Guardrail v1.0.0
pre-ship-gate
Refuses commits and PRs that mix moves with logic, add dependencies, skip tests or are too big to review.
Install
/plugin install pre-ship-gate --marketplace rezk2ll/skills What it does
Refuses a git commit or gh pr create that a reviewer cannot follow. It catches moves or generated files mixed with logic, new npm dependencies, source changes without tests, and PRs too large to review in one sitting. Each refusal says what to fix.
When to use it
- You want Claude to split mechanical changes from logic changes on its own.
- You want new dependencies justified before they land.
- You want large PRs split into commits with a stated reading order.
How it works
- On
git commitit checks the staged diff. Ongh pr createit checks the branch againstorigin/HEAD(ororigin/main,origin/master,origin/develop). - Mixed change: renamed files or generated files (
dist/,build/,*.min.js,*_pb2.pyand similar) next to source files. Lockfiles do not count, since a dependency bump touches the manifest and its lock together. - New dependency: a key added to
dependenciesordevDependenciesin anypackage.json. - No tests (PR only): a sub-project with a
testscript changed but none of its test files did. - Size (PR only): reviewable lines, without lockfiles, generated files and docs. Over the limit, each commit must stay under it and the PR body must name the reading order.
- Review chain (PR only): with the
review-chainplugin installed, the PR is refused until the review skills ran in this session. Docs only PRs needhumanizerinstead.
Configuration
SHIP_MAX_SEMANTIC_LINES: size limit in reviewable lines. Default400.SHIP_REVIEW_CHAIN:auto(default) enforces the review chain once thereview-chainstate dir exists,1always enforces it,0turns it off.REVIEW_CHAIN_REQUIRED,REVIEW_CHAIN_DOCS,REVIEW_CHAIN_DIR: shared with thereview-chainplugin. Defaultscode-review ponytail-review comment-cleanup,humanizer,${TMPDIR:-/tmp}/claude-review-chain.
Overrides
# ship-override: <reason>: append it to the commit or PR command to ship anyway. The reason stays in the transcript.
Requirements
git,jq, and GNUgrep(the-Pflag reads--bodyfrom the command).- Optional: the
review-chainplugin from this repo for the review chain check, andhumanizer(blader/humanizer) for docs only PRs.
Source
{
"hooks": {
"PreToolUse": [
{
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/pre-ship-gate.sh",
"timeout": 30,
"statusMessage": "Pre-ship gate..."
}
],
"matcher": "Bash"
}
]
}
}