AgentSkillsCN

spec-implement

根据已批准的规范实现一项功能。执行实施计划,创建提交,并验证验收标准。

SKILL.md
--- frontmatter
name: spec-implement
description: Implement a feature based on an approved spec. Executes the implementation plan, creates commits, and verifies acceptance criteria.

What to do when this skill is invoked

When the user invokes /spec-implement, they will provide a path to a spec file or a feature name (e.g., /spec-implement ./claude/specs/01-auth.md or /spec-implement auth).

Your job is to:

  1. Locate the spec file - Find the spec at the provided path or search .claude/specs/ for matching filename
  2. Read and validate the spec - Ensure it's complete and ready for implementation
  3. Extract implementation steps - Parse section 7 (Implementation Steps)
  4. Create implementation plan - Use EnterPlanMode to design the implementation approach
  5. Break down into tasks - Use TodoWrite to create granular tasks for each step
  6. Execute implementation - Work through each task systematically
  7. Create commits - Use git to commit work at logical breakpoints
  8. Test and verify - Run tests and ensure acceptance criteria are met
  9. Report completion - Summarize what was implemented and any issues encountered

Implementation workflow

  1. Planning Phase

    • Use EnterPlanMode to present the implementation strategy
    • Get user approval before proceeding
    • Use AskUserQuestion if there are multiple valid approaches
  2. Execution Phase

    • Use TodoWrite to track all implementation tasks
    • Mark tasks in_progress as you work on them
    • Complete tasks immediately after finishing
    • Use git commits to checkpoint work
  3. Verification Phase

    • Run existing tests to ensure nothing broke
    • Test new functionality against acceptance criteria
    • Create tests if needed for the new feature
    • Handle any test failures or issues
  4. Completion Phase

    • Create a final summary commit if needed
    • Report success/issues to the user
    • Suggest next steps (PR creation, testing, etc.)

Key points

  • Always read the spec completely before starting implementation
  • Use TodoWrite proactively to track tasks and stay organized
  • Break each implementation step into concrete, testable pieces
  • Create meaningful git commits at logical checkpoints
  • Test continuously as you implement, don't leave testing for the end
  • If you encounter issues not covered in the spec, ask the user for guidance
  • Reference the spec throughout - if implementation diverges, flag it for discussion
  • Use the spec's acceptance criteria as your definition of done

Process

  1. Read the spec file and validate it's complete
  2. Use EnterPlanMode to present and get approval for the implementation approach
  3. Use TodoWrite to create implementation tasks from the spec's Implementation Steps section
  4. Execute each task, marking them in_progress and completed as you work
  5. Create git commits at logical breakpoints
  6. Run tests and verify acceptance criteria are met
  7. Report completion status and any issues encountered