agentleFS
ianshankianshank/Agents/skills/pre-pr-gate/SKILL.md

pre-pr-gate

Skill1 starsChanged 58 days agoApache-2.0View on GitHub

Run every quality/regression/architecture gate this repo's CI enforces, chained locally as one command, before opening or updating a PR. Use this whenever the user asks whether a branch is ready to merge, wants the full test suite run before pushing, needs a branch validated end to end, or mentions a "pre-PR checklist" or "run everything before I push".

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run this repo's complete pre-PR validation battery — every gate quality-gates.yml and architecture-drift.yml enforce in CI, plus the …

    line 11
  2. Very specific:

    When --out <path> is passed to run_pre_pr_gate.py, <path> is valid JSON: {"passed": bool, "exit_code": int, "target": str, "root": str}.

    line 57

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

pre-pr-gate — E2E Action Skill

Run this repo's complete pre-PR validation battery — every gate quality-gates.yml and architecture-drift.yml enforce in CI, plus the advisory checks this repo has but previously left scattered across AGENTS.md prose and CI YAML — as one command, and report a single pass/fail with evidence.

1. Preconditions (input contract)

  • A checkout of this monorepo with make on PATH and the dev extras installed (make install / make install-all).
  • The working tree state to validate is already the checked-out state — this skill does not stash, commit, or switch branches.
  • The comparison base should be an up-to-date remote-tracking ref. A stale local main produces misleading regression_gate.py/repo-invariant-review findings that point at already-merged, unrelated commits rather than the branch under review — git fetch origin main first if in doubt (tracking ref only); this gate does not do that for you. make pre-pr already compares against origin/main (PRE_PR_BASE_REF).

2. Procedure (the E2E steps)

  1. From the repo root, run make pre-pr, or equivalently python skills/pre-pr-gate/scripts/run_pre_pr_gate.py --root . — the same thing via a script, so the result is a checkable artifact rather than only terminal output. Pass --base-ref <ref> (or PRE_PR_BASE_REF=<ref> to make directly) to compare against something other than origin/main.
  2. The chain, in order: make check-all (root + all 5 sibling packages' own quality gates), make invariants (charter invariants + charter drift), check_size_budget.py, check_guard_reachability.py, check_skill_script_drift.py, check_protected_changes.py, regression_gate.py --base-ref <ref>, validate.py --tier fast --strict-git, architecture-drift-guard's drift_check.py and mermaid_gen.py --check, skill_marketplace.py validate, make determinism, and finally repo-invariant-review's check_invariants.py (advisory — see its own SKILL.md for why it stays non-blocking here: several of its checks already duplicate gates earlier in this same chain).
  3. make pre-pr accumulates every failure instead of stopping at the first, so read the whole output — fixing one and re-running can hide the next one behind it.
  4. A clean exit means the branch is safe to push from a local validation standpoint. Real CI still runs independently and can differ under network-dependent or environment-specific conditions this gate cannot see locally (e.g. secret-scanning, GitHub-hosted-runner specifics).

3. Output contract (postconditions — what "done" means)

  • make pre-pr (equivalently run_pre_pr_gate.py) exited 0, or every failure it reported has been fixed and it was re-run to a clean exit.
  • When --out <path> is passed to run_pre_pr_gate.py, <path> is valid JSON: {"passed": bool, "exit_code": int, "target": str, "root": str}.

4. Failure handling

  • Report with evidence. Relay the actual failing check names from the output — each step in the chain prints its own [pre-pr] ... label — not a bare "something failed".
  • Never skip, disable, or work around a failing check to force a pass. A check red here would also be red in real CI; fix the underlying cause.
  • Idempotent. Re-running is always safe — every chained step is itself read-only or self-cleaning; no state is left behind for a next run to trip over.

5. Validation gate (before declaring success)

Artifact-producing skill — not done until this exits 0:

python scripts/validate_skill.py --skill . --tier structural,behavioral

6. Examples

Example 1 Input: "Is this branch ready to open a PR?" Output: runs make pre-pr; reports each chained check's pass/fail and an overall verdict, with a fix-and-rerun loop if anything failed.

Example 2 (edge case) Input: --root points at a directory with no Makefile at all (e.g. a misconfigured fixture, or a script run from the wrong working directory). Output: fails closed — a non-zero exit surfacing make's own "no makefile found" error — rather than silently reporting success.


Bundled layout

pre-pr-gate/
├── SKILL.md
├── scripts/
│   ├── run_pre_pr_gate.py   # thin wrapper around `make <target>`; the check list
│   │                        # itself lives in the Makefile, not duplicated here
│   └── validate_skill.py    # vendored copy of skills/common/skill_validator.py
├── tests/
│   └── test_run_pre_pr_gate.py
└── evals/
    ├── evals.json
    └── fixtures/
        ├── passing/Makefile
        ├── failing/Makefile
        └── no-makefile/      # deliberately empty — tests the fails-closed path

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.