claude-code-workflow 7.2.30 → 7.3.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 (183) hide show
  1. package/.claude/commands/workflow-skill.md +130 -0
  2. package/.claude/skills/ccw-chain/SKILL.md +44 -71
  3. package/.claude/skills/ccw-chain/chains/ccw-cycle.json +13 -3
  4. package/.claude/skills/ccw-chain/chains/ccw-exploration.json +33 -22
  5. package/.claude/skills/ccw-chain/chains/ccw-issue.json +23 -12
  6. package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +23 -9
  7. package/.claude/skills/ccw-chain/chains/ccw-main.json +15 -2
  8. package/.claude/skills/ccw-chain/chains/ccw-standard.json +28 -16
  9. package/.claude/skills/ccw-chain/chains/ccw-team.json +7 -2
  10. package/.claude/skills/ccw-chain/chains/ccw-with-file.json +25 -9
  11. package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -53
  12. package/.claude/skills/chain-loader/specs/chain-schema.md +30 -3
  13. package/.claude/skills/chain-loader/templates/chain-json.md +63 -63
  14. package/.claude/skills/workflow-plan/SKILL.md +1 -0
  15. package/.claude/skills/workflow-plan/phases/01-session-discovery.md +19 -2
  16. package/.claude/skills/workflow-plan/phases/02-context-gathering.md +2 -2
  17. package/.claude/skills/workflow-plan/phases/04-task-generation.md +9 -1
  18. package/.codex/skills/analyze-with-file/SKILL.md +383 -134
  19. package/.codex/skills/brainstorm/SKILL.md +3 -3
  20. package/.codex/skills/brainstorm-with-file/SKILL.md +208 -88
  21. package/.codex/skills/clean/SKILL.md +1 -1
  22. package/.codex/skills/csv-wave-pipeline/SKILL.md +2 -2
  23. package/.codex/skills/investigate/orchestrator.md +24 -0
  24. package/.codex/skills/issue-discover/SKILL.md +374 -361
  25. package/.codex/skills/issue-discover/phases/01-issue-new.md +1 -1
  26. package/.codex/skills/issue-discover/phases/02-discover.md +2 -2
  27. package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +1 -1
  28. package/.codex/skills/issue-discover/phases/04-quick-execute.md +2 -2
  29. package/.codex/skills/parallel-dev-cycle/SKILL.md +44 -37
  30. package/.codex/skills/project-documentation-workflow/SKILL.md +1 -1
  31. package/.codex/skills/review-cycle/SKILL.md +31 -12
  32. package/.codex/skills/roadmap-with-file/SKILL.md +141 -133
  33. package/.codex/skills/security-audit/orchestrator.md +29 -0
  34. package/.codex/skills/session-sync/SKILL.md +1 -1
  35. package/.codex/skills/ship/orchestrator.md +24 -0
  36. package/.codex/skills/spec-add/SKILL.md +5 -5
  37. package/.codex/skills/spec-generator/SKILL.md +33 -2
  38. package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +3 -3
  39. package/.codex/skills/spec-generator/phases/01-discovery.md +1 -1
  40. package/.codex/skills/spec-generator/phases/02-product-brief.md +1 -1
  41. package/.codex/skills/spec-generator/phases/03-requirements.md +1 -1
  42. package/.codex/skills/spec-generator/phases/04-architecture.md +1 -1
  43. package/.codex/skills/spec-generator/phases/05-epics-stories.md +1 -1
  44. package/.codex/skills/spec-generator/phases/06-readiness-check.md +1 -1
  45. package/.codex/skills/spec-generator/phases/07-issue-export.md +1 -1
  46. package/.codex/skills/spec-setup/SKILL.md +669 -669
  47. package/.codex/skills/team-arch-opt/specs/team-config.json +1 -1
  48. package/.codex/skills/team-brainstorm/SKILL.md +259 -259
  49. package/.codex/skills/team-coordinate/SKILL.md +359 -359
  50. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +1 -1
  51. package/.codex/skills/team-designer/SKILL.md +27 -1
  52. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +2 -2
  53. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  54. package/.codex/skills/team-designer/phases/04-validation.md +1 -1
  55. package/.codex/skills/team-executor/SKILL.md +218 -218
  56. package/.codex/skills/team-frontend/SKILL.md +227 -227
  57. package/.codex/skills/team-frontend-debug/SKILL.md +278 -278
  58. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +2 -2
  59. package/.codex/skills/team-interactive-craft/SKILL.md +220 -220
  60. package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -209
  61. package/.codex/skills/team-issue/SKILL.md +269 -269
  62. package/.codex/skills/team-issue/roles/coordinator/role.md +1 -1
  63. package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -305
  64. package/.codex/skills/team-motion-design/SKILL.md +222 -222
  65. package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -210
  66. package/.codex/skills/team-perf-opt/SKILL.md +258 -258
  67. package/.codex/skills/team-perf-opt/specs/team-config.json +1 -1
  68. package/.codex/skills/team-planex/SKILL.md +216 -216
  69. package/.codex/skills/team-quality-assurance/SKILL.md +229 -229
  70. package/.codex/skills/team-review/SKILL.md +227 -227
  71. package/.codex/skills/team-roadmap-dev/SKILL.md +238 -238
  72. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +5 -5
  73. package/.codex/skills/team-tech-debt/SKILL.md +206 -206
  74. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
  75. package/.codex/skills/team-testing/SKILL.md +237 -237
  76. package/.codex/skills/team-ui-polish/SKILL.md +218 -218
  77. package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -213
  78. package/.codex/skills/team-uidesign/SKILL.md +219 -219
  79. package/.codex/skills/team-uidesign/roles/coordinator/role.md +2 -2
  80. package/.codex/skills/team-ultra-analyze/SKILL.md +260 -260
  81. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +1 -1
  82. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
  83. package/.codex/skills/team-ux-improve/SKILL.md +227 -227
  84. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +1 -1
  85. package/.codex/skills/team-ux-improve/specs/team-config.json +1 -1
  86. package/.codex/skills/team-visual-a11y/SKILL.md +319 -319
  87. package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -213
  88. package/.codex/skills/workflow-execute/SKILL.md +5 -5
  89. package/.codex/skills/workflow-lite-planex/SKILL.md +3 -3
  90. package/.codex/skills/workflow-plan/SKILL.md +3 -3
  91. package/.codex/skills/workflow-tdd-plan/SKILL.md +4 -4
  92. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +403 -402
  93. package/ccw/dist/cli.d.ts.map +1 -1
  94. package/ccw/dist/cli.js +16 -0
  95. package/ccw/dist/cli.js.map +1 -1
  96. package/ccw/dist/commands/chain-loader.d.ts +2 -0
  97. package/ccw/dist/commands/chain-loader.d.ts.map +1 -0
  98. package/ccw/dist/commands/chain-loader.js +11 -0
  99. package/ccw/dist/commands/chain-loader.js.map +1 -0
  100. package/ccw/dist/commands/install.d.ts.map +1 -1
  101. package/ccw/dist/commands/install.js +52 -1
  102. package/ccw/dist/commands/install.js.map +1 -1
  103. package/ccw/dist/commands/launcher.d.ts +2 -0
  104. package/ccw/dist/commands/launcher.d.ts.map +1 -0
  105. package/ccw/dist/commands/launcher.js +434 -0
  106. package/ccw/dist/commands/launcher.js.map +1 -0
  107. package/ccw/dist/tools/chain-loader.d.ts.map +1 -1
  108. package/ccw/dist/tools/chain-loader.js +457 -45
  109. package/ccw/dist/tools/chain-loader.js.map +1 -1
  110. package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -1
  111. package/ccw/dist/tools/skill-context-loader.js +12 -26
  112. package/ccw/dist/tools/skill-context-loader.js.map +1 -1
  113. package/ccw/dist/types/chain-types.d.ts +41 -1
  114. package/ccw/dist/types/chain-types.d.ts.map +1 -1
  115. package/ccw/dist/utils/chain-visualizer.d.ts +13 -0
  116. package/ccw/dist/utils/chain-visualizer.d.ts.map +1 -0
  117. package/ccw/dist/utils/chain-visualizer.js +164 -0
  118. package/ccw/dist/utils/chain-visualizer.js.map +1 -0
  119. package/package.json +1 -1
  120. package/.claude/commands/cli/cli-init.md +0 -441
  121. package/.claude/commands/cli/codex-review.md +0 -361
  122. package/.claude/commands/flow-create.md +0 -663
  123. package/.claude/skills/ccw-chain/phases/analyze-with-file.md +0 -788
  124. package/.claude/skills/ccw-chain/phases/brainstorm/SKILL.md +0 -408
  125. package/.claude/skills/ccw-chain/phases/brainstorm/phases/01-mode-routing.md +0 -207
  126. package/.claude/skills/ccw-chain/phases/brainstorm/phases/02-artifacts.md +0 -567
  127. package/.claude/skills/ccw-chain/phases/brainstorm/phases/03-role-analysis.md +0 -748
  128. package/.claude/skills/ccw-chain/phases/brainstorm/phases/04-synthesis.md +0 -827
  129. package/.claude/skills/ccw-chain/phases/brainstorm-with-file.md +0 -482
  130. package/.claude/skills/ccw-chain/phases/collaborative-plan-with-file.md +0 -639
  131. package/.claude/skills/ccw-chain/phases/debug-with-file.md +0 -656
  132. package/.claude/skills/ccw-chain/phases/integration-test-cycle.md +0 -936
  133. package/.claude/skills/ccw-chain/phases/issue-convert-to-plan.md +0 -720
  134. package/.claude/skills/ccw-chain/phases/issue-discover.md +0 -483
  135. package/.claude/skills/ccw-chain/phases/issue-execute.md +0 -629
  136. package/.claude/skills/ccw-chain/phases/issue-from-brainstorm.md +0 -382
  137. package/.claude/skills/ccw-chain/phases/issue-plan.md +0 -343
  138. package/.claude/skills/ccw-chain/phases/issue-queue.md +0 -464
  139. package/.claude/skills/ccw-chain/phases/refactor-cycle.md +0 -852
  140. package/.claude/skills/ccw-chain/phases/review-cycle/SKILL.md +0 -132
  141. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-fix.md +0 -760
  142. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-module.md +0 -764
  143. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-session.md +0 -775
  144. package/.claude/skills/ccw-chain/phases/roadmap-with-file.md +0 -544
  145. package/.claude/skills/ccw-chain/phases/spec-generator/SKILL.md +0 -338
  146. package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-5-requirement-clarification.md +0 -404
  147. package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-discovery.md +0 -257
  148. package/.claude/skills/ccw-chain/phases/spec-generator/phases/02-product-brief.md +0 -274
  149. package/.claude/skills/ccw-chain/phases/spec-generator/phases/03-requirements.md +0 -184
  150. package/.claude/skills/ccw-chain/phases/spec-generator/phases/04-architecture.md +0 -248
  151. package/.claude/skills/ccw-chain/phases/spec-generator/phases/05-epics-stories.md +0 -178
  152. package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-5-auto-fix.md +0 -144
  153. package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-readiness-check.md +0 -480
  154. package/.claude/skills/ccw-chain/phases/team-planex.md +0 -123
  155. package/.claude/skills/ccw-chain/phases/ui-design-explore-auto.md +0 -678
  156. package/.claude/skills/ccw-chain/phases/unified-execute-with-file.md +0 -870
  157. package/.claude/skills/ccw-chain/phases/workflow-execute/SKILL.md +0 -625
  158. package/.claude/skills/ccw-chain/phases/workflow-execute/phases/06-review.md +0 -215
  159. package/.claude/skills/ccw-chain/phases/workflow-lite-plan.md +0 -616
  160. package/.claude/skills/ccw-chain/phases/workflow-multi-cli-plan.md +0 -424
  161. package/.claude/skills/ccw-chain/phases/workflow-plan/SKILL.md +0 -466
  162. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/01-session-discovery.md +0 -99
  163. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/02-context-gathering.md +0 -338
  164. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/03-conflict-resolution.md +0 -422
  165. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/04-task-generation.md +0 -440
  166. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/05-plan-verify.md +0 -395
  167. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/06-replan.md +0 -594
  168. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/SKILL.md +0 -527
  169. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/01-session-discovery.md +0 -57
  170. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/02-context-gathering.md +0 -407
  171. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/03-test-coverage-analysis.md +0 -172
  172. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/04-conflict-resolution.md +0 -426
  173. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/05-tdd-task-generation.md +0 -473
  174. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/06-tdd-structure-validation.md +0 -189
  175. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/07-tdd-verify.md +0 -635
  176. package/.claude/skills/ccw-chain/phases/workflow-test-fix/SKILL.md +0 -482
  177. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/01-session-start.md +0 -60
  178. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/02-test-context-gather.md +0 -493
  179. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/03-test-concept-enhanced.md +0 -150
  180. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/04-test-task-generate.md +0 -346
  181. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/05-test-cycle-execute.md +0 -538
  182. package/.claude/skills/ccw-chain/specs/intent-patterns.md +0 -60
  183. package/.claude/skills/team-edict.zip +0 -0
