agentleFS
anyoneandersonanyoneanderson/agent-skills/skills/spec-code/SKILL.md

spec-code

Skill3 starsChanged 7 days agoMITView on GitHub

Implement a single task from spec documents autonomously.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 8 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read Agent definition file if referenced (e.g., .claude/agents/workflow-implementer.md)

    line 43
  2. Very specific:

    Run gh issue view {N} --json title,body to understand the feature overview

    line 46
  3. Very specific:

    When called with --feedback, load only:

    line 60
  4. Distinctive:

    Do NOT re-read the full spec set unless the feedback indicates a misunderstanding of requirements.

    line 66
  5. Very specific:

    If task is already checked [x], warn and stop

    line 72
  6. Distinctive:

    Read the design section referenced by the task (e.g., "design.md §4.2"):

    line 76
  7. Distinctive:

    Follow the design to implement the task

    line 83
  8. Distinctive:

    Create or modify only the files specified in the task

    line 85
  9. Distinctive:

    Do NOT modify code unrelated to the findings

    line 102
  10. Very specific:

    Check each completion criterion from tasks.md:

    line 106
  11. Distinctive:

    If criterion is met, note it

    line 107
  12. Distinctive:

    If not met, continue implementing until satisfied

    line 108
  13. Very specific:

    Do NOT update the checkbox in tasks.md (this is spec-implement's responsibility)

    line 109
  14. Distinctive:

    Commit the implementation following project conventions:

    line 113
  15. Very specific:

    Read commit message format from coding-rules.md or CLAUDE.md

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

spec-code — Implement a Single Task from Specs

Autonomously implement one task from the spec documents, understanding the full project context before writing code.

Language Rules

  1. Auto-detect input language → output in the same language
  2. Japanese input → Japanese output, use references/code-guide.ja.md
  3. English input → English output, use references/code-guide.md
  4. Explicit override takes priority

Options

OptionDescription
--issue {N}GitHub Issue number for context
--spec {path}Path to .specs/ directory
--task {task-id}Task ID to implement (e.g., T-007)
--feedback {file}Feedback mode: read review or test result file and address findings

Execution Flow

Step 0: Context Loading (Phase A / Phase B)

Phase A — First invocation (full context):

  1. Locate and read workflow (search order: docs/development/issue-to-pr-workflow.md → docs/ → find):
    • Identify your role as implementer
    • Read Agent definition file if referenced (e.g., .claude/agents/workflow-implementer.md)
  2. Read Issue (if --issue provided):
    • Run gh issue view {N} --json title,body to understand the feature overview
  3. Read all spec files in --spec directory:
    • requirement.md — what to build and why
    • design.md — how to build it (architecture, data models, interfaces)
    • tasks.md — all tasks and their relationships
    • Understand the full picture before focusing on your task
  4. Read project rules (if they exist):
    • coding-rules.md (search: docs/development/ → docs/ → find)
    • CLAUDE.md / AGENTS.md at project root

Phase B — Feedback re-invocation (minimal context):

When called with --feedback, load only:

  1. The feedback file (review or test results)
  2. The target task description from tasks.md
  3. The relevant design.md section
  4. The changed files from the previous implementation

Do NOT re-read the full spec set unless the feedback indicates a misunderstanding of requirements.

Step 1: Locate Target Task

Parse tasks.md to find the task matching --task {task-id}:

  • Extract: task name, requirements ID, design reference, target files, completion criteria
  • If task is already checked [x], warn and stop

Step 2: Reference Design

Read the design section referenced by the task (e.g., "design.md §4.2"):

  • Extract: architecture decisions, interfaces, data models
  • Identify target files to create or modify

Step 3: Implement

Normal mode (no --feedback):

  • Follow the design to implement the task
  • Apply coding rules and project conventions
  • Create or modify only the files specified in the task

Feedback mode (--feedback {file}):

The feedback file is auto-detected by its type: header line:

  • type: review → Read ## Findings section. Fix only the findings tagged fix_before: implementation, at the specified file:line (Critical first, then Improvement). Findings tagged trial / required_check / follow_up are deferred — the caller carries them; do not fix them here. If no finding carries a fix_before tag (a legacy review file), fix Critical findings first, then Improvements.
  • type: test → Read ## Test Cases for failures and ## Completion Criteria Coverage for uncovered criteria. Fix the failing tests by modifying implementation code.
  • type: evaluate → Same ## Findings processing as type: review (identical ### Critical / ### Improvement structure). Fix Critical findings first, then Improvements. Ignore the ## Blocked section: blocked cases are setup gaps, not failures, and are not fix targets.

For both types:

  • Focus on items marked as FAIL or - [ ] (unchecked)
  • Do NOT modify code unrelated to the findings

Step 4: Verify Completion Criteria

Check each completion criterion from tasks.md:

  • If criterion is met, note it
  • If not met, continue implementing until satisfied
  • Do NOT update the checkbox in tasks.md (this is spec-implement's responsibility)

Step 5: Commit

Commit the implementation following project conventions:

  • Read commit message format from coding-rules.md or CLAUDE.md
  • Default format: feat(scope): {task-id} — {brief description}
  • Stage only implementation files (not tasks.md)

Error Handling

SituationResponse
--spec path not foundError: spec directory not found
--task ID not found in tasks.mdError: task ID not found
Task already checked [x]Warning: task already complete, skip
Design section not foundWarning: implement based on task description and requirements only
--feedback file not foundError: feedback file not found
Coding rules not foundWarning: proceed with project defaults

Usage Examples

# Implement a specific task
/spec-code --issue 36 --task T-007 --spec .specs/did-deactivation/

# Address review feedback
/spec-code --task T-007 --spec .specs/did-deactivation/ --feedback .specs/did-deactivation/review-T-007.md

# Address test failure feedback
/spec-code --task T-007 --spec .specs/did-deactivation/ --feedback .specs/did-deactivation/test-T-007.md

# Standalone (no issue)
/spec-code --task T-003 --spec .specs/auth-feature/

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.