@sienklogic/plan-build-run 2.6.0 → 2.8.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/CHANGELOG.md +23 -0
- package/package.json +1 -1
- package/plugins/copilot-pbr/plugin.json +1 -1
- package/plugins/copilot-pbr/setup.sh +1 -1
- package/plugins/copilot-pbr/skills/import/SKILL.md +2 -2
- package/plugins/copilot-pbr/skills/note/SKILL.md +36 -50
- package/plugins/copilot-pbr/skills/quick/SKILL.md +1 -1
- package/plugins/copilot-pbr/skills/shared/context-loader-task.md +1 -1
- package/plugins/copilot-pbr/skills/status/SKILL.md +3 -3
- package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor-pbr/skills/import/SKILL.md +2 -2
- package/plugins/cursor-pbr/skills/note/SKILL.md +36 -50
- package/plugins/cursor-pbr/skills/quick/SKILL.md +1 -1
- package/plugins/cursor-pbr/skills/shared/context-loader-task.md +1 -1
- package/plugins/cursor-pbr/skills/status/SKILL.md +3 -3
- package/plugins/pbr/.claude-plugin/plugin.json +1 -1
- package/plugins/pbr/scripts/check-plan-format.js +89 -7
- package/plugins/pbr/scripts/check-roadmap-sync.js +21 -5
- package/plugins/pbr/scripts/check-skill-workflow.js +7 -0
- package/plugins/pbr/scripts/check-subagent-output.js +79 -3
- package/plugins/pbr/scripts/post-write-dispatch.js +8 -1
- package/plugins/pbr/scripts/progress-tracker.js +13 -9
- package/plugins/pbr/scripts/validate-task.js +431 -1
- package/plugins/pbr/skills/import/SKILL.md +2 -2
- package/plugins/pbr/skills/note/SKILL.md +36 -50
- package/plugins/pbr/skills/quick/SKILL.md +1 -1
- package/plugins/pbr/skills/shared/context-loader-task.md +1 -1
- package/plugins/pbr/skills/status/SKILL.md +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,29 @@ All notable changes to Plan-Build-Run will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.8.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.7.0...plan-build-run-v2.8.0) (2026-02-20)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **03-01:** add review verifier, milestone complete, and build dependency gates ([bda474d](https://github.com/SienkLogic/plan-build-run/commit/bda474d8b88b128464df375d62de9acdeb9dff05))
|
|
14
|
+
* **04-01:** add post-artifact validation for begin/plan/build and VERIFICATION.md ([3cb4bc1](https://github.com/SienkLogic/plan-build-run/commit/3cb4bc1c0f277c6beca99f7c336fba5e7376f9ec))
|
|
15
|
+
* **05-01:** add STATE.md validation, checkpoint manifest check, and active-skill integrity warning ([d780d97](https://github.com/SienkLogic/plan-build-run/commit/d780d97e620915cb05e70372ce8c9d6003fd1ac8))
|
|
16
|
+
|
|
17
|
+
## [2.7.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.6.0...plan-build-run-v2.7.0) (2026-02-19)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **02-01:** add milestone, explore, import, scan write guards to checkSkillRules ([bd21366](https://github.com/SienkLogic/plan-build-run/commit/bd21366f8f63277566035f0827e3fde2ebc39400))
|
|
23
|
+
* **02-02:** add review planner gate to validate-task.js ([89ffb05](https://github.com/SienkLogic/plan-build-run/commit/89ffb05bc6384fc47fbf85ac7c875e16a29db0b9))
|
|
24
|
+
* **02-02:** strengthen ROADMAP sync warnings to CRITICAL level ([7120d60](https://github.com/SienkLogic/plan-build-run/commit/7120d60fdc6678d8c9853679b0d3464116821097))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* **tools:** auto-route quick skill to plan skill when user selects Full plan ([252a35e](https://github.com/SienkLogic/plan-build-run/commit/252a35ed9942c2b1902f38923bb80d92d819ae4e))
|
|
30
|
+
|
|
8
31
|
## [2.6.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.5.0...plan-build-run-v2.6.0) (2026-02-19)
|
|
9
32
|
|
|
10
33
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pbr",
|
|
3
3
|
"displayName": "Plan-Build-Run",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.8.0",
|
|
5
5
|
"description": "Plan-Build-Run — Structured development workflow for GitHub Copilot CLI. Solves context rot through disciplined agent delegation, structured planning, atomic execution, and goal-backward verification.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "SienkLogic",
|
|
@@ -37,7 +37,7 @@ fi
|
|
|
37
37
|
if command -v copilot &> /dev/null; then
|
|
38
38
|
echo "Found Copilot CLI. Installing plugin via 'copilot plugin install'..."
|
|
39
39
|
echo ""
|
|
40
|
-
copilot plugin install
|
|
40
|
+
copilot plugin install "$PLUGIN_DIR"
|
|
41
41
|
echo ""
|
|
42
42
|
echo "Plugin installed successfully via Copilot CLI."
|
|
43
43
|
else
|
|
@@ -76,7 +76,7 @@ Read all relevant context files. This context is used for conflict detection in
|
|
|
76
76
|
- trigger equals the phase number as integer
|
|
77
77
|
- trigger equals * (always matches)
|
|
78
78
|
9. Pending todos — scan .planning/todos/pending/ for items related to this phase
|
|
79
|
-
10.
|
|
79
|
+
10. Notes (if .planning/notes/ exists) — check for related notes
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Collect all of this into a context bundle for use in Steps 4 and 5.
|
|
@@ -150,7 +150,7 @@ Run each of these checks. If any matches, record a `[WARNING]`:
|
|
|
150
150
|
#### INFO checks (supplementary context):
|
|
151
151
|
Run each of these checks. If any matches, record an `[INFO]`:
|
|
152
152
|
|
|
153
|
-
1. **Related notes**: Are there related notes in
|
|
153
|
+
1. **Related notes**: Are there related notes in `.planning/notes/`?
|
|
154
154
|
2. **Matching seeds**: Are there matching seeds in `.planning/seeds/` that could enhance the plan?
|
|
155
155
|
3. **Prior phase patterns**: What patterns from prior phases (from SUMMARY.md `patterns` fields) should the imported plan follow?
|
|
156
156
|
|
|
@@ -23,12 +23,23 @@ This skill runs **inline** — no Task, no AskUserQuestion, no Bash.
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Storage Format
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Notes are stored as **individual markdown files** in a notes directory:
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
- **Project scope**: `.planning/notes/{YYYY-MM-DD}-{slug}.md` — used when `.planning/` directory exists in cwd
|
|
31
|
+
- **Global scope**: `~/.claude/notes/{YYYY-MM-DD}-{slug}.md` — used as fallback when no `.planning/`, or when `--global` flag is present
|
|
32
|
+
|
|
33
|
+
Each note file has this format:
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
---
|
|
37
|
+
date: "YYYY-MM-DD HH:mm"
|
|
38
|
+
promoted: false
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
{note text verbatim}
|
|
42
|
+
```
|
|
32
43
|
|
|
33
44
|
**`--global` flag**: Strip `--global` from anywhere in `$ARGUMENTS` before parsing. When present, force global scope regardless of whether `.planning/` exists.
|
|
34
45
|
|
|
@@ -53,27 +64,17 @@ Parse `$ARGUMENTS` after stripping `--global`:
|
|
|
53
64
|
|
|
54
65
|
## Subcommand: append
|
|
55
66
|
|
|
56
|
-
|
|
67
|
+
Create a timestamped note file in the target directory.
|
|
57
68
|
|
|
58
69
|
### Steps
|
|
59
70
|
|
|
60
|
-
1. Determine scope (project or global) per
|
|
61
|
-
2.
|
|
62
|
-
3.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Quick captures from `/pbr:note`. Ideas worth remembering.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
4. Ensure the file content ends with a newline before appending
|
|
74
|
-
5. Append: `- [YYYY-MM-DD HH:mm] {note text verbatim}`
|
|
75
|
-
6. Write the file
|
|
76
|
-
7. Confirm with exactly one line: `Noted ({scope}): {note text}`
|
|
71
|
+
1. Determine scope (project or global) per Storage Format above
|
|
72
|
+
2. Ensure the notes directory exists (`.planning/notes/` or `~/.claude/notes/`)
|
|
73
|
+
3. Generate slug: first ~4 meaningful words of the note text, lowercase, hyphen-separated (strip articles/prepositions from the start)
|
|
74
|
+
4. Generate filename: `{YYYY-MM-DD}-{slug}.md`
|
|
75
|
+
- If a file with that name already exists, append `-2`, `-3`, etc.
|
|
76
|
+
5. Write the file with frontmatter and note text (see Storage Format)
|
|
77
|
+
6. Confirm with exactly one line: `Noted ({scope}): {note text}`
|
|
77
78
|
- Where `{scope}` is "project" or "global"
|
|
78
79
|
|
|
79
80
|
### Constraints
|
|
@@ -90,11 +91,11 @@ Show notes from both project and global scopes.
|
|
|
90
91
|
|
|
91
92
|
### Steps
|
|
92
93
|
|
|
93
|
-
1.
|
|
94
|
-
2.
|
|
95
|
-
3.
|
|
96
|
-
4. Exclude
|
|
97
|
-
5.
|
|
94
|
+
1. Glob `.planning/notes/*.md` (if directory exists) — these are "project" notes
|
|
95
|
+
2. Glob `~/.claude/notes/*.md` (if directory exists) — these are "global" notes
|
|
96
|
+
3. For each file, read frontmatter to get `date` and `promoted` status
|
|
97
|
+
4. Exclude files where `promoted: true` from active counts (but still show them, dimmed)
|
|
98
|
+
5. Sort by date, number all active entries sequentially starting at 1
|
|
98
99
|
6. If total active entries > 20, show only the last 10 with a note about how many were omitted
|
|
99
100
|
|
|
100
101
|
### Display Format
|
|
@@ -102,18 +103,18 @@ Show notes from both project and global scopes.
|
|
|
102
103
|
```
|
|
103
104
|
Notes:
|
|
104
105
|
|
|
105
|
-
Project (.planning/
|
|
106
|
+
Project (.planning/notes/):
|
|
106
107
|
1. [2026-02-08 14:32] refactor the hook system to support async validators
|
|
107
108
|
2. [promoted] [2026-02-08 14:40] add rate limiting to the API endpoints
|
|
108
109
|
3. [2026-02-08 15:10] consider adding a --dry-run flag to build
|
|
109
110
|
|
|
110
|
-
Global (~/.claude/notes
|
|
111
|
+
Global (~/.claude/notes/):
|
|
111
112
|
4. [2026-02-08 10:00] cross-project idea about shared config
|
|
112
113
|
|
|
113
114
|
{count} active note(s). Use `/pbr:note promote <N>` to convert to a todo.
|
|
114
115
|
```
|
|
115
116
|
|
|
116
|
-
If a scope has no
|
|
117
|
+
If a scope has no directory or no entries, show: `(no notes)`
|
|
117
118
|
|
|
118
119
|
---
|
|
119
120
|
|
|
@@ -129,7 +130,7 @@ Convert a note into a todo file.
|
|
|
129
130
|
4. **Requires `.planning/` directory** — if it doesn't exist, warn: "Todos require a Plan-Build-Run project. Run `/pbr:begin` to initialize one, or use `/pbr:todo add` in an existing project."
|
|
130
131
|
5. Ensure `.planning/todos/pending/` directory exists
|
|
131
132
|
6. Generate todo ID: `{NNN}-{slug}` where NNN is the next sequential number (scan both `.planning/todos/pending/` and `.planning/todos/done/` for the highest existing number, increment by 1, zero-pad to 3 digits) and slug is the first ~4 meaningful words of the note text, lowercase, hyphen-separated
|
|
132
|
-
7. Extract the note text (
|
|
133
|
+
7. Extract the note text from the source file (body after frontmatter)
|
|
133
134
|
8. Create `.planning/todos/pending/{id}.md`:
|
|
134
135
|
|
|
135
136
|
```yaml
|
|
@@ -155,34 +156,18 @@ Promoted from quick note captured on {original date}.
|
|
|
155
156
|
- [ ] {primary criterion derived from note text}
|
|
156
157
|
```
|
|
157
158
|
|
|
158
|
-
9. Mark the
|
|
159
|
+
9. Mark the source note file as promoted: update its frontmatter to `promoted: true`
|
|
159
160
|
10. Confirm: `Promoted note {N} to todo {id}: {note text}`
|
|
160
161
|
|
|
161
162
|
---
|
|
162
163
|
|
|
163
|
-
## NOTES.md Format Reference
|
|
164
|
-
|
|
165
|
-
```markdown
|
|
166
|
-
# Notes
|
|
167
|
-
|
|
168
|
-
Quick captures from `/pbr:note`. Ideas worth remembering.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
- [2026-02-08 14:32] refactor the hook system to support async validators
|
|
173
|
-
- [promoted] [2026-02-08 14:40] add rate limiting to the API endpoints
|
|
174
|
-
- [2026-02-08 15:10] consider adding a --dry-run flag to build
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
164
|
## Edge Cases
|
|
180
165
|
|
|
181
166
|
1. **"list" as note text**: `/pbr:note list of things` → saves note "list of things" (subcommand only when `list` is the entire arg)
|
|
182
|
-
2. **No `.planning/`**: Falls back to global `~/.claude/notes
|
|
167
|
+
2. **No `.planning/`**: Falls back to global `~/.claude/notes/` — works in any directory
|
|
183
168
|
3. **Promote without project**: Warns that todos require `.planning/`, suggests `/pbr:begin`
|
|
184
169
|
4. **Large files**: `list` shows last 10 when >20 active entries
|
|
185
|
-
5. **
|
|
170
|
+
5. **Duplicate slugs**: Append `-2`, `-3` etc. to filename if slug already used on same date
|
|
186
171
|
6. **`--global` position**: Stripped from anywhere — `--global my idea` and `my idea --global` both save "my idea" globally
|
|
187
172
|
7. **Promote already-promoted**: Tell user "Note {N} is already promoted" and stop
|
|
188
173
|
8. **Empty note text after stripping flags**: Treat as `list` subcommand
|
|
@@ -225,3 +210,4 @@ Note {N} not found. Valid range: 1-{max}.
|
|
|
225
210
|
4. **DO NOT** create `.planning/` if it doesn't exist — fall back to global
|
|
226
211
|
5. **DO NOT** number promoted notes in the active count (but still display them)
|
|
227
212
|
6. **DO NOT** over-format the confirmation — one line is enough
|
|
213
|
+
7. **DO NOT** use a flat NOTES.md file — always use individual files in notes directory
|
|
@@ -85,7 +85,7 @@ Use AskUserQuestion:
|
|
|
85
85
|
multiSelect: false
|
|
86
86
|
|
|
87
87
|
If user selects "Quick task": continue to Step 4.
|
|
88
|
-
If user selects "Full plan":
|
|
88
|
+
If user selects "Full plan": clean up `.active-skill` if it exists, then chain directly to the plan skill. The user's task description carries over in conversation context — the plan skill will pick it up.
|
|
89
89
|
If user selects "Revise": go back to Step 2 to get a new task description.
|
|
90
90
|
If user types something else (freeform): interpret their response and proceed accordingly.
|
|
91
91
|
|
|
@@ -32,7 +32,7 @@ Task({
|
|
|
32
32
|
- .planning/CONTEXT.md
|
|
33
33
|
- Any .planning/phases/*/CONTEXT.md files
|
|
34
34
|
- .planning/research/SUMMARY.md (if exists)
|
|
35
|
-
- .planning/
|
|
35
|
+
- .planning/notes/*.md (if notes directory exists — read frontmatter for date/promoted status)
|
|
36
36
|
- .planning/HISTORY.md (if exists — scan for decisions relevant to current work only, do NOT summarize all history)
|
|
37
37
|
|
|
38
38
|
Return ONLY the briefing text. No preamble, no suggestions."
|
|
@@ -142,9 +142,9 @@ If any discrepancy found, add: `Run /pbr:resume to auto-reconcile STATE.md.`
|
|
|
142
142
|
- Count and summarize if any exist
|
|
143
143
|
|
|
144
144
|
#### Quick Notes
|
|
145
|
-
- Check `.planning/
|
|
146
|
-
- Count active notes (
|
|
147
|
-
- Also check `~/.claude/notes
|
|
145
|
+
- Check `.planning/notes/` directory for note files (individual `.md` files)
|
|
146
|
+
- Count active notes (files where frontmatter does NOT contain `promoted: true`)
|
|
147
|
+
- Also check `~/.claude/notes/` for global notes
|
|
148
148
|
|
|
149
149
|
#### Quick Tasks
|
|
150
150
|
- Check `.planning/quick/` for recent quick tasks
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pbr",
|
|
3
3
|
"displayName": "Plan-Build-Run",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.8.0",
|
|
5
5
|
"description": "Plan-Build-Run — Structured development workflow for Cursor. Solves context rot through disciplined subagent delegation, structured planning, atomic execution, and goal-backward verification.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "SienkLogic",
|
|
@@ -77,7 +77,7 @@ Read all relevant context files. This context is used for conflict detection in
|
|
|
77
77
|
- trigger equals the phase number as integer
|
|
78
78
|
- trigger equals * (always matches)
|
|
79
79
|
9. Pending todos — scan .planning/todos/pending/ for items related to this phase
|
|
80
|
-
10.
|
|
80
|
+
10. Notes (if .planning/notes/ exists) — check for related notes
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
Collect all of this into a context bundle for use in Steps 4 and 5.
|
|
@@ -151,7 +151,7 @@ Run each of these checks. If any matches, record a `[WARNING]`:
|
|
|
151
151
|
#### INFO checks (supplementary context):
|
|
152
152
|
Run each of these checks. If any matches, record an `[INFO]`:
|
|
153
153
|
|
|
154
|
-
1. **Related notes**: Are there related notes in
|
|
154
|
+
1. **Related notes**: Are there related notes in `.planning/notes/`?
|
|
155
155
|
2. **Matching seeds**: Are there matching seeds in `.planning/seeds/` that could enhance the plan?
|
|
156
156
|
3. **Prior phase patterns**: What patterns from prior phases (from SUMMARY.md `patterns` fields) should the imported plan follow?
|
|
157
157
|
|
|
@@ -24,12 +24,23 @@ This skill runs **inline** — no Task, no AskUserQuestion, no Bash.
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Storage Format
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Notes are stored as **individual markdown files** in a notes directory:
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
- **Project scope**: `.planning/notes/{YYYY-MM-DD}-{slug}.md` — used when `.planning/` directory exists in cwd
|
|
32
|
+
- **Global scope**: `~/.claude/notes/{YYYY-MM-DD}-{slug}.md` — used as fallback when no `.planning/`, or when `--global` flag is present
|
|
33
|
+
|
|
34
|
+
Each note file has this format:
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
---
|
|
38
|
+
date: "YYYY-MM-DD HH:mm"
|
|
39
|
+
promoted: false
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
{note text verbatim}
|
|
43
|
+
```
|
|
33
44
|
|
|
34
45
|
**`--global` flag**: Strip `--global` from anywhere in `$ARGUMENTS` before parsing. When present, force global scope regardless of whether `.planning/` exists.
|
|
35
46
|
|
|
@@ -54,27 +65,17 @@ Parse `$ARGUMENTS` after stripping `--global`:
|
|
|
54
65
|
|
|
55
66
|
## Subcommand: append
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
Create a timestamped note file in the target directory.
|
|
58
69
|
|
|
59
70
|
### Steps
|
|
60
71
|
|
|
61
|
-
1. Determine scope (project or global) per
|
|
62
|
-
2.
|
|
63
|
-
3.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Quick captures from `/pbr:note`. Ideas worth remembering.
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
4. Ensure the file content ends with a newline before appending
|
|
75
|
-
5. Append: `- [YYYY-MM-DD HH:mm] {note text verbatim}`
|
|
76
|
-
6. Write the file
|
|
77
|
-
7. Confirm with exactly one line: `Noted ({scope}): {note text}`
|
|
72
|
+
1. Determine scope (project or global) per Storage Format above
|
|
73
|
+
2. Ensure the notes directory exists (`.planning/notes/` or `~/.claude/notes/`)
|
|
74
|
+
3. Generate slug: first ~4 meaningful words of the note text, lowercase, hyphen-separated (strip articles/prepositions from the start)
|
|
75
|
+
4. Generate filename: `{YYYY-MM-DD}-{slug}.md`
|
|
76
|
+
- If a file with that name already exists, append `-2`, `-3`, etc.
|
|
77
|
+
5. Write the file with frontmatter and note text (see Storage Format)
|
|
78
|
+
6. Confirm with exactly one line: `Noted ({scope}): {note text}`
|
|
78
79
|
- Where `{scope}` is "project" or "global"
|
|
79
80
|
|
|
80
81
|
### Constraints
|
|
@@ -91,11 +92,11 @@ Show notes from both project and global scopes.
|
|
|
91
92
|
|
|
92
93
|
### Steps
|
|
93
94
|
|
|
94
|
-
1.
|
|
95
|
-
2.
|
|
96
|
-
3.
|
|
97
|
-
4. Exclude
|
|
98
|
-
5.
|
|
95
|
+
1. Glob `.planning/notes/*.md` (if directory exists) — these are "project" notes
|
|
96
|
+
2. Glob `~/.claude/notes/*.md` (if directory exists) — these are "global" notes
|
|
97
|
+
3. For each file, read frontmatter to get `date` and `promoted` status
|
|
98
|
+
4. Exclude files where `promoted: true` from active counts (but still show them, dimmed)
|
|
99
|
+
5. Sort by date, number all active entries sequentially starting at 1
|
|
99
100
|
6. If total active entries > 20, show only the last 10 with a note about how many were omitted
|
|
100
101
|
|
|
101
102
|
### Display Format
|
|
@@ -103,18 +104,18 @@ Show notes from both project and global scopes.
|
|
|
103
104
|
```
|
|
104
105
|
Notes:
|
|
105
106
|
|
|
106
|
-
Project (.planning/
|
|
107
|
+
Project (.planning/notes/):
|
|
107
108
|
1. [2026-02-08 14:32] refactor the hook system to support async validators
|
|
108
109
|
2. [promoted] [2026-02-08 14:40] add rate limiting to the API endpoints
|
|
109
110
|
3. [2026-02-08 15:10] consider adding a --dry-run flag to build
|
|
110
111
|
|
|
111
|
-
Global (~/.claude/notes
|
|
112
|
+
Global (~/.claude/notes/):
|
|
112
113
|
4. [2026-02-08 10:00] cross-project idea about shared config
|
|
113
114
|
|
|
114
115
|
{count} active note(s). Use `/pbr:note promote <N>` to convert to a todo.
|
|
115
116
|
```
|
|
116
117
|
|
|
117
|
-
If a scope has no
|
|
118
|
+
If a scope has no directory or no entries, show: `(no notes)`
|
|
118
119
|
|
|
119
120
|
---
|
|
120
121
|
|
|
@@ -130,7 +131,7 @@ Convert a note into a todo file.
|
|
|
130
131
|
4. **Requires `.planning/` directory** — if it doesn't exist, warn: "Todos require a Plan-Build-Run project. Run `/pbr:begin` to initialize one, or use `/pbr:todo add` in an existing project."
|
|
131
132
|
5. Ensure `.planning/todos/pending/` directory exists
|
|
132
133
|
6. Generate todo ID: `{NNN}-{slug}` where NNN is the next sequential number (scan both `.planning/todos/pending/` and `.planning/todos/done/` for the highest existing number, increment by 1, zero-pad to 3 digits) and slug is the first ~4 meaningful words of the note text, lowercase, hyphen-separated
|
|
133
|
-
7. Extract the note text (
|
|
134
|
+
7. Extract the note text from the source file (body after frontmatter)
|
|
134
135
|
8. Create `.planning/todos/pending/{id}.md`:
|
|
135
136
|
|
|
136
137
|
```yaml
|
|
@@ -156,34 +157,18 @@ Promoted from quick note captured on {original date}.
|
|
|
156
157
|
- [ ] {primary criterion derived from note text}
|
|
157
158
|
```
|
|
158
159
|
|
|
159
|
-
9. Mark the
|
|
160
|
+
9. Mark the source note file as promoted: update its frontmatter to `promoted: true`
|
|
160
161
|
10. Confirm: `Promoted note {N} to todo {id}: {note text}`
|
|
161
162
|
|
|
162
163
|
---
|
|
163
164
|
|
|
164
|
-
## NOTES.md Format Reference
|
|
165
|
-
|
|
166
|
-
```markdown
|
|
167
|
-
# Notes
|
|
168
|
-
|
|
169
|
-
Quick captures from `/pbr:note`. Ideas worth remembering.
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
- [2026-02-08 14:32] refactor the hook system to support async validators
|
|
174
|
-
- [promoted] [2026-02-08 14:40] add rate limiting to the API endpoints
|
|
175
|
-
- [2026-02-08 15:10] consider adding a --dry-run flag to build
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
165
|
## Edge Cases
|
|
181
166
|
|
|
182
167
|
1. **"list" as note text**: `/pbr:note list of things` → saves note "list of things" (subcommand only when `list` is the entire arg)
|
|
183
|
-
2. **No `.planning/`**: Falls back to global `~/.claude/notes
|
|
168
|
+
2. **No `.planning/`**: Falls back to global `~/.claude/notes/` — works in any directory
|
|
184
169
|
3. **Promote without project**: Warns that todos require `.planning/`, suggests `/pbr:begin`
|
|
185
170
|
4. **Large files**: `list` shows last 10 when >20 active entries
|
|
186
|
-
5. **
|
|
171
|
+
5. **Duplicate slugs**: Append `-2`, `-3` etc. to filename if slug already used on same date
|
|
187
172
|
6. **`--global` position**: Stripped from anywhere — `--global my idea` and `my idea --global` both save "my idea" globally
|
|
188
173
|
7. **Promote already-promoted**: Tell user "Note {N} is already promoted" and stop
|
|
189
174
|
8. **Empty note text after stripping flags**: Treat as `list` subcommand
|
|
@@ -226,3 +211,4 @@ Note {N} not found. Valid range: 1-{max}.
|
|
|
226
211
|
4. **DO NOT** create `.planning/` if it doesn't exist — fall back to global
|
|
227
212
|
5. **DO NOT** number promoted notes in the active count (but still display them)
|
|
228
213
|
6. **DO NOT** over-format the confirmation — one line is enough
|
|
214
|
+
7. **DO NOT** use a flat NOTES.md file — always use individual files in notes directory
|
|
@@ -85,7 +85,7 @@ Use AskUserQuestion:
|
|
|
85
85
|
multiSelect: false
|
|
86
86
|
|
|
87
87
|
If user selects "Quick task": continue to Step 4.
|
|
88
|
-
If user selects "Full plan":
|
|
88
|
+
If user selects "Full plan": clean up `.active-skill` if it exists, then chain directly to the plan skill. The user's task description carries over in conversation context — the plan skill will pick it up.
|
|
89
89
|
If user selects "Revise": go back to Step 2 to get a new task description.
|
|
90
90
|
If user types something else (freeform): interpret their response and proceed accordingly.
|
|
91
91
|
|
|
@@ -32,7 +32,7 @@ Task({
|
|
|
32
32
|
- .planning/CONTEXT.md
|
|
33
33
|
- Any .planning/phases/*/CONTEXT.md files
|
|
34
34
|
- .planning/research/SUMMARY.md (if exists)
|
|
35
|
-
- .planning/
|
|
35
|
+
- .planning/notes/*.md (if notes directory exists — read frontmatter for date/promoted status)
|
|
36
36
|
- .planning/HISTORY.md (if exists — scan for decisions relevant to current work only, do NOT summarize all history)
|
|
37
37
|
|
|
38
38
|
Return ONLY the briefing text. No preamble, no suggestions."
|
|
@@ -142,9 +142,9 @@ If any discrepancy found, add: `Run /pbr:resume to auto-reconcile STATE.md.`
|
|
|
142
142
|
- Count and summarize if any exist
|
|
143
143
|
|
|
144
144
|
#### Quick Notes
|
|
145
|
-
- Check `.planning/
|
|
146
|
-
- Count active notes (
|
|
147
|
-
- Also check `~/.claude/notes
|
|
145
|
+
- Check `.planning/notes/` directory for note files (individual `.md` files)
|
|
146
|
+
- Count active notes (files where frontmatter does NOT contain `promoted: true`)
|
|
147
|
+
- Also check `~/.claude/notes/` for global notes
|
|
148
148
|
|
|
149
149
|
#### Quick Tasks
|
|
150
150
|
- Check `.planning/quick/` for recent quick tasks
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pbr",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Plan-Build-Run — Structured development workflow for Claude Code. Solves context rot through disciplined subagent delegation, structured planning, atomic execution, and goal-backward verification.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SienkLogic",
|
|
@@ -42,7 +42,9 @@ function main() {
|
|
|
42
42
|
const isPlan = basename.endsWith('PLAN.md');
|
|
43
43
|
const isSummary = basename.includes('SUMMARY') && basename.endsWith('.md');
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
const isVerification = basename === 'VERIFICATION.md';
|
|
46
|
+
|
|
47
|
+
if (!isPlan && !isSummary && !isVerification) {
|
|
46
48
|
process.exit(0);
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -53,9 +55,11 @@ function main() {
|
|
|
53
55
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
54
56
|
const result = isPlan
|
|
55
57
|
? validatePlan(content, filePath)
|
|
56
|
-
:
|
|
58
|
+
: isVerification
|
|
59
|
+
? validateVerification(content, filePath)
|
|
60
|
+
: validateSummary(content, filePath);
|
|
57
61
|
|
|
58
|
-
const eventType = isPlan ? 'plan-validated' : 'summary-validated';
|
|
62
|
+
const eventType = isPlan ? 'plan-validated' : isVerification ? 'verification-validated' : 'summary-validated';
|
|
59
63
|
|
|
60
64
|
if (result.errors.length > 0) {
|
|
61
65
|
// Structural errors — block and force correction
|
|
@@ -231,16 +235,19 @@ function checkPlanWrite(data) {
|
|
|
231
235
|
const basename = path.basename(filePath);
|
|
232
236
|
const isPlan = basename.endsWith('PLAN.md');
|
|
233
237
|
const isSummary = basename.includes('SUMMARY') && basename.endsWith('.md');
|
|
238
|
+
const isVerification = basename === 'VERIFICATION.md';
|
|
234
239
|
|
|
235
|
-
if (!isPlan && !isSummary) return null;
|
|
240
|
+
if (!isPlan && !isSummary && !isVerification) return null;
|
|
236
241
|
if (!fs.existsSync(filePath)) return null;
|
|
237
242
|
|
|
238
243
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
239
244
|
const result = isPlan
|
|
240
245
|
? validatePlan(content, filePath)
|
|
241
|
-
:
|
|
246
|
+
: isVerification
|
|
247
|
+
? validateVerification(content, filePath)
|
|
248
|
+
: validateSummary(content, filePath);
|
|
242
249
|
|
|
243
|
-
const eventType = isPlan ? 'plan-validated' : 'summary-validated';
|
|
250
|
+
const eventType = isPlan ? 'plan-validated' : isVerification ? 'verification-validated' : 'summary-validated';
|
|
244
251
|
|
|
245
252
|
if (result.errors.length > 0) {
|
|
246
253
|
logHook('check-plan-format', 'PostToolUse', 'block', { file: basename, errors: result.errors });
|
|
@@ -266,5 +273,80 @@ function checkPlanWrite(data) {
|
|
|
266
273
|
return null;
|
|
267
274
|
}
|
|
268
275
|
|
|
269
|
-
|
|
276
|
+
function validateState(content, _filePath) {
|
|
277
|
+
const errors = [];
|
|
278
|
+
const warnings = [];
|
|
279
|
+
|
|
280
|
+
// STATE.md uses warnings (not errors) because it's written by multiple hooks
|
|
281
|
+
// and auto-sync processes. Blocking would create feedback loops.
|
|
282
|
+
if (!content.startsWith('---')) {
|
|
283
|
+
warnings.push('Missing YAML frontmatter');
|
|
284
|
+
} else {
|
|
285
|
+
const frontmatterEnd = content.indexOf('---', 3);
|
|
286
|
+
if (frontmatterEnd === -1) {
|
|
287
|
+
warnings.push('Unclosed YAML frontmatter');
|
|
288
|
+
} else {
|
|
289
|
+
const frontmatter = content.substring(3, frontmatterEnd);
|
|
290
|
+
const requiredFields = ['version', 'current_phase', 'total_phases', 'phase_slug', 'status'];
|
|
291
|
+
for (const field of requiredFields) {
|
|
292
|
+
if (!frontmatter.includes(`${field}:`)) {
|
|
293
|
+
warnings.push(`Frontmatter missing "${field}" field`);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return { errors, warnings };
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function validateVerification(content, _filePath) {
|
|
303
|
+
const errors = [];
|
|
304
|
+
const warnings = [];
|
|
305
|
+
|
|
306
|
+
if (!content.startsWith('---')) {
|
|
307
|
+
errors.push('Missing YAML frontmatter');
|
|
308
|
+
} else {
|
|
309
|
+
const frontmatterEnd = content.indexOf('---', 3);
|
|
310
|
+
if (frontmatterEnd === -1) {
|
|
311
|
+
errors.push('Unclosed YAML frontmatter');
|
|
312
|
+
} else {
|
|
313
|
+
const frontmatter = content.substring(3, frontmatterEnd);
|
|
314
|
+
const requiredFields = ['status', 'phase', 'checked_at', 'must_haves_checked', 'must_haves_passed', 'must_haves_failed'];
|
|
315
|
+
for (const field of requiredFields) {
|
|
316
|
+
if (!frontmatter.includes(`${field}:`)) {
|
|
317
|
+
errors.push(`Frontmatter missing "${field}" field`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return { errors, warnings };
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Separate STATE.md validation for use by dispatchers.
|
|
328
|
+
* Kept separate from checkPlanWrite because STATE.md routing in the
|
|
329
|
+
* dispatcher must happen AFTER roadmap sync (which also triggers on STATE.md).
|
|
330
|
+
*/
|
|
331
|
+
function checkStateWrite(data) {
|
|
332
|
+
const filePath = data.tool_input?.file_path || data.tool_input?.path || '';
|
|
333
|
+
const basename = path.basename(filePath);
|
|
334
|
+
if (basename !== 'STATE.md') return null;
|
|
335
|
+
if (!fs.existsSync(filePath)) return null;
|
|
336
|
+
|
|
337
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
338
|
+
const result = validateState(content, filePath);
|
|
339
|
+
|
|
340
|
+
if (result.warnings.length > 0) {
|
|
341
|
+
logHook('check-plan-format', 'PostToolUse', 'warn', { file: basename, warnings: result.warnings });
|
|
342
|
+
logEvent('workflow', 'state-validated', { file: basename, status: 'warn', warningCount: result.warnings.length });
|
|
343
|
+
return { output: { additionalContext: `${basename} warnings:\n${result.warnings.map(i => ` - ${i}`).join('\n')}` } };
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
logHook('check-plan-format', 'PostToolUse', 'pass', { file: basename });
|
|
347
|
+
logEvent('workflow', 'state-validated', { file: basename, status: 'pass' });
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
module.exports = { validatePlan, validateSummary, validateVerification, validateState, checkPlanWrite, checkStateWrite };
|
|
270
352
|
if (require.main === module || process.argv[1] === __filename) { main(); }
|