M plugins/spire/CHANGELOG.md M plugins/spire/skills/gremlins/SKILL.md M plugins/spire/skills/implementation/SKILL.md M plugins/spire/skills/implementation/references/known-failures.md
7.7 KiB
name, description
| name | description |
|---|---|
| implementation | Drive implementation lean — test the plan against the code before building, build in large blocks with a cheap gate between them, run tests once per phase, review at the build plan's review points, 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. Composes with `quire`. |
Implementation
Governs driving a build, not writing code. Lean: few checks, each sized to its risk; extra ceremony needs a stated reason. Lean is the route, not the scope: how much capability is built is the Scope: level (spire:project). Most defects trace to the plan: castigate it before building. Change fits one agent in one go: inline, no cycle.
The cycle
plan ─► castigate the plan ─► the one gate: user approves the build plan (none with `Build plan: skip`)
phase: block ─► gate ─► block ─► gate ─► … ─► tests once ─► run log ─► next phase
review point (fresh reviewer) ─► one fix pass ─► re-check only Critical/Important ─► continue or stop
Planner, advocate, builder, reviewer: four different agents. Under Igor: Igor dispatches plan and castigation; the Athanor runs the build plan's phases and review points.
Castigate the plan (alias: attack)
A fresh agent that did not write the plan tests it adversarially against the code: blockers, design errors, wrong root causes, missed consumers of changed semantics (other readers, stats, migrations, callers in other crates). Reach: every direct reader or caller of what the change touches; further only where the changed meaning is passed on.
Same pass reshapes it: phases each ending testable, blocks one owner can finish, scope fitted to the goal at its Scope: level, defaults taken and blocking decisions listed. Output: a new build plan file; the original stays. Before the castigate the planner may amend its plan in place; after it, changes go to a new file.
- Plan written before earlier phases landed: castigate against current code; read the previous run log and review only when something is off.
- The build plan sets defaults (block size, owner model per block, gate per block, what may stay broken between blocks) and places the review points.
- Its risk list shapes the build, never a reviewer's scope (a reviewer handed a checklist confirms the checklist).
- Plan altitude: decisions, code structure, contracts, invariants, scope fence. Code only where its exact form is the decision (schema, wire format, state machine, main signatures); every plan line of code becomes a build obligation.
Building a phase
- Sequence by default. Parallel only for truly disjoint work: separate files with no behavioural coupling, read-only exploration, separate test suites. Independence needs hard thought: sequence.
- One owner per coherent change. Never split one logical change across agents.
- Hand over as commits. Each block commits and adds a short handoff note to the run log (template:
references/run-log.md); flags reach the reviewer through it. - Between blocks: a cheap gate, not a review. Compile or typecheck what the block owns. Test suite once, at phase end; the last block fixes the fallout.
- Tests: one per behaviour and failure path the plan names, not one per branch. Never cut a test a plan box needs to save size.
- Decisions belong before the run. Inside it: conservative default, flag in the handoff note, continue; never wait on the user.
- Deviate with a reason. Splitting a block, changing an owner on information the plan lacked, adding a check: allowed, logged with why.
Context: fresh, gremlin, or keep
Trade-off: many tiny fresh implementers relearn the code and fragment the plan; one kept across many tasks bloats and drifts. Choose per block by shared understanding needed and context room left (references/models.md figures are guesstimates).
Trunk and gremlins: at build start the code the build touches (the trunk) is read once into short trunk notes. A headless base is trained on it; each complex block in its area goes to a gremlin forked from the base (spire:gremlins; call sequence: agents/athanor.md step 2). Mechanical or distant blocks: a fresh Agent-tool agent reading the trunk notes. Verified vs assumed harness behaviour: ${CLAUDE_PLUGIN_ROOT}/providers/runtimes/claude-code/spawning.md. If ${CLAUDE_PLUGIN_ROOT} appears literally, it is the folder two levels above this SKILL.md (<this file's dir>/../..); resolve it there and do not search elsewhere.
Review, fix, stop
- Review points: placed by the build plan, at most one per phase (one may span phases), each with a one-line reason (a risk area, or "end"). Opus 5.5 owners on complex blocks: one for the build plus one per risk area (auth, file access, deletion, rendering, security). Sonnet or Haiku owners: up to one per phase.
- Reviewer: fresh, owned no block in scope, dispatched by the Athanor (by Igor only where no point covers the work). Rules:
agents/reviewer.md. - Adversarial: runs the gates, traces concrete scenarios, reads every flag in the handoff notes (answers one only where it changes a finding or verdict). In the diff in scope it reports as findings every weakened check (loosened assertion, downgraded error, deleted test) and every test that cannot fail.
- Ends with a short size and unrequested surface section: size next to the plan's estimate, with a cause where far over; what lies beyond the boxes at the
Scope:level. Reviewer lists; Igor and the user decide after the run. - One fix pass over all findings. Minors: fixed in that pass or logged as follow-ups.
- Re-check only Critical and Important, by a fresh reviewer scoped to those findings; then the review tree's branch 2 (
skills/igor/SKILL.md): continue, second pass, or stop.
Bugs
- Failing test first when you would say "I think the issue is…"; it stays as a guard. Can't write it: investigate further. Still won't reproduce: fix on the evidence, say so in the handoff note. Skip for obvious bugs.
- Explore before you focus when the cause is not plain: one or two layers up, recent commits in the area, where the pattern recurs, reproduce end to end before changing anything. Stop once you can name the cause.
Spawning and models
- Read
${CLAUDE_PLUGIN_ROOT}/providers/runtimes/claude-code/spawning.mdbefore dispatching; its Rules of thumb own the harness rules. Host layers:${CLAUDE_PLUGIN_ROOT}/providers/README.md. - Model traits:
references/models.md(dated observations, not law). - Known failures:
references/known-failures.md; add a dated line when one recurs.
Writing things down
Placement: quire skill.
plans/: plan, build plan.logs/<run>/: run log, trunk notes, reviews, re-checks. Scratch: raw output (tiers:quire).- Record of a run: the run log and session journals. Times from
date, durations from git, never from feel. - Journal a hard bug as you go, dead ends included.
- Promote invariants other code will rely on (event shapes, error codes, state transitions) to
specs/.
Project settings
Source: spire:project ## Build section (project.local.md wins over project.md). Unset = this skill's default; none = deliberately absent. A brief overrides both. Settings: 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, time limits), build-plan gate (shown, or skip).
Composition
quire: document placement.research-tree: first, when how to build is itself an open question.- Out of scope: code style, test frameworks, CI, plan formats.