Skip to content
Back to skills

Pre Pr

ASecurity

Use before creating a pull request or pushing a new PR branch, when repository checks and changed-behavior coverage need verification.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 25, 2026
ai-agentsrustbashgitapidocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 25, 2026

npx -y skills add OrionArchitekton/orion-skills --skill pre-pr --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pre Pr?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pre Pr
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/orionarchitekton-pre-pr/badge)](https://www.skillsdirectory.com/skills/orionarchitekton-pre-pr)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pre-pr
description: Use before creating a pull request or pushing a new PR branch, when repository checks and changed-behavior coverage need verification.
---

# Pre-PR Verification

Structured verification pass before creating any PR. Run this BEFORE `gh pr create` or `git push` for a new PR.

## Step 1: Detect base branch

First check for repo-local PR convention. Look for a declared base branch in:

1. Repo-local `AGENTS.md` or `CLAUDE.md` (some repos use a non-`main` default branch, e.g. `develop`, `release`, or a project-specific trunk; never assume `main`)
2. `.claude/pr-config.json` if it exists (field: `baseBranch`)

If no repo-local convention is found, fall back:

```bash
git remote show origin | grep 'HEAD branch' | sed 's/.*: //'
```

Report which source determined the base branch.

## Step 2: Verify working branch

```bash
CURRENT=$(git branch --show-current)
```

Check that the current branch is NOT the base branch or any protected branch declared in repo-local config. If it is, report as BLOCKING.

## Step 3: Run repo-local preflight

Read the repository's `AGENTS.md` or `CLAUDE.md` and CI configuration. Run
its declared applicable checks (for example, `pytest`, `npm test`, `bun test`).
If the repository declares an existing trusted preflight executable, run it too;
`.claude/hooks/pre-commit.sh` is one optional convention, not a bundled requirement.
Do not install or activate hooks as part of this check.

If no repo-local preflight exists, report as INFO: "No repo-local preflight found."

## Step 4: Secret scan

Scan the diff against the base branch for credential patterns:

```bash
git diff <base-branch>...HEAD
```

Patterns to check (advisory, not a policy gate):
- `password`, `secret`, `token`, `api_key`, `apikey`, `private_key`, `auth_token` followed by assignment with a string value
- Base64-encoded strings longer than 40 characters that look like keys
- Your secrets manager's documented token prefixes (most managers publish a recognizable prefix for service/personal tokens; add yours here)

If hits are found, report as BLOCKING (secrets are the one advisory pattern that blocks).

## Step 5: Repo-local optional patterns

If `.claude/pr-config.json` exists and declares additional scan patterns:

```json
{
  "scanPatterns": [
    { "pattern": "console\\.log", "severity": "WARNING", "label": "Debug logging" },
    { "pattern": "TODO|FIXME|HACK", "severity": "WARNING", "label": "Shipping markers" }
  ]
}
```

Run each pattern against the diff and report at the declared severity.

If no repo-local patterns are configured, skip this step.

## Step 6: File inventory

List all changed files with a one-line rationale:

```bash
git diff --stat <base-branch>...HEAD
```

For each file, state what changed and why (based on the diff content and commit messages).

## Step 7: Coverage of the diff

Review changed behavior as well as the suite's exit code:

1. Identify each changed behavior, invariant, error path, authority gate, state
   transition or side effect in `git diff <base-branch>...HEAD`.
2. Name the highest useful test seam already available (unit, API/integration,
   CLI/hook, migration, or manual proof when automation is inappropriate).
3. Map each behavior to a test or observed proof that would fail if it broke.
   Report **WARNING** for a missing match, especially for silent failure,
   fallback, authorization, data integrity and state changes. Existing green tests
   alone do not establish coverage of the changed behavior.
4. Mechanical edits and prose-only documentation corrections need no new tests;
   report why this review is not applicable. A documented executable recipe or a
   change to a supported workflow is behavior and still needs a scenario/proof.
   Respect the current request's authority for any live proof; an absent grant
   means report the gap, not invoke production or a provider.

Worked example: a PR changes an API's 401 fallback, while its only test exercises
200 success. Report `WARNING: 401 fallback has no matching failure-path test at
the API seam`, even if the full suite passes. A Markdown spelling correction has
no changed behavior: report `INFO: coverage review not applicable; prose-only`.

This review is advisory. It does not weaken repository-required checks, convert
warnings into approval, or grant push/PR/merge authority.

## Output Format

```
## Pre-PR Report

**Base branch:** <branch> (source: <repo-local | origin default>)
**Current branch:** <branch>
**Files changed:** <count>

### BLOCKING
- [secrets found, protected-branch violation, preflight failure]

### WARNING
- [advisory findings: TODOs, debug markers, large diffs, repo-local patterns, changed behavior without matching proof]

### INFO
- [file inventory, branch state, preflight status]

### Result: CLEAR | ISSUES (<N> blocking, <N> warning)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.