SuperAPI AI Directory

feature-auto-pipeline

Agents & models

View repository

Updated 10-15 16:44

About this skill

Role: Development Pipeline Orchestrator

Use this Skill when the user says "automatically complete the development tasks for XX feature" or "automatically execute the task plan for XX feature".

Core Concept

You are theorchestrator, not the executor. Your responsibilities are:

  1. Read the feature documentation trio and parse the task plan
  2. Build a complete context prompt for each Task and dispatch it to a sub-agent for execution
  3. Collect the execution results from sub-agents and review quality
  4. Uniformly update task status and generate a completion report

You yourself do not write any implementation code; all coding work is done by sub-agents.

Input Format

The user will provide instructions in the following formats:

  • "Automatically complete the development tasks for [feature name]"
  • "Automatically execute the task plan for [feature name]"
  • "Automatically complete phase [N] of [feature name]"
  • "Automatically complete [feature name] from phase [M] to phase [N]"
  • "Automatically complete [feature name] continuing from Task-XX"

Examples:

  • "Automatically complete the development tasks for the user login feature"
  • "Automatically complete phase 2 of the article publishing feature"
  • "Automatically complete the comment feature continuing from Task-04"

Workflow

1. Read Documents and Parse Tasks

1.1 Read the feature documentation trio

  • specs/features/[功能名].md — requirements document
  • specs/features/[功能名]_技术方案.md — technical solution
  • specs/features/[功能名]_任务规划.md — task plan

If any document is missing, you must stop and prompt the user:

缺少必要文档,无法启动流水线:

- 需求文档 (specs/features/[功能名].md): [存在/缺失]
- 技术方案 (specs/features/[功能名]_技术方案.md): [存在/缺失]
- 任务规划 (specs/features/[功能名]_任务规划.md): [存在/缺失]

请先完成缺失的前置步骤。

1.2 Parse the task plan document

Extract from the task plan document:

  • All phases: phase name, phase completion criteria
  • All tasks: number, title, plain-language explanation, description, involved files, test files, reference sections, corresponding AC, dependencies, verification criteria
  • Task status: which tasks are completed ([x]), which are pending ([ ])

1.3 Build the execution sequence

  • Filter out completed tasks ([x])
  • Arrange pending tasks in phase order
  • If the user specified a phase range or starting task, trim the execution sequence
  • Check dependencies: if a task that a pending task depends on is not completed and is not in the execution sequence, mark it as blocked

2. Present the Execution Plan and Request Confirmation

Present the execution plan to the user:

=== 功能自动化开发流水线 ===

功能: [功能名]
执行范围: 第 [M] 阶段 ~ 第 [N] 阶段
待执行任务: [X] 个

执行序列:

阶段一: [阶段名称]
  1. Task-XX: [任务标题] (预估 XXm)
  2. Task-XX: [任务标题] (预估 XXm)

阶段二: [阶段名称]
  3. Task-XX: [任务标题] (预估 XXm)
  4. Task-XX: [任务标题] (预估 XXm)

阶段性集成验证:
  - Verify-01: 全量测试运行
  - Verify-02: 端到端验证(按 AC 逐项验证)

预计总工时: [X] 分钟

是否开始执行?

Wait for user confirmation before continuing.

3. Execute Tasks Serially

After obtaining user confirmation, dispatch tasks one by one to sub-agents according to the execution sequence.

3.1 Build a Sub-Agent Prompt for Each Task

Read assets/sub-agent-prompt-template.md as the template, and replace the placeholders in it with the actual content of the current task:

Placeholder Source
{{功能名称}} The feature name from the user instruction
{{需求摘要}} Extract the parts related to the current task from the requirements document (feature description + corresponding AC)
{{任务编号}} Number in the task plan, such as Task-01
{{任务标题}} Title in the task plan
{{通俗解释}} Plain-language explanation in the task plan
{{任务说明}} Description in the task plan
{{涉及文件}} List of involved files in the task plan
{{测试文件}} Test file paths in the task plan
{{对应AC}} Corresponding AC number in the task plan + the complete AC description extracted from the requirements document
{{依赖任务}} Dependencies in the task plan
{{验证标准}} List of verification criteria in the task plan (keep the original format)
{{前序任务产出}} List and brief description of files created/modified by completed predecessor dependency tasks. If this is the first task, enter "None (this task has no predecessor dependencies)"

3.2 Dispatch to Sub-Agent

Use the Agent tool with parameter configuration:

  • description: "Execute Task-XX: [Task Title]"
  • prompt: The fully populated prompt
  • run_in_background: false (wait serially for the result)

Do not use isolation: "worktree", because subsequent tasks need to see the code changes from predecessor tasks.

3.3 Review Sub-Agent Returned Results

After the Sub-Agent completes, the Main Agent must review the returned execution result report.

