This example shows the full handoff loop on a small feature so the workflow is concrete instead of abstract.
You want to add a --json flag to an existing CLI command.
handoff init json-outputThis creates the workspace:
.handoff/
current -> features/json-output
features/json-output/
FEATURE.md
SPEC.md
DESIGN.md
STATE.md
SESSION.md
DECISIONS.md
Start with .handoff/current/FEATURE.md.
Example:
# Feature: json-output
## Goal
Add a `--json` flag to `handoff status` so scripts can consume the current state.
## Requirements
- Preserve the existing human-readable output by default.
- Return deterministic JSON keys.
- Fail with a clear error if no active feature exists.
## Non-Goals
- Do not redesign `handoff status`.
- Do not add network behavior.For most features, use:
handoff run --copyhandoff run decides what prompt comes next:
- if planning is incomplete, it emits a planning prompt
- if the execution plan is ready, it emits an execution prompt
Use:
handoff next
handoff statusto see the current state without generating another prompt.
After planning, the feature workspace should converge toward:
SPEC.md: clear behavioral requirements and acceptance criteriaDESIGN.md: optional implementation notes when the change is complex enoughSTATE.md: execution plan with exactly one[>]current step while work remainsSESSION.md: continuation-safe summary of what changed and what comes nextDECISIONS.md: durable decisions that should survive future sessions
Example execution plan:
# Current Step
Implement JSON serialization for `handoff status`.
# Execution Plan
- [x] Add CLI flag parsing for `--json`.
- [>] Return JSON output from the status command.
- [ ] Add tests for no-active-feature and healthy-status cases.Once the plan is ready, either:
handoff run --copyor:
handoff start --copy
handoff continue --copyUse run when you want handoff to choose automatically.
Use start and continue when you want to drive the execution flow directly.
During implementation:
- mark completed steps as
[x] - record evidence in
STATE.mdfor completed steps - keep exactly one
[>]if work remains - rewrite
SESSION.mdafter meaningful progress - update
DECISIONS.mdwhen a durable product or architecture choice changes - use
handoff validatewhen you need a hard readiness check
When all planned steps are done:
- every execution step should be
[x] - completed steps should include evidence for changed files and validation
SESSION.mdshould summarize what shipped and any follow-up itemshandoff nextshould stop pointing to more execution work
Use handoff drift --copy if you want an audit prompt that compares the saved spec, plan, session, decisions, and implementation before closing the feature.
The product is not just “prompt generation.”
The value is the saved state on disk:
- the feature brief survives
- the plan survives
- the execution ledger survives
- the continuation context survives
- the decision history survives
That is what lets a later AI session resume without starting over.