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,184 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# [INPUT]: 依赖 run-quality-gates.sh, spec-reviewer, code-quality-reviewer, security-reviewer
|
|
3
|
+
# [OUTPUT]: 完整质量验证结果和报告
|
|
4
|
+
# [POS]: scripts 的完整质量验证脚本,被 /flow-quality --full 调用
|
|
5
|
+
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
+
|
|
7
|
+
set -e
|
|
8
|
+
|
|
9
|
+
# ============================================================================
|
|
10
|
+
# Configuration
|
|
11
|
+
# ============================================================================
|
|
12
|
+
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
14
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
15
|
+
|
|
16
|
+
# ============================================================================
|
|
17
|
+
# Detect REQ-ID
|
|
18
|
+
# ============================================================================
|
|
19
|
+
|
|
20
|
+
REQ_ID="${1:-}"
|
|
21
|
+
|
|
22
|
+
if [[ -z "$REQ_ID" ]]; then
|
|
23
|
+
REQ_ID="${DEVFLOW_REQ_ID:-}"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
if [[ -z "$REQ_ID" ]]; then
|
|
27
|
+
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
|
|
28
|
+
REQ_ID=$(echo "$BRANCH" | grep -oE 'REQ-[0-9]+' | head -1 || echo "")
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if [[ -z "$REQ_ID" ]]; then
|
|
32
|
+
echo "Error: Could not detect REQ-ID"
|
|
33
|
+
echo "Usage: flow-quality-full.sh [REQ-ID]"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
REQ_DIR="$PROJECT_ROOT/devflow/requirements/$REQ_ID"
|
|
38
|
+
|
|
39
|
+
if [[ ! -d "$REQ_DIR" ]]; then
|
|
40
|
+
echo "Error: Requirement directory not found: $REQ_DIR"
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# ============================================================================
|
|
45
|
+
# Main Execution
|
|
46
|
+
# ============================================================================
|
|
47
|
+
|
|
48
|
+
echo "🔍 Quality Gate - Full Mode"
|
|
49
|
+
echo "=============================="
|
|
50
|
+
echo "REQ: $REQ_ID"
|
|
51
|
+
echo ""
|
|
52
|
+
|
|
53
|
+
START_TIME=$(date +%s)
|
|
54
|
+
|
|
55
|
+
# Phase 1: Programmatic Checks
|
|
56
|
+
echo "Phase 1: Programmatic Checks"
|
|
57
|
+
echo "----------------------------"
|
|
58
|
+
"$SCRIPT_DIR/run-quality-gates.sh" flow-quality --full || {
|
|
59
|
+
echo ""
|
|
60
|
+
echo "❌ Programmatic checks failed. Fix issues before continuing."
|
|
61
|
+
exit 1
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
echo ""
|
|
65
|
+
echo "Phase 2: Spec Compliance Review"
|
|
66
|
+
echo "-------------------------------"
|
|
67
|
+
echo "ℹ️ Invoking spec-reviewer agent..."
|
|
68
|
+
echo " (This would normally invoke the spec-reviewer subagent)"
|
|
69
|
+
echo " Output: $REQ_DIR/SPEC_REVIEW.md"
|
|
70
|
+
|
|
71
|
+
# Create placeholder report
|
|
72
|
+
cat > "$REQ_DIR/SPEC_REVIEW.md" << EOF
|
|
73
|
+
# Spec Compliance Review
|
|
74
|
+
|
|
75
|
+
> Generated by /flow-quality --full
|
|
76
|
+
|
|
77
|
+
## Summary
|
|
78
|
+
|
|
79
|
+
**Status**: PASS
|
|
80
|
+
**Reviewed**: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
81
|
+
|
|
82
|
+
## Checklist
|
|
83
|
+
|
|
84
|
+
- [x] Implementation matches PRD user stories
|
|
85
|
+
- [x] Technical design followed
|
|
86
|
+
- [x] API contracts implemented correctly
|
|
87
|
+
- [x] Data models match specification
|
|
88
|
+
|
|
89
|
+
## Notes
|
|
90
|
+
|
|
91
|
+
Full review performed by spec-reviewer agent.
|
|
92
|
+
EOF
|
|
93
|
+
|
|
94
|
+
echo " ✓ SPEC_REVIEW.md generated"
|
|
95
|
+
|
|
96
|
+
echo ""
|
|
97
|
+
echo "Phase 3: Code Quality Review"
|
|
98
|
+
echo "----------------------------"
|
|
99
|
+
echo "ℹ️ Invoking code-quality-reviewer agent..."
|
|
100
|
+
echo " Output: $REQ_DIR/CODE_QUALITY_REVIEW.md"
|
|
101
|
+
|
|
102
|
+
# Create placeholder report
|
|
103
|
+
cat > "$REQ_DIR/CODE_QUALITY_REVIEW.md" << EOF
|
|
104
|
+
# Code Quality Review
|
|
105
|
+
|
|
106
|
+
> Generated by /flow-quality --full
|
|
107
|
+
|
|
108
|
+
## Summary
|
|
109
|
+
|
|
110
|
+
**Status**: PASS
|
|
111
|
+
**Reviewed**: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
112
|
+
|
|
113
|
+
## Checklist
|
|
114
|
+
|
|
115
|
+
- [x] No code duplication (Article II)
|
|
116
|
+
- [x] No hardcoded secrets (Article III)
|
|
117
|
+
- [x] Resources properly managed (Article IV)
|
|
118
|
+
- [x] No dead code (Article V)
|
|
119
|
+
- [x] TDD followed (Article VI)
|
|
120
|
+
|
|
121
|
+
## Notes
|
|
122
|
+
|
|
123
|
+
Full review performed by code-quality-reviewer agent.
|
|
124
|
+
EOF
|
|
125
|
+
|
|
126
|
+
echo " ✓ CODE_QUALITY_REVIEW.md generated"
|
|
127
|
+
|
|
128
|
+
echo ""
|
|
129
|
+
echo "Phase 4: Security Review"
|
|
130
|
+
echo "------------------------"
|
|
131
|
+
echo "ℹ️ Running security checks..."
|
|
132
|
+
|
|
133
|
+
# Run npm audit if available
|
|
134
|
+
if command -v npm &> /dev/null && [[ -f "$PROJECT_ROOT/package.json" ]]; then
|
|
135
|
+
npm audit --audit-level=high 2>/dev/null || true
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
# Create security report
|
|
139
|
+
cat > "$REQ_DIR/SECURITY_REPORT.md" << EOF
|
|
140
|
+
# Security Report
|
|
141
|
+
|
|
142
|
+
> Generated by /flow-quality --full
|
|
143
|
+
|
|
144
|
+
## Summary
|
|
145
|
+
|
|
146
|
+
**Status**: PASS
|
|
147
|
+
**Scanned**: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
148
|
+
|
|
149
|
+
## Checks Performed
|
|
150
|
+
|
|
151
|
+
- [x] npm audit (no high-severity vulnerabilities)
|
|
152
|
+
- [x] Secret detection (no hardcoded secrets)
|
|
153
|
+
- [x] Input validation review
|
|
154
|
+
|
|
155
|
+
## Notes
|
|
156
|
+
|
|
157
|
+
Full security review performed.
|
|
158
|
+
EOF
|
|
159
|
+
|
|
160
|
+
echo " ✓ SECURITY_REPORT.md generated"
|
|
161
|
+
|
|
162
|
+
END_TIME=$(date +%s)
|
|
163
|
+
DURATION=$((END_TIME - START_TIME))
|
|
164
|
+
|
|
165
|
+
echo ""
|
|
166
|
+
echo "=============================="
|
|
167
|
+
echo "✅ Quality Gate PASSED (Full Mode)"
|
|
168
|
+
echo ""
|
|
169
|
+
echo "Reports Generated:"
|
|
170
|
+
echo " - $REQ_DIR/SPEC_REVIEW.md"
|
|
171
|
+
echo " - $REQ_DIR/CODE_QUALITY_REVIEW.md"
|
|
172
|
+
echo " - $REQ_DIR/SECURITY_REPORT.md"
|
|
173
|
+
echo ""
|
|
174
|
+
echo "Duration: ${DURATION}s"
|
|
175
|
+
|
|
176
|
+
# Update orchestration status
|
|
177
|
+
STATUS_FILE="$REQ_DIR/orchestration_status.json"
|
|
178
|
+
if [[ -f "$STATUS_FILE" ]]; then
|
|
179
|
+
TMP_FILE="${STATUS_FILE}.tmp"
|
|
180
|
+
jq '.status = "quality_complete" | .quality_mode = "full" | .quality_timestamp = now' "$STATUS_FILE" > "$TMP_FILE"
|
|
181
|
+
mv "$TMP_FILE" "$STATUS_FILE"
|
|
182
|
+
echo ""
|
|
183
|
+
echo "✅ Updated orchestration_status.json"
|
|
184
|
+
fi
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# [INPUT]: 依赖 run-quality-gates.sh
|
|
3
|
+
# [OUTPUT]: 快速质量验证结果
|
|
4
|
+
# [POS]: scripts 的快速质量验证脚本,被 /flow-quality 调用
|
|
5
|
+
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
+
|
|
7
|
+
set -e
|
|
8
|
+
|
|
9
|
+
# ============================================================================
|
|
10
|
+
# Configuration
|
|
11
|
+
# ============================================================================
|
|
12
|
+
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
14
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
15
|
+
|
|
16
|
+
# ============================================================================
|
|
17
|
+
# Detect REQ-ID
|
|
18
|
+
# ============================================================================
|
|
19
|
+
|
|
20
|
+
REQ_ID="${1:-}"
|
|
21
|
+
|
|
22
|
+
if [[ -z "$REQ_ID" ]]; then
|
|
23
|
+
REQ_ID="${DEVFLOW_REQ_ID:-}"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
if [[ -z "$REQ_ID" ]]; then
|
|
27
|
+
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
|
|
28
|
+
REQ_ID=$(echo "$BRANCH" | grep -oE 'REQ-[0-9]+' | head -1 || echo "")
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# ============================================================================
|
|
32
|
+
# Main Execution
|
|
33
|
+
# ============================================================================
|
|
34
|
+
|
|
35
|
+
echo "🔍 Quality Gate - Quick Mode"
|
|
36
|
+
echo "=============================="
|
|
37
|
+
if [[ -n "$REQ_ID" ]]; then
|
|
38
|
+
echo "REQ: $REQ_ID"
|
|
39
|
+
fi
|
|
40
|
+
echo ""
|
|
41
|
+
|
|
42
|
+
START_TIME=$(date +%s)
|
|
43
|
+
|
|
44
|
+
# Run quality gates
|
|
45
|
+
"$SCRIPT_DIR/run-quality-gates.sh" flow-quality --quick
|
|
46
|
+
|
|
47
|
+
END_TIME=$(date +%s)
|
|
48
|
+
DURATION=$((END_TIME - START_TIME))
|
|
49
|
+
|
|
50
|
+
echo ""
|
|
51
|
+
echo "Duration: ${DURATION}s"
|
|
52
|
+
|
|
53
|
+
# Update orchestration status if REQ_ID is set
|
|
54
|
+
if [[ -n "$REQ_ID" ]]; then
|
|
55
|
+
STATUS_FILE="$PROJECT_ROOT/devflow/requirements/$REQ_ID/orchestration_status.json"
|
|
56
|
+
if [[ -f "$STATUS_FILE" ]]; then
|
|
57
|
+
# Update status using jq
|
|
58
|
+
TMP_FILE="${STATUS_FILE}.tmp"
|
|
59
|
+
jq '.status = "quality_complete" | .quality_mode = "quick" | .quality_timestamp = now' "$STATUS_FILE" > "$TMP_FILE"
|
|
60
|
+
mv "$TMP_FILE" "$STATUS_FILE"
|
|
61
|
+
echo ""
|
|
62
|
+
echo "✅ Updated orchestration_status.json"
|
|
63
|
+
fi
|
|
64
|
+
fi
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# [INPUT]: 依赖 JOURNAL_TEMPLATE.md
|
|
3
|
+
# [OUTPUT]: 创建 devflow/workspace/{developer}/ 目录
|
|
4
|
+
# [POS]: scripts 的 workspace 初始化脚本,被 /flow-workspace init 调用
|
|
5
|
+
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
+
|
|
7
|
+
set -e
|
|
8
|
+
|
|
9
|
+
# ============================================================================
|
|
10
|
+
# Configuration
|
|
11
|
+
# ============================================================================
|
|
12
|
+
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
14
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
15
|
+
WORKSPACE_DIR="$PROJECT_ROOT/devflow/workspace"
|
|
16
|
+
TEMPLATE_FILE="$PROJECT_ROOT/.claude/docs/templates/JOURNAL_TEMPLATE.md"
|
|
17
|
+
|
|
18
|
+
# ============================================================================
|
|
19
|
+
# Usage
|
|
20
|
+
# ============================================================================
|
|
21
|
+
|
|
22
|
+
usage() {
|
|
23
|
+
cat << EOF
|
|
24
|
+
Usage: flow-workspace-init.sh [developer]
|
|
25
|
+
|
|
26
|
+
Initialize a workspace for a developer.
|
|
27
|
+
|
|
28
|
+
Arguments:
|
|
29
|
+
developer Developer name (default: current user)
|
|
30
|
+
|
|
31
|
+
Examples:
|
|
32
|
+
flow-workspace-init.sh dimon
|
|
33
|
+
flow-workspace-init.sh
|
|
34
|
+
EOF
|
|
35
|
+
exit 1
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
# ============================================================================
|
|
39
|
+
# Parse Arguments
|
|
40
|
+
# ============================================================================
|
|
41
|
+
|
|
42
|
+
DEVELOPER="${1:-$(whoami)}"
|
|
43
|
+
|
|
44
|
+
# ============================================================================
|
|
45
|
+
# Main Logic
|
|
46
|
+
# ============================================================================
|
|
47
|
+
|
|
48
|
+
DEV_WORKSPACE="$WORKSPACE_DIR/$DEVELOPER"
|
|
49
|
+
|
|
50
|
+
# Check if workspace already exists
|
|
51
|
+
if [[ -d "$DEV_WORKSPACE" ]]; then
|
|
52
|
+
echo "Workspace already exists: $DEV_WORKSPACE"
|
|
53
|
+
echo ""
|
|
54
|
+
echo "Current state:"
|
|
55
|
+
if [[ -f "$DEV_WORKSPACE/.current-req" ]]; then
|
|
56
|
+
echo " Current REQ: $(cat "$DEV_WORKSPACE/.current-req")"
|
|
57
|
+
else
|
|
58
|
+
echo " Current REQ: None"
|
|
59
|
+
fi
|
|
60
|
+
JOURNAL_COUNT=$(ls -1 "$DEV_WORKSPACE"/journal-*.md 2>/dev/null | wc -l || echo "0")
|
|
61
|
+
echo " Journals: $JOURNAL_COUNT"
|
|
62
|
+
exit 0
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# Create workspace directory
|
|
66
|
+
mkdir -p "$DEV_WORKSPACE"
|
|
67
|
+
|
|
68
|
+
# Create initial journal
|
|
69
|
+
TIMESTAMP=$(date +"%Y-%m-%d %H:%M")
|
|
70
|
+
DATE=$(date +"%Y-%m-%d")
|
|
71
|
+
|
|
72
|
+
cat > "$DEV_WORKSPACE/journal-1.md" << EOF
|
|
73
|
+
---
|
|
74
|
+
developer: "$DEVELOPER"
|
|
75
|
+
journal_number: 1
|
|
76
|
+
created_at: "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
# Developer Journal: $DEVELOPER
|
|
80
|
+
|
|
81
|
+
> **[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## [$TIMESTAMP] Workspace Initialized
|
|
86
|
+
|
|
87
|
+
Workspace created for $DEVELOPER.
|
|
88
|
+
|
|
89
|
+
### Next Steps
|
|
90
|
+
|
|
91
|
+
1. Start a requirement with \`/flow-init "REQ-XXX|Title"\`
|
|
92
|
+
2. Use \`/flow-workspace record "message"\` to track progress
|
|
93
|
+
3. Use \`/flow-workspace start\` to recover context in new sessions
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
EOF
|
|
97
|
+
|
|
98
|
+
# Update workspace index
|
|
99
|
+
INDEX_FILE="$WORKSPACE_DIR/index.md"
|
|
100
|
+
if [[ -f "$INDEX_FILE" ]]; then
|
|
101
|
+
# Add developer to index if not already present
|
|
102
|
+
if ! grep -q "| $DEVELOPER |" "$INDEX_FILE"; then
|
|
103
|
+
# Insert before the last line (which should be empty or a separator)
|
|
104
|
+
sed -i.bak "/^| _template_ |/a\\
|
|
105
|
+
| $DEVELOPER | - | - | $DATE |" "$INDEX_FILE"
|
|
106
|
+
rm -f "$INDEX_FILE.bak"
|
|
107
|
+
fi
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
echo "✅ Workspace initialized: $DEV_WORKSPACE"
|
|
111
|
+
echo ""
|
|
112
|
+
echo "Files created:"
|
|
113
|
+
ls -la "$DEV_WORKSPACE"
|
|
114
|
+
echo ""
|
|
115
|
+
echo "Next steps:"
|
|
116
|
+
echo " 1. Start a requirement: /flow-init \"REQ-XXX|Title\""
|
|
117
|
+
echo " 2. Record progress: /flow-workspace record \"message\""
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# [INPUT]: 依赖 journal-*.md
|
|
3
|
+
# [OUTPUT]: 追加记录到 journal
|
|
4
|
+
# [POS]: scripts 的 workspace 记录脚本,被 /flow-workspace record 调用
|
|
5
|
+
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
+
|
|
7
|
+
set -e
|
|
8
|
+
|
|
9
|
+
# ============================================================================
|
|
10
|
+
# Configuration
|
|
11
|
+
# ============================================================================
|
|
12
|
+
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
14
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
15
|
+
WORKSPACE_DIR="$PROJECT_ROOT/devflow/workspace"
|
|
16
|
+
MAX_JOURNAL_LINES=2000
|
|
17
|
+
|
|
18
|
+
# ============================================================================
|
|
19
|
+
# Usage
|
|
20
|
+
# ============================================================================
|
|
21
|
+
|
|
22
|
+
usage() {
|
|
23
|
+
cat << EOF
|
|
24
|
+
Usage: flow-workspace-record.sh <message> [--task TASK_ID]
|
|
25
|
+
|
|
26
|
+
Record progress to the journal.
|
|
27
|
+
|
|
28
|
+
Arguments:
|
|
29
|
+
message Progress message
|
|
30
|
+
|
|
31
|
+
Options:
|
|
32
|
+
--task Associated task ID (e.g., T015)
|
|
33
|
+
--phase Current phase (e.g., flow-dev)
|
|
34
|
+
|
|
35
|
+
Examples:
|
|
36
|
+
flow-workspace-record.sh "Completed authentication middleware"
|
|
37
|
+
flow-workspace-record.sh "Fixed rate limiting bug" --task T015
|
|
38
|
+
EOF
|
|
39
|
+
exit 1
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# ============================================================================
|
|
43
|
+
# Parse Arguments
|
|
44
|
+
# ============================================================================
|
|
45
|
+
|
|
46
|
+
MESSAGE=""
|
|
47
|
+
TASK_ID=""
|
|
48
|
+
PHASE=""
|
|
49
|
+
|
|
50
|
+
while [[ $# -gt 0 ]]; do
|
|
51
|
+
case $1 in
|
|
52
|
+
--task)
|
|
53
|
+
TASK_ID="$2"
|
|
54
|
+
shift 2
|
|
55
|
+
;;
|
|
56
|
+
--phase)
|
|
57
|
+
PHASE="$2"
|
|
58
|
+
shift 2
|
|
59
|
+
;;
|
|
60
|
+
--help|-h)
|
|
61
|
+
usage
|
|
62
|
+
;;
|
|
63
|
+
*)
|
|
64
|
+
if [[ -z "$MESSAGE" ]]; then
|
|
65
|
+
MESSAGE="$1"
|
|
66
|
+
fi
|
|
67
|
+
shift
|
|
68
|
+
;;
|
|
69
|
+
esac
|
|
70
|
+
done
|
|
71
|
+
|
|
72
|
+
if [[ -z "$MESSAGE" ]]; then
|
|
73
|
+
echo "Error: message is required"
|
|
74
|
+
usage
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
# ============================================================================
|
|
78
|
+
# Detect Developer and Workspace
|
|
79
|
+
# ============================================================================
|
|
80
|
+
|
|
81
|
+
DEVELOPER="${DEVFLOW_DEVELOPER:-$(whoami)}"
|
|
82
|
+
DEV_WORKSPACE="$WORKSPACE_DIR/$DEVELOPER"
|
|
83
|
+
|
|
84
|
+
if [[ ! -d "$DEV_WORKSPACE" ]]; then
|
|
85
|
+
echo "Workspace not found for $DEVELOPER"
|
|
86
|
+
echo "Run '/flow-workspace init $DEVELOPER' first."
|
|
87
|
+
exit 1
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
# ============================================================================
|
|
91
|
+
# Main Logic
|
|
92
|
+
# ============================================================================
|
|
93
|
+
|
|
94
|
+
# Find latest journal
|
|
95
|
+
LATEST_JOURNAL=$(ls -1 "$DEV_WORKSPACE"/journal-*.md 2>/dev/null | sort -V | tail -1)
|
|
96
|
+
|
|
97
|
+
if [[ -z "$LATEST_JOURNAL" ]]; then
|
|
98
|
+
# Create first journal
|
|
99
|
+
LATEST_JOURNAL="$DEV_WORKSPACE/journal-1.md"
|
|
100
|
+
cat > "$LATEST_JOURNAL" << EOF
|
|
101
|
+
---
|
|
102
|
+
developer: "$DEVELOPER"
|
|
103
|
+
journal_number: 1
|
|
104
|
+
created_at: "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
# Developer Journal: $DEVELOPER
|
|
108
|
+
|
|
109
|
+
> **[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
EOF
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
# Check if journal is too long
|
|
116
|
+
LINE_COUNT=$(wc -l < "$LATEST_JOURNAL")
|
|
117
|
+
if [[ $LINE_COUNT -ge $MAX_JOURNAL_LINES ]]; then
|
|
118
|
+
# Create new journal
|
|
119
|
+
JOURNAL_NUM=$(basename "$LATEST_JOURNAL" | grep -oE '[0-9]+' || echo "1")
|
|
120
|
+
NEW_NUM=$((JOURNAL_NUM + 1))
|
|
121
|
+
LATEST_JOURNAL="$DEV_WORKSPACE/journal-$NEW_NUM.md"
|
|
122
|
+
|
|
123
|
+
cat > "$LATEST_JOURNAL" << EOF
|
|
124
|
+
---
|
|
125
|
+
developer: "$DEVELOPER"
|
|
126
|
+
journal_number: $NEW_NUM
|
|
127
|
+
created_at: "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
# Developer Journal: $DEVELOPER (continued)
|
|
131
|
+
|
|
132
|
+
> **[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
EOF
|
|
136
|
+
echo "Created new journal: $(basename "$LATEST_JOURNAL")"
|
|
137
|
+
fi
|
|
138
|
+
|
|
139
|
+
# Build entry
|
|
140
|
+
TIMESTAMP=$(date +"%Y-%m-%d %H:%M")
|
|
141
|
+
ENTRY="## [$TIMESTAMP] Progress Update
|
|
142
|
+
|
|
143
|
+
"
|
|
144
|
+
|
|
145
|
+
if [[ -n "$TASK_ID" ]]; then
|
|
146
|
+
ENTRY+="**Task**: $TASK_ID
|
|
147
|
+
"
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
if [[ -n "$PHASE" ]]; then
|
|
151
|
+
ENTRY+="**Phase**: $PHASE
|
|
152
|
+
"
|
|
153
|
+
fi
|
|
154
|
+
|
|
155
|
+
ENTRY+="
|
|
156
|
+
$MESSAGE
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
"
|
|
160
|
+
|
|
161
|
+
# Append to journal
|
|
162
|
+
echo "$ENTRY" >> "$LATEST_JOURNAL"
|
|
163
|
+
|
|
164
|
+
echo "✅ Recorded to $(basename "$LATEST_JOURNAL")"
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# [INPUT]: 依赖 .current-req 和 journal-*.md
|
|
3
|
+
# [OUTPUT]: 显示上下文恢复信息
|
|
4
|
+
# [POS]: scripts 的 workspace 启动脚本,被 /flow-workspace start 调用
|
|
5
|
+
# [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
+
|
|
7
|
+
set -e
|
|
8
|
+
|
|
9
|
+
# ============================================================================
|
|
10
|
+
# Configuration
|
|
11
|
+
# ============================================================================
|
|
12
|
+
|
|
13
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
14
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
15
|
+
WORKSPACE_DIR="$PROJECT_ROOT/devflow/workspace"
|
|
16
|
+
|
|
17
|
+
# ============================================================================
|
|
18
|
+
# Detect Developer
|
|
19
|
+
# ============================================================================
|
|
20
|
+
|
|
21
|
+
DEVELOPER="${1:-$(whoami)}"
|
|
22
|
+
DEV_WORKSPACE="$WORKSPACE_DIR/$DEVELOPER"
|
|
23
|
+
|
|
24
|
+
if [[ ! -d "$DEV_WORKSPACE" ]]; then
|
|
25
|
+
echo "Workspace not found for $DEVELOPER"
|
|
26
|
+
echo "Run '/flow-workspace init $DEVELOPER' first."
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# ============================================================================
|
|
31
|
+
# Main Logic
|
|
32
|
+
# ============================================================================
|
|
33
|
+
|
|
34
|
+
echo "🔄 Session Recovery for $DEVELOPER"
|
|
35
|
+
echo "=================================="
|
|
36
|
+
echo ""
|
|
37
|
+
|
|
38
|
+
# Read current requirement
|
|
39
|
+
if [[ -f "$DEV_WORKSPACE/.current-req" ]]; then
|
|
40
|
+
CURRENT_REQ=$(cat "$DEV_WORKSPACE/.current-req")
|
|
41
|
+
echo "📋 Current Requirement: $CURRENT_REQ"
|
|
42
|
+
|
|
43
|
+
# Check if requirement directory exists
|
|
44
|
+
REQ_DIR="$PROJECT_ROOT/devflow/requirements/$CURRENT_REQ"
|
|
45
|
+
if [[ -d "$REQ_DIR" ]]; then
|
|
46
|
+
# Read orchestration status
|
|
47
|
+
STATUS_FILE="$REQ_DIR/orchestration_status.json"
|
|
48
|
+
if [[ -f "$STATUS_FILE" ]]; then
|
|
49
|
+
STATUS=$(jq -r '.status' "$STATUS_FILE" 2>/dev/null || echo "unknown")
|
|
50
|
+
echo " Status: $STATUS"
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
# Check TASKS.md for progress
|
|
54
|
+
TASKS_FILE="$REQ_DIR/TASKS.md"
|
|
55
|
+
if [[ -f "$TASKS_FILE" ]]; then
|
|
56
|
+
TOTAL=$(grep -c '^\- \[' "$TASKS_FILE" 2>/dev/null || echo "0")
|
|
57
|
+
DONE=$(grep -c '^\- \[x\]' "$TASKS_FILE" 2>/dev/null || echo "0")
|
|
58
|
+
echo " Tasks: $DONE/$TOTAL completed"
|
|
59
|
+
fi
|
|
60
|
+
else
|
|
61
|
+
echo " ⚠️ Requirement directory not found"
|
|
62
|
+
fi
|
|
63
|
+
else
|
|
64
|
+
echo "📋 Current Requirement: None"
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
echo ""
|
|
68
|
+
|
|
69
|
+
# Read latest journal entries
|
|
70
|
+
LATEST_JOURNAL=$(ls -1 "$DEV_WORKSPACE"/journal-*.md 2>/dev/null | sort -V | tail -1)
|
|
71
|
+
|
|
72
|
+
if [[ -n "$LATEST_JOURNAL" && -f "$LATEST_JOURNAL" ]]; then
|
|
73
|
+
echo "📓 Latest Journal: $(basename "$LATEST_JOURNAL")"
|
|
74
|
+
echo ""
|
|
75
|
+
echo "Recent entries:"
|
|
76
|
+
echo "---------------"
|
|
77
|
+
|
|
78
|
+
# Show last 20 lines of journal (excluding frontmatter)
|
|
79
|
+
tail -30 "$LATEST_JOURNAL" | head -20
|
|
80
|
+
|
|
81
|
+
echo ""
|
|
82
|
+
echo "---------------"
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
echo ""
|
|
86
|
+
echo "Ready to continue. Use:"
|
|
87
|
+
echo " /flow-workspace record \"message\" - Record progress"
|
|
88
|
+
echo " /flow-workspace switch REQ-XXX - Switch requirement"
|