원클릭으로
audit
Review past Claude Code sessions for PBR workflow compliance and UX quality.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Review past Claude Code sessions for PBR workflow compliance and UX quality.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Run multiple phases hands-free. Chains discuss, plan, build, and verify automatically.
Start a new project. Deep questioning, research, requirements, and roadmap.
Execute all plans in a phase. Spawns agents to build in parallel, commits atomically.
Configure settings: depth, model profiles, features, git, and gates.
Execute the next logical step automatically. No prompts, no decisions — just do it.
Systematic debugging with hypothesis testing. Persistent across sessions.
| name | audit |
| description | Review past Claude Code sessions for PBR workflow compliance and UX quality. |
| allowed-tools | Read, Write, Bash, Glob, Grep, Task, AskUserQuestion |
| argument-hint | [--from DATE] [--to DATE] [--today] [--mode compliance|ux|full] [--preset minimal|standard|comprehensive] [--dimension ID...] [--skip ID...] [--only ID...] |
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.
Before ANY tool calls, display this banner:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► SESSION AUDIT ║
╚══════════════════════════════════════════════════════════════╝
Then proceed to Step 1.
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.
This skill uses parallel Task() delegation to analyze multiple sessions simultaneously, keeping main context lean.
Reference: skills/shared/context-budget.md for the universal orchestrator rules.
Reference: skills/shared/agent-type-resolution.md for agent type fallback when spawning Task() subagents.
Additionally for this skill:
Parse $ARGUMENTS for:
| Argument | Default | Description |
|---|---|---|
--from DATE | Start of today | Start of audit window (ISO date or natural language) |
--to DATE | Now | End of audit window |
--today | false | Shorthand for --from start of today --to now |
--mode MODE | full | compliance = workflow only, ux = user experience only, full = both |
--preset PRESET | config.json audit.preset | Override audit preset (minimal/standard/comprehensive) |
--dimension ID | (none) | Add specific dimension(s) to the active set. Accepts code (SI-01) or slug (skill-template-refs). Repeatable. |
--skip ID | (none) | Remove specific dimension(s) from the active set. Accepts code or slug. Repeatable. |
--only ID | (none) | Run ONLY these dimensions, ignoring preset/categories. Accepts code or slug. Repeatable. |
Natural language parsing: Accept formats like:
--today or just today--from 2026-02-21 or --from "yesterday"--from "3 days ago" or --from "last monday"02/21 implies --from 02/21 --to 02/21 (full day)3 implies last 3 daysIf no arguments provided, default to --today --mode full.
Display the parsed time range to the user:
Audit window: {from} → {to}
Mode: {mode}
Load the project's config.json audit section. Build cliFlags from parsed arguments:
const cliFlags = {
preset: parsedArgs.preset, // string or undefined
dimension: parsedArgs.dimension, // array of ID/slug strings or undefined
skip: parsedArgs.skip, // array of ID/slug strings or undefined
only: parsedArgs.only, // array of ID/slug strings or undefined
};
Call audit-dimensions.js resolveDimensions(config, cliFlags) to compute the active dimension set.
Display the resolution summary:
Preset: {preset} ({N} base dimensions)
Active dimensions: {N} ({breakdown by category, e.g., "SI: 15, IH: 10, EF: 7, WC: 12"})
If --dimension or --skip was used, also display:
Adjustments: +{added} -{removed}
Store the resolved dimension list for use in Step 4.
Session JSONL files live at:
~/.claude/projects/{encoded-project-path}/*.jsonl
Where {encoded-project-path} encodes the project directory path (e.g., D:\Repos\plan-build-run → D--Repos-plan-build-run).
CRITICAL: Determine the correct encoded path for the current project by listing ~/.claude/projects/ and finding the directory that matches.
Use Bash to find sessions in the audit window:
find ~/.claude/projects/{encoded-path}/ -name "*.jsonl" -maxdepth 1 \
-newermt "{from_datetime}" ! -newermt "{to_datetime}" | sort
CRITICAL — Exclude Current Session: Before proceeding, determine the current session ID:
.jsonl in the project directory that is actively being written to (i.e., THIS session)find ~/.claude/projects/{encoded-path}/ -name "*.jsonl" -maxdepth 1 -mmin -1 2>/dev/nullExcluding current session {id} from analysis (self-referential)For each session file found, also check for subagent logs:
ls ~/.claude/projects/{encoded-path}/{session-id}/subagents/*.jsonl 2>/dev/null
Display discovery results:
Found {N} sessions in audit window:
{session-id-1} ({size}, {date})
{session-id-2} ({size}, {date})
...
If no sessions found, display an error and exit:
╔══════════════════════════════════════════════════════════════╗
║ ERROR ║
╚══════════════════════════════════════════════════════════════╝
No session logs found between {from} and {to}.
Check: ~/.claude/projects/{encoded-path}/
In parallel with session analysis (Step 4), gather git commit data for the audit window:
git log --since="{from_iso}" --until="{to_iso}" --format="%h %s %an %ai" --all
Check for:
Co-Authored-By linesThis data feeds into the final report synthesis.
CRITICAL: Spawn one pbr:audit agent per session, ALL in parallel. Do NOT analyze sessions sequentially.
Before spawning agents, check for a recent insights report:
ls -t ~/.claude/insights/*.html 2>/dev/null | head -1
If a file exists and was modified within the last 30 days, store its absolute path as insights_report_path. Otherwise set to 'none'.
Compute paths for the spawn prompt:
plugins/pbr (e.g., D:/Repos/plan-build-run/plugins/pbr).planning (e.g., D:/Repos/plan-build-run/.planning)JSON.stringify(config) from the loaded config.json — escape backslashes and quotes for template embeddingFor each session:
Task({
subagent_type: "pbr:audit",
prompt: "<files_to_read>
CRITICAL: Read these files BEFORE any other action:
1. {absolute_path_to_session.jsonl} — session log to analyze
2. {subagent log paths, if any} — subagent session logs
</files_to_read>
<audit_assignment>
Session JSONL: {absolute_path_to_session.jsonl}
Subagent logs: {list of subagent jsonl paths, or 'none'}
Audit mode: {mode}
Active dimensions: {comma-separated list of dimension codes from Step 1b}
Preset: {preset}
Plugin root: {absolute path to plugins/pbr}
Planning dir: {absolute path to .planning}
Config JSON: {JSON.stringify(config) — escaped for template}
Run programmatic checks first via audit-checks/index.js runAllChecks(),
then analyze JSONL for session-dependent dimensions.
Return per-dimension results table.
Only check dimensions in the active set. Skip all others.
Output path: DO NOT write to disk — return findings inline.
Analyze this session for PBR workflow compliance and/or UX quality
per your audit checklists. Return your full findings as structured
markdown in your response.
Insights report: {insights_report_path}
</audit_assignment>"
})
Also spawn a git analysis agent:
Task({
subagent_type: "pbr:general",
model: "haiku",
prompt: "Run these git commands in {project_dir}:
1. git log --since='{from}' --until='{to}' --format='%h|%s|%an|%ai' --all
2. git log --since='{from}' --until='{to}' --all --format='%B' | grep -i 'co-authored-by' || echo 'None found'
Report: all commits, any format violations against pattern {type}({scope}): {desc}, any co-author lines."
})
Display progress:
◐ Analyzing {N} sessions in parallel...
As agents complete, check each audit agent's Task() output for ## AUDIT COMPLETE. If the marker is absent, mark that session as "analysis failed" in the synthesis and skip its findings — do not treat incomplete output as valid analysis. Log: ⚠ Session {id}: audit agent did not return completion marker — skipping.
Wait for all agents before proceeding.
From each agent's output, extract the per-dimension results tables. Each row has: Code, Dimension, Status, Evidence Summary.
Merge results across sessions:
For each of the 9 categories (AC, SI, IH, EF, WC, BC, SQ, FV, QM):
{Category Name} ({Code}): {pass}/{total} pass, {warn} warn, {fail} failCompute overall dimension score: {pass}/{total} dimensions passed
{pass}/{total} dimensions passed| Session | Duration | Commands | Compliance | UX Rating | Dimensions Checked |
|---|
Merge and deduplicate findings across sessions. Categorize by severity:
Prioritize as:
CRITICAL: Write the full report to disk. Do NOT just display it inline.
Write to: .planning/audits/{YYYY-MM-DD}-session-audit.md
CRITICAL: Create the audits directory NOW. Do not skip this step.
Create .planning/audits/ directory if it doesn't exist.
The report should follow this v2 structure:
# PBR Session Audit Report — {date range}
**Audit Period:** {from} – {to}
**Sessions Analyzed:** {N}
**Commits:** {N}
**Mode:** {mode}
---
## Executive Summary
{2-3 sentence overview}
**Overall dimension score:** {pass}/{total} dimensions passed
## Dimension Coverage
**Preset:** {preset}
**Dimensions checked:** {N}/{total enabled}
**Overall:** {pass} pass, {warn} warn, {fail} fail
## Per-Category Results
### Self-Integrity (SI): {pass}/{total} pass, {warn} warn
| Code | Dimension | Status | Evidence Summary |
|------|-----------|--------|------------------|
### Infrastructure Health (IH): {pass}/{total} pass, {warn} warn
(repeat for each active category: AC, SI, IH, EF, WC, BC, SQ, FV, QM)
## Config Cross-Reference
For each dimension that references an `audit.thresholds` key, show:
| Dimension | Threshold Key | Configured Value | Check Result |
|-----------|--------------|-----------------|--------------|
| IH-03 | hook_performance_ms | 500 | pass |
(Only include dimensions with non-null thresholdKey from audit-dimensions.js)
## Session Summary
{per-session table}
## Detailed Session Analysis
{per-session findings}
## Git Activity
{commit summary, format compliance}
## Cross-Session Patterns
{recurring issues}
## Trend Analysis
If QM-03 baseline comparison data is available:
- Dimensions that **regressed** (were pass, now warn/fail)
- Dimensions that **improved** (were warn/fail, now pass)
- Overall trend direction
If no prior audit data: "No prior audit data available for trend comparison."
## Consolidated Findings
### Critical
### High
### Medium
### Low
## Recommendations
### Immediate
### Short-Term
### Medium-Term
---
*Generated by /pbr:audit on {date}*
Before displaying results, verify the report landed on disk:
.planning/audits/{YYYY-MM-DD}-session-audit.md to confirm the file existsApply verbosity filtering to the Per-Category Results section based on the active preset:
| Preset | Per-Category Results Behavior |
|---|---|
minimal | Omit Per-Category Results detail entirely. Show only category-level summary lines (e.g., "SI: 14/15 pass, 1 warn"). |
standard | Per-Category Results shows only warn/fail dimensions. Passing dimensions are omitted from the detail tables. |
comprehensive | Per-Category Results shows ALL dimensions including passing ones. |
Implementation: After building the per-category dimension tables in Step 5, filter rows before writing to the report:
minimal: skip writing dimension tables, keep only the ### {Category} ({Code}): {summary} header linesstandard: filter each category table to only include rows where Status is warn or failcomprehensive: include all rowsThe Dimension Coverage section and Executive Summary are always included regardless of verbosity.
After writing the report, display inline (keep it concise — the full report is on disk):
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► AUDIT COMPLETE ✓ ║
╚══════════════════════════════════════════════════════════════╝
{N} sessions analyzed, {N} commits reviewed
Compliance: {X}/{N} sessions passed
UX Rating: {average or per-session ratings}
Top findings:
1. {headline finding 1}
2. {headline finding 2}
3. {headline finding 3}
Full report: .planning/audits/{filename}
╔══════════════════════════════════════════════════════════════╗
║ ▶ NEXT UP ║
╚══════════════════════════════════════════════════════════════╝
{Smart routing based on findings:}
- If critical issues found: **Fix workflow** → `/pbr:quick`
- If todos identified: **Create todos** → `/pbr:add-todo "{description}"`
- Default: **See project status** → `/pbr:progress`
<sub>`/clear` first → fresh context window</sub>
Reference: skills/shared/error-reporting.md for branded error output patterns.
If an audit agent fails:
⚠ Failed to analyze session {id}: {error}
Continuing with remaining {N-1} sessions.
Include a note in the final report that session was skipped.
Display error (Step 2) and exit gracefully.
Warn the agent to sample rather than read the full log:
Note: Session {id} is {size}MB. Sampling key sections (first 200 lines, last 200 lines, user messages, hook events).
Reference: skills/shared/commit-planning-docs.md -- if planning.commit_docs is true, commit the audit report file.
Additionally for this skill: