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,545 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-spec
|
|
3
|
+
description: 'Unified specification phase: PRD → Tech+UI (parallel) → Epic/Tasks. Usage: /flow-spec "REQ-123" [--skip-tech] [--skip-ui]'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flow-Spec Skill
|
|
7
|
+
|
|
8
|
+
> [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
|
+
统一规格阶段,合并 flow-prd/flow-tech/flow-ui/flow-epic 为单一命令,内部并行调度 Agent。
|
|
13
|
+
|
|
14
|
+
## Input Format
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Full Mode (默认)
|
|
18
|
+
/flow-spec "REQ_ID"
|
|
19
|
+
|
|
20
|
+
# Quick Mode (小需求)
|
|
21
|
+
/flow-spec "REQ_ID" --skip-tech --skip-ui
|
|
22
|
+
|
|
23
|
+
# Backend Only
|
|
24
|
+
/flow-spec "REQ_ID" --skip-ui
|
|
25
|
+
|
|
26
|
+
# Frontend Only
|
|
27
|
+
/flow-spec "REQ_ID" --skip-tech
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Mode Matrix
|
|
31
|
+
|
|
32
|
+
| Mode | Command | Agents | Execution |
|
|
33
|
+
|------|---------|--------|-----------|
|
|
34
|
+
| Full | `/flow-spec` | PRD + Tech + UI + Epic | **Team Mode** (v4.7) |
|
|
35
|
+
| Quick | `--skip-tech --skip-ui` | PRD + Epic | Subagent Mode |
|
|
36
|
+
| Backend | `--skip-ui` | PRD + Tech + Epic | Subagent Mode |
|
|
37
|
+
| Frontend | `--skip-tech` | PRD + UI + Epic | Subagent Mode |
|
|
38
|
+
|
|
39
|
+
## Execution Mode Detection (v4.7)
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
Mode Detection:
|
|
43
|
+
if (--skip-tech OR --skip-ui):
|
|
44
|
+
mode: subagent # 简单模式,无需协商
|
|
45
|
+
else:
|
|
46
|
+
mode: team # Full Mode,需要协商
|
|
47
|
+
|
|
48
|
+
Team Mode Benefits:
|
|
49
|
+
- tech-architect 和 ui-designer 可实时协商
|
|
50
|
+
- 解决 API 格式、字段命名等共享决策
|
|
51
|
+
- 减少返工率 ~60%
|
|
52
|
+
|
|
53
|
+
Script: scripts/team-init.sh detect [skip_tech] [skip_ui]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Entry Gate
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
Prerequisites:
|
|
60
|
+
1. REQ_ID 解析:
|
|
61
|
+
- 从参数获取
|
|
62
|
+
- 或从当前分支推断 (feature/REQ-XXX-*)
|
|
63
|
+
- 或从 orchestration_status.json 获取
|
|
64
|
+
|
|
65
|
+
2. BRAINSTORM.md 存在:
|
|
66
|
+
- 路径: devflow/requirements/${REQ_ID}/BRAINSTORM.md
|
|
67
|
+
- 必须包含: 需求描述、目标用户、核心功能
|
|
68
|
+
|
|
69
|
+
3. Research 完成:
|
|
70
|
+
- 路径: devflow/requirements/${REQ_ID}/research/research.md
|
|
71
|
+
- 无 TODO/PLACEHOLDER
|
|
72
|
+
|
|
73
|
+
4. Status Check:
|
|
74
|
+
- orchestration_status.status ∈ {"initialized", "spec_failed"}
|
|
75
|
+
|
|
76
|
+
5. Constitution Gate:
|
|
77
|
+
- 读取 BRAINSTORM.md 验证需求边界
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Execution Flow
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
84
|
+
│ ENTRY GATE │
|
|
85
|
+
│ REQ_ID → BRAINSTORM.md → research.md → Status Check │
|
|
86
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
87
|
+
│
|
|
88
|
+
▼
|
|
89
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
90
|
+
│ STAGE 1: PRD Generation │
|
|
91
|
+
│ Agent: prd-writer │
|
|
92
|
+
│ Output: PRD.md │
|
|
93
|
+
│ Rules: ANTI-EXPANSION, INVEST, [NEEDS CLARIFICATION] │
|
|
94
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
95
|
+
│
|
|
96
|
+
▼
|
|
97
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
98
|
+
│ STAGE 2: Parallel Execution │
|
|
99
|
+
│ │
|
|
100
|
+
│ ┌─────────────────────┐ ┌─────────────────────┐ │
|
|
101
|
+
│ │ tech-architect │ │ ui-designer │ │
|
|
102
|
+
│ │ (if !--skip-tech) │ │ (if !--skip-ui) │ │
|
|
103
|
+
│ │ │ │ │ │
|
|
104
|
+
│ │ Output: │ │ Output: │ │
|
|
105
|
+
│ │ - TECH_DESIGN.md │ │ - UI_PROTOTYPE.html│ │
|
|
106
|
+
│ │ - data-model.md │ │ - ui_design_ │ │
|
|
107
|
+
│ │ - contracts/ │ │ strategy.md │ │
|
|
108
|
+
│ └─────────────────────┘ └─────────────────────┘ │
|
|
109
|
+
│ │
|
|
110
|
+
│ Parallel: Both agents run simultaneously via Task tool │
|
|
111
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
112
|
+
│
|
|
113
|
+
▼
|
|
114
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
115
|
+
│ STAGE 3: Epic Generation │
|
|
116
|
+
│ Agent: planner │
|
|
117
|
+
│ Input: PRD.md + TECH_DESIGN.md (optional) + UI_PROTOTYPE.html │
|
|
118
|
+
│ Output: EPIC.md + TASKS.md │
|
|
119
|
+
│ Rules: TDD Order, Bite-Sized Tasks, Phase -1 Gates │
|
|
120
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
121
|
+
│
|
|
122
|
+
▼
|
|
123
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
124
|
+
│ EXIT GATE │
|
|
125
|
+
│ 1. PRD.md exists, no {{PLACEHOLDER}} │
|
|
126
|
+
│ 2. TECH_DESIGN.md exists (if not skipped) │
|
|
127
|
+
│ 3. UI_PROTOTYPE.html exists (if not skipped) │
|
|
128
|
+
│ 4. EPIC.md exists │
|
|
129
|
+
│ 5. TASKS.md exists, TDD order correct │
|
|
130
|
+
│ 6. Status: spec_complete │
|
|
131
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Stage Details
|
|
135
|
+
|
|
136
|
+
### Stage 1: PRD Generation
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
Agent: prd-writer (research-type)
|
|
140
|
+
Input:
|
|
141
|
+
- BRAINSTORM.md
|
|
142
|
+
- research/research.md
|
|
143
|
+
- research/internal/codebase-overview.md
|
|
144
|
+
|
|
145
|
+
Output:
|
|
146
|
+
- PRD.md
|
|
147
|
+
|
|
148
|
+
Rules:
|
|
149
|
+
- ANTI-EXPANSION: 未提及 → [NEEDS CLARIFICATION]
|
|
150
|
+
- NO TECH DETAILS: 只关注 WHAT/WHY
|
|
151
|
+
- STORY INDEPENDENCE: 每个故事有独立测试
|
|
152
|
+
- PRIORITY MANDATORY: P1, P2, P3...
|
|
153
|
+
- MVP IDENTIFICATION: P1 = MVP
|
|
154
|
+
|
|
155
|
+
Validation:
|
|
156
|
+
- 无 {{PLACEHOLDER}}
|
|
157
|
+
- 所有故事有验收标准
|
|
158
|
+
- Constitution Check 通过
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Stage 2: Parallel Execution
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
# =============================================================================
|
|
165
|
+
# Team Mode (Full Mode, v4.7)
|
|
166
|
+
# =============================================================================
|
|
167
|
+
Team Mode:
|
|
168
|
+
Condition: !--skip-tech AND !--skip-ui
|
|
169
|
+
|
|
170
|
+
Team: spec-design-team
|
|
171
|
+
Lead: spec-lead (main agent)
|
|
172
|
+
Teammates:
|
|
173
|
+
- tech-architect: 技术设计
|
|
174
|
+
- ui-designer: UI 原型
|
|
175
|
+
|
|
176
|
+
# ---------------------------------------------------------------------------
|
|
177
|
+
# Team Mode Execution Steps (详细)
|
|
178
|
+
# ---------------------------------------------------------------------------
|
|
179
|
+
Execution Steps:
|
|
180
|
+
|
|
181
|
+
Step 1 - 初始化 Team:
|
|
182
|
+
Action: 调用 scripts/team-init.sh init
|
|
183
|
+
Result: 创建 spec-design-team,设置 lead 为当前 agent
|
|
184
|
+
State Update: orchestration_status.team.mode = "parallel"
|
|
185
|
+
|
|
186
|
+
Step 2 - Spawn Teammates:
|
|
187
|
+
Action: 使用 Task tool 并行 spawn 两个 agent
|
|
188
|
+
Parallel:
|
|
189
|
+
- Task: tech-architect
|
|
190
|
+
Agent: flow-tech/references/tech-architect.md
|
|
191
|
+
Input: PRD.md, research/codebase-overview.md
|
|
192
|
+
Output: TECH_DESIGN.md, data-model.md, contracts/
|
|
193
|
+
|
|
194
|
+
- Task: ui-designer
|
|
195
|
+
Agent: flow-ui/references/ui-designer.md
|
|
196
|
+
Input: PRD.md, STYLE.md (optional)
|
|
197
|
+
Output: UI_PROTOTYPE.html, ui_design_strategy.md
|
|
198
|
+
|
|
199
|
+
Step 3 - 协商协议 (SendMessage):
|
|
200
|
+
Trigger: tech-architect 完成初稿后发起
|
|
201
|
+
Protocol: Direct Message via SendMessage tool
|
|
202
|
+
Topics:
|
|
203
|
+
- api_format: API 响应格式
|
|
204
|
+
- field_naming: 数据字段命名
|
|
205
|
+
- auth_strategy: 认证策略
|
|
206
|
+
- state_management: 前端状态管理
|
|
207
|
+
Output: design_decisions.md (协商结果记录)
|
|
208
|
+
|
|
209
|
+
Step 4 - 等待完成:
|
|
210
|
+
Mechanism: 监听 TeammateIdle 事件
|
|
211
|
+
Condition: 两者都完成后进入 Stage 3
|
|
212
|
+
Timeout: 30 minutes (可配置)
|
|
213
|
+
|
|
214
|
+
Step 5 - 清理 Team:
|
|
215
|
+
Action: 发送 shutdown_request 给 teammates
|
|
216
|
+
Cleanup: 调用 TeamDelete 清理 Team 状态
|
|
217
|
+
|
|
218
|
+
# ---------------------------------------------------------------------------
|
|
219
|
+
# SendMessage 协商协议 (v4.7)
|
|
220
|
+
# ---------------------------------------------------------------------------
|
|
221
|
+
Negotiate Protocol:
|
|
222
|
+
|
|
223
|
+
# -------------------------------------------------------------------------
|
|
224
|
+
# Topic 1: API Format 协商
|
|
225
|
+
# -------------------------------------------------------------------------
|
|
226
|
+
api_format:
|
|
227
|
+
Initiator: tech-architect
|
|
228
|
+
Responder: ui-designer
|
|
229
|
+
Decision Owner: tech-architect
|
|
230
|
+
|
|
231
|
+
Message Flow:
|
|
232
|
+
1. tech-architect → ui-designer:
|
|
233
|
+
SendMessage:
|
|
234
|
+
type: "message"
|
|
235
|
+
recipient: "ui-designer"
|
|
236
|
+
content: |
|
|
237
|
+
API 响应格式建议采用 REST + JSON。
|
|
238
|
+
- 分页: cursor-based (nextCursor 字段)
|
|
239
|
+
- 错误格式: { code, message, details }
|
|
240
|
+
- 时间格式: ISO 8601
|
|
241
|
+
请确认是否与前端需求一致。
|
|
242
|
+
summary: "API 格式协商请求"
|
|
243
|
+
|
|
244
|
+
2. ui-designer → tech-architect:
|
|
245
|
+
SendMessage:
|
|
246
|
+
type: "message"
|
|
247
|
+
recipient: "tech-architect"
|
|
248
|
+
content: |
|
|
249
|
+
确认 REST + JSON 格式。
|
|
250
|
+
建议补充:
|
|
251
|
+
- 分页响应包含 hasMore 字段便于前端判断
|
|
252
|
+
- 列表接口支持 limit 参数 (默认 20)
|
|
253
|
+
summary: "API 格式确认 + 补充建议"
|
|
254
|
+
|
|
255
|
+
3. tech-architect 更新 TECH_DESIGN.md 并记录到 design_decisions.md
|
|
256
|
+
|
|
257
|
+
# -------------------------------------------------------------------------
|
|
258
|
+
# Topic 2: Field Naming 协商
|
|
259
|
+
# -------------------------------------------------------------------------
|
|
260
|
+
field_naming:
|
|
261
|
+
Initiator: tech-architect
|
|
262
|
+
Responder: ui-designer
|
|
263
|
+
Decision Owner: tech-architect
|
|
264
|
+
|
|
265
|
+
Message Flow:
|
|
266
|
+
1. tech-architect → ui-designer:
|
|
267
|
+
SendMessage:
|
|
268
|
+
type: "message"
|
|
269
|
+
recipient: "ui-designer"
|
|
270
|
+
content: |
|
|
271
|
+
数据模型字段命名规范建议:
|
|
272
|
+
- API 响应: camelCase (userId, createdAt)
|
|
273
|
+
- 数据库: snake_case (user_id, created_at)
|
|
274
|
+
- 前端 props: camelCase
|
|
275
|
+
核心实体字段: id, name, status, createdAt, updatedAt
|
|
276
|
+
请确认是否与 UI 组件 props 一致。
|
|
277
|
+
summary: "字段命名规范协商"
|
|
278
|
+
|
|
279
|
+
2. ui-designer → tech-architect:
|
|
280
|
+
SendMessage:
|
|
281
|
+
type: "message"
|
|
282
|
+
recipient: "tech-architect"
|
|
283
|
+
content: |
|
|
284
|
+
确认 camelCase 命名。
|
|
285
|
+
UI 组件需要的额外字段:
|
|
286
|
+
- displayName (用于展示)
|
|
287
|
+
- isActive (布尔状态)
|
|
288
|
+
- avatarUrl (头像链接)
|
|
289
|
+
summary: "字段命名确认"
|
|
290
|
+
|
|
291
|
+
# -------------------------------------------------------------------------
|
|
292
|
+
# Topic 3: Auth Strategy 协商
|
|
293
|
+
# -------------------------------------------------------------------------
|
|
294
|
+
auth_strategy:
|
|
295
|
+
Initiator: tech-architect
|
|
296
|
+
Responder: ui-designer
|
|
297
|
+
Decision Owner: tech-architect
|
|
298
|
+
|
|
299
|
+
Message Flow:
|
|
300
|
+
1. tech-architect → ui-designer:
|
|
301
|
+
SendMessage:
|
|
302
|
+
type: "message"
|
|
303
|
+
recipient: "ui-designer"
|
|
304
|
+
content: |
|
|
305
|
+
认证策略建议采用 JWT:
|
|
306
|
+
- Access Token: 15 分钟过期
|
|
307
|
+
- Refresh Token: 7 天过期
|
|
308
|
+
- 存储: httpOnly cookie (推荐) 或 localStorage
|
|
309
|
+
前端需要处理 token 刷新逻辑。
|
|
310
|
+
summary: "认证策略协商"
|
|
311
|
+
|
|
312
|
+
2. ui-designer → tech-architect:
|
|
313
|
+
SendMessage:
|
|
314
|
+
type: "message"
|
|
315
|
+
recipient: "tech-architect"
|
|
316
|
+
content: |
|
|
317
|
+
确认 JWT 方案。
|
|
318
|
+
前端实现:
|
|
319
|
+
- 使用 axios interceptor 自动刷新
|
|
320
|
+
- 401 响应触发 refresh 流程
|
|
321
|
+
- refresh 失败跳转登录页
|
|
322
|
+
summary: "认证策略确认"
|
|
323
|
+
|
|
324
|
+
# -------------------------------------------------------------------------
|
|
325
|
+
# Topic 4: State Management 协商
|
|
326
|
+
# -------------------------------------------------------------------------
|
|
327
|
+
state_management:
|
|
328
|
+
Initiator: ui-designer
|
|
329
|
+
Responder: tech-architect
|
|
330
|
+
Decision Owner: ui-designer
|
|
331
|
+
|
|
332
|
+
Message Flow:
|
|
333
|
+
1. ui-designer → tech-architect:
|
|
334
|
+
SendMessage:
|
|
335
|
+
type: "message"
|
|
336
|
+
recipient: "tech-architect"
|
|
337
|
+
content: |
|
|
338
|
+
前端状态管理建议采用 Zustand:
|
|
339
|
+
- 全局状态: user, theme, notifications
|
|
340
|
+
- 服务端状态: 使用 React Query 管理
|
|
341
|
+
- 表单状态: 组件内部 useState
|
|
342
|
+
API 缓存策略需要后端支持 ETag 或 Last-Modified。
|
|
343
|
+
summary: "状态管理方案协商"
|
|
344
|
+
|
|
345
|
+
2. tech-architect → ui-designer:
|
|
346
|
+
SendMessage:
|
|
347
|
+
type: "message"
|
|
348
|
+
recipient: "ui-designer"
|
|
349
|
+
content: |
|
|
350
|
+
确认 Zustand + React Query 方案。
|
|
351
|
+
后端支持:
|
|
352
|
+
- 列表接口返回 ETag header
|
|
353
|
+
- 详情接口返回 Last-Modified
|
|
354
|
+
- 支持 If-None-Match 条件请求
|
|
355
|
+
summary: "状态管理确认"
|
|
356
|
+
|
|
357
|
+
# ---------------------------------------------------------------------------
|
|
358
|
+
# 协商结果记录
|
|
359
|
+
# ---------------------------------------------------------------------------
|
|
360
|
+
Decision Record:
|
|
361
|
+
Path: devflow/requirements/${REQ_ID}/research/design_decisions.md
|
|
362
|
+
Format: |
|
|
363
|
+
# Design Decisions
|
|
364
|
+
|
|
365
|
+
> 由 spec-design-team 协商生成
|
|
366
|
+
> 生成时间: ${TIMESTAMP}
|
|
367
|
+
|
|
368
|
+
## API Format
|
|
369
|
+
**决策**: REST + JSON, cursor-based pagination
|
|
370
|
+
**参与者**: tech-architect, ui-designer
|
|
371
|
+
**原因**: 前后端一致性,便于缓存
|
|
372
|
+
|
|
373
|
+
## Field Naming
|
|
374
|
+
**决策**: camelCase for API, snake_case for DB
|
|
375
|
+
**参与者**: tech-architect, ui-designer
|
|
376
|
+
**原因**: 行业标准,前端友好
|
|
377
|
+
|
|
378
|
+
## Auth Strategy
|
|
379
|
+
**决策**: JWT with refresh token
|
|
380
|
+
**参与者**: tech-architect, ui-designer
|
|
381
|
+
**原因**: 无状态,可扩展
|
|
382
|
+
|
|
383
|
+
## State Management
|
|
384
|
+
**决策**: Zustand + React Query
|
|
385
|
+
**参与者**: ui-designer, tech-architect
|
|
386
|
+
**原因**: 轻量级,服务端状态分离
|
|
387
|
+
|
|
388
|
+
Negotiate Topics:
|
|
389
|
+
- api_format: API 响应格式 (REST/GraphQL)
|
|
390
|
+
- field_naming: 数据字段命名规范
|
|
391
|
+
- auth_strategy: 认证策略
|
|
392
|
+
- state_management: 前端状态管理
|
|
393
|
+
|
|
394
|
+
# =============================================================================
|
|
395
|
+
# Subagent Mode (Simplified Modes)
|
|
396
|
+
# =============================================================================
|
|
397
|
+
Subagent Mode:
|
|
398
|
+
Condition: --skip-tech OR --skip-ui
|
|
399
|
+
|
|
400
|
+
Parallel Agents:
|
|
401
|
+
tech-architect:
|
|
402
|
+
Condition: !--skip-tech
|
|
403
|
+
Input: PRD.md, research/codebase-overview.md
|
|
404
|
+
Output: TECH_DESIGN.md, data-model.md, contracts/
|
|
405
|
+
Rules:
|
|
406
|
+
- ANTI-TECH-CREEP: 复用 baseline 技术栈
|
|
407
|
+
- Simplicity Gate: ≤3 栈层
|
|
408
|
+
- Integration-First: 契约先定义
|
|
409
|
+
|
|
410
|
+
ui-designer:
|
|
411
|
+
Condition: !--skip-ui AND PRD 含 UI 关键词
|
|
412
|
+
Input: PRD.md, STYLE.md (optional)
|
|
413
|
+
Output: UI_PROTOTYPE.html, ui_design_strategy.md
|
|
414
|
+
Rules:
|
|
415
|
+
- ANTI-GENERIC-DESIGN: 无占位图/AI紫蓝
|
|
416
|
+
- 响应式: 3 断点
|
|
417
|
+
- 交互完整: 所有状态
|
|
418
|
+
|
|
419
|
+
Execution:
|
|
420
|
+
- 使用 Task tool 并行调用 agent
|
|
421
|
+
- 等待完成后进入 Stage 3
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Stage 3: Epic Generation
|
|
425
|
+
|
|
426
|
+
```yaml
|
|
427
|
+
Agent: planner (research-type)
|
|
428
|
+
Input:
|
|
429
|
+
- PRD.md
|
|
430
|
+
- TECH_DESIGN.md (if exists)
|
|
431
|
+
- UI_PROTOTYPE.html (if exists)
|
|
432
|
+
|
|
433
|
+
Output:
|
|
434
|
+
- EPIC.md
|
|
435
|
+
- TASKS.md
|
|
436
|
+
|
|
437
|
+
Rules:
|
|
438
|
+
- TDD Order: Phase 2 (Tests) → Phase 3 (Implementation)
|
|
439
|
+
- Bite-Sized Tasks: 每个 step 2-5 分钟
|
|
440
|
+
- Phase -1 Gates: Simplicity, Anti-Abstraction, Integration-First
|
|
441
|
+
- UI Integration: 如有 UI_PROTOTYPE.html,提取组件清单
|
|
442
|
+
|
|
443
|
+
Validation:
|
|
444
|
+
- EPIC.md 无 {{PLACEHOLDER}}
|
|
445
|
+
- TASKS.md TDD 顺序正确
|
|
446
|
+
- Constitution Check 通过
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
## Exit Gate
|
|
450
|
+
|
|
451
|
+
```yaml
|
|
452
|
+
File Checks:
|
|
453
|
+
- [ ] PRD.md exists, no {{PLACEHOLDER}}
|
|
454
|
+
- [ ] TECH_DESIGN.md exists (if !--skip-tech)
|
|
455
|
+
- [ ] UI_PROTOTYPE.html exists (if !--skip-ui AND UI detected)
|
|
456
|
+
- [ ] EPIC.md exists, no {{PLACEHOLDER}}
|
|
457
|
+
- [ ] TASKS.md exists, TDD order correct
|
|
458
|
+
|
|
459
|
+
Quality Checks:
|
|
460
|
+
- [ ] PRD: ANTI-EXPANSION rules passed
|
|
461
|
+
- [ ] TECH: ANTI-TECH-CREEP rules passed (if applicable)
|
|
462
|
+
- [ ] UI: ANTI-GENERIC-DESIGN rules passed (if applicable)
|
|
463
|
+
- [ ] EPIC: Phase -1 Gates passed
|
|
464
|
+
|
|
465
|
+
Status Update:
|
|
466
|
+
- orchestration_status.status = "spec_complete"
|
|
467
|
+
- orchestration_status.phase = "spec"
|
|
468
|
+
- orchestration_status.outputs = [list of generated files]
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
## Output Structure
|
|
472
|
+
|
|
473
|
+
```
|
|
474
|
+
devflow/requirements/${REQ_ID}/
|
|
475
|
+
├── PRD.md # Always
|
|
476
|
+
├── TECH_DESIGN.md # If !--skip-tech
|
|
477
|
+
├── data-model.md # If !--skip-tech
|
|
478
|
+
├── contracts/ # If !--skip-tech
|
|
479
|
+
│ └── openapi.yaml
|
|
480
|
+
├── quickstart.md # If !--skip-tech
|
|
481
|
+
├── UI_PROTOTYPE.html # If !--skip-ui AND UI detected
|
|
482
|
+
├── EPIC.md # Always
|
|
483
|
+
├── TASKS.md # Always
|
|
484
|
+
├── research/
|
|
485
|
+
│ ├── research.md # Pre-existing
|
|
486
|
+
│ ├── codebase-tech-analysis.md # If !--skip-tech
|
|
487
|
+
│ └── ui_design_strategy.md # If !--skip-ui
|
|
488
|
+
└── orchestration_status.json # Updated
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
## Error Handling
|
|
492
|
+
|
|
493
|
+
```yaml
|
|
494
|
+
Stage 1 Failure (PRD):
|
|
495
|
+
- Log error to EXECUTION_LOG.md
|
|
496
|
+
- Status: spec_failed
|
|
497
|
+
- Retry: /flow-spec --retry
|
|
498
|
+
|
|
499
|
+
Stage 2 Failure (Tech/UI):
|
|
500
|
+
- If tech-architect fails: Continue with UI, mark tech as skipped
|
|
501
|
+
- If ui-designer fails: Continue without UI, mark ui as skipped
|
|
502
|
+
- Log partial completion
|
|
503
|
+
|
|
504
|
+
Stage 3 Failure (Epic):
|
|
505
|
+
- Log error to EXECUTION_LOG.md
|
|
506
|
+
- Status: spec_failed
|
|
507
|
+
- Retry: /flow-spec --retry --from=epic
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
## Backward Compatibility
|
|
511
|
+
|
|
512
|
+
旧命令仍可用,但显示 deprecation warning:
|
|
513
|
+
|
|
514
|
+
```bash
|
|
515
|
+
/flow-prd "REQ-123" # ⚠️ Deprecated: Use /flow-spec instead
|
|
516
|
+
/flow-tech "REQ-123" # ⚠️ Deprecated: Use /flow-spec instead
|
|
517
|
+
/flow-ui "REQ-123" # ⚠️ Deprecated: Use /flow-spec instead
|
|
518
|
+
/flow-epic "REQ-123" # ⚠️ Deprecated: Use /flow-spec instead
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
## Next Step
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
/flow-dev "${REQ_ID}"
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
## Agent References
|
|
528
|
+
|
|
529
|
+
| Agent | Purpose | Location |
|
|
530
|
+
|-------|---------|----------|
|
|
531
|
+
| prd-writer | PRD 生成 | `flow-prd/references/prd-writer.md` |
|
|
532
|
+
| tech-architect | 技术设计 | `flow-tech/references/tech-architect.md` |
|
|
533
|
+
| ui-designer | UI 原型 | `flow-ui/references/ui-designer.md` |
|
|
534
|
+
| planner | Epic/Tasks | `flow-epic/references/planner.md` |
|
|
535
|
+
|
|
536
|
+
## Constitution Compliance
|
|
537
|
+
|
|
538
|
+
- **Article I**: Complete implementation, no placeholders
|
|
539
|
+
- **Article II**: Reuse existing components
|
|
540
|
+
- **Article III**: No hardcoded secrets
|
|
541
|
+
- **Article VI**: TDD order enforced
|
|
542
|
+
- **Article VII**: Simplicity Gate
|
|
543
|
+
- **Article VIII**: Anti-Abstraction Gate
|
|
544
|
+
- **Article IX**: Integration-First Gate
|
|
545
|
+
- **Article X**: Requirement boundary enforced
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{"file": "devflow/requirements/{REQ}/BRAINSTORM.md", "reason": "Original intent and requirements"}
|
|
2
|
+
{"file": "devflow/requirements/{REQ}/research/research.md", "reason": "Research findings"}
|
|
3
|
+
{"file": "devflow/requirements/{REQ}/research/internal/codebase-overview.md", "reason": "Codebase analysis", "optional": true}
|
|
4
|
+
{"file": "devflow/spec/frontend/index.md", "reason": "Frontend conventions", "optional": true}
|
|
5
|
+
{"file": "devflow/spec/backend/index.md", "reason": "Backend conventions", "optional": true}
|
|
6
|
+
{"file": "devflow/STYLE.md", "reason": "Design style guide", "optional": true}
|
|
7
|
+
{"file": "CLAUDE.md", "reason": "Tech stack baseline"}
|