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
|
@@ -1,50 +1,196 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* T001: Platform Configuration Registry
|
|
2
|
+
* T001: Platform Configuration Registry (v2.0)
|
|
3
|
+
*
|
|
4
|
+
* [INPUT]: 无外部依赖
|
|
5
|
+
* [OUTPUT]: PLATFORM_CONFIG, PLATFORMS, getPlatformConfig, isValidPlatform, getRulesEntryPath
|
|
6
|
+
* [POS]: 编译器核心配置,定义四个目标平台的完整编译配置
|
|
7
|
+
* [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
3
8
|
*
|
|
4
9
|
* 定义四个目标平台的编译配置:
|
|
5
|
-
* - cursor: Cursor IDE (.mdc
|
|
6
|
-
* - codex: Codex CLI (
|
|
7
|
-
* - qwen: Qwen Code (.toml
|
|
8
|
-
* - antigravity: Antigravity (
|
|
10
|
+
* - cursor: Cursor IDE (.mdc rules, subagents, hooks)
|
|
11
|
+
* - codex: Codex CLI (skills/, prompts/, AGENTS.md)
|
|
12
|
+
* - qwen: Qwen Code (.toml commands, agents/)
|
|
13
|
+
* - antigravity: Antigravity (skills/, workflows/, rules/)
|
|
9
14
|
*
|
|
10
|
-
*
|
|
15
|
+
* v2.0: 支持完整功能模块 (skills, commands, agents, rules, hooks)
|
|
11
16
|
*/
|
|
12
17
|
|
|
13
18
|
// ============================================================
|
|
14
|
-
//
|
|
19
|
+
// MODULE_TYPES - 支持的模块类型
|
|
20
|
+
// ============================================================
|
|
21
|
+
const MODULE_TYPES = ['skills', 'commands', 'agents', 'rules', 'hooks'];
|
|
22
|
+
|
|
23
|
+
// ============================================================
|
|
24
|
+
// PLATFORM_CONFIG - 平台配置注册表 (v2.0)
|
|
15
25
|
// ============================================================
|
|
16
26
|
const PLATFORM_CONFIG = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
// ----------------------------------------------------------
|
|
28
|
+
// Codex CLI
|
|
29
|
+
// ----------------------------------------------------------
|
|
30
|
+
codex: {
|
|
31
|
+
name: 'Codex CLI',
|
|
32
|
+
folder: '.codex/',
|
|
33
|
+
|
|
34
|
+
// Skills 配置
|
|
35
|
+
skills: {
|
|
36
|
+
dir: 'skills/',
|
|
37
|
+
file: 'SKILL.md',
|
|
38
|
+
frontmatter: 'yaml',
|
|
39
|
+
supportsScripts: true,
|
|
40
|
+
supportsReferences: true
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
// Commands → Prompts
|
|
44
|
+
commands: {
|
|
45
|
+
dir: 'prompts/',
|
|
46
|
+
ext: '.md',
|
|
47
|
+
frontmatter: 'yaml',
|
|
48
|
+
argumentPattern: '$ARGUMENTS'
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// Agents → AGENTS.md (项目根目录合并)
|
|
52
|
+
agents: {
|
|
53
|
+
outputFile: 'AGENTS.md',
|
|
54
|
+
mergeMode: 'append'
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
// Rules → AGENTS.md (合并到 agents)
|
|
58
|
+
rules: {
|
|
59
|
+
outputFile: 'AGENTS.md',
|
|
60
|
+
mergeMode: 'append'
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
// Hooks: 不支持
|
|
64
|
+
hooks: {
|
|
65
|
+
supported: false
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// 旧版兼容字段
|
|
20
69
|
rulesEntry: {
|
|
21
|
-
path: '
|
|
22
|
-
format: '
|
|
70
|
+
path: 'skills/cc-devflow/SKILL.md',
|
|
71
|
+
format: 'markdown'
|
|
23
72
|
},
|
|
24
|
-
commandsDir: '
|
|
73
|
+
commandsDir: 'prompts/',
|
|
25
74
|
commandExt: '.md',
|
|
26
75
|
argumentPattern: '$ARGUMENTS',
|
|
27
76
|
hasHooks: false,
|
|
28
77
|
limits: {}
|
|
29
78
|
},
|
|
30
79
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
80
|
+
// ----------------------------------------------------------
|
|
81
|
+
// Cursor IDE
|
|
82
|
+
// ----------------------------------------------------------
|
|
83
|
+
cursor: {
|
|
84
|
+
name: 'Cursor IDE',
|
|
85
|
+
folder: '.cursor/',
|
|
86
|
+
|
|
87
|
+
// Skills → Rules (.mdc)
|
|
88
|
+
skills: {
|
|
89
|
+
dir: 'rules/',
|
|
90
|
+
ext: '.mdc',
|
|
91
|
+
frontmatter: 'yaml',
|
|
92
|
+
supportsGlobs: true,
|
|
93
|
+
supportsAlwaysApply: true
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// Commands
|
|
97
|
+
commands: {
|
|
98
|
+
dir: 'commands/',
|
|
99
|
+
ext: '.md',
|
|
100
|
+
frontmatter: null,
|
|
101
|
+
argumentPattern: '$ARGUMENTS'
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
// Agents → Subagents
|
|
105
|
+
agents: {
|
|
106
|
+
dir: 'subagents/',
|
|
107
|
+
ext: '.md',
|
|
108
|
+
frontmatter: 'yaml',
|
|
109
|
+
supportsTools: true
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
// Rules → Rules (.mdc)
|
|
113
|
+
rules: {
|
|
114
|
+
dir: 'rules/',
|
|
115
|
+
ext: '.mdc',
|
|
116
|
+
frontmatter: 'yaml'
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
// Hooks: 支持
|
|
120
|
+
hooks: {
|
|
121
|
+
supported: true,
|
|
122
|
+
configFile: 'hooks.json',
|
|
123
|
+
scriptsDir: 'hooks/',
|
|
124
|
+
events: ['sessionStart', 'preToolUse', 'postToolUse', 'afterFileEdit']
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
// MCP 配置
|
|
128
|
+
mcp: {
|
|
129
|
+
supported: true,
|
|
130
|
+
configFile: 'mcp.json'
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
// 项目级指令
|
|
134
|
+
projectFile: 'AGENTS.md',
|
|
135
|
+
|
|
136
|
+
// 旧版兼容字段
|
|
34
137
|
rulesEntry: {
|
|
35
|
-
path: '
|
|
36
|
-
format: '
|
|
138
|
+
path: 'rules/devflow.mdc',
|
|
139
|
+
format: 'mdc'
|
|
37
140
|
},
|
|
38
|
-
commandsDir: '
|
|
141
|
+
commandsDir: 'commands/',
|
|
39
142
|
commandExt: '.md',
|
|
40
143
|
argumentPattern: '$ARGUMENTS',
|
|
41
|
-
hasHooks:
|
|
144
|
+
hasHooks: true,
|
|
42
145
|
limits: {}
|
|
43
146
|
},
|
|
44
147
|
|
|
148
|
+
// ----------------------------------------------------------
|
|
149
|
+
// Qwen Code
|
|
150
|
+
// ----------------------------------------------------------
|
|
45
151
|
qwen: {
|
|
46
152
|
name: 'Qwen Code',
|
|
47
153
|
folder: '.qwen/',
|
|
154
|
+
|
|
155
|
+
// Skills → Commands (.toml)
|
|
156
|
+
skills: {
|
|
157
|
+
dir: 'commands/',
|
|
158
|
+
ext: '.toml',
|
|
159
|
+
frontmatter: 'toml',
|
|
160
|
+
supportsNesting: true
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
// Commands (.toml)
|
|
164
|
+
commands: {
|
|
165
|
+
dir: 'commands/',
|
|
166
|
+
ext: '.toml',
|
|
167
|
+
frontmatter: 'toml',
|
|
168
|
+
argumentPattern: '{{args}}'
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
// Agents
|
|
172
|
+
agents: {
|
|
173
|
+
dir: 'agents/',
|
|
174
|
+
ext: '.md',
|
|
175
|
+
frontmatter: 'yaml',
|
|
176
|
+
supportsTemplating: true
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
// Rules → CONTEXT.md
|
|
180
|
+
rules: {
|
|
181
|
+
outputFile: 'CONTEXT.md',
|
|
182
|
+
mergeMode: 'append'
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
// Hooks: 不支持
|
|
186
|
+
hooks: {
|
|
187
|
+
supported: false
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
// 配置文件
|
|
191
|
+
configFile: 'settings.json',
|
|
192
|
+
|
|
193
|
+
// 旧版兼容字段
|
|
48
194
|
rulesEntry: {
|
|
49
195
|
path: 'commands/devflow.toml',
|
|
50
196
|
format: 'toml'
|
|
@@ -56,9 +202,51 @@ const PLATFORM_CONFIG = {
|
|
|
56
202
|
limits: {}
|
|
57
203
|
},
|
|
58
204
|
|
|
205
|
+
// ----------------------------------------------------------
|
|
206
|
+
// Antigravity
|
|
207
|
+
// ----------------------------------------------------------
|
|
59
208
|
antigravity: {
|
|
60
209
|
name: 'Antigravity',
|
|
61
210
|
folder: '.agent/',
|
|
211
|
+
|
|
212
|
+
// Skills
|
|
213
|
+
skills: {
|
|
214
|
+
dir: 'skills/',
|
|
215
|
+
file: 'SKILL.md',
|
|
216
|
+
frontmatter: 'yaml',
|
|
217
|
+
supportsScripts: true,
|
|
218
|
+
supportsReferences: true,
|
|
219
|
+
supportsMetadata: true
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
// Commands → Workflows
|
|
223
|
+
commands: {
|
|
224
|
+
dir: 'workflows/',
|
|
225
|
+
ext: '.md',
|
|
226
|
+
frontmatter: 'yaml',
|
|
227
|
+
argumentPattern: '$ARGUMENTS',
|
|
228
|
+
supportsTurbo: true
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
// Agents → AGENTS.md
|
|
232
|
+
agents: {
|
|
233
|
+
outputFile: 'AGENTS.md',
|
|
234
|
+
mergeMode: 'append'
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
// Rules
|
|
238
|
+
rules: {
|
|
239
|
+
dir: 'rules/',
|
|
240
|
+
ext: '.md',
|
|
241
|
+
frontmatter: null
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
// Hooks: 不支持
|
|
245
|
+
hooks: {
|
|
246
|
+
supported: false
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
// 旧版兼容字段
|
|
62
250
|
rulesEntry: {
|
|
63
251
|
path: 'rules/rules.md',
|
|
64
252
|
format: 'markdown'
|
|
@@ -104,10 +292,71 @@ function getRulesEntryPath(platform) {
|
|
|
104
292
|
return `${config.folder}${config.rulesEntry.path}`;
|
|
105
293
|
}
|
|
106
294
|
|
|
295
|
+
// ============================================================
|
|
296
|
+
// getModuleConfig - 获取特定模块的配置
|
|
297
|
+
// ============================================================
|
|
298
|
+
function getModuleConfig(platform, moduleType) {
|
|
299
|
+
const config = getPlatformConfig(platform);
|
|
300
|
+
const moduleConfig = config[moduleType];
|
|
301
|
+
|
|
302
|
+
if (!moduleConfig) {
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
return moduleConfig;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// ============================================================
|
|
310
|
+
// isModuleSupported - 检查平台是否支持特定模块
|
|
311
|
+
// ============================================================
|
|
312
|
+
function isModuleSupported(platform, moduleType) {
|
|
313
|
+
const moduleConfig = getModuleConfig(platform, moduleType);
|
|
314
|
+
|
|
315
|
+
if (!moduleConfig) {
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// hooks 模块需要检查 supported 字段
|
|
320
|
+
if (moduleType === 'hooks') {
|
|
321
|
+
return moduleConfig.supported === true;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return true;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// ============================================================
|
|
328
|
+
// getOutputPath - 获取模块输出路径
|
|
329
|
+
// ============================================================
|
|
330
|
+
function getOutputPath(platform, moduleType, filename = '') {
|
|
331
|
+
const config = getPlatformConfig(platform);
|
|
332
|
+
const moduleConfig = config[moduleType];
|
|
333
|
+
|
|
334
|
+
if (!moduleConfig) {
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// 合并模式 (AGENTS.md, CONTEXT.md)
|
|
339
|
+
if (moduleConfig.outputFile) {
|
|
340
|
+
return moduleConfig.outputFile;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// 目录模式
|
|
344
|
+
if (moduleConfig.dir) {
|
|
345
|
+
const ext = moduleConfig.ext || '';
|
|
346
|
+
return `${config.folder}${moduleConfig.dir}${filename}${ext}`;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
|
|
107
352
|
module.exports = {
|
|
108
353
|
PLATFORM_CONFIG,
|
|
109
354
|
PLATFORMS,
|
|
355
|
+
MODULE_TYPES,
|
|
110
356
|
getPlatformConfig,
|
|
111
357
|
isValidPlatform,
|
|
112
|
-
getRulesEntryPath
|
|
358
|
+
getRulesEntryPath,
|
|
359
|
+
getModuleConfig,
|
|
360
|
+
isModuleSupported,
|
|
361
|
+
getOutputPath
|
|
113
362
|
};
|
package/package.json
CHANGED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: flow-epic
|
|
3
|
-
description: 'Generate Epic and Tasks breakdown. Usage: /flow-epic "REQ-123" or /flow-epic'
|
|
4
|
-
scripts:
|
|
5
|
-
prereq: .claude/scripts/check-prerequisites.sh
|
|
6
|
-
setup: .claude/scripts/setup-epic.sh
|
|
7
|
-
validate_constitution: .claude/scripts/validate-constitution.sh
|
|
8
|
-
agent_scripts:
|
|
9
|
-
sh: .claude/scripts/update-agent-context.sh __AGENT__
|
|
10
|
-
ps: scripts/powershell/update-agent-context.ps1 -AgentType __AGENT__
|
|
11
|
-
skills:
|
|
12
|
-
tdd: .claude/skills/flow-tdd/SKILL.md
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# Flow-Epic - Epic 和任务规划命令
|
|
16
|
-
|
|
17
|
-
## Bite-Sized Tasks 原则
|
|
18
|
-
|
|
19
|
-
任务必须足够小:
|
|
20
|
-
|
|
21
|
-
```yaml
|
|
22
|
-
Task 粒度规范:
|
|
23
|
-
- 每个 step 2-5 分钟可完成
|
|
24
|
-
- "Write the failing test" = 1 step
|
|
25
|
-
- "Run it to make sure it fails" = 1 step
|
|
26
|
-
- "Implement minimal code to pass" = 1 step
|
|
27
|
-
- "Run tests and verify" = 1 step
|
|
28
|
-
- "Commit" = 1 step
|
|
29
|
-
|
|
30
|
-
Task 内容规范:
|
|
31
|
-
- 精确的文件路径 (不是 "update the config")
|
|
32
|
-
- 完整的代码片段 (不是 "add validation")
|
|
33
|
-
- 精确的命令 + 期望输出
|
|
34
|
-
- 明确的验收标准
|
|
35
|
-
|
|
36
|
-
Bad Task Examples:
|
|
37
|
-
❌ "Implement user authentication"
|
|
38
|
-
❌ "Add validation"
|
|
39
|
-
❌ "Update the API"
|
|
40
|
-
|
|
41
|
-
Good Task Examples:
|
|
42
|
-
✅ "Create src/auth/login.ts with LoginRequest interface"
|
|
43
|
-
✅ "Write failing test: POST /api/login returns 401 for invalid credentials"
|
|
44
|
-
✅ "Run npm test -- --grep 'login' and verify test fails"
|
|
45
|
-
✅ "Implement login handler to pass the test"
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## User Input
|
|
49
|
-
```text
|
|
50
|
-
$ARGUMENTS = "REQ_ID?"
|
|
51
|
-
```
|
|
52
|
-
空输入时根据当前分支或 `DEVFLOW_REQ_ID` 自动解析;如果无法解析必须直接报错。
|
|
53
|
-
|
|
54
|
-
## 命令格式
|
|
55
|
-
```text
|
|
56
|
-
/flow-epic "REQ_ID"
|
|
57
|
-
/flow-epic # Auto-detect from current branch
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## 执行流程
|
|
61
|
-
|
|
62
|
-
### 阶段 1: Entry Gate
|
|
63
|
-
```
|
|
64
|
-
1. Requirement ID
|
|
65
|
-
→ Provided: use argument
|
|
66
|
-
→ Else: run {SCRIPT:prereq} --json --paths-only
|
|
67
|
-
→ Missing: ERROR "No requirement ID found."
|
|
68
|
-
|
|
69
|
-
2. 结构校验
|
|
70
|
-
→ 需求目录、EXECUTION_LOG.md、orchestration_status.json 必须存在
|
|
71
|
-
→ PRD.md 完整且无 {{PLACEHOLDER}}
|
|
72
|
-
→ 研究产物(/flow-init 输出):
|
|
73
|
-
• research/research.md (研究摘要,Decision/Rationale/Alternatives 格式)
|
|
74
|
-
• research/tasks.json (研究任务列表)
|
|
75
|
-
→ 技术产物(/flow-tech 输出):
|
|
76
|
-
• TECH_DESIGN.md (技术方案总纲) ⭐ planner 必读
|
|
77
|
-
• research/codebase-tech-analysis.md (代码库技术分析)
|
|
78
|
-
• data-model.md (数据模型定义)
|
|
79
|
-
• contracts/ (API 契约目录,至少 1 个文件)
|
|
80
|
-
• quickstart.md (快速启动指南)
|
|
81
|
-
→ 状态校验:
|
|
82
|
-
• orchestration_status.phase0_complete == true (研究阶段完成)
|
|
83
|
-
• orchestration_status.phase1_complete == true (技术设计完成)
|
|
84
|
-
|
|
85
|
-
3. 状态检查
|
|
86
|
-
→ status ∈ {tech_design_complete, epic_generation_failed}
|
|
87
|
-
→ 已存在 EPIC.md 或 TASKS.md → WARN 并询问是否覆盖
|
|
88
|
-
|
|
89
|
-
4. Constitution Gate
|
|
90
|
-
→ Run: {SCRIPT:validate_constitution} --type prd --severity error --json
|
|
91
|
-
→ 若有 ERROR 级违规 → 停止
|
|
92
|
-
|
|
93
|
-
5. Checklist Gate (如果 checklists/ 存在)
|
|
94
|
-
→ Run: node .claude/hooks/checklist-gate.js --req-id {REQ_ID} --json
|
|
95
|
-
→ 若 status == "FAIL" 且无 --skip-gate:
|
|
96
|
-
• ERROR: 显示完成度不足提示
|
|
97
|
-
• 建议: "Run /flow-checklist --status to review incomplete items"
|
|
98
|
-
→ 若 --skip-gate 提供:
|
|
99
|
-
• 验证 --reason 参数存在
|
|
100
|
-
• Run: node .claude/hooks/checklist-gate.js --req-id {REQ_ID} --skip --reason "{reason}"
|
|
101
|
-
• 审计日志记录到 EXECUTION_LOG.md
|
|
102
|
-
→ 若 status == "PASS" 或 "SKIPPED": 继续
|
|
103
|
-
→ 若 checklists/ 不存在: 跳过此检查 (Checklist 可选)
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### 阶段 2: Epic/TASKS 初始化
|
|
107
|
-
```
|
|
108
|
-
1. 执行 {SCRIPT:setup} --json
|
|
109
|
-
→ 返回 EPIC_FILE, TASKS_FILE, reqId, title
|
|
110
|
-
2. 加载模板
|
|
111
|
-
→ EPIC_TEMPLATE.md、TASKS_TEMPLATE.md
|
|
112
|
-
3. 写入 orchestration_status
|
|
113
|
-
→ status = "epic_generation_in_progress"
|
|
114
|
-
→ phase = "planning"
|
|
115
|
-
4. EXECUTION_LOG.md 追加启动记录
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### 阶段 3: Planner Agent
|
|
119
|
-
```
|
|
120
|
-
Agent Prompt 要点:
|
|
121
|
-
- Inputs:
|
|
122
|
-
• PRD.md
|
|
123
|
-
• TECH_DESIGN.md
|
|
124
|
-
• research/research.md (决策)
|
|
125
|
-
• data-model.md
|
|
126
|
-
• contracts/ (OpenAPI/GraphQL)
|
|
127
|
-
• quickstart.md (测试环境/命令)
|
|
128
|
-
• research/codebase-tech-analysis.md
|
|
129
|
-
• UI_PROTOTYPE.html (若存在)
|
|
130
|
-
- Must:
|
|
131
|
-
• 执行 Phase -1 Gates (Simplicity / Anti-Abstraction / Integration-First)
|
|
132
|
-
• 按模板输出 EPIC.md (含 Success Metrics、Phase 2 Tests First、Complexity Tracking)
|
|
133
|
-
• 生成单一 TASKS.md:
|
|
134
|
-
- Phase 1 Setup → Phase 2 Foundational → Phase 3+ User Stories → Final Polish
|
|
135
|
-
- Phase 2 列出所有 contract/integration tests(引用 contracts/ 路径)
|
|
136
|
-
- Phase 3+ 依据 data-model 分配实体、依据 contracts 分配端点
|
|
137
|
-
- 引用 quickstart 中的命令作为测试/验证步骤
|
|
138
|
-
- 使用 `[US#]`、`[P]` 标签,包含精确文件路径
|
|
139
|
-
- 插入 “⚠️ TEST VERIFICATION CHECKPOINT” 于 Phase 2 与 Phase 3 之间
|
|
140
|
-
• Dependencies、Parallel Execution、Implementation Strategy 必须填写
|
|
141
|
-
• Constitution Check per phase
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### 阶段 4: Exit Gate
|
|
145
|
-
```
|
|
146
|
-
1. 文件存在
|
|
147
|
-
→ EPIC_FILE, TASKS_FILE
|
|
148
|
-
|
|
149
|
-
2. EPIC.md 结构
|
|
150
|
-
→ 包含 Technical Approach、Phase 2 Tests First、Complexity Tracking、Constitution Check
|
|
151
|
-
→ 无 {{PLACEHOLDER}}
|
|
152
|
-
|
|
153
|
-
3. TASKS.md 结构
|
|
154
|
-
→ Phase 顺序正确 (Setup → Foundational → US… → Polish)
|
|
155
|
-
→ Phase 2 在 Phase 3 前且包含 contract tests
|
|
156
|
-
→ “⚠️ TEST VERIFICATION CHECKPOINT” 位于 Phase 2 与 Phase 3 之间
|
|
157
|
-
→ 任务格式 `- [ ] T### [P?] [US#?] Description with file path`
|
|
158
|
-
|
|
159
|
-
4. 依赖覆盖
|
|
160
|
-
→ 数据模型任务与 data-model.md 一致
|
|
161
|
-
→ API 任务覆盖 contracts/
|
|
162
|
-
→ Tests 引用 quickstart 与 contracts
|
|
163
|
-
|
|
164
|
-
5. 状态更新
|
|
165
|
-
→ orchestration_status:
|
|
166
|
-
status = "epic_complete"
|
|
167
|
-
completedSteps append "epic"
|
|
168
|
-
→ EXECUTION_LOG.md 记录完成时间
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## 错误处理
|
|
172
|
-
- 缺少任一必需产物 → 直接返回 ERROR 提示回到 `/flow-tech`。
|
|
173
|
-
- Planner 生成失败 → 标记 `epic_generation_failed`,用户可修正后重试。
|
|
174
|
-
- Constitution 校验不通过 → 输出违规项并终止。
|
|
175
|
-
|
|
176
|
-
## 输出
|
|
177
|
-
- `EPIC.md`: 包含范围、成功指标、TDD 阶段、复杂度跟踪。
|
|
178
|
-
- `TASKS.md`: 单文件任务清单,按 user story 独立测试,引用 data-model、contracts、quickstart。
|
|
179
|
-
|
|
180
|
-
## 后续建议
|
|
181
|
-
1. 审阅任务依赖和并行策略。
|
|
182
|
-
2. 立即运行 `/flow-dev` 进入实现,确保 Phase 2 Tests 先落地。
|
|
183
|
-
3. 若新增技术栈,回到 `research/tasks.json` 更新研究状态并同步 agent context。
|