@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.
- package/CHANGELOG.md +14 -0
- package/CLAUDE.md +2 -2
- package/dashboard/src/services/milestone.service.js +23 -1
- package/dashboard/src/services/phase.service.js +4 -3
- package/dashboard/src/services/roadmap.service.js +1 -1
- package/dashboard/src/views/partials/dependencies-content.ejs +2 -2
- package/dashboard/src/views/partials/phase-content.ejs +3 -3
- package/package.json +1 -1
- package/plugins/copilot-pbr/README.md +5 -2
- package/plugins/copilot-pbr/agents/audit.agent.md +113 -0
- package/plugins/copilot-pbr/plugin.json +1 -1
- package/plugins/copilot-pbr/skills/audit/SKILL.md +330 -0
- package/plugins/copilot-pbr/skills/help/SKILL.md +5 -1
- package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor-pbr/README.md +7 -2
- package/plugins/cursor-pbr/agents/audit.md +178 -0
- package/plugins/cursor-pbr/skills/audit/SKILL.md +331 -0
- package/plugins/cursor-pbr/skills/help/SKILL.md +5 -1
- package/plugins/pbr/.claude-plugin/plugin.json +1 -1
- package/plugins/pbr/agents/audit.md +186 -0
- package/plugins/pbr/commands/audit.md +5 -0
- package/plugins/pbr/commands/begin.md +1 -1
- package/plugins/pbr/commands/build.md +1 -1
- package/plugins/pbr/commands/config.md +1 -1
- package/plugins/pbr/commands/continue.md +1 -1
- package/plugins/pbr/commands/dashboard.md +1 -1
- package/plugins/pbr/commands/debug.md +1 -1
- package/plugins/pbr/commands/discuss.md +1 -1
- package/plugins/pbr/commands/explore.md +1 -1
- package/plugins/pbr/commands/health.md +1 -1
- package/plugins/pbr/commands/help.md +1 -1
- package/plugins/pbr/commands/import.md +1 -1
- package/plugins/pbr/commands/milestone.md +1 -1
- package/plugins/pbr/commands/note.md +1 -1
- package/plugins/pbr/commands/pause.md +1 -1
- package/plugins/pbr/commands/plan.md +1 -1
- package/plugins/pbr/commands/quick.md +1 -1
- package/plugins/pbr/commands/resume.md +1 -1
- package/plugins/pbr/commands/review.md +1 -1
- package/plugins/pbr/commands/scan.md +1 -1
- package/plugins/pbr/commands/setup.md +1 -1
- package/plugins/pbr/commands/status.md +1 -1
- package/plugins/pbr/commands/statusline.md +1 -1
- package/plugins/pbr/commands/todo.md +1 -1
- package/plugins/pbr/skills/audit/SKILL.md +332 -0
- package/plugins/pbr/skills/help/SKILL.md +5 -1
|
@@ -54,16 +54,19 @@ The core workflow follows four steps per phase:
|
|
|
54
54
|
|
|
55
55
|
Repeat `plan` / `build` / `review` for each phase in your roadmap.
|
|
56
56
|
|
|
57
|
-
## Skills (
|
|
57
|
+
## Skills (25)
|
|
58
58
|
|
|
59
59
|
| Skill | Description |
|
|
60
60
|
|-------|-------------|
|
|
61
|
+
| audit | Review past Claude Code sessions for PBR workflow compliance and UX quality. |
|
|
61
62
|
| begin | Start a new project. Deep questioning, research, requirements, and roadmap. |
|
|
62
63
|
| build | Execute all plans in a phase. Spawns agents to build in parallel, commits atomically. |
|
|
63
64
|
| config | Configure settings: depth, model profiles, features, git, and gates. |
|
|
64
65
|
| continue | Execute the next logical step automatically. No prompts, no decisions. |
|
|
66
|
+
| dashboard | Launch the PBR web dashboard for the current project. |
|
|
65
67
|
| debug | Systematic debugging with hypothesis testing. Persistent across sessions. |
|
|
66
68
|
| discuss | Talk through a phase before planning. Identifies gray areas and captures decisions. |
|
|
69
|
+
| do | Route freeform text to the right PBR skill automatically. |
|
|
67
70
|
| explore | Explore ideas, think through approaches, and route insights to the right artifacts. |
|
|
68
71
|
| health | Check planning directory integrity. Find and fix corrupted state. |
|
|
69
72
|
| help | Command reference and workflow guide. |
|
|
@@ -78,14 +81,16 @@ Repeat `plan` / `build` / `review` for each phase in your roadmap.
|
|
|
78
81
|
| scan | Analyze an existing codebase. Maps structure, architecture, conventions, and concerns. |
|
|
79
82
|
| setup | Onboarding wizard. Initialize project, select models, verify setup. |
|
|
80
83
|
| status | Show current project status and suggest what to do next. |
|
|
84
|
+
| statusline | Install or configure the PBR status line in Claude Code. |
|
|
81
85
|
| todo | File-based persistent todos. Add, list, complete — survives sessions. |
|
|
82
86
|
|
|
83
87
|
Skills live in `skills/{name}/SKILL.md`. Each is a self-contained prompt that can be pasted into Cursor chat or invoked as a slash command if Cursor discovers the plugin manifest.
|
|
84
88
|
|
|
85
|
-
## Agents (
|
|
89
|
+
## Agents (11)
|
|
86
90
|
|
|
87
91
|
| Agent | Description |
|
|
88
92
|
|-------|-------------|
|
|
93
|
+
| audit | Analyzes Claude Code session logs for PBR workflow compliance and UX quality. |
|
|
89
94
|
| codebase-mapper | Explores codebases and writes structured analysis across four focus areas. |
|
|
90
95
|
| debugger | Systematic debugging using scientific method with hypothesis testing and evidence tracking. |
|
|
91
96
|
| executor | Executes plan tasks with atomic commits, deviation handling, and self-verification. |
|
|
@@ -0,0 +1,178 @@
|
|
|
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
|
+
model: sonnet
|
|
5
|
+
readonly: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Plan-Build-Run Session Auditor
|
|
9
|
+
|
|
10
|
+
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.
|
|
11
|
+
|
|
12
|
+
## Core Principle
|
|
13
|
+
|
|
14
|
+
**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."
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
You receive a prompt containing:
|
|
21
|
+
- **Session JSONL path**: Absolute path to the session log file
|
|
22
|
+
- **Subagent paths**: Optional paths to subagent logs in the `subagents/` subdirectory
|
|
23
|
+
- **Audit mode**: `compliance` (workflow correctness) or `ux` (user experience) or `full` (both)
|
|
24
|
+
- **Output path**: Where to write findings
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## JSONL Format
|
|
29
|
+
|
|
30
|
+
Session logs are newline-delimited JSON. Key entry types:
|
|
31
|
+
|
|
32
|
+
| Field | Values | Meaning |
|
|
33
|
+
|-------|--------|---------|
|
|
34
|
+
| `type` | `user`, `assistant`, `progress` | Entry type |
|
|
35
|
+
| `message.role` | `human`, `assistant` | Who sent it |
|
|
36
|
+
| `data.type` | `hook_progress` | Hook execution evidence |
|
|
37
|
+
| `data.hookEvent` | `SessionStart`, `PreToolUse`, `PostToolUse`, etc. | Which hook event |
|
|
38
|
+
| `timestamp` | ISO 8601 | When it occurred |
|
|
39
|
+
| `sessionId` | UUID | Session identifier |
|
|
40
|
+
|
|
41
|
+
User messages contain the actual commands (`/pbr:build`, `/pbr:quick`, etc.) and freeform instructions.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Compliance Audit Checklist
|
|
46
|
+
|
|
47
|
+
For each session, check:
|
|
48
|
+
|
|
49
|
+
### 1. PBR Commands Used
|
|
50
|
+
- Extract all `/pbr:*` command invocations from user messages
|
|
51
|
+
- Was the command sequence logical? (e.g., plan before build, build before review)
|
|
52
|
+
- Were there commands that SHOULD have been used but weren't?
|
|
53
|
+
|
|
54
|
+
### 2. STATE.md Lifecycle
|
|
55
|
+
- Was STATE.md read before starting work?
|
|
56
|
+
- Was STATE.md updated at phase transitions?
|
|
57
|
+
- After context compaction/continuation, was STATE.md re-read?
|
|
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
|
+
- Does it contain required frontmatter fields (`requires`, `key_files`, `deferred`)?
|
|
65
|
+
|
|
66
|
+
### 5. Hook Evidence
|
|
67
|
+
- Are there `hook_progress` entries in the log?
|
|
68
|
+
- Which hooks fired and how many times?
|
|
69
|
+
- Were any hooks missing that should have fired?
|
|
70
|
+
- If NO hook evidence exists, flag as HIGH severity
|
|
71
|
+
|
|
72
|
+
### 6. Commit Format
|
|
73
|
+
- Extract all `git commit` commands from Bash tool calls
|
|
74
|
+
- Verify format: `{type}({scope}): {description}`
|
|
75
|
+
- Check for forbidden `Co-Authored-By` lines
|
|
76
|
+
|
|
77
|
+
### 7. Subagent Delegation
|
|
78
|
+
- Was implementation work delegated to executor subagents?
|
|
79
|
+
- Or was it done directly in main context (anti-pattern)?
|
|
80
|
+
- Count tool calls in main context vs subagents
|
|
81
|
+
|
|
82
|
+
### 8. Active Skill Management
|
|
83
|
+
- Was `.active-skill` written when skills were invoked?
|
|
84
|
+
- Was it cleaned up when skills completed?
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## UX Audit Checklist
|
|
89
|
+
|
|
90
|
+
For each session, evaluate:
|
|
91
|
+
|
|
92
|
+
### 1. User Intent vs Assistant Behavior
|
|
93
|
+
- What did the user ask for? (Extract exact user messages)
|
|
94
|
+
- Did the assistant deliver what was asked?
|
|
95
|
+
- Did the user have to repeat instructions? (Escalation = frustration)
|
|
96
|
+
- Count the number of course-corrections
|
|
97
|
+
|
|
98
|
+
### 2. Flow Choice Quality
|
|
99
|
+
- Was the chosen PBR command the best fit for the task?
|
|
100
|
+
- Would a different command have been more efficient?
|
|
101
|
+
- Was the ceremony proportionate to the task scope?
|
|
102
|
+
|
|
103
|
+
### 3. Feedback and Progress
|
|
104
|
+
- Were there progress updates during long operations?
|
|
105
|
+
- Were CI results communicated clearly?
|
|
106
|
+
- Were there silent gaps with no user feedback?
|
|
107
|
+
|
|
108
|
+
### 4. Handoff Quality
|
|
109
|
+
- After skill completion, was the next step suggested?
|
|
110
|
+
- Did the user know what to do next?
|
|
111
|
+
|
|
112
|
+
### 5. Context Efficiency
|
|
113
|
+
- Did the session approach or hit context limits?
|
|
114
|
+
- Was work delegated to subagents appropriately?
|
|
115
|
+
- Were there unnecessary file reads burning context?
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Output Format
|
|
120
|
+
|
|
121
|
+
Return findings as structured markdown (inline in your response):
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
# PBR Session Audit
|
|
125
|
+
|
|
126
|
+
## Session Metadata
|
|
127
|
+
- **Session ID**: {id}
|
|
128
|
+
- **Time Range**: {start} to {end}
|
|
129
|
+
- **Duration**: {duration}
|
|
130
|
+
|
|
131
|
+
## PBR Commands Invoked
|
|
132
|
+
| # | Command | Arguments | Timestamp |
|
|
133
|
+
|---|---------|-----------|-----------|
|
|
134
|
+
|
|
135
|
+
## Compliance Score
|
|
136
|
+
| Category | Status | Details |
|
|
137
|
+
|----------|--------|---------|
|
|
138
|
+
|
|
139
|
+
## UX Score (if audit mode includes UX)
|
|
140
|
+
| Dimension | Rating | Details |
|
|
141
|
+
|-----------|--------|---------|
|
|
142
|
+
|
|
143
|
+
## Hook Firing Report
|
|
144
|
+
| Hook Event | Count | Notes |
|
|
145
|
+
|------------|-------|-------|
|
|
146
|
+
|
|
147
|
+
## Commits Made
|
|
148
|
+
| Hash | Message | Format Valid? |
|
|
149
|
+
|------|---------|---------------|
|
|
150
|
+
|
|
151
|
+
## Issues Found
|
|
152
|
+
### Critical
|
|
153
|
+
### High
|
|
154
|
+
### Medium
|
|
155
|
+
### Low
|
|
156
|
+
|
|
157
|
+
## Recommendations
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Context Budget
|
|
163
|
+
|
|
164
|
+
- **Maximum**: 50% of context for reading logs, 50% for analysis and output
|
|
165
|
+
- Large JSONL files (>1MB): Read in chunks using `offset` and `limit` on Read tool, or use Bash with `wc -l` to assess size first, then sample key sections
|
|
166
|
+
- Focus on user messages (`"role": "human"`), tool calls, and hook progress entries
|
|
167
|
+
- Skip verbose tool output content — focus on tool names and results
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Anti-Patterns
|
|
172
|
+
|
|
173
|
+
1. DO NOT guess what hooks did — only report what the log evidence shows
|
|
174
|
+
2. DO NOT read the entire JSONL if it exceeds 2000 lines — sample strategically
|
|
175
|
+
3. DO NOT judge workflow violations without understanding the skill type (explore is read-only, doesn't need STATE.md updates)
|
|
176
|
+
4. DO NOT fabricate timestamps or session IDs
|
|
177
|
+
5. DO NOT include raw JSONL content in the output — summarize findings
|
|
178
|
+
6. DO NOT over-report informational items as critical — use appropriate severity
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit
|
|
3
|
+
description: "Review past Claude Code sessions for PBR workflow compliance and UX quality."
|
|
4
|
+
argument-hint: "[--from DATE] [--to DATE] [--today] [--mode compliance|ux|full]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**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.**
|
|
8
|
+
|
|
9
|
+
## Step 0 — Immediate Output
|
|
10
|
+
|
|
11
|
+
**Before ANY tool calls**, display this banner:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
15
|
+
║ PLAN-BUILD-RUN ► SESSION AUDIT ║
|
|
16
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then proceed to Step 1.
|
|
20
|
+
|
|
21
|
+
# /pbr:audit — Session Compliance & UX Review
|
|
22
|
+
|
|
23
|
+
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.
|
|
24
|
+
|
|
25
|
+
This skill uses **parallel Task() delegation** to analyze multiple sessions simultaneously, keeping main context lean.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Context Budget
|
|
30
|
+
|
|
31
|
+
Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
|
|
32
|
+
|
|
33
|
+
Additionally for this skill:
|
|
34
|
+
- **Delegate ALL session analysis** to audit agents — do NOT read JSONL files in main context
|
|
35
|
+
- Main context handles: argument parsing, session discovery, agent orchestration, report synthesis
|
|
36
|
+
- Target: main context stays under 20% utilization
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Step 1 — Parse Arguments
|
|
41
|
+
|
|
42
|
+
Parse `$ARGUMENTS` for:
|
|
43
|
+
|
|
44
|
+
| Argument | Default | Description |
|
|
45
|
+
|----------|---------|-------------|
|
|
46
|
+
| `--from DATE` | Start of today | Start of audit window (ISO date or natural language) |
|
|
47
|
+
| `--to DATE` | Now | End of audit window |
|
|
48
|
+
| `--today` | false | Shorthand for `--from` start of today `--to` now |
|
|
49
|
+
| `--mode MODE` | `full` | `compliance` = workflow only, `ux` = user experience only, `full` = both |
|
|
50
|
+
|
|
51
|
+
**Natural language parsing**: Accept formats like:
|
|
52
|
+
- `--today` or just `today`
|
|
53
|
+
- `--from 2026-02-21` or `--from "yesterday"`
|
|
54
|
+
- `--from "3 days ago"` or `--from "last monday"`
|
|
55
|
+
- A bare date like `02/21` implies `--from 02/21 --to 02/21` (full day)
|
|
56
|
+
- A bare `3` implies last 3 days
|
|
57
|
+
|
|
58
|
+
If no arguments provided, default to `--today --mode full`.
|
|
59
|
+
|
|
60
|
+
Display the parsed time range to the user:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Audit window: {from} → {to}
|
|
64
|
+
Mode: {mode}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Step 2 — Discover Session Logs
|
|
70
|
+
|
|
71
|
+
Session JSONL files live at:
|
|
72
|
+
```
|
|
73
|
+
~/.claude/projects/{encoded-project-path}/*.jsonl
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Where `{encoded-project-path}` encodes the project directory path (e.g., `D:\Repos\plan-build-run` → `D--Repos-plan-build-run`).
|
|
77
|
+
|
|
78
|
+
**CRITICAL**: Determine the correct encoded path for the current project by listing `~/.claude/projects/` and finding the directory that matches.
|
|
79
|
+
|
|
80
|
+
Use Bash to find sessions in the audit window:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
find ~/.claude/projects/{encoded-path}/ -name "*.jsonl" -maxdepth 1 \
|
|
84
|
+
-newermt "{from_datetime}" ! -newermt "{to_datetime}" | sort
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
For each session file found, also check for subagent logs:
|
|
88
|
+
```bash
|
|
89
|
+
ls ~/.claude/projects/{encoded-path}/{session-id}/subagents/*.jsonl 2>/dev/null
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Display discovery results:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
Found {N} sessions in audit window:
|
|
96
|
+
{session-id-1} ({size}, {date})
|
|
97
|
+
{session-id-2} ({size}, {date})
|
|
98
|
+
...
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
If no sessions found, display an error and exit:
|
|
102
|
+
```
|
|
103
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
104
|
+
║ ERROR ║
|
|
105
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
106
|
+
|
|
107
|
+
No session logs found between {from} and {to}.
|
|
108
|
+
Check: ~/.claude/projects/{encoded-path}/
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Step 3 — Discover Git Activity
|
|
114
|
+
|
|
115
|
+
In parallel with session analysis (Step 4), gather git commit data for the audit window:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
git log --since="{from_iso}" --until="{to_iso}" --format="%h %s %an %ai" --all
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Check for:
|
|
122
|
+
- Conventional commit format violations
|
|
123
|
+
- Forbidden `Co-Authored-By` lines
|
|
124
|
+
- Release-please automated commits
|
|
125
|
+
|
|
126
|
+
This data feeds into the final report synthesis.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Step 4 — Spawn Audit Agents
|
|
131
|
+
|
|
132
|
+
**CRITICAL**: Spawn one `pbr:audit` agent per session, ALL in parallel. Do NOT analyze sessions sequentially.
|
|
133
|
+
|
|
134
|
+
For each session:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Task({
|
|
138
|
+
subagent_type: "pbr:audit",
|
|
139
|
+
prompt: "<audit_assignment>
|
|
140
|
+
Session JSONL: {absolute_path_to_session.jsonl}
|
|
141
|
+
Subagent logs: {list of subagent jsonl paths, or 'none'}
|
|
142
|
+
Audit mode: {mode}
|
|
143
|
+
Output path: DO NOT write to disk — return findings inline.
|
|
144
|
+
|
|
145
|
+
Analyze this session for PBR workflow compliance and/or UX quality
|
|
146
|
+
per your audit checklists. Return your full findings as structured
|
|
147
|
+
markdown in your response.
|
|
148
|
+
</audit_assignment>"
|
|
149
|
+
})
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Also spawn a git analysis agent (can use a Bash agent or general-purpose):
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
Task({
|
|
156
|
+
subagent_type: "Bash",
|
|
157
|
+
model: "haiku",
|
|
158
|
+
prompt: "Run these git commands in {project_dir}:
|
|
159
|
+
1. git log --since='{from}' --until='{to}' --format='%h|%s|%an|%ai' --all
|
|
160
|
+
2. git log --since='{from}' --until='{to}' --all --format='%B' | grep -i 'co-authored-by' || echo 'None found'
|
|
161
|
+
Report: all commits, any format violations against pattern {type}({scope}): {desc}, any co-author lines."
|
|
162
|
+
})
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Display progress:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
◐ Analyzing {N} sessions in parallel...
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Step 5 — Collect and Synthesize
|
|
174
|
+
|
|
175
|
+
As agents complete, collect their findings. Wait for all agents before proceeding.
|
|
176
|
+
|
|
177
|
+
Synthesize across all sessions:
|
|
178
|
+
|
|
179
|
+
### 5a. Executive Summary
|
|
180
|
+
- Total sessions, total commits, releases
|
|
181
|
+
- Overall compliance: how many sessions passed/failed
|
|
182
|
+
- Headline finding (the most important issue)
|
|
183
|
+
|
|
184
|
+
### 5b. Per-Session Summary Table
|
|
185
|
+
| Session | Duration | Commands | Compliance | UX Rating |
|
|
186
|
+
|---------|----------|----------|------------|-----------|
|
|
187
|
+
|
|
188
|
+
### 5c. Cross-Session Patterns
|
|
189
|
+
- Recurring issues (e.g., STATE.md never read across multiple sessions)
|
|
190
|
+
- Hook coverage gaps
|
|
191
|
+
- Common flow mistakes
|
|
192
|
+
|
|
193
|
+
### 5d. Consolidated Findings
|
|
194
|
+
Merge and deduplicate findings across sessions. Categorize by severity:
|
|
195
|
+
- **CRITICAL**: Workflow bypassed despite user requests, hooks not firing
|
|
196
|
+
- **HIGH**: State files not consulted, missing artifacts
|
|
197
|
+
- **MEDIUM**: Suboptimal flow choice, missing feedback
|
|
198
|
+
- **LOW**: Minor ceremony issues, informational
|
|
199
|
+
|
|
200
|
+
### 5e. Recommendations
|
|
201
|
+
Prioritize as:
|
|
202
|
+
- **Immediate**: Fix in next session
|
|
203
|
+
- **Short-term**: Fix in next sprint/milestone
|
|
204
|
+
- **Medium-term**: Architectural improvements
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Step 6 — Write Report
|
|
209
|
+
|
|
210
|
+
**CRITICAL**: Write the full report to disk. Do NOT just display it inline.
|
|
211
|
+
|
|
212
|
+
Write to: `.planning/audits/{YYYY-MM-DD}-session-audit.md`
|
|
213
|
+
|
|
214
|
+
Create `.planning/audits/` directory if it doesn't exist.
|
|
215
|
+
|
|
216
|
+
The report should follow this structure:
|
|
217
|
+
|
|
218
|
+
```markdown
|
|
219
|
+
# PBR Session Audit Report — {date range}
|
|
220
|
+
|
|
221
|
+
**Audit Period:** {from} – {to}
|
|
222
|
+
**Sessions Analyzed:** {N}
|
|
223
|
+
**Commits:** {N}
|
|
224
|
+
**Mode:** {mode}
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Executive Summary
|
|
229
|
+
{2-3 sentence overview}
|
|
230
|
+
|
|
231
|
+
## Session Summary
|
|
232
|
+
{per-session table}
|
|
233
|
+
|
|
234
|
+
## Detailed Session Analysis
|
|
235
|
+
{per-session findings}
|
|
236
|
+
|
|
237
|
+
## Git Activity
|
|
238
|
+
{commit summary, format compliance}
|
|
239
|
+
|
|
240
|
+
## Cross-Session Patterns
|
|
241
|
+
{recurring issues}
|
|
242
|
+
|
|
243
|
+
## Consolidated Findings
|
|
244
|
+
### Critical
|
|
245
|
+
### High
|
|
246
|
+
### Medium
|
|
247
|
+
### Low
|
|
248
|
+
|
|
249
|
+
## Recommendations
|
|
250
|
+
### Immediate
|
|
251
|
+
### Short-Term
|
|
252
|
+
### Medium-Term
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
*Generated by /pbr:audit on {date}*
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Step 7 — Display Summary
|
|
261
|
+
|
|
262
|
+
After writing the report, display inline (keep it concise — the full report is on disk):
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
266
|
+
║ PLAN-BUILD-RUN ► AUDIT COMPLETE ✓ ║
|
|
267
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
268
|
+
|
|
269
|
+
{N} sessions analyzed, {N} commits reviewed
|
|
270
|
+
|
|
271
|
+
Compliance: {X}/{N} sessions passed
|
|
272
|
+
UX Rating: {average or per-session ratings}
|
|
273
|
+
|
|
274
|
+
Top findings:
|
|
275
|
+
1. {headline finding 1}
|
|
276
|
+
2. {headline finding 2}
|
|
277
|
+
3. {headline finding 3}
|
|
278
|
+
|
|
279
|
+
Full report: .planning/audits/{filename}
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
283
|
+
║ ▶ NEXT UP ║
|
|
284
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
285
|
+
|
|
286
|
+
{Smart routing based on findings:}
|
|
287
|
+
- If critical issues found: **Fix workflow** → `/pbr:quick`
|
|
288
|
+
- If todos identified: **Create todos** → `/pbr:todo add "{description}"`
|
|
289
|
+
- Default: **See project status** → `/pbr:status`
|
|
290
|
+
|
|
291
|
+
`/clear` first → fresh context window
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Error Handling
|
|
297
|
+
|
|
298
|
+
### Agent fails to analyze a session
|
|
299
|
+
If an audit agent fails:
|
|
300
|
+
```
|
|
301
|
+
⚠ Failed to analyze session {id}: {error}
|
|
302
|
+
Continuing with remaining {N-1} sessions.
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Include a note in the final report that session was skipped.
|
|
306
|
+
|
|
307
|
+
### No sessions found
|
|
308
|
+
Display error (Step 2) and exit gracefully.
|
|
309
|
+
|
|
310
|
+
### Very large session files (>5MB)
|
|
311
|
+
Warn the agent to sample rather than read the full log:
|
|
312
|
+
```
|
|
313
|
+
Note: Session {id} is {size}MB. Sampling key sections (first 200 lines, last 200 lines, user messages, hook events).
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## Anti-Patterns
|
|
319
|
+
|
|
320
|
+
Reference: `skills/shared/universal-anti-patterns.md` for rules that apply to ALL skills.
|
|
321
|
+
|
|
322
|
+
Additionally for this skill:
|
|
323
|
+
|
|
324
|
+
1. **DO NOT** read JSONL files in main context — always delegate to audit agents
|
|
325
|
+
2. **DO NOT** display the full report inline — write to disk, show summary
|
|
326
|
+
3. **DO NOT** analyze sessions sequentially — spawn all agents in parallel
|
|
327
|
+
4. **DO NOT** report findings without evidence (line numbers, timestamps, quotes)
|
|
328
|
+
5. **DO NOT** judge explore sessions for missing STATE.md updates (explore is read-only)
|
|
329
|
+
6. **DO NOT** flag release-please/merge commits as format violations
|
|
330
|
+
7. **DO NOT** fabricate UX ratings — base them on concrete evidence (user repetitions, escalations, course-corrections)
|
|
331
|
+
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pbr",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.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",
|