workflow-ledger 0.3.5
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 +18 -0
- package/.claude-plugin/plugin.json +18 -0
- package/LICENSE +21 -0
- package/README.md +226 -0
- package/README.zh-CN.md +224 -0
- package/bin/workflow-ledger +417 -0
- package/bin/workflow-ledger.js +239 -0
- package/docs/cli.md +94 -0
- package/docs/design.md +43 -0
- package/docs/design.zh-CN.md +47 -0
- package/docs/usage.md +119 -0
- package/docs/usage.zh-CN.md +117 -0
- package/examples/claude-project/CLAUDE.md.snippet +18 -0
- package/examples/claude-project/WORKFLOW.md +36 -0
- package/examples/codex-project/AGENTS.md.snippet +11 -0
- package/hooks/hooks.json +10 -0
- package/hooks/session-start +28 -0
- package/install.sh +75 -0
- package/package.json +43 -0
- package/skills/workflow-ledger/SKILL.md +168 -0
- package/skills/workflow-ledger/templates/WORKFLOW.md +50 -0
- package/templates/WORKFLOW.md +50 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-ledger
|
|
3
|
+
description: Lightweight OpenSpec-style change ledger for Claude Code. Use when starting, resuming, updating, closing, or reviewing multi-step code work; when todos may change during implementation; when the user wants traceability without heavyweight specs; or when a task may be interrupted and continued later.
|
|
4
|
+
when_to_use: Use for development tasks that need mutable todo tracking, prerequisites, blockers, deferred follow-ups, or cross-session recovery. Skip for pure Q&A and trivial one-step edits unless the user requests tracking. Trigger phrases include "start task", "resume task", "update", "close", "workflow", "ledger", "recover", "continue previous task", "what is left", "review progress".
|
|
5
|
+
argument-hint: start|resume|update|close [task]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Workflow Ledger
|
|
9
|
+
|
|
10
|
+
Use this skill to keep development work recoverable without turning progress notes into a transcript, full spec, or project-management system.
|
|
11
|
+
|
|
12
|
+
## Core rule
|
|
13
|
+
|
|
14
|
+
Maintain one project overview file at `.claude/WORKFLOW.md` for Level 2/3 work and for any task the user wants tracked. The ledger is compressed resume state: it should answer what the active change is, what changed during execution, what is blocking or required next, and the one next action to take.
|
|
15
|
+
|
|
16
|
+
Do not use the ledger for full operation logs, detailed diffs, raw GitNexus output, complete test output, temporary reasoning, or unrelated cleanup notes.
|
|
17
|
+
|
|
18
|
+
## Project installation contract
|
|
19
|
+
|
|
20
|
+
Recommended one-command project setup from the target project root:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
curl -fsSL https://raw.githubusercontent.com/MorseWayne/workflow-ledger/main/install.sh | bash
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
For project-local use, the installer configures all three pieces:
|
|
27
|
+
|
|
28
|
+
1. Copy this skill to `.claude/skills/workflow-ledger`.
|
|
29
|
+
2. Add [examples/claude-project/CLAUDE.md.snippet](../../examples/claude-project/CLAUDE.md.snippet) to the project's `CLAUDE.md` if missing.
|
|
30
|
+
3. Create `.claude/WORKFLOW.md` from [templates/WORKFLOW.md](templates/WORKFLOW.md) if missing.
|
|
31
|
+
|
|
32
|
+
## Workflow levels
|
|
33
|
+
|
|
34
|
+
Classify first. If uncertain, choose the lighter level unless risk appears.
|
|
35
|
+
|
|
36
|
+
- **Level 0 — Q&A / read-only**: explain, answer, inspect without edits. No ledger required.
|
|
37
|
+
- **Level 1 — lightweight edit**: typo, docs tweak, formatting, tiny config, no runtime behavior change. Ledger optional.
|
|
38
|
+
- **Level 2 — standard code work**: small bugfix, single-module behavior change, tests, provider logic, repeatable multi-step work. Use ledger.
|
|
39
|
+
- **Level 3 — complex work**: new feature, cross-module or cross-repo changes, public API/data model changes, auth/streaming/concurrency/metrics, unclear requirements, high-risk impact. Use ledger and add attachments only when the ledger would otherwise become too long.
|
|
40
|
+
|
|
41
|
+
Escalate when you discover cross-file behavior changes, public API changes, failed validation, unclear requirements, or HIGH/CRITICAL impact.
|
|
42
|
+
|
|
43
|
+
## Ledger hygiene rules
|
|
44
|
+
|
|
45
|
+
- Default to at most one `Active` task.
|
|
46
|
+
- If multiple tasks are active, each needs a clear priority, blocker state, and `Resume next`.
|
|
47
|
+
- Update at milestone points only: task start, material scope/todo change, new prerequisite, blocker, validation result, interruption handoff, or close.
|
|
48
|
+
- Do not rewrite `Completed` history except to fix an obvious error.
|
|
49
|
+
- Do not do cross-task cleanup while updating one task.
|
|
50
|
+
- Keep each Active task under roughly 80 lines.
|
|
51
|
+
- Move short-lived release, cleanup, and index-refresh tasks to `Completed` as soon as they finish.
|
|
52
|
+
|
|
53
|
+
## Ledger structure
|
|
54
|
+
|
|
55
|
+
`.claude/WORKFLOW.md` should contain:
|
|
56
|
+
|
|
57
|
+
1. `Active` — current change entries.
|
|
58
|
+
2. `Backlog / Future` — discovered tasks not needed for the current intent.
|
|
59
|
+
3. `Completed` — short close summaries.
|
|
60
|
+
|
|
61
|
+
Each active task should have:
|
|
62
|
+
|
|
63
|
+
- stable ID: `WF-YYYY-MM-DD-NNN`
|
|
64
|
+
- status, level, dates, and `Current phase` as the current focus
|
|
65
|
+
- `Intent:` as the smallest user-visible goal or change intent
|
|
66
|
+
- `Current todo:` as mutable next work, not a fixed plan
|
|
67
|
+
- `Changes:` for scope, todo, prerequisite, or blocker changes that matter for resume
|
|
68
|
+
- `Prerequisites:` for what must be true before continuing, or `None`
|
|
69
|
+
- optional `Blocked by:` when work cannot continue
|
|
70
|
+
- one concrete `Resume next:` action
|
|
71
|
+
|
|
72
|
+
## Task shape
|
|
73
|
+
|
|
74
|
+
Use one lightweight change entry instead of proposal/design/tasks/spec files:
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
### WF-YYYY-MM-DD-001 — Task title
|
|
78
|
+
Status: In Progress
|
|
79
|
+
Level: 2
|
|
80
|
+
Started: YYYY-MM-DD
|
|
81
|
+
Last updated: YYYY-MM-DD
|
|
82
|
+
Current phase: Current focus name
|
|
83
|
+
|
|
84
|
+
Intent:
|
|
85
|
+
- One user-visible goal or change intent.
|
|
86
|
+
|
|
87
|
+
Current todo:
|
|
88
|
+
- [ ] Mutable next item.
|
|
89
|
+
|
|
90
|
+
Changes:
|
|
91
|
+
- Scope, todo, prerequisite, or blocker changes that matter for resume.
|
|
92
|
+
|
|
93
|
+
Prerequisites:
|
|
94
|
+
- Required before current work can proceed, or None.
|
|
95
|
+
|
|
96
|
+
Resume next:
|
|
97
|
+
- One concrete next action.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
If blocked, set `Status: Blocked`, add `Blocked by:`, and make `Resume next` the single unblock action.
|
|
101
|
+
|
|
102
|
+
## Handling changing todos
|
|
103
|
+
|
|
104
|
+
When implementation reveals new work, choose the smallest durable update:
|
|
105
|
+
|
|
106
|
+
- Same intent and small todo/scope change: update `Current todo:` and add one `Changes:` bullet if it matters for resuming.
|
|
107
|
+
- New prerequisite for the current intent: add it to `Prerequisites:`; if it blocks progress, set `Status: Blocked` and add `Blocked by:`.
|
|
108
|
+
- Useful work that does not block the current intent: add it to `Backlog / Future` with a short deferred reason.
|
|
109
|
+
- Different intent or scope explosion: start a new task or use a heavier planning/spec process.
|
|
110
|
+
|
|
111
|
+
## Backlog and discovered work
|
|
112
|
+
|
|
113
|
+
Backlog is for non-blocking follow-up only. Each backlog item should include why it is deferred, but it does not need a strict schema.
|
|
114
|
+
|
|
115
|
+
Do not move non-blocking discoveries into `Current todo:` just because they were noticed during the task.
|
|
116
|
+
|
|
117
|
+
## Start a tracked task
|
|
118
|
+
|
|
119
|
+
1. Locate or create `.claude/WORKFLOW.md` using [templates/WORKFLOW.md](templates/WORKFLOW.md).
|
|
120
|
+
2. Create one `Active` task entry.
|
|
121
|
+
3. Classify Level 0-3.
|
|
122
|
+
4. Write the smallest `Intent:`.
|
|
123
|
+
5. Set mutable `Current todo:`.
|
|
124
|
+
6. Record `Prerequisites:` or `None`.
|
|
125
|
+
7. Set `Current phase` as the current focus and write one concrete `Resume next` action.
|
|
126
|
+
|
|
127
|
+
## Resume a task
|
|
128
|
+
|
|
129
|
+
1. Read `.claude/WORKFLOW.md`.
|
|
130
|
+
2. Find the single highest-priority `Active` task.
|
|
131
|
+
3. Use `Intent`, `Current phase`, `Current todo`, `Prerequisites`, `Blocked by`, and `Resume next` to continue.
|
|
132
|
+
4. Verify current repo state before trusting stale ledger details.
|
|
133
|
+
5. If code state differs from the ledger, update the ledger with the observed resume-relevant state.
|
|
134
|
+
|
|
135
|
+
## Update a task
|
|
136
|
+
|
|
137
|
+
1. Update only resume-relevant fields.
|
|
138
|
+
2. Prefer changing `Current todo:` over appending a history log.
|
|
139
|
+
3. Add one `Changes:` bullet only when the change explains why the next action or scope differs.
|
|
140
|
+
4. Keep raw command output, transcripts, and implementation details out of the ledger.
|
|
141
|
+
|
|
142
|
+
## Close a task
|
|
143
|
+
|
|
144
|
+
1. Ensure required work is done or explicitly deferred to `Backlog / Future`.
|
|
145
|
+
2. Move the task from `Active` to `Completed`.
|
|
146
|
+
3. Replace active-only fields with `Close summary:`.
|
|
147
|
+
4. Include only outcome, validation, and gaps.
|
|
148
|
+
|
|
149
|
+
Use this completed shape:
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
### WF-YYYY-MM-DD-001 — Task title
|
|
153
|
+
Completed: YYYY-MM-DD
|
|
154
|
+
Level: 2
|
|
155
|
+
|
|
156
|
+
Close summary:
|
|
157
|
+
- Outcome: What changed.
|
|
158
|
+
- Validation: What passed.
|
|
159
|
+
- Gaps: None or deferred follow-up.
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Interaction with other mechanisms
|
|
163
|
+
|
|
164
|
+
- Use TodoWrite for current-session execution tracking.
|
|
165
|
+
- Use `.claude/WORKFLOW.md` for cross-session recovery and milestone history.
|
|
166
|
+
- Use CLAUDE.md for short mandatory project rules.
|
|
167
|
+
- Use hooks only for advisory reminders or hard guardrails.
|
|
168
|
+
- Use heavier design/spec artifacts only for Level 3 work that genuinely needs them.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Workflow Ledger
|
|
2
|
+
|
|
3
|
+
A lightweight OpenSpec-style resume ledger for Claude Code development work.
|
|
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: Current focus name
|
|
12
|
+
updated: YYYY-MM-DD
|
|
13
|
+
-->
|
|
14
|
+
|
|
15
|
+
### WF-YYYY-MM-DD-001 — Task title
|
|
16
|
+
Status: In Progress
|
|
17
|
+
Level: 2
|
|
18
|
+
Started: YYYY-MM-DD
|
|
19
|
+
Last updated: YYYY-MM-DD
|
|
20
|
+
Current phase: Current focus name
|
|
21
|
+
|
|
22
|
+
Intent:
|
|
23
|
+
- One user-visible goal or change intent.
|
|
24
|
+
|
|
25
|
+
Current todo:
|
|
26
|
+
- [ ] Mutable next item.
|
|
27
|
+
|
|
28
|
+
Changes:
|
|
29
|
+
- Scope, todo, prerequisite, or blocker changes that matter for resume.
|
|
30
|
+
|
|
31
|
+
Prerequisites:
|
|
32
|
+
- Required before current work can proceed, or None.
|
|
33
|
+
|
|
34
|
+
Resume next:
|
|
35
|
+
- One concrete next action.
|
|
36
|
+
|
|
37
|
+
## Backlog / Future
|
|
38
|
+
|
|
39
|
+
- [ ] Future task discovered outside the active task scope — deferred because it does not block the current intent.
|
|
40
|
+
|
|
41
|
+
## Completed
|
|
42
|
+
|
|
43
|
+
### WF-YYYY-MM-DD-000 — Completed task title
|
|
44
|
+
Completed: YYYY-MM-DD
|
|
45
|
+
Level: 1
|
|
46
|
+
|
|
47
|
+
Close summary:
|
|
48
|
+
- Outcome: User-visible result.
|
|
49
|
+
- Validation: Checks performed.
|
|
50
|
+
- Gaps: Remaining follow-up or none.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Workflow Ledger
|
|
2
|
+
|
|
3
|
+
Shared resume-state ledger for AI coding agents.
|
|
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: Current focus name
|
|
12
|
+
updated: YYYY-MM-DD
|
|
13
|
+
-->
|
|
14
|
+
|
|
15
|
+
### WF-YYYY-MM-DD-001 — Task title
|
|
16
|
+
Status: In Progress
|
|
17
|
+
Level: 2
|
|
18
|
+
Started: YYYY-MM-DD
|
|
19
|
+
Last updated: YYYY-MM-DD
|
|
20
|
+
Current phase: Current focus name
|
|
21
|
+
|
|
22
|
+
Intent:
|
|
23
|
+
- One user-visible goal or change intent.
|
|
24
|
+
|
|
25
|
+
Current todo:
|
|
26
|
+
- [ ] Mutable next item.
|
|
27
|
+
|
|
28
|
+
Changes:
|
|
29
|
+
- Scope, todo, prerequisite, or blocker changes that matter for resume.
|
|
30
|
+
|
|
31
|
+
Prerequisites:
|
|
32
|
+
- Required before current work can proceed, or None.
|
|
33
|
+
|
|
34
|
+
Resume next:
|
|
35
|
+
- One concrete next action.
|
|
36
|
+
|
|
37
|
+
## Backlog / Future
|
|
38
|
+
|
|
39
|
+
- [ ] Future task discovered outside the active task scope — deferred because it does not block the current intent.
|
|
40
|
+
|
|
41
|
+
## Completed
|
|
42
|
+
|
|
43
|
+
### WF-YYYY-MM-DD-000 — Completed task title
|
|
44
|
+
Completed: YYYY-MM-DD
|
|
45
|
+
Level: 1
|
|
46
|
+
|
|
47
|
+
Close summary:
|
|
48
|
+
- Outcome: User-visible result.
|
|
49
|
+
- Validation: Checks performed.
|
|
50
|
+
- Gaps: Remaining follow-up or none.
|