@@ -1,527 +0,0 @@
1
- ---
2
- name: workflow-tdd-plan-plan
3
- description: Unified TDD workflow skill combining 6-phase TDD planning with Red-Green-Refactor task chain generation, and 4-phase TDD verification with compliance reporting. Triggers on "workflow-tdd-plan", "workflow-tdd-verify".
4
- allowed-tools: Skill, Agent, AskUserQuestion, TaskCreate, TaskUpdate, TaskList, Read, Write, Edit, Bash, Glob, Grep
5
- ---
6
-
7
- <purpose>
8
- Unified TDD workflow skill combining TDD planning (Red-Green-Refactor task chain generation with test-first development structure) and TDD verification (compliance validation with quality gate reporting). Produces IMPL_PLAN.md, task JSONs with internal TDD cycles, and TDD_COMPLIANCE_REPORT.md. Triggers on "workflow-tdd-plan" (plan mode) or "workflow-tdd-verify" (verify mode).
9
- </purpose>
10
-
11
- <process>
12
-
13
- ## 1. Architecture Overview
14
-
15
- ```
16
- ┌──────────────────────────────────────────────────────────────────┐
17
- │ Workflow TDD Orchestrator (SKILL.md) │
18
- │ → Route by mode: plan | verify │
19
- │ → Pure coordinator: Execute phases, parse outputs, pass context │
20
- └──────────────────────────────────┬───────────────────────────────┘
21
-
22
- ┌───────────────────────┴───────────────────────┐
23
- ↓ ↓
24
- ┌─────────────┐ ┌───────────┐
25
- │ Plan Mode │ │ Verify │
26
- │ (default) │ │ Mode │
27
- │ Phase 1-6 │ │ Phase 7 │
28
- └──────┬──────┘ └───────────┘
29
-
30
- ┌─────┼─────┬─────┬─────┬─────┐
31
- ↓ ↓ ↓ ↓ ↓ ↓
32
- ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐
33
- │ 1 │ │ 2 │ │ 3 │ │ 4 │ │ 5 │ │ 6 │
34
- │Ses│ │Ctx│ │Tst│ │Con│ │Gen│ │Val│
35
- └───┘ └───┘ └───┘ └───┘ └─┬─┘ └───┘
36
-
37
- ┌───────────┐
38
- │ Confirm │─── Verify ──→ Phase 7
39
- │ (choice) │─── Execute ─→ Skill("workflow-execute")
40
- └───────────┘─── Review ──→ Display session status inline
41
- ```
42
-
43
- ## 2. Key Design Principles
44
-
45
- 1. **Pure Orchestrator**: SKILL.md routes and coordinates only; execution detail lives in phase files
46
- 2. **Progressive Phase Loading**: Read phase docs ONLY when that phase is about to execute
47
- 3. **Multi-Mode Routing**: Single skill handles plan/verify via mode detection
48
- 4. **Task Attachment Model**: Sub-command tasks are ATTACHED, executed sequentially, then COLLAPSED
49
- 5. **Auto-Continue**: After each phase completes, automatically execute next pending phase
50
- 6. **TDD Iron Law**: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST - enforced in task structure
51
-
52
- ## 3. Interactive Preference Collection
53
-
54
- Before dispatching to phase execution, collect workflow preferences via AskUserQuestion:
55
-
56
- ```javascript
57
- // ★ 统一 auto mode 检测:-y/--yes 从 $ARGUMENTS 或 ccw 传播
58
- const autoYes = /\b(-y|--yes)\b/.test($ARGUMENTS)
59
-
60
- if (autoYes) {
61
- // 自动模式:跳过所有询问,使用默认值
62
- workflowPreferences = { autoYes: true }
63
- } else {
64
- const prefResponse = AskUserQuestion({
65
- questions: [
66
- {
67
- question: "是否跳过所有确认步骤(自动模式)?",
68
- header: "Auto Mode",
69
- multiSelect: false,
70
- options: [
71
- { label: "Interactive (Recommended)", description: "交互模式,包含确认步骤" },
72
- { label: "Auto", description: "跳过所有确认,自动执行" }
73
- ]
74
- }
75
- ]
76
- })
77
-
78
- workflowPreferences = {
79
- autoYes: prefResponse.autoMode === 'Auto'
80
- }
81
- }
82
- ```
83
-
84
- **workflowPreferences** is passed to phase execution as context variable, referenced as `workflowPreferences.autoYes` within phases.
85
-
86
- ## 4. Mode Detection
87
-
88
- ```javascript
89
- const args = $ARGUMENTS
90
- const mode = detectMode(args)
91
-
92
- function detectMode(args) {
93
- // Skill trigger determines mode
94
- if (skillName === 'workflow-tdd-verify') return 'verify'
95
- return 'plan' // default: workflow-tdd-plan
96
- }
97
- ```
98
-
99
- ## 5. Compact Recovery (Phase Persistence)
100
-
101
- Multi-phase TDD planning (Phase 1-6/7) spans long conversations. Uses **双重保险**: TodoWrite 跟踪 active phase 保护其不被压缩,sentinel 作为兜底。
102
-
103
- > **⚠️ COMPACT DIRECTIVE**: Context compression MUST check TodoWrite phase status.
104
- > The phase currently marked `in_progress` is the active execution phase — preserve its FULL content.
105
- > Only compress phases marked `completed` or `pending`.
106
-
107
- ## 6. Execution Flow — Plan Mode (default)
108
-
109
- ```
110
- Input Parsing:
111
- └─ Convert user input to TDD structured format (GOAL/SCOPE/CONTEXT/TEST_FOCUS)
112
-
113
- Phase 1: Session Discovery
114
- └─ Read("phases/01-session-discovery.md")
115
- └─ Output: sessionId (WFS-xxx)
116
-
117
- Phase 2: Context Gathering
118
- └─ Read("phases/02-context-gathering.md")
119
- ├─ Tasks attached: Analyze structure → Identify integration → Generate package
120
- └─ Output: contextPath + conflictRisk
121
-
122
- Phase 3: Test Coverage Analysis
123
- └─ Read("phases/03-test-coverage-analysis.md")
124
- ├─ Tasks attached: Detect framework → Analyze coverage → Identify gaps
125
- └─ Output: testContextPath
126
-
127
- Phase 4: Conflict Resolution (conditional: conflictRisk ≥ medium)
128
- └─ Decision (conflictRisk check):
129
- ├─ conflictRisk ≥ medium → Read("phases/04-conflict-resolution.md")
130
- │ ├─ Tasks attached: Detect conflicts → Log analysis → Apply strategies
131
- │ └─ Output: conflict-resolution.json
132
- └─ conflictRisk < medium → Skip to Phase 5
133
-
134
- Phase 5: TDD Task Generation
135
- └─ Read("phases/05-tdd-task-generation.md")
136
- ├─ Tasks attached: Discovery → Planning → Output
137
- └─ Output: IMPL_PLAN.md, IMPL-*.json, TODO_LIST.md
138
-
139
- Phase 6: TDD Structure Validation
140
- └─ Read("phases/06-tdd-structure-validation.md")
141
- └─ Output: Validation report + Plan Confirmation Gate
142
-
143
- Plan Confirmation (User Decision Gate):
144
- └─ Decision (user choice):
145
- ├─ "Verify TDD Compliance" (Recommended) → Route to Phase 7 (tdd-verify)
146
- ├─ "Start Execution" → Skill(skill="workflow-execute")
147
- └─ "Review Status Only" → Display session status inline
148
- ```
149
-
150
- ## 7. Execution Flow — Verify Mode
151
-
152
- ```
153
- Phase 7: TDD Verification
154
- └─ Read("phases/07-tdd-verify.md")
155
- └─ Output: TDD_COMPLIANCE_REPORT.md with quality gate recommendation
156
- ```
157
-
158
- ## 8. Phase Reference Documents
159
-
160
- Read on-demand when phase executes using `Read("phases/...")`:
161
-
162
- | Phase | Document | Purpose | Mode | Compact |
163
- |-------|----------|---------|------|---------|
164
- | 1 | phases/01-session-discovery.md | Create or discover TDD workflow session | plan | TodoWrite 驱动 |
165
- | 2 | phases/02-context-gathering.md | Gather project context and analyze codebase | plan | TodoWrite 驱动 |
166
- | 3 | phases/03-test-coverage-analysis.md | Analyze test coverage and framework detection | plan | TodoWrite 驱动 |
167
- | 4 | phases/04-conflict-resolution.md | Detect and resolve conflicts (conditional) | plan | TodoWrite 驱动 |
168
- | 5 | phases/05-tdd-task-generation.md | Generate TDD tasks with Red-Green-Refactor cycles | plan | TodoWrite 驱动 + sentinel |
169
- | 6 | phases/06-tdd-structure-validation.md | Validate TDD structure and present confirmation gate | plan | TodoWrite 驱动 + sentinel |
170
- | 7 | phases/07-tdd-verify.md | Full TDD compliance verification with quality gate | verify | TodoWrite 驱动 |
171
-
172
- **Compact Rules**:
173
- 1. **TodoWrite `in_progress`** → 保留完整内容,禁止压缩
174
- 2. **TodoWrite `completed`** → 可压缩为摘要
175
- 3. **sentinel fallback** → Phase 5/6 包含 compact sentinel;若 compact 后仅存 sentinel 而无完整 Step 协议,必须立即 `Read()` 恢复对应 phase 文件
176
-
177
- ## 9. Core Rules
178
-
179
- 1. **Start Immediately**: First action is mode detection + TaskCreate initialization, second action is phase execution
180
- 2. **No Preliminary Analysis**: Do not read files, analyze structure, or gather context before Phase 1
181
- 3. **Parse Every Output**: Extract required data from each phase output for next phase
182
- 4. **Auto-Continue via TaskList**: Check TaskList status to execute next pending phase automatically
183
- 5. **Track Progress**: Update TaskCreate/TaskUpdate dynamically with task attachment/collapse pattern
184
- 6. **Task Attachment Model**: Skill execute **attaches** sub-tasks to current workflow. Orchestrator **executes** these attached tasks itself, then **collapses** them after completion
185
- 7. **Progressive Phase Loading**: Read phase docs ONLY when that phase is about to execute
186
- 8. **DO NOT STOP**: Continuous multi-phase workflow. After executing all attached tasks, immediately collapse them and execute next phase
187
- 9. **TDD Context**: All descriptions include "TDD:" prefix
188
-
189
- ## 10. TDD Compliance Requirements
190
-
191
- ### The Iron Law
192
-
193
- ```
194
- NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
195
- ```
196
-
197
- **Enforcement Method**:
198
- - Phase 5: `implementation` includes test-first steps (Red → Green → Refactor)
199
- - Green phase: Includes test-fix-cycle configuration (max 3 iterations)
200
- - Auto-revert: Triggered when max iterations reached without passing tests
201
-
202
- **Verification**: Phase 6 validates Red-Green-Refactor structure in all generated tasks
203
-
204
- ### TDD Compliance Checkpoint
205
-
206
- | Checkpoint | Validation Phase | Evidence Required |
207
- |------------|------------------|-------------------|
208
- | Test-first structure | Phase 5 | `implementation` has 3 steps |
209
- | Red phase exists | Phase 6 | Step 1: `tdd_phase: "red"` |
210
- | Green phase with test-fix | Phase 6 | Step 2: `tdd_phase: "green"` + test-fix-cycle |
211
- | Refactor phase exists | Phase 6 | Step 3: `tdd_phase: "refactor"` |
212
-
213
- ### Core TDD Principles
214
-
215
- **Red Flags - STOP and Reassess**:
216
- - Code written before test
217
- - Test passes immediately (no Red phase witnessed)
218
- - Cannot explain why test should fail
219
- - "Just this once" rationalization
220
- - "Tests after achieve same goals" thinking
221
-
222
- **Why Order Matters**:
223
- - Tests written after code pass immediately → proves nothing
224
- - Test-first forces edge case discovery before implementation
225
- - Tests-after verify what was built, not what's required
226
-
227
- ## 11. Input Processing
228
-
229
- **Convert User Input to TDD Structured Format**:
230
-
231
- 1. **Simple text** → Add TDD context:
232
- ```
233
- User: "Build authentication system"
234
-
235
- Structured:
236
- TDD: Authentication System
237
- GOAL: Build authentication system
238
- SCOPE: Core authentication features
239
- CONTEXT: New implementation
240
- TEST_FOCUS: Authentication scenarios
241
- ```
242
-
243
- 2. **Detailed text** → Extract components with TEST_FOCUS:
244
- ```
245
- User: "Add JWT authentication with email/password login and token refresh"
246
-
247
- Structured:
248
- TDD: JWT Authentication
249
- GOAL: Implement JWT-based authentication
250
- SCOPE: Email/password login, token generation, token refresh endpoints
251
- CONTEXT: JWT token-based security, refresh token rotation
252
- TEST_FOCUS: Login flow, token validation, refresh rotation, error cases
253
- ```
254
-
255
- 3. **File/Issue** → Read and structure with TDD
256
-
257
- ## 12. Data Flow — Plan Mode
258
-
259
- ```
260
- User Input (task description)
261
-
262
- [Convert to TDD Structured Format]
263
- ↓ Structured Description:
264
- ↓ TDD: [Feature Name]
265
- ↓ GOAL: [objective]
266
- ↓ SCOPE: [boundaries]
267
- ↓ CONTEXT: [background]
268
- ↓ TEST_FOCUS: [test scenarios]
269
-
270
- Phase 1: session:start --auto "TDD: structured-description"
271
- ↓ Output: sessionId
272
-
273
- Phase 2: context-gather --session sessionId "structured-description"
274
- ↓ Input: sessionId + structured description
275
- ↓ Output: contextPath (context-package.json) + conflictRisk
276
-
277
- Phase 3: test-context-gather --session sessionId
278
- ↓ Input: sessionId
279
- ↓ Output: testContextPath (test-context-package.json)
280
-
281
- Phase 4: conflict-resolution [conditional: conflictRisk ≥ medium]
282
- ↓ Input: sessionId + contextPath + conflictRisk
283
- ↓ Output: conflict-resolution.json
284
- ↓ Skip if conflictRisk is none/low → proceed directly to Phase 5
285
-
286
- Phase 5: task-generate-tdd --session sessionId
287
- ↓ Input: sessionId + all accumulated context
288
- ↓ Output: IMPL_PLAN.md, IMPL-*.json, TODO_LIST.md
289
-
290
- Phase 6: TDD Structure Validation (internal)
291
- ↓ Validate Red-Green-Refactor structure
292
- ↓ Present Plan Confirmation Gate
293
-
294
- Plan Confirmation (User Decision Gate):
295
- ├─ "Verify TDD Compliance" (Recommended) → Route to Phase 7
296
- ├─ "Start Execution" → Skill(skill="workflow-execute")
297
- └─ "Review Status Only" → Display session status inline
298
- ```
299
-
300
- ## 13. Data Flow — Verify Mode
301
-
302
- ```
303
- Input: --session sessionId (or auto-detect)
304
-
305
- Phase 7: Session discovery → Chain validation → Coverage analysis → Report
306
- ↓ Output: TDD_COMPLIANCE_REPORT.md with quality gate
307
- ```
308
-
309
- **Session Memory Flow**: Each phase receives session ID, which provides access to:
310
- - Previous task summaries
311
- - Existing context and analysis
312
- - Session-specific configuration
313
-
314
- ## 14. TodoWrite Pattern
315
-
316
- **Core Concept**: Dynamic task attachment and collapse for real-time visibility into TDD workflow execution.
317
-
318
- > **Implementation Note**: Phase files use `TodoWrite` syntax to describe the conceptual tracking pattern. At runtime, these are implemented via `TaskCreate/TaskUpdate/TaskList` tools. Map as follows:
319
- > - Initial list creation → `TaskCreate` for each item
320
- > - Status changes → `TaskUpdate({ taskId, status })`
321
- > - Sub-task attachment → `TaskCreate` + `TaskUpdate({ addBlockedBy })`
322
- > - Sub-task collapse → `TaskUpdate({ status: "completed" })` + `TaskUpdate({ status: "deleted" })` for collapsed sub-items
323
-
324
- ### Key Principles
325
-
326
- 1. **Task Attachment** (when phase executed):
327
- - Sub-tasks are **attached** to orchestrator's TodoWrite
328
- - **Phase 3, 4, 5**: Multiple sub-tasks attached
329
- - **Phase 1, 2, 6**: Single task (atomic)
330
- - First attached task marked as `in_progress`, others as `pending`
331
- - Orchestrator **executes** these attached tasks sequentially
332
-
333
- 2. **Task Collapse** (after sub-tasks complete):
334
- - **Applies to Phase 3, 4, 5**: Remove detailed sub-tasks from TodoWrite
335
- - **Collapse** to high-level phase summary
336
- - **Phase 1, 2, 6**: No collapse needed (single task, just mark completed)
337
- - Maintains clean orchestrator-level view
338
-
339
- 3. **Continuous Execution**: After completion, automatically proceed to next pending phase
340
-
341
- **Lifecycle**: Initial pending → Phase executed (tasks ATTACHED) → Sub-tasks executed sequentially → Phase completed (tasks COLLAPSED for 3/4/5, marked completed for 1/2/6) → Next phase → Repeat
342
-
343
- ### Initial State (Plan Mode):
344
- ```json
345
- [
346
- {"content": "Phase 1: Session Discovery", "status": "in_progress", "activeForm": "Executing session discovery"},
347
- {"content": "Phase 2: Context Gathering", "status": "pending", "activeForm": "Executing context gathering"},
348
- {"content": "Phase 3: Test Coverage Analysis", "status": "pending", "activeForm": "Executing test coverage analysis"},
349
- {"content": "Phase 5: TDD Task Generation", "status": "pending", "activeForm": "Executing TDD task generation"},
350
- {"content": "Phase 6: TDD Structure Validation", "status": "pending", "activeForm": "Validating TDD structure"}
351
- ]
352
- ```
353
-
354
- **Note**: Phase 4 (Conflict Resolution) is added dynamically after Phase 2 if conflictRisk ≥ medium.
355
-
356
- ### Phase 3 (Tasks Attached):
357
- ```json
358
- [
359
- {"content": "Phase 1: Session Discovery", "status": "completed"},
360
- {"content": "Phase 2: Context Gathering", "status": "completed"},
361
- {"content": "Phase 3: Test Coverage Analysis", "status": "in_progress"},
362
- {"content": " → Detect test framework and conventions", "status": "in_progress"},
363
- {"content": " → Analyze existing test coverage", "status": "pending"},
364
- {"content": " → Identify coverage gaps", "status": "pending"},
365
- {"content": "Phase 5: TDD Task Generation", "status": "pending"},
366
- {"content": "Phase 6: TDD Structure Validation", "status": "pending"}
367
- ]
368
- ```
369
-
370
- ### Phase 3 (Collapsed):
371
- ```json
372
- [
373
- {"content": "Phase 1: Session Discovery", "status": "completed"},
374
- {"content": "Phase 2: Context Gathering", "status": "completed"},
375
- {"content": "Phase 3: Test Coverage Analysis", "status": "completed"},
376
- {"content": "Phase 5: TDD Task Generation", "status": "pending"},
377
- {"content": "Phase 6: TDD Structure Validation", "status": "pending"}
378
- ]
379
- ```
380
-
381
- ### Phase 5 (Tasks Attached):
382
- ```json
383
- [
384
- {"content": "Phase 1: Session Discovery", "status": "completed"},
385
- {"content": "Phase 2: Context Gathering", "status": "completed"},
386
- {"content": "Phase 3: Test Coverage Analysis", "status": "completed"},
387
- {"content": "Phase 5: TDD Task Generation", "status": "in_progress"},
388
- {"content": " → Discovery - analyze TDD requirements", "status": "in_progress"},
389
- {"content": " → Planning - design Red-Green-Refactor cycles", "status": "pending"},
390
- {"content": " → Output - generate IMPL tasks with internal TDD phases", "status": "pending"},
391
- {"content": "Phase 6: TDD Structure Validation", "status": "pending"}
392
- ]
393
- ```
394
-
395
- **Note**: See individual Phase descriptions for detailed TodoWrite Update examples.
396
-
397
- ## 15. Post-Phase Updates
398
-
399
- ### Memory State Check
400
-
401
- After heavy phases (Phase 2-3), evaluate context window usage:
402
- - If memory usage is high (>110K tokens or approaching context limits):
403
- ```javascript
404
- Skill(skill="memory-capture")
405
- ```
406
- - Memory compaction is particularly important after analysis phases
407
-
408
- ### Planning Notes (Optional)
409
-
410
- Similar to workflow-plan, a `planning-notes.md` can accumulate context across phases if needed. See Phase 1 for initialization.
411
-
412
- ## 16. Error Handling
413
-
414
- - **Parsing Failure**: If output parsing fails, retry command once, then report error
415
- - **Validation Failure**: Report which file/data is missing or invalid
416
- - **Command Failure**: Keep phase `in_progress`, report error to user, do not proceed
417
- - **TDD Validation Failure**: Report incomplete chains or wrong dependencies
418
- - **Session Not Found** (verify mode): Report error with available sessions list
419
-
420
- ### Error Handling Quick Reference
421
-
422
- | Error Type | Detection | Recovery Action |
423
- |------------|-----------|-----------------|
424
- | Parsing failure | Empty/malformed output | Retry once, then report |
425
- | Missing context-package | File read error | Re-run Phase 2 (context-gathering) |
426
- | Invalid task JSON | jq parse error | Report malformed file path |
427
- | Task count exceeds 18 | Count validation ≥19 | Request re-scope, split into multiple sessions |
428
- | Missing cli_execution.id | All tasks lack ID | Regenerate tasks with phase 0 user config |
429
- | Test-context missing | File not found | Re-run Phase 3 (test-coverage-analysis) |
430
- | Phase timeout | No response | Retry phase, check CLI connectivity |
431
- | CLI tool not available | Tool not in cli-tools.json | Fall back to alternative preferred tool |
432
-
433
- ### TDD Warning Patterns
434
-
435
- | Pattern | Warning Message | Recommended Action |
436
- |---------|----------------|-------------------|
437
- | Task count >10 | High task count detected | Consider splitting into multiple sessions |
438
- | Missing test-fix-cycle | Green phase lacks auto-revert | Add `max_iterations: 3` to task config |
439
- | Red phase missing test path | Test file path not specified | Add explicit test file paths |
440
- | Generic task names | Vague names like "Add feature" | Use specific behavior descriptions |
441
- | No refactor criteria | Refactor phase lacks completion criteria | Define clear refactor scope |
442
-
443
- ### Non-Blocking Warning Policy
444
-
445
- **All warnings are advisory** - they do not halt execution:
446
- 1. Warnings logged to `.process/tdd-warnings.log`
447
- 2. Summary displayed in Phase 6 output
448
- 3. User decides whether to address before `workflow-execute` skill
449
-
450
- ## 17. Coordinator Checklist — Plan Mode
451
-
452
- - **Pre-Phase**: Convert user input to TDD structured format (TDD/GOAL/SCOPE/CONTEXT/TEST_FOCUS)
453
- - Initialize TaskCreate before any command (Phase 4 added dynamically after Phase 2)
454
- - Execute Phase 1 immediately with structured description
455
- - Parse session ID from Phase 1 output, store in memory
456
- - Pass session ID and structured description to Phase 2 command
457
- - Parse context path from Phase 2 output, store in memory
458
- - **Extract conflictRisk from context-package.json**: Determine Phase 4 execution
459
- - Execute Phase 3 (test coverage analysis) with sessionId
460
- - Parse testContextPath from Phase 3 output, store in memory
461
- - **If conflictRisk ≥ medium**: Launch Phase 4 conflict-resolution with sessionId and contextPath
462
- - Wait for Phase 4 to finish executing (if executed), verify conflict-resolution.json created
463
- - **If conflictRisk is none/low**: Skip Phase 4, proceed directly to Phase 5
464
- - Pass session ID to Phase 5 command (TDD task generation)
465
- - Verify all Phase 5 outputs (IMPL_PLAN.md, IMPL-*.json, TODO_LIST.md)
466
- - Execute Phase 6 (internal TDD structure validation)
467
- - **Plan Confirmation Gate**: Present user with choice (Verify → Phase 7 / Execute / Review Status)
468
- - **If user selects Verify**: Read("phases/07-tdd-verify.md"), execute Phase 7 in-process
469
- - **If user selects Execute**: Skill(skill="workflow-execute")
470
- - **If user selects Review**: Display session status inline
471
- - **Auto mode (workflowPreferences.autoYes)**: Auto-select "Verify TDD Compliance", then auto-continue to execute if APPROVED
472
- - Update TaskCreate/TaskUpdate after each phase
473
- - After each phase, automatically continue to next phase based on TaskList status
474
-
475
- ## 18. Coordinator Checklist — Verify Mode
476
-
477
- - Detect/validate session (from --session flag or auto-detect)
478
- - Initialize TaskCreate with verification tasks
479
- - Execute Phase 7 through all sub-phases (session validation → chain validation → coverage analysis → report generation)
480
- - Present quality gate result and next step options
481
-
482
- ## 19. Related Skills
483
-
484
- **Prerequisite Skills**:
485
- - None - TDD planning is self-contained (can optionally run brainstorm commands before)
486
-
487
- **Called by Plan Mode** (6 phases):
488
- - `/workflow:session:start` - Phase 1: Create or discover TDD workflow session
489
- - `phases/02-context-gathering.md` - Phase 2: Gather project context and analyze codebase (inline)
490
- - `phases/03-test-coverage-analysis.md` - Phase 3: Analyze existing test patterns and coverage (inline)
491
- - `phases/04-conflict-resolution.md` - Phase 4: Detect and resolve conflicts (inline, conditional)
492
- - `memory-capture` skill - Phase 4: Memory optimization (if context approaching limits)
493
- - `phases/05-tdd-task-generation.md` - Phase 5: Generate TDD tasks with Red-Green-Refactor cycles (inline)
494
-
495
- **Called by Verify Mode**:
496
- - `phases/07-tdd-verify.md` - Phase 7: Test coverage and cycle analysis (inline)
497
-
498
- **Follow-up Skills**:
499
- - `workflow-tdd-plan` skill (tdd-verify phase) - Verify TDD compliance (can also invoke via verify mode)
500
- - `workflow-plan` skill (plan-verify phase) - Verify plan quality and dependencies
501
- - Display session status inline - Review TDD task breakdown
502
- - `Skill(skill="workflow-execute")` - Begin TDD implementation
503
-
504
- </process>
505
-
506
- <auto_mode>
507
- When `workflowPreferences.autoYes` is true (triggered by `-y`/`--yes` flag):
508
- - Skip all interactive confirmation prompts
509
- - Use default values for all preference questions
510
- - At Plan Confirmation Gate: Auto-select "Verify TDD Compliance"
511
- - After verification: Auto-continue to execute if quality gate returns APPROVED
512
- - All phases execute continuously without user intervention
513
- </auto_mode>
514
-
515
- <success_criteria>
516
- - [ ] Mode correctly detected from skill trigger name (plan vs verify)
517
- - [ ] All 6 plan phases execute sequentially with proper data flow between them
518
- - [ ] Phase files loaded progressively via Read() only when phase is about to execute
519
- - [ ] TaskCreate/TaskUpdate tracks all phases with attachment/collapse pattern
520
- - [ ] TDD Iron Law enforced: every task has Red-Green-Refactor structure
521
- - [ ] Phase 4 (Conflict Resolution) conditionally executes based on conflictRisk level
522
- - [ ] Plan Confirmation Gate presents three choices after Phase 6
523
- - [ ] Verify mode (Phase 7) produces TDD_COMPLIANCE_REPORT.md with quality gate
524
- - [ ] All outputs generated: IMPL_PLAN.md, IMPL-*.json, TODO_LIST.md
525
- - [ ] Compact recovery preserves active phase content via TodoWrite status
526
- - [ ] Error handling retries once on parsing failure, reports on persistent errors
527
- </success_criteria>
@@ -1,57 +0,0 @@
1
- # Phase 1: Session Discovery
2
-
3
- Create or discover TDD workflow session and extract session ID.
4
-
5
- ## Objective
6
-
7
- - Create a new TDD workflow session via `/workflow:session:start`
8
- - Extract session ID for subsequent phases
9
-
10
- ## Execution
11
-
12
- ### Step 1.1: Execute Session Start
13
-
14
- ```javascript
15
- Skill(skill="workflow:session:start", args="--type tdd --auto \"TDD: [structured-description]\"")
16
- ```
17
-
18
- **TDD Structured Format**:
19
- ```
20
- TDD: [Feature Name]
21
- GOAL: [Objective]
22
- SCOPE: [Included/excluded]
23
- CONTEXT: [Background]
24
- TEST_FOCUS: [Test scenarios]
25
- ```
26
-
27
- **Example**:
28
- ```
29
- TDD: JWT Authentication
30
- GOAL: Implement JWT-based authentication
31
- SCOPE: Email/password login, token generation, token refresh endpoints
32
- CONTEXT: Existing user database schema, REST API
33
- TEST_FOCUS: Login flow, token validation, refresh rotation, error cases
34
- ```
35
-
36
- ### Step 1.2: Parse Output
37
-
38
- - Extract: `SESSION_ID: WFS-[id]` (store as `sessionId`)
39
-
40
- **Validation**:
41
- - Session ID successfully extracted
42
- - Session directory `.workflow/active/[sessionId]/` exists
43
-
44
- **Note**: Session directory contains `workflow-session.json` (metadata). Do NOT look for `manifest.json` here - it only exists in `.workflow/archives/` for archived sessions.
45
-
46
- **TodoWrite**: Mark phase 1 completed, phase 2 in_progress
47
-
48
- **After Phase 1**: Return to user showing Phase 1 results, then auto-continue to Phase 2
49
-
50
- ## Output
51
-
52
- - **Variable**: `sessionId` (WFS-xxx)
53
- - **TodoWrite**: Mark Phase 1 completed, Phase 2 in_progress
54
-
55
- ## Next Phase
56
-
57
- Return to orchestrator, then auto-continue to [Phase 2: Context Gathering](02-context-gathering.md).