Implements features using acceptance-driven workflow with structural gates. Use when user says "build", "implement", "add feature", "create [thing]", "implement F-XXXX", "ag implement", or describes new functionality to build. Do NOT use for: one-line fixes (use fixing-bugs), writing tests only (use writing-tests), code review (use reviewing-code), documentation-only changes (use updating-documentation).
Acceptance-driven feature implementation with structural enforcement gates.
bash .agentic/tools/wip.sh check
Check for spec/acceptance/F-XXXX.md. If it does not exist:
.agentic/spec/acceptance.template.md## Tests section — tests are part of the feature definitionspec/acceptance/F-XXXX.mdIf no feature ID exists yet, create one in spec/FEATURES.md first.
Do NOT write any code until acceptance criteria exist.
Check if spec analysis is enabled:
spec_analysis setting from STACK.md (default: on for formal, off for discovery)bash .agentic/tools/spec-analyze.sh F-XXXXVerify the feature is small batch (max 5-10 files). If larger, break into smaller features first and confirm with user.
bash .agentic/tools/wip.sh start F-XXXX "Description" "file1 file2"
This creates .agentic-state/WIP.md — a lock that prevents premature commits.
CONTEXT_PACK.md for "Where to look first"STACK.md for development_mode (standard or tdd)references/programming_standards.mdbash .agentic/tools/wip.sh checkpoint "Completed step X"
When acceptance criteria have priority groups (P1/P2):
This ensures MVP is solid before adding enhancements.
Then hand off to the committing-changes workflow (do NOT commit directly).
Example 1: Implementing a new CLI command
User says: "Add an ag sync command"
Steps taken:
spec/acceptance/F-0125.md exists — it does, read criteriawip.sh start F-0125 "ag sync command" "ag .agentic/tools/sync.sh"ag scriptwip.sh checkpoint "sync.sh working, tests pass"
Result: Feature implemented, tests passing, ready for commit workflow.Example 2: User describes functionality without a feature ID User says: "Build a dark mode toggle" Steps taken:
Error: wip.sh exits "WIP already active"
Cause: Previous work was interrupted or not completed.
Solution: Run bash .agentic/tools/wip.sh check to see what's in progress. Either complete it (wip.sh complete) or abandon it (wip.sh abandon) before starting new work.
Error: No acceptance criteria found
Cause: Feature work attempted without spec.
Solution: Create spec/acceptance/F-XXXX.md first. Use the template at .agentic/spec/acceptance.template.md.
Error: Scope too large (>10 files) Cause: Feature is too big for one batch. Solution: Break into 3-5 smaller features, each touching max 5-10 files. Confirm decomposition with user.
references/feature_implementation.mdreferences/feature_start.mdreferences/programming_standards.md