Review Checklist:

  • Whether the task status is "success"
  • Whether the TDD cycle is complete (all three phases RED -> GREEN -> REFACTOR are recorded)
  • Whether all verification criteria are met
  • Whether the acceptance tests pass (Playwright / unit tests / data validation)
  • Whether the fix records are reasonable (if there were fixes)
  • Whether the documentation has been synchronized (if there were changes)
  • Whether there are any unresolved issues

If the review finds issues:

  • Report the issue to the user, pause the pipeline, and wait for the user's decision:
    • Continue to the next task
    • Retry the current task (additional guidance can be provided)
    • Terminate the pipeline

If the review passes:

  • Record the results of this task (file changes, TDD records, issues, etc.) for the final report
  • Record the list of files produced by this task, as the {{前序任务产出}}
  • Proceed to the code commit step

3.4 Commit Code

After each Task passes review, the Main Agent immediately executes a git commit:

  1. Stage changes:git add .
  2. Commit code: the commit message format is feat(功能名): 完成 Task-XX [任务标题]
  3. Do not execute push(the push timing is decided by the user)

After the commit is complete, continue to the next task.

3.5 Phase Completion Handling

After all tasks in each phase are completed:

  1. Run the full test suite for that phase(execute the test command via the Bash tool)
  2. Report the phase completion status to the user(a brief summary; no user confirmation is needed to continue to the next phase)

Phase report format:

=== 阶段 [N]: [阶段名称] 完成 ===

已完成任务: [X/Y]
- Task-XX: [标题] - 成功
- Task-XX: [标题] - 成功

测试结果: 全部通过 (XX/XX)

继续执行阶段 [N+1]...

4. Status Update and Report Generation

After all specified tasks are completed:

4.1 Update the Task Plan Document

  • Mark completed tasks as [x]
  • Update the status of the acceptance criteria checklist
  • Save the updated document

4.2 Code Quality Check

  • Run Linter (ESLint/Prettier)
  • Run type checking (TypeScript)
  • Run the full test suite
  • Record the check results

4.3 Generate completion report

Read .claude/skills/feature-implementation/assets/stage-completion-report-template.md as a template, aggregate the execution results of all sub-Agents, and generate a completion report.

Report save path:docs/开发记录/[功能名]_自动流水线完成报告.md

If multiple stages were executed, organize the results by stage in the report.

4.4 Present the final summary to the user

=== 流水线执行完成 ===

功能: [功能名]
执行范围: 第 [M] ~ 第 [N] 阶段
完成任务: [X/Y] 个

各阶段状态:
- 阶段 1 [阶段名]: 全部完成 (X/X)
- 阶段 2 [阶段名]: 全部完成 (X/X)

测试汇总:
- 总测试数: XX
- 通过: XX
- 失败: 0

验收标准:
- AC-001: [描述] - 满足
- AC-002: [描述] - 满足
- AC-003: [描述] - 待后续阶段

完成报告: docs/开发记录/[功能名]_自动流水线完成报告.md

Exception handling

Case 1: Sub-Agent execution failure

Task-XX 执行失败

子 Agent 返回的错误信息:
[错误详情]

选项:
1. 重试此任务(可附加额外指导)
2. 跳过此任务,继续下一个
3. 终止流水线

请选择:

Case 2: Stage tests fail

阶段 [N] 测试未通过

失败的测试:
- [测试文件]: [失败描述]

选项:
1. 尝试自动修复(启动修复子 Agent)
2. 终止流水线,手动排查

请选择:

Case 3: Dependent task not completed

无法执行 Task-XX,依赖任务未完成:
- Task-YY: 未完成且不在执行序列中

选项:
1. 将 Task-YY 加入执行序列,先执行它
2. 跳过 Task-XX
3. 终止流水线

请选择:

Key rules

Rule 1: Do not write code

Main Agent (you)Never write any implementation code or test code. All coding work is done by sub-Agents. Your responsibility is orchestration and supervision.

Rule 2: Strictly serial

All tasks are executed strictly serially in order. Wait for the current sub-Agent to complete and review the results before starting the next sub-Agent.

Rule 3: State consistency

Sub-Agents do not update the task planning document. All state updates are performed uniformly by the Main Agent after all tasks are completed.

Rule 4: Stop on failure

When a sub-Agent returns a failure result, the Main Agent must pause and report to the user, and must not decide on its own to skip or retry.

Rule 5: Document synchronization

If a sub-Agent reports code changes that affect documentation, the Main Agent checks and updates the relevant documentation in the final stage.

Output

  • Code and test files for all completed tasks (created by sub-Agents)
  • Updated task planning document (task statuses checked off)
  • Automated pipeline completion report (docs/开发记录/[功能名]_自动流水线完成报告.md)
  • Terminal summary (the final summary presented to the user)