@boyingliu01/xp-gate 0.12.13 → 0.13.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.
Files changed (130) hide show
  1. package/adapters/typescript.sh +5 -2
  2. package/build-integrity/__tests__/ccn-refactor-gate10.test.ts +133 -0
  3. package/build-integrity/gate-10.ts +111 -123
  4. package/hooks/gate-3.sh +68 -0
  5. package/hooks/gate-4.sh +80 -0
  6. package/hooks/gate-7.sh +45 -0
  7. package/hooks/gate-8.sh +56 -0
  8. package/hooks/pre-commit +15 -3
  9. package/mock-policy/AGENTS.md +4 -4
  10. package/mutation/AGENTS.md +4 -4
  11. package/package.json +1 -1
  12. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  13. package/plugins/claude-code/skills/delphi-review/AGENTS.md +4 -4
  14. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +50 -62
  15. package/plugins/claude-code/skills/sprint-flow/SKILL.md +200 -238
  16. package/plugins/claude-code/skills/sprint-flow/references/force-levels.md +13 -14
  17. package/plugins/claude-code/skills/sprint-flow/references/orchestration-rules.md +61 -197
  18. package/plugins/claude-code/skills/sprint-flow/references/phase-1-prep.md +294 -0
  19. package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +194 -0
  20. package/{skills/sprint-flow/references/phase-2-build.md → plugins/claude-code/skills/sprint-flow/references/phase-3-build.md} +11 -11
  21. package/plugins/claude-code/skills/sprint-flow/references/phase-4-verify.md +153 -0
  22. package/plugins/claude-code/skills/sprint-flow/references/phase-5-ship.md +40 -0
  23. package/plugins/claude-code/skills/sprint-flow/references/phase-6-close.md +134 -0
  24. package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-learning-log.md +1 -1
  25. package/plugins/claude-code/skills/sprint-flow/templates/auto-estimate-output-template.md +15 -37
  26. package/plugins/claude-code/skills/sprint-flow/templates/emergent-issues-template.md +7 -7
  27. package/plugins/claude-code/skills/sprint-flow/templates/pain-document-template.md +5 -5
  28. package/plugins/claude-code/skills/sprint-flow/templates/sprint-progress-template.md +36 -47
  29. package/plugins/claude-code/skills/sprint-flow/templates/sprint-summary-template.md +16 -15
  30. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +4 -4
  31. package/plugins/opencode/package.json +1 -1
  32. package/plugins/opencode/skills/delphi-review/AGENTS.md +4 -4
  33. package/plugins/opencode/skills/sprint-flow/AGENTS.md +50 -62
  34. package/plugins/opencode/skills/sprint-flow/SKILL.md +200 -238
  35. package/plugins/opencode/skills/sprint-flow/references/force-levels.md +13 -14
  36. package/plugins/opencode/skills/sprint-flow/references/orchestration-rules.md +61 -197
  37. package/plugins/opencode/skills/sprint-flow/references/phase-1-prep.md +294 -0
  38. package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +194 -0
  39. package/plugins/{claude-code/skills/sprint-flow/references/phase-2-build.md → opencode/skills/sprint-flow/references/phase-3-build.md} +11 -11
  40. package/plugins/opencode/skills/sprint-flow/references/phase-4-verify.md +153 -0
  41. package/plugins/opencode/skills/sprint-flow/references/phase-5-ship.md +40 -0
  42. package/plugins/opencode/skills/sprint-flow/references/phase-6-close.md +134 -0
  43. package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-learning-log.md +1 -1
  44. package/plugins/opencode/skills/sprint-flow/templates/auto-estimate-output-template.md +15 -37
  45. package/plugins/opencode/skills/sprint-flow/templates/emergent-issues-template.md +7 -7
  46. package/plugins/opencode/skills/sprint-flow/templates/pain-document-template.md +5 -5
  47. package/plugins/opencode/skills/sprint-flow/templates/sprint-progress-template.md +36 -47
  48. package/plugins/opencode/skills/sprint-flow/templates/sprint-summary-template.md +16 -15
  49. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +4 -4
  50. package/plugins/qoder/plugin.json +1 -1
  51. package/plugins/qoder/skills/delphi-review/AGENTS.md +4 -4
  52. package/plugins/qoder/skills/sprint-flow/AGENTS.md +50 -62
  53. package/plugins/qoder/skills/sprint-flow/SKILL.md +274 -208
  54. package/plugins/qoder/skills/sprint-flow/references/components/middleware.md +5 -2
  55. package/plugins/qoder/skills/sprint-flow/references/force-levels.md +13 -14
  56. package/plugins/qoder/skills/sprint-flow/references/orchestration-rules.md +61 -197
  57. package/plugins/qoder/skills/sprint-flow/references/phase-1-prep.md +294 -0
  58. package/plugins/qoder/skills/sprint-flow/references/phase-2-design.md +194 -0
  59. package/plugins/{opencode/skills/sprint-flow/references/phase-2-build.md → qoder/skills/sprint-flow/references/phase-3-build.md} +11 -11
  60. package/plugins/qoder/skills/sprint-flow/references/phase-4-verify.md +153 -0
  61. package/plugins/qoder/skills/sprint-flow/references/phase-5-ship.md +40 -0
  62. package/plugins/qoder/skills/sprint-flow/references/phase-6-close.md +134 -0
  63. package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-learning-log.md +1 -1
  64. package/plugins/qoder/skills/sprint-flow/templates/auto-estimate-output-template.md +15 -37
  65. package/plugins/qoder/skills/sprint-flow/templates/emergent-issues-template.md +7 -7
  66. package/plugins/qoder/skills/sprint-flow/templates/pain-document-template.md +5 -5
  67. package/plugins/qoder/skills/sprint-flow/templates/sprint-progress-template.md +36 -47
  68. package/plugins/qoder/skills/sprint-flow/templates/sprint-summary-template.md +16 -15
  69. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +4 -4
  70. package/principles/AGENTS.md +4 -4
  71. package/principles/lint-baseline.ts +35 -40
  72. package/skills/delphi-review/AGENTS.md +4 -4
  73. package/skills/sprint-flow/AGENTS.md +50 -62
  74. package/skills/sprint-flow/SKILL.md +200 -238
  75. package/skills/sprint-flow/references/force-levels.md +13 -14
  76. package/skills/sprint-flow/references/orchestration-rules.md +61 -197
  77. package/skills/sprint-flow/references/phase-1-prep.md +294 -0
  78. package/skills/sprint-flow/references/phase-2-design.md +194 -0
  79. package/skills/sprint-flow/references/phase-3-build.md +147 -0
  80. package/skills/sprint-flow/references/phase-4-verify.md +153 -0
  81. package/skills/sprint-flow/references/phase-5-ship.md +40 -0
  82. package/skills/sprint-flow/references/phase-6-close.md +134 -0
  83. package/skills/sprint-flow/templates/auto-estimate-learning-log.md +1 -1
  84. package/skills/sprint-flow/templates/auto-estimate-output-template.md +15 -37
  85. package/skills/sprint-flow/templates/emergent-issues-template.md +7 -7
  86. package/skills/sprint-flow/templates/pain-document-template.md +5 -5
  87. package/skills/sprint-flow/templates/sprint-progress-template.md +36 -47
  88. package/skills/sprint-flow/templates/sprint-summary-template.md +16 -15
  89. package/skills/test-specification-alignment/AGENTS.md +4 -4
  90. package/plugins/claude-code/skills/sprint-flow/references/phase-0-think.md +0 -115
  91. package/plugins/claude-code/skills/sprint-flow/references/phase-1-plan.md +0 -178
  92. package/plugins/claude-code/skills/sprint-flow/references/phase-3-review.md +0 -215
  93. package/plugins/claude-code/skills/sprint-flow/references/phase-4-uat.md +0 -125
  94. package/plugins/claude-code/skills/sprint-flow/references/phase-5-feedback.md +0 -100
  95. package/plugins/claude-code/skills/sprint-flow/references/phase-6-ship.md +0 -9
  96. package/plugins/claude-code/skills/sprint-flow/references/phase-7-land.md +0 -9
  97. package/plugins/claude-code/skills/sprint-flow/references/phase-8-cleanup.md +0 -9
  98. package/plugins/claude-code/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +0 -263
  99. package/plugins/claude-code/skills/sprint-flow/references/phase-minus-1-isolate.md +0 -58
  100. package/plugins/opencode/skills/sprint-flow/references/phase-0-think.md +0 -115
  101. package/plugins/opencode/skills/sprint-flow/references/phase-1-plan.md +0 -178
  102. package/plugins/opencode/skills/sprint-flow/references/phase-3-review.md +0 -215
  103. package/plugins/opencode/skills/sprint-flow/references/phase-4-uat.md +0 -125
  104. package/plugins/opencode/skills/sprint-flow/references/phase-5-feedback.md +0 -100
  105. package/plugins/opencode/skills/sprint-flow/references/phase-6-ship.md +0 -9
  106. package/plugins/opencode/skills/sprint-flow/references/phase-7-land.md +0 -9
  107. package/plugins/opencode/skills/sprint-flow/references/phase-8-cleanup.md +0 -9
  108. package/plugins/opencode/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +0 -263
  109. package/plugins/opencode/skills/sprint-flow/references/phase-minus-1-isolate.md +0 -58
  110. package/plugins/qoder/skills/sprint-flow/references/phase-0-think.md +0 -115
  111. package/plugins/qoder/skills/sprint-flow/references/phase-1-plan.md +0 -178
  112. package/plugins/qoder/skills/sprint-flow/references/phase-2-build.md +0 -43
  113. package/plugins/qoder/skills/sprint-flow/references/phase-3-review.md +0 -215
  114. package/plugins/qoder/skills/sprint-flow/references/phase-4-uat.md +0 -125
  115. package/plugins/qoder/skills/sprint-flow/references/phase-5-feedback.md +0 -100
  116. package/plugins/qoder/skills/sprint-flow/references/phase-6-ship.md +0 -9
  117. package/plugins/qoder/skills/sprint-flow/references/phase-7-land.md +0 -9
  118. package/plugins/qoder/skills/sprint-flow/references/phase-8-cleanup.md +0 -9
  119. package/plugins/qoder/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +0 -263
  120. package/plugins/qoder/skills/sprint-flow/references/phase-minus-1-isolate.md +0 -58
  121. package/skills/sprint-flow/references/phase-0-think.md +0 -115
  122. package/skills/sprint-flow/references/phase-1-plan.md +0 -178
  123. package/skills/sprint-flow/references/phase-3-review.md +0 -215
  124. package/skills/sprint-flow/references/phase-4-uat.md +0 -125
  125. package/skills/sprint-flow/references/phase-5-feedback.md +0 -100
  126. package/skills/sprint-flow/references/phase-6-ship.md +0 -9
  127. package/skills/sprint-flow/references/phase-7-land.md +0 -9
  128. package/skills/sprint-flow/references/phase-8-cleanup.md +0 -9
  129. package/skills/sprint-flow/references/phase-minus-0-5-auto-estimate.md +0 -263
  130. package/skills/sprint-flow/references/phase-minus-1-isolate.md +0 -58
