Skip to content
Development
Skill

/pre-pr-audit

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

From plugin
sd0x-dev-flow
195102 skills16 agents5 hooks

Claude Code

$ npx -y skills add sd0xdev/sd0x-harness --skill pre-pr-audit --agent claude-code

SKILL.md

pre-pr-audit.SKILL.md
name: pre-pr-audit
description: "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)."
allowed-tools: Read, Grep, Glob, Bash(git:*), Bash(bash:*), Skill, AskUserQuestion, Agent

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

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

| 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

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-assess --mode fast
        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)

| 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) | Invoke `/risk-assess --mode fast` | Skill tool — get risk_level, top_affected, overall_score | | A3 | Background Agent | Detect changed files + map to test files | `git diff --name-only HEAD` → match against `test/` patterns |

**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)

1. Source: `/risk-assess` JSON `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: `git diff --name-only` for files beyond top_affected cap 5. Fallback: if `/risk-assess` unavailable, `git diff --stat` sorted by lines-changed descending

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
  • Per-dimension score table
  • Hard-fail check results
  • Findings (prioritized)
  • Next actions

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.

Read more
@sd0xdev
Ships withsd0x-dev-flow

Language: English | 繁體中文 | 简体中文 | 日本語 | 한국어 | Español The harness layer for Claude Code. Let the model choose the path. Keep "done" verifiable. Claude has discretion inside a closed, test-pinned anchor set.

195102 skills16 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
195
Star history of sd0xdev/sd0x-dev-flow on GitHub, a chart by star-history.com

Other skills on sd0x-dev-flow.

adr

adr

Write an Architecture Decision Record (ADR) for a feature — Context / Decision / Status / Consequences / Alternatives, filed as…

agentctl-setup

agentctl-setup

Install and set up the optional agentctl mod (task scope, refusal before execution, evidence that goes stale, model-free…

architecture

architecture

Architecture design and documentation. Produces 3-architecture.md with component diagrams, data flow, integration points, and…

ask

ask

Context-aware Q&A with auto context gathering. Use when: user has a quick question about codebase, git history, rules, docs, or…

best-practices

best-practices

Industry best practices conformance audit with mandatory adversarial debate. Produces audit artifact: verdict (OK/WARN/FAIL) +…

bug-fix

bug-fix

Bug fix workflow. Use when: fixing bugs, resolving issues, regression fixes. Not for: new features (use feature-dev),…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about pre-pr-audit.

Which coding agents can use pre-pr-audit?
pre-pr-audit installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.