spec-implement
Skill3 starsChanged 7 days agoMITView on GitHub
Specification-driven implementation orchestrator — Coordinate spec-code, spec-review, and spec-test to implement from specs to PR.
- Commits and pushes
6 other projects use a version of this.
Adopted by
Most recently taken up by
- benjaminthomas/spec-driven-devtheir own version, first seen Nov 8, 2026
- stjarnstrom/spec-systemtheir own version, first seen Oct 15, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- martinffx/ateliertheir own version, first seen Oct 9, 2026
- sourjya/kiro-railstheir own version, first seen Jul 8, 2026
- h3y6e/spec-skillstheir own version, first seen Feb 23, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- martinffx/atelier★ 51same name
- sourjya/kiro-rails★ 9same name
- xfstudio/skills★ 9same name
- benjaminthomas/spec-driven-dev★ 2same name
- h3y6e/spec-skills★ 0same name
- stjarnstrom/spec-system★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-delegateSkill
- cmux-delegateSkill
- cmux-forkSkill
- cmux-second-opinionSkill
- handoverSkill
- harness-initSkill
- harness-loopSkill
- harness-planSkill
- ja-humanizerSkill
- magiSkill
- mcp-convertSkill
- skill-suggestSkill
- spec-codeSkill
- spec-evaluateSkill
- spec-generatorSkill
- spec-inspectSkill
- spec-orchestrateSkill
- spec-reviewSkill
- spec-rules-initSkill
- spec-testSkill
- spec-to-issueSkill
- spec-workflow-initSkill
- spec-writingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
39 rules. 0 are common, 17 are distinctive, and 22 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
17
Distinctive
This author's own choices. Worth a look.
22
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 45
Do NOT write implementation code yourself: Always delegate to spec-code.
- Very specific: line 46
Do NOT perform code reviews yourself: Always delegate to spec-review.
- Very specific: line 47
Do NOT write tests yourself: Always delegate to spec-test.
- Distinctive: line 49
If a worker skill is not installed, stop and suggest installation.
- Distinctive: line 64
If set → record that cmux dispatch is available as an external-pane option.
- Very specific: line 71
If running in Codex and .codex/agents/workflow-*.toml exists → prefer runtime-native Codex sub-agents over cmux for workflow roles.
- Very specific: line 72
If running in Claude Code and .claude/agents/workflow-*.md exists → prefer Claude Code agent team over cmux for workflow roles only when …
- Very specific: line 75
If --spec provided → verify the path exists, then use it
- Distinctive: line 80
If a matching spec directory is found → use it and proceed
- Very specific: line 81
If no .specs/ found → ask user via AskUserQuestion:
- Distinctive: line 89
If user specifies a path → verify it exists and use it
- Very specific: line 90
If user chooses spec-generator → stop and instruct: Run /spec-generator first, then re-run /spec-implement
- Very specific: line 104
Read workflow, coding rules, and project instructions.
- Very specific: line 110
Test/lint/build commands
- Very specific: line 115
If --issue {N} is provided:
- Very specific: line 135
If a phase has NO role tag (legacy specs without [code]/[orchestrator]), treat it as [code] by default.
- Distinctive: line 163
When invoking worker skills, the method depends on execution mode:
- Very specific: line 173
If running in Codex and .codex/agents/workflow-*.toml exists → use Codex sub-agents by default
- Very specific: line 174
If running in Claude Code, .claude/agents/workflow-*.md exists, and CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set → use Claude Code agent …
- Distinctive: line 175
If cmux is available and the workflow/user explicitly selects cmux → use cmux dispatch
- Very specific: line 185
Use the Agent column value as the custom agent type
- Very specific: line 186
Do not inline the TOML content into the prompt.
- Very specific: line 191
Verify CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set
- Very specific: line 192
Ask Claude Code to create an agent team with predictable teammate names and to use the workflow agent definitions by Agent column value
- Distinctive: line 193
Do not inline the Markdown agent definition into the prompt when Claude Code can select that agent directly
- Distinctive: line 197
Read workflow's dispatch strategy and agent definition file paths
- Very specific: line 211
Read the task's kind: field (ui | backend | test) from its detail block in tasks.md.
- Very specific: line 213
Treat owner as the implementer AI role, not the backend.
- Very specific: line 238
If that cross-AI reviewer is unavailable, the default --review-fallback block reports a blocker.
- Distinctive: line 257
After all tasks complete:
- Distinctive: line 259
Run test commands from workflow (or language defaults)
- Distinctive: line 260
Run lint/typecheck commands (if specified)
- Distinctive: line 261
Verify all tasks in tasks.md are checked
- Very specific: line 262
If any check fails → fix via spec-code --feedback → recheck
- Distinctive: line 266
Treat the PR body as a review index, not an audit log, specification, or implementation diary.
- Distinctive: line 278
When no project template exists, use headings that serve these roles: summary, background or reason, changes, verification, known …
- Distinctive: line 289
Do NOT create PR if tests are failing
- Distinctive: line 290
Do NOT force push or push to main/master
- Distinctive: line 291
Verify base branch matches workflow
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
spec-implement — Orchestrator for Spec-Driven Implementation
Coordinate worker skills (spec-code, spec-review, spec-test) to implement from specifications to pull request. This skill does NOT write code or review — it delegates.
Language Rules
- Auto-detect input language → output in the same language
- Japanese input → Japanese output, use
references/implement-guide.ja.md - English input → English output, use
references/implement-guide.md - Explicit override takes priority
Options
| Option | Description |
--resume | Resume from last uncompleted task in tasks.md |
--issue {N} | Specify GitHub Issue number for context |
--spec {path} | Specify .specs/ directory path (default: auto-detect) |
--dry-run | Show execution plan without making any changes |
--roles {map} | Per-task owner routing by kind. Format: ui=claude,backend=codex,test=codex, or a path to a pipeline.yml whose roles.impl_{kind} keys supply the mapping. Omitted → every task uses spec-code and every review uses spec-review (legacy behavior, no agent-delegate involvement). |
--host-runtime {claude|codex} | Runtime executing this skill. Required with --roles; the orchestrator passes its recorded host_runtime so AI role and execution backend are resolved separately. |
--review-fallback {block|native-independent} | Review-only capability policy for the --roles path. Default block preserves standalone behavior. native-independent lets a missing cross-AI reviewer fall back to a fresh, read-only runtime-native reviewer subagent; spec-orchestrate passes this explicitly. |
Role: Orchestrator Only
🚨 BLOCKING — This rule overrides everything below.
This skill is an orchestrator. It coordinates worker skills but does NOT perform work itself.
- Do NOT write implementation code yourself. Always delegate to
spec-code. - Do NOT perform code reviews yourself. Always delegate to
spec-review. - Do NOT write tests yourself. Always delegate to
spec-test.
If a worker skill is not installed, stop and suggest installation. Never fall back to doing it yourself.
Critical First Steps
BEFORE any implementation, execute these checks in order:
- Verify environment:
pwd,git status,gh auth status - Parse user input: Extract
--resume,--issue,--spec,--dry-run,--roles, and--host-runtimeoptions - Check cmux availability:
If set → record that cmux dispatch is available as an external-pane option.echo $CMUX_SOCKET_PATH - Check runtime-native agent availability:
If running in Codex andls .codex/agents/workflow-*.toml 2>/dev/null ls .claude/agents/workflow-*.md 2>/dev/null.codex/agents/workflow-*.tomlexists → prefer runtime-native Codex sub-agents over cmux for workflow roles. Codex discovers custom agents from.codex/agents/*.toml; do not require[agents.<name>] config_fileentries. If running in Claude Code and.claude/agents/workflow-*.mdexists → prefer Claude Code agent team over cmux for workflow roles only whenCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1is set. If it is not set, use normal Claude Code subagents or single-agent sequential mode. - Locate spec directory 🚨 BLOCKING:
- If
--specprovided → verify the path exists, then use it - Always scan
.specs/regardless of whether Issue body contains a path:find .specs -maxdepth 2 -name "tasks.md" 2>/dev/null - If a matching spec directory is found → use it and proceed
- If no
.specs/found → ask user via AskUserQuestion:question: "No spec directory found. Where are your specifications?" / "仕様書ディレクトリが見つかりません。仕様書の場所を教えてください。" options: - "Specify path manually" / "パスを手動で指定する" - "Generate specs with spec-generator" / "spec-generator で仕様書を生成する"- If user specifies a path → verify it exists and use it
- If user chooses spec-generator → stop and instruct:
Run /spec-generator first, then re-run /spec-implement
- Do NOT proceed to Phase 5 (branch creation) until a valid spec directory is confirmed.
- If
- Locate and read project files:
- Workflow:
docs/development/issue-to-pr-workflow.md→docs/→ find → fallback - Coding rules:
docs/development/coding-rules.md→docs/→ find → fallback - Review rules:
docs/development/review_rules.md→docs/→ find → optional - Project instructions:
CLAUDE.md,AGENTS.md - Spec files:
requirement.md,design.md,tasks.md
- Workflow:
Execution Flow
Phase 1-3: Load Context
Read workflow, coding rules, and project instructions. Same search/fallback logic as before — see references/implement-guide.md for details.
Extract from workflow:
- Base branch (default:
main) - Branch naming convention
- Commit message format
- Test/lint/build commands
- Dispatch strategy and agent definitions (if present)
Phase 4: Issue Analysis
If --issue {N} is provided:
gh issue view {N} --json title,body,labels,assigneesPhase 5: Branch Creation
🚨 BLOCKING — Feature branch is MANDATORY
git checkout {base_branch} && git pull origin {base_branch}
git checkout -b feature/issue-{N}-{brief-description}Post-creation verification — MUST NOT be on main, master, or develop.
Phase 6: Task Loop (Orchestration)
Read tasks.md and process phases by role tag:
If a phase has NO role tag (legacy specs without [code]/[orchestrator]), treat it as [code] by default. This ensures backward compatibility with specs generated before v3.
Review gate phases: Phases with -R suffix (e.g., Phase 2-R: Review Gate [orchestrator]) are review gates. When processing these, run spec-review + spec-test for each task in the preceding [code] phase.
for each phase in tasks.md:
if phase has [orchestrator] tag AND phase name contains "Review Gate":
// This is a review gate — run spec-review + spec-test for preceding [code] tasks
for each task in the preceding [code] phase:
invoke spec-review --task {task-id} --spec {path}
read review result → if FAIL, run fix loop (spec-code --feedback → re-review, max 3)
invoke spec-test --task {task-id} --spec {path}
read test result → if FAIL, run fix loop (spec-code --feedback → re-test)
if review PASS AND test PASS: mark review gate task checkbox
elif phase has [orchestrator] tag:
execute tasks directly (run commands, check results — do NOT modify files)
elif phase has [code] tag (or NO tag — legacy fallback):
for each unchecked task in phase:
// Implement only — review/test happens in the Review Gate phase
invoke spec-code --issue {N} --task {task-id} --spec {path}
mark task checkbox: - [ ] → - [x]
commit progressDispatch modes:
When invoking worker skills, the method depends on execution mode:
| Mode | How to invoke |
| Single agent | Call the skill directly in the current session |
| Codex sub-agents | Spawn the workflow custom agent by the Agent column value (e.g., workflow-implementer) and instruct it to run /spec-code, /spec-review, or /spec-test for the assigned task |
| Claude Code agent team | Ask Claude Code to create an agent team with teammates based on the Agent column values (e.g., workflow-implementer) and assign /spec-code, /spec-review, or /spec-test tasks to those teammates |
| cmux dispatch | Use cmux-delegate --agent {ai} --task "/spec-code --issue {N} --task {id} --spec {path}" when external panes are explicitly selected or runtime-native agents are unavailable |
Mode priority:
- If running in Codex and
.codex/agents/workflow-*.tomlexists → use Codex sub-agents by default - If running in Claude Code,
.claude/agents/workflow-*.mdexists, andCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1is set → use Claude Code agent team by default - If cmux is available and the workflow/user explicitly selects cmux → use cmux dispatch
- Otherwise use single-agent sequential execution
This priority applies to the legacy path without --roles. When --roles is
active, Phase 6b's host-aware capability fallback takes precedence: report an
unavailable native worker to the caller and do not silently switch to cmux or
single-agent execution.
For Codex sub-agents:
- Validate
.codex/agents/workflow-implementer.toml,.codex/agents/workflow-reviewer.toml, and.codex/agents/workflow-tester.tomlexist when referenced by the workflow - Use the
Agentcolumn value as the custom agent type - Do not inline the TOML content into the prompt; Codex loads
developer_instructionsfrom the custom agent file - Pass only task-specific context: issue, spec path, task id, relevant files, and expected artifact/result
For Claude Code agent team:
- Validate
.claude/agents/workflow-implementer.md,.claude/agents/workflow-reviewer.md, and.claude/agents/workflow-tester.mdexist when referenced by the workflow - Verify
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1is set - Ask Claude Code to create an agent team with predictable teammate names and to use the workflow agent definitions by
Agentcolumn value - Do not inline the Markdown agent definition into the prompt when Claude Code can select that agent directly
- Pass task-specific context: issue, spec path, task id, relevant files, dependencies, expected artifact/result, and file ownership to avoid conflicts
For cmux dispatch:
- Read workflow's dispatch strategy and agent definition file paths
- Map roles to agents (implementer/tester → cmux-delegate, reviewer → cmux-second-opinion)
- Pass skill commands — worker skills handle their own context loading
Phase 6b: Kind-Based Task Routing (--roles)
This layer sits on top of the Phase 6 loop and only activates when --roles is
provided (orchestrated mode). Without --roles, every task uses spec-code and every
review uses spec-review — identical to legacy behavior, with no agent-delegate
involvement. The loop's control flow (per-phase iteration, fix loop with its 3-iteration
cap, gate evaluation, checkbox marking, spec-test) is unchanged; only the executor of
each step is resolved per task.
Owner resolution (per task):
- Read the task's
kind:field (ui | backend | test) from its detail block in tasks.md. owner = roles[kind]when kind is known and present in the map; otherwiseclaude(default).- Treat
owneras the implementer AI role, not the backend. - Resolve the executor from
--host-runtime:owner == host_runtime→ run spec-code in a runtime-native subagent; do not start agent-delegate.owner != host_runtime→ run the agent-delegate script with--mode delegate --target <owner> --detach. Retain the expected run id and use the contract's 15–30-second report-first state wait. Re-evaluate at 30-minute intervals and apply the contract's controlled stop at 2 hours.
Reviewer inversion (review gate): choose the preferred reviewer as the opposite AI role from the task's implementer, then resolve that reviewer through the same host-aware matrix:
| Implementer AI role | Reviewer AI role |
| codex | claude |
| claude | codex |
Matching reviewer and host use a runtime-native spec-review subagent; differing
roles use agent-delegate --mode review --target <reviewer> (sync only with a
concrete <=5-minute basis; otherwise detach). Fixes route to the implementer AI
role and resolve through the same matrix again. An agent-delegate review file is
spec-review-compatible (severity sections + Gate: PASS|FAIL), so the existing
fix loop consumes it unchanged.
If that cross-AI reviewer is unavailable, the default --review-fallback block
reports a blocker. Only native-independent may continue with the host AI role,
and only by spawning a fresh runtime-native reviewer subagent that is not the
implementer instance, does not resume or receive the implementation conversation,
has no write tools, and leaves the workspace unchanged. If that independent
native reviewer cannot be created, block. Each use is recorded in orchestrator
state and the PR body; never disguise it as cross-AI review. To preserve state
ownership, spec-implement returns one structured fallback record per use to its
caller. spec-orchestrate appends those records to state and the PR; a standalone
caller shows them in the completion summary without writing pipeline state.
agent-delegate is a public-contract dependency: call the script per
agent-delegate/references/contract.md and always pass --target explicitly (the
contract's nested-chain caveat forbids self-detection for programmatic callers). See
references/implement-guide.md → "Kind-Based Task Routing" for invocation details,
expected-run polling, sandbox stages, resume, and unavailable-peer fallback.
Phase 7: Final Quality Gate
After all tasks complete:
- Run test commands from workflow (or language defaults)
- Run lint/typecheck commands (if specified)
- Verify all tasks in tasks.md are checked
- If any check fails → fix via spec-code --feedback → recheck
Phase 8: PR Creation
Treat the PR body as a review index, not an audit log, specification, or implementation diary. Before composing it, inspect the repository's pull request template and PR-writing rules. When a project template exists, preserve its headings, order, required fields, and checkboxes.
Select only facts whose removal would change a reviewer's judgment about correctness, risk, scope, verification, or merge readiness. Summarize changed behavior, design rationale, affected scope, known constraints, verification, and review focus. Keep complete review rounds, all findings, acceptance tables, evidence manifests, task progress, and arbitration history in their durable local records; do not copy them wholesale into the PR body.
When no project template exists, use headings that serve these roles: summary, background or reason, changes, verification, known constraints, and review focus.
gh pr create \
--title "{type}: {description} (closes #{N})" \
--body "{PR body following workflow template}" \
--base {base_branch}Safety guards:
- Do NOT create PR if tests are failing
- Do NOT force push or push to main/master
- Verify base branch matches workflow
Deferred findings: for each review finding carried with fix_before:
trial / required_check / follow_up, create a follow-up issue (gh issue
create — finding text, severity, fix_before stage, file/section, link back
to the PR; same-class findings may share one issue). Keep the full finding in
that Issue. Put only the Issue link, its effect on changed behavior, and why the
current PR can land before the follow-up in the PR body. If issue creation fails
or gh is unavailable, keep the full finding text in the PR body with a warning
— a deferred finding must never survive only in a run record.
Summarize a review fallback in the PR only when it reduces review assurance. State the preferred and actual reviewer roles, why the fallback occurred, and its effect on merge judgment; do not dump every structured fallback record.
Error Handling
| Situation | Response |
| Not a git repository | Error: must be in a git repository |
gh CLI not available | Error: guide user to install/auth |
.specs/ not found | 🚨 BLOCKING: ask user for path or suggest spec-generator |
requirement.md missing | Warning: use Issue body as requirements |
tasks.md missing | Warning: generate simple checklist from Issue |
| On protected branch | 🚨 BLOCKING: stop, require feature branch |
| Worker skill not installed | Error: suggest npx skills add anyoneanderson/agent-skills --skill {name} |
--roles provided without a valid --host-runtime | Report a configuration blocker to the orchestrator. Standalone: ask the user for claude or codex; do not guess |
| Runtime-native subagent unavailable for an owned task | Report the blocker to the orchestrator, which applies its manual/auto role fallback. Standalone: ask before reassigning the AI role |
agent-delegate unavailable for cross-AI implementation (script missing / exit 2 / tool_unavailable) | Report the blocker to the orchestrator, which applies its manual/auto owner fallback. Standalone: ask before reassigning to the host AI |
| agent-delegate unavailable for cross-AI review | With default --review-fallback block, report a blocker. With explicit native-independent, use a fresh read-only host-native reviewer subagent and record the degraded review; if that subagent is unavailable, block |
| Review FAIL after 3 iterations | Ask user to decide |
| Test FAIL after fix attempt | Ask user to decide |
Post-Completion Actions
AskUserQuestion:
question: "PR created. What's next?" / "PRを作成しました。次は?"
options:
- "Monitor CI status" / "CIステータスを監視"
- "Done" / "完了"Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

