@sienklogic/plan-build-run 2.3.0 → 2.3.1
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/package.json +1 -1
- package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor-pbr/skills/do/SKILL.md +67 -0
- package/plugins/cursor-pbr/skills/todo/SKILL.md +28 -5
- package/plugins/pbr/.claude-plugin/plugin.json +1 -1
- package/plugins/pbr/scripts/validate-skill-args.js +54 -10
- package/plugins/pbr/skills/do/SKILL.md +70 -0
- package/plugins/pbr/skills/todo/SKILL.md +29 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pbr",
|
|
3
3
|
"displayName": "Plan-Build-Run",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.1",
|
|
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",
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: do
|
|
3
|
+
description: "Route freeform text to the right PBR skill automatically."
|
|
4
|
+
argument-hint: "<freeform description of what you want to do>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /pbr:do — Freeform Task Router
|
|
8
|
+
|
|
9
|
+
You are running the **do** skill. Your job is to analyze freeform text from the user and route it to the most appropriate PBR skill. You are a dispatcher, not an executor — you never do the work yourself.
|
|
10
|
+
|
|
11
|
+
## Step 0 — Immediate Output
|
|
12
|
+
|
|
13
|
+
**Before ANY tool calls**, display this banner:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
17
|
+
PLAN-BUILD-RUN ► ROUTING
|
|
18
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Then proceed to Step 1.
|
|
22
|
+
|
|
23
|
+
## Step 1 — Validate Input
|
|
24
|
+
|
|
25
|
+
If `$ARGUMENTS` is empty, ask the user what they want to do via AskUserQuestion:
|
|
26
|
+
```
|
|
27
|
+
What would you like to do? Describe the task, bug, or idea and I'll route it to the right skill.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Step 2 — Analyze and Route
|
|
31
|
+
|
|
32
|
+
Evaluate `$ARGUMENTS` against these routing criteria. Apply the **first matching** rule:
|
|
33
|
+
|
|
34
|
+
| If the text describes... | Route to | Why |
|
|
35
|
+
|--------------------------|----------|-----|
|
|
36
|
+
| A bug, error, crash, failure, or something broken | `/pbr:debug` | Needs systematic investigation |
|
|
37
|
+
| Exploration, research, comparison, or "how does X work" | `/pbr:explore` | Open-ended investigation |
|
|
38
|
+
| A complex task: refactoring, migration, multi-file architecture, system redesign | `/pbr:plan add` | Needs a full phase with research/plan/build cycle |
|
|
39
|
+
| A review or quality concern about existing work | `/pbr:review` | Needs verification against plan |
|
|
40
|
+
| A note, idea, or "remember to..." | `/pbr:note` | Capture for later |
|
|
41
|
+
| A specific, actionable task (add feature, fix typo, update config, write test) | `/pbr:quick` | Self-contained, single executor |
|
|
42
|
+
|
|
43
|
+
**Ambiguity handling**: If the text could reasonably match multiple routes, ask the user via AskUserQuestion with the top 2-3 options. For example:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
"Refactor the authentication system" could be:
|
|
47
|
+
- /pbr:plan add — Full planning cycle (recommended for multi-file refactors)
|
|
48
|
+
- /pbr:quick — Quick execution (if scope is small and clear)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Step 3 — Confirm and Dispatch
|
|
52
|
+
|
|
53
|
+
Display the routing decision:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
**Input:** {first 80 chars of arguments}
|
|
57
|
+
**Routing to:** {chosen skill}
|
|
58
|
+
**Reason:** {one-line explanation}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Then invoke the chosen skill via the Skill tool, passing `$ARGUMENTS` as the args.
|
|
62
|
+
|
|
63
|
+
**Special case for `/pbr:plan add`**: When routing to plan, check if `.planning/ROADMAP.md` exists first (via Read). If it doesn't, suggest `/pbr:begin` instead — the user needs to set up the project before they can add phases.
|
|
64
|
+
|
|
65
|
+
## Step 4 — No Follow-Up
|
|
66
|
+
|
|
67
|
+
After invoking the skill, your job is done. The dispatched skill handles everything from here (execution, commits, state updates). Do not add any additional output after the Skill tool call.
|
|
@@ -184,17 +184,38 @@ Todo {NNN} not found in pending todos.
|
|
|
184
184
|
2. If not found, display the same error block as `done` — suggest `/pbr:todo list`
|
|
185
185
|
3. Read the todo file content (frontmatter + body)
|
|
186
186
|
4. Extract the `title` from frontmatter and the full body (Goal, Scope, Acceptance Criteria sections)
|
|
187
|
-
|
|
187
|
+
|
|
188
|
+
5. **Assess complexity** to choose the right skill. Evaluate the todo content against these criteria:
|
|
189
|
+
|
|
190
|
+
| Signal | Route to |
|
|
191
|
+
|--------|----------|
|
|
192
|
+
| Single file change, small fix, simple addition | `/pbr:quick` |
|
|
193
|
+
| Multiple acceptance criteria, multi-file scope, architectural decisions, needs research | `/pbr:plan` (requires an active phase) |
|
|
194
|
+
| Investigation needed, unclear root cause | `/pbr:debug` |
|
|
195
|
+
| Open-ended exploration, no clear deliverable | `/pbr:explore` |
|
|
196
|
+
|
|
197
|
+
If unsure, ask the user via AskUserQuestion:
|
|
198
|
+
```
|
|
199
|
+
Todo {NNN} could be handled as a quick task or may need full planning.
|
|
200
|
+
|
|
201
|
+
Which approach?
|
|
202
|
+
- Quick task (/pbr:quick) — single executor, atomic commit
|
|
203
|
+
- Full planning (/pbr:plan) — research, plan, build cycle
|
|
204
|
+
- Debug (/pbr:debug) — systematic investigation
|
|
205
|
+
- Explore (/pbr:explore) — open-ended investigation
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
6. Display branded output:
|
|
188
209
|
```
|
|
189
210
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
190
211
|
PLAN-BUILD-RUN ► WORKING ON TODO {NNN}
|
|
191
212
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
192
213
|
|
|
193
214
|
**Todo {NNN}:** {title}
|
|
194
|
-
|
|
195
|
-
Launching /pbr:quick with todo context...
|
|
215
|
+
**Routing to:** /pbr:{chosen-skill}
|
|
196
216
|
```
|
|
197
|
-
|
|
217
|
+
|
|
218
|
+
7. Invoke the chosen skill via the Skill tool, passing the todo title and body as args:
|
|
198
219
|
|
|
199
220
|
```
|
|
200
221
|
{title}
|
|
@@ -203,7 +224,9 @@ Context from todo {NNN}:
|
|
|
203
224
|
{body content — Goal, Scope, Acceptance Criteria sections}
|
|
204
225
|
```
|
|
205
226
|
|
|
206
|
-
|
|
227
|
+
For `/pbr:plan`, if no phase exists for this work yet, suggest the user run `/pbr:plan add` first to create one, then re-run `/pbr:todo work {NNN}`.
|
|
228
|
+
|
|
229
|
+
8. When the skill completes, remind the user:
|
|
207
230
|
|
|
208
231
|
```
|
|
209
232
|
───────────────────────────────────────────────────────────────
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pbr",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
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",
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* - /pbr:plan — blocks freeform text arguments that don't match
|
|
8
8
|
* valid patterns (phase number, subcommand, flags).
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* When freeform text is detected, analyzes it to suggest the most
|
|
11
|
+
* appropriate skill (quick, debug, explore, todo, plan).
|
|
12
12
|
*
|
|
13
13
|
* Exit codes:
|
|
14
14
|
* 0 = allowed (valid args or non-plan skill)
|
|
@@ -29,6 +29,47 @@ const { logHook } = require('./hook-logger');
|
|
|
29
29
|
*/
|
|
30
30
|
const PLAN_VALID_PATTERN = /^\s*$|^\s*\d+(\.\d+)?\s*(--(?:skip-research|assumptions|gaps|teams)\s*)*$|^\s*(?:add|check)\s*$|^\s*(?:insert|remove)\s+\d+(\.\d+)?\s*$/i;
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Keyword patterns for routing freeform text to the right skill.
|
|
34
|
+
* Order matters — first match wins.
|
|
35
|
+
*/
|
|
36
|
+
const ROUTE_PATTERNS = [
|
|
37
|
+
{
|
|
38
|
+
pattern: /\b(bugs?|fix(es|ing)?|errors?|crash(es|ing)?|fails?|failing|broken|issues?|debug(ging)?|diagnos(e|ing)|stack\s*trace|exceptions?|regress(ion|ing)?)\b/i,
|
|
39
|
+
skill: '/pbr:debug',
|
|
40
|
+
reason: 'Looks like a bug or debugging task'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
pattern: /\b(explore|research|understand|how does|what is|analy[zs]e|evaluate|compare|pros and cons|trade-?offs?|approach(es)?)\b/i,
|
|
44
|
+
skill: '/pbr:explore',
|
|
45
|
+
reason: 'Looks like exploration or research'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
pattern: /\b(refactor|redesign|architect|migrate|restructure|overhaul|rewrite|multi-?phase|complex|system|infrastructure)\b/i,
|
|
49
|
+
skill: '/pbr:plan add',
|
|
50
|
+
reason: 'Looks like a complex task that needs full planning'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
// Default: anything actionable goes to quick
|
|
54
|
+
pattern: /./,
|
|
55
|
+
skill: '/pbr:quick',
|
|
56
|
+
reason: 'Looks like a straightforward task'
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Suggest the best skill for freeform text.
|
|
62
|
+
* Returns { skill, reason }.
|
|
63
|
+
*/
|
|
64
|
+
function suggestSkill(text) {
|
|
65
|
+
for (const route of ROUTE_PATTERNS) {
|
|
66
|
+
if (route.pattern.test(text)) {
|
|
67
|
+
return { skill: route.skill, reason: route.reason };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return { skill: '/pbr:quick', reason: 'Default routing' };
|
|
71
|
+
}
|
|
72
|
+
|
|
32
73
|
/**
|
|
33
74
|
* Check whether a Skill tool call has valid arguments.
|
|
34
75
|
* Returns null if valid, or { output, exitCode } if blocked.
|
|
@@ -48,11 +89,14 @@ function checkSkillArgs(data) {
|
|
|
48
89
|
return null;
|
|
49
90
|
}
|
|
50
91
|
|
|
51
|
-
// Freeform text detected —
|
|
92
|
+
// Freeform text detected — suggest the right skill
|
|
93
|
+
const suggestion = suggestSkill(args);
|
|
94
|
+
|
|
52
95
|
logHook('validate-skill-args', 'PreToolUse', 'blocked', {
|
|
53
96
|
skill,
|
|
54
97
|
args: args.substring(0, 100),
|
|
55
|
-
reason: 'freeform-text'
|
|
98
|
+
reason: 'freeform-text',
|
|
99
|
+
suggested: suggestion.skill
|
|
56
100
|
});
|
|
57
101
|
|
|
58
102
|
return {
|
|
@@ -62,17 +106,17 @@ function checkSkillArgs(data) {
|
|
|
62
106
|
'',
|
|
63
107
|
'The arguments "' + args.substring(0, 80) + (args.length > 80 ? '...' : '') + '" do not match any valid pattern.',
|
|
64
108
|
'',
|
|
65
|
-
'Valid usage:',
|
|
109
|
+
'Valid /pbr:plan usage:',
|
|
66
110
|
' /pbr:plan <N> Plan phase N',
|
|
67
111
|
' /pbr:plan <N> --gaps Create gap-closure plans',
|
|
68
112
|
' /pbr:plan add Add a new phase',
|
|
69
113
|
' /pbr:plan insert <N> Insert a phase at position N',
|
|
70
114
|
' /pbr:plan remove <N> Remove phase N',
|
|
71
115
|
'',
|
|
72
|
-
'
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'
|
|
116
|
+
'Suggested skill for this text:',
|
|
117
|
+
' ' + suggestion.skill + ' — ' + suggestion.reason,
|
|
118
|
+
'',
|
|
119
|
+
'Or use /pbr:do to auto-route freeform text to the right skill.'
|
|
76
120
|
].join('\n')
|
|
77
121
|
},
|
|
78
122
|
exitCode: 2
|
|
@@ -102,5 +146,5 @@ function main() {
|
|
|
102
146
|
});
|
|
103
147
|
}
|
|
104
148
|
|
|
105
|
-
module.exports = { checkSkillArgs, PLAN_VALID_PATTERN };
|
|
149
|
+
module.exports = { checkSkillArgs, suggestSkill, PLAN_VALID_PATTERN, ROUTE_PATTERNS };
|
|
106
150
|
if (require.main === module || process.argv[1] === __filename) { main(); }
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: do
|
|
3
|
+
description: "Route freeform text to the right PBR skill automatically."
|
|
4
|
+
allowed-tools: Read, Skill, AskUserQuestion
|
|
5
|
+
argument-hint: "<freeform description of what you want to do>"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~3,000 tokens. Begin executing Step 1 immediately.**
|
|
9
|
+
|
|
10
|
+
# /pbr:do — Freeform Task Router
|
|
11
|
+
|
|
12
|
+
You are running the **do** skill. Your job is to analyze freeform text from the user and route it to the most appropriate PBR skill. You are a dispatcher, not an executor — you never do the work yourself.
|
|
13
|
+
|
|
14
|
+
## Step 0 — Immediate Output
|
|
15
|
+
|
|
16
|
+
**Before ANY tool calls**, display this banner:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
20
|
+
PLAN-BUILD-RUN ► ROUTING
|
|
21
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then proceed to Step 1.
|
|
25
|
+
|
|
26
|
+
## Step 1 — Validate Input
|
|
27
|
+
|
|
28
|
+
If `$ARGUMENTS` is empty, ask the user what they want to do via AskUserQuestion:
|
|
29
|
+
```
|
|
30
|
+
What would you like to do? Describe the task, bug, or idea and I'll route it to the right skill.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Step 2 — Analyze and Route
|
|
34
|
+
|
|
35
|
+
Evaluate `$ARGUMENTS` against these routing criteria. Apply the **first matching** rule:
|
|
36
|
+
|
|
37
|
+
| If the text describes... | Route to | Why |
|
|
38
|
+
|--------------------------|----------|-----|
|
|
39
|
+
| A bug, error, crash, failure, or something broken | `/pbr:debug` | Needs systematic investigation |
|
|
40
|
+
| Exploration, research, comparison, or "how does X work" | `/pbr:explore` | Open-ended investigation |
|
|
41
|
+
| A complex task: refactoring, migration, multi-file architecture, system redesign | `/pbr:plan add` | Needs a full phase with research/plan/build cycle |
|
|
42
|
+
| A review or quality concern about existing work | `/pbr:review` | Needs verification against plan |
|
|
43
|
+
| A note, idea, or "remember to..." | `/pbr:note` | Capture for later |
|
|
44
|
+
| A specific, actionable task (add feature, fix typo, update config, write test) | `/pbr:quick` | Self-contained, single executor |
|
|
45
|
+
|
|
46
|
+
**Ambiguity handling**: If the text could reasonably match multiple routes, ask the user via AskUserQuestion with the top 2-3 options. For example:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
"Refactor the authentication system" could be:
|
|
50
|
+
- /pbr:plan add — Full planning cycle (recommended for multi-file refactors)
|
|
51
|
+
- /pbr:quick — Quick execution (if scope is small and clear)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Step 3 — Confirm and Dispatch
|
|
55
|
+
|
|
56
|
+
Display the routing decision:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
**Input:** {first 80 chars of arguments}
|
|
60
|
+
**Routing to:** {chosen skill}
|
|
61
|
+
**Reason:** {one-line explanation}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then invoke the chosen skill via the Skill tool, passing `$ARGUMENTS` as the args.
|
|
65
|
+
|
|
66
|
+
**Special case for `/pbr:plan add`**: When routing to plan, check if `.planning/ROADMAP.md` exists first (via Read). If it doesn't, suggest `/pbr:begin` instead — the user needs to set up the project before they can add phases.
|
|
67
|
+
|
|
68
|
+
## Step 4 — No Follow-Up
|
|
69
|
+
|
|
70
|
+
After invoking the skill, your job is done. The dispatched skill handles everything from here (execution, commits, state updates). Do not add any additional output after the Skill tool call.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: todo
|
|
3
3
|
description: "File-based persistent todos. Add, list, complete — survives sessions."
|
|
4
|
-
allowed-tools: Read, Write, Bash, Glob, Grep, Skill
|
|
4
|
+
allowed-tools: Read, Write, Bash, Glob, Grep, Skill, AskUserQuestion
|
|
5
5
|
argument-hint: "add <description> | list [theme] | done <NNN> | work <NNN>"
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -187,17 +187,38 @@ Todo {NNN} not found in pending todos.
|
|
|
187
187
|
2. If not found, display the same error block as `done` — suggest `/pbr:todo list`
|
|
188
188
|
3. Read the todo file content (frontmatter + body)
|
|
189
189
|
4. Extract the `title` from frontmatter and the full body (Goal, Scope, Acceptance Criteria sections)
|
|
190
|
-
|
|
190
|
+
|
|
191
|
+
5. **Assess complexity** to choose the right skill. Evaluate the todo content against these criteria:
|
|
192
|
+
|
|
193
|
+
| Signal | Route to |
|
|
194
|
+
|--------|----------|
|
|
195
|
+
| Single file change, small fix, simple addition | `/pbr:quick` |
|
|
196
|
+
| Multiple acceptance criteria, multi-file scope, architectural decisions, needs research | `/pbr:plan` (requires an active phase) |
|
|
197
|
+
| Investigation needed, unclear root cause | `/pbr:debug` |
|
|
198
|
+
| Open-ended exploration, no clear deliverable | `/pbr:explore` |
|
|
199
|
+
|
|
200
|
+
If unsure, ask the user via AskUserQuestion:
|
|
201
|
+
```
|
|
202
|
+
Todo {NNN} could be handled as a quick task or may need full planning.
|
|
203
|
+
|
|
204
|
+
Which approach?
|
|
205
|
+
- Quick task (/pbr:quick) — single executor, atomic commit
|
|
206
|
+
- Full planning (/pbr:plan) — research, plan, build cycle
|
|
207
|
+
- Debug (/pbr:debug) — systematic investigation
|
|
208
|
+
- Explore (/pbr:explore) — open-ended investigation
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
6. Display branded output:
|
|
191
212
|
```
|
|
192
213
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
193
214
|
PLAN-BUILD-RUN ► WORKING ON TODO {NNN}
|
|
194
215
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
195
216
|
|
|
196
217
|
**Todo {NNN}:** {title}
|
|
197
|
-
|
|
198
|
-
Launching /pbr:quick with todo context...
|
|
218
|
+
**Routing to:** /pbr:{chosen-skill}
|
|
199
219
|
```
|
|
200
|
-
|
|
220
|
+
|
|
221
|
+
7. Invoke the chosen skill via the Skill tool, passing the todo title and body as args:
|
|
201
222
|
|
|
202
223
|
```
|
|
203
224
|
{title}
|
|
@@ -206,7 +227,9 @@ Context from todo {NNN}:
|
|
|
206
227
|
{body content — Goal, Scope, Acceptance Criteria sections}
|
|
207
228
|
```
|
|
208
229
|
|
|
209
|
-
|
|
230
|
+
For `/pbr:plan`, if no phase exists for this work yet, suggest the user run `/pbr:plan add` first to create one, then re-run `/pbr:todo work {NNN}`.
|
|
231
|
+
|
|
232
|
+
8. When the skill completes, remind the user:
|
|
210
233
|
|
|
211
234
|
```
|
|
212
235
|
───────────────────────────────────────────────────────────────
|