@@ -0,0 +1,56 @@
1
+ # ============================================================================
2
+ # GATE 8: Secret Scanning (gitleaks)
3
+ # Detects secrets (API keys, passwords, tokens) in staged files
4
+ # Tool: gitleaks -- https://github.com/gitleaks/gitleaks
5
+ # ============================================================================
6
+
7
+ 2>&1 echo ""
8
+ 2>&1 echo "→ Gate 8: Secret scanning (gitleaks)..."
9
+ GATE_8_START=$(gate_start_ms)
10
+
11
+ # Gitleaks availability check
12
+ GITLEAKS_CMD=""
13
+ if command -v gitleaks >/dev/null 2>&1; then
14
+ GITLEAKS_CMD="gitleaks"
15
+ elif [ -f "$HOME/.local/bin/gitleaks" ]; then
16
+ GIBLEAKS_CMD="$HOME/.local/bin/gitleaks"
17
+ fi
18
+
19
+ if [ -n "$GITLEAKS_CMD" ]; then
20
+ GITLEAKS_CONFIG=""
21
+ if [ -f ".gitleaks.toml" ]; then
22
+ GITLEAKS_CONFIG="--config=.gitleaks.toml"
23
+ fi
24
+
25
+ # Run gitleaks on staged changes only (pre-commit mode for speed)
26
+ GITLEAKS_OUTPUT=$($GITLEAKS_CMD git --pre-commit --redact --no-banner $GITLEAKS_CONFIG --report-format=json --report-path=/tmp/gitleaks-report.json 2>&1)
27
+ GITLEAKS_EXIT=$?
28
+
29
+ if [ "$GITLEAKS_EXIT" -eq 0 ]; then
30
+ echo " ✅ PASSED - No secrets detected."
31
+ GATE_8_STATUS="PASS"
32
+ elif [ "$GITLEAKS_EXIT" -eq 1 ]; then
33
+ # Secrets found — output details
34
+ echo "$GITLEAKS_OUTPUT"
35
+ echo ""
36
+ echo "❌ BLOCKED - Secrets detected in staged files."
37
+ echo ""
38
+ echo "Remediation options:"
39
+ echo " 1. Remove the secret and use environment variables instead"
40
+ echo " 2. Add a false positive to .gitleaks.toml allowlist"
41
+ echo " 3. Use git secret or vault for sensitive data"
42
+ echo ""
43
+ echo "See: https://github.com/gitleaks/gitleaks"
44
+ exit 1
45
+ else
46
+ echo " ⚠️ gitleaks exited with code $GITLEAKS_EXIT - skipping gate"
47
+ echo " ✅ Secret Scanning (SKIP, gitleaks error)"
48
+ GATE_8_STATUS="SKIP"
49
+ fi
50
+ else
51
+ echo " ℹ️ gitleaks not installed — secret scanning unavailable"
52
+ echo " Install: brew install gitleaks (macOS) | winget install gitleaks (Windows) | scripts/install-gitleaks.sh (Linux)"
53
+ echo " ⏭️ SKIPPED - Secret scanning (gitleaks not installed)"
54
+ GATE_8_STATUS="SKIP"
55
+ fi
56
+ record_gate_audit "gate-8" "secret-scanning" "$GATE_8_STATUS" "0" "$GATE_8_START"
package/hooks/pre-commit CHANGED
@@ -1555,6 +1555,11 @@ else
1555
1555
  # Stage 2: UNCONDITIONAL coverage percentage enforcement
