Skip to content

chore(git-hooks): run the guardrails git hooks from the claude-code-plugins lefthook remote - #148

Merged
kyle-sexton merged 3 commits into
mainfrom
chore/guardrails-shared-git-hooks
Oct 24, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
chore/guardrails-shared-git-hooks

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

No related issue: rolls out the guardrails lefthook remote (claude-code-plugins#9504)

Summary

Runs the guardrails plugin's three git hooks in this repository from one lefthook remotes: entry, so every clone gets the same hooks from lefthook install and they update from claude-code-plugins main every 24 hours, with no vendored copies:

  • commit-msg-convention (commit-msg): the subject against the synced commit convention (docs/conventions/source-control/commit-convention.yml).
  • pre-commit-content (pre-commit): secrets and machine-specific paths on added lines.
  • reference-verify (pre-push): CLI flags, /plugin:skill references and deleted paths on pushed lines.

No plugin component changes, so the plugin documentation preflight in AGENTS.md does not apply; this is repository tooling only.

Fix

  • lefthook.yml (new; the repository had none): one remotes: entry, git_url: https://github.com/melodic-software/claude-code-plugins, ref: main, refetch_frequency: 24h, configs: [plugins/guardrails/git-hooks/lefthook-remote.yml], from install.mjs plan --scope remote.
  • Nothing else differs from main: the earlier vendored .githooks/guardrails/ copies, their lefthook jobs, the README layout lines and the .claude/source-control.md subject_pattern are gone (the synced commit convention supplies the pattern).
  • Installer no-ci-rerun decision: no CI workflow here runs jq/reference-verify, so a commit pushed without the hook is not re-checked in CI.

Verification

install.mjs verify --repo <worktree> after lefthook install (rc 0):

ok	commit-msg-convention
ok	pre-commit-content
ok	reference-verify

A second plan --scope remote returns no lefthook-config or migrate decision. This PR's commit ran the remote commit-msg and pre-commit hooks and the push ran guardrails-remote-reference-verify.

Observation runs against this repository's history in report-only mode, before blocking (the remote serves the same hook scripts, so this evidence holds):

Hook Observation Findings Classification
reference-verify pre-push replay of origin/main~137..origin/main (whole history, 138 commits), 35 changed .md/.sh/.ps1 files, 3 s 0 none; largest scanned file is 46,507 bytes, under the 128 KiB argument limit
pre-commit-content each of the last 100 non-merge commits replayed into the index (1 to 15 staged files each, that commit's own), 14 s total 1 commit (09e5a79, #119) narrowly justified exception: validate-marketplace.test.mjs:773 feeds C:\Users\alice\plugin to the validator as test input it must reject. Current content is clean; a future edit of that line would block. Repo-side exemption list tracked as item 5 of claude-code-plugins#9426
commit-msg-convention subject pattern tested against all 138 subjects on main 1 non-matching: Initial commit narrowly justified exception: the repository's root commit, historical only

Related

🤖 Generated with Claude Code

… jobs

Commit the guardrails plugin's three git-hook entries (commit-msg-convention,
pre-commit-content, reference-verify) as shared lefthook jobs so every clone
gets them from `lefthook install`, and record the subject_pattern they
enforce in .claude/source-control.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 23, 2026 17:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T04:04:42.878189Z 7db6dee Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

claude-review reviewed 7db6deeddaf499e2ad8455d46c8f74baf74b838a: 0 finding(s), 0 as inline comments.

No code-review findings on PR #148 (lefthook.yml, 6 lines, new file).

  • The change is a single lefthook remotes: entry pointing at melodic-software/claude-code-plugins, ref: main, refetch_frequency: 24h, with configs: [plugins/guardrails/git-hooks/lefthook-remote.yml]. I found no correctness, error-handling or maintainability defect in it.
  • Closing issue: none. The PR states "No related issue", so there are no acceptance criteria to check.
  • Plugin manifests: the diff touches none, so no manifest <field> lines apply.
  • Path-scoped rules: .claude/rules/pr-body-contract.md has no paths: glob matching this file. The PR body follows its contract.
  • The PR's claim that the AGENTS.md documentation preflight doesn't apply is consistent with the diff, which is repository tooling only.
  • Everything in the Verification section (install.mjs verify output, history-replay observations) is author-claimed. I did not run it and did not treat it as independently confirmed.
  • Left to the security lane: the config follows a moving ref: main with a 24h refetch, so hook code from another repository runs on contributors' machines without a pinned revision. The PR chose this deliberately to avoid vendored copies. Whether it needs a pinned SHA is a supply-chain and trust-boundary question, not a code-review defect.
  • Hold for a person: none. The diff adds no model spend and doesn't touch the trusted-actors files, CODEOWNERS, or .gitmodules.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

claude-security-review reviewed 7db6deeddaf499e2ad8455d46c8f74baf74b838a: 0 finding(s), 0 as inline comments.

Security review skipped under skip-gate item 1: PR #148 is already MERGED, so it is not open. I posted nothing.

The skip gate says to stop early here, so I did not do a deep review. The diff is small, and I read it:

  • It adds one file, lefthook.yml, which declares a lefthook remote. The remote is melodic-software/claude-code-plugins, ref: main, refetch_frequency: 24h, config plugins/guardrails/git-hooks/lefthook-remote.yml.
  • The remote is a mutable main ref in a same-org repository, with no commit pin. Hook commands that land on that ref run on contributors' machines at git-hook time. The trust sits in that repository's branch protection and review. This diff has no concrete exploit path of its own.
  • Informational only, not counted as a finding: pinning ref to a tag or SHA would remove the mutable-ref dependency, if the owner wants that.

No plugin manifests or instruction-surface files changed. No trust-gate paths were touched.

critical-findings: 0

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19986dfd02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .githooks/guardrails/reference-verify.sh Outdated
Comment thread .githooks/guardrails/skill-reference-verify.sh Outdated
kyle-sexton and others added 2 commits October 24, 2026 00:00
…lugins lefthook remote

Replace the vendored hook copies under .githooks/guardrails/ with one
lefthook remotes: entry that fetches plugins/guardrails/git-hooks/lefthook-remote.yml
from melodic-software/claude-code-plugins (ref main, refetched every 24h).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton kyle-sexton changed the title chore(git-hooks): install the guardrails git hooks as shared lefthook jobs chore(git-hooks): run the guardrails git hooks from the claude-code-plugins lefthook remote Oct 24, 2026
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 24, 2026 04:01
@kyle-sexton
kyle-sexton enabled auto-merge (squash) October 24, 2026 04:01
@kyle-sexton
kyle-sexton merged commit 56846d5 into main Oct 24, 2026
15 of 16 checks passed
@kyle-sexton
kyle-sexton deleted the chore/guardrails-shared-git-hooks branch October 24, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant