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.
- package/.claude/CLAUDE.md +1065 -48
- package/.claude/agents/dev-implementer.md +195 -0
- package/.claude/commands/{flow-archive.md → flow/archive.md} +46 -11
- package/.claude/commands/flow/context.md +150 -0
- package/.claude/commands/flow/delta.md +245 -0
- package/.claude/commands/{flow-dev.md → flow/dev.md} +112 -11
- package/.claude/commands/flow/init.md +45 -0
- package/.claude/commands/flow/quality.md +159 -0
- package/.claude/commands/flow/spec.md +186 -0
- package/.claude/commands/flow/workspace.md +146 -0
- package/.claude/commands/{cancel-ralph.md → util/cancel-ralph.md} +1 -0
- package/.claude/config/quality-gates.yml +305 -0
- package/.claude/docs/guides/TEAM_MODE_GUIDE.md +313 -0
- package/.claude/docs/templates/DELTA_SPEC_TEMPLATE.md +91 -0
- package/.claude/docs/templates/DESIGN_DECISIONS_TEMPLATE.md +151 -0
- package/.claude/docs/templates/JOURNAL_TEMPLATE.md +75 -0
- package/.claude/docs/templates/_shared/CLAUDE.md +36 -0
- package/.claude/docs/templates/_shared/CONSTITUTION_CHECK.md +125 -0
- package/.claude/docs/templates/_shared/VALIDATION_CHECKLIST.md +187 -0
- package/.claude/docs/templates/_shared/YAML_FRONTMATTER.md +164 -0
- package/.claude/docs/templates/context/dev.jsonl.template +6 -0
- package/.claude/docs/templates/context/epic.jsonl.template +5 -0
- package/.claude/docs/templates/context/prd.jsonl.template +4 -0
- package/.claude/docs/templates/context/research.jsonl.template +4 -0
- package/.claude/docs/templates/context/review.jsonl.template +5 -0
- package/.claude/docs/templates/context/tech.jsonl.template +5 -0
- package/.claude/hooks/CLAUDE.md +342 -0
- package/.claude/hooks/inject-agent-context.ts +480 -0
- package/.claude/hooks/inject-skill-context.ts +359 -0
- package/.claude/hooks/ralph-loop.ts +931 -0
- package/.claude/hooks/task-completed-hook.ts +593 -0
- package/.claude/hooks/teammate-idle-hook.ts +690 -0
- package/.claude/hooks/types/team-types.d.ts +238 -0
- package/.claude/rules/devflow-conventions.md +82 -9
- package/.claude/scripts/archive-requirement.sh +44 -1
- package/.claude/scripts/common.sh +670 -3
- package/.claude/scripts/delta-parser.ts +527 -0
- package/.claude/scripts/detect-file-conflicts.sh +151 -0
- package/.claude/scripts/flow-context-add.sh +134 -0
- package/.claude/scripts/flow-context-init.sh +133 -0
- package/.claude/scripts/flow-context-validate.sh +144 -0
- package/.claude/scripts/flow-delta-apply.sh +297 -0
- package/.claude/scripts/flow-delta-archive.sh +71 -0
- package/.claude/scripts/flow-delta-create.sh +202 -0
- package/.claude/scripts/flow-delta-list.sh +142 -0
- package/.claude/scripts/flow-delta-status.sh +235 -0
- package/.claude/scripts/flow-quality-full.sh +184 -0
- package/.claude/scripts/flow-quality-quick.sh +64 -0
- package/.claude/scripts/flow-workspace-init.sh +117 -0
- package/.claude/scripts/flow-workspace-record.sh +164 -0
- package/.claude/scripts/flow-workspace-start.sh +88 -0
- package/.claude/scripts/get-workflow-status.sh +415 -0
- package/.claude/scripts/parse-task-dependencies.js +334 -0
- package/.claude/scripts/record-quality-error.sh +165 -0
- package/.claude/scripts/run-quality-gates.sh +242 -0
- package/.claude/scripts/team-dev-init.sh +319 -0
- package/.claude/scripts/team-state-recovery.sh +229 -0
- package/.claude/scripts/workflow-status.ts +433 -0
- package/.claude/settings.json +19 -0
- package/.claude/skills/cc-devflow-orchestrator/SKILL.md +85 -200
- package/.claude/skills/domain/using-git-worktrees/SKILL.md +252 -0
- package/.claude/skills/domain/using-git-worktrees/assets/SHELL_ALIASES.md +133 -0
- package/.claude/skills/domain/using-git-worktrees/context.jsonl +4 -0
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-cleanup.sh +218 -0
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-create.sh +232 -0
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-list.sh +130 -0
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-status.sh +140 -0
- package/.claude/skills/domain/using-git-worktrees/scripts/worktree-switch.sh +70 -0
- package/.claude/skills/skill-rules.json +72 -1
- package/.claude/skills/utility/journey-checker/SKILL.md +199 -0
- package/.claude/skills/utility/journey-checker/pressure-scenarios.md +164 -0
- package/.claude/skills/utility/skill-creator/LICENSE.txt +202 -0
- package/.claude/skills/utility/skill-creator/SKILL.md +356 -0
- package/.claude/skills/utility/skill-creator/references/output-patterns.md +82 -0
- package/.claude/skills/utility/skill-creator/references/workflows.md +28 -0
- package/.claude/skills/utility/skill-creator/scripts/init_skill.py +303 -0
- package/.claude/skills/utility/skill-creator/scripts/package_skill.py +110 -0
- package/.claude/skills/utility/skill-creator/scripts/quick_validate.py +95 -0
- package/.claude/skills/workflow/flow-dev/CLAUDE.md +78 -0
- package/.claude/skills/workflow/flow-dev/SKILL.md +96 -0
- package/.claude/skills/workflow/flow-dev/assets/IMPLEMENTATION_PLAN_TEMPLATE.md +71 -0
- package/.claude/skills/workflow/flow-dev/context.jsonl +8 -0
- package/.claude/skills/workflow/flow-dev/dev-implementer.jsonl +8 -0
- package/.claude/skills/workflow/flow-dev/scripts/entry-gate.sh +116 -0
- package/.claude/skills/workflow/flow-dev/scripts/exit-gate.sh +101 -0
- package/.claude/skills/workflow/flow-dev/scripts/task-orchestrator.sh +106 -0
- package/.claude/skills/workflow/flow-fix/SKILL.md +105 -0
- package/.claude/skills/workflow/flow-fix/context.jsonl +6 -0
- package/.claude/skills/workflow/flow-fix/references/bug-analyzer.md +381 -0
- package/.claude/skills/workflow/flow-init/SKILL.md +211 -0
- package/.claude/skills/workflow/flow-init/assets/BRAINSTORM_TEMPLATE.md +148 -0
- package/.claude/skills/workflow/flow-init/assets/INIT_FLOW_TEMPLATE.md +198 -0
- package/.claude/skills/workflow/flow-init/assets/RESEARCH_TEMPLATE.md +276 -0
- package/.claude/skills/workflow/flow-init/context.jsonl +5 -0
- package/.claude/skills/workflow/flow-init/references/flow-researcher.md +132 -0
- package/.claude/skills/workflow/flow-init/scripts/check-prerequisites.sh +232 -0
- package/.claude/skills/workflow/flow-init/scripts/consolidate-research.sh +182 -0
- package/.claude/skills/workflow/flow-init/scripts/create-requirement.sh +515 -0
- package/.claude/skills/workflow/flow-init/scripts/generate-research-tasks.sh +157 -0
- package/.claude/skills/workflow/flow-init/scripts/populate-research-tasks.sh +284 -0
- package/.claude/skills/workflow/flow-init/scripts/validate-research.sh +332 -0
- package/.claude/skills/workflow/flow-quality/SKILL.md +94 -0
- package/.claude/skills/workflow/flow-quality/context.jsonl +6 -0
- package/.claude/skills/workflow/flow-quality/references/code-quality-reviewer.md +205 -0
- package/.claude/skills/workflow/flow-quality/references/qa-tester.md +313 -0
- package/.claude/skills/workflow/flow-quality/references/security-reviewer.md +314 -0
- package/.claude/skills/workflow/flow-quality/references/spec-reviewer.md +221 -0
- package/.claude/skills/workflow/flow-release/SKILL.md +126 -0
- package/.claude/skills/workflow/flow-release/context.jsonl +7 -0
- package/.claude/skills/workflow/flow-release/references/release-manager.md +295 -0
- package/.claude/skills/workflow/flow-spec/CLAUDE.md +103 -0
- package/.claude/skills/workflow/flow-spec/SKILL.md +545 -0
- package/.claude/skills/workflow/flow-spec/context.jsonl +7 -0
- package/.claude/skills/workflow/flow-spec/scripts/entry-gate.sh +194 -0
- package/.claude/skills/workflow/flow-spec/scripts/exit-gate.sh +244 -0
- package/.claude/skills/workflow/flow-spec/scripts/parallel-orchestrator.sh +205 -0
- package/.claude/skills/workflow/flow-spec/scripts/team-communication.sh +353 -0
- package/.claude/skills/workflow/flow-spec/scripts/team-init.sh +195 -0
- package/.claude/skills/workflow/flow-spec/scripts/test-team-mode.sh +496 -0
- package/.claude/skills/workflow/flow-spec/team-config.json +165 -0
- package/.claude/skills/workflow.yaml +417 -0
- package/CHANGELOG.md +254 -0
- package/README.md +193 -33
- package/README.zh-CN.md +206 -46
- package/lib/compiler/CLAUDE.md +77 -46
- package/lib/compiler/__tests__/multi-module-emitters.test.js +508 -0
- package/lib/compiler/context-expander.js +179 -0
- package/lib/compiler/emitters/antigravity-emitter.js +195 -5
- package/lib/compiler/emitters/base-emitter.js +217 -2
- package/lib/compiler/emitters/codex-emitter.js +200 -4
- package/lib/compiler/emitters/cursor-emitter.js +307 -3
- package/lib/compiler/emitters/qwen-emitter.js +196 -4
- package/lib/compiler/index.js +197 -2
- package/lib/compiler/platforms.js +270 -21
- package/package.json +1 -1
- package/.claude/commands/flow-epic.md +0 -183
- package/.claude/commands/flow-init.md +0 -370
- package/.claude/commands/flow-prd.md +0 -144
- package/.claude/commands/flow-qa.md +0 -93
- package/.claude/commands/flow-review.md +0 -257
- package/.claude/commands/flow-tech.md +0 -142
- package/.claude/commands/flow-ui.md +0 -189
- package/.claude/skills/file-header-guardian/SKILL.md +0 -56
- package/.claude/skills/skill-developer/ADVANCED.md +0 -197
- package/.claude/skills/skill-developer/HOOK_MECHANISMS.md +0 -306
- package/.claude/skills/skill-developer/PATTERNS_LIBRARY.md +0 -152
- package/.claude/skills/skill-developer/SKILL.md +0 -426
- package/.claude/skills/skill-developer/SKILL_RULES_REFERENCE.md +0 -315
- package/.claude/skills/skill-developer/TRIGGER_TYPES.md +0 -305
- package/.claude/skills/skill-developer/TROUBLESHOOTING.md +0 -514
- package/.claude/skills/writing-skills/SKILL.md +0 -655
- package/.claude/skills/writing-skills/anthropic-best-practices.md +0 -1150
- package/.claude/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
- package/.claude/skills/writing-skills/graphviz-conventions.dot +0 -172
- package/.claude/skills/writing-skills/persuasion-principles.md +0 -187
- package/.claude/skills/writing-skills/render-graphs.js +0 -168
- package/.claude/skills/writing-skills/testing-skills-with-subagents.md +0 -384
- package/.claude/tsc-cache/795ba6e3-b98a-423b-bab2-51aa62812569/affected-repos.txt +0 -1
- package/.claude/tsc-cache/ae335694-be5a-4ba4-a1a0-b676c09a7906/affected-repos.txt +0 -1
- /package/.claude/commands/{core-architecture.md → core/architecture.md} +0 -0
- /package/.claude/commands/{core-guidelines.md → core/guidelines.md} +0 -0
- /package/.claude/commands/{core-roadmap.md → core/roadmap.md} +0 -0
- /package/.claude/commands/{core-style.md → core/style.md} +0 -0
- /package/.claude/commands/{flow-checklist.md → flow/checklist.md} +0 -0
- /package/.claude/commands/{flow-clarify.md → flow/clarify.md} +0 -0
- /package/.claude/commands/{flow-constitution.md → flow/constitution.md} +0 -0
- /package/.claude/commands/{flow-fix.md → flow/fix.md} +0 -0
- /package/.claude/commands/{flow-ideate.md → flow/ideate.md} +0 -0
- /package/.claude/commands/{flow-new.md → flow/new.md} +0 -0
- /package/.claude/commands/{flow-release.md → flow/release.md} +0 -0
- /package/.claude/commands/{flow-restart.md → flow/restart.md} +0 -0
- /package/.claude/commands/{flow-status.md → flow/status.md} +0 -0
- /package/.claude/commands/{flow-update.md → flow/update.md} +0 -0
- /package/.claude/commands/{flow-upgrade.md → flow/upgrade.md} +0 -0
- /package/.claude/commands/{flow-verify.md → flow/verify.md} +0 -0
- /package/.claude/commands/{code-review-high.md → util/code-review.md} +0 -0
- /package/.claude/commands/{git-commit.md → util/git-commit.md} +0 -0
- /package/.claude/commands/{problem-analyzer.md → util/problem-analyzer.md} +0 -0
- /package/.claude/skills/{flow-attention-refresh → domain/attention-refresh}/SKILL.md +0 -0
- /package/.claude/skills/{flow-brainstorming → domain/brainstorming}/SKILL.md +0 -0
- /package/.claude/skills/{flow-debugging → domain/debugging}/SKILL.md +0 -0
- /package/.claude/skills/{flow-finishing-branch → domain/finishing-branch}/SKILL.md +0 -0
- /package/.claude/skills/{flow-receiving-review → domain/receiving-review}/SKILL.md +0 -0
- /package/.claude/skills/{flow-tdd → domain/tdd}/SKILL.md +0 -0
- /package/.claude/skills/{verification-before-completion → domain/verification}/SKILL.md +0 -0
- /package/.claude/skills/{constitution-guardian → guardrail/constitution-guardian}/SKILL.md +0 -0
- /package/.claude/skills/{devflow-tdd-enforcer → guardrail/tdd-enforcer}/SKILL.md +0 -0
- /package/.claude/skills/{devflow-constitution-quick-ref → utility/constitution-quick-ref}/SKILL.md +0 -0
- /package/.claude/skills/{devflow-file-standards → utility/file-standards}/SKILL.md +0 -0
- /package/.claude/skills/{fractal-docs-generator → utility/fractal-docs}/SKILL.md +0 -0
- /package/.claude/skills/{npm-release → utility/npm-release}/SKILL.md +0 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# Claude Team 模式使用指南
|
|
2
|
+
|
|
3
|
+
> **版本**: v1.0.0
|
|
4
|
+
> **日期**: 2026-02-07
|
|
5
|
+
> **适用**: CC-DevFlow v4.7+
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 概述
|
|
10
|
+
|
|
11
|
+
Claude Team 模式允许多个 Agent 并行协作开发,显著提升开发效率。
|
|
12
|
+
|
|
13
|
+
### 核心优势
|
|
14
|
+
|
|
15
|
+
| 指标 | 单 Agent | Team 模式 | 提升 |
|
|
16
|
+
|------|----------|-----------|------|
|
|
17
|
+
| 并行任务数 | 1 | 3-5 | +400% |
|
|
18
|
+
| 需求完成时间 | 90 min | 50 min | -45% |
|
|
19
|
+
| 上下文隔离 | 无 | 完全隔离 | 100% |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 快速开始
|
|
24
|
+
|
|
25
|
+
### 1. flow-dev Team 模式
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# 启用 Team 模式 (默认 3 个 Agent)
|
|
29
|
+
/flow:dev "REQ-123" --team
|
|
30
|
+
|
|
31
|
+
# 指定 Agent 数量 (2-5)
|
|
32
|
+
/flow:dev "REQ-123" --team --agents 5
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. flow-spec Team 模式
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Full Mode 自动使用 Team (tech + ui 并行)
|
|
39
|
+
/flow:spec "REQ-123"
|
|
40
|
+
|
|
41
|
+
# 简化模式使用 Subagent
|
|
42
|
+
/flow:spec "REQ-123" --skip-tech --skip-ui
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 工作原理
|
|
48
|
+
|
|
49
|
+
### flow-dev Team 执行流程
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
53
|
+
│ 1. 任务分析 │
|
|
54
|
+
│ → parse-task-dependencies.js 解析 TASKS.md │
|
|
55
|
+
│ → 识别 [P] 并行标记、[US*] 用户故事、Phase 依赖 │
|
|
56
|
+
├─────────────────────────────────────────────────────────────┤
|
|
57
|
+
│ 2. 冲突检测 │
|
|
58
|
+
│ → detect-file-conflicts.sh 检测文件冲突 │
|
|
59
|
+
│ → 冲突任务分配给同一 Agent 串行执行 │
|
|
60
|
+
├─────────────────────────────────────────────────────────────┤
|
|
61
|
+
│ 3. 任务分配 │
|
|
62
|
+
│ → Round-robin 分配无冲突任务 │
|
|
63
|
+
│ → 更新 orchestration_status.json │
|
|
64
|
+
├─────────────────────────────────────────────────────────────┤
|
|
65
|
+
│ 4. 并行执行 │
|
|
66
|
+
│ → 每个 Agent 独立执行分配的任务 │
|
|
67
|
+
│ → TeammateIdle Hook 自动分配下一任务 │
|
|
68
|
+
├─────────────────────────────────────────────────────────────┤
|
|
69
|
+
│ 5. 完成处理 │
|
|
70
|
+
│ → TaskCompleted Hook 验证质量 │
|
|
71
|
+
│ → 所有任务完成后 shutdown │
|
|
72
|
+
└─────────────────────────────────────────────────────────────┘
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### flow-spec Team 执行流程
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
PRD (串行) → Tech + UI (Team 并行) → Epic (串行)
|
|
79
|
+
|
|
80
|
+
Time ────────────────────────────────────────────►
|
|
81
|
+
|
|
82
|
+
T0 ┌─────────────┐
|
|
83
|
+
│ prd-writer │ (必须先完成)
|
|
84
|
+
└──────┬──────┘
|
|
85
|
+
│
|
|
86
|
+
T1 ├────────────────────┐
|
|
87
|
+
│ │
|
|
88
|
+
┌──────▼──────┐ ┌──────▼──────┐
|
|
89
|
+
│tech-architect│ │ ui-designer │ (Team 并行)
|
|
90
|
+
└──────┬──────┘ └──────┬──────┘
|
|
91
|
+
│ │
|
|
92
|
+
│ ← SendMessage 协商 →
|
|
93
|
+
│ │
|
|
94
|
+
T2 └─────────┬──────────┘
|
|
95
|
+
│
|
|
96
|
+
┌──────▼──────┐
|
|
97
|
+
│ planner │ (等待两者完成)
|
|
98
|
+
└─────────────┘
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## TASKS.md 标记规范
|
|
104
|
+
|
|
105
|
+
### 并行标记 [P]
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
## Phase 3: Core Implementation
|
|
109
|
+
|
|
110
|
+
- [ ] T005 [P] [US1] 实现用户注册 API (src/api/user.ts)
|
|
111
|
+
- [ ] T006 [P] [US2] 实现订单创建 API (src/api/order.ts)
|
|
112
|
+
- [ ] T007 [US1] 实现用户验证逻辑 (src/services/auth.ts)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
- `[P]` 标记表示该任务可并行执行
|
|
116
|
+
- 无 `[P]` 标记的任务必须串行执行
|
|
117
|
+
- 同一文件的任务不应标记 `[P]`
|
|
118
|
+
|
|
119
|
+
### 用户故事分组 [US*]
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
- [ ] T005 [P] [US1] 用户注册 API
|
|
123
|
+
- [ ] T006 [P] [US1] 用户登录 API
|
|
124
|
+
- [ ] T007 [P] [US2] 订单创建 API
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- `[US1]`, `[US2]` 等标记用户故事分组
|
|
128
|
+
- 同一用户故事的任务优先分配给同一 Agent
|
|
129
|
+
- 减少上下文切换,提高效率
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 文件冲突处理
|
|
134
|
+
|
|
135
|
+
### 冲突检测
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# 输入
|
|
139
|
+
{
|
|
140
|
+
"tasks": [
|
|
141
|
+
{"id": "T001", "filePath": "src/user.ts"},
|
|
142
|
+
{"id": "T002", "filePath": "src/user.ts"},
|
|
143
|
+
{"id": "T003", "filePath": "src/order.ts"}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
# 输出
|
|
148
|
+
{
|
|
149
|
+
"hasConflicts": true,
|
|
150
|
+
"conflicts": [
|
|
151
|
+
{"file": "src/user.ts", "tasks": ["T001", "T002"]}
|
|
152
|
+
],
|
|
153
|
+
"safeGroups": [
|
|
154
|
+
{"tasks": ["T003"]}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 冲突解决策略
|
|
160
|
+
|
|
161
|
+
| 策略 | 描述 |
|
|
162
|
+
|------|------|
|
|
163
|
+
| **same_agent** | 冲突任务分配给同一 Agent 串行执行 |
|
|
164
|
+
| **sequential** | 所有冲突任务按顺序执行 |
|
|
165
|
+
| **worktree** | 使用 Git Worktree 隔离 (未来支持) |
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 状态管理
|
|
170
|
+
|
|
171
|
+
### orchestration_status.json Team 字段
|
|
172
|
+
|
|
173
|
+
```json
|
|
174
|
+
{
|
|
175
|
+
"team": {
|
|
176
|
+
"mode": "parallel",
|
|
177
|
+
"lead": "dev-lead",
|
|
178
|
+
"teammates": [
|
|
179
|
+
{
|
|
180
|
+
"id": "dev-1",
|
|
181
|
+
"role": "developer",
|
|
182
|
+
"status": "working",
|
|
183
|
+
"currentTask": "T001",
|
|
184
|
+
"completedTasks": ["T000"],
|
|
185
|
+
"lastActiveAt": "2026-02-07T10:00:00Z"
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"taskAssignments": {
|
|
189
|
+
"T001": "dev-1",
|
|
190
|
+
"T002": "dev-2"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Teammate 状态
|
|
197
|
+
|
|
198
|
+
| 状态 | 描述 |
|
|
199
|
+
|------|------|
|
|
200
|
+
| `idle` | 空闲,等待任务分配 |
|
|
201
|
+
| `working` | 正在执行任务 |
|
|
202
|
+
| `blocked` | 被依赖阻塞 |
|
|
203
|
+
| `completed` | 所有任务完成 |
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Hook 配置
|
|
208
|
+
|
|
209
|
+
### quality-gates.yml
|
|
210
|
+
|
|
211
|
+
```yaml
|
|
212
|
+
# TeammateIdle Hook 配置
|
|
213
|
+
teammate_idle:
|
|
214
|
+
idle_checks:
|
|
215
|
+
- npm run lint --if-present
|
|
216
|
+
- npm run typecheck --if-present
|
|
217
|
+
assignment_strategy: priority_first
|
|
218
|
+
idle_timeout: 300 # 秒
|
|
219
|
+
|
|
220
|
+
# TaskCompleted Hook 配置
|
|
221
|
+
task_completed:
|
|
222
|
+
verify:
|
|
223
|
+
- npm run lint --if-present
|
|
224
|
+
- npm run typecheck --if-present
|
|
225
|
+
- npm test -- --passWithNoTests
|
|
226
|
+
block_on_failure: true
|
|
227
|
+
max_retries: 3
|
|
228
|
+
|
|
229
|
+
# Ralph Loop Team 模式配置
|
|
230
|
+
ralph_loop:
|
|
231
|
+
team_mode:
|
|
232
|
+
enabled: true
|
|
233
|
+
scope: teammate
|
|
234
|
+
teammate_verify:
|
|
235
|
+
dev-frontend:
|
|
236
|
+
- npm run lint -- --files-changed
|
|
237
|
+
dev-backend:
|
|
238
|
+
- npm test -- --changed
|
|
239
|
+
global_verify:
|
|
240
|
+
- npm run lint
|
|
241
|
+
- npm run typecheck
|
|
242
|
+
- npm test
|
|
243
|
+
max_iterations_per_teammate: 3
|
|
244
|
+
max_global_iterations: 10
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 最佳实践
|
|
250
|
+
|
|
251
|
+
### 1. 任务设计
|
|
252
|
+
|
|
253
|
+
- **独立性**: 每个任务应尽量独立,减少文件冲突
|
|
254
|
+
- **粒度**: 任务粒度适中,不要太大也不要太小
|
|
255
|
+
- **标记**: 正确使用 `[P]` 和 `[US*]` 标记
|
|
256
|
+
|
|
257
|
+
### 2. Agent 数量选择
|
|
258
|
+
|
|
259
|
+
| 任务数 | 推荐 Agent 数 |
|
|
260
|
+
|--------|---------------|
|
|
261
|
+
| 1-5 | 2 |
|
|
262
|
+
| 6-10 | 3 |
|
|
263
|
+
| 11-20 | 4 |
|
|
264
|
+
| 20+ | 5 |
|
|
265
|
+
|
|
266
|
+
### 3. 监控和调试
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
# 查看 Team 状态
|
|
270
|
+
cat devflow/requirements/REQ-123/orchestration_status.json | jq '.team'
|
|
271
|
+
|
|
272
|
+
# 查看任务分配
|
|
273
|
+
cat devflow/requirements/REQ-123/orchestration_status.json | jq '.team.taskAssignments'
|
|
274
|
+
|
|
275
|
+
# 查看执行日志
|
|
276
|
+
tail -f devflow/requirements/REQ-123/EXECUTION_LOG.md
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## 故障排除
|
|
282
|
+
|
|
283
|
+
### 常见问题
|
|
284
|
+
|
|
285
|
+
| 问题 | 原因 | 解决方案 |
|
|
286
|
+
|------|------|----------|
|
|
287
|
+
| Agent 空闲超时 | 任务执行时间过长 | 增加 `idle_timeout` 配置 |
|
|
288
|
+
| 文件冲突频繁 | 任务设计不合理 | 重新设计任务,减少文件重叠 |
|
|
289
|
+
| 验证失败循环 | 代码质量问题 | 检查 ERROR_LOG.md,修复问题 |
|
|
290
|
+
| Team 状态不一致 | 异常退出 | 使用 `/flow:dev --resume` 恢复 |
|
|
291
|
+
|
|
292
|
+
### 紧急停止
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# 停止所有 Agent
|
|
296
|
+
# 1. 清理 Team 状态
|
|
297
|
+
jq '.team = null' orchestration_status.json > tmp.json && mv tmp.json orchestration_status.json
|
|
298
|
+
|
|
299
|
+
# 2. 或使用命令
|
|
300
|
+
/util:cancel-ralph
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## 参考资料
|
|
306
|
+
|
|
307
|
+
- [CLAUDE_TEAM_INTEGRATION_PLAN.md](../../../devflow/CLAUDE_TEAM_INTEGRATION_PLAN.md) - 集成方案
|
|
308
|
+
- [hooks/CLAUDE.md](../../hooks/CLAUDE.md) - Hook 文档
|
|
309
|
+
- [flow-dev.md](../../commands/flow/dev.md) - flow-dev 命令文档
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
**[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
delta_id: "{DELTA_ID}"
|
|
3
|
+
req_id: "{REQ_ID}"
|
|
4
|
+
title: "{TITLE}"
|
|
5
|
+
created_at: "{TIMESTAMP}"
|
|
6
|
+
status: "draft"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Delta: {TITLE}
|
|
10
|
+
|
|
11
|
+
> **[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
12
|
+
|
|
13
|
+
## Summary
|
|
14
|
+
|
|
15
|
+
{简要描述变更内容}
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## ADDED Requirements
|
|
20
|
+
|
|
21
|
+
### Requirement: {Name}
|
|
22
|
+
|
|
23
|
+
{Description}
|
|
24
|
+
|
|
25
|
+
#### Scenario: {Scenario Name}
|
|
26
|
+
|
|
27
|
+
- GIVEN {precondition}
|
|
28
|
+
- WHEN {action}
|
|
29
|
+
- THEN {expected result}
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## MODIFIED Requirements
|
|
34
|
+
|
|
35
|
+
### Requirement: {Name}
|
|
36
|
+
|
|
37
|
+
{New description}
|
|
38
|
+
|
|
39
|
+
(Previously: {old description})
|
|
40
|
+
|
|
41
|
+
#### Scenario: {Scenario Name}
|
|
42
|
+
|
|
43
|
+
- GIVEN {precondition}
|
|
44
|
+
- WHEN {action}
|
|
45
|
+
- THEN {expected result}
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## REMOVED Requirements
|
|
50
|
+
|
|
51
|
+
### Requirement: {Name}
|
|
52
|
+
|
|
53
|
+
**Reason**: {why removed}
|
|
54
|
+
|
|
55
|
+
**Migration**: {how to migrate}
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## RENAMED Requirements
|
|
60
|
+
|
|
61
|
+
- FROM: {Old Name}
|
|
62
|
+
- TO: {New Name}
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Impact Analysis
|
|
67
|
+
|
|
68
|
+
### Affected Files
|
|
69
|
+
|
|
70
|
+
| File | Change Type | Description |
|
|
71
|
+
|------|-------------|-------------|
|
|
72
|
+
| `src/example.ts` | NEW | Example file |
|
|
73
|
+
|
|
74
|
+
### Dependencies
|
|
75
|
+
|
|
76
|
+
- Requires: None
|
|
77
|
+
- Blocks: None
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Verification
|
|
82
|
+
|
|
83
|
+
- [ ] Unit tests added for new functionality
|
|
84
|
+
- [ ] Integration tests updated
|
|
85
|
+
- [ ] Documentation updated
|
|
86
|
+
- [ ] Backward compatibility verified
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
**Author**: {AUTHOR}
|
|
91
|
+
**Reviewed By**: Pending
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Design Decisions Record
|
|
2
|
+
|
|
3
|
+
> [INPUT]: 依赖 team-config.json 的 negotiate_topics 定义
|
|
4
|
+
> [OUTPUT]: 对外提供设计决策记录格式
|
|
5
|
+
> [POS]: templates/ 的 Team 协商决策记录模板,被 flow-spec Team 模式消费
|
|
6
|
+
> [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
req_id: "${REQ_ID}"
|
|
10
|
+
created_at: "${TIMESTAMP}"
|
|
11
|
+
updated_at: "${TIMESTAMP}"
|
|
12
|
+
participants: ["tech-architect", "ui-designer", "planner"]
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Design Decisions for ${REQ_ID}
|
|
16
|
+
|
|
17
|
+
本文档记录 spec-design-team 在设计阶段的共享决策。
|
|
18
|
+
|
|
19
|
+
## Decision Log
|
|
20
|
+
|
|
21
|
+
<!-- 每个决策按以下格式记录 -->
|
|
22
|
+
|
|
23
|
+
### DD-001: API 响应格式
|
|
24
|
+
|
|
25
|
+
**Topic ID**: `api_format`
|
|
26
|
+
**Decision Owner**: tech-architect
|
|
27
|
+
**Participants**: tech-architect, ui-designer
|
|
28
|
+
**Status**: approved | pending | rejected
|
|
29
|
+
|
|
30
|
+
**Context**:
|
|
31
|
+
描述决策背景和需要解决的问题。
|
|
32
|
+
|
|
33
|
+
**Decision**:
|
|
34
|
+
最终决策内容。
|
|
35
|
+
|
|
36
|
+
**Rationale**:
|
|
37
|
+
选择该方案的原因。
|
|
38
|
+
|
|
39
|
+
**Alternatives Considered**:
|
|
40
|
+
1. 方案 A - 原因
|
|
41
|
+
2. 方案 B - 原因
|
|
42
|
+
|
|
43
|
+
**Impact**:
|
|
44
|
+
- 前端: 影响描述
|
|
45
|
+
- 后端: 影响描述
|
|
46
|
+
|
|
47
|
+
**Timestamp**: ${TIMESTAMP}
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### DD-002: 数据字段命名
|
|
52
|
+
|
|
53
|
+
**Topic ID**: `field_naming`
|
|
54
|
+
**Decision Owner**: tech-architect
|
|
55
|
+
**Participants**: tech-architect, ui-designer, planner
|
|
56
|
+
**Status**: approved | pending | rejected
|
|
57
|
+
|
|
58
|
+
**Context**:
|
|
59
|
+
统一数据字段命名规范,确保前后端一致。
|
|
60
|
+
|
|
61
|
+
**Decision**:
|
|
62
|
+
- 命名风格: camelCase / snake_case
|
|
63
|
+
- 关键字段映射表
|
|
64
|
+
|
|
65
|
+
**Rationale**:
|
|
66
|
+
选择该方案的原因。
|
|
67
|
+
|
|
68
|
+
**Timestamp**: ${TIMESTAMP}
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### DD-003: 认证策略
|
|
73
|
+
|
|
74
|
+
**Topic ID**: `auth_strategy`
|
|
75
|
+
**Decision Owner**: tech-architect
|
|
76
|
+
**Participants**: tech-architect, ui-designer
|
|
77
|
+
**Status**: approved | pending | rejected
|
|
78
|
+
|
|
79
|
+
**Context**:
|
|
80
|
+
确定认证方案。
|
|
81
|
+
|
|
82
|
+
**Decision**:
|
|
83
|
+
- 认证方式: JWT / Session / OAuth
|
|
84
|
+
- Token 存储: localStorage / httpOnly cookie
|
|
85
|
+
- 刷新策略: 描述
|
|
86
|
+
|
|
87
|
+
**Rationale**:
|
|
88
|
+
选择该方案的原因。
|
|
89
|
+
|
|
90
|
+
**Timestamp**: ${TIMESTAMP}
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### DD-004: 状态管理方案
|
|
95
|
+
|
|
96
|
+
**Topic ID**: `state_management`
|
|
97
|
+
**Decision Owner**: ui-designer
|
|
98
|
+
**Participants**: tech-architect, ui-designer
|
|
99
|
+
**Status**: approved | pending | rejected
|
|
100
|
+
|
|
101
|
+
**Context**:
|
|
102
|
+
确定前端状态管理方案。
|
|
103
|
+
|
|
104
|
+
**Decision**:
|
|
105
|
+
- 方案: Redux / Context / Zustand / Jotai
|
|
106
|
+
- 全局状态: 列表
|
|
107
|
+
- 本地状态: 列表
|
|
108
|
+
|
|
109
|
+
**Rationale**:
|
|
110
|
+
选择该方案的原因。
|
|
111
|
+
|
|
112
|
+
**Timestamp**: ${TIMESTAMP}
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### DD-005: 组件粒度
|
|
117
|
+
|
|
118
|
+
**Topic ID**: `component_granularity`
|
|
119
|
+
**Decision Owner**: ui-designer
|
|
120
|
+
**Participants**: ui-designer, planner
|
|
121
|
+
**Status**: approved | pending | rejected
|
|
122
|
+
|
|
123
|
+
**Context**:
|
|
124
|
+
确定 UI 组件拆分粒度,影响任务分解。
|
|
125
|
+
|
|
126
|
+
**Decision**:
|
|
127
|
+
- 组件列表及复杂度评估
|
|
128
|
+
- 每个组件预估时间
|
|
129
|
+
|
|
130
|
+
**Rationale**:
|
|
131
|
+
选择该方案的原因。
|
|
132
|
+
|
|
133
|
+
**Timestamp**: ${TIMESTAMP}
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Summary
|
|
138
|
+
|
|
139
|
+
| Topic | Decision | Owner | Status |
|
|
140
|
+
|-------|----------|-------|--------|
|
|
141
|
+
| api_format | | tech-architect | |
|
|
142
|
+
| field_naming | | tech-architect | |
|
|
143
|
+
| auth_strategy | | tech-architect | |
|
|
144
|
+
| state_management | | ui-designer | |
|
|
145
|
+
| component_granularity | | ui-designer | |
|
|
146
|
+
|
|
147
|
+
## Changelog
|
|
148
|
+
|
|
149
|
+
| Date | Topic | Change | By |
|
|
150
|
+
|------|-------|--------|-----|
|
|
151
|
+
| ${TIMESTAMP} | - | Initial creation | spec-lead |
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
developer: "{DEVELOPER}"
|
|
3
|
+
journal_number: 1
|
|
4
|
+
created_at: "{TIMESTAMP}"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Developer Journal: {DEVELOPER}
|
|
8
|
+
|
|
9
|
+
> **[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## [{DATE} {TIME}] Session Start
|
|
14
|
+
|
|
15
|
+
**REQ**: {REQ_ID}
|
|
16
|
+
**Phase**: {PHASE}
|
|
17
|
+
**Task**: {TASK_ID}
|
|
18
|
+
|
|
19
|
+
### Context Recovery
|
|
20
|
+
|
|
21
|
+
Previous session ended at:
|
|
22
|
+
- Last completed task: {LAST_TASK}
|
|
23
|
+
- Current blockers: {BLOCKERS}
|
|
24
|
+
- Open questions: {QUESTIONS}
|
|
25
|
+
|
|
26
|
+
### Session Goals
|
|
27
|
+
|
|
28
|
+
1. Goal 1
|
|
29
|
+
2. Goal 2
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## [{DATE} {TIME}] Progress Update
|
|
34
|
+
|
|
35
|
+
### Completed
|
|
36
|
+
|
|
37
|
+
- [x] Task description
|
|
38
|
+
|
|
39
|
+
### In Progress
|
|
40
|
+
|
|
41
|
+
- [ ] Current task
|
|
42
|
+
|
|
43
|
+
### Blockers
|
|
44
|
+
|
|
45
|
+
- None
|
|
46
|
+
|
|
47
|
+
### Notes
|
|
48
|
+
|
|
49
|
+
- Important observation
|
|
50
|
+
- Decision made
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## [{DATE} {TIME}] Session End
|
|
55
|
+
|
|
56
|
+
### Summary
|
|
57
|
+
|
|
58
|
+
Brief summary of what was accomplished.
|
|
59
|
+
|
|
60
|
+
### Handoff Notes
|
|
61
|
+
|
|
62
|
+
For next session:
|
|
63
|
+
- Continue with: {NEXT_TASK}
|
|
64
|
+
- Watch out for: {WARNINGS}
|
|
65
|
+
- Questions to resolve: {QUESTIONS}
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
<!--
|
|
70
|
+
Journal Guidelines:
|
|
71
|
+
- Max 2000 lines per file
|
|
72
|
+
- When approaching limit, create journal-{N+1}.md
|
|
73
|
+
- Keep entries concise but informative
|
|
74
|
+
- Focus on decisions and blockers, not routine progress
|
|
75
|
+
-->
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# _shared/ - Shared Template Components
|
|
2
|
+
|
|
3
|
+
> L2 | 父级: `.claude/docs/templates/CLAUDE.md`
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Reusable template components extracted from PRD/EPIC/TECH_DESIGN/UI_PROTOTYPE templates to reduce duplication and ensure consistency.
|
|
8
|
+
|
|
9
|
+
## Members
|
|
10
|
+
|
|
11
|
+
| File | Purpose | Lines | Used By |
|
|
12
|
+
|------|---------|-------|---------|
|
|
13
|
+
| `CONSTITUTION_CHECK.md` | Constitution compliance check section | ~150 | PRD, EPIC, TECH_DESIGN |
|
|
14
|
+
| `VALIDATION_CHECKLIST.md` | Validation checklist patterns | ~100 | All templates |
|
|
15
|
+
| `YAML_FRONTMATTER.md` | YAML frontmatter patterns | ~50 | All templates |
|
|
16
|
+
|
|
17
|
+
## Usage Pattern
|
|
18
|
+
|
|
19
|
+
Templates reference these components via include syntax:
|
|
20
|
+
```markdown
|
|
21
|
+
{{INCLUDE: _shared/CONSTITUTION_CHECK.md}}
|
|
22
|
+
{{INCLUDE: _shared/VALIDATION_CHECKLIST.md#prd}}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or copy relevant sections based on document type.
|
|
26
|
+
|
|
27
|
+
## Design Principles
|
|
28
|
+
|
|
29
|
+
1. **DRY**: Extract repeated content once, reference everywhere
|
|
30
|
+
2. **Consistency**: Single source of truth for Constitution checks
|
|
31
|
+
3. **Modularity**: Each component is self-contained
|
|
32
|
+
4. **Versioned**: Components track Constitution version
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
[PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|