1556
1556
  # Always attempt to parse coverage from available sources. If percentage
1557
1557
  # can be determined and is < 80% → BLOCK. If no data found → warn.
1558
+ #
1559
+ # NOTE: When only a subset of test files were run (smart selection, Issue #286),
1560
+ # coverage data reflects only the tested subset. In that case we warn but don't
1561
+ # block, because the full suite coverage may be ≥80% even though the subset
1562
+ # coverage is lower.
1558
1563
  # ============================================================================
1559
1564
  COVERAGE_ENFORCED=false
1560
1565
 
@@ -1571,10 +1576,17 @@ else
1571
1576
  " 2>/dev/null)
1572
1577
  if [ "$COVERAGE_PERCENT" != "parse_error" ] && [ -n "$COVERAGE_PERCENT" ]; then
1573
1578
  if [ "$COVERAGE_PERCENT" -lt 80 ]; then
1574
- echo "❌ BLOCKED - TypeScript coverage ${COVERAGE_PERCENT}% below 80% threshold"
1575
- exit 1
1579
+ # If only subset of tests ran, warn instead of block
1580
+ if [ -n "${CHANGED_TEST_FILE_COUNT:-}" ] && [ "${CHANGED_TEST_FILE_COUNT:-0}" -gt 0 ] 2>/dev/null; then
1581
+ echo "⚠️ Partial coverage ${COVERAGE_PERCENT}% (subset test run, not full suite)."
1582
+ echo " Run 'npx vitest run --coverage' for full coverage check."
1583
+ else
1584
+ echo "❌ BLOCKED - TypeScript coverage ${COVERAGE_PERCENT}% below 80% threshold"
1585
+ exit 1
1586
+ fi
1587
+ else
1588
+ echo "TypeScript coverage: ${COVERAGE_PERCENT}% ✅ (≥ 80%)"
1576
1589
  fi
