Skip to content

feat(feature-runner): implement /implement-feature skill end-to-end#25

Merged
orioltf merged 46 commits into
developfrom
feature/custom-spec-runner
May 11, 2026
Merged

feat(feature-runner): implement /implement-feature skill end-to-end#25
orioltf merged 46 commits into
developfrom
feature/custom-spec-runner

Conversation

@orioltf
Copy link
Copy Markdown
Member

@orioltf orioltf commented May 9, 2026

Summary

Implements the Feature Runner (/implement-feature) end-to-end — the final step that closes the AI-development cycle:

/grill-with-docs → /to-prd → /to-issues → /triage → /implement-feature

Work spans 20 issues (19 resolved, 1 rejected). Issues 01–09 built the skill; issues 10–20 refined it through two write-a-skill reviews and a skill-development review.

What the skill does

/implement-feature <slug> (or no-arg for auto-selection):

  1. Scopes ADRs from PRD path references (plugin vs. repo/tooling); extracts PRD title: frontmatter for the PR title
  2. Creates (or reuses) an isolated feature/afk/<slug> worktree from develop
  3. Reads all NN-*.md files, builds a topological execution order from ## Blocked by, halts on ordering conflicts or unsatisfied ready-for-human dependencies
  4. For each ready-for-agent issue: emits a progress line, invokes /tdd as a general-purpose sub-agent (explicit Skill-tool load) with the full six-part context bundle (issue, PRD, siblings, scoped CONTEXT.md, scoped ADRs, last 5 commits), marks it resolved on success
  5. On /tdd failure: flips the issue to needs-info (preventing loop re-pickup), appends a failure note, stops the runner, leaves the worktree for inspection
  6. When all issues are resolved: opens a PR targeting develop via gh, removes the worktree
  7. No-arg path: auto-selects the first qualifying feature alphabetically (at least one ready-for-agent, no unprepped issues); emits LOOP_COMPLETE when the queue is empty (composable with /loop for overnight draining)
  8. Ctrl+C safe: manual interrupts leave the failing issue at ready-for-agent; only a /tdd failure flips it to needs-info

Issues resolved

  • docs/issues/feature-runner/01-skill-scaffold.md
  • docs/issues/feature-runner/02-failure-handling.md
  • docs/issues/feature-runner/03-pr-creation.md
  • docs/issues/feature-runner/04-progress-reporting.md
  • docs/issues/feature-runner/05-full-context-bundle.md
  • docs/issues/feature-runner/06-dependency-graph.md
  • docs/issues/feature-runner/07-auto-selection.md
  • docs/issues/feature-runner/08-feature-runner-docs.md
  • docs/issues/feature-runner/09-retry-on-tdd-failure.md (rejected)
  • docs/issues/feature-runner/10-references-split.md
  • docs/issues/feature-runner/11-quick-start.md
  • docs/issues/feature-runner/12-heredoc-note-in-references.md
  • docs/issues/feature-runner/13-tdd-prompt-template-in-references.md
  • docs/issues/feature-runner/14-smarter-auto-select.md
  • docs/issues/feature-runner/15-ready-for-human-unsatisfied-dependency.md
  • docs/issues/feature-runner/16-explicit-tdd-skill-invocation.md
  • docs/issues/feature-runner/17-prd-title-extraction-step-1.md
  • docs/issues/feature-runner/18-failure-loop-protection.md
  • docs/issues/feature-runner/19-skill-agents-doc-crosslink.md
  • docs/issues/feature-runner/20-prompt-template-and-step-cleanup.md

Test plan

  • Run /implement-feature with no arg on an empty queue and verify LOOP_COMPLETE output
  • Run /implement-feature with no arg on a queue with one ready feature and verify auto-selection
  • Run /implement-feature <slug> on a feature with ready-for-agent issues and verify the full lifecycle (worktree, branch, issues resolved, PR opened)
  • Simulate a /tdd failure mid-feature and verify the issue flips to needs-info, the runner stops, subsequent issues are untouched, and a re-run after manual fix resumes correctly
  • Verify a plugin-scoped PRD injects only plugin ADRs, not root ADRs
  • Run /loop /implement-feature on a two-feature queue and verify both are processed sequentially then LOOP_COMPLETE fires

🤖 Generated with Claude Code

orioltf and others added 30 commits May 9, 2026 01:16
Issues in pr-review-rereview, pr-review-doc-context-enrichment,
pr-review-doc-context-spawn-reliability, and inbox-collision-check
were completed through docs/plans/ specs but never advanced past
resolved in the issue tracker.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Parallel terms to Spec / Spec Runner, grounded during the
feature-runner grilling session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three ADRs capturing decisions reached during the Feature Runner PRD
grilling session:

- 0027: context bundle injected into every /tdd sub-agent invocation,
  with domain-scoped ADR and CONTEXT.md selection
- 0028: ## Blocked by as canonical sequencing signal; topological order
  over numerical filename order; halt on conflict
- 0029: AFK invocation via Agent tool; acceptance criteria replace
  /tdd's interactive planning phase; LOOP_COMPLETE as stop signal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merges five decisions from the /grill-with-docs session into the
Feature Runner PRD:

- Context bundle: /tdd sub-agents receive issue + PRD + siblings +
  CONTEXT.md + scoped ADRs + recent commits, not just the issue file
- ADR scoping: plugin ADRs for plugin features, root ADRs for tooling;
  inferred from PRD path references
- AFK invocation: Agent tool is non-interactive; acceptance criteria
  replace /tdd's planning phase
- Sequencing: ## Blocked by is the canonical dependency signal;
  topological order over numerical filename order; halt on conflict
