kata-audit-milestone
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Verify milestone achieved its definition of done. Check requirements coverage, cross-phase integration, and end-to-end flows.
This command IS the orchestrator. Reads existing VERIFICATION.md files (phases already verified during phase-execute), aggregates tech debt and deferred gaps, then spawns integration checker for cross-phase wiring.
</objective>
<execution_context>
<!-- Spawns kata-integration-checker agent which has all audit expertise baked in -->
</execution_context>
<context>
Version: $ARGUMENTS (optional — defaults to current milestone)
Original Intent:
@.planning/PROJECT.md
@.planning/REQUIREMENTS.md
Planned Work:
@.planning/ROADMAP.md
@.planning/config.json (if exists)
Completed Work:
Glob: .planning/phases/{active,pending,completed}//-SUMMARY.md
Glob: .planning/phases/{active,pending,completed}//-VERIFICATION.md
(Also check flat: .planning/phases/[0-9]/-SUMMARY.md for backward compatibility)
</context>
<process><objective>
验证里程碑是否达成其完成定义。检查需求覆盖情况、跨阶段集成以及端到端流程。
此命令是编排器。 读取现有的VERIFICATION.md文件(阶段已在phase-execute期间验证),汇总技术债务和延迟解决的差距,然后生成集成检查器来检查跨阶段连接。
</objective>
<execution_context>
<!-- 生成kata-integration-checker agent,该agent内置所有审计专业能力 -->
</execution_context>
<context>
版本: $ARGUMENTS (可选 — 默认使用当前里程碑)
原始意图:
@.planning/PROJECT.md
@.planning/REQUIREMENTS.md
计划工作:
@.planning/ROADMAP.md
@.planning/config.json (如果存在)
已完成工作:
通配符: .planning/phases/{active,pending,completed}//-SUMMARY.md
通配符: .planning/phases/{active,pending,completed}//-VERIFICATION.md
(同时检查扁平结构: .planning/phases/[0-9]/-SUMMARY.md 以实现向后兼容)
</context>
<process>0. Resolve Model Profile
0. 解析模型配置文件
Read model profile for agent spawning:
bash
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")Default to "balanced" if not set.
Model lookup table:
| Agent | quality | balanced | budget |
|---|---|---|---|
| kata-integration-checker | sonnet | sonnet | haiku |
Store resolved model for use in Task call below.
读取用于生成agent的模型配置文件:
bash
MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")如果未设置,则默认使用"balanced"。
模型查找表:
| Agent | quality | balanced | budget |
|---|---|---|---|
| kata-integration-checker | sonnet | sonnet | haiku |
存储解析后的模型,供后续Task调用使用。
1. Determine Milestone Scope
1. 确定里程碑范围
bash
undefinedbash
undefinedScan all phase directories across states
扫描所有状态下的阶段目录
ALL_PHASE_DIRS=""
for state in active pending completed; do
[ -d ".planning/phases/${state}" ] && ALL_PHASE_DIRS="${ALL_PHASE_DIRS} $(find .planning/phases/${state} -maxdepth 1 -type d -not -name "${state}" 2>/dev/null)"
done
ALL_PHASE_DIRS=""
for state in active pending completed; do
[ -d ".planning/phases/${state}" ] && ALL_PHASE_DIRS="${ALL_PHASE_DIRS} $(find .planning/phases/${state} -maxdepth 1 -type d -not -name "${state}" 2>/dev/null)"
done
Fallback: include flat directories (backward compatibility)
回退方案:包含扁平目录(向后兼容)
FLAT_DIRS=$(find .planning/phases -maxdepth 1 -type d -name "[0-9]*" 2>/dev/null)
[ -n "$FLAT_DIRS" ] && ALL_PHASE_DIRS="${ALL_PHASE_DIRS} ${FLAT_DIRS}"
echo "$ALL_PHASE_DIRS" | tr ' ' '\n' | sort -V
- Parse version from arguments or detect current from ROADMAP.md
- Identify all phase directories in scope (across active/pending/completed subdirectories)
- Extract milestone definition of done from ROADMAP.md
- Extract requirements mapped to this milestone from REQUIREMENTS.mdFLAT_DIRS=$(find .planning/phases -maxdepth 1 -type d -name "[0-9]*" 2>/dev/null)
[ -n "$FLAT_DIRS" ] && ALL_PHASE_DIRS="${ALL_PHASE_DIRS} ${FLAT_DIRS}"
echo "$ALL_PHASE_DIRS" | tr ' ' '\n' | sort -V
- 从参数中解析版本,或从ROADMAP.md中检测当前版本
- 确定范围内的所有阶段目录(涵盖active/pending/completed子目录)
- 从ROADMAP.md中提取里程碑的完成定义
- 从REQUIREMENTS.md中提取与此里程碑关联的需求2. Read All Phase Verifications
2. 读取所有阶段验证文件
For each phase directory, read the VERIFICATION.md:
bash
undefined针对每个阶段目录,读取VERIFICATION.md文件:
bash
undefinedRead VERIFICATION.md from each phase directory found in step 1
读取步骤1中找到的每个阶段目录下的VERIFICATION.md
for phase_dir in $ALL_PHASE_DIRS; do
[ -d "$phase_dir" ] || continue
cat "${phase_dir}"*-VERIFICATION.md 2>/dev/null
done
From each VERIFICATION.md, extract:
- **Status:** passed | gaps_found
- **Critical gaps:** (if any — these are blockers)
- **Non-critical gaps:** tech debt, deferred items, warnings
- **Anti-patterns found:** TODOs, stubs, placeholders
- **Requirements coverage:** which requirements satisfied/blocked
If a phase is missing VERIFICATION.md, flag it as "unverified phase" — this is a blocker.for phase_dir in $ALL_PHASE_DIRS; do
[ -d "$phase_dir" ] || continue
cat "${phase_dir}"*-VERIFICATION.md 2>/dev/null
done
从每个VERIFICATION.md中提取:
- **状态:** passed | gaps_found
- **关键差距:**(如果有 — 这些是阻碍项)
- **非关键差距:** 技术债务、延迟解决的事项、警告
- **发现的反模式:** TODOs、存根、占位符
- **需求覆盖情况:** 哪些需求已满足/被阻碍
如果某个阶段缺少VERIFICATION.md,则标记为“未验证阶段” — 这属于阻碍项。3. Spawn Integration Checker
3. 生成集成检查器
Read the integration checker instructions:
integration_checker_instructions_content = Read("skills/kata-audit-milestone/references/integration-checker-instructions.md")With phase context collected:
Task(
prompt="<agent-instructions>
{integration_checker_instructions_content}
</agent-instructions>
Check cross-phase integration and E2E flows.
Phases: {phase_dirs}
Phase exports: {from SUMMARYs}
API routes: {routes created}
Verify cross-phase wiring and E2E user flows.",
subagent_type="general-purpose",
model="{integration_checker_model}"
)读取集成检查器说明:
integration_checker_instructions_content = Read("skills/kata-audit-milestone/references/integration-checker-instructions.md")结合收集到的阶段上下文:
Task(
prompt="<agent-instructions>
{integration_checker_instructions_content}
</agent-instructions>
Check cross-phase integration and E2E flows.
Phases: {phase_dirs}
Phase exports: {from SUMMARYs}
API routes: {routes created}
Verify cross-phase wiring and E2E user flows.",
subagent_type="general-purpose",
model="{integration_checker_model}"
)4. Collect Results
4. 收集结果
Combine:
- Phase-level gaps and tech debt (from step 2)
- Integration checker's report (wiring gaps, broken flows)
合并以下内容:
- 阶段级别的差距和技术债务(来自步骤2)
- 集成检查器的报告(连接差距、流程中断)
5. Check Requirements Coverage
5. 检查需求覆盖情况
For each requirement in REQUIREMENTS.md mapped to this milestone:
- Find owning phase
- Check phase verification status
- Determine: satisfied | partial | unsatisfied
针对REQUIREMENTS.md中与此里程碑关联的每个需求:
- 找到负责的阶段
- 检查阶段验证状态
- 确定:已满足 | 部分满足 | 未满足
6. Aggregate into v{version}-MILESTONE-AUDIT.md
6. 汇总为v{version}-MILESTONE-AUDIT.md
Create with:
.planning/v{version}-v{version}-MILESTONE-AUDIT.mdyaml
---
milestone: {version}
audited: {timestamp}
status: passed | gaps_found | tech_debt
scores:
requirements: N/M
phases: N/M
integration: N/M
flows: N/M
gaps: # Critical blockers
requirements: [...]
integration: [...]
flows: [...]
tech_debt: # Non-critical, deferred
- phase: 01-auth
items:
- "TODO: add rate limiting"
- "Warning: no password strength validation"
- phase: 03-dashboard
items:
- "Deferred: mobile responsive layout"
---Plus full markdown report with tables for requirements, phases, integration, tech debt.
Status values:
- — all requirements met, no critical gaps, minimal tech debt
passed - — critical blockers exist
gaps_found - — no blockers but accumulated deferred items need review
tech_debt
创建文件,内容如下:
.planning/v{version}-v{version}-MILESTONE-AUDIT.mdyaml
---
milestone: {version}
audited: {timestamp}
status: passed | gaps_found | tech_debt
scores:
requirements: N/M
phases: N/M
integration: N/M
flows: N/M
gaps: # 关键阻碍项
requirements: [...]
integration: [...]
flows: [...]
tech_debt: # 非关键、延迟解决的事项
- phase: 01-auth
items:
- "TODO: add rate limiting"
- "Warning: no password strength validation"
- phase: 03-dashboard
items:
- "Deferred: mobile responsive layout"
---此外还包含完整的Markdown报告,其中有需求、阶段、集成、技术债务的相关表格。
状态值说明:
- — 所有需求已满足,无关键差距,技术债务极少
passed - — 存在关键阻碍项
gaps_found - — 无阻碍项,但积累的延迟解决事项需要评审
tech_debt
7. Present Results
7. 展示结果
Route by status (see ).
</process>
<offer_next><offer_next>
Output this markdown directly (not as a code block). Route based on status:
If passed:
根据状态进行路由(见)。
</process>
<offer_next><offer_next>
直接输出此Markdown内容(不要放在代码块中)。根据状态进行路由:
如果状态为passed:
✓ Milestone {version} — Audit Passed
✓ 里程碑 {version} — 审计通过
Score: {N}/{M} requirements satisfied
Report: .planning/v{version}-MILESTONE-AUDIT.md
All requirements covered. Cross-phase integration verified. E2E flows complete.
───────────────────────────────────────────────────────────────
得分: {N}/{M} 需求已满足
报告: .planning/v{version}-MILESTONE-AUDIT.md
所有需求已覆盖。跨阶段集成已验证。端到端流程已完成。
───────────────────────────────────────────────────────────────
▶ Next Up
▶ 下一步
Complete milestone — archive and tag
/kata-complete-milestone {version}
<sub>/clear first → fresh context window</sub>
───────────────────────────────────────────────────────────────
If gaps_found:
完成里程碑 — 归档并打标签
/kata-complete-milestone {version}
<sub>/clear first → 刷新上下文窗口</sub>
───────────────────────────────────────────────────────────────
如果状态为gaps_found:
⚠ Milestone {version} — Gaps Found
⚠ 里程碑 {version} — 发现差距
Score: {N}/{M} requirements satisfied
Report: .planning/v{version}-MILESTONE-AUDIT.md
得分: {N}/{M} 需求已满足
报告: .planning/v{version}-MILESTONE-AUDIT.md
Unsatisfied Requirements
未满足的需求
{For each unsatisfied requirement:}
- {REQ-ID}: {description} (Phase {X})
- {reason}
{针对每个未满足的需求:}
- {REQ-ID}: {描述} (阶段 {X})
- {原因}
Cross-Phase Issues
跨阶段问题
{For each integration gap:}
- {from} → {to}: {issue}
{针对每个集成差距:}
- {from} → {to}: {问题}
Broken Flows
流程中断
{For each flow gap:}
- {flow name}: breaks at {step}
───────────────────────────────────────────────────────────────
{针对每个流程差距:}
- {流程名称}: 在{步骤}处中断
───────────────────────────────────────────────────────────────
▶ Next Up
▶ 下一步
Plan gap closure — create phases to complete milestone
/kata-plan-milestone-gaps
<sub>/clear first → fresh context window</sub>
───────────────────────────────────────────────────────────────
Also available:
- cat .planning/v{version}-MILESTONE-AUDIT.md — see full report
- /kata-complete-milestone {version} — proceed anyway (accept tech debt)
───────────────────────────────────────────────────────────────
If tech_debt (no blockers but accumulated debt):
计划差距修复 — 创建阶段以完成里程碑
/kata-plan-milestone-gaps
<sub>/clear first → 刷新上下文窗口</sub>
───────────────────────────────────────────────────────────────
其他可用操作:
- cat .planning/v{version}-MILESTONE-AUDIT.md — 查看完整报告
- /kata-complete-milestone {version} — 继续推进(接受技术债务)
───────────────────────────────────────────────────────────────
如果状态为tech_debt(无阻碍项但积累了债务):
⚡ Milestone {version} — Tech Debt Review
⚡ 里程碑 {version} — 技术债务评审
Score: {N}/{M} requirements satisfied
Report: .planning/v{version}-MILESTONE-AUDIT.md
All requirements met. No critical blockers. Accumulated tech debt needs review.
得分: {N}/{M} 需求已满足
报告: .planning/v{version}-MILESTONE-AUDIT.md
所有需求已满足。无关键阻碍项。积累的技术债务需要评审。
Tech Debt by Phase
各阶段的技术债务
{For each phase with debt:}
Phase {X}: {name}
- {item 1}
- {item 2}
{针对每个有债务的阶段:}
阶段 {X}: {名称}
- {事项1}
- {事项2}
Total: {N} items across {M} phases
总计: {N} 项,分布在 {M} 个阶段
───────────────────────────────────────────────────────────────
───────────────────────────────────────────────────────────────
▶ Options
▶ 选项
A. Complete milestone — accept debt, track in backlog
/kata-complete-milestone {version}
B. Plan cleanup phase — address debt before completing
/kata-plan-milestone-gaps
<sub>/clear first → fresh context window</sub>
───────────────────────────────────────────────────────────────
</offer_next>
<success_criteria>
- Milestone scope identified
- All phase VERIFICATION.md files read
- Tech debt and deferred gaps aggregated
- Integration checker spawned for cross-phase wiring
- v{version}-MILESTONE-AUDIT.md created
- Results presented with actionable next steps </success_criteria>
A. 完成里程碑 — 接受债务,在待办事项中追踪
/kata-complete-milestone {version}
B. 计划清理阶段 — 在完成前处理债务
/kata-plan-milestone-gaps
<sub>/clear first → 刷新上下文窗口</sub>
───────────────────────────────────────────────────────────────
</offer_next>
<success_criteria>
- 已确定里程碑范围
- 已读取所有阶段VERIFICATION.md文件
- 已汇总技术债务和延迟解决的差距
- 已生成用于跨阶段连接检查的集成检查器
- 已创建v{version}-MILESTONE-AUDIT.md
- 已展示结果并提供可执行的下一步操作 </success_criteria>