@sienklogic/plan-build-run 2.16.0 → 2.17.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/CLAUDE.md +2 -2
  3. package/dashboard/src/services/milestone.service.js +23 -1
  4. package/dashboard/src/services/phase.service.js +4 -3
  5. package/dashboard/src/services/roadmap.service.js +1 -1
  6. package/dashboard/src/views/partials/dependencies-content.ejs +2 -2
  7. package/dashboard/src/views/partials/phase-content.ejs +3 -3
  8. package/package.json +1 -1
  9. package/plugins/copilot-pbr/README.md +5 -2
  10. package/plugins/copilot-pbr/agents/audit.agent.md +113 -0
  11. package/plugins/copilot-pbr/plugin.json +1 -1
  12. package/plugins/copilot-pbr/skills/audit/SKILL.md +330 -0
  13. package/plugins/copilot-pbr/skills/help/SKILL.md +5 -1
  14. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  15. package/plugins/cursor-pbr/README.md +7 -2
  16. package/plugins/cursor-pbr/agents/audit.md +178 -0
  17. package/plugins/cursor-pbr/skills/audit/SKILL.md +331 -0
  18. package/plugins/cursor-pbr/skills/help/SKILL.md +5 -1
  19. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  20. package/plugins/pbr/agents/audit.md +186 -0
  21. package/plugins/pbr/commands/audit.md +5 -0
  22. package/plugins/pbr/commands/begin.md +1 -1
  23. package/plugins/pbr/commands/build.md +1 -1
  24. package/plugins/pbr/commands/config.md +1 -1
  25. package/plugins/pbr/commands/continue.md +1 -1
  26. package/plugins/pbr/commands/dashboard.md +1 -1
  27. package/plugins/pbr/commands/debug.md +1 -1
  28. package/plugins/pbr/commands/discuss.md +1 -1
  29. package/plugins/pbr/commands/explore.md +1 -1
  30. package/plugins/pbr/commands/health.md +1 -1
  31. package/plugins/pbr/commands/help.md +1 -1
  32. package/plugins/pbr/commands/import.md +1 -1
  33. package/plugins/pbr/commands/milestone.md +1 -1
  34. package/plugins/pbr/commands/note.md +1 -1
  35. package/plugins/pbr/commands/pause.md +1 -1
  36. package/plugins/pbr/commands/plan.md +1 -1
  37. package/plugins/pbr/commands/quick.md +1 -1
  38. package/plugins/pbr/commands/resume.md +1 -1
  39. package/plugins/pbr/commands/review.md +1 -1
  40. package/plugins/pbr/commands/scan.md +1 -1
  41. package/plugins/pbr/commands/setup.md +1 -1
  42. package/plugins/pbr/commands/status.md +1 -1
  43. package/plugins/pbr/commands/statusline.md +1 -1
  44. package/plugins/pbr/commands/todo.md +1 -1
  45. package/plugins/pbr/skills/audit/SKILL.md +332 -0
  46. package/plugins/pbr/skills/help/SKILL.md +5 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ 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.17.1](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.17.0...plan-build-run-v2.17.1) (2026-02-22)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **dashboard:** plan count regex and mermaid rendering ([204838b](https://github.com/SienkLogic/plan-build-run/commit/204838b8be197cfa0835005e79a288f1d7d3d646))
14
+
15
+ ## [2.17.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.16.0...plan-build-run-v2.17.0) (2026-02-22)
16
+
17
+
18
+ ### Features
19
+
20
+ * **tools:** add /pbr:audit skill for session compliance and UX review ([ea9920e](https://github.com/SienkLogic/plan-build-run/commit/ea9920e3ce9d982d222644e8898569b2dbfa71f8))
21
+
8
22
  ## [2.16.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.15.0...plan-build-run-v2.16.0) (2026-02-22)
9
23
 
10
24
 
package/CLAUDE.md CHANGED
@@ -43,12 +43,12 @@ All plugin code lives under `plugins/pbr/`. Three layers:
43
43
  ### Skills (`skills/{name}/SKILL.md`)
44
44
  Markdown files with YAML frontmatter defining slash commands (`/pbr:begin`, `/pbr:plan`, etc.). Each SKILL.md is a complete prompt that tells the orchestrator what to do. Skills read state, interact with the user, and spawn agents.
45
45
 
46
- 21 skills: begin, build, config, continue, debug, discuss, explore, health, help, import, milestone, note, pause, plan, quick, resume, review, scan, setup, status, todo.
46
+ 25 skills: audit, begin, build, config, continue, dashboard, debug, discuss, do, explore, health, help, import, milestone, note, pause, plan, quick, resume, review, scan, setup, status, statusline, todo.
47
47
 
48
48
  ### Agents (`agents/{name}.md`)
49
49
  Markdown files with YAML frontmatter defining specialized subagent prompts. Agents run in fresh `Task()` contexts with clean 200k token windows. Spawned via `subagent_type: "pbr:{name}"` — auto-loaded by Claude Code.
50
50
 
51
- 10 agents: researcher, planner, plan-checker, executor, verifier, integration-checker, debugger, codebase-mapper, synthesizer, general.
51
+ 11 agents: audit, codebase-mapper, debugger, executor, general, integration-checker, plan-checker, planner, researcher, synthesizer, verifier.
52
52
 
53
53
  ### Scripts (`scripts/*.js`)
54
54
  28 Node.js hook scripts that fire on Claude Code lifecycle events. Configured in `hooks/hooks.json`. All use CommonJS, must be cross-platform (`path.join()`, not hardcoded separators), and log via `logHook()` from `hook-logger.js`.
@@ -88,13 +88,35 @@ export async function listArchivedMilestones(projectDir) {
88
88
 
89
89
  if (statsPath) {
90
90
  try {
91
- const { frontmatter, html } = await readMarkdownFile(statsPath);
91
+ const { frontmatter, html, rawContent } = await readMarkdownFile(statsPath);
92
92
  milestone.name = frontmatter.milestone || frontmatter.name || `v${version}`;
93
93
  milestone.date = frontmatter.completed || frontmatter.date || '';
94
94
  milestone.duration = frontmatter.duration || '';
95
95
  milestone.stats.phaseCount = frontmatter.phases_completed || frontmatter.phase_count || 0;
96
96
  milestone.stats.commitCount = frontmatter.total_commits || frontmatter.commit_count || 0;
97
97
  milestone.stats.statsHtml = html || '';
98
+
99
+ // Fallback: parse markdown content if frontmatter is empty
100
+ if (milestone.name === `v${version}` && rawContent) {
101
+ const nameMatch = rawContent.match(/\*\*Name:\*\*\s*(.+)/);
102
+ if (nameMatch) milestone.name = nameMatch[1].trim();
103
+ else {
104
+ const titleMatch = rawContent.match(/^#\s+.*?:\s*(.+?)(?:\s*\(v[\d.]+\))?$/m);
105
+ if (titleMatch) milestone.name = titleMatch[1].trim();
106
+ }
107
+ }
108
+ if (!milestone.date && rawContent) {
109
+ const dateMatch = rawContent.match(/\*\*Completed:\*\*\s*(.+)/);
110
+ if (dateMatch) milestone.date = dateMatch[1].trim();
111
+ }
112
+ if (!milestone.duration && rawContent) {
113
+ const durMatch = rawContent.match(/\*\*Duration:\*\*\s*(.+)/);
114
+ if (durMatch) milestone.duration = durMatch[1].trim();
115
+ }
116
+ if (!milestone.stats.commitCount && rawContent) {
117
+ const commitMatch = rawContent.match(/Total commits:\s*(\d+)/i) || rawContent.match(/\*\*Plans\*\*:\s*(\d+)/);
118
+ if (commitMatch) milestone.stats.commitCount = parseInt(commitMatch[1], 10);
119
+ }
98
120
  } catch (_e) {
99
121
  milestone.name = `v${version}`;
100
122
  }
@@ -112,7 +112,7 @@ export async function getPhaseDetail(projectDir, phaseId) {
112
112
  // Supports both naming conventions:
113
113
  // - NN-NN-PLAN.md (plan ID embedded in filename)
114
114
  // - PLAN.md (single plan per phase, ID derived from phase directory)
115
- const planRegex = /^(?:\d{2}-\d{2}-)?PLAN\.md$/;
115
+ const planRegex = /^(?:(?:\d{2}-\d{2})-)?PLAN(?:-\d{2})?\.md$/;
116
116
  const planFiles = phaseFiles
117
117
  .filter(f => planRegex.test(f))
118
118
  .sort();
@@ -120,8 +120,9 @@ export async function getPhaseDetail(projectDir, phaseId) {
120
120
  // Build summary paths and read them in parallel
121
121
  // Derive planId from filename (NN-NN-PLAN.md) or phase directory (PLAN.md -> NN-01)
122
122
  const summaryPaths = planFiles.map((planFile, index) => {
123
- const idMatch = planFile.match(/^(\d{2}-\d{2})-PLAN\.md$/);
124
- const planId = idMatch ? idMatch[1] : `${phaseId.padStart(2, '0')}-${String(index + 1).padStart(2, '0')}`;
123
+ const oldMatch = planFile.match(/^(\d{2}-\d{2})-PLAN\.md$/);
124
+ const newMatch = planFile.match(/^PLAN-(\d{2})\.md$/);
125
+ const planId = oldMatch ? oldMatch[1] : newMatch ? `${phaseId.padStart(2, '0')}-${newMatch[1]}` : `${phaseId.padStart(2, '0')}-${String(index + 1).padStart(2, '0')}`;
125
126
  return { planId, planFile, summaryPath: join(phaseFullPath, `SUMMARY-${planId}.md`) };
126
127
  });
127
128
 
@@ -35,7 +35,7 @@ async function countPlansForPhase(projectDir, phaseId) {
35
35
  if (!phaseDir) return 0;
36
36
 
37
37
  const phaseFiles = await readdir(join(phasesDir, phaseDir.name));
38
- return phaseFiles.filter(f => /^(?:\d{2}-\d{2}-)?PLAN\.md$/.test(f)).length;
38
+ return phaseFiles.filter(f => /^(?:(?:\d{2}-\d{2})-)?PLAN(?:-\d{2})?\.md$/.test(f)).length;
39
39
  } catch (err) {
40
40
  if (err.code === 'ENOENT') return 0;
41
41
  throw err;
@@ -10,7 +10,7 @@
10
10
  <%- include('empty-state', { icon: '🔗', title: 'No dependency data available', action: '' }) %>
11
11
  <% } %>
12
12
 
13
- <script type="module">
14
- import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
13
+ <script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
14
+ <script>
15
15
  mermaid.initialize({ startOnLoad: true, theme: 'default', securityLevel: 'loose' });
16
16
  </script>
@@ -11,10 +11,10 @@
11
11
  </header>
12
12
  <%
13
13
  // Map verification status to CSS status-badge data-status values
14
- var vStatus = verification.status || verification.verdict || 'unknown';
14
+ var vStatus = verification.result || verification.status || verification.verdict || 'unknown';
15
15
  var verificationCssStatus = 'not-started';
16
- if (vStatus === 'passed') verificationCssStatus = 'complete';
17
- else if (vStatus === 'failed') verificationCssStatus = 'blocked';
16
+ if (vStatus === 'pass' || vStatus === 'passed') verificationCssStatus = 'complete';
17
+ else if (vStatus === 'fail' || vStatus === 'failed') verificationCssStatus = 'blocked';
18
18
  else if (vStatus === 'partial') verificationCssStatus = 'in-progress';
19
19
  %>
20
20
  <p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sienklogic/plan-build-run",
3
- "version": "2.16.0",
3
+ "version": "2.17.1",
4
4
  "description": "Plan it, Build it, Run it — structured development workflow for Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -52,10 +52,11 @@ The core workflow follows four steps per phase:
52
52
 
53
53
  Repeat `plan` / `build` / `review` for each phase in your roadmap.
54
54
 
55
- ## Skills (22)
55
+ ## Skills (25)
56
56
 
57
57
  | Skill | Description |
58
58
  |-------|-------------|
59
+ | audit | Review past Claude Code sessions for PBR workflow compliance and UX quality. |
59
60
  | begin | Start a new project. Deep questioning, research, requirements, and roadmap. |
60
61
  | build | Execute all plans in a phase. Spawns agents to build in parallel, commits atomically. |
61
62
  | config | Configure settings: depth, model profiles, features, git, and gates. |
@@ -78,12 +79,14 @@ Repeat `plan` / `build` / `review` for each phase in your roadmap.
78
79
  | scan | Analyze an existing codebase. Maps structure, architecture, conventions, and concerns. |
79
80
  | setup | Onboarding wizard. Initialize project, select models, verify setup. |
80
81
  | status | Show current project status and suggest what to do next. |
82
+ | statusline | Install or configure the PBR status line in Claude Code. |
81
83
  | todo | File-based persistent todos. Add, list, complete — survives sessions. |
82
84
 
83
- ## Agents (10)
85
+ ## Agents (11)
84
86
 
85
87
  | Agent | Description |
86
88
  |-------|-------------|
89
+ | audit | Analyzes Claude Code session logs for PBR workflow compliance and UX quality. |
87
90
  | codebase-mapper | Explores codebases and writes structured analysis across four focus areas. |
88
91
  | debugger | Systematic debugging using scientific method with hypothesis testing and evidence tracking. |
89
92
  | executor | Executes plan tasks with atomic commits, deviation handling, and self-verification. |
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: audit
3
+ description: "Analyzes Claude Code session logs for PBR workflow compliance, hook firing, state file hygiene, and user experience quality."
4
+ tools: ["read", "search"]
5
+ infer: true
6
+ target: "github-copilot"
7
+ ---
8
+
9
+ # Plan-Build-Run Session Auditor
10
+
11
+ You are **audit**, the session analysis agent for the Plan-Build-Run development system. You analyze Claude Code session JSONL logs to evaluate PBR workflow compliance, hook firing, state management, commit discipline, and user experience quality.
12
+
13
+ ## Core Principle
14
+
15
+ **Evidence over assumption.** Every finding must cite specific JSONL line numbers, timestamps, or tool call IDs. Never infer hook behavior without evidence — absent evidence means "no evidence found," not "hooks didn't fire."
16
+
17
+ ---
18
+
19
+ ## Input
20
+
21
+ You receive a prompt containing:
22
+ - **Session JSONL path**: Absolute path to the session log file
23
+ - **Subagent paths**: Optional paths to subagent logs in the `subagents/` subdirectory
24
+ - **Audit mode**: `compliance` (workflow correctness) or `ux` (user experience) or `full` (both)
25
+ - **Output path**: Where to write findings
26
+
27
+ ---
28
+
29
+ ## JSONL Format
30
+
31
+ Session logs are newline-delimited JSON. Key entry types:
32
+
33
+ | Field | Values | Meaning |
34
+ |-------|--------|---------|
35
+ | `type` | `user`, `assistant`, `progress` | Entry type |
36
+ | `message.role` | `human`, `assistant` | Who sent it |
37
+ | `data.type` | `hook_progress` | Hook execution evidence |
38
+ | `data.hookEvent` | `SessionStart`, `PreToolUse`, `PostToolUse`, etc. | Which hook event |
39
+ | `timestamp` | ISO 8601 | When it occurred |
40
+ | `sessionId` | UUID | Session identifier |
41
+
42
+ User messages contain the actual commands (`/pbr:build`, `/pbr:quick`, etc.) and freeform instructions.
43
+
44
+ ---
45
+
46
+ ## Compliance Audit Checklist
47
+
48
+ For each session, check:
49
+
50
+ ### 1. PBR Commands Used
51
+ - Extract all `/pbr:*` command invocations from user messages
52
+ - Was the command sequence logical?
53
+ - Were there commands that SHOULD have been used but weren't?
54
+
55
+ ### 2. STATE.md Lifecycle
56
+ - Was STATE.md read before starting work?
57
+ - Was STATE.md updated at phase transitions?
58
+
59
+ ### 3. ROADMAP.md Consultation
60
+ - Was ROADMAP.md read during build, plan, or milestone operations?
61
+
62
+ ### 4. SUMMARY.md Creation
63
+ - After any build or quick task, was SUMMARY.md created?
64
+
65
+ ### 5. Hook Evidence
66
+ - Are there `hook_progress` entries in the log?
67
+ - Which hooks fired and how many times?
68
+ - If NO hook evidence exists, flag as HIGH severity
69
+
70
+ ### 6. Commit Format
71
+ - Verify format: `{type}({scope}): {description}`
72
+ - Check for forbidden `Co-Authored-By` lines
73
+
74
+ ### 7. Subagent Delegation
75
+ - Was implementation work delegated to executor agents?
76
+ - Or was it done directly in main context (anti-pattern)?
77
+
78
+ ---
79
+
80
+ ## UX Audit Checklist
81
+
82
+ ### 1. User Intent vs Assistant Behavior
83
+ - Did the assistant deliver what was asked?
84
+ - Did the user have to repeat instructions?
85
+
86
+ ### 2. Flow Choice Quality
87
+ - Was the chosen PBR command the best fit?
88
+ - Was ceremony proportionate to task scope?
89
+
90
+ ### 3. Feedback and Progress
91
+ - Were there progress updates during long operations?
92
+
93
+ ### 4. Context Efficiency
94
+ - Did the session hit context limits?
95
+ - Was work delegated appropriately?
96
+
97
+ ---
98
+
99
+ ## Context Budget
100
+
101
+ - **Maximum**: 50% of context for reading logs, 50% for analysis
102
+ - Large JSONL files: sample strategically, don't read entirely
103
+ - Focus on user messages, tool calls, and hook progress entries
104
+
105
+ ---
106
+
107
+ ## Anti-Patterns
108
+
109
+ 1. DO NOT guess what hooks did — only report evidence
110
+ 2. DO NOT read the entire JSONL if it exceeds 2000 lines
111
+ 3. DO NOT judge explore sessions for missing STATE.md updates
112
+ 4. DO NOT fabricate timestamps or session IDs
113
+ 5. DO NOT include raw JSONL content in output
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbr",
3
3
  "displayName": "Plan-Build-Run",
4
- "version": "2.16.0",
4
+ "version": "2.17.1",
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",
@@ -0,0 +1,330 @@
1
+ ---
2
+ name: audit
3
+ description: "Review past Claude Code sessions for PBR workflow compliance and UX quality."
4
+ ---
5
+
6
+ **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 tokens. Begin executing Step 0 immediately.**
7
+
8
+ ## Step 0 — Immediate Output
9
+
10
+ **Before ANY tool calls**, display this banner:
11
+
12
+ ```
13
+ ╔══════════════════════════════════════════════════════════════╗
14
+ ║ PLAN-BUILD-RUN ► SESSION AUDIT ║
15
+ ╚══════════════════════════════════════════════════════════════╝
16
+ ```
17
+
18
+ Then proceed to Step 1.
19
+
20
+ # /pbr:audit — Session Compliance & UX Review
21
+
22
+ You are running the **audit** skill. Your job is to analyze past Claude Code session logs for this project, checking PBR workflow compliance (STATE.md updates, hook firing, commit format, skill usage) and user experience quality (flow choice, friction, unmet expectations). You produce a comprehensive report document.
23
+
24
+ This skill uses **parallel Task() delegation** to analyze multiple sessions simultaneously, keeping main context lean.
25
+
26
+ ---
27
+
28
+ ## Context Budget
29
+
30
+ Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
31
+
32
+ Additionally for this skill:
33
+ - **Delegate ALL session analysis** to audit agents — do NOT read JSONL files in main context
34
+ - Main context handles: argument parsing, session discovery, agent orchestration, report synthesis
35
+ - Target: main context stays under 20% utilization
36
+
37
+ ---
38
+
39
+ ## Step 1 — Parse Arguments
40
+
41
+ Parse `$ARGUMENTS` for:
42
+
43
+ | Argument | Default | Description |
44
+ |----------|---------|-------------|
45
+ | `--from DATE` | Start of today | Start of audit window (ISO date or natural language) |
46
+ | `--to DATE` | Now | End of audit window |
47
+ | `--today` | false | Shorthand for `--from` start of today `--to` now |
48
+ | `--mode MODE` | `full` | `compliance` = workflow only, `ux` = user experience only, `full` = both |
49
+
50
+ **Natural language parsing**: Accept formats like:
51
+ - `--today` or just `today`
52
+ - `--from 2026-02-21` or `--from "yesterday"`
53
+ - `--from "3 days ago"` or `--from "last monday"`
54
+ - A bare date like `02/21` implies `--from 02/21 --to 02/21` (full day)
55
+ - A bare `3` implies last 3 days
56
+
57
+ If no arguments provided, default to `--today --mode full`.
58
+
59
+ Display the parsed time range to the user:
60
+
61
+ ```
62
+ Audit window: {from} → {to}
63
+ Mode: {mode}
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Step 2 — Discover Session Logs
69
+
70
+ Session JSONL files live at:
71
+ ```
72
+ ~/.claude/projects/{encoded-project-path}/*.jsonl
73
+ ```
74
+
75
+ Where `{encoded-project-path}` encodes the project directory path (e.g., `D:\Repos\plan-build-run` → `D--Repos-plan-build-run`).
76
+
77
+ **CRITICAL**: Determine the correct encoded path for the current project by listing `~/.claude/projects/` and finding the directory that matches.
78
+
79
+ Use Bash to find sessions in the audit window:
80
+
81
+ ```bash
82
+ find ~/.claude/projects/{encoded-path}/ -name "*.jsonl" -maxdepth 1 \
83
+ -newermt "{from_datetime}" ! -newermt "{to_datetime}" | sort
84
+ ```
85
+
86
+ For each session file found, also check for subagent logs:
87
+ ```bash
88
+ ls ~/.claude/projects/{encoded-path}/{session-id}/subagents/*.jsonl 2>/dev/null
89
+ ```
90
+
91
+ Display discovery results:
92
+
93
+ ```
94
+ Found {N} sessions in audit window:
95
+ {session-id-1} ({size}, {date})
96
+ {session-id-2} ({size}, {date})
97
+ ...
98
+ ```
99
+
100
+ If no sessions found, display an error and exit:
101
+ ```
102
+ ╔══════════════════════════════════════════════════════════════╗
103
+ ║ ERROR ║
104
+ ╚══════════════════════════════════════════════════════════════╝
105
+
106
+ No session logs found between {from} and {to}.
107
+ Check: ~/.claude/projects/{encoded-path}/
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Step 3 — Discover Git Activity
113
+
114
+ In parallel with session analysis (Step 4), gather git commit data for the audit window:
115
+
116
+ ```bash
117
+ git log --since="{from_iso}" --until="{to_iso}" --format="%h %s %an %ai" --all
118
+ ```
119
+
120
+ Check for:
121
+ - Conventional commit format violations
122
+ - Forbidden `Co-Authored-By` lines
123
+ - Release-please automated commits
124
+
125
+ This data feeds into the final report synthesis.
126
+
127
+ ---
128
+
129
+ ## Step 4 — Spawn Audit Agents
130
+
131
+ **CRITICAL**: Spawn one `pbr:audit` agent per session, ALL in parallel. Do NOT analyze sessions sequentially.
132
+
133
+ For each session:
134
+
135
+ ```
136
+ Task({
137
+ subagent_type: "pbr:audit",
138
+ prompt: "<audit_assignment>
139
+ Session JSONL: {absolute_path_to_session.jsonl}
140
+ Subagent logs: {list of subagent jsonl paths, or 'none'}
141
+ Audit mode: {mode}
142
+ Output path: DO NOT write to disk — return findings inline.
143
+
144
+ Analyze this session for PBR workflow compliance and/or UX quality
145
+ per your audit checklists. Return your full findings as structured
146
+ markdown in your response.
147
+ </audit_assignment>"
148
+ })
149
+ ```
150
+
151
+ Also spawn a git analysis agent (can use a Bash agent or general-purpose):
152
+
153
+ ```
154
+ Task({
155
+ subagent_type: "Bash",
156
+ model: "haiku",
157
+ prompt: "Run these git commands in {project_dir}:
158
+ 1. git log --since='{from}' --until='{to}' --format='%h|%s|%an|%ai' --all
159
+ 2. git log --since='{from}' --until='{to}' --all --format='%B' | grep -i 'co-authored-by' || echo 'None found'
160
+ Report: all commits, any format violations against pattern {type}({scope}): {desc}, any co-author lines."
161
+ })
162
+ ```
163
+
164
+ Display progress:
165
+
166
+ ```
167
+ ◐ Analyzing {N} sessions in parallel...
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Step 5 — Collect and Synthesize
173
+
174
+ As agents complete, collect their findings. Wait for all agents before proceeding.
175
+
176
+ Synthesize across all sessions:
177
+
178
+ ### 5a. Executive Summary
179
+ - Total sessions, total commits, releases
180
+ - Overall compliance: how many sessions passed/failed
181
+ - Headline finding (the most important issue)
182
+
183
+ ### 5b. Per-Session Summary Table
184
+ | Session | Duration | Commands | Compliance | UX Rating |
185
+ |---------|----------|----------|------------|-----------|
186
+
187
+ ### 5c. Cross-Session Patterns
188
+ - Recurring issues (e.g., STATE.md never read across multiple sessions)
189
+ - Hook coverage gaps
190
+ - Common flow mistakes
191
+
192
+ ### 5d. Consolidated Findings
193
+ Merge and deduplicate findings across sessions. Categorize by severity:
194
+ - **CRITICAL**: Workflow bypassed despite user requests, hooks not firing
195
+ - **HIGH**: State files not consulted, missing artifacts
196
+ - **MEDIUM**: Suboptimal flow choice, missing feedback
197
+ - **LOW**: Minor ceremony issues, informational
198
+
199
+ ### 5e. Recommendations
200
+ Prioritize as:
201
+ - **Immediate**: Fix in next session
202
+ - **Short-term**: Fix in next sprint/milestone
203
+ - **Medium-term**: Architectural improvements
204
+
205
+ ---
206
+
207
+ ## Step 6 — Write Report
208
+
209
+ **CRITICAL**: Write the full report to disk. Do NOT just display it inline.
210
+
211
+ Write to: `.planning/audits/{YYYY-MM-DD}-session-audit.md`
212
+
213
+ Create `.planning/audits/` directory if it doesn't exist.
214
+
215
+ The report should follow this structure:
216
+
217
+ ```markdown
218
+ # PBR Session Audit Report — {date range}
219
+
220
+ **Audit Period:** {from} – {to}
221
+ **Sessions Analyzed:** {N}
222
+ **Commits:** {N}
223
+ **Mode:** {mode}
224
+
225
+ ---
226
+
227
+ ## Executive Summary
228
+ {2-3 sentence overview}
229
+
230
+ ## Session Summary
231
+ {per-session table}
232
+
233
+ ## Detailed Session Analysis
234
+ {per-session findings}
235
+
236
+ ## Git Activity
237
+ {commit summary, format compliance}
238
+
239
+ ## Cross-Session Patterns
240
+ {recurring issues}
241
+
242
+ ## Consolidated Findings
243
+ ### Critical
244
+ ### High
245
+ ### Medium
246
+ ### Low
247
+
248
+ ## Recommendations
249
+ ### Immediate
250
+ ### Short-Term
251
+ ### Medium-Term
252
+
253
+ ---
254
+ *Generated by /pbr:audit on {date}*
255
+ ```
256
+
257
+ ---
258
+
259
+ ## Step 7 — Display Summary
260
+
261
+ After writing the report, display inline (keep it concise — the full report is on disk):
262
+
263
+ ```
264
+ ╔══════════════════════════════════════════════════════════════╗
265
+ ║ PLAN-BUILD-RUN ► AUDIT COMPLETE ✓ ║
266
+ ╚══════════════════════════════════════════════════════════════╝
267
+
268
+ {N} sessions analyzed, {N} commits reviewed
269
+
270
+ Compliance: {X}/{N} sessions passed
271
+ UX Rating: {average or per-session ratings}
272
+
273
+ Top findings:
274
+ 1. {headline finding 1}
275
+ 2. {headline finding 2}
276
+ 3. {headline finding 3}
277
+
278
+ Full report: .planning/audits/{filename}
279
+
280
+
281
+ ╔══════════════════════════════════════════════════════════════╗
282
+ ║ ▶ NEXT UP ║
283
+ ╚══════════════════════════════════════════════════════════════╝
284
+
285
+ {Smart routing based on findings:}
286
+ - If critical issues found: **Fix workflow** → `/pbr:quick`
287
+ - If todos identified: **Create todos** → `/pbr:todo add "{description}"`
288
+ - Default: **See project status** → `/pbr:status`
289
+
290
+ `/clear` first → fresh context window
291
+ ```
292
+
293
+ ---
294
+
295
+ ## Error Handling
296
+
297
+ ### Agent fails to analyze a session
298
+ If an audit agent fails:
299
+ ```
300
+ ⚠ Failed to analyze session {id}: {error}
301
+ Continuing with remaining {N-1} sessions.
302
+ ```
303
+
304
+ Include a note in the final report that session was skipped.
305
+
306
+ ### No sessions found
307
+ Display error (Step 2) and exit gracefully.
308
+
309
+ ### Very large session files (>5MB)
310
+ Warn the agent to sample rather than read the full log:
311
+ ```
312
+ Note: Session {id} is {size}MB. Sampling key sections (first 200 lines, last 200 lines, user messages, hook events).
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Anti-Patterns
318
+
319
+ Reference: `skills/shared/universal-anti-patterns.md` for rules that apply to ALL skills.
320
+
321
+ Additionally for this skill:
322
+
323
+ 1. **DO NOT** read JSONL files in main context — always delegate to audit agents
324
+ 2. **DO NOT** display the full report inline — write to disk, show summary
325
+ 3. **DO NOT** analyze sessions sequentially — spawn all agents in parallel
326
+ 4. **DO NOT** report findings without evidence (line numbers, timestamps, quotes)
327
+ 5. **DO NOT** judge explore sessions for missing STATE.md updates (explore is read-only)
328
+ 6. **DO NOT** flag release-please/merge commits as format violations
329
+ 7. **DO NOT** fabricate UX ratings — base them on concrete evidence (user repetitions, escalations, course-corrections)
330
+ 8. **DO NOT** exceed 5 headline findings in the inline summary — full details go in the report file
@@ -103,10 +103,14 @@ Display the following reference to the user:
103
103
  | `/pbr:import --skip-checker` | Skip plan-checker validation on import. |
104
104
  | `/pbr:setup` | Interactive onboarding wizard for new projects. |
105
105
 
106
- ### Utilities
106
+ ### Analysis & Utilities
107
107
 
108
108
  | Command | Description |
109
109
  |---------|-------------|
110
+ | `/pbr:audit` | Review past sessions for PBR workflow compliance and UX quality. |
111
+ | `/pbr:audit --today` | Audit today's sessions (default). |
112
+ | `/pbr:audit --from DATE --to DATE` | Audit a specific date range. |
113
+ | `/pbr:audit --mode compliance\|ux` | Run compliance-only or UX-only audit. |
110
114
  | `/pbr:do <description>` | Route freeform text to the right PBR skill automatically. |
111
115
  | `/pbr:dashboard` | Launch the web dashboard for the current project. |
112
116
  | `/pbr:dashboard --port <N>` | Launch dashboard on a specific port. |
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbr",
3
3
  "displayName": "Plan-Build-Run",
4
- "version": "2.16.0",
4
+ "version": "2.17.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",