cc-devflow 4.5.14 → 4.5.16
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 +5 -0
- package/.claude/skills/cc-act/SKILL.md +2 -2
- package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +3 -0
- package/.claude/skills/cc-act/scripts/render-pr-brief.sh +113 -33
- package/.claude/skills/cc-check/SKILL.md +0 -1
- package/.claude/skills/cc-dev/CHANGELOG.md +5 -0
- package/.claude/skills/cc-dev/PLAYBOOK.md +6 -3
- package/.claude/skills/cc-dev/SKILL.md +11 -8
- package/.claude/skills/cc-dev/scripts/ensure-work-branch.sh +117 -0
- package/.claude/skills/cc-dev/scripts/prepare-change-worktree.sh +135 -0
- package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +8 -26
- package/.claude/skills/cc-do/SKILL.md +1 -2
- package/.claude/skills/cc-investigate/CHANGELOG.md +15 -0
- package/.claude/skills/cc-investigate/SKILL.md +86 -9
- package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +57 -1
- package/.claude/skills/cc-investigate/references/investigation-contract.md +1 -0
- package/.claude/skills/cc-plan/CHANGELOG.md +23 -0
- package/.claude/skills/cc-plan/PLAYBOOK.md +8 -5
- package/.claude/skills/cc-plan/SKILL.md +91 -20
- package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +59 -8
- package/.claude/skills/cc-plan/references/planning-contract.md +15 -9
- package/.claude/skills/cc-pr-review/CHANGELOG.md +9 -0
- package/.claude/skills/cc-pr-review/PLAYBOOK.md +3 -0
- package/.claude/skills/cc-pr-review/SKILL.md +30 -1
- package/.claude/skills/cc-review/CHANGELOG.md +10 -0
- package/.claude/skills/cc-review/SKILL.md +53 -9
- package/.claude/skills/cc-review/references/implementation-review-branch.md +1 -0
- package/.claude/skills/cc-review/references/plan-review-branch.md +1 -0
- package/.claude/skills/cc-review/references/review-methods.md +30 -0
- package/.claude/skills/cc-roadmap/CHANGELOG.md +6 -0
- package/.claude/skills/cc-roadmap/SKILL.md +1 -1
- package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/markdown.js +274 -69
- package/.claude/skills/cc-roadmap/scripts/lib/roadmap-tracking/schema.js +69 -15
- package/CHANGELOG.md +18 -0
- package/README.md +3 -4
- package/README.zh-CN.md +3 -4
- package/bin/cc-devflow-cli.js +8 -94
- package/docs/examples/example-bindings.json +8 -8
- package/docs/examples/full-design-blocked/BACKLOG.md +12 -1
- package/docs/examples/full-design-blocked/README.md +1 -1
- package/docs/examples/full-design-blocked/ROADMAP.md +2 -2
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/task.md +39 -5
- package/docs/examples/full-design-blocked/roadmap.json +7 -2
- package/docs/examples/local-handoff/BACKLOG.md +12 -1
- package/docs/examples/local-handoff/README.md +1 -1
- package/docs/examples/local-handoff/ROADMAP.md +2 -2
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/task.md +39 -5
- package/docs/examples/local-handoff/roadmap.json +7 -2
- package/docs/examples/pdca-loop/BACKLOG.md +12 -1
- package/docs/examples/pdca-loop/README.md +1 -1
- package/docs/examples/pdca-loop/ROADMAP.md +2 -2
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/task.md +39 -5
- package/docs/examples/pdca-loop/roadmap.json +7 -2
- package/lib/skill-runtime/CLAUDE.md +1 -1
- package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +2 -1
- package/lib/skill-runtime/__tests__/config.test.js +7 -2
- package/lib/skill-runtime/config.js +38 -6
- package/lib/skill-runtime/index.js +1 -9
- package/package.json +1 -1
- package/lib/skill-runtime/errors.js +0 -39
- package/lib/skill-runtime/query-registry.js +0 -101
- package/lib/skill-runtime/query.js +0 -126
- package/lib/skill-runtime/trace.js +0 -22
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [INPUT]: 依赖 task.md、handoff/pr-brief.md 与 Git 状态。
|
|
3
|
-
* [OUTPUT]: 提供 Git-first workflow-context 查询,不读取流程 JSON。
|
|
4
|
-
* [POS]: cc-devflow CLI 的只读上下文层;Git 是历史真相,task.md 是任务真相。
|
|
5
|
-
* [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
const { spawnSync } = require('child_process');
|
|
11
|
-
const { createQueryRegistry } = require('./query-registry');
|
|
12
|
-
const { getChangePaths } = require('./paths');
|
|
13
|
-
const { createTrace } = require('./trace');
|
|
14
|
-
|
|
15
|
-
function readTextIfExists(filePath) {
|
|
16
|
-
return fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function runGit(repoRoot, args) {
|
|
20
|
-
const result = spawnSync('git', args, {
|
|
21
|
-
cwd: repoRoot,
|
|
22
|
-
encoding: 'utf8'
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
if (result.status !== 0) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return result.stdout.trim();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function parseTaskSummary(markdown) {
|
|
33
|
-
const lines = String(markdown || '').split(/\r?\n/);
|
|
34
|
-
const tasks = [];
|
|
35
|
-
|
|
36
|
-
for (const line of lines) {
|
|
37
|
-
const match = line.match(/^\s*-\s+\[( |x|X)\]\s+((?:T\d+|[A-Z]+-\d+)[^:\n]*)(?::\s*)?(.*)$/);
|
|
38
|
-
if (!match) continue;
|
|
39
|
-
|
|
40
|
-
tasks.push({
|
|
41
|
-
id: match[2].trim().split(/\s+/)[0],
|
|
42
|
-
title: (match[3] || match[2]).trim(),
|
|
43
|
-
status: match[1].toLowerCase() === 'x' ? 'done' : 'pending'
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const completed = tasks.filter((task) => task.status === 'done').length;
|
|
48
|
-
const next = tasks.find((task) => task.status === 'pending') || null;
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
total: tasks.length,
|
|
52
|
-
completed,
|
|
53
|
-
pending: tasks.length - completed,
|
|
54
|
-
next
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function getWorkflowContextArtifactRefs(repoRoot, changeId, options = {}) {
|
|
59
|
-
const change = getChangePaths(repoRoot, changeId, options);
|
|
60
|
-
return [
|
|
61
|
-
path.join(change.changeDir, 'task.md'),
|
|
62
|
-
path.join(change.handoffDir, 'pr-brief.md')
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function getWorkflowContextRequiredArtifactRefs(repoRoot, changeId, options = {}) {
|
|
67
|
-
const change = getChangePaths(repoRoot, changeId, options);
|
|
68
|
-
return [path.join(change.changeDir, 'task.md')];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async function getWorkflowContext(repoRoot, changeId, options = {}) {
|
|
72
|
-
const change = getChangePaths(repoRoot, changeId, options);
|
|
73
|
-
const taskPath = path.join(change.changeDir, 'task.md');
|
|
74
|
-
const prBriefPath = path.join(change.handoffDir, 'pr-brief.md');
|
|
75
|
-
const taskMarkdown = readTextIfExists(taskPath) || '';
|
|
76
|
-
const taskSummary = parseTaskSummary(taskMarkdown);
|
|
77
|
-
|
|
78
|
-
const branch = runGit(repoRoot, ['branch', '--show-current']) || '';
|
|
79
|
-
const head = runGit(repoRoot, ['rev-parse', '--short', 'HEAD']) || '';
|
|
80
|
-
const status = runGit(repoRoot, ['status', '--short']) || '';
|
|
81
|
-
const recentCommits = runGit(repoRoot, ['log', '--oneline', '-5']) || '';
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
changeId,
|
|
85
|
-
changeKey: change.changeKey,
|
|
86
|
-
nextAction: {
|
|
87
|
-
skill: taskSummary.next ? 'cc-do' : 'cc-check',
|
|
88
|
-
taskId: taskSummary.next ? taskSummary.next.id : null
|
|
89
|
-
},
|
|
90
|
-
files: {
|
|
91
|
-
task: taskPath,
|
|
92
|
-
prBrief: fs.existsSync(prBriefPath) ? prBriefPath : null
|
|
93
|
-
},
|
|
94
|
-
taskSummary,
|
|
95
|
-
git: {
|
|
96
|
-
branch,
|
|
97
|
-
head,
|
|
98
|
-
dirty: status.length > 0,
|
|
99
|
-
status: status ? status.split(/\r?\n/) : [],
|
|
100
|
-
recentCommits: recentCommits ? recentCommits.split(/\r?\n/) : []
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const registry = createQueryRegistry([
|
|
106
|
-
{
|
|
107
|
-
id: 'workflow-context',
|
|
108
|
-
artifactRefs: ({ repoRoot, changeId, changeKey }) => (
|
|
109
|
-
getWorkflowContextArtifactRefs(repoRoot, changeId, { changeKey })
|
|
110
|
-
),
|
|
111
|
-
requiredArtifactRefs: ({ repoRoot, changeId, changeKey }) => (
|
|
112
|
-
getWorkflowContextRequiredArtifactRefs(repoRoot, changeId, { changeKey })
|
|
113
|
-
),
|
|
114
|
-
nextAction: 'read-task-md-and-git-history',
|
|
115
|
-
handler: ({ repoRoot, changeId, changeKey }) => getWorkflowContext(repoRoot, changeId, { changeKey })
|
|
116
|
-
}
|
|
117
|
-
]);
|
|
118
|
-
|
|
119
|
-
module.exports = {
|
|
120
|
-
getWorkflowContext,
|
|
121
|
-
getWorkflowContextArtifactRefs,
|
|
122
|
-
getWorkflowContextRequiredArtifactRefs,
|
|
123
|
-
listQueryIds: registry.listQueryIds,
|
|
124
|
-
runQuery: registry.runQuery,
|
|
125
|
-
createTrace
|
|
126
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [INPUT]: 接收 query/doctor/preflight 的事件名、refs 与下一动作。
|
|
3
|
-
* [OUTPUT]: 生成统一 trace shape,供排查和上下文读取使用。
|
|
4
|
-
* [POS]: skill runtime 的 operational trace 层,不承载 workflow 决策。
|
|
5
|
-
* [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const crypto = require('crypto');
|
|
9
|
-
|
|
10
|
-
function createTrace({ event, changeId, artifactRefs = [], nextAction = 'inspect-result' } = {}) {
|
|
11
|
-
return {
|
|
12
|
-
eventId: `trace-${crypto.randomUUID()}`,
|
|
13
|
-
event: event || 'runtime-event',
|
|
14
|
-
changeId: changeId || '',
|
|
15
|
-
artifactRefs,
|
|
16
|
-
nextAction
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
module.exports = {
|
|
21
|
-
createTrace
|
|
22
|
-
};
|