cc-devflow 4.1.6 → 4.3.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/commands/core/architecture.md +30 -0
- package/.claude/commands/core/guidelines.md +25 -0
- package/.claude/commands/core/roadmap.md +29 -0
- package/.claude/commands/core/style.md +18 -0
- package/.claude/commands/flow/CLAUDE.md +0 -4
- package/.claude/docs/examples/design-inspiration-pool.md +59 -0
- package/.claude/docs/examples/ui-prototype-constitution-checklist.md +75 -0
- package/.claude/docs/implementation-summary-v7.md +449 -0
- package/.claude/docs/spec-format-guide.md +349 -0
- package/.claude/docs/state-consolidation-design.md +323 -0
- package/.claude/docs/templates/ARCHITECTURE_TEMPLATE.md +85 -386
- package/.claude/docs/templates/DESIGN_TEMPLATE.md +157 -0
- package/.claude/docs/templates/PROPOSAL_TEMPLATE.md +91 -0
- package/.claude/docs/templates/SPEC_TEMPLATE_DELTA.md +139 -0
- package/.claude/docs/templates/SPEC_TEMPLATE_PROJECT.md +93 -0
- package/.claude/docs/templates/STYLE_TEMPLATE.md +114 -901
- package/.claude/docs/templates/UI_PROTOTYPE_TEMPLATE.md +143 -1205
- package/.claude/hooks/inject-agent-context.ts +9 -9
- package/.claude/scripts/.claude/commands/flow/export-openspec.md +221 -0
- package/.claude/scripts/.claude/commands/flow/import-openspec.md +171 -0
- package/.claude/scripts/__tests__/openspec.test.js +212 -0
- package/.claude/scripts/delta-parser.ts +112 -2
- package/.claude/scripts/export-openspec.js +222 -0
- package/.claude/scripts/import-openspec.js +272 -0
- package/.claude/scripts/validate-scope.sh +200 -0
- package/.claude/skills/cc-devflow-orchestrator/SKILL.md +25 -0
- package/.claude/skills/flow-dev/SKILL.md +94 -0
- package/.claude/skills/flow-init/SKILL.md +105 -0
- package/.claude/skills/{workflow/flow-release → flow-release}/SKILL.md +14 -3
- package/.claude/skills/flow-spec/SKILL.md +102 -0
- package/.claude/skills/utility/npm-release/CLAUDE.md +55 -0
- package/.claude/skills/utility/npm-release/SKILL.md +111 -46
- package/.claude/skills/utility/npm-release/references/version-decision-guide.md +134 -0
- package/.claude/skills/utility/npm-release/scripts/atomic-version-bump.sh +95 -0
- package/.claude/skills/utility/npm-release/scripts/validate-version-sync.sh +82 -0
- package/.claude/skills/utility/npm-release/scripts/version-decision-tree.sh +44 -0
- package/.claude/tsc-cache/70d2fc6d-2936-429b-b529-429f1aae8c88/affected-repos.txt +1 -0
- package/.claude/tsc-cache/70d2fc6d-2936-429b-b529-429f1aae8c88/edited-files.log +2 -0
- package/CHANGELOG.md +81 -0
- package/README.md +7 -1
- package/README.zh-CN.md +7 -1
- package/bin/cc-devflow-cli.js +154 -0
- package/docs/v4.3.0-migration-guide.md +276 -0
- package/lib/harness/CLAUDE.md +5 -4
- package/lib/harness/__tests__/planner.tdd.test.js +125 -0
- package/lib/harness/index.js +4 -2
- package/lib/harness/operations/dispatch.js +13 -0
- package/lib/harness/operations/plan.js +55 -1
- package/lib/harness/operations/release.js +87 -0
- package/lib/harness/operations/verify.js +14 -0
- package/lib/harness/planner.js +131 -0
- package/lib/harness/query.js +126 -0
- package/lib/harness/schemas.js +22 -1
- package/package.json +1 -1
- package/.claude/commands/flow/checklist.md +0 -18
- package/.claude/commands/flow/clarify.md +0 -18
- package/.claude/commands/flow/new.md +0 -23
- package/.claude/commands/flow/quality.md +0 -21
- package/.claude/docs/templates/EPIC_TEMPLATE.md +0 -805
- package/.claude/docs/templates/PRD_TEMPLATE.md +0 -562
- package/.claude/docs/templates/TASKS_TEMPLATE.md +0 -523
- package/.claude/docs/templates/TECH_DESIGN_TEMPLATE.md +0 -1019
- package/.claude/skills/workflow/CLAUDE.md +0 -24
- package/.claude/skills/workflow/flow-dev/SKILL.md +0 -58
- package/.claude/skills/workflow/flow-init/SKILL.md +0 -55
- package/.claude/skills/workflow/flow-spec/SKILL.md +0 -42
- /package/.claude/skills/{domain/attention-refresh → attention-refresh}/SKILL.md +0 -0
- /package/.claude/skills/{domain/brainstorming → brainstorming}/SKILL.md +0 -0
- /package/.claude/skills/{guardrail/constitution-guardian → constitution-guardian}/SKILL.md +0 -0
- /package/.claude/skills/{utility/constitution-quick-ref → constitution-quick-ref}/SKILL.md +0 -0
- /package/.claude/skills/{domain/debugging → debugging}/SKILL.md +0 -0
- /package/.claude/skills/{utility/file-standards → file-standards}/SKILL.md +0 -0
- /package/.claude/skills/{domain/finishing-branch → finishing-branch}/SKILL.md +0 -0
- /package/.claude/skills/{workflow/flow-dev → flow-dev}/CLAUDE.md +0 -0
- /package/.claude/skills/{workflow/flow-dev → flow-dev}/assets/IMPLEMENTATION_PLAN_TEMPLATE.md +0 -0
- /package/.claude/skills/{workflow/flow-dev → flow-dev}/context.jsonl +0 -0
- /package/.claude/skills/{workflow/flow-dev → flow-dev}/dev-implementer.jsonl +0 -0
- /package/.claude/skills/{workflow/flow-dev → flow-dev}/scripts/entry-gate.sh +0 -0
- /package/.claude/skills/{workflow/flow-dev → flow-dev}/scripts/exit-gate.sh +0 -0
- /package/.claude/skills/{workflow/flow-dev → flow-dev}/scripts/task-orchestrator.sh +0 -0
- /package/.claude/skills/{workflow/flow-fix → flow-fix}/SKILL.md +0 -0
- /package/.claude/skills/{workflow/flow-fix → flow-fix}/context.jsonl +0 -0
- /package/.claude/skills/{workflow/flow-fix → flow-fix}/references/bug-analyzer.md +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/assets/BRAINSTORM_TEMPLATE.md +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/assets/INIT_FLOW_TEMPLATE.md +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/assets/RESEARCH_TEMPLATE.md +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/context.jsonl +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/references/flow-researcher.md +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/check-prerequisites.sh +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/consolidate-research.sh +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/create-requirement.sh +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/generate-research-tasks.sh +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/populate-research-tasks.sh +0 -0
- /package/.claude/skills/{workflow/flow-init → flow-init}/scripts/validate-research.sh +0 -0
- /package/.claude/skills/{workflow/flow-quality → flow-quality}/SKILL.md +0 -0
- /package/.claude/skills/{workflow/flow-quality → flow-quality}/context.jsonl +0 -0
- /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/code-quality-reviewer.md +0 -0
- /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/qa-tester.md +0 -0
- /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/security-reviewer.md +0 -0
- /package/.claude/skills/{workflow/flow-quality → flow-quality}/references/spec-reviewer.md +0 -0
- /package/.claude/skills/{workflow/flow-release → flow-release}/context.jsonl +0 -0
- /package/.claude/skills/{workflow/flow-release → flow-release}/references/release-manager.md +0 -0
- /package/.claude/skills/{workflow/flow-spec → flow-spec}/CLAUDE.md +0 -0
- /package/.claude/skills/{workflow/flow-spec → flow-spec}/context.jsonl +0 -0
- /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/entry-gate.sh +0 -0
- /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/exit-gate.sh +0 -0
- /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/parallel-orchestrator.sh +0 -0
- /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/team-communication.sh +0 -0
- /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/team-init.sh +0 -0
- /package/.claude/skills/{workflow/flow-spec → flow-spec}/scripts/test-team-mode.sh +0 -0
- /package/.claude/skills/{workflow/flow-spec → flow-spec}/team-config.json +0 -0
- /package/.claude/skills/{workflow/flow-verify → flow-verify}/CLAUDE.md +0 -0
- /package/.claude/skills/{workflow/flow-verify → flow-verify}/SKILL.md +0 -0
- /package/.claude/skills/{workflow/flow-verify → flow-verify}/context.jsonl +0 -0
- /package/.claude/skills/{utility/fractal-docs → fractal-docs}/SKILL.md +0 -0
- /package/.claude/skills/{utility/journey-checker → journey-checker}/SKILL.md +0 -0
- /package/.claude/skills/{utility/journey-checker → journey-checker}/pressure-scenarios.md +0 -0
- /package/.claude/skills/{domain/receiving-review → receiving-review}/SKILL.md +0 -0
- /package/.claude/skills/{utility/skill-creator → skill-creator}/LICENSE.txt +0 -0
- /package/.claude/skills/{utility/skill-creator → skill-creator}/SKILL.md +0 -0
- /package/.claude/skills/{utility/skill-creator → skill-creator}/references/output-patterns.md +0 -0
- /package/.claude/skills/{utility/skill-creator → skill-creator}/references/workflows.md +0 -0
- /package/.claude/skills/{utility/skill-creator → skill-creator}/scripts/init_skill.py +0 -0
- /package/.claude/skills/{utility/skill-creator → skill-creator}/scripts/package_skill.py +0 -0
- /package/.claude/skills/{utility/skill-creator → skill-creator}/scripts/quick_validate.py +0 -0
- /package/.claude/skills/{domain/tdd → tdd}/SKILL.md +0 -0
- /package/.claude/skills/{guardrail/tdd-enforcer → tdd-enforcer}/SKILL.md +0 -0
- /package/.claude/skills/{domain/verification → verification}/SKILL.md +0 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# [INPUT]: 依赖 proposal.md 和 Delta spec.md
|
|
3
|
+
# [OUTPUT]: 生成 scope-creep-report.md
|
|
4
|
+
# [POS]: 反扩散检查脚本,被 /flow:spec 和 /flow:verify 调用
|
|
5
|
+
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
# ============================================================================
|
|
10
|
+
# Configuration
|
|
11
|
+
# ============================================================================
|
|
12
|
+
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
14
|
+
source "${SCRIPT_DIR}/common.sh"
|
|
15
|
+
|
|
16
|
+
REQ_ID="${1:-}"
|
|
17
|
+
if [[ -z "$REQ_ID" ]]; then
|
|
18
|
+
error "Usage: validate-scope.sh <REQ-ID>"
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
REQ_DIR="devflow/requirements/${REQ_ID}"
|
|
23
|
+
PROPOSAL_FILE="${REQ_DIR}/proposal.md"
|
|
24
|
+
REPORT_FILE="${REQ_DIR}/scope-creep-report.md"
|
|
25
|
+
|
|
26
|
+
# ============================================================================
|
|
27
|
+
# Validation
|
|
28
|
+
# ============================================================================
|
|
29
|
+
|
|
30
|
+
if [[ ! -f "$PROPOSAL_FILE" ]]; then
|
|
31
|
+
error "proposal.md not found: $PROPOSAL_FILE"
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# 查找所有 Delta spec.md 文件
|
|
36
|
+
DELTA_SPECS=$(find "${REQ_DIR}/specs" -name "spec.md" 2>/dev/null || true)
|
|
37
|
+
|
|
38
|
+
if [[ -z "$DELTA_SPECS" ]]; then
|
|
39
|
+
warn "No Delta specs found in ${REQ_DIR}/specs/"
|
|
40
|
+
exit 0
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# ============================================================================
|
|
44
|
+
# Extract Original Intent
|
|
45
|
+
# ============================================================================
|
|
46
|
+
|
|
47
|
+
info "Extracting original intent from proposal.md..."
|
|
48
|
+
|
|
49
|
+
# 提取 ## What 章节(原始需求描述)
|
|
50
|
+
ORIGINAL_INTENT=$(awk '
|
|
51
|
+
/^## What/ { flag=1; next }
|
|
52
|
+
/^## / { flag=0 }
|
|
53
|
+
flag { print }
|
|
54
|
+
' "$PROPOSAL_FILE" | sed '/^$/d')
|
|
55
|
+
|
|
56
|
+
if [[ -z "$ORIGINAL_INTENT" ]]; then
|
|
57
|
+
warn "No 'What' section found in proposal.md"
|
|
58
|
+
ORIGINAL_INTENT="(No explicit requirements found)"
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
# ============================================================================
|
|
62
|
+
# Extract Delta Requirements
|
|
63
|
+
# ============================================================================
|
|
64
|
+
|
|
65
|
+
info "Extracting ADDED requirements from Delta specs..."
|
|
66
|
+
|
|
67
|
+
ADDED_REQUIREMENTS=""
|
|
68
|
+
SCOPE_CREEP_COUNT=0
|
|
69
|
+
|
|
70
|
+
while IFS= read -r delta_file; do
|
|
71
|
+
module=$(basename "$(dirname "$delta_file")")
|
|
72
|
+
|
|
73
|
+
# 提取 ADDED Requirements 章节
|
|
74
|
+
added=$(awk '
|
|
75
|
+
/^## ADDED Requirements/ { flag=1; next }
|
|
76
|
+
/^## / { flag=0 }
|
|
77
|
+
flag && /^### Requirement:/ { print $0 }
|
|
78
|
+
' "$delta_file")
|
|
79
|
+
|
|
80
|
+
if [[ -n "$added" ]]; then
|
|
81
|
+
ADDED_REQUIREMENTS+="
|
|
82
|
+
### Module: $module
|
|
83
|
+
$added
|
|
84
|
+
"
|
|
85
|
+
fi
|
|
86
|
+
done <<< "$DELTA_SPECS"
|
|
87
|
+
|
|
88
|
+
# ============================================================================
|
|
89
|
+
# Detect Scope Creep
|
|
90
|
+
# ============================================================================
|
|
91
|
+
|
|
92
|
+
info "Detecting scope creep..."
|
|
93
|
+
|
|
94
|
+
# 简单启发式:检查 ADDED 需求中的关键词是否在原始意图中出现
|
|
95
|
+
CREEP_ITEMS=""
|
|
96
|
+
|
|
97
|
+
while IFS= read -r line; do
|
|
98
|
+
if [[ "$line" =~ ^###\ Requirement:\ (.+)$ ]]; then
|
|
99
|
+
req_name="${BASH_REMATCH[1]}"
|
|
100
|
+
|
|
101
|
+
# 提取关键词(去除常见词)
|
|
102
|
+
keywords=$(echo "$req_name" | tr '[:upper:]' '[:lower:]' | \
|
|
103
|
+
sed -e 's/the //g' -e 's/a //g' -e 's/an //g' -e 's/and //g' | \
|
|
104
|
+
tr -s ' ' '\n' | grep -v '^$')
|
|
105
|
+
|
|
106
|
+
# 检查关键词是否在原始意图中
|
|
107
|
+
found=false
|
|
108
|
+
while IFS= read -r keyword; do
|
|
109
|
+
if echo "$ORIGINAL_INTENT" | grep -qi "$keyword"; then
|
|
110
|
+
found=true
|
|
111
|
+
break
|
|
112
|
+
fi
|
|
113
|
+
done <<< "$keywords"
|
|
114
|
+
|
|
115
|
+
if [[ "$found" == "false" ]]; then
|
|
116
|
+
CREEP_ITEMS+="- ⚠️ $req_name (not mentioned in original intent)
|
|
117
|
+
"
|
|
118
|
+
((SCOPE_CREEP_COUNT++))
|
|
119
|
+
else
|
|
120
|
+
CREEP_ITEMS+="- ✅ $req_name
|
|
121
|
+
"
|
|
122
|
+
fi
|
|
123
|
+
fi
|
|
124
|
+
done <<< "$ADDED_REQUIREMENTS"
|
|
125
|
+
|
|
126
|
+
# ============================================================================
|
|
127
|
+
# Generate Report
|
|
128
|
+
# ============================================================================
|
|
129
|
+
|
|
130
|
+
info "Generating scope-creep-report.md..."
|
|
131
|
+
|
|
132
|
+
cat > "$REPORT_FILE" <<EOF
|
|
133
|
+
# Scope Creep Report - ${REQ_ID}
|
|
134
|
+
|
|
135
|
+
> **Generated**: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
136
|
+
> **Status**: $([ $SCOPE_CREEP_COUNT -eq 0 ] && echo "✅ No scope creep detected" || echo "⚠️ Potential scope creep detected")
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Original Intent (from proposal.md)
|
|
141
|
+
|
|
142
|
+
${ORIGINAL_INTENT}
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Current Delta (from specs/)
|
|
147
|
+
|
|
148
|
+
${ADDED_REQUIREMENTS:-No ADDED requirements found}
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Analysis
|
|
153
|
+
|
|
154
|
+
${CREEP_ITEMS:-No requirements to analyze}
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Summary
|
|
159
|
+
|
|
160
|
+
- **Total ADDED requirements**: $(echo "$ADDED_REQUIREMENTS" | grep -c "^### Requirement:" || echo 0)
|
|
161
|
+
- **Potential scope creep**: ${SCOPE_CREEP_COUNT}
|
|
162
|
+
|
|
163
|
+
## Recommendation
|
|
164
|
+
|
|
165
|
+
EOF
|
|
166
|
+
|
|
167
|
+
if [[ $SCOPE_CREEP_COUNT -eq 0 ]]; then
|
|
168
|
+
cat >> "$REPORT_FILE" <<EOF
|
|
169
|
+
✅ All ADDED requirements align with original intent. Safe to proceed.
|
|
170
|
+
EOF
|
|
171
|
+
else
|
|
172
|
+
cat >> "$REPORT_FILE" <<EOF
|
|
173
|
+
⚠️ ${SCOPE_CREEP_COUNT} requirement(s) may be beyond original scope.
|
|
174
|
+
|
|
175
|
+
**Action Required**:
|
|
176
|
+
1. Review each ⚠️ marked requirement
|
|
177
|
+
2. If necessary, update proposal.md to include these features
|
|
178
|
+
3. If not necessary, remove from Delta specs
|
|
179
|
+
4. Consider creating separate REQs for additional features
|
|
180
|
+
|
|
181
|
+
**Constitutional Reference**: Article X - Requirement Boundary
|
|
182
|
+
EOF
|
|
183
|
+
fi
|
|
184
|
+
|
|
185
|
+
# ============================================================================
|
|
186
|
+
# Output
|
|
187
|
+
# ============================================================================
|
|
188
|
+
|
|
189
|
+
success "Scope creep report generated: $REPORT_FILE"
|
|
190
|
+
|
|
191
|
+
if [[ $SCOPE_CREEP_COUNT -gt 0 ]]; then
|
|
192
|
+
warn "⚠️ Potential scope creep detected: ${SCOPE_CREEP_COUNT} requirement(s)"
|
|
193
|
+
echo ""
|
|
194
|
+
echo "Review the report and confirm before proceeding:"
|
|
195
|
+
echo " cat $REPORT_FILE"
|
|
196
|
+
exit 1
|
|
197
|
+
else
|
|
198
|
+
success "✅ No scope creep detected"
|
|
199
|
+
exit 0
|
|
200
|
+
fi
|
|
@@ -19,6 +19,29 @@ Guide users to the correct command/skill without duplicating detailed implementa
|
|
|
19
19
|
/core:style → STYLE.md
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
## Project-Level Harness Protocol (Long-running)
|
|
23
|
+
|
|
24
|
+
For `/core:*` commands, enforce a two-session model before declaring completion:
|
|
25
|
+
|
|
26
|
+
1. Initializer session
|
|
27
|
+
- establish/update `devflow/.core-harness/<command>/checklist.json`, `progress.md`, `session-handoff.md`
|
|
28
|
+
- convert high-level goal into structured acceptance checks (default all failing)
|
|
29
|
+
2. Worker session(s)
|
|
30
|
+
- resume from `session-handoff.md` + `progress.md`
|
|
31
|
+
- execute one smallest deliverable per session
|
|
32
|
+
- update checklist status only after command-specific validation
|
|
33
|
+
3. Completion gate
|
|
34
|
+
- completion is allowed only when checklist is fully passing and command validation gates pass
|
|
35
|
+
- never declare success from “looks complete”; require artifact evidence
|
|
36
|
+
|
|
37
|
+
### Core Route Defaults
|
|
38
|
+
|
|
39
|
+
- no `devflow/ROADMAP.md` → route to `/core:roadmap` (initializer first)
|
|
40
|
+
- roadmap exists but architecture missing/stale → route to `/core:architecture`
|
|
41
|
+
- architecture exists but guidelines missing/stale → route to `/core:guidelines`
|
|
42
|
+
- style missing/stale → route to `/core:style`
|
|
43
|
+
- interrupted core command → rerun same command from handoff (`/core:roadmap --resume` if supported; otherwise run command again and continue from `session-handoff.md`)
|
|
44
|
+
|
|
22
45
|
### Requirement-Level Canonical Mainline (v6)
|
|
23
46
|
|
|
24
47
|
```text
|
|
@@ -140,5 +163,7 @@ This skill only does routing:
|
|
|
140
163
|
- Which command to run next
|
|
141
164
|
- Which gate blocks progress
|
|
142
165
|
- Which migration path applies for deprecated commands
|
|
166
|
+
- Prefer incremental convergence over one-shot generation
|
|
167
|
+
- Require artifact-backed completion for long-running sessions
|
|
143
168
|
|
|
144
169
|
Detailed quality standards stay in command files and workflow skills.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-dev
|
|
3
|
+
description: 'Execute task-manifest with dependency-aware parallel dispatch and checkpoint recovery. Use when implementing planned tasks for a requirement.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flow-Dev Skill
|
|
7
|
+
|
|
8
|
+
> [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
|
+
执行 `task-manifest.json` 中的任务,默认并行调度并写入 checkpoint/events 供恢复。
|
|
13
|
+
|
|
14
|
+
## Long-Running Harness Protocol(Initializer/Worker/Done Gate)
|
|
15
|
+
|
|
16
|
+
`/flow:dev` 是最长链路阶段,必须严格执行“先读状态、再增量、后留证据”。
|
|
17
|
+
|
|
18
|
+
### Session Start(禁止盲跑)
|
|
19
|
+
|
|
20
|
+
每个窗口开始时先同步以下信息:
|
|
21
|
+
- `devflow/requirements/${REQ_ID}/session-checklist.json`(若存在)
|
|
22
|
+
- `devflow/requirements/${REQ_ID}/session-progress.md`(若存在)
|
|
23
|
+
- `devflow/requirements/${REQ_ID}/session-handoff.md`(若存在)
|
|
24
|
+
- `devflow/requirements/${REQ_ID}/task-manifest.json`
|
|
25
|
+
- `.harness/runtime/${REQ_ID}/**/checkpoint.json` 与 `events.jsonl`(若存在)
|
|
26
|
+
|
|
27
|
+
然后执行一次基础健康检查:
|
|
28
|
+
1. 不存在损坏的 `running` 残留状态
|
|
29
|
+
2. 上轮失败任务与失败原因可定位
|
|
30
|
+
|
|
31
|
+
### Worker Session(最小可执行前沿)
|
|
32
|
+
|
|
33
|
+
单窗口仅推进一个最小前沿:
|
|
34
|
+
- 仅处理当前 `dependsOn` 已满足的一组任务
|
|
35
|
+
- 每完成一组任务即写入 checkpoint/events
|
|
36
|
+
- 遇到失败立即收敛原因并记录,不并行扩散新的失败面
|
|
37
|
+
|
|
38
|
+
会话收尾必须:
|
|
39
|
+
1. 更新 `task-manifest.json` 状态
|
|
40
|
+
2. 更新 `session-progress.md` 与 `session-handoff.md`
|
|
41
|
+
3. 推荐提交一个可回滚的最小 git commit(若仓库策略允许)
|
|
42
|
+
|
|
43
|
+
### Done Gate
|
|
44
|
+
|
|
45
|
+
仅当以下条件满足才标记 `flow:dev` 完成:
|
|
46
|
+
- 全部任务为 `passed` 或 `skipped`
|
|
47
|
+
- 无 `running`/`failed` 残留
|
|
48
|
+
- `session-checklist.json` 中 `flow:dev.passes == true`
|
|
49
|
+
|
|
50
|
+
## Input Format
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
/flow:dev "REQ_ID" [--parallel N] [--resume] [--max-retries N]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Execution Steps
|
|
57
|
+
|
|
58
|
+
1. 解析参数:
|
|
59
|
+
- 默认 `parallel = 3`
|
|
60
|
+
- 默认不 resume
|
|
61
|
+
2. 分支执行:
|
|
62
|
+
- 普通执行:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm run harness:dispatch -- --change-id "${REQ_ID}" --parallel ${PARALLEL} [--max-retries ${MAX_RETRIES}]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- 恢复执行:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm run harness:resume -- --change-id "${REQ_ID}" --parallel ${PARALLEL} [--max-retries ${MAX_RETRIES}]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
3. 检查执行结果:
|
|
75
|
+
- `task-manifest.json` 状态更新
|
|
76
|
+
- `.harness/runtime/${REQ_ID}/<TASK_ID>/events.jsonl`
|
|
77
|
+
- `.harness/runtime/${REQ_ID}/<TASK_ID>/checkpoint.json`
|
|
78
|
+
|
|
79
|
+
## Exit Criteria
|
|
80
|
+
|
|
81
|
+
- 所有任务状态为 `passed` 或 `skipped`
|
|
82
|
+
- 没有 `running` 残留状态
|
|
83
|
+
|
|
84
|
+
## Failure Handling
|
|
85
|
+
|
|
86
|
+
- 若存在 `failed` 任务:
|
|
87
|
+
1. 修复失败原因
|
|
88
|
+
2. 重新运行 `--resume`
|
|
89
|
+
|
|
90
|
+
## Next Step
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
/flow:verify "${REQ_ID}"
|
|
94
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-init
|
|
3
|
+
description: 'Initialize a requirement with harness state and context package. Use when starting a new REQ/BUG and preparing deterministic execution context for the next stages.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flow-Init Skill
|
|
7
|
+
|
|
8
|
+
> [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
|
+
初始化需求目录的 harness 运行状态,并生成可执行上下文包。
|
|
13
|
+
|
|
14
|
+
## Long-Running Harness Protocol(Initializer/Worker/Done Gate)
|
|
15
|
+
|
|
16
|
+
为与 `/core:*` 保持一致,`/flow:init` 也采用会话分层协议。
|
|
17
|
+
|
|
18
|
+
### Initializer Session(为后续窗口建立可恢复上下文)
|
|
19
|
+
|
|
20
|
+
在执行 `harness:init + harness:pack` 后,确保以下工件存在:
|
|
21
|
+
- `devflow/requirements/${REQ_ID}/session-checklist.json`
|
|
22
|
+
- 至少包含 `flow:init/flow:spec/flow:dev/flow:verify/flow:release` 五个阶段,默认 `passes=false`
|
|
23
|
+
- `devflow/requirements/${REQ_ID}/session-progress.md`
|
|
24
|
+
- 记录本窗口完成内容、风险和阻塞
|
|
25
|
+
- `devflow/requirements/${REQ_ID}/session-handoff.md`
|
|
26
|
+
- 明确下一窗口唯一优先动作(通常是 `/flow:spec "${REQ_ID}"`)
|
|
27
|
+
|
|
28
|
+
### Worker Session(只做 init 的原子闭环)
|
|
29
|
+
|
|
30
|
+
每次仅执行一个最小闭环:
|
|
31
|
+
1. 读取 `session-progress.md` 与 `session-handoff.md`
|
|
32
|
+
2. 运行 `harness:init`
|
|
33
|
+
3. 运行 `harness:pack`
|
|
34
|
+
4. 验证产物并更新 session 工件
|
|
35
|
+
|
|
36
|
+
### Done Gate(禁止口头完成)
|
|
37
|
+
|
|
38
|
+
仅当以下条件同时满足才允许标记 `flow:init` 为完成:
|
|
39
|
+
- `harness-state.json.status == "initialized"`
|
|
40
|
+
- `context-package.md` 存在且包含 Next Commands
|
|
41
|
+
- `session-checklist.json` 中 `flow:init.passes == true`
|
|
42
|
+
|
|
43
|
+
## Input Format
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
/flow:init "REQ_ID|TITLE|PLAN_URLS?"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- `REQ_ID`: `REQ-123` 或 `BUG-123`
|
|
50
|
+
- `TITLE`: 需求标题
|
|
51
|
+
- `PLAN_URLS`: 可选,逗号分隔
|
|
52
|
+
|
|
53
|
+
## Execution Steps
|
|
54
|
+
|
|
55
|
+
1. 解析输入,提取 `REQ_ID`、`TITLE`、`PLAN_URLS`。
|
|
56
|
+
|
|
57
|
+
2. **读取项目级 specs/ 了解当前系统状态**(v4.3 新增):
|
|
58
|
+
- 读取 `devflow/specs/README.md` 了解模块结构
|
|
59
|
+
- 扫描 `devflow/specs/*/spec.md` 识别相关模块
|
|
60
|
+
- 记录当前系统状态到上下文
|
|
61
|
+
|
|
62
|
+
3. 组装 goal 文本:
|
|
63
|
+
- `Deliver <REQ_ID>: <TITLE>`
|
|
64
|
+
- 若有 URL,追加 `Sources: <URLS>`。
|
|
65
|
+
|
|
66
|
+
4. 运行初始化:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm run harness:init -- --change-id "${REQ_ID}" --goal "${GOAL}"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
5. 运行上下文打包:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm run harness:pack -- --change-id "${REQ_ID}" --goal "${GOAL}"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
6. **生成 proposal.md**(v4.3 新增,替代 PRD.md):
|
|
79
|
+
- 基于 TITLE 和 PLAN_URLS 生成 proposal.md
|
|
80
|
+
- 格式:Why(为什么需要)+ What(要做什么)
|
|
81
|
+
- 使用 `.claude/docs/templates/PROPOSAL_TEMPLATE.md`
|
|
82
|
+
- 输出到 `devflow/requirements/${REQ_ID}/proposal.md`
|
|
83
|
+
|
|
84
|
+
7. **创建 specs/ 目录**(v4.3 新增):
|
|
85
|
+
- 创建 `devflow/requirements/${REQ_ID}/specs/` 目录
|
|
86
|
+
- 准备存放 Delta spec.md
|
|
87
|
+
|
|
88
|
+
8. 验证输出文件:
|
|
89
|
+
- `devflow/requirements/${REQ_ID}/harness-state.json`
|
|
90
|
+
- `devflow/requirements/${REQ_ID}/context-package.md`
|
|
91
|
+
- `devflow/requirements/${REQ_ID}/proposal.md` ⭐ 新增
|
|
92
|
+
- `devflow/requirements/${REQ_ID}/specs/` 目录存在 ⭐ 新增
|
|
93
|
+
|
|
94
|
+
## Exit Criteria
|
|
95
|
+
|
|
96
|
+
- `harness-state.json.status == "initialized"`
|
|
97
|
+
- `context-package.md` 存在并包含 Next Commands 段落
|
|
98
|
+
- `proposal.md` 存在且包含 Why 和 What 章节 ⭐ v4.3 新增
|
|
99
|
+
- `specs/` 目录已创建 ⭐ v4.3 新增
|
|
100
|
+
|
|
101
|
+
## Next Step
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
/flow:spec "${REQ_ID}"
|
|
105
|
+
```
|
|
@@ -23,25 +23,36 @@ description: 'Release a verified requirement and run runtime cleanup. Use only a
|
|
|
23
23
|
|
|
24
24
|
1. 检查 `report-card.json`:
|
|
25
25
|
- `overall` 必须为 `pass`
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
2. **合并 Delta specs 到项目级 specs/**(v4.3 新增):
|
|
28
|
+
- 检测 `devflow/requirements/${REQ_ID}/specs/` 目录
|
|
29
|
+
- 遍历所有模块的 Delta spec.md
|
|
30
|
+
- 调用 `delta-parser.ts merge` 合并到 `devflow/specs/{module}/spec.md`
|
|
31
|
+
- 自动更新项目级 spec.md 的版本号和时间戳
|
|
32
|
+
- 记录合并结果到 RELEASE_NOTE.md
|
|
33
|
+
|
|
34
|
+
3. 运行发布:
|
|
27
35
|
|
|
28
36
|
```bash
|
|
29
37
|
npm run harness:release -- --change-id "${REQ_ID}"
|
|
30
38
|
```
|
|
31
39
|
|
|
32
|
-
|
|
40
|
+
4. 运行熵清理:
|
|
33
41
|
|
|
34
42
|
```bash
|
|
35
43
|
npm run harness:janitor -- --hours ${HOURS}
|
|
36
44
|
```
|
|
37
45
|
|
|
38
|
-
|
|
46
|
+
5. 验证输出:
|
|
39
47
|
- `devflow/requirements/${REQ_ID}/RELEASE_NOTE.md`
|
|
40
48
|
- `devflow/requirements/${REQ_ID}/harness-state.json` 中 `status == "released"`
|
|
49
|
+
- 项目级 `devflow/specs/{module}/spec.md` 已更新版本号 ⭐ v4.3 新增
|
|
41
50
|
|
|
42
51
|
## Exit Criteria
|
|
43
52
|
|
|
44
53
|
- 发布文件存在且状态为 released
|
|
54
|
+
- Delta specs 已成功合并到项目级 specs/ ⭐ v4.3 新增
|
|
55
|
+
- 项目级 spec.md 版本号已更新 ⭐ v4.3 新增
|
|
45
56
|
- janitor 执行成功
|
|
46
57
|
|
|
47
58
|
## Next Step
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-spec
|
|
3
|
+
description: 'Generate and refresh task-manifest for a requirement. Use when converting requirement context into dependency-aware executable tasks.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flow-Spec Skill
|
|
7
|
+
|
|
8
|
+
> [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
|
+
将需求上下文转换为 `task-manifest.json`,作为后续执行唯一任务源。
|
|
13
|
+
|
|
14
|
+
## Long-Running Harness Protocol(Initializer/Worker/Done Gate)
|
|
15
|
+
|
|
16
|
+
`/flow:spec` 必须以“可恢复、可验证”的增量方式生成计划,而不是一次性黑箱产出。
|
|
17
|
+
|
|
18
|
+
### Session Start(先同步上下文,再规划)
|
|
19
|
+
|
|
20
|
+
每个窗口启动先读取:
|
|
21
|
+
- `devflow/requirements/${REQ_ID}/session-checklist.json`(若存在)
|
|
22
|
+
- `devflow/requirements/${REQ_ID}/session-progress.md`(若存在)
|
|
23
|
+
- `devflow/requirements/${REQ_ID}/session-handoff.md`(若存在)
|
|
24
|
+
- `devflow/requirements/${REQ_ID}/context-package.md`
|
|
25
|
+
- 旧版 `task-manifest.json`(若存在)
|
|
26
|
+
|
|
27
|
+
### Worker Session(一次只收敛一个规划目标)
|
|
28
|
+
|
|
29
|
+
每轮只完成一个最小目标,例如:
|
|
30
|
+
- 修正一个依赖子图
|
|
31
|
+
- 补齐一组缺失的 `run` 指令
|
|
32
|
+
- 处理一次 `--overwrite` 下的清理重建
|
|
33
|
+
|
|
34
|
+
完成后必须:
|
|
35
|
+
1. 运行 `harness:plan` 生成/刷新 manifest
|
|
36
|
+
2. 校验 schema 与依赖无环
|
|
37
|
+
3. 更新 progress/handoff,写明下一轮唯一目标
|
|
38
|
+
|
|
39
|
+
### Done Gate
|
|
40
|
+
|
|
41
|
+
仅当以下条件满足才标记 `flow:spec` 完成:
|
|
42
|
+
- `task-manifest.json` 存在且 `tasks` 非空
|
|
43
|
+
- `id/dependsOn/run` 字段完整且无自循环
|
|
44
|
+
- `session-checklist.json` 中 `flow:spec.passes == true`
|
|
45
|
+
|
|
46
|
+
## Input Format
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
/flow:spec "REQ_ID" [--overwrite]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Execution Steps
|
|
53
|
+
|
|
54
|
+
1. 解析 `REQ_ID` 和可选 `--overwrite`。
|
|
55
|
+
|
|
56
|
+
2. **读取项目级 specs/ 了解当前系统状态**(v4.3 新增):
|
|
57
|
+
- 读取 `devflow/specs/README.md` 了解模块结构
|
|
58
|
+
- 扫描 `devflow/specs/*/spec.md` 识别相关模块
|
|
59
|
+
- 记录当前系统状态到上下文
|
|
60
|
+
|
|
61
|
+
3. **生成 design.md**(v4.3 新增,替代 TECH_DESIGN.md):
|
|
62
|
+
- 基于 `proposal.md` 的 What 章节
|
|
63
|
+
- 基于项目级 `specs/` 的当前状态
|
|
64
|
+
- 输出到 `devflow/requirements/${REQ_ID}/design.md`
|
|
65
|
+
- 格式:How(技术方案)+ Implementation(实现细节)
|
|
66
|
+
|
|
67
|
+
4. **生成 Delta specs/**(v4.3 新增):
|
|
68
|
+
- 基于 `proposal.md` 和 `design.md`
|
|
69
|
+
- 为每个受影响的模块生成 Delta spec.md
|
|
70
|
+
- 输出到 `devflow/requirements/${REQ_ID}/specs/{module}/spec.md`
|
|
71
|
+
- 格式:ADDED/MODIFIED/REMOVED/RENAMED Requirements
|
|
72
|
+
- 使用 `.claude/docs/templates/SPEC_TEMPLATE_DELTA.md`
|
|
73
|
+
|
|
74
|
+
5. **自动反扩散检查**(v4.3 新增):
|
|
75
|
+
- 运行 `bash .claude/scripts/validate-scope.sh "${REQ_ID}"`
|
|
76
|
+
- 对比 `proposal.md` 原始意图与 Delta specs 的 ADDED 需求
|
|
77
|
+
- 生成 `scope-creep-report.md`
|
|
78
|
+
- 如检测到范围扩散,阻塞并要求人工确认
|
|
79
|
+
|
|
80
|
+
6. 运行计划生成:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm run harness:plan -- --change-id "${REQ_ID}" [--overwrite]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
7. 校验输出:
|
|
87
|
+
- `devflow/requirements/${REQ_ID}/task-manifest.json`
|
|
88
|
+
- `tasks` 数组非空,`id/dependsOn/run` 字段完整
|
|
89
|
+
|
|
90
|
+
## Exit Criteria
|
|
91
|
+
|
|
92
|
+
- `design.md` 存在且包含 How 和 Implementation 章节 ⭐ v4.3 新增
|
|
93
|
+
- `specs/` 目录存在且至少有一个模块的 Delta spec.md ⭐ v4.3 新增
|
|
94
|
+
- `scope-creep-report.md` 存在且无阻塞性警告 ⭐ v4.3 新增
|
|
95
|
+
- `task-manifest.json` 可通过 schema 校验
|
|
96
|
+
- 任务依赖图无自循环(由 planner 保障)
|
|
97
|
+
|
|
98
|
+
## Next Step
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
/flow:dev "${REQ_ID}"
|
|
102
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# npm-release Skill
|
|
2
|
+
|
|
3
|
+
Version management skill with semantic versioning enforcement.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm-release/
|
|
9
|
+
├── SKILL.md # Main workflow instructions
|
|
10
|
+
├── scripts/
|
|
11
|
+
│ ├── validate-version-sync.sh # Check version consistency
|
|
12
|
+
│ ├── version-decision-tree.sh # Calculate next version
|
|
13
|
+
│ └── atomic-version-bump.sh # Atomic version update
|
|
14
|
+
└── references/
|
|
15
|
+
└── version-decision-guide.md # Detailed SemVer rules
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Purpose
|
|
19
|
+
|
|
20
|
+
Prevents version chaos by enforcing:
|
|
21
|
+
1. Semantic versioning rules (no arbitrary jumps)
|
|
22
|
+
2. Atomic synchronization (package.json + CHANGELOG.md + git tags)
|
|
23
|
+
3. Format consistency (vX.Y.Z everywhere)
|
|
24
|
+
|
|
25
|
+
## Key Scripts
|
|
26
|
+
|
|
27
|
+
### validate-version-sync.sh
|
|
28
|
+
Checks that package.json, git tags, and CHANGELOG.md all have matching versions.
|
|
29
|
+
|
|
30
|
+
### version-decision-tree.sh
|
|
31
|
+
Enforces SemVer rules:
|
|
32
|
+
- Breaking change → MAJOR (X.0.0)
|
|
33
|
+
- New feature → MINOR (X.Y.0)
|
|
34
|
+
- Bug fix → PATCH (X.Y.Z)
|
|
35
|
+
|
|
36
|
+
### atomic-version-bump.sh
|
|
37
|
+
Updates all version markers in one transaction, preventing inconsistencies.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Validate current state
|
|
43
|
+
bash scripts/validate-version-sync.sh
|
|
44
|
+
|
|
45
|
+
# Calculate next version
|
|
46
|
+
bash scripts/version-decision-tree.sh 4.2.0 minor
|
|
47
|
+
# Output: 4.3.0
|
|
48
|
+
|
|
49
|
+
# Atomic bump (recommended)
|
|
50
|
+
bash scripts/atomic-version-bump.sh minor "Add export command"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
**[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|