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,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev-implementer
|
|
3
|
+
description: Execute development tasks following TDD Iron Law with implementation planning.
|
|
4
|
+
tools: Read, Write, Grep, Glob
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a development implementation specialist with **MANDATORY TDD IRON LAW ENFORCEMENT**.
|
|
9
|
+
|
|
10
|
+
## ⚠️ CRITICAL: TDD IRON LAW
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### TDD Checkpoint
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
⚠️ TEST VERIFICATION CHECKPOINT:
|
|
20
|
+
1. 运行所有 Phase 2 测试
|
|
21
|
+
2. 验证所有新测试 FAIL
|
|
22
|
+
3. 只有全部 FAIL 后才能进入 Phase 3
|
|
23
|
+
4. 如果已经写了实现代码 → DELETE 重来
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Your Role
|
|
27
|
+
|
|
28
|
+
- **Primary**: Execute individual tasks from TASKS.md following TDD sequence
|
|
29
|
+
- **Output**: Implementation code + IMPLEMENTATION_PLAN.md for each task
|
|
30
|
+
- **Enforce**: TDD Iron Law - tests MUST fail before implementation
|
|
31
|
+
- **Track**: Update task status and log progress
|
|
32
|
+
|
|
33
|
+
## Rules Integration
|
|
34
|
+
|
|
35
|
+
You MUST follow these rules during implementation:
|
|
36
|
+
|
|
37
|
+
1. **TDD Sequence**:
|
|
38
|
+
- Read task DoD (Definition of Done)
|
|
39
|
+
- Write failing test FIRST
|
|
40
|
+
- Verify test fails
|
|
41
|
+
- Write minimal implementation to pass
|
|
42
|
+
- Refactor while keeping tests green
|
|
43
|
+
- Commit
|
|
44
|
+
|
|
45
|
+
2. **Code Quality**:
|
|
46
|
+
- No partial implementations (Article I)
|
|
47
|
+
- Reuse existing code (Article II)
|
|
48
|
+
- No hardcoded secrets (Article III)
|
|
49
|
+
- Proper resource cleanup (Article IV)
|
|
50
|
+
- No dead code (Article V)
|
|
51
|
+
|
|
52
|
+
3. **File Operations**:
|
|
53
|
+
- Use exact file paths from TASKS.md
|
|
54
|
+
- Follow existing code patterns
|
|
55
|
+
- Maintain consistent naming conventions
|
|
56
|
+
|
|
57
|
+
## Input Context
|
|
58
|
+
|
|
59
|
+
When executing a task, you receive:
|
|
60
|
+
- **REQ_ID**: Requirement identifier
|
|
61
|
+
- **TASK_ID**: Task identifier (T001, T002, etc.)
|
|
62
|
+
- **TASKS.md**: Full task list with DoD
|
|
63
|
+
- **TECH_DESIGN.md**: Technical design reference
|
|
64
|
+
- **PRD.md**: Product requirements reference
|
|
65
|
+
|
|
66
|
+
## Execution Flow
|
|
67
|
+
|
|
68
|
+
### Stage 1: Task Analysis
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
1. Read TASKS.md and locate task by TASK_ID
|
|
72
|
+
2. Extract:
|
|
73
|
+
- Task description
|
|
74
|
+
- File paths
|
|
75
|
+
- DoD criteria
|
|
76
|
+
- Dependencies
|
|
77
|
+
- [P] parallel flag
|
|
78
|
+
- [US#] user story reference
|
|
79
|
+
3. Read related context:
|
|
80
|
+
- TECH_DESIGN.md for technical details
|
|
81
|
+
- PRD.md for acceptance criteria
|
|
82
|
+
- Existing code for patterns
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Stage 2: Implementation Planning
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
1. Create IMPLEMENTATION_PLAN.md in tasks/ directory
|
|
89
|
+
2. Document:
|
|
90
|
+
- Approach
|
|
91
|
+
- Files to modify
|
|
92
|
+
- Test strategy
|
|
93
|
+
- Implementation steps
|
|
94
|
+
- Verification commands
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Stage 3: TDD Execution
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
Phase 2 (Tests First):
|
|
101
|
+
1. Write test file
|
|
102
|
+
2. Run test → MUST FAIL
|
|
103
|
+
3. If test passes → ERROR (invalid test)
|
|
104
|
+
4. Log test creation
|
|
105
|
+
|
|
106
|
+
Phase 3 (Implementation):
|
|
107
|
+
1. Write minimal code to pass test
|
|
108
|
+
2. Run test → MUST PASS
|
|
109
|
+
3. Refactor if needed
|
|
110
|
+
4. Run test again → MUST PASS
|
|
111
|
+
5. Log implementation
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Stage 4: Verification
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
1. Run all related tests
|
|
118
|
+
2. Check coverage
|
|
119
|
+
3. Verify DoD criteria met
|
|
120
|
+
4. Update TASKS.md (mark [x])
|
|
121
|
+
5. Log completion
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Output Structure
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
devflow/requirements/${REQ_ID}/tasks/
|
|
128
|
+
├── IMPLEMENTATION_PLAN.md # Overall implementation plan
|
|
129
|
+
├── T001_plan.md # Task-specific plan
|
|
130
|
+
├── T002_plan.md
|
|
131
|
+
└── ...
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Error Handling
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
Test Failure:
|
|
138
|
+
1. Log error to ERROR_LOG.md
|
|
139
|
+
2. Analyze root cause
|
|
140
|
+
3. Fix and retry
|
|
141
|
+
4. If persistent → escalate
|
|
142
|
+
|
|
143
|
+
Implementation Failure:
|
|
144
|
+
1. Log error with full context
|
|
145
|
+
2. Check dependencies
|
|
146
|
+
3. Review TECH_DESIGN.md
|
|
147
|
+
4. Retry with adjusted approach
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Constitution Compliance
|
|
151
|
+
|
|
152
|
+
For each task, verify:
|
|
153
|
+
- [ ] Article I: Complete implementation, no placeholders
|
|
154
|
+
- [ ] Article II: Reused existing code where possible
|
|
155
|
+
- [ ] Article III: No hardcoded secrets
|
|
156
|
+
- [ ] Article IV: Resources properly managed
|
|
157
|
+
- [ ] Article V: No dead code introduced
|
|
158
|
+
- [ ] Article VI: TDD sequence followed
|
|
159
|
+
|
|
160
|
+
## Attention Refresh Protocols
|
|
161
|
+
|
|
162
|
+
| Protocol | Trigger | Action |
|
|
163
|
+
|----------|---------|--------|
|
|
164
|
+
| Protocol 2 | Task start | Read TASKS.md T### + DoD |
|
|
165
|
+
| Protocol 3 | Iteration start | Read TASKS.md + ERROR_LOG |
|
|
166
|
+
| Protocol 4 | After error | Read ERROR_LOG.md |
|
|
167
|
+
|
|
168
|
+
## Quality Criteria
|
|
169
|
+
|
|
170
|
+
- **TDD Compliance**: Tests written and failing before implementation
|
|
171
|
+
- **Code Coverage**: ≥80% for new code
|
|
172
|
+
- **No Placeholders**: All code complete and functional
|
|
173
|
+
- **Documentation**: Implementation plan documented
|
|
174
|
+
- **Verification**: All DoD criteria met
|
|
175
|
+
|
|
176
|
+
## Process Summary
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
1. Read task from TASKS.md
|
|
180
|
+
2. Create implementation plan
|
|
181
|
+
3. Write failing test (Phase 2)
|
|
182
|
+
4. Verify test fails
|
|
183
|
+
5. Write implementation (Phase 3)
|
|
184
|
+
6. Verify test passes
|
|
185
|
+
7. Update task status
|
|
186
|
+
8. Log completion
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Context Requirements
|
|
190
|
+
|
|
191
|
+
- Read `orchestration_status.json` for project state
|
|
192
|
+
- Read `TECH_DESIGN.md` for technical specifications
|
|
193
|
+
- Read `PRD.md` for acceptance criteria
|
|
194
|
+
- Read existing code for patterns and conventions
|
|
195
|
+
- Update `EXECUTION_LOG.md` with progress
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flow-archive
|
|
3
|
-
description: 'Archive completed/deprecated requirements. Usage: /flow
|
|
3
|
+
description: 'Archive completed/deprecated requirements with Delta Specs support. Usage: /flow:archive "REQ-123" or /flow:archive --list'
|
|
4
|
+
version: 4.5.0
|
|
4
5
|
scripts:
|
|
5
6
|
archive: .claude/scripts/archive-requirement.sh
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
#
|
|
9
|
+
# /flow:archive - 需求归档命令 (v4.5)
|
|
10
|
+
|
|
11
|
+
> **[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
9
12
|
|
|
10
13
|
## User Input
|
|
11
14
|
```text
|
|
@@ -15,10 +18,10 @@ $ARGUMENTS = "REQ_ID?" | "--list" | "--restore REQ_ID"
|
|
|
15
18
|
|
|
16
19
|
## 命令格式
|
|
17
20
|
```text
|
|
18
|
-
/flow
|
|
19
|
-
/flow
|
|
20
|
-
/flow
|
|
21
|
-
/flow
|
|
21
|
+
/flow:archive "REQ-123" # 归档已完成需求
|
|
22
|
+
/flow:archive "REQ-123" --reason deprecated # 标记为废弃归档
|
|
23
|
+
/flow:archive --list # 列出所有归档
|
|
24
|
+
/flow:archive "REQ-123" --restore # 恢复归档需求
|
|
22
25
|
```
|
|
23
26
|
|
|
24
27
|
### 参数说明
|
|
@@ -221,11 +224,43 @@ ERROR: 无效的归档原因: cancelled
|
|
|
221
224
|
## 与其他命令的关系
|
|
222
225
|
|
|
223
226
|
```text
|
|
224
|
-
/flow
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
/flow:init → /flow:spec → /flow:dev → /flow:quality → /flow:release
|
|
228
|
+
↓
|
|
229
|
+
/flow:archive ← 工作流终点
|
|
230
|
+
↓
|
|
231
|
+
devflow/archive/{YYYY-MM}/
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Delta Specs 集成 (v4.5)
|
|
235
|
+
|
|
236
|
+
归档时自动处理 Delta Specs:
|
|
237
|
+
|
|
238
|
+
### 归档前检查
|
|
239
|
+
- 检测 `deltas/` 目录中的 Delta Specs
|
|
240
|
+
- 警告未应用的 Delta Specs (status != "applied")
|
|
241
|
+
- 建议先运行 `/flow:delta apply REQ-XXX --all`
|
|
242
|
+
|
|
243
|
+
### 归档内容
|
|
244
|
+
```
|
|
245
|
+
devflow/archive/{YYYY-MM}/{REQ_ID}/
|
|
246
|
+
├── PRD.md # 主规格文档
|
|
247
|
+
├── deltas/ # Delta Specs (完整保留)
|
|
248
|
+
│ ├── 2026-02-01-add-2fa/
|
|
249
|
+
│ │ ├── delta.md
|
|
250
|
+
│ │ └── tasks.md
|
|
251
|
+
│ └── ...
|
|
252
|
+
├── orchestration_status.json # 包含 deltaCount 字段
|
|
253
|
+
└── ...
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### 状态文件增强
|
|
257
|
+
```json
|
|
258
|
+
{
|
|
259
|
+
"status": "archived",
|
|
260
|
+
"archivedReason": "completed",
|
|
261
|
+
"deltaCount": 3,
|
|
262
|
+
"archivedAt": "2026-02-07T10:00:00+08:00"
|
|
263
|
+
}
|
|
229
264
|
```
|
|
230
265
|
|
|
231
266
|
## 脚本集成
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-context
|
|
3
|
+
description: Manage staged context injection for agents (RM-015)
|
|
4
|
+
version: 3.0.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /flow-context
|
|
8
|
+
|
|
9
|
+
> **[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Manage context injection configuration for CC-DevFlow agents.
|
|
14
|
+
Each agent type has a JSONL file defining what context to load.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Initialize context directory for a requirement
|
|
20
|
+
/flow-context init [REQ-ID] [--type backend|frontend|fullstack]
|
|
21
|
+
|
|
22
|
+
# Add entry to context file
|
|
23
|
+
/flow-context add [agent] [path] [purpose] [--optional]
|
|
24
|
+
|
|
25
|
+
# List current context configuration
|
|
26
|
+
/flow-context list [agent]
|
|
27
|
+
|
|
28
|
+
# Validate context paths exist
|
|
29
|
+
/flow-context validate [REQ-ID]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Subcommands
|
|
33
|
+
|
|
34
|
+
### init
|
|
35
|
+
|
|
36
|
+
Initialize context directory with templates.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
/flow-context init REQ-007 --type backend
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Creates:
|
|
43
|
+
- `devflow/requirements/REQ-007/context/`
|
|
44
|
+
- Copies templates from `.claude/docs/templates/context/*.jsonl.template`
|
|
45
|
+
- Customizes based on `--type` (backend removes frontend specs, etc.)
|
|
46
|
+
|
|
47
|
+
### add
|
|
48
|
+
|
|
49
|
+
Add an entry to a context JSONL file.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
/flow-context add dev "src/utils/auth.ts" "Authentication utilities" --optional
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Appends to `context/dev.jsonl`:
|
|
56
|
+
```json
|
|
57
|
+
{"type": "file", "path": "src/utils/auth.ts", "purpose": "Authentication utilities", "optional": true}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### list
|
|
61
|
+
|
|
62
|
+
Show current context configuration.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
/flow-context list dev
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Output:
|
|
69
|
+
```
|
|
70
|
+
Context for 'dev' agent (REQ-007):
|
|
71
|
+
|
|
72
|
+
1. [file] TASKS.md - Current task list and progress
|
|
73
|
+
2. [file] EPIC.md - Epic overview and phases
|
|
74
|
+
3. [file] TECH_DESIGN.md - Technical implementation guide
|
|
75
|
+
4. [file] ERROR_LOG.md - Previous errors to avoid (optional)
|
|
76
|
+
5. [spec] devflow/spec/frontend/style.md - Frontend style guide (optional)
|
|
77
|
+
|
|
78
|
+
Total: 5 entries (3 required, 2 optional)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### validate
|
|
82
|
+
|
|
83
|
+
Validate all context paths exist.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
/flow-context validate REQ-007
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Output:
|
|
90
|
+
```
|
|
91
|
+
Validating context for REQ-007...
|
|
92
|
+
|
|
93
|
+
✓ dev.jsonl: 5/5 paths valid
|
|
94
|
+
✓ epic.jsonl: 4/4 paths valid
|
|
95
|
+
✗ review.jsonl: 3/4 paths valid
|
|
96
|
+
- Missing: contracts/api.yaml
|
|
97
|
+
|
|
98
|
+
Overall: 12/13 paths valid (92%)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Integration
|
|
102
|
+
|
|
103
|
+
### With flow-init
|
|
104
|
+
|
|
105
|
+
When `/flow-init` creates a new requirement, it automatically runs:
|
|
106
|
+
```bash
|
|
107
|
+
/flow-context init {REQ-ID} --type {detected-type}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### With Agent Invocation
|
|
111
|
+
|
|
112
|
+
The `inject-agent-context.ts` hook automatically:
|
|
113
|
+
1. Detects current REQ-ID from environment or git branch
|
|
114
|
+
2. Reads `context/{agent}.jsonl`
|
|
115
|
+
3. Injects resolved content into agent prompt
|
|
116
|
+
|
|
117
|
+
## Context Entry Format
|
|
118
|
+
|
|
119
|
+
```jsonl
|
|
120
|
+
{"type": "file", "path": "PRD.md", "purpose": "Product requirements"}
|
|
121
|
+
{"type": "directory", "path": "contracts/", "purpose": "API contracts", "depth": 2}
|
|
122
|
+
{"type": "spec", "path": "devflow/spec/backend/api.md", "purpose": "API conventions"}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Entry Types
|
|
126
|
+
|
|
127
|
+
| Type | Path Resolution | Use Case |
|
|
128
|
+
|------|-----------------|----------|
|
|
129
|
+
| `file` | Relative to requirement dir | Requirement-specific files |
|
|
130
|
+
| `directory` | Relative to requirement dir | Load all files in directory |
|
|
131
|
+
| `spec` | Relative to project root | Project-level specifications |
|
|
132
|
+
|
|
133
|
+
### Optional Entries
|
|
134
|
+
|
|
135
|
+
Add `"optional": true` for files that may not exist:
|
|
136
|
+
```json
|
|
137
|
+
{"type": "file", "path": "ERROR_LOG.md", "purpose": "Previous errors", "optional": true}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Scripts
|
|
141
|
+
|
|
142
|
+
- `.claude/scripts/flow-context-init.sh` - Initialize context directory
|
|
143
|
+
- `.claude/scripts/flow-context-add.sh` - Add entry to JSONL
|
|
144
|
+
- `.claude/scripts/flow-context-validate.sh` - Validate paths
|
|
145
|
+
|
|
146
|
+
## Related
|
|
147
|
+
|
|
148
|
+
- **Hook**: `.claude/hooks/inject-agent-context.ts`
|
|
149
|
+
- **Types**: `.claude/hooks/types/context-injection.d.ts`
|
|
150
|
+
- **Templates**: `.claude/docs/templates/context/*.jsonl.template`
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-delta
|
|
3
|
+
description: Manage delta specs for incremental requirement tracking (RM-017)
|
|
4
|
+
version: 4.0.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /flow:delta
|
|
8
|
+
|
|
9
|
+
> **[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Manage incremental specification changes (delta specs) for tracking requirement evolution.
|
|
14
|
+
Delta specs capture ADDED/MODIFIED/REMOVED/RENAMED changes that are later applied to the SSOT.
|
|
15
|
+
|
|
16
|
+
借鉴 OpenSpec 的 Delta Specs 设计,实现增量规格管理。
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Create a new delta spec
|
|
22
|
+
/flow:delta create "REQ-123" "add-2fa"
|
|
23
|
+
|
|
24
|
+
# List all deltas for a requirement
|
|
25
|
+
/flow:delta list "REQ-123"
|
|
26
|
+
|
|
27
|
+
# Apply delta to main specs (PRD.md)
|
|
28
|
+
/flow:delta apply "REQ-123" "add-2fa"
|
|
29
|
+
|
|
30
|
+
# Check delta status
|
|
31
|
+
/flow:delta status "REQ-123" "add-2fa"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Subcommands
|
|
35
|
+
|
|
36
|
+
### create
|
|
37
|
+
|
|
38
|
+
Create a new delta spec for a requirement.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
/flow:delta create "REQ-123" "add-2fa"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Creates:
|
|
45
|
+
```
|
|
46
|
+
devflow/requirements/REQ-123/
|
|
47
|
+
└── deltas/
|
|
48
|
+
└── {YYYY-MM-DD}-add-2fa/
|
|
49
|
+
├── delta.md
|
|
50
|
+
└── tasks.md
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Process**:
|
|
54
|
+
1. Validate REQ-ID exists
|
|
55
|
+
2. Generate delta_id: `{YYYY-MM-DD}-{slug}`
|
|
56
|
+
3. Create directory structure
|
|
57
|
+
4. Generate delta.md from template
|
|
58
|
+
5. Generate tasks.md for delta-specific tasks
|
|
59
|
+
|
|
60
|
+
### list
|
|
61
|
+
|
|
62
|
+
List all deltas for a requirement.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
/flow:delta list "REQ-123"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Output**:
|
|
69
|
+
```
|
|
70
|
+
Deltas for REQ-123:
|
|
71
|
+
1. 2026-02-01-add-2fa [approved] Add 2FA support
|
|
72
|
+
2. 2026-02-05-fix-login [draft] Fix login timeout
|
|
73
|
+
3. 2026-02-07-add-oauth [review] Add OAuth providers
|
|
74
|
+
|
|
75
|
+
Total: 3 deltas (1 approved, 1 draft, 1 review)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### apply
|
|
79
|
+
|
|
80
|
+
Apply a delta to the main PRD.md specification.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
/flow:delta apply "REQ-123" "add-2fa"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Process**:
|
|
87
|
+
1. Parse delta.md using delta-parser.ts
|
|
88
|
+
2. Validate delta status is "approved"
|
|
89
|
+
3. Apply changes to PRD.md:
|
|
90
|
+
- RENAMED: Rename requirement headers
|
|
91
|
+
- REMOVED: Remove requirement blocks
|
|
92
|
+
- MODIFIED: Replace requirement content
|
|
93
|
+
- ADDED: Append new requirements
|
|
94
|
+
4. Update delta status to "applied"
|
|
95
|
+
5. Move to archive/
|
|
96
|
+
|
|
97
|
+
**Validation**:
|
|
98
|
+
- Delta must be in "approved" status
|
|
99
|
+
- No duplicate requirements in ADDED
|
|
100
|
+
- MODIFIED/REMOVED targets must exist
|
|
101
|
+
- RENAMED source must exist, target must not
|
|
102
|
+
|
|
103
|
+
### status
|
|
104
|
+
|
|
105
|
+
Check the status of a specific delta.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
/flow:delta status "REQ-123" "add-2fa"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Output**:
|
|
112
|
+
```
|
|
113
|
+
Delta: 2026-02-01-add-2fa
|
|
114
|
+
Status: approved
|
|
115
|
+
Created: 2026-02-01T10:00:00Z
|
|
116
|
+
|
|
117
|
+
Changes:
|
|
118
|
+
ADDED: 2 requirements
|
|
119
|
+
MODIFIED: 1 requirement
|
|
120
|
+
REMOVED: 0 requirements
|
|
121
|
+
RENAMED: 1 requirement
|
|
122
|
+
|
|
123
|
+
Validation:
|
|
124
|
+
✓ All ADDED requirements are unique
|
|
125
|
+
✓ All MODIFIED targets exist
|
|
126
|
+
✓ All RENAMED sources exist
|
|
127
|
+
✓ Ready to apply
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Delta Spec Format
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
---
|
|
134
|
+
delta_id: "2026-02-01-add-2fa"
|
|
135
|
+
req_id: "REQ-123"
|
|
136
|
+
title: "Add 2FA Support"
|
|
137
|
+
created_at: "2026-02-01T10:00:00Z"
|
|
138
|
+
status: "draft|review|approved|applied"
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
# Delta: Add 2FA Support
|
|
142
|
+
|
|
143
|
+
## Summary
|
|
144
|
+
Brief description of changes.
|
|
145
|
+
|
|
146
|
+
## ADDED Requirements
|
|
147
|
+
|
|
148
|
+
### Requirement: Two-Factor Authentication
|
|
149
|
+
Description of the new requirement.
|
|
150
|
+
|
|
151
|
+
#### Scenario: Enable 2FA
|
|
152
|
+
- GIVEN user is logged in
|
|
153
|
+
- WHEN user enables 2FA
|
|
154
|
+
- THEN system generates QR code
|
|
155
|
+
|
|
156
|
+
## MODIFIED Requirements
|
|
157
|
+
|
|
158
|
+
### Requirement: User Login
|
|
159
|
+
New description.
|
|
160
|
+
(Previously: old description)
|
|
161
|
+
|
|
162
|
+
## REMOVED Requirements
|
|
163
|
+
|
|
164
|
+
### Requirement: Legacy Session
|
|
165
|
+
**Reason**: Replaced by JWT
|
|
166
|
+
**Migration**: Run migration script
|
|
167
|
+
|
|
168
|
+
## RENAMED Requirements
|
|
169
|
+
|
|
170
|
+
- FROM: Old Name
|
|
171
|
+
- TO: New Name
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Status Workflow
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
draft → review → approved → applied
|
|
178
|
+
│ │ │
|
|
179
|
+
│ │ └── /flow:delta apply
|
|
180
|
+
│ │
|
|
181
|
+
│ └── Manual review approval
|
|
182
|
+
│
|
|
183
|
+
└── /flow:delta create
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Scripts
|
|
187
|
+
|
|
188
|
+
| Script | Purpose |
|
|
189
|
+
|--------|---------|
|
|
190
|
+
| `flow-delta-create.sh` | Create delta directory and files |
|
|
191
|
+
| `flow-delta-list.sh` | List all deltas for a requirement |
|
|
192
|
+
| `flow-delta-apply.sh` | Apply delta to PRD.md |
|
|
193
|
+
| `flow-delta-status.sh` | Check delta status |
|
|
194
|
+
| `delta-parser.ts` | Parse and apply delta blocks |
|
|
195
|
+
|
|
196
|
+
## Integration
|
|
197
|
+
|
|
198
|
+
### With /flow:spec
|
|
199
|
+
|
|
200
|
+
When `/flow:spec` modifies existing requirements, it can generate deltas:
|
|
201
|
+
```
|
|
202
|
+
PRD.md changes → deltas/{date}-{slug}/delta.md
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### With /flow:release
|
|
206
|
+
|
|
207
|
+
Before PR creation, `/flow:release` applies all approved deltas:
|
|
208
|
+
```bash
|
|
209
|
+
/flow:delta apply REQ-XXX --all
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### With /flow:archive
|
|
213
|
+
|
|
214
|
+
After release, `/flow:archive` includes applied deltas:
|
|
215
|
+
```bash
|
|
216
|
+
devflow/archive/{date}-REQ-XXX/deltas/
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Directory Structure
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
devflow/requirements/REQ-123/
|
|
223
|
+
├── PRD.md # Main specification (SSOT)
|
|
224
|
+
├── deltas/ # Delta specs directory
|
|
225
|
+
│ ├── 2026-02-01-add-2fa/
|
|
226
|
+
│ │ ├── delta.md # Delta specification
|
|
227
|
+
│ │ └── tasks.md # Delta-specific tasks
|
|
228
|
+
│ └── 2026-02-05-fix-login/
|
|
229
|
+
│ ├── delta.md
|
|
230
|
+
│ └── tasks.md
|
|
231
|
+
└── ...
|
|
232
|
+
|
|
233
|
+
devflow/archive/
|
|
234
|
+
└── 2026-02/
|
|
235
|
+
└── REQ-123/
|
|
236
|
+
└── deltas/ # Archived deltas
|
|
237
|
+
└── 2026-02-01-add-2fa/
|
|
238
|
+
└── delta.md
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Related
|
|
242
|
+
|
|
243
|
+
- **Template**: `.claude/docs/templates/DELTA_SPEC_TEMPLATE.md`
|
|
244
|
+
- **Parser**: `.claude/scripts/delta-parser.ts`
|
|
245
|
+
- **Archive**: `devflow/archive/` - Historical delta specs
|