Guardrail v1.0.0
review-chain
Blocks the PR skill until code-review, ponytail-review and comment-cleanup have run in the session.
Install
/plugin install review-chain --marketplace rezk2ll/skills What it does
Blocks the pr skill until three review skills have run in the current session: code-review, ponytail-review and comment-cleanup. The refusal comes before Claude drafts a PR body, not at gh pr create.
When to use it
- You want every PR Claude opens to go through the same review steps.
- You keep forgetting to run the review before asking for a PR.
- You run subagents that open PRs and want each one to review its own diff.
How it works
- A
PostToolUsehook onSkilland aUserPromptSubmithook record each review skill as it runs, whether Claude calls it or you type/code-review. - A
PreToolUsehook onSkilldenies the gated skill while any step of the chain is missing, and names the missing steps. - State is per session. A subagent keeps its own chain, so a review in the parent does not count for the subagent.
- Plugin prefixes are ignored:
code-review:code-reviewcounts ascode-review.
Configuration
REVIEW_CHAIN_GATED_SKILL: the skill to block. Defaultpr.REVIEW_CHAIN_REQUIRED: space separated skills that must run first, in the order you want them run. Defaultcode-review ponytail-review comment-cleanup.REVIEW_CHAIN_DOCS: skills recorded for docs only PRs. Defaulthumanizer. Only thepre-ship-gateplugin reads this.REVIEW_CHAIN_DIR: where the per session record lives. Default${TMPDIR:-/tmp}/claude-review-chain.
There is no override token. To skip the chain, run the skills or change REVIEW_CHAIN_REQUIRED.
Requirements
jq.- The skills in the default chain, each from a public plugin:
code-reviewfromcode-review@claude-plugins-officialponytail-reviewfrom the ponytail plugin (DietrichGebert/ponytail)comment-cleanupandprfrom this repo
- With a different chain, install whatever provides the skills you name instead.
Source
{
"hooks": {
"PreToolUse": [
{ "matcher": "Skill", "hooks": [ { "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/chain-before-pr.sh", "timeout": 10 } ] }
],
"PostToolUse": [
{ "matcher": "Skill", "hooks": [ { "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/review-chain-mark.sh", "timeout": 5 } ] }
],
"UserPromptSubmit": [
{ "hooks": [ { "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/review-chain-mark.sh", "timeout": 5 } ] }
]
}
}