cc-devflow 4.5.9 → 4.5.11
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/skills/cc-act/CHANGELOG.md +11 -0
- package/.claude/skills/cc-act/SKILL.md +19 -10
- package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +1 -1
- package/.claude/skills/cc-act/references/closure-contract.md +1 -1
- package/.claude/skills/cc-act/references/git-commit-guidelines.md +1 -1
- package/.claude/skills/cc-check/CHANGELOG.md +23 -0
- package/.claude/skills/cc-check/PLAYBOOK.md +1 -0
- package/.claude/skills/cc-check/SKILL.md +15 -9
- package/.claude/skills/cc-check/references/review-contract.md +7 -0
- package/.claude/skills/cc-check/scripts/render-report-card.js +6 -1
- package/.claude/skills/cc-dev/CHANGELOG.md +10 -0
- package/.claude/skills/cc-dev/SKILL.md +34 -2
- package/.claude/skills/cc-do/CHANGELOG.md +18 -0
- package/.claude/skills/cc-do/PLAYBOOK.md +7 -7
- package/.claude/skills/cc-do/SKILL.md +47 -40
- package/.claude/skills/cc-do/references/execution-recovery.md +18 -13
- package/.claude/skills/cc-do/scripts/build-task-context.sh +4 -17
- package/.claude/skills/cc-do/scripts/record-review-decision.sh +4 -5
- package/.claude/skills/cc-do/scripts/recover-workflow.sh +9 -11
- package/.claude/skills/cc-do/scripts/verify-task-gates.sh +12 -10
- package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +7 -29
- package/.claude/skills/cc-investigate/CHANGELOG.md +24 -0
- package/.claude/skills/cc-investigate/PLAYBOOK.md +10 -9
- package/.claude/skills/cc-investigate/SKILL.md +163 -417
- package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +56 -10
- package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +6 -6
- package/.claude/skills/cc-investigate/assets/{ANALYSIS_TEMPLATE.md → legacy/ANALYSIS_TEMPLATE.md} +1 -0
- package/.claude/skills/cc-investigate/references/investigation-contract.md +5 -4
- package/.claude/skills/cc-investigate/scripts/bootstrap-analysis.sh +1 -1
- package/.claude/skills/cc-plan/CHANGELOG.md +32 -0
- package/.claude/skills/cc-plan/PLAYBOOK.md +55 -53
- package/.claude/skills/cc-plan/SKILL.md +209 -536
- package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +50 -14
- package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +5 -4
- package/.claude/skills/cc-plan/assets/{DESIGN_TEMPLATE.md → legacy/DESIGN_TEMPLATE.md} +1 -0
- package/.claude/skills/cc-plan/assets/{TINY_DESIGN_TEMPLATE.md → legacy/TINY_DESIGN_TEMPLATE.md} +1 -1
- package/.claude/skills/cc-plan/references/planning-contract.md +12 -10
- package/.claude/skills/cc-review/CHANGELOG.md +6 -0
- package/.claude/skills/cc-review/PLAYBOOK.md +9 -11
- package/.claude/skills/cc-review/SKILL.md +37 -61
- package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +1 -1
- package/.claude/skills/cc-review/references/implementation-review-branch.md +5 -5
- package/.claude/skills/cc-review/references/plan-review-branch.md +1 -1
- package/.claude/skills/cc-review/references/review-methods.md +4 -4
- package/.claude/skills/cc-review/scripts/collect-review-context.sh +14 -7
- package/CHANGELOG.md +30 -0
- package/CONTRIBUTING.md +40 -4
- package/CONTRIBUTING.zh-CN.md +40 -4
- package/README.md +22 -8
- package/README.zh-CN.md +22 -8
- package/bin/cc-devflow-cli.js +293 -36
- package/docs/examples/START-HERE.md +6 -4
- package/docs/examples/example-bindings.json +8 -8
- package/docs/examples/full-design-blocked/README.md +2 -2
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +2 -1
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +3 -2
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/tasks.md +11 -8
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +4 -4
- package/docs/examples/local-handoff/README.md +2 -2
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +2 -1
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +3 -2
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/tasks.md +9 -6
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +1 -1
- package/docs/examples/pdca-loop/README.md +2 -2
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +2 -2
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +2 -1
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +2 -1
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/tasks.md +9 -6
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +1 -1
- package/docs/examples/scripts/check-example-bindings.sh +2 -0
- package/docs/get-shit-done-strategy-audit.md +22 -22
- package/docs/guides/artifact-contract.md +5 -1
- package/docs/guides/getting-started.md +11 -8
- package/docs/guides/getting-started.zh-CN.md +11 -8
- package/docs/guides/minimize-artifacts.md +137 -0
- package/lib/compiler/__tests__/skills-registry.test.js +2 -2
- package/lib/skill-runtime/CLAUDE.md +1 -1
- package/lib/skill-runtime/__tests__/autopilot.test.js +42 -6
- package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +165 -0
- package/lib/skill-runtime/__tests__/benchmark-skills.test.js +109 -0
- package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +2 -2
- package/lib/skill-runtime/__tests__/dispatch.test.js +8 -38
- package/lib/skill-runtime/__tests__/intent.test.js +4 -20
- package/lib/skill-runtime/__tests__/lifecycle.test.js +1 -1
- package/lib/skill-runtime/__tests__/paths.test.js +7 -1
- package/lib/skill-runtime/__tests__/planner.tdd.test.js +61 -0
- package/lib/skill-runtime/__tests__/prepare-pr.test.js +3 -16
- package/lib/skill-runtime/__tests__/query.test.js +388 -7
- package/lib/skill-runtime/__tests__/review-check-integration.test.js +148 -0
- package/lib/skill-runtime/__tests__/review-records.test.js +619 -0
- package/lib/skill-runtime/__tests__/runtime.integration.test.js +64 -23
- package/lib/skill-runtime/__tests__/schemas.test.js +43 -0
- package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +137 -0
- package/lib/skill-runtime/__tests__/task-contract.test.js +874 -0
- package/lib/skill-runtime/__tests__/verify-artifacts.test.js +203 -0
- package/lib/skill-runtime/__tests__/worker-run.test.js +4 -11
- package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +31 -0
- package/lib/skill-runtime/__tests__/workflow-context.test.js +98 -0
- package/lib/skill-runtime/artifacts.js +0 -5
- package/lib/skill-runtime/context-index.js +545 -0
- package/lib/skill-runtime/intent.js +9 -33
- package/lib/skill-runtime/lifecycle.js +1 -1
- package/lib/skill-runtime/operations/CLAUDE.md +2 -2
- package/lib/skill-runtime/operations/dispatch.js +4 -42
- package/lib/skill-runtime/operations/init.js +2 -6
- package/lib/skill-runtime/operations/janitor.js +2 -18
- package/lib/skill-runtime/operations/resume.js +21 -38
- package/lib/skill-runtime/operations/review-records.js +265 -0
- package/lib/skill-runtime/operations/snapshot.js +1 -1
- package/lib/skill-runtime/operations/task-contract.js +593 -0
- package/lib/skill-runtime/operations/worker-run.js +2 -30
- package/lib/skill-runtime/paths.js +4 -4
- package/lib/skill-runtime/planner.js +24 -11
- package/lib/skill-runtime/query-registry.js +2 -2
- package/lib/skill-runtime/query.js +15 -2
- package/lib/skill-runtime/review-records.js +123 -0
- package/lib/skill-runtime/review.js +246 -11
- package/lib/skill-runtime/schemas.js +174 -12
- package/lib/skill-runtime/store.js +0 -10
- package/lib/skill-runtime/task-contract.js +188 -0
- package/lib/skill-runtime/workflow-context.js +748 -0
- package/package.json +6 -2
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [INPUT]: 依赖 runReviewSuite、临时 devflow review artifacts。
|
|
3
|
+
* [OUTPUT]: 验证 cc-check review 读取 review-findings.json 优先并按 legacy 层级 fallback。
|
|
4
|
+
* [POS]: REQ-003-minimize-workflow-artifacts T015 的 Red/Green 证据。
|
|
5
|
+
* [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const os = require('os');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
|
|
12
|
+
const { runReviewSuite } = require('../review');
|
|
13
|
+
|
|
14
|
+
function writeJson(filePath, value) {
|
|
15
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
16
|
+
fs.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function writeText(filePath, value) {
|
|
20
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
21
|
+
fs.writeFileSync(filePath, value);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function makeReviewRoot(changeId, changeKey) {
|
|
25
|
+
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'cc-devflow-review-check-'));
|
|
26
|
+
const reviewDir = path.join(repoRoot, 'devflow', 'changes', changeKey, 'review');
|
|
27
|
+
fs.mkdirSync(reviewDir, { recursive: true });
|
|
28
|
+
return { repoRoot, reviewDir, changeId, changeKey };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function findingsDoc(overrides = {}) {
|
|
32
|
+
return {
|
|
33
|
+
schema: 'review-findings.v2',
|
|
34
|
+
change: 'REQ-140-review-records',
|
|
35
|
+
reviewId: 'RVW-20260512-001',
|
|
36
|
+
headSha: 'def456',
|
|
37
|
+
freshness: {
|
|
38
|
+
status: 'fresh',
|
|
39
|
+
reviewedCommit: 'def456',
|
|
40
|
+
currentCommit: 'def456',
|
|
41
|
+
commitsSinceReview: 0
|
|
42
|
+
},
|
|
43
|
+
summary: {
|
|
44
|
+
status: 'findings',
|
|
45
|
+
blockingCount: 1,
|
|
46
|
+
warningCount: 0,
|
|
47
|
+
next: 'cc-do'
|
|
48
|
+
},
|
|
49
|
+
findings: [
|
|
50
|
+
{
|
|
51
|
+
id: 'F001',
|
|
52
|
+
severity: 'important',
|
|
53
|
+
confidence: 8,
|
|
54
|
+
displayTier: 'blocking',
|
|
55
|
+
fingerprint: 'sha256:f001',
|
|
56
|
+
scope: 'inside current requirement blast radius',
|
|
57
|
+
path: 'lib/skill-runtime/review.js',
|
|
58
|
+
evidence: 'review records should be consumed before legacy report text',
|
|
59
|
+
recommendation: 'read review-findings.json first',
|
|
60
|
+
route: 'cc-do'
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
...overrides
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function runReviewCase(files) {
|
|
68
|
+
const ctx = makeReviewRoot('REQ-140', 'REQ-140-review-records');
|
|
69
|
+
if (files.findings) {
|
|
70
|
+
writeJson(path.join(ctx.reviewDir, 'review-findings.json'), files.findings);
|
|
71
|
+
}
|
|
72
|
+
if (files.ledger) {
|
|
73
|
+
writeText(path.join(ctx.reviewDir, 'review-ledger.jsonl'), files.ledger);
|
|
74
|
+
}
|
|
75
|
+
if (files.legacyReport) {
|
|
76
|
+
writeText(path.join(ctx.reviewDir, 'cc-review-report.md'), files.legacyReport);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const review = await runReviewSuite({
|
|
80
|
+
repoRoot: ctx.repoRoot,
|
|
81
|
+
changeId: ctx.changeId,
|
|
82
|
+
manifest: { tasks: [] },
|
|
83
|
+
strict: false,
|
|
84
|
+
skipReview: true
|
|
85
|
+
});
|
|
86
|
+
fs.rmSync(ctx.repoRoot, { recursive: true, force: true });
|
|
87
|
+
return review;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
describe('cc-check review record fallback', () => {
|
|
91
|
+
test('reads review-findings.json before ledger or legacy report', async () => {
|
|
92
|
+
const review = await runReviewCase({
|
|
93
|
+
findings: findingsDoc(),
|
|
94
|
+
ledger: '{"schema":"review-ledger.v2","change":"REQ-140-review-records","reviewId":"RVW-20260512-002","createdAt":"2026-05-12T00:00:00.000Z","createdBy":"cc-devflow-cli","event":"review-closed","status":"clean","blockingCount":0,"warningCount":0,"next":"cc-check"}\n',
|
|
95
|
+
legacyReport: '# Legacy Report\n'
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
expect(review.recordReview).toMatchObject({
|
|
99
|
+
source: 'review-findings.json',
|
|
100
|
+
status: 'fail',
|
|
101
|
+
freshness: { status: 'fresh' }
|
|
102
|
+
});
|
|
103
|
+
expect(review.findings[0]).toMatchObject({
|
|
104
|
+
id: 'F001',
|
|
105
|
+
source: 'review-records',
|
|
106
|
+
severity: 'important',
|
|
107
|
+
displayTier: 'blocking'
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test('falls back to ledger tail when findings doc is missing', async () => {
|
|
112
|
+
const review = await runReviewCase({
|
|
113
|
+
ledger: [
|
|
114
|
+
'{"schema":"review-ledger.v2","change":"REQ-140-review-records","reviewId":"RVW-20260512-001","createdAt":"2026-05-12T00:00:00.000Z","createdBy":"cc-devflow-cli","event":"review-started","mode":"implementation","scope":"current-diff","baseSha":"abc123","headSha":"def456","selectedNodes":[],"skippedNodes":[],"riskLanes":[]}',
|
|
115
|
+
'{"schema":"review-ledger.v2","change":"REQ-140-review-records","reviewId":"RVW-20260512-001","createdAt":"2026-05-12T00:01:00.000Z","createdBy":"cc-devflow-cli","event":"review-closed","status":"clean","blockingCount":0,"warningCount":0,"next":"cc-check"}'
|
|
116
|
+
].join('\n')
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
expect(review.recordReview).toMatchObject({
|
|
120
|
+
source: 'review-ledger.jsonl',
|
|
121
|
+
status: 'pass',
|
|
122
|
+
summary: expect.stringContaining('review ledger')
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test('falls back to legacy cc-review-report.md with unknown freshness', async () => {
|
|
127
|
+
const review = await runReviewCase({
|
|
128
|
+
legacyReport: '# Legacy Review\n\nNo blocking findings.\n'
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
expect(review.recordReview).toMatchObject({
|
|
132
|
+
source: 'cc-review-report.md',
|
|
133
|
+
status: 'pass',
|
|
134
|
+
freshness: { status: 'unknown' }
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test('blocks when all review records are missing', async () => {
|
|
139
|
+
const review = await runReviewCase({});
|
|
140
|
+
|
|
141
|
+
expect(review.status).toBe('blocked');
|
|
142
|
+
expect(review.recordReview).toMatchObject({
|
|
143
|
+
source: 'review-records',
|
|
144
|
+
status: 'blocked',
|
|
145
|
+
summary: expect.stringContaining('review-missing')
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|