skills/implement-feature/SKILL.md
Autonomous feature implementation orchestrator
npx skillsauth add alchemishty/agent-harness implement-featureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Autonomous orchestrator that takes a feature from plan through to merge-ready PR. This is the primary workflow — it coordinates planning, implementation, verification, cleanup, and review.
Accept either:
docs/plans/active/2026-03-07-user-auth.md)If both are ambiguous, ask the human to clarify.
Before anything else, read harness.yaml at the project root. Parse and hold in context:
commands — every command you run comes from hereverification.checks — the pre-commit gate checksverification.max_retries — how many times to retry before escalating (default 3)review.max_review_cycles — how many review cycles before escalating (default 3)review.provider — the review agent (e.g., coderabbit)docs — paths for plans, decisions, architectureenforcement — rules to enforcegardening — post-feature checksAlso read AGENTS.md to understand project-specific agent rules.
If a memory/ directory exists at the project root, read its files to load cross-session learned patterns (common failures, fixes, user preferences). This is cheap context that prevents repeating past mistakes.
Determine the repo owner and name from git remote for use in gh api calls:
git remote get-url origin
/create-plan with the feature description## Steps sectionCreate a task list from the plan steps. Each step becomes a task. Also create completion tasks for post-implementation phases — these ensure cleanup, archival, and retrospective don't get skipped when the user sends ad-hoc requests late in the workflow.
Required tasks:
The completion tasks act as visible reminders. Do NOT mark them complete until the actual work is done — even if the user asks for other things in between.
git checkout -b feat/<short-topic-name>
Use a descriptive branch name derived from the plan title.
For each step in the plan, in order:
Context isolation note: For plans with 7+ steps, consider using sub-agents for each phase (Planning, Implementation, Cleanup, PR). Each sub-agent gets a fresh context window, preventing degradation from accumulated conversation history. Pass only: plan file path, branch name, harness.yaml path, and memory/ path. Sub-agents exist primarily to isolate context, not to divide roles.
File-based handoff (avoid the telephone game): When using sub-agents, have them write results to files rather than relying on conversation relay. Sub-agents should write decisions to the plan's Decision Log, phase results to scratch/phase-N-results.md, and issues to scratch/issues-found.md. The orchestrator reads these files directly — this preserves full fidelity instead of lossy paraphrasing.
Re-read the current step from the plan file. During long sessions, the original plan drifts toward the middle of the context window where recall is lowest (10-40% lower than edges). Explicitly re-reading places the step requirements at a recent, high-attention position. This costs ~100-200 tokens per step but prevents drift from plan intent.
Read the step from the plan file. Understand:
If the step references patterns from docs/conventions.md or docs/architecture.md, read those sections now.
# Use commands.test or commands.test_unit from harness.yaml
docs/conventions.mdIf the step has a Verify: section with a specific command, run it now to confirm the step works before committing.
Stage the files changed in this step (prefer specific file paths over git add .):
git add <specific-files>
git commit -m "<descriptive message for this step>"
The pre-commit gate fires automatically on commit. Here is what it does and how to handle it:
harness.yaml -> verification.checksscratch/last-verification.log. Keep only a compact summary in conversation context: pass/fail status, error count, and the first 3 error messages. This prevents test and lint output from bloating the context window.scratch/last-verification.log for details)verification.max_retries consecutive failures (default 3): STOP IMMEDIATELY.
VERIFICATION FAILED after [N] retries.
Failing check: [check name]
Last error output:
[paste relevant error output]
What I tried:
[list each fix attempt]
I need your help to resolve this before continuing.
After a successful commit, update the plan file to mark the step as done. Add a checkmark or [DONE] prefix to the step heading:
### Step 1: [DONE] Set up database models
Starting from step 4 onward (or after any retry cycle on the verification gate), write a structured state summary to scratch/session-state.md covering: current position, completed steps, files modified, decisions made, and next action. This serves as a cheap re-orientation point — re-reading this file (~200 tokens) is faster and more reliable than scanning the full conversation history. See the context management reference for the checkpoint format.
After ALL steps in the plan are complete:
Before running cleanup, verify that the implementation actually matches the plan. Re-read the plan file and check:
[DONE]? If any are unmarked, they were missed.ls on each.If any probe fails, fix the gap before continuing. If the gap requires architectural judgment, escalate to the human.
Run all verification checks from harness.yaml -> verification.checks against the full codebase (not just changed files). Fix any issues found.
Invoke /deslop to clean up generated code:
Invoke /garden for an entropy scan:
enforcement.file_size_limit?)Address any findings before proceeding.
Invoke /create-qa to generate a manual QA checklist based on the changes made. This goes into the PR description or a linked QA doc.
Before moving to Phase 4, ensure all verbose outputs from Phase 2 and 3 are in scratch/ files and not bloating the conversation context. If you are carrying large diffs, test outputs, or lint results in context, write them to scratch/ now and keep only summaries going forward.
Invoke /create-pr to handle the standards gate (lint, test, enforcement) and PR creation. This skill will:
If /create-pr fails the standards gate, fix the issues and invoke it again.
Wait 30 seconds for the review agent (e.g., CodeRabbit) to begin its review:
sleep 30
Get the PR number from the gh pr create output, then poll:
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments
For each review comment:
If actionable (requests a code change):
fix: address review — <what was fixed>)If informational (suggestion, praise, question, or nitpick you disagree with):
gh api:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments/{comment_id}/replies -f body="<response>"
If unclear (you do not understand the comment):
After pushing fixes:
Loop up to review.max_review_cycles (from harness.yaml, default 3).
After all review cycles are complete (whether approved or escalated), run /retrospective to capture learnings from the review feedback. Review comments are the highest-signal input for memory — reviewers explicitly state team standards that may not be documented anywhere. Focus on question 1f (review-specific) and 1c (documentation gaps revealed by reviewer comments).
If the review agent approves or there are no new actionable comments:
PR is ready for merge: <PR URL>
Summary of changes:
- [bullet points]
Review cycles completed: [N]
All review comments addressed.
Please review and merge when ready.
If max review cycles reached with unresolved comments:
REVIEW ESCALATION after [N] cycles.
Unresolved comments:
1. [file:line] — [summary of comment] — [why it's unresolved]
2. ...
I need your guidance on these before continuing.
PR URL: <url>
After the human merges the PR:
Move the plan file from docs/plans/active/ to docs/plans/completed/:
git mv docs/plans/active/<plan-file>.md docs/plans/completed/<plan-file>.md
git commit -m "chore: move completed plan to archive"
git push
Run /retrospective to capture learnings from this implementation session. This writes structured findings to memory/ and optionally proposes improvements to docs or skills. If you prefer a quick finish, at minimum write back to memory any recurring issues you fixed during implementation.
Report final summary:
Feature complete: <feature name>
Commits: [N]
Files changed: [N]
Tests added: [N]
Review cycles: [N]
Plan: docs/plans/completed/<plan-file>.md
harness.yaml -> commands or verification.checks. The only exceptions are git and gh commands.harness.yaml at the start and reference it throughout. If the file changes mid-workflow (unlikely but possible), re-read it.git add <file1> <file2> over git add . or git add -A.documentation
Post-implementation retrospective that captures learnings to memory and proposes doc improvements
testing
Validate and fix project structure against architecture rules
tools
Migrate project scaffolding to match the latest harness version. Adds new directories (memory/, scratch/), new harness.yaml fields, and suggests AGENTS.md updates. For plugin users this handles what a plugin update cannot — project-level structure changes. For git-clone users this also updates copied skill files.
data-ai
Install the agent harness into a target project. Detects project type (greenfield vs existing), copies skills, and delegates to the appropriate bootstrap command.