- Parallelism: serialisation is an explicit decision, not an omission;
  LOOP_COMPLETE named as the stop signal for /loop composability

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Split Phase 7 in development-workflow.md into Spec Runner and Feature
Runner paths — the two runners are not interchangeable and the previous
single-command entry was misleading. Adds /implement-feature, /loop
composability, and LOOP_COMPLETE to the quick reference table.

Adds ai-development.md: a narrative deep guide covering the mental
model behind the workflow — two-runner architecture, pipeline quality
gates, the correct-but-wrong failure mode, context bundle design, AFK
trust chain, ## Blocked by sequencing, overnight draining, and
CONTEXT.md/ADR maintenance. Complements the quick-reference workflow
doc with the reasoning behind the decisions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Breaks the Feature Runner PRD into 8 vertical slices, all triaged to
ready-for-agent:

  01 — skill scaffold and minimal execution loop (tracer bullet)
  02 — failure handling (blocks on 01)
  03 — PR creation and worktree cleanup (blocks on 02)
  04 — progress reporting (blocks on 01)
  05 — full context bundle (blocks on 01)
  06 — dependency graph and topological ordering (blocks on 01)
  07 — auto-selection and LOOP_COMPLETE (blocks on 01)
  08 — docs/agents/feature-runner.md (blocks on 03–07)

## Blocked by is the canonical dependency signal per ADR-0028.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates .claude/skills/implement-feature/SKILL.md — the tracer-bullet
happy path for the Feature Runner: worktree creation, issue filtering
by status, sequential /tdd sub-agent invocation, and resolved marking.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… (issue 02)

On /tdd sub-agent failure: appends a failure note under ## Comments,
leaves the issue at ready-for-agent, stops the runner, and surfaces a
clear message to the user. The worktree is left in place for inspection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After all issues resolve, the skill pushes the branch, opens a PR
targeting develop via gh CLI (title from PRD frontmatter, body listing
resolved issues), then removes the worktree. Failure path from 02
prevents this step from running on a broken feature.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ll (issue 04)

Before each /tdd invocation the runner outputs "Implementing issue N of M:
<title>". M is frozen at run start from the ready-for-agent queue count,
so the progress line is accurate regardless of failures or mid-run state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…c (issue 05)

Step 1 now detects plugin vs. repo scope from PRD path references and
gathers CONTEXT.md, scoped ADRs, and last-5 commits once before the
loop. Step 4 reads sibling issues at invocation time and assembles the
full six-part context bundle for each /tdd sub-agent call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dering (issue 06)

Step 3 now reads all NN-*.md files (including resolved/closed), parses
## Blocked by edges, checks for conflicts where a blocker has a higher
NN than the issue it blocks, and derives a topological execution order.
Resolved/closed issues satisfy dependencies but are not re-executed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nal (issue 07)

Step 0 handles the no-argument path: scans docs/issues/ for features
where every NN-*.md is ready-for-agent, selects the first alphabetically,
and runs it. Emits LOOP_COMPLETE on an empty queue so /loop terminates
cleanly. Partial features (mixed statuses) are skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ument (issue 08)

Covers the full lifecycle (selection → worktree → tdd loop → PR → closed),
the six-part context bundle with ADR scoping rationale, ## Blocked by
ordering and conflict behaviour, failure handling, and the historical
cleanup convention for Spec Runner overlap. No duplication of issue-tracker.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Grilled and rejected. Both failure modes that could trigger a retry are
not worth automating: Agent tool errors have unpredictable resolution
windows, and sub-agent failures mean /tdd already exhausted its own
loop — both call for human review, not an automated retry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds two ready-for-agent issues identified during a post-implementation
skill review and grilling session: extract verbatim output strings to a
references file (10), and add a Quick start section to SKILL.md (11).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…es file (issue 10)

Creates references/runner-output-formats.md with all five canonical
strings (progress line, conflict error, failure note, PR body, LOOP_COMPLETE).
SKILL.md references the file by name, dropping from 213 to 171 lines.
Procedural logic is unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds three annotated invocation patterns (named run, auto-select,
overnight loop) between the opening paragraph and ## Steps, so users
can orient themselves before reading the full procedure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two ready-for-agent issues identified after issues 10–11 were resolved:
add heredoc wrapping note to the PR body template in references (12),
and extract the /tdd prompt template to its own references file (13).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…issue 12)

The PR body template section in runner-output-formats.md now shows the
complete gh pr create command with heredoc wrapper so agents know how
to pass the multiline body. No changes to SKILL.md or other sections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…file (issue 13)

Creates references/tdd-prompt-template.md with the full AFK prompt.
Step 4 of SKILL.md replaces the 23-line inline block with a one-sentence
reference. SKILL.md drops from 177 to 151 lines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All 14 child issues spawned; 12 resolved, 1 rejected, 1 ready-for-agent.
PRD has fulfilled its spec purpose and will close when issue 14 merges.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…features

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-person format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Auto-select now picks up partially-completed features (resolved + ready-
for-agent mix) and skips only features with unprepped issues (needs-triage,
needs-info, needs-specs) or no ready-for-agent work left. Step 2 checks
for an existing worktree and reuses it instead of re-running git worktree
add. Updates SKILL.md and docs/agents/feature-runner.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… and feature-runner docs

resolved/closed/rejected satisfy dependents; ready-for-human does not — halt if a
ready-for-agent issue depends on one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ied dependency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…(issue 15)

Adds an explicit unsatisfied dependency check to step 3: if any ready-
for-agent issue's blocker is ready-for-human, the runner halts before
executing anything. Adds the error format to runner-output-formats.md.
rejected blockers remain satisfied and do not trigger a halt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…l review)

Add interrupt-safety bullet to Quick Start and a Supporting Documentation
section listing the two references/ files. Correct the PRD triage comment
to reflect 15 issues (not 14) and remove the stale PR-merge condition.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants