AgentSkillsCN

build

制定包含检查点支持的计划文件,以便在中断后轻松恢复工作。

SKILL.md
--- frontmatter
name: build
description: Implement a plan file with checkpoint support for resuming work
argument-hint: <plan-file> [checkpoint] [--git] [context]

Build

Overview

Implement all tasks from a plan file with checkpoint support for resuming work, progress tracking via TodoWrite, and optional git commits at logical milestones.

Arguments

Definitions

  • <plan-file> (required): Path to plan file.
  • [checkpoint] (optional): Resume from specific task/milestone (e.g., "Milestone 2" or "Task 3.1").
  • [--git] (optional): Auto-commit changes at logical checkpoints.
  • [context] (optional): Freeform context for implementation guidance.

Values

$ARGUMENTS

Core Principles

  • Plans are read-only - never modify the plan file during implementation
  • Track progress via TodoWrite tool, not plan file updates
  • Ask clarifying questions rather than making assumptions
  • Maintain code quality and follow existing patterns in the codebase
  • Run tests frequently to catch issues early
  • Git commits should be atomic and meaningful, aligned with milestones or task groups
  • Ensure changes work before committing
  • If blocked on a task, explain the blocker and ask for guidance

Skill-Specific Guidelines

Checkpoint System

The checkpoint system allows resuming long-running builds:

  1. Milestone Checkpoint: Resume from start of a milestone

    bash
    --checkpoint "Milestone 2"
    --checkpoint "Milestone 2: OAuth Integration"
    
  2. Task Checkpoint: Resume from a specific task

    bash
    --checkpoint "Task 2.1"
    --checkpoint "Add OAuth handlers"
    
  3. Text Matching: Checkpoint matches against:

    • Milestone numbers (e.g., "Milestone 2")
    • Milestone titles (e.g., "OAuth Integration")
    • Task numbers (e.g., "Task 2.1")
    • Task descriptions (partial match supported)

Git Commit Strategy

When --git flag is used, use /git-commit to commit at logical checkpoints:

  • Feature plans: Commit after each milestone
  • Bug fix plans: Commit after fix, again after tests
  • Chore plans: Commit after major task groups

Instructions

  1. Read Plan File

    • Read the plan file from the provided path
    • Parse the plan structure (milestones, tasks, validation criteria)
    • Validate the plan has required sections
  2. Handle Checkpoint (if --checkpoint flag)

    • Parse the checkpoint text to find the resume point
    • Match against milestone titles or task descriptions
    • Mark all previous tasks as already completed
    • Resume from the matched checkpoint
  3. Create Todo List

    • Extract all tasks from the plan
    • For feature plans: create todos per milestone with nested tasks
    • For bug/chore plans: create todos per task
    • Use TodoWrite tool to track progress
    • Mark checkpoint-completed tasks if resuming
  4. Implement Tasks

    • Work through each task sequentially
    • Mark current task as in_progress before starting
    • Analyze what changes are needed for the task
    • Make the required code changes
    • If implementation is ambiguous:
      • Ask user clarifying questions using AskUserQuestion
      • Wait for response before proceeding
    • Mark task as completed when done
  5. Git Commits (if --git flag)

    • Use /git-commit at logical checkpoints:
      • Features: after each milestone completion
      • Bugs: after fix implemented, after tests added
      • Chores: after major task groups
  6. Validation

    • After completing all tasks, remind user to run /sdlc-review
    • Provide summary of changes made

Output Guidance

Provide clear progress updates and a final summary.

During implementation:

code
[in_progress] Milestone 1: OAuth Integration
  [completed] Task 1.1: Add OAuth provider configuration
  [in_progress] Task 1.2: Implement OAuth handlers
  [pending] Task 1.3: Add session management

On completion:

code
## Implementation Complete

Tasks completed: X
Files modified: Y
Commits created: Z (if --git used)

Changes summary:
- [list key changes made]

Next steps:
- Run validation: /sdlc-review --plan specs/feature-auth.md
- Review changes and test functionality