1577
- echo "TypeScript coverage: ${COVERAGE_PERCENT}% ✅ (≥ 80%)"
1578
1590
  else
1579
1591
  echo "⚠️ Could not parse TypeScript coverage from coverage/coverage-summary.json"
1580
1592
  fi
@@ -1,9 +1,9 @@
1
1
  # SRC/MOCK-POLICY KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-07
4
- **Commit:** 897f8eb
5
- **Branch:** main
6
- **Version:** 0.12.13.0
3
+ **Generated:** 2026-07-08
4
+ **Commit:** 6f868ee
5
+ **Branch:** sprint/2026-07-07-01
6
+ **Version:** 0.13.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Mock layering policy enforcement — Gate M3 of pre-push hook. Ensures integration tests use real implementations for internal dependencies, mock external dependencies, and annotate pending mocks with removal plans. Combines project scope scanning, mock decision engine, and per-file validation into a single pipeline.
@@ -1,9 +1,9 @@
1
1
  # SRC/MUTATION KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-07
4
- **Commit:** 897f8eb
5
- **Branch:** main
6
- **Version:** 0.12.13.0
3
+ **Generated:** 2026-07-08
4
+ **Commit:** 6f868ee
5
+ **Branch:** sprint/2026-07-07-01
6
+ **Version:** 0.13.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **Gate M** (incremental mutation testing) + **Gate M2** helpers (test-layer detection used by `src/mock-policy/`). Pre-push quality gate. TypeScript-only; uses Stryker.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/xp-gate",
3
- "version": "0.12.13",
3
+ "version": "0.13.0",
4
4
  "description": "AI-driven development workflow: 6 quality gates + Delphi review + Sprint Flow",
