cc-devflow 2.4.6 → 4.1.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 (191) hide show
  1. package/.claude/CLAUDE.md +1065 -48
  2. package/.claude/agents/dev-implementer.md +195 -0
  3. package/.claude/commands/{flow-archive.md → flow/archive.md} +46 -11
  4. package/.claude/commands/flow/context.md +150 -0
  5. package/.claude/commands/flow/delta.md +245 -0
  6. package/.claude/commands/{flow-dev.md → flow/dev.md} +112 -11
  7. package/.claude/commands/flow/init.md +45 -0
  8. package/.claude/commands/flow/quality.md +159 -0
  9. package/.claude/commands/flow/spec.md +186 -0
  10. package/.claude/commands/flow/workspace.md +146 -0
  11. package/.claude/commands/{cancel-ralph.md → util/cancel-ralph.md} +1 -0
  12. package/.claude/config/quality-gates.yml +305 -0
  13. package/.claude/docs/guides/TEAM_MODE_GUIDE.md +313 -0
  14. package/.claude/docs/templates/DELTA_SPEC_TEMPLATE.md +91 -0
  15. package/.claude/docs/templates/DESIGN_DECISIONS_TEMPLATE.md +151 -0
  16. package/.claude/docs/templates/JOURNAL_TEMPLATE.md +75 -0
  17. package/.claude/docs/templates/_shared/CLAUDE.md +36 -0
  18. package/.claude/docs/templates/_shared/CONSTITUTION_CHECK.md +125 -0
  19. package/.claude/docs/templates/_shared/VALIDATION_CHECKLIST.md +187 -0
  20. package/.claude/docs/templates/_shared/YAML_FRONTMATTER.md +164 -0
  21. package/.claude/docs/templates/context/dev.jsonl.template +6 -0
  22. package/.claude/docs/templates/context/epic.jsonl.template +5 -0
  23. package/.claude/docs/templates/context/prd.jsonl.template +4 -0
  24. package/.claude/docs/templates/context/research.jsonl.template +4 -0
  25. package/.claude/docs/templates/context/review.jsonl.template +5 -0
  26. package/.claude/docs/templates/context/tech.jsonl.template +5 -0
  27. package/.claude/hooks/CLAUDE.md +342 -0
  28. package/.claude/hooks/inject-agent-context.ts +480 -0
  29. package/.claude/hooks/inject-skill-context.ts +359 -0
  30. package/.claude/hooks/ralph-loop.ts +931 -0
  31. package/.claude/hooks/task-completed-hook.ts +593 -0
  32. package/.claude/hooks/teammate-idle-hook.ts +690 -0
  33. package/.claude/hooks/types/team-types.d.ts +238 -0
  34. package/.claude/rules/devflow-conventions.md +82 -9
  35. package/.claude/scripts/archive-requirement.sh +44 -1
  36. package/.claude/scripts/common.sh +670 -3
  37. package/.claude/scripts/delta-parser.ts +527 -0
  38. package/.claude/scripts/detect-file-conflicts.sh +151 -0
  39. package/.claude/scripts/flow-context-add.sh +134 -0
  40. package/.claude/scripts/flow-context-init.sh +133 -0
  41. package/.claude/scripts/flow-context-validate.sh +144 -0
  42. package/.claude/scripts/flow-delta-apply.sh +297 -0
  43. package/.claude/scripts/flow-delta-archive.sh +71 -0
  44. package/.claude/scripts/flow-delta-create.sh +202 -0
  45. package/.claude/scripts/flow-delta-list.sh +142 -0
  46. package/.claude/scripts/flow-delta-status.sh +235 -0
  47. package/.claude/scripts/flow-quality-full.sh +184 -0
  48. package/.claude/scripts/flow-quality-quick.sh +64 -0
  49. package/.claude/scripts/flow-workspace-init.sh +117 -0
  50. package/.claude/scripts/flow-workspace-record.sh +164 -0
  51. package/.claude/scripts/flow-workspace-start.sh +88 -0
  52. package/.claude/scripts/get-workflow-status.sh +415 -0
  53. package/.claude/scripts/parse-task-dependencies.js +334 -0
  54. package/.claude/scripts/record-quality-error.sh +165 -0
  55. package/.claude/scripts/run-quality-gates.sh +242 -0
  56. package/.claude/scripts/team-dev-init.sh +319 -0
  57. package/.claude/scripts/team-state-recovery.sh +229 -0
  58. package/.claude/scripts/workflow-status.ts +433 -0
  59. package/.claude/settings.json +19 -0
  60. package/.claude/skills/cc-devflow-orchestrator/SKILL.md +85 -200
  61. package/.claude/skills/domain/using-git-worktrees/SKILL.md +252 -0
  62. package/.claude/skills/domain/using-git-worktrees/assets/SHELL_ALIASES.md +133 -0
  63. package/.claude/skills/domain/using-git-worktrees/context.jsonl +4 -0
  64. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-cleanup.sh +218 -0
  65. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-create.sh +232 -0
  66. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-list.sh +130 -0
  67. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-status.sh +140 -0
  68. package/.claude/skills/domain/using-git-worktrees/scripts/worktree-switch.sh +70 -0
  69. package/.claude/skills/skill-rules.json +72 -1
  70. package/.claude/skills/utility/journey-checker/SKILL.md +199 -0
  71. package/.claude/skills/utility/journey-checker/pressure-scenarios.md +164 -0
  72. package/.claude/skills/utility/skill-creator/LICENSE.txt +202 -0
  73. package/.claude/skills/utility/skill-creator/SKILL.md +356 -0
  74. package/.claude/skills/utility/skill-creator/references/output-patterns.md +82 -0
  75. package/.claude/skills/utility/skill-creator/references/workflows.md +28 -0
  76. package/.claude/skills/utility/skill-creator/scripts/init_skill.py +303 -0
  77. package/.claude/skills/utility/skill-creator/scripts/package_skill.py +110 -0
  78. package/.claude/skills/utility/skill-creator/scripts/quick_validate.py +95 -0
  79. package/.claude/skills/workflow/flow-dev/CLAUDE.md +78 -0
  80. package/.claude/skills/workflow/flow-dev/SKILL.md +96 -0
  81. package/.claude/skills/workflow/flow-dev/assets/IMPLEMENTATION_PLAN_TEMPLATE.md +71 -0
  82. package/.claude/skills/workflow/flow-dev/context.jsonl +8 -0
  83. package/.claude/skills/workflow/flow-dev/dev-implementer.jsonl +8 -0
  84. package/.claude/skills/workflow/flow-dev/scripts/entry-gate.sh +116 -0
  85. package/.claude/skills/workflow/flow-dev/scripts/exit-gate.sh +101 -0
  86. package/.claude/skills/workflow/flow-dev/scripts/task-orchestrator.sh +106 -0
  87. package/.claude/skills/workflow/flow-fix/SKILL.md +105 -0
  88. package/.claude/skills/workflow/flow-fix/context.jsonl +6 -0
  89. package/.claude/skills/workflow/flow-fix/references/bug-analyzer.md +381 -0
  90. package/.claude/skills/workflow/flow-init/SKILL.md +211 -0
  91. package/.claude/skills/workflow/flow-init/assets/BRAINSTORM_TEMPLATE.md +148 -0
  92. package/.claude/skills/workflow/flow-init/assets/INIT_FLOW_TEMPLATE.md +198 -0
  93. package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +276 -0
  94. package/.claude/skills/workflow/flow-init/context.jsonl +5 -0
  95. package/.claude/skills/workflow/flow-init/references/flow-researcher.md +132 -0
  96. package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +232 -0
  97. package/.claude/skills/workflow/flow-init/scripts/consolidate-research.sh +182 -0
  98. package/.claude/skills/workflow/flow-init/scripts/create-requirement.sh +515 -0
  99. package/.claude/skills/workflow/flow-init/scripts/generate-research-tasks.sh +157 -0
  100. package/.claude/skills/workflow/flow-init/scripts/populate-research-tasks.sh +284 -0
  101. package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +332 -0
  102. package/.claude/skills/workflow/flow-quality/SKILL.md +94 -0
  103. package/.claude/skills/workflow/flow-quality/context.jsonl +6 -0
  104. package/.claude/skills/workflow/flow-quality/references/code-quality-reviewer.md +205 -0
  105. package/.claude/skills/workflow/flow-quality/references/qa-tester.md +313 -0
  106. package/.claude/skills/workflow/flow-quality/references/security-reviewer.md +314 -0
  107. package/.claude/skills/workflow/flow-quality/references/spec-reviewer.md +221 -0
  108. package/.claude/skills/workflow/flow-release/SKILL.md +126 -0
  109. package/.claude/skills/workflow/flow-release/context.jsonl +7 -0
  110. package/.claude/skills/workflow/flow-release/references/release-manager.md +295 -0
  111. package/.claude/skills/workflow/flow-spec/CLAUDE.md +103 -0
  112. package/.claude/skills/workflow/flow-spec/SKILL.md +545 -0
  113. package/.claude/skills/workflow/flow-spec/context.jsonl +7 -0
  114. package/.claude/skills/workflow/flow-spec/scripts/entry-gate.sh +194 -0
  115. package/.claude/skills/workflow/flow-spec/scripts/exit-gate.sh +244 -0
  116. package/.claude/skills/workflow/flow-spec/scripts/parallel-orchestrator.sh +205 -0
  117. package/.claude/skills/workflow/flow-spec/scripts/team-communication.sh +353 -0
  118. package/.claude/skills/workflow/flow-spec/scripts/team-init.sh +195 -0
  119. package/.claude/skills/workflow/flow-spec/scripts/test-team-mode.sh +496 -0
  120. package/.claude/skills/workflow/flow-spec/team-config.json +165 -0
  121. package/.claude/skills/workflow.yaml +417 -0
  122. package/CHANGELOG.md +254 -0
  123. package/README.md +193 -33
  124. package/README.zh-CN.md +206 -46
  125. package/lib/compiler/CLAUDE.md +77 -46
  126. package/lib/compiler/__tests__/multi-module-emitters.test.js +508 -0
  127. package/lib/compiler/context-expander.js +179 -0
  128. package/lib/compiler/emitters/antigravity-emitter.js +195 -5
  129. package/lib/compiler/emitters/base-emitter.js +217 -2
  130. package/lib/compiler/emitters/codex-emitter.js +200 -4
  131. package/lib/compiler/emitters/cursor-emitter.js +307 -3
  132. package/lib/compiler/emitters/qwen-emitter.js +196 -4
  133. package/lib/compiler/index.js +197 -2
  134. package/lib/compiler/platforms.js +270 -21
  135. package/package.json +1 -1
  136. package/.claude/commands/flow-epic.md +0 -183
  137. package/.claude/commands/flow-init.md +0 -370
  138. package/.claude/commands/flow-prd.md +0 -144
  139. package/.claude/commands/flow-qa.md +0 -93
  140. package/.claude/commands/flow-review.md +0 -257
  141. package/.claude/commands/flow-tech.md +0 -142
  142. package/.claude/commands/flow-ui.md +0 -189
  143. package/.claude/skills/file-header-guardian/SKILL.md +0 -56
  144. package/.claude/skills/skill-developer/ADVANCED.md +0 -197
  145. package/.claude/skills/skill-developer/HOOK_MECHANISMS.md +0 -306
  146. package/.claude/skills/skill-developer/PATTERNS_LIBRARY.md +0 -152
  147. package/.claude/skills/skill-developer/SKILL.md +0 -426
  148. package/.claude/skills/skill-developer/SKILL_RULES_REFERENCE.md +0 -315
  149. package/.claude/skills/skill-developer/TRIGGER_TYPES.md +0 -305
  150. package/.claude/skills/skill-developer/TROUBLESHOOTING.md +0 -514
  151. package/.claude/skills/writing-skills/SKILL.md +0 -655
  152. package/.claude/skills/writing-skills/anthropic-best-practices.md +0 -1150
  153. package/.claude/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
  154. package/.claude/skills/writing-skills/graphviz-conventions.dot +0 -172
  155. package/.claude/skills/writing-skills/persuasion-principles.md +0 -187
  156. package/.claude/skills/writing-skills/render-graphs.js +0 -168
  157. package/.claude/skills/writing-skills/testing-skills-with-subagents.md +0 -384
  158. package/.claude/tsc-cache/795ba6e3-b98a-423b-bab2-51aa62812569/affected-repos.txt +0 -1
  159. package/.claude/tsc-cache/ae335694-be5a-4ba4-a1a0-b676c09a7906/affected-repos.txt +0 -1
  160. /package/.claude/commands/{core-architecture.md → core/architecture.md} +0 -0
  161. /package/.claude/commands/{core-guidelines.md → core/guidelines.md} +0 -0
  162. /package/.claude/commands/{core-roadmap.md → core/roadmap.md} +0 -0
  163. /package/.claude/commands/{core-style.md → core/style.md} +0 -0
  164. /package/.claude/commands/{flow-checklist.md → flow/checklist.md} +0 -0
  165. /package/.claude/commands/{flow-clarify.md → flow/clarify.md} +0 -0
  166. /package/.claude/commands/{flow-constitution.md → flow/constitution.md} +0 -0
  167. /package/.claude/commands/{flow-fix.md → flow/fix.md} +0 -0
  168. /package/.claude/commands/{flow-ideate.md → flow/ideate.md} +0 -0
  169. /package/.claude/commands/{flow-new.md → flow/new.md} +0 -0
  170. /package/.claude/commands/{flow-release.md → flow/release.md} +0 -0
  171. /package/.claude/commands/{flow-restart.md → flow/restart.md} +0 -0
  172. /package/.claude/commands/{flow-status.md → flow/status.md} +0 -0
  173. /package/.claude/commands/{flow-update.md → flow/update.md} +0 -0
  174. /package/.claude/commands/{flow-upgrade.md → flow/upgrade.md} +0 -0
  175. /package/.claude/commands/{flow-verify.md → flow/verify.md} +0 -0
  176. /package/.claude/commands/{code-review-high.md → util/code-review.md} +0 -0
  177. /package/.claude/commands/{git-commit.md → util/git-commit.md} +0 -0
  178. /package/.claude/commands/{problem-analyzer.md → util/problem-analyzer.md} +0 -0
  179. /package/.claude/skills/{flow-attention-refresh → domain/attention-refresh}/SKILL.md +0 -0
  180. /package/.claude/skills/{flow-brainstorming → domain/brainstorming}/SKILL.md +0 -0
  181. /package/.claude/skills/{flow-debugging → domain/debugging}/SKILL.md +0 -0
  182. /package/.claude/skills/{flow-finishing-branch → domain/finishing-branch}/SKILL.md +0 -0
  183. /package/.claude/skills/{flow-receiving-review → domain/receiving-review}/SKILL.md +0 -0
  184. /package/.claude/skills/{flow-tdd → domain/tdd}/SKILL.md +0 -0
  185. /package/.claude/skills/{verification-before-completion → domain/verification}/SKILL.md +0 -0
  186. /package/.claude/skills/{constitution-guardian → guardrail/constitution-guardian}/SKILL.md +0 -0
  187. /package/.claude/skills/{devflow-tdd-enforcer → guardrail/tdd-enforcer}/SKILL.md +0 -0
  188. /package/.claude/skills/{devflow-constitution-quick-ref → utility/constitution-quick-ref}/SKILL.md +0 -0
  189. /package/.claude/skills/{devflow-file-standards → utility/file-standards}/SKILL.md +0 -0
  190. /package/.claude/skills/{fractal-docs-generator → utility/fractal-docs}/SKILL.md +0 -0
  191. /package/.claude/skills/{npm-release → utility/npm-release}/SKILL.md +0 -0
