Implements features using contract-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).
Run ag start F-XXXX "Title" to begin, then follow the CLI prompts.
The CLI checks artifacts, enforces transitions, and emits role-specific guidance.
Key commands:
ag start F-XXXX "Title" — create work item, begin planningag transition F-XXXX <state> — advance when artifacts readyag check F-XXXX — see what's missingag verify F-XXXX — run testsag done F-XXXX — post-merge: doc gate, VERSION bump, state flushag contract check F-XXXX — verify contract assertions passAlways call
ag implement F-XXXXas a CLI command — do NOT start coding directly.ag implementenforces plan-approval gates (Step 0.5), spec checks, and sets up the worktree. Bypassing it breaks the enforcement chain and allows DRAFT plans to reach code.
Run ag intel implement F-XXXX for full conventions and quality checks (or wait — the framework auto-pushes a brief on your first code edit).
Quality knowledge references (consult during implementation):
.agentic/lib/quality_knowledge/security.knowledge.md — OWASP patterns, input validation, injection prevention.agentic/lib/quality_knowledge/code_quality.knowledge.md — clarity, error handling, design for testability.agentic/lib/quality_knowledge/testing.knowledge.md — test methodology (London vs Classical), test doubles, coverage.agentic/conventions.md — universal coding standards (always check).agentic/local/conventions-stack.md — stack-specific rules (if generated by ag quality setup)spec/contracts/F-XXXX.yaml with assertionsspecifying or later (not exploring)user_input exists on the contract, process it first (write tests → implement → migrate → clear)When the user corrects your approach or expresses a preference, capture it:
ag intel remember "what they said" --context "what you were doing"
After making code changes, grep spec/contracts/ for assertions related to the changed behavior. If any are affected, STOP — present the affected assertions to the user and wait for approval before modifying any contract or test. Contracts protect shipped behavior; silently updating them to match new code defeats that protection.
Docs are part of the deliverable — update them alongside code, not after merge.
bash .agentic/lib/tools/docs.sh --check-freshness --trigger feature_done --manifest F-XXXXupdating-documentation skillFor framework development: also update instruction files (CLAUDE.md template, memory-seed, DEVELOPER_GUIDE, HOW_IT_WORKS, etc.) — see DEV-003.
When the agentic-coord MCP server is available and the feature has 2+ acceptance criteria,
delegate each AC to a fresh-context subagent instead of implementing directly. This keeps the
orchestrating session lean and avoids context exhaustion on large features.
Delegation workflow:
list_acs(feature_id) to get criteria and completion statusget_delegation_prompt(feature_id, ac_id) → returns {prompt, model_hint, use_worktree}
b. Spawn: Agent(prompt=result.prompt, model=result.model_hint) — subagent implements in fresh context
c. After return: call MCP save_progress(feature_id, ac_id, status, note) with the result
d. Call MCP get_next_action(feature_id) to determine the next stepget_next_action returns "verify" — delegate verification to another subagentWhen to use:
Retry on failure: If a subagent fails an AC, get_next_action will return it again with
an incremented attempt counter. Prior failure notes are included in the next get_delegation_prompt.
After 3 attempts, report the failure to the user.