5
5
  "bin": {
6
6
  "xp-gate": "./bin/xp-gate.js"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.12.13",
3
+ "version": "0.13.0",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Claude Code. Includes 10 quality gates (Gate 0-9), Sprint Flow (11 phases), and Delphi multi-expert review (>=90% consensus).",
6
6
  "author": {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-07
4
- **Commit:** 897f8eb
5
- **Branch:** main
6
- **Version:** 0.12.13.0
3
+ **Generated:** 2026-07-08
4
+ **Commit:** 6f868ee
5
+ **Branch:** sprint/2026-07-07-01
6
+ **Version:** 0.13.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, 3 experts from ≥2 providers, domestic models only). Supports design + code-walkthrough modes.
@@ -1,35 +1,32 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-07-07
4
- **Commit:** 897f8eb
5
- **Branch:** main
6
- **Version:** 0.12.13.0
3
+ **Generated:** 2026-07-08
4
+ **Commit:** 6f868ee
5
+ **Branch:** sprint/2026-07-07-01
6
+ **Version:** 0.13.0.0
7
7
 
8
8
  ## OVERVIEW
9
- **11-phase** development pipeline: ISOLATE AUTO-ESTIMATE THINKPLAN → BUILD → REVIEW → SHIP → LAND → USER ACCEPTANCE → FEEDBACK → CLEANUP. Phase 2 default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE in Phase 1: design must pass Delphi review (≥90% consensus) before any coding.
9
+ **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
10
10
 
11
- > **Doc drift**: README/CAPABILITIES still describe a "7-phase" pipeline. The canonical 11-phase model lives in `SKILL.md` and is what actually executes. See root `AGENTS.md` "Known Drift" #4.
11
+ > **v2.0 Compact Redesign (Issue #290)**: Merged from 11 phases to 6. PREP = old ISOLATE + AUTO-ESTIMATE. DESIGN = old THINK + PLAN. BUILD = old BUILD. VERIFY = old REVIEW + FEEDBACK. SHIP = old SHIP + LAND. CLOSE = old USER ACCEPTANCE + CLEANUP.
12
12
 
13
13
  ## STRUCTURE
14
14
  ```
15
15
  skills/sprint-flow/
16
- ├── SKILL.md # 11-phase pipeline definition (canonical)
16
+ ├── SKILL.md # 6-phase pipeline definition (canonical, v2.0)
17
17
  ├── AGENTS.md # This file (mirrored to 7 other locations — DO NOT edit mirrors)
18
18
  ├── evals/ # Evaluation test cases
19
19
  ├── evolution-history.json
20
20
  ├── evolution-log.md
21
21
  ├── references/
22
- │ ├── phase-minus-0-5-auto-estimate.md # Phase -0.5: AUTO-ESTIMATE
23
- │ ├── phase-0-think.md # Phase 0: brainstorming CONTEXT.md + ADR
24
- │ ├── phase-1-plan.md # Phase 1: autoplan + delphi-review (HARD-GATE)
25
- │ ├── phase-2-build.md # Phase 2: ralph-loop default + TDD + test-align
26
- │ ├── phase-3-review.md # Phase 3: code-walkthrough + QA + benchmark
27
- │ ├── phase-4-uat.md # Phase 4: USER ACCEPTANCE
28
- │ ├── phase-5-feedback.md # Phase 5: retro + debugging + learn
29
- │ ├── phase-6-ship.md # Phase 6: finishing-dev-branch + PR
30
- │ ├── phase-7-land.md # Phase 7: land + deploy
31
- │ ├── phase-8-cleanup.md # Phase 8: sprint branch cleanup
22
+ │ ├── phase-1-prep.md # Phase 1/6: PREP (worktree isolation + sizing)
23
+ │ ├── phase-2-design.md # Phase 2/6: DESIGN (brainstorming + delphi-review HARD-GATE)
24
+ │ ├── phase-3-build.md # Phase 3/6: BUILD (ralph-loop default + TDD + test-align)
25
+ │ ├── phase-4-verify.md # Phase 4/6: VERIFY (code-walkthrough + QA + feedback)
26
+ │ ├── phase-5-ship.md # Phase 5/6: SHIP (PR + merge + deploy + canary)
27
+ │ ├── phase-6-close.md # Phase 6/6: CLOSE (UAT + cleanup)
32
28
  │ ├── force-levels.md # Phase forcing rules
29
+ │ ├── orchestration-rules.md # Agent dispatch, context inheritance, transition rules
33
30
  │ └── components/ # Reusable phase building blocks
34
31
  └── templates/
35
32
  ├── auto-estimate-output-template.md
@@ -43,73 +40,64 @@ skills/sprint-flow/
43
40
  ## WHERE TO LOOK
44
41
  | Task | Location | Notes |
45
42
  |------|----------|-------|
46
- | Pipeline definition | SKILL.md | 11 phases with HARD-GATE between Phase 1 and Phase 2 |
47
- | Auto-estimate phase | references/phase-minus-0-5-auto-estimate.md | Sizing pass before THINK |
48
- | THINK phase | references/phase-0-think.md | brainstorming CONTEXT.md + ADR |
49
- | PLAN phase + HARD-GATE | references/phase-1-plan.md | autoplan delphi-review specification.yaml |
50
- | BUILD phase | references/phase-2-build.md | ralph-loop (default) vs parallel |
43
+ | Pipeline definition | SKILL.md | 6 phases with HARD-GATE between DESIGN (2/6) and BUILD (3/6) |
44
+ | PREP phase | references/phase-1-prep.md | worktree isolation + sizing pass |
45
+ | DESIGN phase + HARD-GATE | references/phase-2-design.md | brainstorming + autoplan + delphi-review → specification.yaml |
46
+ | BUILD phase | references/phase-3-build.md | ralph-loop (default) vs parallel |
47
+ | VERIFY phase | references/phase-4-verify.md | code-walkthrough + QA + retro + learn |
48
+ | SHIP phase | references/phase-5-ship.md | PR + merge + deploy + canary |
49
+ | CLOSE phase | references/phase-6-close.md | UAT + cleanup |
51
50
  | Force-level rules | references/force-levels.md | Defines when each phase becomes mandatory |
51
+ | Orchestration rules | references/orchestration-rules.md | Agent dispatch, context inheritance, transition gates |
52
52
  | Templates | templates/ | Auto-estimate, sprint progress/summary, pain doc, emergent issues |
53
53
 
54
- ## THE 11 PHASES
54
+ ## THE 6 PHASES (v2.0)
55
55
 
56
- | Phase | Name | Key Action | Hard Gate |
57
- |-------|------|-----------|-----------|
58
- | -1 | ISOLATE | Isolate working tree / worktree creation | — |
59
- | -0.5 | AUTO-ESTIMATE | Sizing pass; emits estimate template | |
60
- | 0 | THINK | brainstorming CONTEXT.md + ADR | — |
61
- | 1 | PLAN | autoplan delphi-review specification.yaml | **HARD-GATE**: design must reach ≥90% Delphi consensus |
62
- | 2 | BUILD | ralph-loop (REQ-level, default) + TDD + test-spec-alignment | — |
63
- | 3 | REVIEW | code-walkthrough + QA + benchmark | |
64
- | 4 | SHIP | finishing-a-development-branch → PR | — |
65
- | 5 | LAND | land + deploy staging + canary | — |
66
- | 6 | USER ACCEPTANCE | Manual verification on staging | — |
67
- | 7 | FEEDBACK | retro + debugging + `learn` (Sprint-level) | — |
68
- | 8 | CLEANUP | Sprint branch cleanup (per `docs/plans/2026-06-06-sprint-branch-cleanup-design.md`) | — |
56
+ | Phase | Name | Maps From (old 11) | Key Action | Hard Gate |
57
+ |-------|------|-------------------|------------|-----------|
58
+ | 1/6 | PREP | ISOLATE + AUTO-ESTIMATE | Worktree isolation + sizing | — |
59
+ | 2/6 | DESIGN | THINK + PLAN | brainstorming → autoplan → Delphi consensus | **HARD-GATE**: design must reach ≥90% Delphi consensus |
60
+ | 3/6 | BUILD | BUILD | ralph-loop (default) + TDD + test-spec-alignment | — |
61
+ | 4/6 | VERIFY | REVIEW + FEEDBACK | code-walkthrough + QA + retro + learn | HARD-GATE: feedback-log.md must exist |
62
+ | 5/6 | SHIP | SHIP + LAND | PR squash-merge → deploy → canary | — |
63
+ | 6/6 | CLOSE | USER ACCEPT + CLEANUP | Manual UAT → emergent issues → cleanup | HARD-GATE: UAT mandatory manual |
69
64
 
70
65
  ## CONVENTIONS
71
- - **ralph-loop is Phase 2 default**. Each REQ runs in a clean context (no linear accumulation), saving 40-67% tokens vs parallel mode.
72
- - **delphi-review HARD-GATE in Phase 1**: design must reach ≥90% consensus across ≥2 model providers, domestic models only. Unapproved → BLOCK coding.
73
- - **`learn` is called twice**: once per REQ in Phase 2 (ralph-loop internal, `progress.log` permanent/contextual classification) and once in Phase 5 (Sprint-level retro).
66
+ - **ralph-loop is Phase 3/6 BUILD default**. Each REQ runs in a clean context, saving 40-67% tokens.
67
+ - **delphi-review HARD-GATE in Phase 2/6 DESIGN**: design must reach ≥90% consensus across ≥2 model providers, domestic models only. Unapproved → BLOCK coding.
68
+ - **`learn` is called twice**: once per REQ in Phase 3/6 (ralph-loop internal) and once in Phase 4/6 VERIFY (Sprint-level retro).
74
69
  - **Phase isolation**: each phase has explicit entry/exit criteria documented in its `references/phase-*.md` file.
75
- - **Emergent Requirements** discovered in Phase 6 (USER ACCEPTANCE) are explicitly captured via `templates/emergent-issues-template.md` — never silently merged.
76
- - **Auto-detection**: Phase 0 uses `src/npm-package/lib/ui-detector.ts` to pick the right tech-stack templates.
70
+ - **Emergent Requirements** discovered in Phase 6/6 CLOSE (USER ACCEPTANCE) are explicitly captured via `templates/emergent-issues-template.md` — never silently merged.
71
+ - **Auto-detection**: Phase 2/6 DESIGN uses `src/npm-package/lib/ui-detector.ts` to pick the right tech-stack templates.
77
72
 
78
73
  ## ANTI-PATTERNS (THIS PROJECT)
79
- - Do NOT skip `delphi-review` in Phase 1 — HARD-GATE blocks implementation.
74
+ - Do NOT skip `delphi-review` in Phase 2/6 DESIGN — HARD-GATE blocks implementation.
80
75
  - Do NOT use parallel build mode unless explicitly requested. Ralph-loop is the default for a reason.
81
- - Do NOT enter Phase 1 (PLAN) without completing Phase 0 (THINK).
82
- - Do NOT implement before design is APPROVED — Phase 1 must reach Delphi consensus first.
83
- - Do NOT merge an Emergent Requirement into the original Sprint silently — capture it via the template.
76
+ - Do NOT enter Phase 2/6 DESIGN (PLAN) without completing DESIGN (brainstorming).
77
+ - Do NOT implement before design is APPROVED — Phase 2/6 DESIGN must reach Delphi consensus first.
78
+ - Do NOT merge an Emergent Requirement into the original Sprint silently — capture it via the template in Phase 6/6 CLOSE.
84
79
  - Do NOT terminate Delphi review before ≥90% consensus or 5 rounds, whichever first.
85
80
 
86
81
  ## UNIQUE STYLES
87
- - **11 phases** including negative-numbered pre-phases (-1, -0.5) — intentional, captures the work that happens before "real" coding starts.
88
- - **HARD-GATE** between PLAN and BUILD is enforced both in the SKILL.md instructions and in the Claude Code plugin's PreToolUse hook (`plugins/claude-code/bin/delphi-review-guard.sh`).
89
- - **Per-REQ clean context in ralph-loop** = the core efficiency mechanism. Sprint-flow specifically chooses this over parallel mode.
82
+ - **6 phases** (v2.0 Issue #290) — compact design with merged phases (1-6 numbering)
83
+ - **HARD-GATE** between DESIGN and BUILD enforced both in SKILL.md and Claude Code plugin's PreToolUse hook.
84
+ - **Per-REQ clean context in ralph-loop** = the core efficiency mechanism.
90
85
  - **Tech-stack auto-detection** via `--type` and `--lang` flags or `ui-detector.ts`.
91
86
 
92
87
  ## COMMANDS
93
88
  ```bash
94
- /sprint-flow "开发用户登录" # Full 11-phase pipeline
89
+ /sprint-flow "开发用户登录" # Full 6-phase pipeline
95
90
  /sprint-flow "开发用户登录" --type web-nextjs --lang typescript # Pin tech stack
96
- /sprint-flow "开发用户登录" --phase build-only # Skip planning (advanced)
91
+ /sprint-flow "开发用户登录" --phase build-only # Skip design (advanced)
97
92
  /sprint-flow "开发用户登录" --mode parallel # Legacy all-at-once (NOT default)
93
+ /sprint-flow "开发用户登录" --stop-at design # Stop after DESIGN phase
98
94
  /delphi-review "开发用户登录" --type web-nextjs --lang typescript
99
95
  ```
100
96
 
101
97
  ## NOTES
102
- - Integrates: brainstorming, autoplan, delphi-review, TDD, test-specification-alignment, qa, design-review, benchmark, systematic-debugging, retro, learn, finishing-a-development-branch.
98
+ - Integrates: brainstorming, autoplan, delphi-review, TDD, test-specification-alignment, qa, design-review, benchmark, systematic-debugging, retro, learn, finishing-a-development-branch, land-and-deploy.
103
99
  - ralph-loop's internal learnings are persisted via `progress.log` (permanent vs contextual classification).
104
- - Phase 5 calls `gstack/learn` for Sprint-level retrospective.
105
- - Phase 8 cleanup behavior is governed by `docs/plans/2026-06-06-sprint-branch-cleanup-design.md`.
106
- - This `AGENTS.md` is the canonical version. **7 byte-identical mirrors** exist at:
107
- - `plugins/claude-code/skills/sprint-flow/AGENTS.md`
108
- - `plugins/opencode/skills/sprint-flow/AGENTS.md`
109
- - `plugins/qoder/skills/sprint-flow/AGENTS.md`
110
- - `src/npm-package/skills/sprint-flow/AGENTS.md`
111
- - `src/npm-package/plugins/claude-code/skills/sprint-flow/AGENTS.md`
112
- - `src/npm-package/plugins/opencode/skills/sprint-flow/AGENTS.md`
113
- - `src/npm-package/plugins/qoder/skills/sprint-flow/AGENTS.md`
100
+ - Phase 4/6 VERIFY calls `gstack/learn` for Sprint-level retrospective.
101
+ - Phase 6/6 CLOSE cleanup behavior is governed by `docs/plans/2026-06-06-sprint-branch-cleanup-design.md`.
102
+ - This `AGENTS.md` is the canonical version. **7 byte-identical mirrors** exist.
114
103
  Mirrors are updated by `scripts/copy-skills.sh`. Do NOT edit them by hand.
115
-