package/README.md CHANGED
@@ -31,6 +31,9 @@ Complete automated workflow from PRD generation to code delivery with `/flow-new
31
31
  - 📜 **Constitution** - 10 Articles governing quality, security, and architecture
32
32
  - 🔄 **Autonomous Development** - Ralph × Manus Integration for memory-enhanced continuous iteration
33
33
  - 🔌 **Multi-Platform Support** - Compile workflows for Codex, Cursor, Qwen, Antigravity via `npm run adapt`
34
+ - 🔄 **Multi-Module Compiler** - Full module compilation: skills, commands, agents, rules, hooks
35
+ - 🌿 **Git Worktree Integration** - Parallel development with isolated worktrees for 3-5 concurrent Claude sessions
36
+ - 🤝 **Claude Team Integration** - Multi-agent parallel collaboration with automatic task scheduling and conflict detection
34
37
 
35
38
  ---
36
39
 
@@ -73,28 +76,37 @@ export SKIP_TDD_ENFORCER=1
73
76
  📚 [Complete Hooks Documentation](docs/guides/hooks-system.md)
74
77
  </details>
75
78
 
76
- ### Skills System
79
+ ### Skills System (v4.0 Skills-First Architecture)
77
80
 
78
- Intelligent knowledge base activation, auto-recommending relevant domain knowledge.
81
+ Intelligent knowledge base activation with grouped Skills and automatic context injection.
79
82
 
80
83
  <details>
81
84
  <summary>📖 Skills Details (Click to Expand)</summary>
82
85
 
83
- **Available Skills**:
86
+ **Skills-First Architecture** (v4.0):
84
87
 
85
- | Skill | Type | Trigger Scenarios |
86
- |-------|------|-------------------|
87
- | `cc-devflow-orchestrator` | domain | Requirement management, process guidance |
88
- | `devflow-tdd-enforcer` | guardrail | Editing TASKS.md |
89
- | `constitution-guardian` | guardrail | Editing PRD/EPIC/TASKS |
90
- | `devflow-file-standards` | domain | File naming, directory structure |
91
- | `skill-developer` | domain | Skill development, Hook system |
88
+ ```
89
+ .claude/skills/
90
+ ├── workflow.yaml # Skill dependency graph (OpenSpec-inspired)
91
+ ├── workflow/ # 9 Workflow Skills (flow-init, flow-spec, flow-dev, etc.)
92
+ ├── domain/ # 7 Domain Skills (tdd, debugging, brainstorming)
93
+ ├── guardrail/ # 3 Guardrail Skills (constitution-guardian, tdd-enforcer)
94
+ └── utility/ # 8 Utility Skills (npm-release, skill-creator)
95
+ ```
96
+
97
+ **Key Skills by Category**:
92
98
 
93
- **Trigger Mechanisms**:
94
- 1. **Keyword Trigger** - Input contains specific keywords
95
- 2. **Intent Matching** - Regex matching user intent
96
- 3. **File Trigger** - Editing specific path files
97
- 4. **Content Matching** - File content matches specific patterns
99
+ | Category | Skills | Purpose |
100
+ |----------|--------|---------|
101
+ | **Workflow** | flow-init, flow-spec, flow-dev, flow-quality, flow-release | Core development workflow |
102
+ | **Domain** | tdd, debugging, brainstorming, verification | Domain expertise |
103
+ | **Guardrail** | constitution-guardian, tdd-enforcer | Real-time compliance |
104
+ | **Utility** | npm-release, skill-creator, writing-skills | Development tools |
105
+
106
+ **Context Injection** (Trellis-inspired):
107
+ - Each Skill has `context.jsonl` defining required context files
108
+ - `inject-skill-context.ts` hook auto-loads context before Skill execution
109
+ - Variable substitution: `{REQ}` → actual requirement ID
98
110
 
99
111
  📚 [Complete Skills Documentation](docs/guides/skills-system.md)
100
112
  </details>
@@ -251,6 +263,7 @@ bash .claude/tests/constitution/run_all_constitution_tests.sh
251
263
  | `/flow-new` | 🎯 Start New Requirement | `/flow-new "REQ-123\|Feature"` | [→](docs/commands/flow-new.md) |
252
264
  | `/flow-init` | 📦 Initialize Requirement | `/flow-init "REQ-123\|Feature"` | [→](docs/commands/flow-init.md) |
253
265
  | `/flow-clarify` | 🔎 Clarify Ambiguities | `/flow-clarify "REQ-123"` | [→](.claude/commands/flow-clarify.md) |
266
+ | `/flow-spec` | 📋 Unified Specification (v4.1) | `/flow-spec "REQ-123"` | [→](.claude/commands/flow-spec.md) |
254
267
  | `/flow-checklist` | ✅ Requirement Quality Check | `/flow-checklist --type ux` | [→](.claude/commands/flow-checklist.md) |
255
268
  | `/flow-review` | �� Two-Stage Code Review | `/flow-review "REQ-123"` | [→](.claude/commands/flow-review.md) |
256
269
  | `/flow-fix` | 🐛 Systematic Bug Fix | `/flow-fix "BUG-123\|Description"` | [→](.claude/commands/flow-fix.md) |
@@ -304,17 +317,10 @@ graph TB
304
317
  ReqLevel([Requirement-Level Development]) --> FlowInit["/flow-init<br/>research.md & BRAINSTORM.md"]
305
318
 
306
319
  FlowInit --> FlowClarify["/flow-clarify<br/>clarifications/*.md<br/>Optional"]
307
- FlowClarify --> FlowPRD["/flow-prd<br/>PRD.md<br/>BRAINSTORM alignment"]
308
- FlowInit -.->|Skip clarify| FlowPRD
309
- FlowPRD --> FlowChecklist["/flow-checklist<br/>checklists/*.md<br/>80% Gate"]
310
- FlowPRD --> FlowTech["/flow-tech<br/>TECH_DESIGN.md & data-model"]
311
- FlowPRD --> FlowUI["/flow-ui<br/>UI_PROTOTYPE.html<br/>Optional"]
312
-
313
- FlowChecklist --> FlowEpic
314
- FlowTech --> FlowEpic["/flow-epic<br/>EPIC.md & TASKS.md<br/>bite-sized tasks"]
315
- FlowUI --> FlowEpic
320
+ FlowClarify --> FlowSpec["/flow-spec (v4.1)<br/>PRD → Tech+UI (parallel) → Epic<br/>Unified specification phase"]
321
+ FlowInit -.->|Skip clarify| FlowSpec
316
322
 
317
- FlowEpic --> FlowDev["/flow-dev<br/>TASKS.md execution<br/>TDD Checkpoint"]
323
+ FlowSpec --> FlowDev["/flow-dev<br/>TASKS.md execution<br/>TDD Checkpoint"]
318
324
 
319
325
  FlowDev --> FlowReview["/flow-review<br/>Two-Stage Review<br/>Spec → Quality"]
320
326
 
@@ -332,11 +338,7 @@ graph TB
332
338
  style ReqLevel fill:#fff4e1
333
339
  style FlowInit fill:#e8f5e9
334
340
  style FlowClarify fill:#fff9c4
335
- style FlowPRD fill:#e8f5e9
336
- style FlowChecklist fill:#ffe0b2
337
- style FlowTech fill:#e8f5e9
338
- style FlowUI fill:#fff9c4
339
- style FlowEpic fill:#e8f5e9
341
+ style FlowSpec fill:#e8f5e9
340
342
  style FlowDev fill:#f3e5f5
341
343
  style FlowReview fill:#e1bee7
342
344
  style FlowQA fill:#fce4ec
@@ -347,10 +349,10 @@ graph TB
347
349
  **Workflow Notes**:
348
350
  - **Project-Level Commands** (light blue): Execute once at project initialization, establish global standards (SSOT)
349
351
  - **Requirement-Level Commands** (light orange): Execute once per requirement (REQ-XXX)
352
+ - **Unified /flow-spec** (v4.1): Replaces flow-prd/flow-tech/flow-ui/flow-epic with parallel execution
350
353
  - **Brainstorming** (v2.3.0): `/flow-init` now generates `BRAINSTORM.md` as requirement "North Star"
351
354
  - **Two-Stage Review** (v2.3.0): `/flow-review` validates Spec Compliance before Code Quality
352
- - **Optional Steps** (yellow): `/flow-clarify` and `/flow-ui` are optional; clarify can be skipped if requirements are clear
353
- - **Quality Gate** (orange): `/flow-checklist` validates requirement quality with 80% completion threshold before `/flow-epic`
355
+ - **Optional Steps** (yellow): `/flow-clarify` is optional; skip if requirements are clear
354
356
  - **TDD Checkpoint** (v2.3.0): `/flow-dev` includes mandatory TDD checkpoint (tests must FAIL first)
355
357
  - **Quality Gates**: Each stage has entry/exit gates ensuring document quality and Constitution compliance
356
358
  - **Consistency Check**: `/flow-verify` can be called at any stage to ensure document consistency
@@ -496,7 +498,165 @@ bash .claude/tests/run-all-tests.sh --scripts
496
498
 
497
499
  ## 📝 Version History
498
500
 
499
- ### v2.3.0 (2026-01-08) - Latest Release
501
+ ### v4.7.0 (2026-02-07) - Latest Release
502
+
503
+ **🤝 Claude Team Integration: Multi-Agent Parallel Collaboration**
504
+
505
+ v4.7.0 introduces Claude Team integration for multi-agent parallel development:
506
+
507
+ - **Team Mode for /flow-dev** - Parallel task execution with multiple agents
508
+ - `--team` flag enables Team mode (default 3 agents)
509
+ - `--agents N` specifies agent count (2-5)
510
+ - Automatic task dependency analysis and conflict detection
511
+ - File conflict tasks assigned to same agent for sequential execution
512
+
513
+ - **New Hooks** - Team lifecycle management
514
+ - `TeammateIdle Hook` - Task assignment and scheduling
515
+ - `TaskCompleted Hook` - Quality verification on completion
516
+ - Timeout detection and alerting
517
+
518
+ - **Task Dependency Parser** - Intelligent task analysis
519
+ - `parse-task-dependencies.js` - Parses TASKS.md format
520
+ - Recognizes `[P]` parallel markers, `[US*]` user story groups
521
+ - Phase-based dependency resolution
522
+
523
+ - **State Recovery** - Checkpoint and resume
524
+ - `team-state-recovery.sh` - Snapshot and restore Team state
525
+ - Support for interrupted session recovery
526
+
527
+ - **New Files**
528
+ - `.claude/scripts/parse-task-dependencies.js` - Task parser
529
+ - `.claude/scripts/detect-file-conflicts.sh` - Conflict detection
530
+ - `.claude/scripts/team-dev-init.sh` - Dev team initialization
531
+ - `.claude/scripts/team-state-recovery.sh` - State recovery
532
+ - `.claude/docs/guides/TEAM_MODE_GUIDE.md` - Complete usage guide
533
+
534
+ **📊 v4.7 Improvements**:
535
+ | Metric | Before | After | Improvement |
536
+ |--------|--------|-------|-------------|
537
+ | Parallel agents | 1 | 3-5 | +400% |
538
+ | Requirement completion time | 90 min | 50 min | -45% |
539
+ | Task scheduling | Manual | Automatic | 100% |
540
+ | Quality verification | Single-point | Distributed | 100% |
541
+
542
+ ### v4.3.0 (2026-02-07)
543
+
544
+ **🌿 Git Worktree Integration: Parallel Development Support**
545
+
546
+ v4.3.0 introduces Git Worktree integration for parallel development with isolated Claude Code sessions:
547
+
548
+ - **Git Worktree Mode (Default)** - Isolated development environments
549
+ - Creates `../repo-name-REQ-xxx/` worktree directories
550
+ - Each worktree has independent Claude Code session
551
+ - Switch between requirements with `cd` instead of `git checkout`
552
+ - `--branch-only` flag for traditional branch mode
553
+
554
+ - **New Skill: using-git-worktrees** - Complete worktree management
555
+ - `worktree-create.sh` - Create new worktree
556
+ - `worktree-list.sh` - List all worktrees
557
+ - `worktree-switch.sh` - Switch to worktree
558
+ - `worktree-cleanup.sh` - Clean up merged worktrees
559
+ - Shell aliases template (za/zl/zm/zw)
560
+
561
+ - **Modified Commands**
562
+ - `/flow-init` - Default worktree mode, `--branch-only` for compatibility
563
+ - `/flow-release` - Automatic worktree cleanup
564
+
565
+ **📊 v4.3 Improvements**:
566
+ | Metric | Before | After | Improvement |
567
+ |--------|--------|-------|-------------|
568
+ | Parallel requirements | 1 | 3-5 | +400% |
569
+ | Context switch time | 30s | 1s | -97% |
570
+ | Session isolation | None | Full | 100% |
571
+
572
+ ### v4.1.0 (2026-02-07)
573
+
574
+ **🎯 Unified Specification Phase: /flow-spec Command**
575
+
576
+ v4.1.0 merges flow-prd/flow-tech/flow-ui/flow-epic into a single `/flow-spec` command with parallel execution:
577
+
578
+ - **Unified /flow-spec Command** - One command for entire specification phase
579
+ - Full Mode: PRD → Tech + UI (parallel) → Epic/Tasks
580
+ - Quick Mode: `--skip-tech --skip-ui` for small requirements
581
+ - Backend Only: `--skip-ui`
582
+ - Frontend Only: `--skip-tech`
583
+
584
+ - **Parallel Agent Execution** - Tech + UI agents run concurrently
585
+ - ~35% time reduction in design phase
586
+ - Shared template components in `_shared/` directory
587
+
588
+ - **Simplified Workflows** (v4.1)
589
+ ```
590
+ Quick (3 steps): /flow-init --quick → /flow-spec --skip-tech --skip-ui → /flow-dev → /flow-release
591
+ Standard (4 steps): /flow-init → /flow-spec → /flow-dev → /flow-quality → /flow-release
592
+ Full (5 steps): /flow-init → /flow-clarify → /flow-spec → /flow-dev → /flow-quality --full → /flow-release
593
+ ```
594
+
595
+ - **Deprecations**: `/flow-prd`, `/flow-tech`, `/flow-ui`, `/flow-epic` now deprecated (use `/flow-spec`)
596
+
597
+ **📊 v4.1 Improvements**:
598
+ | Metric | Before (v4.0) | After (v4.1) | Improvement |
599
+ |--------|---------------|--------------|-------------|
600
+ | Command calls | 4 | 1 | -75% |
601
+ | Design phase time | 8-12 min | 5-8 min | -35% |
602
+ | Entry/Exit Gate code | ~280 lines | ~100 lines | -64% |
603
+
604
+ ### v4.0.0 (2026-02-07)
605
+
606
+ **🏗️ Skills-First Architecture: Unified Skills with Context Injection**
607
+
608
+ v4.0.0 introduces a major architectural refactor, reorganizing 135 files into a unified Skills-First Architecture inspired by Trellis and OpenSpec:
609
+
610
+ - **Skills-First Architecture** - All Skills organized into 4 groups
611
+ - `workflow/`: 9 core workflow Skills (flow-init, flow-spec, flow-dev, etc.)
612
+ - `domain/`: 7 domain expertise Skills (tdd, debugging, brainstorming, verification)
613
+ - `guardrail/`: 3 real-time compliance Skills (constitution-guardian, tdd-enforcer)
614
+ - `utility/`: 8 development tool Skills (npm-release, skill-creator, writing-skills)
615
+
616
+ - **JSONL Context Injection** (Trellis-inspired)
617
+ - Each Skill has `context.jsonl` defining required context files
618
+ - `inject-skill-context.ts` hook auto-loads context before Skill execution
619
+ - Variable substitution: `{REQ}` replaced with actual requirement ID
620
+ - Optional files supported with `"optional": true`
621
+
622
+ - **workflow.yaml Dependency Graph** (OpenSpec-inspired)
623
+ - Defines Skill dependencies with `requires` and `generates`
624
+ - File existence state detection for workflow status
625
+ - Clear visualization of Skill execution order
626
+
627
+ - **Self-Contained Skills**
628
+ - Each Skill directory contains: SKILL.md + context.jsonl + scripts/ + references/ + assets/
629
+ - SKILL.md limited to <500 lines for focused instructions
630
+ - Agent instructions moved to `references/` subdirectory
631
+ - Templates moved to `assets/` subdirectory
632
+
633
+ - **Multi-Module Cross-Platform Compiler** (v3.0)
634
+ - Complete multi-module compilation: skills, commands, agents, rules, hooks
635
+ - Platform-specific output formats:
636
+ - **Codex**: `.codex/skills/`, `.codex/prompts/`, `AGENTS.md`
637
+ - **Cursor**: `.cursor/rules/*.mdc`, `.cursor/subagents/`, `hooks.json`
638
+ - **Qwen**: `.qwen/commands/*.toml`, `.qwen/agents/`, `CONTEXT.md`
639
+ - **Antigravity**: `.agent/skills/`, `.agent/workflows/`, `.agent/rules/`
640
+ - `context.jsonl` compilation-time expansion with platform-specific formats
641
+ - 197 tests passing (24 new multi-module tests)
642
+
643
+ **📊 v4.0 Improvements**:
644
+ | Metric | Before | After | Improvement |
645
+ |--------|--------|-------|-------------|
646
+ | Maintenance points | 4 directories | 1 directory | -75% |
647
+ | Context loading | Manual full load | On-demand auto | -70% tokens |
648
+ | Dependency visibility | Implicit | Explicit (workflow.yaml) | +100% |
649
+ | Platform module support | Commands only | All modules | +400% |
650
+
651
+ **📁 New Files**:
652
+ - `.claude/skills/workflow.yaml` - Skill dependency graph
653
+ - `.claude/hooks/inject-skill-context.ts` - Context injection hook
654
+ - `.claude/skills/workflow/*/context.jsonl` - Per-Skill context definitions
655
+ - `devflow/spec/{frontend,backend,shared}/index.md` - Specification indexes
656
+ - `lib/compiler/context-expander.js` - Context.jsonl expansion module
657
+ - `lib/compiler/__tests__/multi-module-emitters.test.js` - Multi-module tests
658
+
659
+ ### v2.3.0 (2026-01-08)
500
660
 
501
661
  **🛡️ Discipline System: Iron Law + Rationalization Defense + Pressure Testing**
502
662
 
package/README.zh-CN.md CHANGED
@@ -31,6 +31,9 @@
31
31
  - 📜 **Constitution** - 10条宪法条款管控质量、安全和架构
32
32
  - 🔄 **自主开发** - Ralph × Manus 集成实现有记忆的持续迭代
33
33
  - 🔌 **多平台支持** - 通过 `npm run adapt` 编译工作流到 Codex、Cursor、Qwen、Antigravity
34
+ - 🔄 **多模块编译器** - 完整模块编译:skills、commands、agents、rules、hooks
35
+ - 🌿 **Git Worktree 集成** - 支持 3-5 个并行 Claude 会话的隔离 worktree 开发
36
+ - 🤝 **Claude Team 集成** - 多 Agent 并行协作,自动任务调度和冲突检测
34
37
 
35
38
  ---
36
39
 
@@ -73,28 +76,37 @@ export SKIP_TDD_ENFORCER=1
73
76
  📚 [完整 Hooks 文档](docs/guides/hooks-system.zh-CN.md)
74
77
  </details>
75
78
 
76
- ### Skills 系统
79
+ ### Skills 系统 (v4.0 Skills-First 架构)
77
80
 
78
- 智能知识库激活,自动推荐相关领域知识。
81
+ 智能知识库激活,分组 Skills 与自动上下文注入。
79
82
 
80
83
  <details>
81
84
  <summary>📖 Skills 详解(点击展开)</summary>
82
85
 
83
- **可用 Skills**:
86
+ **Skills-First 架构** (v4.0):
84
87
 
85
- | Skill | 类型 | 触发场景 |
86
- |-------|------|----------|
87
- | `cc-devflow-orchestrator` | domain | 需求管理、流程指导 |
88
- | `devflow-tdd-enforcer` | guardrail | 编辑 TASKS.md |
89
- | `constitution-guardian` | guardrail | 编辑 PRD/EPIC/TASKS |
90
- | `devflow-file-standards` | domain | 文件命名、目录结构 |
91
- | `skill-developer` | domain | Skill 开发、Hook 系统 |
88
+ ```
89
+ .claude/skills/
90
+ ├── workflow.yaml # Skill 依赖图 (借鉴 OpenSpec)
91
+ ├── workflow/ # 9 个工作流 Skills (flow-init, flow-spec, flow-dev 等)
92
+ ├── domain/ # 7 个领域 Skills (tdd, debugging, brainstorming)
93
+ ├── guardrail/ # 3 个守护 Skills (constitution-guardian, tdd-enforcer)
94
+ └── utility/ # 8 个工具 Skills (npm-release, skill-creator)
95
+ ```
96
+
97
+ **按分类的关键 Skills**:
92
98
 
93
- **触发机制**:
94
- 1. **关键词触发** - 输入包含特定关键词
95
- 2. **意图匹配** - 正则匹配用户意图
96
- 3. **文件触发** - 编辑特定路径文件
97
- 4. **内容匹配** - 文件内容匹配特定模式
99
+ | 分类 | Skills | 用途 |
100
+ |------|--------|------|
101
+ | **Workflow** | flow-init, flow-spec, flow-dev, flow-quality, flow-release | 核心开发工作流 |
102
+ | **Domain** | tdd, debugging, brainstorming, verification | 领域专业知识 |
103
+ | **Guardrail** | constitution-guardian, tdd-enforcer | 实时合规检查 |
104
+ | **Utility** | npm-release, skill-creator, writing-skills | 开发工具 |
105
+
106
+ **上下文注入** (借鉴 Trellis):
107
+ - 每个 Skill 有 `context.jsonl` 定义所需上下文文件
108
+ - `inject-skill-context.ts` 钩子在 Skill 执行前自动加载上下文
109
+ - 变量替换: `{REQ}` → 实际需求 ID
98
110
 
99
111
  📚 [完整 Skills 文档](docs/guides/skills-system.zh-CN.md)
100
112
  </details>
@@ -245,6 +257,7 @@ bash .claude/tests/constitution/run_all_constitution_tests.sh
245
257
  | `/flow-new` | 🎯 启动新需求 | `/flow-new "REQ-123\|功能"` | [→](docs/commands/flow-new.zh-CN.md) |
246
258
  | `/flow-init` | 📦 初始化需求 | `/flow-init "REQ-123\|功能"` | [→](docs/commands/flow-init.zh-CN.md) |
247
259
  | `/flow-clarify` | 🔎 澄清歧义 | `/flow-clarify "REQ-123"` | [→](.claude/commands/flow-clarify.md) |
260
+ | `/flow-spec` | 📋 统一规格阶段 (v4.1) | `/flow-spec "REQ-123"` | [→](.claude/commands/flow-spec.md) |
248
261
  | `/flow-checklist` | ✅ 需求质量检查 | `/flow-checklist --type ux` | [→](.claude/commands/flow-checklist.md) |
249
262
  | `/flow-verify` | 🔍 验证一致性 | `/flow-verify "REQ-123"` | [→](docs/commands/flow-verify.zh-CN.md) |
250
263
  | `/flow-qa` | 🧪 质量保证 | `/flow-qa "REQ-123"` | [→](docs/commands/flow-qa.zh-CN.md) |
@@ -283,51 +296,40 @@ bash .claude/tests/constitution/run_all_constitution_tests.sh
283
296
  ```mermaid
