🤖 Rewrite implementation skill and Athanor for lean building

The implementation skill now states the lean loop: attack the plan
against the code before building, build phases in blocks with a cheap
gate between them, test and review once per phase, one fix pass, stop.
Harness mechanics, model observations and the run-log template move to
references with dated, sourced claims.

The Athanor becomes a build furnace pinned to claude-opus-5-5: one phase
per turn, no planning, no plan attack, no self-review. It no longer
preloads superpowers; those skills stay available as tools.
This commit is contained in:
2026-10-05 22:12:31 +02:00
parent 08e22a731d
commit e51520723c
5 changed files with 283 additions and 72 deletions
+52 -48
View File
@@ -1,81 +1,85 @@
---
name: implementation
description: Orchestrate non-trivial implementation work across one or more agents — deciding what to do inline, what to delegate, in what order, and how to verify. Use this skill whenever the user asks you to "implement", "build", "ship", "fix this bug", "make this work", or hands you a plan / spec / ticket to execute. Trigger especially for multi-step changes, anything involving compilation or test failures, hard-to-reproduce bugs, or work that spans multiple files or subsystems. Composes with the `workpad` skill (for any plans / journals / reports produced) and runs alongside `superpowers` and similar orchestration helpers.
description: Drive implementation lean — test the plan against the code before building, build in large blocks with a cheap gate between them, run tests and one review per phase, fix once, stop. Use whenever the user asks to "implement", "build", "ship", "fix this bug", or hands you a plan / spec / ticket to execute, especially for multi-step or multi-file changes and hard bugs. Harness mechanics and model notes live in references/. Composes with `workpad`; superpowers skills are optional tools.
---
# Implementation Orchestration
# Implementation
This skill is about **how to drive implementation work**, not about how to write code. It covers: when to delegate to subagents vs. work inline, how to sequence agents, how to handle test/compile failures, and how to approach bugs without thrashing.
How to drive building, not how to write code. The default is lean: few, strong checks placed where the risk is. Every check re-reads the same code, so one check sized to the risk beats several small ones. More ceremony is allowed when you can say why.
**Cycle context:** This skill governs what happens inside Stage 5 (Implement) of the development cycle. The Athanor receives a plan, not a conversation — no mid-run questions. Its output (diff + plan reference) goes to a fresh reviewer for Stage 6 (Review).
The plan is the main lever. Most defects trace back to the plan, not to the model that drafted the code. So quality control moves upstream: attack the plan before building, then build in large chunks and review once per phase.
## Default to sequence, not parallel
If one agent can do the whole change in one go, do it inline. The cycle below is for work that does not fit.
Implementation work is almost always **sequential** by nature — later changes depend on earlier ones, even when they look independent on paper. Two agents editing the same file in parallel is a merge conflict; two agents touching adjacent abstractions in parallel is a subtle integration bug.
## The cycle
Run subagents in parallel only when the work is **genuinely** parallelizable:
- Touching disjoint files / modules with no behavioral coupling.
- Independent investigations or read-only exploration.
- Test runs across separate test suites.
```
plan ─► attack the plan ─► user sees the reshaped plan and open decisions
phase: block ─► gate ─► block ─► gate ─► … ─► tests once ─► run log
phase review (fresh) ─► one fix pass ─► re-check only Critical/Important ─► stop ─► next phase
```
If you have to think hard about whether two tasks are independent, they probably aren't. Default to sequencing.
Separate the roles: the planner, the attacker, the builder and the reviewer are different agents. Under Igor, Igor dispatches the plan, the attack and every phase review; the Athanor builds one phase per turn.
## Delegate compile / test fixes — but verify
## Attack the plan
A common, useful pattern: when the build is broken or tests are failing after a change, dispatch a subagent to fix it. They're tight, well-scoped tasks with a clear pass/fail signal, and they free up the main thread for higher-level decisions.
After the plan is written, a fresh agent that did not write it **tests it adversarially against the code**: blockers, design errors, wrong root causes, and consumers of changed semantics the plan missed (other readers, stats, migrations, callers in other crates). In the same pass it **reshapes** the plan: phases that each end in a testable state, blocks that one owner can finish, scope cut back to the goal, decisions the user must make listed. It writes a new build plan; the original stays as written.
But: **always verify the fix yourself before trusting it.** Subagents fixing tests have a strong incentive to make the test pass, and the easiest way to make a test pass is sometimes the wrong way (deleting the assertion, weakening the expected value, mocking out the thing being tested, catching-and-ignoring the failing path). When the agent reports green:
This step is what pays for dropping per-task review. A plan checked against the code catches in minutes what many small reviews would find one by one, or not at all. Without it, lean is just less review.
1. Read the diff they produced — not just the report.
2. Confirm the fix matches the intent of the original test, not just its letter.
3. Re-run the relevant tests yourself if there's any doubt.
The build plan sets defaults: block size, owner model per block, the gate per block, what may stay broken between blocks. It may place an extra review at a hotspot if it says why. Its risk list shapes the build. It is not the phase reviewer's scope: a reviewer handed a checklist tends to confirm the checklist.
If you can't tell from the diff whether the fix is real, push back. "Tests pass" from a subagent is a hypothesis, not a conclusion.
Plan-writing tools are swappable (superpowers `writing-plans` today; others later). The attack is the same whichever wrote the plan.
## Bugs: prove before fixing, explore before focusing
## Building a phase
Two patterns that prevent the worst kinds of bug-fix thrash.
- **Sequence by default.** Later changes depend on earlier ones, even when they look independent. Run in parallel only for truly disjoint work: separate files with no behavioural coupling, read-only exploration, separate test suites. If you have to think hard about independence, sequence.
- **One owner per coherent change.** Do not split one logical change across agents; they fight over the boundary.
- **Hand over as commits, not descriptions.** Each block commits and adds a short handoff note to the run log (template: `references/run-log.md`). The note is how flags reach the reviewer.
- **Between blocks, a cheap gate, not a review.** Compile or typecheck what the block owns. Run the test suite once, at phase end, and fix the fallout in that last block.
- **Decisions belong before the run.** Inside it, take the conservative default, flag it in the handoff note and continue. Do not wait on the user.
- **Deviate with a reason.** Splitting a block, changing an owner model, adding a check: allowed, logged with why.
**Hard bugs should be proven by a test first.** Before changing production code to fix a bug, write the test that reproduces the bug and watch it fail. This does three things at once: it confirms you actually understand the bug, it gives you an unambiguous signal when the fix works, and it leaves a regression guard behind. If you cannot write a failing test, you do not yet understand the bug well enough to fix it — keep investigating.
## Context: fresh, fork, or keep
For trivial / obvious bugs (typo, off-by-one in an unambiguous spot, missing null check), skip this. The test-first rule is for anything you'd describe as "I think the issue is…" rather than "the issue is…".
Both extremes have failed. Many tiny fresh implementers relearn the code each time and fragment the plan. One implementer kept across many tasks bloats and drifts. Choose per block: how much shared understanding does it need, and how much room is left? Context figures in `references/models.md` are guesstimates, not limits.
**Bugfixing starts with exploration, not focus.** When handed a bug, the temptation is to dive into the suspected file and start poking. Resist for a few minutes:
One option is **trunk and forks**. At intake the builder reads the build plan and the code it touches (the trunk) and writes short trunk notes. Complex blocks in the trunk's area go to a fork of the builder, which inherits its context and model. Mechanical or distant blocks go to a fresh agent that reads the trunk notes. Which harness behaviour is verified and which is assumed: `references/spawning-claude-code.md`.
- Look at the surrounding code paths, not just the suspected one. Bugs often live one or two layers up from where the symptom manifests.
- Skim recent commits to that area — was something changed recently that might explain it?
- Check whether the same pattern appears elsewhere — if it does, the fix may need to be applied in multiple places, or the abstraction itself is the problem.
- Reproduce the bug yourself end-to-end before changing anything.
## Phase review, fix, stop
A short exploration phase pays for itself many times over against fixing-then-discovering-it-was-the-wrong-place.
- A **fresh** reviewer that did not build the phase, dispatched outside the build, stamps its model id in its report header. A review without a stamped id does not count.
- It is adversarial: it runs the gates, traces concrete scenarios, and **answers every deviation and flag in the handoff notes**, one by one. It looks specifically for **weakened checks** (loosened assertions, downgraded errors) and **tests that cannot fail**.
- **One fix pass** over all findings. Minors are fixed in that pass or logged as follow-ups.
- **Re-check only Critical and Important**, by a fresh reviewer scoped to those findings. Then stop.
- Extra reviews (for example a mid-phase review of a hotspot block whose note flags a deviation) are a choice with a stated reason, not a default.
## Sequencing implementation agents
## Bugs
When a task needs multiple implementation agents, plan the sequence before launching:
- **Prove it with a failing test first** when you would say "I think the issue is…". It confirms you understand the bug, signals when the fix works, and stays as a guard. If you cannot write the failing test, keep investigating. Skip this for obvious bugs.
- **Explore before you focus.** Look one or two layers up from the symptom, skim recent commits in the area, check where the same pattern recurs, reproduce end to end before changing anything.
1. **One agent owns each coherent change.** Don't split a single logical change across two agents — they'll fight over the boundary.
2. **Each agent receives the changes from the previous one as committed code, not as a description.** Either commit between agents or hand the diff over explicitly.
3. **Run tests between agents, not just at the end.** Catching a regression at agent N+1 is much cheaper than catching it at agent N+5.
4. **The orchestrator (you) is responsible for keeping the high-level plan coherent.** Subagents see only their slice.
## Spawning and models
For changes small enough that a single agent could do the whole thing, just do it inline. The orchestration overhead is only worth paying when the work genuinely doesn't fit.
- Read `references/spawning-claude-code.md` before dispatching. In short: sequential work runs in the foreground; resume agents only from the session root; leaf briefs say "do this yourself; do not dispatch further agents".
- Every plan, handoff note and review stamps the exact model id the agent ran on.
- Model traits are in `references/models.md`: dated observations, not law.
## When to write things down
## Writing things down
Use the `workpad` skill for placement. The implementation-specific cases:
Use the `workpad` skill for placement.
- **Plan first** for anything more than a few files or a few hours of work. Write it to `plans/` and confirm with the user before touching code. A wrong plan caught at planning time costs minutes; caught at code-review time costs days.
- **Journal a hard bug** — long bug hunts with multiple dead ends should be captured in `journals/` as you go (append-only). The journey is the value; the final fix alone won't tell future-you why obvious-looking alternatives didn't work.
- **Spec frozen contracts.** If implementation reveals an invariant that other code will need to rely on (an event shape, an error code, a state-machine transition), promote it to `specs/` so it doesn't quietly drift.
- The plan and the build plan go to `plans/`, the run log and review reports to `reports/`.
- The run log and the session journals are the record of a run. Take times from `date` and durations from git, never from feel. Journals are also raw material for later mining (future work).
- Journal a hard bug as you go, dead ends included.
- Promote invariants that other code will rely on (event shapes, error codes, state transitions) to `specs/`.
## Composition with other skills
## Project settings
- **`workpad`** governs where any markdown artifacts go. Defer to it.
- **`research-tree`** is the right tool when the question "how should I implement this" is itself unsettled and decomposes into multiple investigations. Run that first; come back to this skill once you have a plan to execute.
- **`superpowers`** and project-specific skills (e.g. ticket workflows, review skills) layer on top of this — they handle domain specifics; this skill handles the orchestration shape.
Read these from `spire:project`; a brief overrides both the config and this skill: worktrees or one checkout, branch ownership, staging (explicit paths), gate and test commands, owner-model defaults per block kind, standing brief constraints for sensitive areas, host rules (temp dirs, memory caps).
## What this skill does *not* govern
## Composition
- Code style, language conventions, or framework choices — that's the project's call.
- Specific test frameworks, CI configuration, or branch strategy.
- The internal structure of a plan / journal / spec — see `workpad`.
- **`workpad`** decides where documents go. **`research-tree`** comes first when how to build is itself an open question.
- **Superpowers** is a toolbox: `writing-plans`, `test-driven-development`, `systematic-debugging`, `verification-before-completion`, `dispatching-parallel-agents` and others are fine to use. Where one prescribes a per-task review loop or other ceremony, the lean rules here take precedence. `subagent-driven-development` is not the default loop; use it only when a plan asks for per-task review.
- This skill does not govern code style, test frameworks, CI or plan formats.