executing-jira-task
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseExecuting Jira Task
执行Jira任务
Purpose
用途
Execute exactly ONE task from the task plan through a structured pipeline of
specialist subagents. Each subagent handles a specific concern (planning,
testing, refactoring, implementation, documentation, code quality, architecture,
security, requirements verification), keeping the orchestrator's context clean
for coordination and decision-making.
The pipeline ensures tasks are completed with proper planning, test coverage,
clean code practices, sound architecture, verified security, and confirmed
requirements before moving on.
通过专业子Agent组成的结构化流水线,仅执行任务计划中的一个任务。每个子Agent负责特定的模块(规划、测试、重构、实现、文档编写、代码质量、架构、安全、需求验证),让编排器的上下文保持清晰,便于协调和决策。
该流水线可确保任务在进入下一阶段前,完成合理规划、测试覆盖、整洁代码实践、合理架构设计、安全验证以及需求确认。
Platform Compatibility
平台兼容性
This skill works across multiple AI coding tools. Each platform uses a
different syntax for dispatching subagents:
| Platform | Dispatch syntax |
|---|---|
| Claude Code CLI | |
| Cursor IDE | Place |
| OpenCode CLI | Subagents invoked via Task tool or |
All three platforms support the Agent Skills open standard (SKILL.md format).
The subagent files are self-contained markdown — each platform discovers and
dispatches them using its own native mechanism.
For Claude Code, place subagent files in (or reference
them from the skill's directory). For Cursor, place them in
(Cursor also reads from for compatibility).
For OpenCode, place them in or define them in
.
.md.claude/agents/subagents/.cursor/agents/.claude/agents/.opencode/agents/opencode.jsonIf your platform does not support native subagent dispatch, read the subagent
file and execute its instructions directly, keeping the subagent's output
contract intact so downstream steps can consume it.
本技能可在多个AI编码工具上运行,不同平台调用子Agent的语法不同:
| 平台 | 调用语法 |
|---|---|
| Claude Code CLI | |
| Cursor IDE | 将 |
| OpenCode CLI | 通过任务工具调用子Agent,或在消息中通过 |
以上三个平台都支持Agent技能开放标准(SKILL.md格式)。子Agent文件是自包含的markdown文件,各平台会通过自身原生机制发现并调用它们。
对于Claude Code,将子Agent的文件放入目录(或从技能的目录引用)。对于Cursor,将文件放入目录(Cursor为了兼容也会读取目录的内容)。对于OpenCode,将文件放入目录,或在中定义。
.md.claude/agents/subagents/.cursor/agents/.claude/agents/.opencode/agents/opencode.json如果你的平台不支持原生子Agent调用,可以直接读取子Agent文件并执行其指令,保留子Agent的输出约定,以便下游步骤可以正常消费输出内容。
Inputs
输入项
| Input | Source | Required | Example |
|---|---|---|---|
| User / | Yes | |
| User / | Yes | |
Both the ticket snapshot () and the task plan
() must exist. If either is missing, tell the user
which prerequisite skill to run.
docs/<TICKET_KEY>.mddocs/<TICKET_KEY>-tasks.md| 输入项 | 来源 | 是否必填 | 示例 |
|---|---|---|---|
| 用户 / | 是 | |
| 用户 / | 是 | |
工单快照()和任务计划()都必须存在。如果任意文件缺失,告知用户需要先运行对应的前置技能。
docs/<TICKET_KEY>.mddocs/<TICKET_KEY>-tasks.mdInput contract (produced by upstream skills)
输入约定(由上游技能生成)
The task plan file must contain these sections,
built up across the preceding phases:
docs/<TICKET_KEY>-tasks.md| Required section / element | Produced by | Used in step | Why |
|---|---|---|---|
| planning-jira-tasks | Step 1 (load) | Source content for the execution brief |
| planning-jira-tasks | Step 1 (pre-flight) | Validates dependencies are satisfied |
| clarifying-assumptions | Step 3 (brief) | Resolved decisions folded into execution context |
Per-task | clarifying-assumptions | Step 1 (pre-flight) | Pre-flight checks all questions are answered |
| creating-jira-subtasks | Step 13b (Jira) | Maps task number to Jira subtask key for status |
| creating-jira-subtasks | Step 13b (Jira) | Identifies which Jira issue to transition |
| executing-jira-task (self) | Step 1 (pre-flight) | Checks whether dependencies are marked complete |
Pre-flight gate: If the table is missing, subtasks were
not created in Jira. Warn the user and ask whether to proceed without Jira
integration or run the creating-jira-subtasks skill first. This is a warning,
not a hard block — execution can proceed without Jira tracking.
## Jira Subtasks任务计划文件必须包含以下部分,由前面的阶段逐步生成:
docs/<TICKET_KEY>-tasks.md| 所需章节/元素 | 生成方 | 使用步骤 | 用途 |
|---|---|---|---|
包含全部8个子章节的 | planning-jira-tasks | 步骤1(加载) | 执行概要的源内容 |
| planning-jira-tasks | 步骤1(预检) | 验证依赖已满足 |
| clarifying-assumptions | 步骤3(概要) | 已解决的决策会纳入执行上下文 |
每个任务的 | clarifying-assumptions | 步骤1(预检) | 预检确认所有问题都已回答 |
包含key的 | creating-jira-subtasks | 步骤13b(Jira) | 映射任务编号到Jira子任务key用于同步状态 |
每个任务章节中的 | creating-jira-subtasks | 步骤13b(Jira) | 识别要流转状态的Jira工单 |
已完成任务的 | executing-jira-task(自身) | 步骤1(预检) | 检查依赖是否标记为已完成 |
预检关卡: 如果缺失表格,说明还没有在Jira中创建子任务。警告用户并询问是无需Jira集成直接继续,还是先运行creating-jira-subtasks技能。这只是警告,不是强制阻塞——可以不使用Jira跟踪直接执行。
## Jira子任务Subagent Registry
子Agent注册表
| Subagent | Path | Purpose |
|---|---|---|
| | Pre-execution: validates task, sets up branch, transitions Jira to In Progress, assembles execution brief |
| | Analyzes the task, inspects the codebase, and produces an execution plan with skills |
| | Defines behaviour-driven tests based on business requirements, not implementation |
| | Evaluates whether existing code needs refactoring before or during task execution |
| | Performs the actual implementation work based on the execution brief — cautious by design |
| | Documents codebase changes, commits all work, and handles post-execution tracking (plan updates, Jira transitions) |
| | Reviews for Clean Code, SOLID principles; validates recency via context7 |
| | Reviews for DDD and functional programming principles; validates recency via context7 |
| | Audits for security vulnerabilities, credential leaks, and insecure patterns |
| | Pre-gate coverage check — confirms all requirements are met before quality gates run |
Before delegating, read the subagent file to understand its contract (expected
input format, output format, and rules). The path is relative to this skill's
directory.
| 子Agent | 路径 | 用途 |
|---|---|---|
| | 执行前准备:验证任务、创建分支、将Jira状态流转为进行中、组装执行概要 |
| | 分析任务、检视代码库、生成包含所需技能的执行计划 |
| | 基于业务需求定义行为驱动测试,而非基于实现细节 |
| | 评估任务执行前或执行过程中现有代码是否需要重构 |
| | 基于执行概要完成实际的实现工作,设计上偏向谨慎 |
| | 记录代码库变更、提交所有工作、处理执行后跟踪(计划更新、Jira状态流转) |
| | 评审整洁代码、SOLID原则合规性;通过context7验证内容时效性 |
| | 评审DDD和函数式编程原则合规性;通过context7验证内容时效性 |
| | 审计安全漏洞、凭证泄露、不安全编码模式 |
| | 前置覆盖检查——在质量门禁运行前确认所有需求都已满足 |
在委派任务前,请先阅读子Agent文件了解其约定(预期输入格式、输出格式和规则)。路径是相对于本技能目录的相对路径。
Skill Dependencies
技能依赖
All subagents depend on external skills that must be installed before
execution. These are validated by the orchestrator's
before execution begins AND by each subagent at runtime (defense-in-depth).
preflight-checkerIf any skill is missing, the subagent will STOP immediately and report
the missing skill to the orchestrator. The orchestrator will then prompt the
user to install the skill and re-dispatch the subagent from the beginning.
There is no fallback behavior — all skills are required.
| Subagent | Depends on | Level | Install command |
|---|---|---|---|
| | Required | |
| | Required | |
| | Required | |
| | Required | |
| | Required | |
| | Required | |
| | Required | |
| | Required | |
| | Required | |
| | Required | |
| | Required | |
| | Required | |
| Quality gates (all 3) | | Required | Connect context7 MCP in your IDE/CLI settings |
所有子Agent都依赖外部技能,必须在执行前安装完成。编排器的会在执行开始前验证依赖,且每个子Agent在运行时也会再次验证(深度防御)。
preflight-checker如果缺失任意技能,子Agent会立即停止并向编排器报告缺失的技能。编排器会提示用户安装该技能,然后从头重新调用子Agent。没有降级行为——所有技能都是必填项。
| 子Agent | 依赖技能 | 依赖级别 | 安装命令 |
|---|---|---|---|
| | 必须 | |
| | 必须 | |
| | 必须 | |
| | 必须 | |
| | 必须 | |
| | 必须 | |
| | 必须 | |
| | 必须 | |
| | 必须 | |
| | 必须 | |
| | 必须 | |
| | 必须 | |
| 全部3个质量门禁 | | 必须 | 在你的IDE/CLI设置中连接context7 MCP |
Output
输出
- Implemented code / configuration changes for the specified task.
- Tests covering business requirements.
- Documentation for all changes.
- Atomic commits for all changes (via /commit-work skill).
- Updated task plan with execution status.
- Jira subtask transitioned (if Jira MCP available and subtask keys present).
- 指定任务的已实现代码/配置变更
- 覆盖业务需求的测试
- 所有变更的文档
- 所有变更的原子提交(通过/commit-work技能实现)
- 带有执行状态的更新后任务计划
- Jira子任务状态流转(如果Jira MCP可用且存在子任务key)
Output contract (consumed by orchestrator and self)
输出约定(供编排器和自身消费)
After this skill completes for a given task, the plan file must contain these
updates:
| Addition | Consumed by | Why |
|---|---|---|
| orchestrator, self | Orchestrator tracks progress; self checks deps |
| orchestrator | Progress file gets a concise summary |
| orchestrator | Progress reporting |
| orchestrator | Reflects current state |
本技能完成指定任务的执行后,计划文件必须包含以下更新:
| 新增内容 | 消费方 | 用途 |
|---|---|---|
任务上的 | 编排器、本技能 | 编排器跟踪进度;本技能检查依赖 |
任务上的 | 编排器 | 进度文件的精简摘要 |
任务上的 | 编排器 | 进度上报 |
| 编排器 | 同步当前状态 |
Quality Gate Architecture
质量门禁架构
Three subagents serve as mandatory quality gates. ALL THREE must return a PASS
verdict for the task execution to be considered complete. The
runs before the gates (step 7) to confirm coverage
is complete — the gates then review code that is known to address all
requirements.
requirements-verifier| Gate | Concern | Runs after |
|---|---|---|
| Clean Code, SOLID, test quality, documentation | |
| DDD, functional programming, bounded contexts | |
| Vulnerabilities, credential leaks, insecure patterns | |
三个子Agent作为强制质量门禁,必须全部返回通过判定,才算任务执行完成。会在门禁前运行(步骤7)确认需求覆盖完整——之后门禁才会评审已知满足所有需求的代码。
requirements-verifier| 门禁 | 检查项 | 运行时机 |
|---|---|---|
| 整洁代码、SOLID、测试质量、文档 | |
| DDD、函数式编程、限界上下文 | |
| 漏洞、凭证泄露、不安全编码模式 | |
On quality gate failure — targeted fix cycle
质量门禁未通过的处理——定向修复循环
If ANY gate returns a verdict other than PASS, the pipeline does NOT re-run
from the beginning. Instead, a targeted fix cycle is triggered:
- The failing gate's feedback (specific issues, file paths, and recommended fixes) is collected.
- The subagent is re-dispatched with the original execution brief PLUS the gate feedback as additional context. The executor addresses only the issues raised by the failing gate — it does not redo the entire implementation.
task-executor - The subagent is re-dispatched to commit the fixes as atomic commits.
documentation-writer - The failing gate is re-run to verify the fixes.
If multiple gates fail in the same run, all gate feedback is collected and
passed to the task-executor together, so all issues are addressed in one fix
cycle. After the fixes are committed, ALL previously failing gates are re-run
in their original order.
Fix cycle limit: Maximum 3 targeted fix cycles per task. If the quality
gates still do not pass after 3 fix cycles, escalate to the user with the
accumulated gate feedback and ask how to proceed.
A full pipeline re-run (from step 1) is reserved for cases where the gate
feedback indicates a fundamental approach failure — not code quality issues.
The orchestrator makes this judgment call when the fix cycle limit is
exhausted.
The quality gates also enforce a commit discipline rule: if any gate
detects uncommitted changes in the working tree, it MUST stop immediately and
report this to the orchestrator. The orchestrator will then require the
subagent to commit all pending changes before the gates
can re-run. This ensures that reviewers always review committed, traceable code.
documentation-writer如果任意门禁返回非通过判定,流水线不会从头重新运行,而是触发定向修复循环:
- 收集未通过门禁的反馈(具体问题、文件路径、建议修复方案)
- 重新调用子Agent,传入原始执行概要加上门禁反馈作为额外上下文。执行器仅处理未通过门禁提出的问题,不会重做整个实现。
task-executor - 重新调用子Agent,将修复内容作为原子提交。
documentation-writer - 重新运行未通过的门禁验证修复效果。
如果同一次运行中多个门禁未通过,会收集所有门禁反馈一起传给task-executor,这样所有问题可以在一个修复循环中处理完成。修复提交后,所有之前未通过的门禁会按原顺序重新运行。
修复循环限制: 每个任务最多进行3次定向修复循环。如果3次循环后质量门禁仍未通过,将累计的门禁反馈上报给用户,询问后续处理方案。
仅当门禁反馈表明基础实现方案存在根本性错误时,才会从头重新运行整个流水线(从步骤1开始),代码质量问题不会触发全量重跑。修复循环次数耗尽后由编排器做出该判断。
质量门禁还会强制提交规范规则:如果任意门禁检测到工作区存在未提交的变更,必须立即停止并向编排器报告。编排器会要求子Agent先提交所有待处理变更,才能重新运行门禁。这确保评审的始终是已提交的、可追溯的代码。
documentation-writerExecution Steps
执行步骤
1. Dispatch: Execution Prepper
1. 调用:执行准备器
Read and dispatch the execution-prepper
subagent with:
./subagents/execution-prepper.mdTICKET_KEYTASK_NUMBER- (if the orchestrator or user specified a branch name)
BRANCH_OVERRIDE
The execution-prepper handles four setup steps in one dispatch:
- Validates the task — checks that the task exists, dependencies are marked complete, and all questions are resolved.
- Ensures the working branch — checks current branch, creates or switches to the feature branch, stashes uncommitted changes if needed.
- Transitions the Jira subtask to "In Progress" — if the subtask key and Jira MCP are available. Skips silently if not.
- Assembles the execution brief — reads the task plan and Decisions Log,
builds a self-contained brief, writes it to
.
docs/<TICKET_KEY>-task-<N>-brief.md
Collect its output as the .
PREP_SUMMARYIf pre-flight FAIL: The subagent reports what needs resolution (unsatisfied
dependencies or unresolved questions). Relay this to the user and stop — do
not proceed to the execution pipeline.
If an existing ticket branch was found: The subagent notes this. Ask the
user whether to reuse the existing branch or create a new task-level branch.
If the user chooses to reuse, re-dispatch with the branch name as
.
BRANCH_OVERRIDEIf changes were stashed: Inform the user that uncommitted changes were
stashed and will need to be popped later.
After the prep summary confirms PASS, proceed to step 2 using the brief file
path from the summary.
读取,调用execution-prepper子Agent,传入以下参数:
./subagents/execution-prepper.mdTICKET_KEYTASK_NUMBER- (如果编排器或用户指定了分支名)
BRANCH_OVERRIDE
execution-prepper会在一次调用中完成四个准备步骤:
- 验证任务 —— 检查任务是否存在、依赖是否标记为已完成、所有问题是否已解决。
- 确保工作分支可用 —— 检查当前分支,创建或切换到功能分支,必要时暂存未提交的变更。
- 将Jira子任务流转为“进行中” —— 如果子任务key和Jira MCP可用,否则静默跳过。
- 组装执行概要 —— 读取任务计划和决策日志,构建自包含的执行概要,写入。
docs/<TICKET_KEY>-task-<N>-brief.md
收集其输出作为。
PREP_SUMMARY如果预检失败: 子Agent会报告需要解决的问题(未满足的依赖或未解决的问题)。将问题转告用户并停止——不要继续执行流水线。
如果找到已有的工单分支: 子Agent会记录该情况。询问用户是复用现有分支还是创建新的任务级分支。如果用户选择复用,传入分支名作为重新调用。
BRANCH_OVERRIDE如果有变更被暂存: 告知用户未提交的变更已被暂存,之后需要手动弹出。
准备摘要确认通过后,使用摘要中的概要文件路径进入步骤2。
2. Dispatch: Execution Planner
2. 调用:执行规划器
Read and dispatch the execution-planner
subagent with the execution brief path.
./subagents/execution-planner.mdThe execution-planner will:
- Analyse the task and the relevant parts of the codebase.
- Use the skill to identify the best available skills for the task.
/find-skills - Produce a structured execution plan with recommended skills, approach, and file-level strategy.
Collect its output as the . This plan feeds into all
subsequent subagents.
EXECUTION_PLAN读取,传入执行概要文件路径调用execution-planner子Agent。
./subagents/execution-planner.mdexecution-planner会完成以下工作:
- 分析任务和代码库的相关部分
- 使用技能识别最适合该任务的可用技能
/find-skills - 生成结构化的执行计划,包含推荐技能、实现方案、文件级策略
收集其输出作为,该计划会输入到所有后续子Agent中。
EXECUTION_PLAN3. Dispatch: Test Strategist
3. 调用:测试策略师
Read and dispatch the test-strategist
subagent with the execution brief and the .
./subagents/test-strategist.mdEXECUTION_PLANThe test strategist will:
- Analyse the business requirements from the execution brief.
- Define a list of behaviour-driven tests (not implementation-detail tests).
- Produce a test specification that the task-executor will implement.
Collect its output as the .
TEST_SPEC读取,传入执行概要和调用test-strategist子Agent。
./subagents/test-strategist.mdEXECUTION_PLANtest-strategist会完成以下工作:
- 分析执行概要中的业务需求
- 定义行为驱动测试列表(而非实现细节相关的测试)
- 生成测试规范,供task-executor实现
收集其输出作为。
TEST_SPEC4. Dispatch: Refactoring Advisor
4. 调用:重构顾问
Read and dispatch the refactoring-advisor
subagent with the execution brief, , and .
./subagents/refactoring-advisor.mdEXECUTION_PLANTEST_SPECThe refactoring advisor will:
- Evaluate whether existing code needs changes to accommodate the task cleanly.
- Identify refactoring opportunities that prevent code rot.
- Produce a refactoring recommendation (which may be "no refactoring needed").
Collect its output as the .
REFACTORING_PLAN读取,传入执行概要、和调用refactoring-advisor子Agent。
./subagents/refactoring-advisor.mdEXECUTION_PLANTEST_SPECrefactoring-advisor会完成以下工作:
- 评估现有代码是否需要变更才能适配当前任务
- 识别可避免代码腐化的重构机会
- 生成重构建议(可能是“无需重构”)
收集其输出作为。
REFACTORING_PLAN5. Dispatch: Task Executor
5. 调用:任务执行器
Read and dispatch the task-executor subagent
with the execution brief, , , and .
./subagents/task-executor.mdEXECUTION_PLANTEST_SPECREFACTORING_PLANThe task executor operates under a cautious execution model: it will STOP
and report back to the orchestrator whenever it encounters ambiguity, unclear
intent, uncertain architectural decisions, or any situation where the correct
course of action is not explicitly documented in its inputs. The orchestrator
must then resolve the ambiguity and re-dispatch the task-executor with updated
guidance.
The task executor will:
- Apply any recommended refactoring first.
- Implement the task following the execution plan and recommended skills.
- Write and run the tests from the test specification.
- STOP and escalate if anything is unclear — it does NOT guess or assume.
- Produce an execution report.
Collect its output as the .
EXECUTION_REPORTIf the task-executor stops due to ambiguity:
- Review the reported ambiguity.
- Resolve it with the user if needed.
- Update the execution brief with the resolution.
- Re-dispatch the task-executor with the updated brief and the
from the previous run.
PARTIAL_EXECUTION_REPORT
Note: The task-executor does NOT write documentation — that is handled
separately by the documentation-writer subagent.
读取,传入执行概要、、和调用task-executor子Agent。
./subagents/task-executor.mdEXECUTION_PLANTEST_SPECREFACTORING_PLANtask-executor遵循谨慎执行模型:每当遇到歧义、意图不明确、不确定的架构决策,或任何正确处理方式未在输入中明确说明的场景时,都会停止并向编排器报告。编排器必须解决歧义后,传入更新后的指引重新调用task-executor。
task-executor会完成以下工作:
- 先应用所有推荐的重构
- 按照执行计划和推荐技能实现任务
- 编写并运行测试规范中的测试
- 遇到任何不明确的内容立即停止并上报——不会猜测或假设
- 生成执行报告
收集其输出作为。
EXECUTION_REPORT如果task-executor因歧义停止:
- 评审上报的歧义问题
- 必要时和用户一起解决问题
- 更新执行概要,记录解决方案
- 传入更新后的概要和上一次运行的,重新调用task-executor。
PARTIAL_EXECUTION_REPORT
注意: task-executor不编写文档——该工作由documentation-writer子Agent单独处理。
6. Dispatch: Documentation Writer
6. 调用:文档编写师
Read and dispatch the documentation-writer
subagent with the , , and .
./subagents/documentation-writer.mdEXECUTION_REPORTTICKET_KEYTASK_NUMBERThe documentation writer will:
- Review all changes made by the task-executor.
- Add or update code comments, docstrings, and inline documentation ONLY in files that the task-executor changed. It does NOT modify any other files.
- Use the skill to ensure all written text reads naturally.
/humanizer - Use the skill to commit all changes (implementation, tests, and documentation) as atomic, logically scoped commits. It does NOT ask for user confirmation — it commits directly.
/commit-work - Update the task plan with completion status, implementation summary, and files changed.
- Transition the Jira subtask to "Done" (if MCP available and subtask key present).
- Update the table status to "Done".
## Jira Subtasks - Produce a documentation report including commits, tracking updates, and any issues.
Collect its output as the .
DOCUMENTATION_REPORT读取,传入、和调用documentation-writer子Agent。
./subagents/documentation-writer.mdEXECUTION_REPORTTICKET_KEYTASK_NUMBERdocumentation-writer会完成以下工作:
- 评审task-executor的所有变更
- 仅在task-executor修改过的文件中新增或更新代码注释、文档字符串、内联文档,不会修改其他任何文件
- 使用技能确保所有文本自然可读
/humanizer - 使用技能将所有变更(实现、测试、文档)作为逻辑独立的原子提交,无需用户确认——直接提交
/commit-work - 更新任务计划,添加完成状态、实现摘要、变更文件列表
- 将Jira子任务流转为“已完成”(如果MCP可用且存在子任务key)
- 更新表格状态为“已完成”
## Jira子任务 - 生成文档报告,包含提交记录、跟踪更新、任何问题
收集其输出作为。
DOCUMENTATION_REPORT7. Dispatch: Requirements Verifier (pre-gate coverage check)
7. 调用:需求验证器(门禁前覆盖检查)
Read and dispatch the
requirements-verifier subagent with the execution brief, ,
, and .
./subagents/requirements-verifier.mdTEST_SPECEXECUTION_REPORTDOCUMENTATION_REPORTThe requirements verifier runs BEFORE the quality gates to catch coverage
gaps early. This prevents the gates from reviewing code that is missing
functionality — wasting a full gate cycle on incomplete work.
The requirements verifier will:
- Cross-check every item in the Definition of Done against the actual changes.
- Verify test coverage matches business requirements.
- Confirm documentation is complete.
- Produce a verification verdict: PASS or FAIL with specific gaps.
If the verdict is FAIL: Report the gaps to the user and ask whether to
address the missing requirements before running the quality gates, or proceed
with the gates on the current implementation. Do NOT automatically re-run
the pipeline — let the user decide.
If the verdict is PASS: Proceed to the quality gates.
Collect its output as the . Pass it to the quality
gates as additional context so they know whether requirements coverage is
complete.
VERIFICATION_RESULT读取,传入执行概要、、和调用requirements-verifier子Agent。
./subagents/requirements-verifier.mdTEST_SPECEXECUTION_REPORTDOCUMENTATION_REPORT需求验证器在质量门禁前运行,尽早发现覆盖缺口,避免门禁评审功能缺失的代码——浪费门禁周期在未完成的工作上。
requirements-verifier会完成以下工作:
- 对照实际变更交叉检查完成定义中的每一项
- 验证测试覆盖匹配业务需求
- 确认文档完整
- 生成验证判定:通过,或带有具体缺口的不通过
如果判定为不通过: 将缺口报告给用户,询问是在运行质量门禁前先补全缺失的需求,还是基于当前实现继续运行门禁。不要自动重新运行流水线——让用户决定。
如果判定为通过: 进入质量门禁阶段。
收集其输出作为,将其作为额外上下文传给质量门禁,让门禁知晓需求覆盖是否完整。
VERIFICATION_RESULT8. Dispatch: Clean Code Reviewer (Quality Gate 1/3)
8. 调用:整洁代码评审员(质量门禁1/3)
Read and dispatch the clean-code-reviewer
subagent with the execution brief, , ,
, , and .
./subagents/clean-code-reviewer.mdTEST_SPECREFACTORING_PLANEXECUTION_REPORTDOCUMENTATION_REPORTVERIFICATION_RESULTPre-gate check: The clean-code-reviewer will first check for uncommitted
changes. If uncommitted changes exist, it stops and reports this — the
orchestrator must ensure the documentation-writer commits all pending work
before the review can proceed.
The clean code reviewer will:
- Use the skill as its primary review reference (required — subagent will stop if not available).
/clean-code - Review the full picture: task requirements, tests, refactoring decisions, implementation, and documentation.
- Check for Clean Code and SOLID principles compliance.
- Use the MCP to retrieve up-to-date documentation for libraries used in the project, ensuring recommendations reflect current best practices.
context7 - Produce a review verdict: PASS, PASS WITH SUGGESTIONS, or NEEDS FIXES.
If verdict is NEEDS FIXES: Collect the review feedback. Do NOT stop the
gate cycle — continue to the architecture-reviewer and security-auditor so
all issues are identified in one pass. After all three gates have run, trigger
a targeted fix cycle (see Quality Gate Architecture above).
Collect the output as the .
CODE_REVIEW读取,传入执行概要、、、、和调用clean-code-reviewer子Agent。
./subagents/clean-code-reviewer.mdTEST_SPECREFACTORING_PLANEXECUTION_REPORTDOCUMENTATION_REPORTVERIFICATION_RESULT门禁前置检查: clean-code-reviewer会首先检查是否存在未提交的变更。如果存在未提交的变更,会停止并报告——编排器必须确保documentation-writer先提交所有待处理工作,才能继续评审。
clean-code-reviewer会完成以下工作:
- 使用技能作为主要评审参考(必填——如果不可用子Agent会停止)
/clean-code - 评审全链路内容:任务需求、测试、重构决策、实现、文档
- 检查整洁代码和SOLID原则合规性
- 使用MCP获取项目所用库的最新文档,确保推荐符合当前最佳实践
context7 - 生成评审判定:通过、有建议通过、需要修复
如果判定为需要修复: 收集评审反馈,不要停止门禁流程——继续运行architecture-reviewer和security-auditor,一次性识别所有问题。三个门禁全部运行完成后,触发定向修复循环(见上文质量门禁架构)。
收集输出作为。
CODE_REVIEW9. Dispatch: Architecture Reviewer (Quality Gate 2/3)
9. 调用:架构评审员(质量门禁2/3)
Read and dispatch the
architecture-reviewer subagent with the execution brief, ,
, , , and .
./subagents/architecture-reviewer.mdEXECUTION_PLANEXECUTION_REPORTDOCUMENTATION_REPORTVERIFICATION_RESULTCODE_REVIEWPre-gate check: The architecture-reviewer will first check for uncommitted
changes. If uncommitted changes exist, it stops and reports this.
The architecture reviewer will:
- Use the skill as its primary review reference (required — subagent will stop if not available).
/architecture-patterns - Verify that changes follow domain-driven design principles: bounded contexts, aggregates, entities, value objects, domain events, and ubiquitous language.
- Verify that changes follow functional programming principles: functional composition, immutability, pure functions, and declarative patterns.
- Explicitly NOT enforce OOP patterns — the codebase should favor composition over inheritance, data transformations over stateful objects.
- Use the MCP to retrieve up-to-date documentation for libraries used in the project.
context7 - Produce a review verdict: PASS, PASS WITH SUGGESTIONS, or NEEDS FIXES.
If verdict is NEEDS FIXES: Collect the review feedback. Continue to the
security-auditor so all issues are identified in one pass.
Collect the output as the .
ARCHITECTURE_REVIEW读取,传入执行概要、、、、和调用architecture-reviewer子Agent。
./subagents/architecture-reviewer.mdEXECUTION_PLANEXECUTION_REPORTDOCUMENTATION_REPORTVERIFICATION_RESULTCODE_REVIEW门禁前置检查: architecture-reviewer会首先检查是否存在未提交的变更。如果存在未提交的变更,会停止并报告。
architecture-reviewer会完成以下工作:
- 使用技能作为主要评审参考(必填——如果不可用子Agent会停止)
/architecture-patterns - 验证变更符合领域驱动设计原则:限界上下文、聚合、实体、值对象、领域事件、通用语言
- 验证变更符合函数式编程原则:函数组合、不可变性、纯函数、声明式模式
- 明确不强制OOP模式——代码库应该优先选择组合而非继承,优先选择数据转换而非有状态对象
- 使用MCP获取项目所用库的最新文档
context7 - 生成评审判定:通过、有建议通过、需要修复
如果判定为需要修复: 收集评审反馈,继续运行security-auditor,一次性识别所有问题。
收集输出作为。
ARCHITECTURE_REVIEW10. Dispatch: Security Auditor (Quality Gate 3/3)
10. 调用:安全审计员(质量门禁3/3)
Read and dispatch the security-auditor
subagent with the execution brief, ,
, , , and .
./subagents/security-auditor.mdEXECUTION_REPORTDOCUMENTATION_REPORTVERIFICATION_RESULTCODE_REVIEWARCHITECTURE_REVIEWPre-gate check: The security-auditor will first check for uncommitted
changes. If uncommitted changes exist, it stops and reports this.
The security auditor will:
- Use the skill as its primary audit reference (required — subagent will stop if not available).
/api-security-best-practices - Audit all changes for security vulnerabilities (injection, XSS, CSRF, insecure deserialization, broken access control, etc.).
- Check for credential leaks, hardcoded secrets, and sensitive information exposure in code, comments, logs, or error messages.
- Verify secure coding patterns (input validation, output encoding, authentication/authorization checks, secure defaults).
- Use the MCP to retrieve up-to-date security documentation for libraries used in the project.
context7 - Produce an audit verdict: PASS, PASS WITH ADVISORIES, or NEEDS FIXES.
If verdict is NEEDS FIXES: Collect the audit feedback.
读取,传入执行概要、、、、和调用security-auditor子Agent。
./subagents/security-auditor.mdEXECUTION_REPORTDOCUMENTATION_REPORTVERIFICATION_RESULTCODE_REVIEWARCHITECTURE_REVIEW门禁前置检查: security-auditor会首先检查是否存在未提交的变更。如果存在未提交的变更,会停止并报告。
security-auditor会完成以下工作:
- 使用技能作为主要审计参考(必填——如果不可用子Agent会停止)
/api-security-best-practices - 审计所有变更的安全漏洞(注入、XSS、CSRF、不安全反序列化、访问控制失效等)
- 检查代码、注释、日志、错误消息中的凭证泄露、硬编码密钥、敏感信息暴露问题
- 验证安全编码模式(输入验证、输出编码、认证/授权检查、安全默认值)
- 使用MCP获取项目所用库的最新安全文档
context7 - 生成审计判定:通过、有警告通过、需要修复
如果判定为需要修复: 收集审计反馈。
10a. Targeted fix cycle (if any gate returned NEEDS FIXES)
10a. 定向修复循环(如果任意门禁返回需要修复)
After all three gates have run, check whether any returned NEEDS FIXES. If
all three passed, skip to step 11.
If one or more gates returned NEEDS FIXES:
-
Collect all feedback. Merge the NEEDS FIXES feedback from every failing gate into a single consolidated fix brief. Include specific file paths, line numbers, and recommended fixes from each gate.
-
Re-dispatch the task-executor. Pass the original execution brief PLUS the consolidated fix brief as additional context. The executor addresses only the issues raised by the failing gates — it does not redo the entire implementation.
-
Re-dispatch the documentation-writer. Pass the fix execution report so the documentation-writer can commit the fixes as atomic commits.
-
Re-run only the previously failing gates. If only the security-auditor failed, only re-run the security-auditor. If clean-code-reviewer and architecture-reviewer both failed, re-run both (in their original order). Gates that already passed do not need to re-run.
-
Check results. If all re-run gates now pass, continue to step 11. If any still fail, repeat this fix cycle.
Fix cycle limit: Maximum 3 targeted fix cycles per task. If the quality
gates still do not pass after 3 fix cycles, escalate to the user with the
accumulated gate feedback and ask how to proceed. The user may choose to:
- Accept the current state and move on.
- Provide guidance for a different approach.
- Request a full pipeline re-run from step 1 (reserved for fundamental approach failures, not code quality issues).
Collect the output as the .
SECURITY_AUDIT三个门禁全部运行完成后,检查是否有门禁返回需要修复。如果全部通过,跳过到步骤11。
如果有一个或多个门禁返回需要修复:
- 收集所有反馈。 将所有未通过门禁的需要修复反馈合并为统一的修复概要,包含每个门禁提出的具体文件路径、行号、建议修复方案。
- 重新调用task-executor。 传入原始执行概要加上合并后的修复概要作为额外上下文。执行器仅处理未通过门禁提出的问题,不会重做整个实现。
- 重新调用documentation-writer。 传入修复执行报告,让documentation-writer将修复内容作为原子提交。
- 仅重新运行之前未通过的门禁。 如果只有security-auditor未通过,仅重新运行security-auditor。如果clean-code-reviewer和architecture-reviewer都未通过,按原顺序重新运行这两个。已经通过的门禁不需要重新运行。
- 检查结果。 如果所有重新运行的门禁现在都通过,继续到步骤11。如果仍有未通过的,重复该修复循环。
修复循环限制: 每个任务最多进行3次定向修复循环。如果3次循环后质量门禁仍未通过,将累计的门禁反馈上报给用户,询问后续处理方案。用户可以选择:
- 接受当前状态继续
- 提供其他实现方案的指引
- 请求从步骤1开始全量重跑流水线(仅用于基础实现方案失败的情况,不用于代码质量问题)
收集输出作为。
SECURITY_AUDIT11. Clean up
11. 清理
Delete the temporary execution brief file:
bash
rm -f docs/<TICKET_KEY>-task-<N>-brief.mdCleanup failure is non-critical — log a warning but do not block.
Note: Post-execution tracking (plan file updates, Jira subtask transitions,
Jira Subtasks table updates) is handled by the subagent
in step 6. Check the for the tracking status. If any
tracking update failed, relay it to the user in the report below.
documentation-writerDOCUMENTATION_REPORT删除临时执行概要文件:
bash
rm -f docs/<TICKET_KEY>-task-<N>-brief.md清理失败不影响流程——记录警告即可,不要阻塞执行。
注意: 执行后跟踪(计划文件更新、Jira子任务状态流转、Jira子任务表格更新)由步骤6中的子Agent处理。检查中的跟踪状态。如果有跟踪更新失败,在下方的报告中转告用户。
documentation-writerDOCUMENTATION_REPORT12. Report to user
12. 向用户报告
Task <N> complete: <Title>
Summary: <what was done in 2-3 sentences>
Pipeline results:
- Prep: <branch name, pre-flight PASS>
- Planning: <skills recommended, approach taken>
- Tests: <N tests defined, N passing>
- Refactoring: <what was refactored, or "none needed">
- Implementation: <files changed count>
- Documentation: <what was documented>
- Commits: <N atomic commits created>
- Tracking: <plan updated, Jira transitioned — from DOCUMENTATION_REPORT>
- Requirements verification: <PASS/FAIL> (pre-gate coverage check)
- Code review: <PASS/PASS WITH NOTES> (recency-validated via context7)
- Architecture review: <PASS/PASS WITH NOTES> (DDD + FP validated)
- Security audit: <PASS/PASS WITH ADVISORIES>
Commits:
- <short hash> — <commit message>
- <short hash> — <commit message>
Files changed:
- <list>
Jira subtask <KEY>: transitioned to Done.
⚠️ Remaining items (if any):
- <anything that could not be fully resolved>
Ready for the next task? Let me know which one to tackle.任务 <N> 已完成:<标题>
摘要:<用2-3句话说明完成的工作>
流水线结果:
- 准备:<分支名,预检通过>
- 规划:<推荐的技能,采用的实现方案>
- 测试:<定义N个测试,N个通过>
- 重构:<重构的内容,或“无需重构”>
- 实现:<变更文件数量>
- 文档:<记录的内容>
- 提交:<创建N个原子提交>
- 跟踪:<计划已更新,Jira状态已流转——来自DOCUMENTATION_REPORT>
- 需求验证:<通过/不通过>(门禁前覆盖检查)
- 代码评审:<通过/有备注通过>(通过context7验证时效性)
- 架构评审:<通过/有备注通过>(DDD + FP验证通过)
- 安全审计:<通过/有警告通过>
提交记录:
- <短哈希> — <提交信息>
- <短哈希> — <提交信息>
变更文件:
- <列表>
Jira子任务 <KEY>:已流转为已完成。
⚠️ 剩余待处理项(如果有):
- <未完全解决的内容>
准备好处理下一个任务了吗?告诉我要处理哪个任务即可。Safety Rules
安全规则
- One task at a time. Never auto-continue to the next task.
- Scope discipline. Do not implement anything outside the task's scope, even if it seems like a quick win.
- Fail loudly. If any subagent encounters ambiguity or a blocker, surface it to the user immediately rather than making assumptions.
- Preserve the plan. The task plan is the source of truth. If execution reveals the plan needs changes, propose the change to the user — do not silently modify the plan.
- Respect the pipeline order. Do not skip subagent steps or reorder them. Each step depends on the output of the previous one.
- Limit retries. The task-executor gets at most 3 retry cycles for ambiguity escalations within a single pipeline run. The targeted fix cycle (triggered by quality gate failures) is limited to 3 iterations within this skill. Full pipeline re-runs are reserved for fundamental approach failures and require user approval.
- Quality gates are non-negotiable. All three quality gates (clean-code, architecture, security) must pass. There is no override, no "good enough."
- 每次仅执行一个任务。 绝对不要自动继续执行下一个任务。
- 范围管控。 不要实现任何超出任务范围的内容,哪怕看起来是很容易实现的优化。
- 明确报错。 如果任意子Agent遇到歧义或阻塞,立即向用户反馈,不要自行假设。
- 保护计划完整性。 任务计划是唯一可信源。如果执行过程中发现计划需要变更,向用户提出变更建议——不要悄悄修改计划。
- 遵守流水线顺序。 不要跳过子Agent步骤或调整顺序,每个步骤都依赖前一步的输出。
- 限制重试次数。 单次流水线运行中,task-executor最多可以因歧义上报重试3次。质量门禁失败触发的定向修复循环在本技能中最多迭代3次。全量重跑流水线仅用于基础实现方案失败的场景,且需要用户批准。
- 质量门禁不可妥协。 三个质量门禁(整洁代码、架构、安全)必须全部通过,没有例外,没有“足够好”的情况。
Handling BLOCKED Verdicts (Missing Required Skills)
处理阻塞判定(缺失必填技能)
Every subagent checks for its required skills as its absolute first step
(defense-in-depth). If a subagent returns a verdict:
BLOCKED — MISSING REQUIRED SKILL- Do NOT proceed to the next pipeline step. The blocked subagent's output is required by downstream steps.
- Present the missing skill(s) to the user with install commands from the subagent's report.
- Wait for the user to confirm the skill(s) have been installed.
- Re-dispatch the blocked subagent from the beginning. Do not attempt to resume from a partial state — the subagent performs no work before the skill check, so there is nothing to resume.
This applies to ANY subagent in the pipeline (steps 1–10). The orchestrator
should present the install instructions clearly:
⚠️ Missing required skill — pipeline paused
The <subagent-name> subagent requires the following skill(s):
- `/<skill-name>` — <purpose>
Install: `skills install <path>`
Please install the skill(s) and let me know when ready to continue.After the user confirms installation, re-dispatch the same subagent with the
same inputs it was originally given.
每个子Agent的第一步都会检查所需技能(深度防御)。如果子Agent返回判定:
阻塞 — 缺失必填技能- 不要继续执行下一个流水线步骤。下游步骤依赖被阻塞子Agent的输出。
- 向用户展示缺失的技能,附带子Agent报告中的安装命令。
- 等待用户确认技能已安装完成。
- 从头重新调用被阻塞的子Agent。 不要尝试从部分状态恢复——子Agent在技能检查前不会执行任何工作,所以没有可恢复的内容。
该规则适用于流水线中的任意子Agent(步骤1-10)。编排器应该清晰展示安装说明:
⚠️ 缺失必填技能 — 流水线已暂停
<subagent-name>子Agent需要以下技能:
- `/<skill-name>` — <用途>
安装命令:`skills install <路径>`
请安装该技能,准备好后告诉我继续。用户确认安装完成后,使用原始输入重新调用同一个子Agent。