pre-pr

Run repository pre-pull-request version, build, and reviewer checks.

2|Updated May 28, 2021
One-click install
npx skills add https://github.com/SpineEventEngine/validation --skill pre-pr-spineeventengine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-pr
Source: https://github.com/SpineEventEngine/validation/tree/main/.agents/skills/pre-pr
Command: npx skills add https://github.com/SpineEventEngine/validation --skill pre-pr-spineeventengine

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents wasted pull-request cycles by running the repository’s required version, build, and reviewer checks locally and producing a clear pass/fail summary before you open the PR.

Core Features & Use Cases

  • Repo-specific orchestration: Detects change scope (proto, code, docs, deps, site) and runs the appropriate build/check command described by the repo’s .agents/running-builds.md.
  • Version gate enforcement (when applicable): Applies the version-bump policy only if version.gradle.kts exists at the repository root, including auto-fix behavior when the bump workflow is present.
  • Reviewer integration + caching: Invokes the relevant reviewers (kotlin-review, review-docs, dependency-audit, check-links) and supports a check-links sentinel cache via .git/check-links.ok.
  • Pass/fail aggregation with a sentinel: Writes .git/pre-pr.ok on success so the gh pr create hook can verify the checklist ran for the current HEAD.

Quick Start

Run the pre-pr skill to execute the version check (if applicable), run the correct build or docs command for your change type, run the relevant reviewers against your branch diff, and write the .git/pre-pr.ok success sentinel.

Frequently Asked Questions about pre-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run all pre-pull-request checks locally before opening a PR?

To run pre-pull-request checks locally, execute the pre-pr skill to detect your change scope, apply version and build commands, dispatch reviewers, and output a pass/fail summary. This prevents wasted PR cycles by validating everything against your base ref beforehand.

What is the best way to automate code review and dependency audits before creating a pull request?

Automating code review and dependency audits before a pull request involves orchestrating reviewers like kotlin-review and dependency-audit against your branch diff. The pre-pr skill aggregates these checks and writes a success sentinel to verify the checklist ran for the current HEAD.

Does the pre-pr version gate check run on all Gradle repositories?

The pre-pr version gate check only runs if `version.gradle.kts` exists at the repository root. For non-versioned Gradle repositories, the skill conditionally skips the version gate and selects fallback build commands per `.agents/running-builds.md`.

How do I enforce repository CI gates and link checking without pushing code?

To enforce repository CI gates and link checking locally, the pre-pr skill runs `./gradlew` checks and utilizes a `check-links` sentinel cache via `.git/check-links.ok`. It respects `.agents/version-policy.md` to ensure all local gates pass before pushing.

Why does my `gh pr create` hook fail even after a successful local Gradle build?

Your `gh pr create` hook may fail because the `.git/pre-pr.ok` sentinel file is missing. This file, containing head, branch, status, and reviewer fields, must be written by the pre-pr skill to verify that all required pre-pull-request checks ran successfully for the current HEAD.

Can I use pre-pr to run docs checks and dependency audits for non-Gradle build tools?

Yes, pre-pr supports non-Gradle build tools by selecting repo-specific fallback commands defined in `.agents/running-builds.md`. It detects your change scope, including docs and deps, and runs the appropriate reviewers like review-docs and dependency-audit against the diff.