@boyingliu01/xp-gate 0.18.4 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapter-common.sh +27 -0
- package/adapters/powershell.sh +85 -33
- package/adapters/typescript.sh +8 -8
- package/build-integrity/__tests__/import-resolver.test.ts +22 -0
- package/build-integrity/__tests__/orchestrator.test.ts +1 -2
- package/build-integrity/gate-10.ts +7 -0
- package/gate-12-file-hygiene.sh +230 -0
- package/hooks/adapter-common.sh +27 -0
- package/hooks/gate-10.sh +105 -0
- package/hooks/lib/validate-code-walkthrough.cjs +125 -0
- package/hooks/pre-commit +130 -33
- package/hooks/pre-push +15 -91
- package/lib/__tests__/check-version.test.js +67 -46
- package/lib/__tests__/doctor.test.js +7 -6
- package/lib/__tests__/gate-runner.test.js +267 -0
- package/lib/__tests__/init.test.js +32 -0
- package/lib/__tests__/npm-package.test.js +13 -0
- package/lib/__tests__/phase-transition.test.js +604 -12
- package/lib/__tests__/sprint-discovery.test.ts +0 -1
- package/lib/__tests__/sprint-status-rework.test.js +100 -1
- package/lib/__tests__/update-hooks.test.js +143 -10
- package/lib/__tests__/upgrade-exec.test.js +73 -45
- package/lib/__tests__/upgrade-skill-sync.test.js +1 -1
- package/lib/__tests__/upgrade.test.js +12 -11
- package/lib/doctor.js +2 -1
- package/lib/gate-runner.js +68 -23
- package/lib/init.js +34 -5
- package/lib/install-skill.js +1 -0
- package/lib/mattpocock-license-verdict.json +1 -1
- package/lib/phase-transition.js +203 -23
- package/lib/shared-paths.js +2 -0
- package/lib/sprint-status.js +15 -4
- package/lib/test-alignment.ts +3 -13
- package/lib/update-hooks.js +129 -15
- package/mock-policy/AGENTS.md +5 -5
- package/mock-policy/__tests__/gate-m3.test.ts +0 -5
- package/mock-policy/__tests__/scope-scanner.test.ts +8 -2
- package/mutation/AGENTS.md +4 -4
- package/mutation/__tests__/mutmut-runner.test.ts +443 -2
- package/mutation/__tests__/update-baseline.test.ts +0 -2
- package/mutation/runners/mutmut-runner.ts +67 -17
- package/package.json +9 -3
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/clipboard-vision/SKILL.md +47 -0
- package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/claude-code/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
- package/plugins/claude-code/skills/clipboard-vision/describe-clipboard.sh +161 -0
- package/plugins/claude-code/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/claude-code/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +24 -27
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +13 -12
- package/plugins/claude-code/skills/delphi-review/INSTALL.md +15 -17
- package/plugins/claude-code/skills/delphi-review/SKILL.md +30 -29
- package/plugins/claude-code/skills/delphi-review/opencode.json.delphi.example +6 -10
- package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +33 -49
- package/plugins/claude-code/skills/delphi-review/references/requirements.md +66 -54
- package/plugins/claude-code/skills/delphi-review/references/round-templates.md +7 -7
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +5 -5
- package/plugins/claude-code/skills/sprint-flow/SKILL.md +4 -4
- package/plugins/claude-code/skills/sprint-flow/references/components/skill-invocations.md +2 -2
- package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +37 -35
- package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +1 -1
- package/plugins/claude-code/skills/sprint-flow/references/phase-1-prep.md +1 -1
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +24 -14
- package/plugins/claude-code/skills/sprint-flow/references/phase-4-verify.md +6 -6
- package/plugins/claude-code/skills/sprint-flow/references/phase-overview.md +2 -2
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +4 -4
- package/plugins/dsh/README.md +25 -0
- package/plugins/dsh/cordis.patch.yml +7 -0
- package/plugins/dsh/package.json +70 -0
- package/plugins/dsh/scripts/prepack.cjs +82 -0
- package/plugins/dsh/skills/admin-template-guidelines/SKILL.md +113 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-1.md +91 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-2.md +155 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-3.md +70 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-4.md +154 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-5.md +126 -0
- package/plugins/dsh/skills/admin-template-guidelines/references/rule-6.md +180 -0
- package/plugins/dsh/skills/batch-grill-me/SKILL.md +15 -0
- package/plugins/dsh/skills/clipboard-vision/SKILL.md +47 -0
- package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/dsh/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
- package/plugins/dsh/skills/clipboard-vision/describe-clipboard.sh +161 -0
- package/plugins/dsh/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/dsh/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/dsh/skills/delphi-review/.delphi-config.json.example +70 -0
- package/plugins/dsh/skills/delphi-review/AGENTS.md +67 -0
- package/plugins/dsh/skills/delphi-review/INSTALL.md +150 -0
- package/plugins/dsh/skills/delphi-review/SKILL.md +559 -0
- package/plugins/dsh/skills/delphi-review/hooks.md +19 -0
- package/plugins/dsh/skills/delphi-review/opencode.json.delphi.example +52 -0
- package/plugins/dsh/skills/delphi-review/references/code-walkthrough.md +470 -0
- package/plugins/dsh/skills/delphi-review/references/orchestrator-dispatch.md +64 -0
- package/plugins/dsh/skills/delphi-review/references/requirements.md +402 -0
- package/plugins/dsh/skills/delphi-review/references/round-templates.md +134 -0
- package/plugins/dsh/skills/delphi-review/scripts/verify-consensus.sh +43 -0
- package/plugins/dsh/skills/delphi-review/tools.md +29 -0
- package/plugins/dsh/skills/domain-modeling/ADR-FORMAT.md +64 -0
- package/plugins/dsh/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/plugins/dsh/skills/domain-modeling/SKILL.md +74 -0
- package/plugins/dsh/skills/grill-with-docs/SKILL.md +7 -0
- package/plugins/dsh/skills/grilling/SKILL.md +12 -0
- package/plugins/dsh/skills/improve-codebase-architecture/SKILL.md +156 -0
- package/plugins/dsh/skills/ralph-loop/SKILL.md +198 -0
- package/plugins/dsh/skills/ralph-loop/references/components.md +113 -0
- package/plugins/dsh/skills/ralph-loop/references/phase-2-build-ralph.md +89 -0
- package/plugins/dsh/skills/ralph-loop/references/workflow-details.md +99 -0
- package/plugins/dsh/skills/ralph-loop/templates/progress-log.md +36 -0
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +103 -0
- package/plugins/dsh/skills/sprint-flow/SKILL.md +411 -0
- package/plugins/dsh/skills/sprint-flow/__tests__/sprint-flow.test.cjs +457 -0
- package/plugins/dsh/skills/sprint-flow/hooks.md +18 -0
- package/plugins/dsh/skills/sprint-flow/references/components/memory.md +87 -0
- package/plugins/dsh/skills/sprint-flow/references/components/middleware.md +75 -0
- package/plugins/dsh/skills/sprint-flow/references/components/skill-invocations.md +105 -0
- package/plugins/dsh/skills/sprint-flow/references/components/system-prompt.md +27 -0
- package/plugins/dsh/skills/sprint-flow/references/components/tool-descriptions.md +95 -0
- package/plugins/dsh/skills/sprint-flow/references/force-levels.md +204 -0
- package/plugins/dsh/skills/sprint-flow/references/orchestration-rules.md +236 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-1-prep.md +294 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-2-design.md +273 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-3-build.md +348 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-4-verify.md +225 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-5-ship.md +222 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-6-close.md +266 -0
- package/plugins/dsh/skills/sprint-flow/references/phase-overview.md +486 -0
- package/plugins/dsh/skills/sprint-flow/scripts/verify-sprint-state.sh +38 -0
- package/plugins/dsh/skills/sprint-flow/templates/auto-estimate-learning-log.md +136 -0
- package/plugins/dsh/skills/sprint-flow/templates/auto-estimate-output-template.md +110 -0
- package/plugins/dsh/skills/sprint-flow/templates/emergent-issues-template.md +120 -0
- package/plugins/dsh/skills/sprint-flow/templates/pain-document-template.md +115 -0
- package/plugins/dsh/skills/sprint-flow/templates/sprint-progress-template.md +140 -0
- package/plugins/dsh/skills/sprint-flow/templates/sprint-summary-template.md +121 -0
- package/plugins/dsh/skills/sprint-flow/tools.md +29 -0
- package/plugins/dsh/skills/test-driven-development/SKILL.md +371 -0
- package/plugins/dsh/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +56 -0
- package/plugins/dsh/skills/test-specification-alignment/SKILL.md +205 -0
- package/plugins/dsh/skills/test-specification-alignment/references/alignment-verification-algorithm.md +493 -0
- package/plugins/dsh/skills/test-specification-alignment/references/phase2-constraint-enforcement.md +431 -0
- package/plugins/dsh/skills/test-specification-alignment/references/specification-format.md +348 -0
- package/plugins/dsh/skills/to-issues/SKILL.md +277 -0
- package/plugins/dsh/src/command.test.ts +102 -0
- package/plugins/dsh/src/command.ts +75 -0
- package/plugins/dsh/src/contract.test.ts +62 -0
- package/plugins/dsh/src/gate-runner.test.ts +100 -0
- package/plugins/dsh/src/gate-runner.ts +58 -0
- package/plugins/dsh/src/index.test.ts +97 -0
- package/plugins/dsh/src/index.ts +94 -0
- package/plugins/dsh/src/skills.test.ts +58 -0
- package/plugins/dsh/tsconfig.build.json +13 -0
- package/plugins/dsh/tsconfig.json +19 -0
- package/plugins/dsh/vitest.config.ts +8 -0
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/scripts/prepack.cjs +1 -0
- package/plugins/opencode/skills/clipboard-vision/SKILL.md +47 -0
- package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/opencode/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
- package/plugins/opencode/skills/clipboard-vision/describe-clipboard.sh +161 -0
- package/plugins/opencode/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/opencode/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +24 -27
- package/plugins/opencode/skills/delphi-review/AGENTS.md +13 -12
- package/plugins/opencode/skills/delphi-review/INSTALL.md +15 -17
- package/plugins/opencode/skills/delphi-review/SKILL.md +30 -29
- package/plugins/opencode/skills/delphi-review/opencode.json.delphi.example +6 -10
- package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +33 -49
- package/plugins/opencode/skills/delphi-review/references/requirements.md +66 -54
- package/plugins/opencode/skills/delphi-review/references/round-templates.md +7 -7
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +5 -5
- package/plugins/opencode/skills/sprint-flow/SKILL.md +4 -4
- package/plugins/opencode/skills/sprint-flow/references/components/skill-invocations.md +2 -2
- package/plugins/opencode/skills/sprint-flow/references/force-levels.md +37 -35
- package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +1 -1
- package/plugins/opencode/skills/sprint-flow/references/phase-1-prep.md +1 -1
- package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +24 -14
- package/plugins/opencode/skills/sprint-flow/references/phase-4-verify.md +6 -6
- package/plugins/opencode/skills/sprint-flow/references/phase-overview.md +2 -2
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +4 -4
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/clipboard-vision/SKILL.md +47 -0
- package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/SKILL.md +47 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/qoder/skills/clipboard-vision/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/qoder/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/plugins/qoder/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +3 -11
- package/plugins/qoder/skills/delphi-review/AGENTS.md +15 -17
- package/plugins/qoder/skills/delphi-review/INSTALL.md +12 -12
- package/plugins/qoder/skills/delphi-review/SKILL.md +58 -25
- package/plugins/qoder/skills/delphi-review/opencode.json.delphi.example +1 -1
- package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +33 -49
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +5 -5
- package/plugins/qoder/skills/sprint-flow/SKILL.md +2 -2
- package/plugins/qoder/skills/sprint-flow/references/force-levels.md +38 -35
- package/plugins/qoder/skills/sprint-flow/references/phase-1-prep.md +1 -1
- package/plugins/qoder/skills/sprint-flow/references/phase-2-design.md +48 -6
- package/plugins/qoder/skills/sprint-flow/references/phase-4-verify.md +5 -6
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +4 -4
- package/principles/AGENTS.md +4 -4
- package/scripts/__tests__/sync-package-content.test.js +30 -0
- package/scripts/delphi-external-review.cjs +194 -63
- package/scripts/sync-package-content.js +9 -2
- package/skills/clipboard-vision/SKILL.md +47 -0
- package/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +65 -0
- package/skills/clipboard-vision/__tests__/clipboard-vision-security.test.cjs +185 -0
- package/skills/clipboard-vision/__tests__/clipboard-vision.Tests.ps1 +138 -0
- package/skills/clipboard-vision/__tests__/clipboard-vision.test.cjs +273 -0
- package/skills/clipboard-vision/describe-clipboard.ps1 +115 -0
- package/skills/clipboard-vision/describe-clipboard.sh +161 -0
- package/skills/clipboard-vision/scripts/clipboard-vision.ps1 +86 -0
- package/skills/clipboard-vision/scripts/clipboard-vision.sh +137 -0
- package/skills/delphi-review/.delphi-config.json.example +24 -27
- package/skills/delphi-review/AGENTS.md +13 -12
- package/skills/delphi-review/INSTALL.md +15 -17
- package/skills/delphi-review/SKILL.md +30 -29
- package/skills/delphi-review/opencode.json.delphi.example +6 -10
- package/skills/delphi-review/references/code-walkthrough.md +33 -49
- package/skills/delphi-review/references/requirements.md +66 -54
- package/skills/delphi-review/references/round-templates.md +7 -7
- package/skills/sprint-flow/AGENTS.md +5 -5
- package/skills/sprint-flow/SKILL.md +4 -4
- package/skills/sprint-flow/references/components/skill-invocations.md +2 -2
- package/skills/sprint-flow/references/force-levels.md +37 -35
- package/skills/sprint-flow/references/orchestration-rules.md +1 -1
- package/skills/sprint-flow/references/phase-1-prep.md +1 -1
- package/skills/sprint-flow/references/phase-2-design.md +24 -14
- package/skills/sprint-flow/references/phase-4-verify.md +6 -6
- package/skills/sprint-flow/references/phase-overview.md +2 -2
- package/skills/test-specification-alignment/AGENTS.md +4 -4
- package/sprint-gate.sh +291 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sprint-flow
|
|
3
|
+
version: 2.1.0
|
|
4
|
+
description: >
|
|
5
|
+
Orchestrates a 6-phase end-to-end feature development pipeline (PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE).
|
|
6
|
+
Integrates grill-with-docs, batch-grill-me, delphi-review (R1 requirements + R2 design), TDD, ralph-loop, code-walkthrough, and native ship/land steps.
|
|
7
|
+
Pauses at key gates for user decisions. Acknowledges emergent requirements with mandatory manual UAT in CLOSE phase.
|
|
8
|
+
|
|
9
|
+
WHAT: Automates the full development lifecycle from worktree isolation to production deployment.
|
|
10
|
+
WHEN: User explicitly requests building a feature, developing new functionality, starting a sprint, or running /sprint-flow.
|
|
11
|
+
NOT WHEN: Asking HOW to implement something (educational), implementing a single function/algorithm, environment setup,
|
|
12
|
+
deployment-only requests, feature suggestions without execution intent, or casual "do it" requests without a feature scope.
|
|
13
|
+
|
|
14
|
+
TRIGGERS: "/sprint-flow", "start sprint", "开发新功能", "实现 X (where X is a feature/module)", "一键开发", "develop new feature",
|
|
15
|
+
"implement feature X", "one-shot development", "build X (where X is a feature)".
|
|
16
|
+
NEGATIVE TRIGGERS: "实现排序算法", "实现一下", "帮我实现这个函数", "怎么实现登录功能", "start spring boot", "开发环境配置",
|
|
17
|
+
"一键部署", "新功能建议", "implement a sort function", "how to implement auth".
|
|
18
|
+
On trigger, first line MUST output: `Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE`
|
|
19
|
+
maturity: beta
|
|
20
|
+
auto_continue: false # Sprint-flow pauses at user decision gates (unlike delphi-review which auto-continues rounds)
|
|
21
|
+
triggers:
|
|
22
|
+
- "/sprint-flow"
|
|
23
|
+
- "start sprint"
|
|
24
|
+
- "开发新功能"
|
|
25
|
+
- "一键开发"
|
|
26
|
+
- "implement feature"
|
|
27
|
+
- "one-shot development"
|
|
28
|
+
- "build a feature"
|
|
29
|
+
triggers_negative_examples:
|
|
30
|
+
- "实现排序算法" # algorithm implementation, not feature development
|
|
31
|
+
- "实现一下" # casual "do it", not a sprint request
|
|
32
|
+
- "帮我实现这个函数" # single function, not full feature
|
|
33
|
+
- "怎么实现登录功能" # asking HOW, not requesting development
|
|
34
|
+
- "start spring boot" # framework name, not sprint
|
|
35
|
+
- "开发环境配置" # environment setup, not feature development
|
|
36
|
+
- "一键部署" # deploy, not develop
|
|
37
|
+
- "新功能建议" # feature suggestion/request, not execution
|
|
38
|
+
- "implement a sort function" # algorithm, not full feature
|
|
39
|
+
- "how to implement auth" # educational question
|
|
40
|
+
- "实现一个util函数" # utility function, not feature
|
|
41
|
+
- "帮我写个脚本" # script writing, not feature development
|
|
42
|
+
- "代码review" # code review, not development
|
|
43
|
+
- "refactor this" # refactoring, not new feature
|
|
44
|
+
triggers_negative_test_cases:
|
|
45
|
+
- input: "实现排序算法"
|
|
46
|
+
expect: "NOT triggered"
|
|
47
|
+
- input: "实现一下"
|
|
48
|
+
expect: "NOT triggered"
|
|
49
|
+
- input: "帮我实现这个函数"
|
|
50
|
+
expect: "NOT triggered"
|
|
51
|
+
- input: "怎么实现登录功能"
|
|
52
|
+
expect: "NOT triggered"
|
|
53
|
+
- input: "start spring boot"
|
|
54
|
+
expect: "NOT triggered"
|
|
55
|
+
- input: "开发环境配置"
|
|
56
|
+
expect: "NOT triggered"
|
|
57
|
+
- input: "一键部署"
|
|
58
|
+
expect: "NOT triggered"
|
|
59
|
+
- input: "新功能建议"
|
|
60
|
+
expect: "NOT triggered"
|
|
61
|
+
- input: "implement a sort function"
|
|
62
|
+
expect: "NOT triggered"
|
|
63
|
+
- input: "how to implement auth"
|
|
64
|
+
expect: "NOT triggered"
|
|
65
|
+
- input: "开发用户认证模块"
|
|
66
|
+
expect: "triggered"
|
|
67
|
+
- input: "/sprint-flow \"开发访谈机器人\""
|
|
68
|
+
expect: "triggered"
|
|
69
|
+
- input: "一键开发 REST API"
|
|
70
|
+
expect: "triggered"
|
|
71
|
+
- input: "implement user authentication feature"
|
|
72
|
+
expect: "triggered"
|
|
73
|
+
- input: "start sprint for login module"
|
|
74
|
+
expect: "triggered"
|
|
75
|
+
- input: "帮我写个脚本"
|
|
76
|
+
expect: "NOT triggered"
|
|
77
|
+
- input: "代码review"
|
|
78
|
+
expect: "NOT triggered"
|
|
79
|
+
- input: "refactor this module"
|
|
80
|
+
expect: "NOT triggered"
|
|
81
|
+
workflow_steps:
|
|
82
|
+
- "Phase 1/6: PREP → Output: ## Phase 1/6: PREP (准备工作)"
|
|
83
|
+
- "Phase 2/6: DESIGN → Output: ## Phase 2/6: DESIGN (设计)"
|
|
84
|
+
- "Phase 3/6: BUILD → Output: ## Phase 3/6: BUILD (构建)"
|
|
85
|
+
- "Phase 4/6: VERIFY → Output: ## Phase 4/6: VERIFY (验证)"
|
|
86
|
+
- "Phase 5/6: SHIP → Output: ## Phase 5/6: SHIP (发布)"
|
|
87
|
+
- "Phase 6/6: CLOSE → Output: ## Phase 6/6: CLOSE (收尾)"
|
|
88
|
+
hooks:
|
|
89
|
+
security:
|
|
90
|
+
- "tools_denied": "Destructive commands blocked via tools_denied (rm -rf, git push --force, DROP TABLE)"
|
|
91
|
+
- "Security Notes": "See Security Notes section for safety guarantees"
|
|
92
|
+
operational:
|
|
93
|
+
- "sprint-state.json": "Native sprint state persistence + --resume-from for context restore"
|
|
94
|
+
tools_allowed:
|
|
95
|
+
- "Bash(git, gh, npm, node)" # git worktree/branch/commit, gh PR/release, npm/node CLI
|
|
96
|
+
- "Read" # read project files, configs, docs
|
|
97
|
+
- "Write" # write sprint-state, specification.yaml, phase summaries
|
|
98
|
+
- "Edit" # edit sprint-state, CHANGELOG, VERSION
|
|
99
|
+
- "Glob" # find project files by pattern
|
|
100
|
+
- "Grep" # search file contents
|
|
101
|
+
- "Task" # delegate to subagents (quick, deep, unspecified-high)
|
|
102
|
+
- "Skill" # invoke integrated skills (grill-with-docs, batch-grill-me, delphi-review, to-issues, etc.)
|
|
103
|
+
- "TodoWrite" # track sprint progress
|
|
104
|
+
- "Question" # ask user at decision gates
|
|
105
|
+
tools_denied:
|
|
106
|
+
- "rm -rf (any recursive force remove)"
|
|
107
|
+
- "git push --force"
|
|
108
|
+
- "DROP TABLE or destructive DB operations"
|
|
109
|
+
- "Write(source code)" # NEVER write implementation code directly — delegate to subagents via Task
|
|
110
|
+
- "Edit(source code)" # NEVER edit implementation code — sprint-flow orchestrates, subagents implement
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
# Sprint Flow — 6-Phase Development Pipeline
|
|
114
|
+
|
|
115
|
+
## Triggers
|
|
116
|
+
|
|
117
|
+
| Trigger Type | Phrases |
|
|
118
|
+
|--------------|---------|
|
|
119
|
+
| **中文** | "开发新功能", "一键开发", "/sprint-flow", "开发用户登录", "创建 XXX 模块" |
|
|
120
|
+
| **English** | "/sprint-flow", "start sprint", "implement feature", "one-shot development", "build a feature" |
|
|
121
|
+
|
|
122
|
+
**Usage**: `/sprint-flow "[feature description]"`
|
|
123
|
+
|
|
124
|
+
**Examples**:
|
|
125
|
+
- `/sprint-flow "开发访谈机器人,支持多轮对话"`
|
|
126
|
+
- `/sprint-flow "实现用户认证模块,支持 OAuth2"`
|
|
127
|
+
- `/sprint-flow "开发 REST API 端点"`
|
|
128
|
+
|
|
129
|
+
**Optional Parameters**:
|
|
130
|
+
- `--no-isolate`: Skip auto worktree isolation (⚠️ risk of polluting protected branches)
|
|
131
|
+
- `--branch-name <name>`: Custom branch name (default: `sprint/YYYY-MM-DD-NN`)
|
|
132
|
+
- `--force`: Force continue on current branch even if protected (⚠️ requires explicit confirmation)
|
|
133
|
+
- `--stop-at <phase>`: Stop after specified phase (prep/design/build/verify/ship/close)
|
|
134
|
+
- `--resume-from <phase>`: Resume from specified phase
|
|
135
|
+
- `--phase <phase>`: Execute only single phase (prep-only/design-only/build-only/verify-only/ship-only/close-only)
|
|
136
|
+
- `--lang <language>`: Specify project language (springboot/django/golang)
|
|
137
|
+
- `--type <project_type>`: Specify project type (web-nextjs/web-react/web-vue/backend-go/backend-django/backend-springboot)
|
|
138
|
+
- `--spec <file>`: Use existing specification.yaml file
|
|
139
|
+
- `--with-performance`: Enable load/stress testing (backend projects)
|
|
140
|
+
- `--mode <build_mode>`: Phase 3 BUILD build mode. Default = ralph-loop. parallel = legacy all-at-once mode
|
|
141
|
+
- `--status`: View Sprint progress dashboard (read-only, no execution)
|
|
142
|
+
|
|
143
|
+
## Security Notes
|
|
144
|
+
|
|
145
|
+
- Sprint flow **does NOT execute destructive commands** (no `rm -rf`, `git push --force`, `DROP TABLE`, etc.)
|
|
146
|
+
- `git worktree remove` only deletes temporary worktree directories created by the sprint, never affects the main repo
|
|
147
|
+
- Phase 5 SHIP only creates PRs (`gh pr create`), never auto-merges without explicit user confirmation
|
|
148
|
+
- Sprint flow does not download, install, or execute external binaries
|
|
149
|
+
|
|
150
|
+
## Permissions
|
|
151
|
+
|
|
152
|
+
- `git`: read/write (worktree, branch, commit)
|
|
153
|
+
- `gh` (GitHub CLI): read/write (PR create, merge, CI query)
|
|
154
|
+
- `filesystem`: read/write (project dir + `.worktrees/` only)
|
|
155
|
+
- `network`: read-only (CI status, canary health)
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 6-Phase Pipeline
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
| Phase | Name | Key Actions | Output |
|
|
166
|
+
|-------|------|-------------|--------|
|
|
167
|
+
| 1/6 | PREP | Detect protected branch → Create git worktree → AUTO-ESTIMATE sizing → Classify (lightweight/standard/complex) | Worktree path + impact assessment |
|
|
168
|
+
| 2/6 | DESIGN | CONTEXT.md 预检 (#322) → grill-with-docs → R1 需求评审 → 设计文档+APPROVAL (HARD-GATE) → batch-grill-me → R2 delphi-review (3 distinct models, ≥90% consensus, max 5 rounds) → to-issues → specification.yaml | specification.yaml + slices-manifest.json + requirements-reviewed.json |
|
|
169
|
+
| 3/6 | BUILD | BUILD-ENTRY-CONTRACT → GITHOOKS-GATE → DELPHI-GATE → ralph-loop (default) or parallel → TDD → blind-review (read-only subagent) → verification | MVP code |
|
|
170
|
+
| 4/6 | VERIFY | delphi-review --mode code-walkthrough → test-specification-alignment (#367 HARD-GATE) → xp-gate check --all → browser (Layer 4) → learnings + xp-gate retro | Review report + feedback-log.md + test-alignment-report.json |
|
|
171
|
+
| 5/6 | SHIP | VERSION-GATE → 分支完成决策 (4选项) → native ship (create PR) → native land (merge + CI + canary) | PR URL + deploy status + merge confirmation |
|
|
172
|
+
| 6/6 | CLOSE | SHIP→CLOSE GATE (merge verified) → Backup sprint-state → #369 返工指标 → USER ACCEPTANCE (⚠️ mandatory manual) → Capture emergent issues → Cleanup worktree + branch | Emergent issues list + cleanup report + metrics |
|
|
173
|
+
|
|
174
|
+
**Hard Gates**:
|
|
175
|
+
- **DESIGN → BUILD**: R1 and R2 invoke all three expert roles independently, verify successful results with three distinct requested models, then aggregate APPROVED consensus ≥90% within 5 rounds, plus GITHOOKS-GATE + DELPHI-GATE + BUILD-ENTRY-CONTRACT (manifest schema + slice↔REQ)
|
|
176
|
+
- **VERIFY → SHIP**: feedback-log.md must exist + test-alignment-report.json PASS (#367 程序化 HARD-GATE)
|
|
177
|
+
- **SHIP → CLOSE**: PR must be merged to main + release completed (HARD-GATE)
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## ⚠️ Required Output Format (MANDATORY for L3 Step Adherence)
|
|
182
|
+
|
|
183
|
+
Every phase MUST output its header as the first line of that phase's output. Format MUST be exact:
|
|
184
|
+
|
|
185
|
+
```markdown
|
|
186
|
+
## Phase 1/6: PREP (准备工作)
|
|
187
|
+
## Phase 2/6: DESIGN (设计)
|
|
188
|
+
## Phase 3/6: BUILD (构建)
|
|
189
|
+
## Phase 4/6: VERIFY (验证)
|
|
190
|
+
## Phase 5/6: SHIP (发布)
|
|
191
|
+
## Phase 6/6: CLOSE (收尾)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Rules**:
|
|
195
|
+
1. First line of every phase output MUST be `## Phase X/6: NAME (中文名)`
|
|
196
|
+
2. NEVER omit "Phase" keyword (not "## 1/6" or "PREP" alone)
|
|
197
|
+
3. NEVER merge phase output — each phase gets its own header
|
|
198
|
+
4. On `/sprint-flow` trigger, first line MUST output: `Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE`
|
|
199
|
+
5. Each phase completion MUST write Phase Summary to `.sprint-state/phase-outputs/phase-{N}-summary.md`
|
|
200
|
+
|
|
201
|
+
### Phase Transition — TodoWrite Embedded (MANDATORY, resolves #366)
|
|
202
|
+
|
|
203
|
+
6. **Sprint initialization**: Phase 1 PREP MUST begin with `npx xp-gate sprint-init "<task_description>"` — this is the single entry point for sprint creation. NEVER manually write sprint-state.json.
|
|
204
|
+
|
|
205
|
+
7. **Phase transitions are embedded in TodoWrite items**, not as separate post-actions. Each phase's TodoWrite item MUST include the phase-transition call as part of the same atomic step:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
TodoWrite item format:
|
|
209
|
+
- "Phase N: <main task> + phase-transition N completed → N+1 in_progress --render"
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Example TodoWrite items for a sprint:
|
|
213
|
+
```
|
|
214
|
+
- Phase 1: PREP — estimate + sprint-init + phase-transition 1 completed --render
|
|
215
|
+
- Phase 2: DESIGN — delphi review + phase-transition 2 completed --render
|
|
216
|
+
- Phase 3: BUILD — implementation + phase-transition 3 completed --render
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
**Rationale**: TodoWrite items are the LLM's most consistently executed operations. Embedding phase-transition elevates it from "post-action meta-info" (priority 4, ignored) to "main task step" (priority 2, executed).
|
|
220
|
+
|
|
221
|
+
8. **NEVER** manually write to `sprint-state.json` or manually render the dashboard. ALWAYS use:
|
|
222
|
+
```
|
|
223
|
+
npx xp-gate phase-transition <phase> <status> --render [--outputs '<json>']
|
|
224
|
+
```
|
|
225
|
+
- `<phase>`: 1-6
|
|
226
|
+
- `<status>`: `in_progress` | `completed` | `skipped` | `failed` | `paused`
|
|
227
|
+
- `--render`: Auto-renders ASCII progress dashboard after state update
|
|
228
|
+
- `--outputs '<json>'`: Optional JSON of phase outputs to record
|
|
229
|
+
|
|
230
|
+
This is a **HARD GATE** — the CLI is the single source of truth for state transitions and dashboard rendering.
|
|
231
|
+
|
|
232
|
+
### Phase Output Status Schema (MANDATORY per phase)
|
|
233
|
+
|
|
234
|
+
Each phase MUST close with structured status:
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
status: completed | blocked | user_decision_required
|
|
238
|
+
outputs: [list of files produced]
|
|
239
|
+
decisions: [list of decisions made]
|
|
240
|
+
next_phase_context: [key info for next phase]
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Phase 1/6: PREP (准备工作)
|
|
246
|
+
|
|
247
|
+
**触发条件**:用户输入匹配 Triggers 表中任一短语,或显式调用 `/sprint-flow`。
|
|
248
|
+
|
|
249
|
+
**输入**:
|
|
250
|
+
| 输入 | 来源 | 必需 |
|
|
251
|
+
|------|------|------|
|
|
252
|
+
| 功能描述 | 用户命令参数 | 是 |
|
|
253
|
+
| 当前分支 | `git branch --show-current` | 自动检测 |
|
|
254
|
+
| 项目语言 | `--lang` 参数或自动检测 | 否 |
|
|
255
|
+
|
|
256
|
+
**步骤**:
|
|
257
|
+
1. 输出首行:`Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE`
|
|
258
|
+
2. 检测当前分支是否为保护分支(main/master/develop)
|
|
259
|
+
3. 创建 git worktree 隔离(除非 `--no-isolate`):
|
|
260
|
+
```bash
|
|
261
|
+
git worktree add .worktrees/sprint-$(date +%Y%m%d-%H%M%S) -b sprint/YYYY-MM-DD-NN
|
|
262
|
+
```
|
|
263
|
+
4. AUTO-ESTIMATE 规模评估(分析功能描述复杂度)
|
|
264
|
+
5. 分类:lightweight / standard / complex
|
|
265
|
+
6. 执行 `npx xp-gate sprint-init "<task_description>"` 初始化状态
|
|
266
|
+
7. 执行 `npx xp-gate phase-transition 1 completed --render`
|
|
267
|
+
|
|
268
|
+
**输出**:
|
|
269
|
+
| 输出物 | 路径 | 格式 |
|
|
270
|
+
|--------|------|------|
|
|
271
|
+
| Worktree 路径 | `.worktrees/sprint-*` | 目录 |
|
|
272
|
+
| Sprint 状态 | `.sprint-state/sprint-state.json` | JSON |
|
|
273
|
+
| Phase Summary | `.sprint-state/phase-outputs/phase-1-summary.md` | Markdown |
|
|
274
|
+
|
|
275
|
+
**详细参考**:`@references/phase-1-prep.md`
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 门禁条件表 (Gate Conditions)
|
|
280
|
+
|
|
281
|
+
| 门禁 | 位置 | 条件 | 失败处理 |
|
|
282
|
+
|------|------|------|----------|
|
|
283
|
+
| BUILD-ENTRY-CONTRACT | Phase 2→3 | slices-manifest.json schema 合法 + slice↔REQ 一致 | BLOCK,返回 Phase 2 修复 |
|
|
284
|
+
| GITHOOKS-GATE | Phase 2→3 | hooks 已安装且可执行 | 自动修复 (`xp-gate doctor --fix`),失败则 BLOCK |
|
|
285
|
+
| DELPHI-GATE | Phase 2→3 | R2 delphi-review APPROVED (≥90%) | 重新设计或用户覆盖(记录原因) |
|
|
286
|
+
| VERSION-GATE | Phase 4→5 | VERSION 文件与 package.json 一致 | 执行 `node scripts/sync-version.cjs` |
|
|
287
|
+
| #367 EVIDENCE-GATE | Phase 4→5 | test-alignment-report.json PASS + head_commit + spec_hash | BLOCK(--skip-evidence 需 --reason,≤2 次/sprint) |
|
|
288
|
+
| SHIP→CLOSE GATE | Phase 5→6 | PR 已合并 + release 完成 | BLOCK,等待合并确认 |
|
|
289
|
+
| feedback-log GATE | Phase 4→5 | feedback-log.md 存在 | BLOCK,必须完成 VERIFY |
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Phase 2–6 详细指令
|
|
294
|
+
|
|
295
|
+
> Phase 2–6 的完整步骤、输入/输出契约、模板和 Skill 集成详情见 `references/` 目录。本节提供路由摘要。
|
|
296
|
+
|
|
297
|
+
| Phase | 参考文件 | 核心 Skill 链 |
|
|
298
|
+
|-------|----------|---------------|
|
|
299
|
+
| 2/6 DESIGN | `@references/phase-2-design.md` | CONTEXT.md 预检 → grill-with-docs → R1 需求评审 → 设计文档+APPROVAL → batch-grill-me → R2 delphi-review → to-issues |
|
|
300
|
+
| 3/6 BUILD | `@references/phase-3-build.md` | BUILD-ENTRY-CONTRACT → GITHOOKS-GATE → DELPHI-GATE → ralph-loop (TDD) → blind-review (read-only subagent) |
|
|
301
|
+
| 4/6 VERIFY | `@references/phase-4-verify.md` | delphi code-walkthrough → test-spec-alignment (#367) → xp-gate check --all → browser (Layer 4) → learnings + retro |
|
|
302
|
+
| 5/6 SHIP | `@references/phase-5-ship.md` | VERSION-GATE → 分支完成决策 (4选项) → native ship (PR) → native land (merge+CI+canary) |
|
|
303
|
+
| 6/6 CLOSE | `@references/phase-6-close.md` | SHIP→CLOSE GATE → backup → #369 返工指标 → USER ACCEPTANCE → emergent → cleanup |
|
|
304
|
+
|
|
305
|
+
**路径约定**:`@references/` 和 `@templates/` 相对于 skill 目录(`skills/sprint-flow/`)解析。
|
|
306
|
+
|
|
307
|
+
**完整参考文件索引**:
|
|
308
|
+
| 文件 | 内容 |
|
|
309
|
+
|------|------|
|
|
310
|
+
| `@references/phase-overview.md` | 全阶段详情、Skill 集成、参数、输出契约 |
|
|
311
|
+
| `@references/orchestration-rules.md` | Agent 调度、上下文继承、转换门禁 |
|
|
312
|
+
| `@references/force-levels.md` | 阶段强制执行规则 |
|
|
313
|
+
| `@templates/` | Pain doc、emergent issues、sprint summary、progress 模板 |
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Anti-Patterns
|
|
318
|
+
|
|
319
|
+
| ❌ Error | ✅ Correct |
|
|
320
|
+
|----------|-----------|
|
|
321
|
+
| Route Q&A, explanation, or code-search requests to sprint-flow | Only trigger for explicit feature development/implementation requests |
|
|
322
|
+
| Skip Phase 1/6 PREP isolation, edit directly on main/master/develop | Default: create worktree; only bypass with `--no-isolate` or `--force` + user confirmation |
|
|
323
|
+
| Skip AUTO-ESTIMATE and apply full heavy pipeline blindly | Evaluate lightweight/standard/complex first, follow recommended or user-confirmed flow |
|
|
324
|
+
| Skip Delphi review in DESIGN, go straight to BUILD | All requirement levels (lightweight/standard/complex) must pass R1 需求评审 + R2 delphi-review; APPROVED before coding |
|
|
325
|
+
| Skip TDD, implement code directly | Phase 3/6 BUILD must follow RED → GREEN → REFACTOR; tests and implementation delivered together |
|
|
326
|
+
| Skip user acceptance, go straight to Ship | Phase 6/6 CLOSE USER ACCEPTANCE must be manual; never automate, skip, or fake |
|
|
327
|
+
| Enter CLOSE without SHIP completing merge to main | Phase 5/6 SHIP must complete merge to main + release before entering Phase 6/6 CLOSE; otherwise worktree cleanup leaves residue + UAT reviews unmerged code |
|
|
328
|
+
| Clean up CLOSE without backing up sprint-state first | `.sprint-state/` is inside worktree; it's lost on worktree removal. CLOSE step 1 MUST back up to repo-tracked path first |
|
|
329
|
+
| Keep adding random changes after verification failures | Max 3 fix cycles; if still failing, BLOCK and request user decision |
|
|
330
|
+
| Enter next phase without generating Phase Summary | Every phase MUST write `.sprint-state/phase-outputs/phase-{N}-summary.md` and pass transition gate |
|
|
331
|
+
| Complete implementation change without running verification | After every file edit/refactor/feature, MUST run `npm test` + `npm run lint` + `npx tsc --noEmit` and record the structured verification event (see `phase-3-build.md` §In-Session Verification) |
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## 状态机 (State Machine)
|
|
336
|
+
|
|
337
|
+
```mermaid
|
|
338
|
+
stateDiagram-v2
|
|
339
|
+
[*] --> PREP : trigger matched
|
|
340
|
+
PREP --> DESIGN : worktree ready
|
|
341
|
+
DESIGN --> BUILD : APPROVED ≥90%
|
|
342
|
+
DESIGN --> DESIGN : REQUEST_CHANGES (max 5 Delphi rounds)
|
|
343
|
+
BUILD --> VERIFY : tests pass
|
|
344
|
+
BUILD --> BUILD : fix cycle (max 3)
|
|
345
|
+
VERIFY --> SHIP : feedback-log exists
|
|
346
|
+
VERIFY --> BUILD : critical issues found
|
|
347
|
+
SHIP --> CLOSE : PR merged
|
|
348
|
+
SHIP --> SHIP : CI failed (retry)
|
|
349
|
+
CLOSE --> [*] : UAT confirmed
|
|
350
|
+
BUILD --> BLOCKED : 3 fix cycles exhausted
|
|
351
|
+
DESIGN --> BLOCKED : 5 Delphi rounds exhausted
|
|
352
|
+
BLOCKED --> [*] : user decision
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## 决策记录模板 (Decision Record)
|
|
358
|
+
|
|
359
|
+
每个用户决策点必须记录到 `.sprint-state/decisions.md`:
|
|
360
|
+
|
|
361
|
+
```markdown
|
|
362
|
+
## Decision DR-{NNN}
|
|
363
|
+
- **Phase**: {phase_number}/6 {PHASE_NAME}
|
|
364
|
+
- **Question**: {what was asked}
|
|
365
|
+
- **Options**: {options presented}
|
|
366
|
+
- **Choice**: {user's selection}
|
|
367
|
+
- **Rationale**: {why this choice}
|
|
368
|
+
- **Timestamp**: {ISO 8601}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**强制决策点**:
|
|
372
|
+
| 决策点 | 阶段 | 触发条件 |
|
|
373
|
+
|--------|------|----------|
|
|
374
|
+
| 规模确认 | PREP | AUTO-ESTIMATE 结果与用户预期不符 |
|
|
375
|
+
| 设计审批 | DESIGN | delphi-review 返回 REQUEST_CHANGES |
|
|
376
|
+
| 修复策略 | BUILD | 修复循环达到 3 次上限 |
|
|
377
|
+
| 发布确认 | SHIP | PR 创建后等待用户确认合并 |
|
|
378
|
+
| UAT 结果 | CLOSE | 用户手动验收(必须手动,禁止自动化) |
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## 失败处理 (Failure Handling)
|
|
383
|
+
|
|
384
|
+
| 失败场景 | 处理策略 | 升级条件 |
|
|
385
|
+
|----------|----------|----------|
|
|
386
|
+
| Worktree 创建失败 | 重试 1 次,失败则提示用户手动处理 | 磁盘空间不足或权限问题 |
|
|
387
|
+
| delphi-review 连续 REQUEST_CHANGES | 最多 3 轮重设计,超过则 BLOCK | 3 轮后仍未 APPROVED |
|
|
388
|
+
| BUILD 修复循环超限 | 最多 3 次 fix cycle,超过则 BLOCK + 用户决策 | 测试持续失败 |
|
|
389
|
+
| CI 失败 | 分析失败原因,尝试 1 次自动修复 | 非 flaky 失败 |
|
|
390
|
+
| PR 合并冲突 | 提示用户手动解决 | 始终(禁止自动 force) |
|
|
391
|
+
| 工具缺失 | SKIP(不 BLOCK),记录到 phase summary | 始终不阻断 |
|
|
392
|
+
|
|
393
|
+
**BLOCK 状态处理**:
|
|
394
|
+
1. 写入 `.sprint-state/sprint-state.json` 状态为 `blocked`
|
|
395
|
+
2. 输出阻塞原因 + 已完成工作 + 建议操作
|
|
396
|
+
3. 等待用户决策(继续/放弃/降级)
|
|
397
|
+
4. 记录决策到 `decisions.md`
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## 使用示例
|
|
402
|
+
|
|
403
|
+
| 场景 | 命令 | 说明 |
|
|
404
|
+
|------|------|------|
|
|
405
|
+
| 完整流水线 | `/sprint-flow "开发访谈机器人"` | 自动执行 6 阶段 → specification.yaml + PR URL |
|
|
406
|
+
| 设计后停止 | `/sprint-flow "开发认证模块" --stop-at design` | 输出 specification.yaml 后停止,供评审 |
|
|
407
|
+
| 仅构建阶段 | `/sprint-flow "开发 API" --lang django --phase build-only` | 跳过准备/设计,直接 Build |
|
|
408
|
+
|
|
409
|
+
## 底层 Skills 保持独立
|
|
410
|
+
|
|
411
|
+
所有被调用的 Skills 独立可用:`delphi-review` (单独评审), `test-driven-development` (TDD), `grill-with-docs` (需求访谈), `batch-grill-me` (批量决策), `to-issues` (切片拆分),sprint-flow 仅自动串联
|