284
297
  graph TB
285
298
  Start([项目启动]) --> ProjectLevel{项目级初始化}
286
-
299
+
287
300
  ProjectLevel --> CoreRoadmap["/core-roadmap<br/>ROADMAP.md & BACKLOG.md"]
288
301
  ProjectLevel --> CoreArch["/core-architecture<br/>ARCHITECTURE.md"]
289
302
  ProjectLevel --> CoreGuidelines["/core-guidelines<br/>前端/后端规范"]
290
303
  ProjectLevel --> CoreStyle["/core-style<br/>STYLE.md"]
291
-
304
+
292
305
  CoreRoadmap --> ReqLevel
293
306
  CoreArch --> ReqLevel
294
307
  CoreGuidelines --> ReqLevel
295
308
  CoreStyle --> ReqLevel
296
-
297
- ReqLevel([需求级开发流程]) --> FlowInit["/flow-init<br/>research.md & tasks.json"]
298
-
309
+
310
+ ReqLevel([需求级开发流程]) --> FlowInit["/flow-init<br/>research.md & BRAINSTORM.md"]
311
+
299
312
  FlowInit --> FlowClarify["/flow-clarify<br/>clarifications/*.md<br/>可选"]
300
- FlowClarify --> FlowPRD["/flow-prd<br/>PRD.md"]
301
- FlowInit -.->|跳过澄清| FlowPRD
302
- FlowPRD --> FlowChecklist["/flow-checklist<br/>checklists/*.md<br/>80%门禁"]
303
- FlowPRD --> FlowTech["/flow-tech<br/>TECH_DESIGN.md & 数据模型"]
304
- FlowPRD --> FlowUI["/flow-ui<br/>UI_PROTOTYPE.html<br/>可选"]
305
-
306
- FlowChecklist --> FlowEpic
307
- FlowTech --> FlowEpic["/flow-epic<br/>EPIC.md & TASKS.md"]
308
- FlowUI --> FlowEpic
309
-
310
- FlowEpic --> FlowDev["/flow-dev<br/>TASKS.md 执行<br/>TDD 强制"]
311
-
313
+ FlowClarify --> FlowSpec["/flow-spec (v4.1)<br/>PRD → Tech+UI (并行) → Epic<br/>统一规格阶段"]
314
+ FlowInit -.->|跳过澄清| FlowSpec
315
+
316
+ FlowSpec --> FlowDev["/flow-dev<br/>TASKS.md 执行<br/>TDD 强制"]
317
+
312
318
  FlowDev --> FlowQA["/flow-qa<br/>QA 报告 & 安全审查"]
313
-
319
+
314
320
  FlowQA --> FlowRelease["/flow-release<br/>PR 创建 & 部署"]
315
-
321
+
316
322
  FlowRelease --> FlowVerify["/flow-verify<br/>一致性检查"]
317
-
323
+
318
324
  FlowVerify --> End([发布完成])
319
-
325
+
320
326
  FlowVerify -.->|可在任意阶段调用| ReqLevel
321
-
327
+
322
328
  style ProjectLevel fill:#e1f5ff
323
329
  style ReqLevel fill:#fff4e1
324
330
  style FlowInit fill:#e8f5e9
325
331
  style FlowClarify fill:#fff9c4
326
- style FlowPRD fill:#e8f5e9
327
- style FlowChecklist fill:#ffe0b2
328
- style FlowTech fill:#e8f5e9
329
- style FlowUI fill:#fff9c4
330
- style FlowEpic fill:#e8f5e9
332
+ style FlowSpec fill:#e8f5e9
331
333
  style FlowDev fill:#f3e5f5
332
334
  style FlowQA fill:#fce4ec
333
335
  style FlowRelease fill:#e0f2f1
@@ -337,8 +339,8 @@ graph TB
337
339
  **流程说明**:
338
340
  - **项目级命令**(浅蓝色):项目初始化时执行一次,建立全局标准(SSOT)
