conductor-implement

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Implement Track

实施追踪项

Execute tasks from a track's implementation plan, following the workflow rules defined in
conductor/workflow.md
.
遵循
conductor/workflow.md
中定义的工作流规则,执行追踪项实施计划中的任务。

Use this skill when

何时使用此技能

  • Working on implement track tasks or workflows
  • Needing guidance, best practices, or checklists for implement track
  • 处理实施追踪项的任务或工作流时
  • 需要实施追踪项的指导、最佳实践或检查清单时

Do not use this skill when

何时请勿使用此技能

  • The task is unrelated to implement track
  • You need a different domain or tool outside this scope
  • 任务与实施追踪项无关时
  • 需要此范围之外的其他领域或工具时

Instructions

操作说明

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open
    resources/implementation-playbook.md
    .
  • 明确目标、约束条件和所需输入。
  • 应用相关最佳实践并验证结果。
  • 提供可操作的步骤和验证方式。
  • 如果需要详细示例,请打开
    resources/implementation-playbook.md

Pre-flight Checks

执行前检查

  1. Verify Conductor is initialized:
    • Check
      conductor/product.md
      exists
    • Check
      conductor/workflow.md
      exists
    • Check
      conductor/tracks.md
      exists
    • If missing: Display error and suggest running
      /conductor:setup
      first
  2. Load workflow configuration:
    • Read
      conductor/workflow.md
    • Parse TDD strictness level
    • Parse commit strategy
    • Parse verification checkpoint rules
  1. 验证Conductor已初始化:
    • 检查
      conductor/product.md
      是否存在
    • 检查
      conductor/workflow.md
      是否存在
    • 检查
      conductor/tracks.md
      是否存在
    • 如果缺失:显示错误并建议先运行
      /conductor:setup
  2. 加载工作流配置:
    • 读取
      conductor/workflow.md
    • 解析TDD严格程度
    • 解析提交策略
    • 解析验证检查点规则

Track Selection

追踪项选择

If argument provided:

如果提供了参数:

  • Validate track exists:
    conductor/tracks/{argument}/plan.md
  • If not found: Search for partial matches, suggest corrections
  • 验证追踪项是否存在:
    conductor/tracks/{argument}/plan.md
  • 如果未找到:搜索部分匹配项,建议修正

If no argument:

