workflow-ledger 0.3.5 → 0.3.6
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-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +6 -5
- package/README.zh-CN.md +6 -5
- package/bin/workflow-ledger +54 -4
- package/bin/workflow-ledger.js +101 -20
- package/docs/cli.md +9 -4
- package/examples/claude-project/CLAUDE.zh-CN.md.snippet +18 -0
- package/examples/codex-project/AGENTS.zh-CN.md.snippet +11 -0
- package/package.json +1 -1
- package/skills/workflow-ledger/templates/WORKFLOW.zh-CN.md +50 -0
- package/templates/WORKFLOW.zh-CN.md +50 -0
package/README.md
CHANGED
|
@@ -94,16 +94,17 @@ npx workflow-ledger setup --tool codex
|
|
|
94
94
|
npx workflow-ledger setup --tool all
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
Then initialize a project ledger from the target project root:
|
|
97
|
+
Then initialize a project ledger from the target project root. Bare `init` asks you to choose a language first; automation can pass `--lang en` or `--lang zh-CN` to skip the prompt:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
100
|
npx workflow-ledger init
|
|
101
|
-
npx workflow-ledger init --
|
|
102
|
-
npx workflow-ledger init --tool
|
|
103
|
-
npx workflow-ledger init --tool
|
|
101
|
+
npx workflow-ledger init --lang en
|
|
102
|
+
npx workflow-ledger init --tool claude-code --lang en
|
|
103
|
+
npx workflow-ledger init --tool codex --lang en
|
|
104
|
+
npx workflow-ledger init --tool all --lang en
|
|
104
105
|
```
|
|
105
106
|
|
|
106
|
-
`setup` installs global tool integrations. `init` creates project-local ledger files and short instruction snippets. `claude-code` uses `.claude/WORKFLOW.md`; `codex` uses `.workflow-ledger/WORKFLOW.md` plus `AGENTS.md`.
|
|
107
|
+
`setup` installs global tool integrations. `init` creates project-local ledger files and short instruction snippets. `claude-code` uses `.claude/WORKFLOW.md`; `codex` uses `.workflow-ledger/WORKFLOW.md` plus `AGENTS.md`. The language choice controls newly created ledger templates and tool instruction snippets; existing files are not overwritten.
|
|
107
108
|
|
|
108
109
|
The Bash installer remains available for Claude Code project initialization:
|
|
109
110
|
|
package/README.zh-CN.md
CHANGED
|
@@ -92,16 +92,17 @@ npx workflow-ledger setup --tool codex
|
|
|
92
92
|
npx workflow-ledger setup --tool all
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
然后在目标项目根目录初始化 ledger
|
|
95
|
+
然后在目标项目根目录初始化 ledger。裸 `init` 会先交互式选择语言;自动化脚本可传 `--lang en` 或 `--lang zh-CN` 跳过交互:
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
98
|
npx workflow-ledger init
|
|
99
|
-
npx workflow-ledger init --
|
|
100
|
-
npx workflow-ledger init --tool
|
|
101
|
-
npx workflow-ledger init --tool
|
|
99
|
+
npx workflow-ledger init --lang zh-CN
|
|
100
|
+
npx workflow-ledger init --tool claude-code --lang zh-CN
|
|
101
|
+
npx workflow-ledger init --tool codex --lang zh-CN
|
|
102
|
+
npx workflow-ledger init --tool all --lang zh-CN
|
|
102
103
|
```
|
|
103
104
|
|
|
104
|
-
`setup` 安装全局工具接入;`init` 创建项目本地 ledger 和短指令片段。`claude-code` 使用 `.claude/WORKFLOW.md`;`codex` 使用 `.workflow-ledger/WORKFLOW.md` 和 `AGENTS.md
|
|
105
|
+
`setup` 安装全局工具接入;`init` 创建项目本地 ledger 和短指令片段。`claude-code` 使用 `.claude/WORKFLOW.md`;`codex` 使用 `.workflow-ledger/WORKFLOW.md` 和 `AGENTS.md`。语言选择会影响新创建的 ledger 模板和工具指令片段;已有文件不会被覆盖。
|
|
105
106
|
|
|
106
107
|
Bash 安装器仍可用于 Claude Code 项目初始化:
|
|
107
108
|
|
package/bin/workflow-ledger
CHANGED
|
@@ -21,7 +21,7 @@ workflow-ledger — lightweight project-local workflow guardrails
|
|
|
21
21
|
|
|
22
22
|
Usage:
|
|
23
23
|
workflow-ledger help
|
|
24
|
-
workflow-ledger init
|
|
24
|
+
workflow-ledger init [--lang en|zh-CN]
|
|
25
25
|
workflow-ledger doctor
|
|
26
26
|
workflow-ledger list
|
|
27
27
|
workflow-ledger hooks status
|
|
@@ -71,9 +71,14 @@ hook_status_value() {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
find_template() {
|
|
74
|
+
local language="$1"
|
|
75
|
+
local template_name='WORKFLOW.md'
|
|
76
|
+
if [ "$language" = 'zh-CN' ]; then
|
|
77
|
+
template_name='WORKFLOW.zh-CN.md'
|
|
78
|
+
fi
|
|
74
79
|
local candidates=(
|
|
75
|
-
"$ROOT/.claude/skills/workflow-ledger/templates
|
|
76
|
-
"$REPO_ROOT/skills/workflow-ledger/templates
|
|
80
|
+
"$ROOT/.claude/skills/workflow-ledger/templates/$template_name"
|
|
81
|
+
"$REPO_ROOT/skills/workflow-ledger/templates/$template_name"
|
|
77
82
|
)
|
|
78
83
|
local candidate
|
|
79
84
|
for candidate in "${candidates[@]}"; do
|
|
@@ -85,7 +90,52 @@ find_template() {
|
|
|
85
90
|
return 1
|
|
86
91
|
}
|
|
87
92
|
|
|
93
|
+
normalize_language() {
|
|
94
|
+
case "$1" in
|
|
95
|
+
en|english) printf 'en' ;;
|
|
96
|
+
zh|zh-CN|zh-cn|zh_CN|cn|chinese|中文) printf 'zh-CN' ;;
|
|
97
|
+
*) return 1 ;;
|
|
98
|
+
esac
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
choose_language() {
|
|
102
|
+
local answer=''
|
|
103
|
+
if [ -t 0 ] && [ -t 1 ]; then
|
|
104
|
+
printf 'Choose language / 选择语言 [1] English [2] 简体中文: '
|
|
105
|
+
IFS= read -r answer || answer=''
|
|
106
|
+
case "$answer" in
|
|
107
|
+
2|zh|zh-CN|zh-cn|cn|中文) printf 'zh-CN'; return 0 ;;
|
|
108
|
+
esac
|
|
109
|
+
fi
|
|
110
|
+
printf 'en'
|
|
111
|
+
}
|
|
112
|
+
|
|
88
113
|
cmd_init() {
|
|
114
|
+
local language=''
|
|
115
|
+
while [ "$#" -gt 0 ]; do
|
|
116
|
+
case "$1" in
|
|
117
|
+
--lang|--language)
|
|
118
|
+
language="${2:-}"
|
|
119
|
+
shift 2
|
|
120
|
+
;;
|
|
121
|
+
--lang=*|--language=*)
|
|
122
|
+
language="${1#*=}"
|
|
123
|
+
shift
|
|
124
|
+
;;
|
|
125
|
+
*)
|
|
126
|
+
shift
|
|
127
|
+
;;
|
|
128
|
+
esac
|
|
129
|
+
done
|
|
130
|
+
if [ -n "$language" ]; then
|
|
131
|
+
if ! language="$(normalize_language "$language")"; then
|
|
132
|
+
printf 'error: unknown language. Expected en or zh-CN.\n' >&2
|
|
133
|
+
return 1
|
|
134
|
+
fi
|
|
135
|
+
else
|
|
136
|
+
language="$(choose_language)"
|
|
137
|
+
fi
|
|
138
|
+
|
|
89
139
|
if ! mkdir -p "$ROOT/.claude" 2>/dev/null; then
|
|
90
140
|
printf 'error: cannot create .claude directory\n' >&2
|
|
91
141
|
return 1
|
|
@@ -95,7 +145,7 @@ cmd_init() {
|
|
|
95
145
|
printf 'kept existing .claude/WORKFLOW.md\n'
|
|
96
146
|
else
|
|
97
147
|
local template
|
|
98
|
-
if ! template="$(find_template)"; then
|
|
148
|
+
if ! template="$(find_template "$language")"; then
|
|
99
149
|
printf 'workflow-ledger skill template not found; run install.sh from the workflow-ledger checkout.\n' >&2
|
|
100
150
|
return 0
|
|
101
151
|
fi
|
package/bin/workflow-ledger.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
const fs = require('fs');
|
|
3
3
|
const os = require('os');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const readline = require('readline/promises');
|
|
6
|
+
const { stdin: input, stdout: output } = require('process');
|
|
5
7
|
const { spawnSync } = require('child_process');
|
|
6
8
|
|
|
7
9
|
const repoRoot = path.resolve(__dirname, '..');
|
|
@@ -15,12 +17,23 @@ const toolAliases = new Map([
|
|
|
15
17
|
['all', 'all'],
|
|
16
18
|
]);
|
|
17
19
|
|
|
20
|
+
const languageAliases = new Map([
|
|
21
|
+
['en', 'en'],
|
|
22
|
+
['english', 'en'],
|
|
23
|
+
['zh', 'zh-CN'],
|
|
24
|
+
['zh-cn', 'zh-CN'],
|
|
25
|
+
['zh_CN', 'zh-CN'],
|
|
26
|
+
['cn', 'zh-CN'],
|
|
27
|
+
['chinese', 'zh-CN'],
|
|
28
|
+
['中文', 'zh-CN'],
|
|
29
|
+
]);
|
|
30
|
+
|
|
18
31
|
function printHelp() {
|
|
19
32
|
console.log(`workflow-ledger — lightweight workflow guardrails for AI coding agents
|
|
20
33
|
|
|
21
34
|
Usage:
|
|
22
35
|
workflow-ledger setup [--tool claude-code|codex|all]
|
|
23
|
-
workflow-ledger init [--tool claude-code|codex|all] [--root PATH]
|
|
36
|
+
workflow-ledger init [--tool claude-code|codex|all] [--lang en|zh-CN] [--root PATH]
|
|
24
37
|
workflow-ledger help
|
|
25
38
|
workflow-ledger doctor
|
|
26
39
|
workflow-ledger list
|
|
@@ -31,14 +44,26 @@ setup installs global tool integrations. init creates project-local ledger files
|
|
|
31
44
|
}
|
|
32
45
|
|
|
33
46
|
function parseArgs(argv) {
|
|
34
|
-
const args = { command: argv[0] || 'help', tool: 'claude-code', root: targetRoot };
|
|
47
|
+
const args = { command: argv[0] || 'help', tool: 'claude-code', language: '', root: targetRoot, interactiveLanguage: argv[0] === 'init' };
|
|
35
48
|
for (let i = 1; i < argv.length; i += 1) {
|
|
36
49
|
const arg = argv[i];
|
|
37
50
|
if (arg === '--tool') {
|
|
38
51
|
args.tool = argv[i + 1] || '';
|
|
52
|
+
args.interactiveLanguage = false;
|
|
39
53
|
i += 1;
|
|
40
54
|
} else if (arg.startsWith('--tool=')) {
|
|
41
55
|
args.tool = arg.slice('--tool='.length);
|
|
56
|
+
args.interactiveLanguage = false;
|
|
57
|
+
} else if (arg === '--lang' || arg === '--language') {
|
|
58
|
+
args.language = argv[i + 1] || '';
|
|
59
|
+
args.interactiveLanguage = false;
|
|
60
|
+
i += 1;
|
|
61
|
+
} else if (arg.startsWith('--lang=')) {
|
|
62
|
+
args.language = arg.slice('--lang='.length);
|
|
63
|
+
args.interactiveLanguage = false;
|
|
64
|
+
} else if (arg.startsWith('--language=')) {
|
|
65
|
+
args.language = arg.slice('--language='.length);
|
|
66
|
+
args.interactiveLanguage = false;
|
|
42
67
|
} else if (arg === '--root') {
|
|
43
68
|
args.root = path.resolve(argv[i + 1] || '.');
|
|
44
69
|
i += 1;
|
|
@@ -47,6 +72,7 @@ function parseArgs(argv) {
|
|
|
47
72
|
}
|
|
48
73
|
}
|
|
49
74
|
args.tool = toolAliases.get(args.tool) || args.tool;
|
|
75
|
+
args.language = args.language ? languageAliases.get(args.language) || args.language : 'en';
|
|
50
76
|
return args;
|
|
51
77
|
}
|
|
52
78
|
|
|
@@ -103,6 +129,32 @@ function validateTool(tool) {
|
|
|
103
129
|
return true;
|
|
104
130
|
}
|
|
105
131
|
|
|
132
|
+
function validateLanguage(language) {
|
|
133
|
+
if (!['en', 'zh-CN'].includes(language)) {
|
|
134
|
+
console.error(`error: unknown language '${language}'. Expected en or zh-CN.`);
|
|
135
|
+
process.exitCode = 1;
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
async function chooseLanguage() {
|
|
142
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) return 'en';
|
|
143
|
+
const rl = readline.createInterface({ input, output });
|
|
144
|
+
try {
|
|
145
|
+
const answer = await rl.question('Choose language / 选择语言 [1] English [2] 简体中文: ');
|
|
146
|
+
const normalized = answer.trim().toLowerCase();
|
|
147
|
+
if (['2', 'zh', 'zh-cn', 'cn', '中文'].includes(normalized)) return 'zh-CN';
|
|
148
|
+
return 'en';
|
|
149
|
+
} finally {
|
|
150
|
+
rl.close();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function localizedPath(...segments) {
|
|
155
|
+
return path.join(repoRoot, ...segments);
|
|
156
|
+
}
|
|
157
|
+
|
|
106
158
|
function createResult() {
|
|
107
159
|
return { configured: [], skipped: [], errors: [] };
|
|
108
160
|
}
|
|
@@ -169,11 +221,19 @@ function setup(args) {
|
|
|
169
221
|
console.log('\nNext: run workflow-ledger init in a project.');
|
|
170
222
|
}
|
|
171
223
|
|
|
172
|
-
function
|
|
224
|
+
function templateFile(language, englishPath, chinesePath) {
|
|
225
|
+
return language === 'zh-CN' ? localizedPath(...chinesePath) : localizedPath(...englishPath);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function initClaudeCodeProject(root, language, result) {
|
|
173
229
|
const claudeDir = path.join(root, '.claude');
|
|
174
230
|
ensureDir(claudeDir);
|
|
175
231
|
copyFileIfMissing(
|
|
176
|
-
|
|
232
|
+
templateFile(
|
|
233
|
+
language,
|
|
234
|
+
['skills', 'workflow-ledger', 'templates', 'WORKFLOW.md'],
|
|
235
|
+
['skills', 'workflow-ledger', 'templates', 'WORKFLOW.zh-CN.md']
|
|
236
|
+
),
|
|
177
237
|
path.join(claudeDir, 'WORKFLOW.md'),
|
|
178
238
|
'created .claude/WORKFLOW.md',
|
|
179
239
|
'kept existing .claude/WORKFLOW.md',
|
|
@@ -181,7 +241,11 @@ function initClaudeCodeProject(root, result) {
|
|
|
181
241
|
);
|
|
182
242
|
appendSnippet(
|
|
183
243
|
'## Workflow Ledger',
|
|
184
|
-
|
|
244
|
+
templateFile(
|
|
245
|
+
language,
|
|
246
|
+
['examples', 'claude-project', 'CLAUDE.md.snippet'],
|
|
247
|
+
['examples', 'claude-project', 'CLAUDE.zh-CN.md.snippet']
|
|
248
|
+
),
|
|
185
249
|
path.join(root, 'CLAUDE.md'),
|
|
186
250
|
'updated CLAUDE.md',
|
|
187
251
|
'kept existing Workflow Ledger section in CLAUDE.md',
|
|
@@ -189,11 +253,15 @@ function initClaudeCodeProject(root, result) {
|
|
|
189
253
|
);
|
|
190
254
|
}
|
|
191
255
|
|
|
192
|
-
function initCodexProject(root, result) {
|
|
256
|
+
function initCodexProject(root, language, result) {
|
|
193
257
|
const ledgerDir = path.join(root, '.workflow-ledger');
|
|
194
258
|
ensureDir(ledgerDir);
|
|
195
259
|
copyFileIfMissing(
|
|
196
|
-
|
|
260
|
+
templateFile(
|
|
261
|
+
language,
|
|
262
|
+
['templates', 'WORKFLOW.md'],
|
|
263
|
+
['templates', 'WORKFLOW.zh-CN.md']
|
|
264
|
+
),
|
|
197
265
|
path.join(ledgerDir, 'WORKFLOW.md'),
|
|
198
266
|
'created .workflow-ledger/WORKFLOW.md',
|
|
199
267
|
'kept existing .workflow-ledger/WORKFLOW.md',
|
|
@@ -201,7 +269,11 @@ function initCodexProject(root, result) {
|
|
|
201
269
|
);
|
|
202
270
|
appendSnippet(
|
|
203
271
|
'# Workflow Ledger',
|
|
204
|
-
|
|
272
|
+
templateFile(
|
|
273
|
+
language,
|
|
274
|
+
['examples', 'codex-project', 'AGENTS.md.snippet'],
|
|
275
|
+
['examples', 'codex-project', 'AGENTS.zh-CN.md.snippet']
|
|
276
|
+
),
|
|
205
277
|
path.join(root, 'AGENTS.md'),
|
|
206
278
|
'updated AGENTS.md',
|
|
207
279
|
'kept existing Workflow Ledger section in AGENTS.md',
|
|
@@ -209,12 +281,14 @@ function initCodexProject(root, result) {
|
|
|
209
281
|
);
|
|
210
282
|
}
|
|
211
283
|
|
|
212
|
-
function initProject(args) {
|
|
284
|
+
async function initProject(args) {
|
|
213
285
|
if (!validateTool(args.tool)) return;
|
|
286
|
+
if (!validateLanguage(args.language)) return;
|
|
287
|
+
const language = args.interactiveLanguage ? await chooseLanguage() : args.language;
|
|
214
288
|
const result = createResult();
|
|
215
289
|
ensureDir(args.root);
|
|
216
|
-
if (args.tool === 'claude-code' || args.tool === 'all') initClaudeCodeProject(args.root, result);
|
|
217
|
-
if (args.tool === 'codex' || args.tool === 'all') initCodexProject(args.root, result);
|
|
290
|
+
if (args.tool === 'claude-code' || args.tool === 'all') initClaudeCodeProject(args.root, language, result);
|
|
291
|
+
if (args.tool === 'codex' || args.tool === 'all') initCodexProject(args.root, language, result);
|
|
218
292
|
printResult('Workflow Ledger Init', result);
|
|
219
293
|
}
|
|
220
294
|
|
|
@@ -228,12 +302,19 @@ function delegateToBash(argv) {
|
|
|
228
302
|
}
|
|
229
303
|
|
|
230
304
|
const args = parseArgs(process.argv.slice(2));
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
305
|
+
async function main() {
|
|
306
|
+
if (args.command === 'help' || args.command === '-h' || args.command === '--help') {
|
|
307
|
+
printHelp();
|
|
308
|
+
} else if (args.command === 'setup') {
|
|
309
|
+
setup(args);
|
|
310
|
+
} else if (args.command === 'init') {
|
|
311
|
+
await initProject(args);
|
|
312
|
+
} else {
|
|
313
|
+
delegateToBash(process.argv.slice(2));
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
main().catch((error) => {
|
|
318
|
+
console.error(error.message);
|
|
319
|
+
process.exitCode = 1;
|
|
320
|
+
});
|
package/docs/cli.md
CHANGED
|
@@ -16,9 +16,12 @@ It does not modify your shell `PATH`.
|
|
|
16
16
|
workflow-ledger setup --tool claude-code
|
|
17
17
|
workflow-ledger setup --tool codex
|
|
18
18
|
workflow-ledger setup --tool all
|
|
19
|
-
workflow-ledger init
|
|
20
|
-
workflow-ledger init --
|
|
21
|
-
workflow-ledger init --
|
|
19
|
+
workflow-ledger init
|
|
20
|
+
workflow-ledger init --lang en
|
|
21
|
+
workflow-ledger init --lang zh-CN
|
|
22
|
+
workflow-ledger init --tool claude-code --lang en
|
|
23
|
+
workflow-ledger init --tool codex --lang en
|
|
24
|
+
workflow-ledger init --tool all --lang en
|
|
22
25
|
workflow-ledger doctor
|
|
23
26
|
workflow-ledger list
|
|
24
27
|
workflow-ledger hooks status
|
|
@@ -37,11 +40,13 @@ Installs global Workflow Ledger integrations for supported AI coding tools.
|
|
|
37
40
|
|
|
38
41
|
## `init`
|
|
39
42
|
|
|
40
|
-
Creates project-local Workflow Ledger files for selected tools.
|
|
43
|
+
Creates project-local Workflow Ledger files for selected tools. Bare `init` asks for a language when run in a terminal; pass `--lang en` or `--lang zh-CN` for non-interactive use.
|
|
41
44
|
|
|
42
45
|
- `--tool claude-code` creates `.claude/WORKFLOW.md` and updates `CLAUDE.md`.
|
|
43
46
|
- `--tool codex` creates `.workflow-ledger/WORKFLOW.md` and updates `AGENTS.md`.
|
|
44
47
|
- `--tool all` initializes both project adapters.
|
|
48
|
+
- `--lang en` creates English ledger templates and instruction snippets.
|
|
49
|
+
- `--lang zh-CN` creates Simplified Chinese ledger templates and instruction snippets.
|
|
45
50
|
- `--root PATH` targets a project root other than the current directory.
|
|
46
51
|
|
|
47
52
|
`init` preserves existing ledger files and instruction sections.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## Workflow Ledger
|
|
2
|
+
|
|
3
|
+
使用 `workflow-ledger` 跟踪可恢复的开发工作。
|
|
4
|
+
|
|
5
|
+
- 执行前先分级:Level 0 问答,Level 1 轻量编辑,Level 2 标准代码工作,Level 3 复杂工作。
|
|
6
|
+
- Level 2/3 任务,以及用户希望跨会话跟踪的任务,都维护在 `.claude/WORKFLOW.md` 中。
|
|
7
|
+
- 被跟踪的工作只记录恢复状态:`Intent`、可变的 `Current todo`、`Prerequisites`、可选的 `Blocked by`,以及一个具体的 `Resume next`。
|
|
8
|
+
- 关闭工作前,把任务移到 `Completed`,写简短 `Close summary`:outcome、validation、gaps;验证失败时任务保持 In Progress 或 Blocked。
|
|
9
|
+
- 记录依赖和发现的未来任务;先完成阻塞当前工作的前置条件,把非阻塞发现延后到 Backlog/Future。
|
|
10
|
+
- 当前会话执行用 TodoWrite;里程碑历史和恢复点用 `.claude/WORKFLOW.md`。
|
|
11
|
+
- 不要创建附件或额外 spec 文件,除非 Level 3 工作确实需要,或用户明确要求。
|
|
12
|
+
|
|
13
|
+
不要找理由跳过 ledger:
|
|
14
|
+
|
|
15
|
+
- “这个很小”仍然需要分级;Level 2/3 工作必须跟踪。
|
|
16
|
+
- “我之后再更新”不安全;在重要待办/范围变化、阻塞、验证结果和交接点更新。
|
|
17
|
+
- TodoWrite 是会话本地状态;`.claude/WORKFLOW.md` 是持久恢复状态。
|
|
18
|
+
- 保持核心字段稳定,让 `.claude/bin/workflow-ledger doctor` 能检查 ledger。
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Workflow Ledger
|
|
2
|
+
|
|
3
|
+
把 Workflow Ledger 作为 Codex 会话共享的恢复状态。
|
|
4
|
+
|
|
5
|
+
- 恢复被跟踪的工作前,先读取 `.workflow-ledger/WORKFLOW.md`。
|
|
6
|
+
- Level 2/3 或跨会话任务记录在 `.workflow-ledger/WORKFLOW.md`。
|
|
7
|
+
- 保持 ledger 简短:当前工作、进展,以及一个具体的 `Resume next` 动作。
|
|
8
|
+
- 默认只有一个 Active 任务;不确定的后续事项放到 Backlog/Future。
|
|
9
|
+
- 使用 `Intent`、可变的 `Current todo`、`Prerequisites`、可选的 `Blocked by`,以及一个具体的 `Resume next`。
|
|
10
|
+
- 关闭工作前记录简短 `Close summary`:outcome、validation、gaps。
|
|
11
|
+
- 不要把完整命令输出、原始工具 JSON、详细 diff 或临时推理粘进 ledger。
|
package/package.json
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Workflow Ledger
|
|
2
|
+
|
|
3
|
+
Claude Code 开发工作的轻量级可恢复台账。
|
|
4
|
+
|
|
5
|
+
## Active
|
|
6
|
+
|
|
7
|
+
<!-- workflow-ledger:task
|
|
8
|
+
id: WF-YYYY-MM-DD-001
|
|
9
|
+
level: 2
|
|
10
|
+
status: In Progress
|
|
11
|
+
current_phase: 当前焦点
|
|
12
|
+
updated: YYYY-MM-DD
|
|
13
|
+
-->
|
|
14
|
+
|
|
15
|
+
### WF-YYYY-MM-DD-001 — 任务标题
|
|
16
|
+
Status: In Progress
|
|
17
|
+
Level: 2
|
|
18
|
+
Started: YYYY-MM-DD
|
|
19
|
+
Last updated: YYYY-MM-DD
|
|
20
|
+
Current phase: 当前焦点
|
|
21
|
+
|
|
22
|
+
Intent:
|
|
23
|
+
- 一个用户可见的目标或变更意图。
|
|
24
|
+
|
|
25
|
+
Current todo:
|
|
26
|
+
- [ ] 可随发现调整的下一步事项。
|
|
27
|
+
|
|
28
|
+
Changes:
|
|
29
|
+
- 记录会影响恢复上下文的范围、待办、前置条件或阻塞变化。
|
|
30
|
+
|
|
31
|
+
Prerequisites:
|
|
32
|
+
- 继续当前工作前必须满足的条件,或 None。
|
|
33
|
+
|
|
34
|
+
Resume next:
|
|
35
|
+
- 一个具体的下一步动作。
|
|
36
|
+
|
|
37
|
+
## Backlog / Future
|
|
38
|
+
|
|
39
|
+
- [ ] 当前任务范围外发现的未来事项 — 因为不阻塞当前意图而延后。
|
|
40
|
+
|
|
41
|
+
## Completed
|
|
42
|
+
|
|
43
|
+
### WF-YYYY-MM-DD-000 — 已完成任务标题
|
|
44
|
+
Completed: YYYY-MM-DD
|
|
45
|
+
Level: 1
|
|
46
|
+
|
|
47
|
+
Close summary:
|
|
48
|
+
- Outcome: 用户可见结果。
|
|
49
|
+
- Validation: 已执行的检查。
|
|
50
|
+
- Gaps: 剩余后续事项或 none。
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Workflow Ledger
|
|
2
|
+
|
|
3
|
+
AI coding agent 共享的可恢复状态台账。
|
|
4
|
+
|
|
5
|
+
## Active
|
|
6
|
+
|
|
7
|
+
<!-- workflow-ledger:task
|
|
8
|
+
id: WF-YYYY-MM-DD-001
|
|
9
|
+
level: 2
|
|
10
|
+
status: In Progress
|
|
11
|
+
current_phase: 当前焦点
|
|
12
|
+
updated: YYYY-MM-DD
|
|
13
|
+
-->
|
|
14
|
+
|
|
15
|
+
### WF-YYYY-MM-DD-001 — 任务标题
|
|
16
|
+
Status: In Progress
|
|
17
|
+
Level: 2
|
|
18
|
+
Started: YYYY-MM-DD
|
|
19
|
+
Last updated: YYYY-MM-DD
|
|
20
|
+
Current phase: 当前焦点
|
|
21
|
+
|
|
22
|
+
Intent:
|
|
23
|
+
- 一个用户可见的目标或变更意图。
|
|
24
|
+
|
|
25
|
+
Current todo:
|
|
26
|
+
- [ ] 可随发现调整的下一步事项。
|
|
27
|
+
|
|
28
|
+
Changes:
|
|
29
|
+
- 记录会影响恢复上下文的范围、待办、前置条件或阻塞变化。
|
|
30
|
+
|
|
31
|
+
Prerequisites:
|
|
32
|
+
- 继续当前工作前必须满足的条件,或 None。
|
|
33
|
+
|
|
34
|
+
Resume next:
|
|
35
|
+
- 一个具体的下一步动作。
|
|
36
|
+
|
|
37
|
+
## Backlog / Future
|
|
38
|
+
|
|
39
|
+
- [ ] 当前任务范围外发现的未来事项 — 因为不阻塞当前意图而延后。
|
|
40
|
+
|
|
41
|
+
## Completed
|
|
42
|
+
|
|
43
|
+
### WF-YYYY-MM-DD-000 — 已完成任务标题
|
|
44
|
+
Completed: YYYY-MM-DD
|
|
45
|
+
Level: 1
|
|
46
|
+
|
|
47
|
+
Close summary:
|
|
48
|
+
- Outcome: 用户可见结果。
|
|
49
|
+
- Validation: 已执行的检查。
|
|
50
|
+
- Gaps: 剩余后续事项或 none。
|