339
341
  - **需求级命令**(浅橙色):每个需求(REQ-XXX)执行一次
340
- - **可选步骤**(黄色):`/flow-clarify` `/flow-ui` 为可选步骤
341
- - **质量门禁**(橙色):`/flow-checklist` 在 `/flow-epic` 前验证需求质量,80% 完成度阈值
342
+ - **统一 /flow-spec** (v4.1):替代 flow-prd/flow-tech/flow-ui/flow-epic,支持并行执行
343
+ - **可选步骤**(黄色):`/flow-clarify` 为可选步骤,需求清晰时可跳过
342
344
  - **质量闸门**:每个阶段都有入口/出口闸门,确保文档质量和 Constitution 合规性
343
345
  - **TDD 强制执行**:`/flow-dev` 严格强制执行测试驱动开发顺序
344
346
  - **一致性检查**:`/flow-verify` 可在任意阶段调用,确保文档一致性
@@ -420,7 +422,7 @@ devflow/
420
422
  ```
421
423
 
422
424
  <details>
423
- <parameter name="summary">🔧 完整配置选项(点击展开)</summary>
425
+ <summary>🔧 完整配置选项(点击展开)</summary>
424
426
 
425
427
  ### Hooks 配置
426
428
 
@@ -484,7 +486,165 @@ bash .claude/tests/run-all-tests.sh --scripts
484
486
 
485
487
  ## 📝 版本历史
486
488
 
487
- ### v2.3.0 (2026-01-08) - 最新版本
489
+ ### v4.7.0 (2026-02-07) - 最新版本
490
+
491
+ **🤝 Claude Team 集成:多 Agent 并行协作**
492
+
493
+ v4.7.0 引入 Claude Team 集成,支持多 Agent 并行开发:
494
+
495
+ - **flow-dev Team 模式** - 多 Agent 并行任务执行
496
+ - `--team` 标志启用 Team 模式(默认 3 个 Agent)
497
+ - `--agents N` 指定 Agent 数量(2-5)
498
+ - 自动任务依赖分析和冲突检测
499
+ - 文件冲突任务分配给同一 Agent 串行执行
500
+
501
+ - **新增 Hooks** - Team 生命周期管理
502
+ - `TeammateIdle Hook` - 任务分配和调度
503
+ - `TaskCompleted Hook` - 完成时质量验证
504
+ - 超时检测和告警
505
+
506
+ - **任务依赖解析器** - 智能任务分析
507
+ - `parse-task-dependencies.js` - 解析 TASKS.md 格式
508
+ - 识别 `[P]` 并行标记、`[US*]` 用户故事分组
509
+ - 基于 Phase 的依赖解析
510
+
511
+ - **状态恢复** - 断点续传
512
+ - `team-state-recovery.sh` - 快照和恢复 Team 状态
513
+ - 支持中断会话恢复
514
+
515
+ - **新增文件**
516
+ - `.claude/scripts/parse-task-dependencies.js` - 任务解析器
517
+ - `.claude/scripts/detect-file-conflicts.sh` - 冲突检测
518
+ - `.claude/scripts/team-dev-init.sh` - Dev Team 初始化
519
+ - `.claude/scripts/team-state-recovery.sh` - 状态恢复
520
+ - `.claude/docs/guides/TEAM_MODE_GUIDE.md` - 完整使用指南
521
+
522
+ **📊 v4.7 改进指标**:
523
+ | 指标 | 之前 | 之后 | 改善 |
524
+ |------|------|------|------|
525
+ | 并行 Agent 数 | 1 | 3-5 | +400% |
526
+ | 需求完成时间 | 90 分钟 | 50 分钟 | -45% |
527
+ | 任务调度 | 手动 | 自动 | 100% |
528
+ | 质量验证 | 单点 | 分布式 | 100% |
529
+
530
+ ### v4.3.0 (2026-02-07)
531
+
532
+ **🌿 Git Worktree 集成:并行开发支持**
533
+
534
+ v4.3.0 引入 Git Worktree 集成,支持多个隔离的 Claude Code 会话并行开发:
535
+
536
+ - **Git Worktree 模式(默认)** - 隔离的开发环境
537
+ - 创建 `../repo-name-REQ-xxx/` worktree 目录
538
+ - 每个 worktree 有独立的 Claude Code 会话
539
+ - 用 `cd` 切换需求,而非 `git checkout`
540
+ - `--branch-only` 标志支持传统分支模式
541
+
542
+ - **新增 Skill: using-git-worktrees** - 完整的 worktree 管理
543
+ - `worktree-create.sh` - 创建新 worktree
544
+ - `worktree-list.sh` - 列出所有 worktree
545
+ - `worktree-switch.sh` - 切换 worktree
546
+ - `worktree-cleanup.sh` - 清理已合并的 worktree
547
+ - Shell 别名模板 (za/zl/zm/zw)
548
+
549
+ - **修改的命令**
550
+ - `/flow-init` - 默认 worktree 模式,`--branch-only` 兼容旧模式
551
+ - `/flow-release` - 自动清理 worktree
552
+
553
+ **📊 v4.3 改进指标**:
554
+ | 指标 | 之前 | 之后 | 改善 |
555
+ |------|------|------|------|
556
+ | 并行需求数 | 1 | 3-5 | +400% |
557
+ | 上下文切换时间 | 30s | 1s | -97% |
558
+ | 会话隔离 | 无 | 完全 | 100% |
559
+
560
+ ### v4.1.0 (2026-02-07)
561
+
562
+ **🎯 统一规格阶段:/flow-spec 命令**
563
+
564
+ v4.1.0 将 flow-prd/flow-tech/flow-ui/flow-epic 合并为单一 `/flow-spec` 命令,支持并行执行:
565
+
566
+ - **统一 /flow-spec 命令** - 一个命令完成整个规格阶段
567
+ - 完整模式:PRD → Tech + UI(并行)→ Epic/Tasks
568
+ - 快速模式:`--skip-tech --skip-ui` 适用于小需求
569
+ - 仅后端:`--skip-ui`
570
+ - 仅前端:`--skip-tech`
571
+
572
+ - **并行 Agent 执行** - Tech + UI 代理并发运行
573
+ - 设计阶段时间减少约 35%
574
+ - 共享模板组件位于 `_shared/` 目录
575
+
576
+ - **简化工作流** (v4.1)
577
+ ```
578
+ 精简 (3 步): /flow-init --quick → /flow-spec --skip-tech --skip-ui → /flow-dev → /flow-release
579
+ 标准 (4 步): /flow-init → /flow-spec → /flow-dev → /flow-quality → /flow-release
580
+ 完整 (5 步): /flow-init → /flow-clarify → /flow-spec → /flow-dev → /flow-quality --full → /flow-release
581
+ ```
582
+
583
+ - **废弃命令**:`/flow-prd`、`/flow-tech`、`/flow-ui`、`/flow-epic` 已废弃(请使用 `/flow-spec`)
584
+
585
+ **📊 v4.1 改进指标**:
586
+ | 指标 | 之前 (v4.0) | 之后 (v4.1) | 改善 |
587
+ |------|-------------|-------------|------|
588
+ | 命令调用次数 | 4 | 1 | -75% |
589
+ | 设计阶段时间 | 8-12 分钟 | 5-8 分钟 | -35% |
590
+ | Entry/Exit Gate 代码 | ~280 行 | ~100 行 | -64% |
591
+
592
+ ### v4.0.0 (2026-02-07)
593
+
594
+ **🏗️ Skills-First 架构:统一 Skills 与上下文注入**
595
+
596
+ v4.0.0 引入重大架构重构,将 135 个文件重组为统一的 Skills-First 架构,借鉴 Trellis 和 OpenSpec:
597
+
598
+ - **Skills-First 架构** - 所有 Skills 组织为 4 个分组
599
+ - `workflow/`: 9 个核心工作流 Skills (flow-init, flow-spec, flow-dev 等)
600
+ - `domain/`: 7 个领域专业 Skills (tdd, debugging, brainstorming, verification)
601
+ - `guardrail/`: 3 个实时合规 Skills (constitution-guardian, tdd-enforcer)
602
+ - `utility/`: 8 个开发工具 Skills (npm-release, skill-creator, writing-skills)
603
+
604
+ - **JSONL 上下文注入** (借鉴 Trellis)
605
+ - 每个 Skill 有 `context.jsonl` 定义所需上下文文件
606
+ - `inject-skill-context.ts` 钩子在 Skill 执行前自动加载上下文
607
+ - 变量替换: `{REQ}` 替换为实际需求 ID
608
+ - 支持可选文件 `"optional": true`
609
+
610
+ - **workflow.yaml 依赖图** (借鉴 OpenSpec)
611
+ - 通过 `requires` 和 `generates` 定义 Skill 依赖
612
+ - 文件存在性状态检测
613
+ - 清晰可视化 Skill 执行顺序
614
+
615
+ - **自包含 Skills**
616
+ - 每个 Skill 目录包含: SKILL.md + context.jsonl + scripts/ + references/ + assets/
617
+ - SKILL.md 限制 <500 行,聚焦核心指令
618
+ - Agent 指令移至 `references/` 子目录
619
+ - 模板移至 `assets/` 子目录
620
+
621
+ - **多模块跨平台编译器** (v3.0)
622
+ - 完整模块编译:skills、commands、agents、rules、hooks
623
+ - 平台专用输出格式:
624
+ - **Codex**: `.codex/skills/`, `.codex/prompts/`, `AGENTS.md`
625
+ - **Cursor**: `.cursor/rules/*.mdc`, `.cursor/subagents/`, `hooks.json`
626
+ - **Qwen**: `.qwen/commands/*.toml`, `.qwen/agents/`, `CONTEXT.md`
627
+ - **Antigravity**: `.agent/skills/`, `.agent/workflows/`, `.agent/rules/`
628
+ - `context.jsonl` 编译时展开,支持平台专用格式
629
+ - 197 个测试通过(24 个新增多模块测试)
630
+
631
+ **📊 v4.0 改进指标**:
632
+ | 指标 | 之前 | 之后 | 改善 |
633
+ |------|------|------|------|
634
+ | 维护点 | 4 个目录 | 1 个目录 | -75% |
635
+ | 上下文加载 | 手动全量 | 按需自动 | -70% token |
636
+ | 依赖可见性 | 隐式 | 显式 (workflow.yaml) | +100% |
637
+ | 平台模块支持 | 仅命令 | 全部模块 | +400% |
638
+
639
+ **📁 新增文件**:
640
+ - `.claude/skills/workflow.yaml` - Skill 依赖图
641
+ - `.claude/hooks/inject-skill-context.ts` - 上下文注入钩子
642
+ - `.claude/skills/workflow/*/context.jsonl` - 每个 Skill 的上下文定义
643
+ - `devflow/spec/{frontend,backend,shared}/index.md` - 规范索引
644
+ - `lib/compiler/context-expander.js` - Context.jsonl 展开模块
645
+ - `lib/compiler/__tests__/multi-module-emitters.test.js` - 多模块测试
646
+
647
+ ### v2.3.0 (2026-01-08)
488
648
 
489
649
  **🛡️ 纪律系统:铁律 + 合理化防御 + 压力测试**
490
650