如果未提供参数:

  1. Read
    conductor/tracks.md
  2. Parse for incomplete tracks (status
    [ ]
    or
    [~]
    )
  3. Display selection menu:
    Select a track to implement:
    
    In Progress:
    1. [~] auth_20250115 - User Authentication (Phase 2, Task 3)
    
    Pending:
    2. [ ] nav-fix_20250114 - Navigation Bug Fix
    3. [ ] dashboard_20250113 - Dashboard Feature
    
    Enter number or track ID:
  1. 读取
    conductor/tracks.md
  2. 解析未完成的追踪项(状态为
    [ ]
    [~]
  3. 显示选择菜单:
    Select a track to implement:
    
    In Progress:
    1. [~] auth_20250115 - User Authentication (Phase 2, Task 3)
    
    Pending:
    2. [ ] nav-fix_20250114 - Navigation Bug Fix
    3. [ ] dashboard_20250113 - Dashboard Feature
    
    Enter number or track ID:

Context Loading

上下文加载

Load all relevant context for implementation:
  1. Track documents:
    • conductor/tracks/{trackId}/spec.md
      - Requirements
    • conductor/tracks/{trackId}/plan.md
      - Task list
    • conductor/tracks/{trackId}/metadata.json
      - Progress state
  2. Project context:
    • conductor/product.md
      - Product understanding
    • conductor/tech-stack.md
      - Technical constraints
    • conductor/workflow.md
      - Process rules
  3. Code style (if exists):
    • conductor/code_styleguides/{language}.md
加载实施所需的所有相关上下文:
  1. 追踪项文档:
    • conductor/tracks/{trackId}/spec.md
      - 需求说明
    • conductor/tracks/{trackId}/plan.md
      - 任务列表
    • conductor/tracks/{trackId}/metadata.json
      - 进度状态
  2. 项目上下文:
    • conductor/product.md
      - 产品认知
    • conductor/tech-stack.md
      - 技术约束
    • conductor/workflow.md
      - 流程规则
  3. 代码风格(如果存在):
    • conductor/code_styleguides/{language}.md

Track Status Update

追踪项状态更新

Update track to in-progress:
  1. In
    conductor/tracks.md
    :
    • Change
      [ ]
      to
      [~]
      for this track
  2. In
    conductor/tracks/{trackId}/metadata.json
    :
    • Set
      status: "in_progress"
    • Update
      updated
      timestamp
将追踪项更新为进行中:
  1. conductor/tracks.md
    中:
    • 将此追踪项的
      [ ]
      改为
      [~]
  2. conductor/tracks/{trackId}/metadata.json
    中:
    • 设置
      status: "in_progress"
    • 更新
      updated
      时间戳

Task Execution Loop

任务执行循环

For each incomplete task in plan.md (marked with
[ ]
):
针对plan.md中每个未完成的任务(标记为
[ ]
):

1. Task Identification

1. 任务识别

Parse plan.md to find next incomplete task:
  • Look for lines matching
    - [ ] Task X.Y: {description}
  • Track current phase from structure
解析plan.md以找到下一个未完成的任务:
  • 查找匹配
    - [ ] Task X.Y: {description}
    的行
  • 从结构中追踪当前阶段

2. Task Start

2. 任务开始

Mark task as in-progress:
  • Update plan.md: Change
    [ ]
    to
    [~]
    for current task
  • Announce: "Starting Task X.Y: {description}"
将任务标记为进行中:
  • 更新plan.md:将当前任务的
    [ ]
    改为
    [~]
  • 通知:"开始执行任务X.Y: {description}"

3. TDD Workflow (if TDD enabled in workflow.md)

3. TDD工作流(如果workflow.md中启用了TDD)

Red Phase - Write Failing Test:
Following TDD workflow for Task X.Y...

Step 1: Writing failing test
  • Create test file if needed
  • Write test(s) for the task functionality
  • Run tests to confirm they fail
  • If tests pass unexpectedly: HALT, investigate
Green Phase - Implement:
Step 2: Implementing minimal code to pass test
  • Write minimum code to make test pass
  • Run tests to confirm they pass
  • If tests fail: Debug and fix
Refactor Phase:
Step 3: Refactoring while keeping tests green
  • Clean up code
  • Run tests to ensure still passing
红阶段 - 编写失败的测试:
Following TDD workflow for Task X.Y...

Step 1: Writing failing test
  • 如有需要,创建测试文件
  • 为任务功能编写测试用例
  • 运行测试以确认测试失败
  • 如果测试意外通过:暂停执行,调查原因
绿阶段 - 实现功能:
Step 2: Implementing minimal code to pass test
  • 编写最少代码以通过测试
  • 运行测试以确认测试通过
  • 如果测试失败:调试并修复
重构阶段:
Step 3: Refactoring while keeping tests green
  • 清理代码
  • 运行测试以确保仍能通过

4. Non-TDD Workflow (if TDD not strict)

4. 非TDD工作流(如果未严格要求TDD)

  • Implement the task directly
  • Run any existing tests
  • Manual verification as needed
  • 直接实现任务
  • 运行所有现有测试
  • 按需进行手动验证

5. Task Completion

5. 任务完成

Commit changes (following commit strategy from workflow.md):
bash
git add -A
git commit -m "{commit_prefix}: {task description} ({trackId})"
Update plan.md:
  • Change
    [~]
    to
    [x]
    for completed task
  • Commit plan update:
bash
git add conductor/tracks/{trackId}/plan.md
git commit -m "chore: mark task X.Y complete ({trackId})"
Update metadata.json:
  • Increment
    tasks.completed
  • Update
    updated
    timestamp
提交更改(遵循workflow.md中的提交策略):
bash
git add -A
git commit -m "{commit_prefix}: {task description} ({trackId})"
更新plan.md:
  • 将已完成任务的
    [~]
    改为
    [x]
  • 提交plan.md的更新:
bash
git add conductor/tracks/{trackId}/plan.md
git commit -m "chore: mark task X.Y complete ({trackId})"
更新metadata.json:
  • 增加
    tasks.completed
    的数值
  • 更新
    updated
    时间戳

6. Phase Completion Check

6. 阶段完成检查

After each task, check if phase is complete:
  • Parse plan.md for phase structure
  • If all tasks in current phase are
    [x]
    :
Run phase verification:
Phase {N} complete. Running verification...
  • Execute verification tasks listed for the phase
  • Run full test suite:
    npm test
    /
    pytest
    / etc.
Report and wait for approval:
Phase {N} Verification Results:
- All phase tasks: Complete
- Tests: {passing/failing}
- Verification: {pass/fail}

Approve to continue to Phase {N+1}?
1. Yes, continue
2. No, there are issues to fix
3. Pause implementation
CRITICAL: Wait for explicit user approval before proceeding to next phase.
每个任务完成后,检查当前阶段是否已完成:
  • 解析plan.md的阶段结构
  • 如果当前阶段的所有任务均标记为
    [x]
运行阶段验证:
Phase {N} complete. Running verification...
  • 执行该阶段列出的验证任务
  • 运行完整测试套件:
    npm test
    /
    pytest
    / 等
报告并等待批准:
Phase {N} Verification Results:
- All phase tasks: Complete
- Tests: {passing/failing}
- Verification: {pass/fail}

Approve to continue to Phase {N+1}?
1. Yes, continue
2. No, there are issues to fix
3. Pause implementation
重要提示:进入下一阶段前必须等待用户明确批准。

Error Handling During Implementation

实施期间的错误处理

On Tool Failure

工具故障时

ERROR: {tool} failed with: {error message}

Options:
1. Retry the operation
2. Skip this task and continue
3. Pause implementation
4. Revert current task changes
  • HALT and present options
  • Do NOT automatically continue
ERROR: {tool} failed with: {error message}

Options:
1. Retry the operation
2. Skip this task and continue
3. Pause implementation
4. Revert current task changes
  • 暂停执行并显示选项
  • 请勿自动继续

On Test Failure

测试失败时

TESTS FAILING after Task X.Y

Failed tests:
- {test name}: {failure reason}

Options:
1. Attempt to fix
2. Rollback task changes
3. Pause for manual intervention
TESTS FAILING after Task X.Y

Failed tests:
- {test name}: {failure reason}

Options:
1. Attempt to fix
2. Rollback task changes
3. Pause for manual intervention

On Git Failure

Git故障时

GIT ERROR: {error message}

This may indicate:
- Uncommitted changes from outside Conductor
- Merge conflicts
- Permission issues

Options:
1. Show git status
2. Attempt to resolve
3. Pause for manual intervention
GIT ERROR: {error message}

This may indicate:
- Uncommitted changes from outside Conductor
- Merge conflicts
- Permission issues

Options:
1. Show git status
2. Attempt to resolve
3. Pause for manual intervention

Track Completion

追踪项完成

When all phases and tasks are complete:
当所有阶段和任务均完成时:

1. Final Verification

1. 最终验证

All tasks complete. Running final verification...
  • Run full test suite
  • Check all acceptance criteria from spec.md
  • Generate verification report
All tasks complete. Running final verification...
  • 运行完整测试套件
  • 检查spec.md中的所有验收标准
  • 生成验证报告

2. Update Track Status

2. 更新追踪项状态

In
conductor/tracks.md
:
  • Change
    [~]
    to
    [x]
    for this track
  • Update the "Updated" column
In
conductor/tracks/{trackId}/metadata.json
:
  • Set
    status: "complete"
  • Set
    phases.completed
    to total
  • Set
    tasks.completed
    to total
  • Update
    updated
    timestamp
In
conductor/tracks/{trackId}/plan.md
:
  • Update header status to
    [x] Complete
conductor/tracks.md
中:
  • 将此追踪项的
    [~]
    改为
    [x]
  • 更新“更新时间”列
conductor/tracks/{trackId}/metadata.json
中:
  • 设置
    status: "complete"
  • phases.completed
    设置为总阶段数
  • tasks.completed
    设置为总任务数
  • 更新
    updated
    时间戳
conductor/tracks/{trackId}/plan.md
中:
  • 将标题状态更新为
    [x] 已完成

3. Documentation Sync Offer

3. 文档同步提议

Track complete! Would you like to sync documentation?

This will update:
- conductor/product.md (if new features added)
- conductor/tech-stack.md (if new dependencies added)
- README.md (if applicable)

1. Yes, sync documentation
2. No, skip
Track complete! Would you like to sync documentation?

This will update:
- conductor/product.md (if new features added)
- conductor/tech-stack.md (if new dependencies added)
- README.md (if applicable)

1. Yes, sync documentation
2. No, skip

4. Cleanup Offer

4. 清理提议

Track {trackId} is complete.

Cleanup options:
1. Archive - Move to conductor/tracks/_archive/
2. Delete - Remove track directory
3. Keep - Leave as-is
Track {trackId} is complete.

Cleanup options:
1. Archive - Move to conductor/tracks/_archive/
2. Delete - Remove track directory
3. Keep - Leave as-is

5. Completion Summary

5. 完成总结

Track Complete: {track title}

Summary:
- Track ID: {trackId}
- Phases completed: {N}/{N}
- Tasks completed: {M}/{M}
- Commits created: {count}
- Tests: All passing

Next steps:
- Run /conductor:status to see project progress
- Run /conductor:new-track for next feature
Track Complete: {track title}

Summary:
- Track ID: {trackId}
- Phases completed: {N}/{N}
- Tasks completed: {M}/{M}
- Commits created: {count}
- Tests: All passing

Next steps:
- Run /conductor:status to see project progress
- Run /conductor:new-track for next feature

Progress Tracking

进度追踪

Maintain progress in
metadata.json
throughout:
json
{
  "id": "auth_20250115",
  "title": "User Authentication",
  "type": "feature",
  "status": "in_progress",
  "created": "2025-01-15T10:00:00Z",
  "updated": "2025-01-15T14:30:00Z",
  "current_phase": 2,
  "current_task": "2.3",
  "phases": {
    "total": 3,
    "completed": 1
  },
  "tasks": {
    "total": 12,
    "completed": 7
  },
  "commits": [
    "abc1234: feat: add login form (auth_20250115)",
    "def5678: feat: add password validation (auth_20250115)"
  ]
}
在整个过程中维护metadata.json中的进度信息:
json
{
  "id": "auth_20250115",
  "title": "User Authentication",
  "type": "feature",
  "status": "in_progress",
  "created": "2025-01-15T10:00:00Z",
  "updated": "2025-01-15T14:30:00Z",
  "current_phase": 2,
  "current_task": "2.3",
    "phases": {
    "total": 3,
    "completed": 1
  },
  "tasks": {
    "total": 12,
    "completed": 7
  },
  "commits": [
    "abc1234: feat: add login form (auth_20250115)",
    "def5678: feat: add password validation (auth_20250115)"
  ]
}

Resumption

恢复执行

If implementation is paused and resumed:
  1. Load
    metadata.json
    for current state
  2. Find current task from
    current_task
    field
  3. Check if task is
    [~]
    in plan.md
  4. Ask user:
    Resuming track: {title}
    
    Last task in progress: Task {X.Y}: {description}
    
    Options:
    1. Continue from where we left off
    2. Restart current task
    3. Show progress summary first
如果实施被暂停后恢复:
  1. 加载metadata.json获取当前状态
  2. current_task
    字段找到当前任务
  3. 检查plan.md中该任务是否标记为
    [~]
  4. 询问用户:
    Resuming track: {title}
    
    Last task in progress: Task {X.Y}: {description}
    
    Options:
    1. Continue from where we left off
    2. Restart current task
    3. Show progress summary first

Critical Rules

重要规则

  1. NEVER skip verification checkpoints - Always wait for user approval between phases
  2. STOP on any failure - Do not attempt to continue past errors
  3. Follow workflow.md strictly - TDD, commit strategy, and verification rules are mandatory
  4. Keep plan.md updated - Task status must reflect actual progress
  5. Commit frequently - Each task completion should be committed
  6. Track all commits - Record commit hashes in metadata.json for potential revert
  1. 绝不跳过验证检查点 - 阶段之间必须等待用户批准
  2. 任何故障时立即停止 - 请勿尝试跳过错误继续执行
  3. 严格遵循workflow.md - TDD、提交策略和验证规则是强制性的
  4. 保持plan.md更新 - 任务状态必须反映实际进度
  5. 频繁提交 - 每个任务完成后都应提交
  6. 追踪所有提交 - 在metadata.json中记录提交哈希,以便后续可能的回滚