sd0xdev/sd0x-dev-flow/pre-pr-audit
Claude Code and agent skill by sd0xdev/sd0x-dev-flow
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Pre-PR confidence audit with 5-dimension scoring. Use when: final check before commit/push/PR, evaluating PR readiness, assessing test quality + risk + coverage holistically. Triggers: pre-pr, readiness check, confidence audit, final verification, ready to PR, how confident. Not for: code review (use codex-review-fast), post-deploy verification (use feature-verify), periodic health (use project-audit).
Install
npx vskill@latest install sd0xdev/sd0x-dev-flow/pre-pr-auditSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as sd0xdev/sd0x-dev-flow/pre-pr-audit.
Pre-PR Audit
Pre-deploy ultimate verification. Aggregates test quality, coverage, risk, and AC traceability into a single confidence index (0-100).
When NOT to Use
| Need | Use Instead | |
|---|---|---|
| Code review | /codex-review-fast | |
| Post-deploy runtime verification | /feature-verify | |
| Periodic project health | /project-audit | |
| Just run tests | /verify | |
| Just check risk | /risk-assess |
Positioning
Prohibited
This skill audits and reports. It does not modify code or commit.
Arguments
| Arg | Description | Default | ||
|---|---|---|---|---|
| `--mode fast\ | deep` | Execution depth | fast | |
--strict | Non-zero exit on ⛔ PR-Blocked | off | ||
--json | Machine-readable JSON output | off | ||
--base <ref> | Compare against ref | HEAD |
Workflow
Phase A: Collect (parallel with dispatch annotations)
| Step | Dispatch | Action | Source | |
|---|---|---|---|---|
| A1 | Background Agent | Read precommit gate state | node scripts/review-state.js check --format=json(installed copy first: .claude/scripts/review-state.js)— precommit.passed is content-addressed, so no separate freshness check; checker absent → report "no verdict source", never a pass | |
| A2 | Foreground (blocking) | Run the /risk-assess analyzer for <base> | bash "${CLAUDE_PLUGIN_ROOT}/scripts/run-skill.sh" risk-assess risk-analyze.js --json --mode fast --base <base>, run from the audited repository (the runner is the plugin's, so its path is never repo-relative) — the JSON itself, not the skill's report, which omits fields needed here: base, risk_level, overall_score, dimensions.blast_radius.top_affected. Exit 1 (High) and 2 (Critical) are results, not failures. No parseable JSON, or a base other than <base> → /risk-assess is unavailable (Module Selection step 5) | |
| A3 | Background Agent | Map the change inventory to test files | Inventory → match against test/ patterns |
Change inventory = git diff --name-only <base> ∪ git ls-files --others --exclude-standard. An untracked module is part of the change; a plain git diff never lists it.
<base> is the --base ref, resolved once at the start (default HEAD) and used everywhere the change is measured — A2, A3, Module Selection's supplement and its fallback. Measuring one of them against HEAD while the audit was asked for --base main hides committed changes, and with them the consumer and output paths § Key Evidence is about.
A2 MUST stay foreground: Phase B Module Selection depends on top_affected from /risk-assess output. A1 and A3 dispatch as background Agents and run in parallel with A2.
Phase B: Targeted (parallel, mode-dependent, with dispatch annotations)
| Step | Dispatch | fast | deep | Action | |
|---|---|---|---|---|---|
| B1 | Foreground | top-3 | top-10 + supplement | /codex-test-review on selected modules (see Module Selection) | |
| B2 | Background Agent (coverage-analyst) | skip | ✅ | /check-coverage for pyramid balance | |
| B3 | Background Agent | skip | ✅ (if request doc) | AC trace: parse ## Acceptance Criteria → map to test evidence |
B2 uses `coverage-analyst` agent (agents/coverage-analyst.md) for background execution. B3 dispatches as a background Agent for AC parsing. B1 stays foreground as the primary assessment.
Module Selection (deterministic)
- Source: A2's JSON
dimensions.blast_radius.top_affectedarray (each:file+dependent_count) - Sort:
dependent_countdescending, tie-breakfileascending (stable sort) - Select: N=3 (
fast) or N=10 (deep) - Deep supplement: change-inventory files beyond the top_affected cap
- Fallback: if
/risk-assessis unavailable, the change inventory sorted by lines changed, descending —git diff --numstat <base>(added + deleted), and for an untracked file its whole line count
Phase C: Aggregate
- Score each dimension per
references/scoring-model.md - Apply evidence confidence cap
- Check hard-fail overrides
- Compute final index
Phase D: Output
Output report per references/output-template.md. Include:
- Confidence index (0-100) + gate sentinel — the final (capped) index; § Summary Integrity
- Per-dimension score table
- Hard-fail check results
- Findings (prioritized)
- Next actions
Summary Integrity
The user-facing summary is what most readers see. It never reads better than the evidence:
| Rule | Detail | |
|---|---|---|
| Final, not raw | The headline number is final_index (raw × cap). The raw score appears only beside its cap — raw 92 × cap 0.6 = 55 — never alone | |
| Hard-fails stay on top | Any triggered hard-fail is named in the first lines of the summary with ⛔ PR-Blocked (hard-fail), whatever the score | |
| Missing key evidence is listed | Every item of § Key Evidence that is missing appears under Not Verified, in the summary itself — not only in the findings | |
| No readiness without key evidence | With any key evidence missing, the gate is at most ⚠️ PR-Caution, whatever the index | |
| N/A is not a pass | A check is N/A only when it does not apply to this change. A consumer-path or output-path check that applies but has no evidence is missing: scored as a fail, not excluded. Missing test execution keeps the scoring model's own treatment (Static-only cap 0.6) and is listed as missing too | |
| Short forms too | A one-line or --json summary carries the gate, the final index, the cap, the triggered hard-fails and the missing-evidence count (missing_evidence.length in --json) |
Key Evidence
| Key evidence | Missing when | |
|---|---|---|
| Test execution | No test run data for the current tree (Execution Integrity has nothing to read) | |
| Consumer paths | A changed function, export, schema or CLI flag has callers or readers, and no test exercises the change through one of them | |
| Output paths | The change alters something the system emits — a file, report, API response, event, exit code — and no test asserts on that output | |
| Risk input | Module Selection used its line-count fallback: /risk-assess did not run, failed, or returned a different base |
5 Dimensions
| # | Dimension | Weight | Checks | |
|---|---|---|---|---|
| 1 | Execution Integrity | 25% | All tests pass, precommit passed, HEAD freshness, no flaky indicators | |
| 2 | Coverage Adequacy | 25% | Unit/Integration/E2E pyramid balance, per-module gap analysis | |
| 3 | Test Quality | 20% | AAA compliance, naming, assertion depth, edge cases (per @rules/testing.md) | |
| 4 | Risk-to-Test Alignment | 20% | High-risk files have tests, risk level ↔ test depth proportional | |
| 5 | Evidence Governance | 10% | AC traceability, exception policy compliance, expiry check |
Gate
User-Facing (3-tier)
| Gate | Score | Sentinel | |
|---|---|---|---|
| ✅ Ready | >=85 | ✅ PR-Ready | |
| ⚠️ Needs attention | 60-84 | ⚠️ PR-Caution | |
| ⛔ Not ready | <60 | ⛔ PR-Blocked |
Hard-Fail Overrides (force ⛔ regardless of score)
Before the four exception checks sourced from the testing contract, Read @skills/test-review/references/testing-contract.md; if that Read fails, stop the audit before scoring and report that no readiness verdict can be given — never emit a PR-Ready, PR-Caution or PR-Blocked sentinel with the hard-fail checks unrun, and never judge an exception from memory.
| Override | Condition | Source | |
|---|---|---|---|
| Precommit stale | Not passed after latest edit | Auto-loop state | |
| Prohibited domain exception | Security/data-integrity/regression AC uses manual exception | rules/testing.md § Evidence Model | |
| Exception cap exceeded | Exception count > AC-count-based cap | @skills/test-review/references/testing-contract.md § Evidence Model | |
| Expired exception | Past ISO 8601 expiry date | @skills/test-review/references/testing-contract.md § Evidence Model | |
| Invalid reason class | Non-enum reason in exception | @skills/test-review/references/testing-contract.md § Evidence Model | |
| Unverified exception | No Codex VALID_EXCEPTION verdict | @skills/test-review/references/testing-contract.md § Evidence Model | |
| Evidence stale | Artifacts HEAD SHA ≠ current HEAD | Freshness check | |
| Critical untested | /risk-assess HIGH+ on zero-coverage files | Risk alignment |
Scoring
See references/scoring-model.md for formulas. Summary:
- Check score: pass=1, partial=0.5, fail=0, N/A=excluded
- Dimension score:
applicable_sum / applicable_count × 100 - Raw: weighted average (N/A dimensions excluded, weights renormalized)
- Cap: evidence confidence (1.0 / 0.9 / 0.75 / 0.6)
- Final:
round(raw × cap) - Gate ceiling: missing key evidence → at most
⚠️ PR-Caution(§ Summary Integrity)
Verification
- [ ] All 5 dimensions scored (or N/A with reason)
- [ ] Hard-fail checks evaluated
- [ ] Gate sentinel output matches score, hard-fails and the missing-evidence ceiling
- [ ] Summary shows the final index (raw only beside its cap), every triggered hard-fail and every missing key evidence item
- [ ] No git add/commit/push executed
- [ ] Findings include file:line references
References
references/scoring-model.md— Scoring formulas, weights, confidence capsreferences/output-template.md— Report format, JSON schema, sentinel strings@skills/test-review/references/testing-contract.md— exception gates, caps and expiry (hard-fail source)@rules/testing.md— evidence core and the domains that never take an exception (hard-fail source)@rules/testing-project.md— Project-specific overrides
Examples
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/pre-pr-audit/SKILL.md
Popularity
- Repository stars
- 188
- Repository forks
- 24
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 22 May 2026, 6 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sd0xdev/sd0x-dev-flow/pre-pr-audit)