Work
Use this skill when there is a plan path or tightly scoped bare prompt ready for execution.
See shared pipeline instructions for model routing and pipeline behavior.
Core rules
- Load project rules before writing any code: detect language via repo markers (map in Workflow step 2), then load
rules/common/development-workflow.md, rules/common/testing.md, matching rules/{lang}/ files, plus rules/web/ for frontend/browser concerns. Emit a Rules loaded: manifest — no manifest, no implementation
- Priority: project-level
{repo-root}/rules/ overrides package defaults
- Distinguish input: plan path vs bare prompt
- Derive tasks from plan implementation units
- Execution mode: inline mode — all plan units execute inline in the current session. No built-in subagent tools.
- Use
session_checkpoint to track progress and enable resume; before executing a plan, flip its Status header to executing
- Use
task_splitter to analyze dependencies before execution
- If in worktree (via
07-worktree), execute inside it
- End by recommending
04-review
- When designing/restructuring modules, use the deep-module vocabulary (
../references/module-design.md) — evaluate depth and seam placement.
- Continuous execution: do not pause between units for confirmation. Progress goes to
session_checkpoint; report once at completion. Four — and only four — valves may stop and ask: (1) stop-the-line failure that cannot self-heal, (2) 3-failure cap on the same unit, (3) destructive or irreversible operations (delete, overwrite, force-push, or anything without an undo path), (4) spec ambiguity or plan gap discovered mid-execution — record as blocker, ask, never guess. Do not automate past any valve.
Advanced: If you need external child agent delegation (background runs, parallel audits), install pi-subagents separately. Super Pi does not require it.
Hard gates — TDD enforcement
Every step follows RED → GREEN → REFACTOR:
Blocking violations — stop and ask if:
- Code written before RED test
- RED fails for wrong reason
- Missing evidence test failed before implementation
- Missing evidence test passed after implementation
- Tests added only after code
Stop-the-line rule (Hard gate)
When any unexpected failure occurs during execution:
- STOP adding features or making changes
- PRESERVE evidence (error output, repro steps)
- DIAGNOSE root cause — follow debug discipline (
references/debug-discipline.md): build feedback loop first, then reproduce → hypothesise → instrument → fix
- FIX the root cause, not the symptom
- GUARD with a regression test
- RESUME only after verification passes
Anti-rationalization — when a gate fails or evidence is missing:
- Do not rationalize, downgrade, or explain away the failure.
- Stop, report the blocker with evidence, and either fix the root cause or ask for direction.
- Do not continue unrelated implementation after failed verification.
Common rationalizations and their reality:
| Excuse |
Reality |
| "Close enough — the gate almost passed" |
A failed gate means not done. Fix it or stop and report; those are the only exits. |
| "One more retry will converge" |
Past the 3-failure cap, retries do not converge — the failure is structural. Ask for direction. |
| "The fix is tiny, skip re-verification" |
Unverified fixes are how regressions land. Every fix ends with verification. |
| "This failure is a special case" |
No evidence, no exception. Treat it like every other failure. |
This is a hard gate — do not push past a failing test or broken build to continue implementation. Errors compound.
Error compaction after recovery
After a stop-the-line failure is diagnosed, fixed, and verified:
- Replace full traces with
ERROR(resolved): <root cause>; keep only the final repro, root cause, fix summary, and verification result
- Remove stale debug output and failed exploratory runs; update
session_checkpoint with the compacted state only
If the same tool, command, or implementation unit fails 3 consecutive times, stop retrying and ask the user for direction with a concise evidence summary.
Workflow
- Load context: consume latest handoff before any broad file reads —
context_handoff load or read .context/compound-engineering/handoffs/latest.md. If found, use activeFiles, blocker, verification, activeRules as starting point; activeRules may already list loaded rules — verify against the repo, do not blindly trust. If not found, proceed normally. Read CONTEXT.md if it exists at root — see ../references/domain-language.md.
- Load project rules (blocking — no implementation before this completes):
- Detect language: merge
{repo-root}/rules/language-detection.md (project-level map, same marker wins) with the built-in table: tsconfig.json/package.json→typescript, Cargo.toml→rust, go.mod→golang, pyproject.toml/requirements.txt→python; others in language detection
- Check
{repo-root}/rules/ first (overrides package defaults); then load rules/common/development-workflow.md, rules/common/testing.md, matching rules/{lang}/ files, rules/web/ only for frontend/browser concerns
- Emit manifest before any code:
Rules loaded: language=<lang> (via <marker>[, project-level map]), common=<files>, lang=<files>, web=<files or N/A>
- Same-session re-entry: if the transcript already contains a
Rules loaded: manifest for the same language, do not re-read the rule files — reuse them, cite the earlier manifest, and note the skip
- Detect input type (plan path vs bare prompt)
- Read implementation units if plan path
- Load
session_checkpoint to skip completed units
- Use
task_splitter for dependency analysis
- Execute: inline mode — all units run in the current session
- Follow TDD per unit: RED → minimal code → GREEN → refactor → unit-level verification
- Source-driven gate: Before implementing framework/library-specific code, verify the API or pattern against official documentation. Flag unverified patterns as UNVERIFIED in output.
- Record progress via
references/progress-update-format.md
- Save
session_checkpoint after each unit
- On failure:
session_checkpoint fail → retry → follow strategy
- Provide completion report (see
references/completion-report.md) — include the Rules applied section
- Save handoff:
context_handoff save with current stage, next stage, activeFiles, blocker, verification, activeRules (carry loaded rules in activeRules)
- Handoff to
04-review using references/handoff.md
Before finishing this skill, apply the completion checklist in shared pipeline instructions.
1---2name: 03-work3description: Execute plan units with TDD enforcement and checkpoint resume. Use when a plan path is ready for implementation.4---56# Work78Use this skill when there is a plan path or tightly scoped bare prompt ready for execution.910See [shared pipeline instructions](../references/pipeline-config.md) for model routing and pipeline behavior.1112## Core rules13141. Load project rules before writing any code: detect language via repo markers (map in Workflow step 2), then load `rules/common/development-workflow.md`, `rules/common/testing.md`, matching `rules/{lang}/` files, plus `rules/web/` for frontend/browser concerns. Emit a `Rules loaded:` manifest — **no manifest, no implementation**152. **Priority:** project-level `{repo-root}/rules/` overrides package defaults163. **Distinguish input:** plan path vs bare prompt174. Derive tasks from plan **implementation units**185. **Execution mode:** **inline mode** — all plan units execute inline in the current session. No built-in subagent tools.196. Use **`session_checkpoint`** to track progress and enable resume; before executing a plan, flip its Status header to `executing`207. Use **`task_splitter`** to analyze dependencies before execution218. If in **worktree** (via `07-worktree`), execute inside it229. End by recommending `04-review`2310. When designing/restructuring modules, use the deep-module vocabulary (`../references/module-design.md`) — evaluate depth and seam placement.2411. **Continuous execution:** do not pause between units for confirmation. Progress goes to `session_checkpoint`; report once at completion. Four — and only four — valves may stop and ask: (1) stop-the-line failure that cannot self-heal, (2) 3-failure cap on the same unit, (3) destructive or irreversible operations (delete, overwrite, force-push, or anything without an undo path), (4) spec ambiguity or plan gap discovered mid-execution — record as blocker, ask, never guess. Do not automate past any valve.2526> **Advanced:** If you need external child agent delegation (background runs, parallel audits), install `pi-subagents` separately. Super Pi does not require it.2728## Hard gates — TDD enforcement2930Every step follows **RED → GREEN → REFACTOR**:3132**Blocking violations** — stop and ask if:33- Code written before RED test34- RED fails for wrong reason35- Missing evidence test failed before implementation36- Missing evidence test passed after implementation37- Tests added only after code3839## Stop-the-line rule (Hard gate)4041When any unexpected failure occurs during execution:42431. **STOP** adding features or making changes442. **PRESERVE** evidence (error output, repro steps)453. **DIAGNOSE** root cause — follow debug discipline (`references/debug-discipline.md`): build feedback loop first, then reproduce → hypothesise → instrument → fix464. **FIX** the root cause, not the symptom475. **GUARD** with a regression test486. **RESUME** only after verification passes4950Anti-rationalization — when a gate fails or evidence is missing:51- Do not rationalize, downgrade, or explain away the failure.52- Stop, report the blocker with evidence, and either fix the root cause or ask for direction.53- Do not continue unrelated implementation after failed verification.5455Common rationalizations and their reality:5657| Excuse | Reality |58|--------|---------|59| "Close enough — the gate almost passed" | A failed gate means not done. Fix it or stop and report; those are the only exits. |60| "One more retry will converge" | Past the 3-failure cap, retries do not converge — the failure is structural. Ask for direction. |61| "The fix is tiny, skip re-verification" | Unverified fixes are how regressions land. Every fix ends with verification. |62| "This failure is a special case" | No evidence, no exception. Treat it like every other failure. |6364This is a hard gate — do not push past a failing test or broken build to continue implementation. Errors compound.6566## Error compaction after recovery6768After a stop-the-line failure is diagnosed, fixed, and verified:69701. Replace full traces with `ERROR(resolved): <root cause>`; keep only the final repro, root cause, fix summary, and verification result712. Remove stale debug output and failed exploratory runs; update `session_checkpoint` with the compacted state only7273If the same tool, command, or implementation unit fails 3 consecutive times, stop retrying and ask the user for direction with a concise evidence summary.7475## Workflow76771. **Load context**: consume latest handoff before any broad file reads — `context_handoff load` or read `.context/compound-engineering/handoffs/latest.md`. If found, use `activeFiles`, `blocker`, `verification`, `activeRules` as starting point; `activeRules` may already list loaded rules — verify against the repo, do not blindly trust. If not found, proceed normally. Read `CONTEXT.md` if it exists at root — see `../references/domain-language.md`.782. **Load project rules** (blocking — no implementation before this completes):79 - Detect language: merge `{repo-root}/rules/language-detection.md` (project-level map, same marker wins) with the built-in table: `tsconfig.json`/`package.json`→typescript, `Cargo.toml`→rust, `go.mod`→golang, `pyproject.toml`/`requirements.txt`→python; others in [language detection](../references/language-detection.md)80 - Check `{repo-root}/rules/` first (overrides package defaults); then load `rules/common/development-workflow.md`, `rules/common/testing.md`, matching `rules/{lang}/` files, `rules/web/` only for frontend/browser concerns81 - Emit manifest before any code: `Rules loaded: language=<lang> (via <marker>[, project-level map]), common=<files>, lang=<files>, web=<files or N/A>`82 - **Same-session re-entry:** if the transcript already contains a `Rules loaded:` manifest for the same language, do not re-read the rule files — reuse them, cite the earlier manifest, and note the skip833. Detect input type (plan path vs bare prompt)844. Read implementation units if plan path855. Load `session_checkpoint` to skip completed units866. Use `task_splitter` for dependency analysis877. Execute: **inline mode** — all units run in the current session888. Follow TDD per unit: RED → minimal code → GREEN → refactor → unit-level **verification**899. **Source-driven gate:** Before implementing framework/library-specific code, verify the API or pattern against official documentation. Flag unverified patterns as UNVERIFIED in output.9010. Record progress via `references/progress-update-format.md`9111. Save `session_checkpoint` after each unit9212. On failure: `session_checkpoint` `fail` → `retry` → follow strategy9313. Provide completion report (see `references/completion-report.md`) — include the `Rules applied` section9414. **Save handoff**: `context_handoff save` with current stage, next stage, activeFiles, blocker, verification, activeRules (carry loaded rules in `activeRules`)9515. Handoff to `04-review` using `references/handoff.md`9697Before finishing this skill, apply the completion checklist in [shared pipeline instructions](../references/pipeline-config.md).