sd0xdev/sd0x-dev-flow/pre-pr-audit

Claude Code and agent skill by sd0xdev/sd0x-dev-flow

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

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-audit

Semi-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

NeedUse 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

auto-loop done → [user invokes] /pre-pr-audit → /smart-commit → /push-ci → /create-pr
↑
Pre-deploy ultimate verification

Prohibited

❌ git add | git commit | git push — per @rules/git-workflow.md

This skill audits and reports. It does not modify code or commit.

Arguments

ArgDescriptionDefault
`--mode fast\deep`Execution depthfast
--strictNon-zero exit on ⛔ PR-Blockedoff
--jsonMachine-readable JSON outputoff
--base <ref>Compare against refHEAD

Workflow

mermaid
sequenceDiagram
participant U as User
participant PA as /pre-pr-audit
participant RA as /risk-assess
participant TR as /codex-test-review
participant CC as /check-coverage
participant ST as State / Artifacts
U->>PA: /pre-pr-audit [--mode fast|deep]
par Phase A: Collect
PA->>ST: [Background Agent] Read precommit/verify state (freshness)
PA->>RA: [Foreground — blocking] risk-analyze.js --json --base <base>
PA->>PA: [Background Agent] Detect changed files + map to tests
end
Note over PA,RA: A2 (/risk-assess) must complete before Phase B — Module Selection depends on top_affected
par Phase B: Targeted
PA->>TR: [Foreground] /codex-test-review (top-N risky modules)
PA->>CC: [Background Agent: coverage-analyst] /check-coverage (deep mode only)
PA->>PA: [Background Agent] AC trace (if request doc exists)
end
PA->>PA: Phase C: Aggregate + hard-fail + gate
PA->>U: Phase D: Report + confidence index
Phase A: Collect (parallel with dispatch annotations)
StepDispatchActionSource
A1Background AgentRead precommit gate statenode 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
A2Foreground (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)
A3Background AgentMap the change inventory to test filesInventory → 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)
StepDispatchfastdeepAction
B1Foregroundtop-3top-10 + supplement/codex-test-review on selected modules (see Module Selection)
B2Background Agent (coverage-analyst)skip✅/check-coverage for pyramid balance
B3Background Agentskip✅ (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)
  1. Source: A2's JSON dimensions.blast_radius.top_affected array (each: file + dependent_count)
  2. Sort: dependent_count descending, tie-break file ascending (stable sort)
  3. Select: N=3 (fast) or N=10 (deep)
  4. Deep supplement: change-inventory files beyond the top_affected cap
  5. Fallback: if /risk-assess is 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
  1. Score each dimension per references/scoring-model.md
  2. Apply evidence confidence cap
  3. Check hard-fail overrides
  4. 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:

RuleDetail
Final, not rawThe 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 topAny triggered hard-fail is named in the first lines of the summary with ⛔ PR-Blocked (hard-fail), whatever the score
Missing key evidence is listedEvery item of § Key Evidence that is missing appears under Not Verified, in the summary itself — not only in the findings
No readiness without key evidenceWith any key evidence missing, the gate is at most ⚠️ PR-Caution, whatever the index
N/A is not a passA 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 tooA 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 evidenceMissing when
Test executionNo test run data for the current tree (Execution Integrity has nothing to read)
Consumer pathsA changed function, export, schema or CLI flag has callers or readers, and no test exercises the change through one of them
Output pathsThe change alters something the system emits — a file, report, API response, event, exit code — and no test asserts on that output
Risk inputModule Selection used its line-count fallback: /risk-assess did not run, failed, or returned a different base

5 Dimensions

#DimensionWeightChecks
1Execution Integrity25%All tests pass, precommit passed, HEAD freshness, no flaky indicators
2Coverage Adequacy25%Unit/Integration/E2E pyramid balance, per-module gap analysis
3Test Quality20%AAA compliance, naming, assertion depth, edge cases (per @rules/testing.md)
4Risk-to-Test Alignment20%High-risk files have tests, risk level ↔ test depth proportional
5Evidence Governance10%AC traceability, exception policy compliance, expiry check

Gate

User-Facing (3-tier)
GateScoreSentinel
✅ Ready>=85✅ PR-Ready
⚠️ Needs attention60-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.

OverrideConditionSource
Precommit staleNot passed after latest editAuto-loop state
Prohibited domain exceptionSecurity/data-integrity/regression AC uses manual exceptionrules/testing.md § Evidence Model
Exception cap exceededException count > AC-count-based cap@skills/test-review/references/testing-contract.md § Evidence Model
Expired exceptionPast ISO 8601 expiry date@skills/test-review/references/testing-contract.md § Evidence Model
Invalid reason classNon-enum reason in exception@skills/test-review/references/testing-contract.md § Evidence Model
Unverified exceptionNo Codex VALID_EXCEPTION verdict@skills/test-review/references/testing-contract.md § Evidence Model
Evidence staleArtifacts HEAD SHA ≠ current HEADFreshness check
Critical untested/risk-assess HIGH+ on zero-coverage filesRisk 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 caps
  • references/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

Input: /pre-pr-audit
Action: fast mode → collect state + risk → test-review top-3 → aggregate → 85/100 ✅ PR-Ready
Input: /pre-pr-audit --mode deep
Action: deep mode → collect + risk → test-review top-10 + coverage + AC trace → aggregate → 72/100 ⚠️ PR-Caution
Input: /pre-pr-audit (all present checks pass; the changed exporter's output file has no test)
Action: raw 96 × cap 1.0 = 96, but output-path evidence is missing → ⚠️ PR-Caution, "Not Verified: output path of exportReport()"
Input: /pre-pr-audit --strict
Action: fast mode → score 55 → ⛔ PR-Blocked → exit code 1

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/sd0xdev/sd0x-dev-flow/pre-pr-audit/badge)](https://verified-skill.com/skills/sd0xdev/sd0x-dev-flow/pre-pr-audit)

Something wrong with this skill or its page? Tell us.