Skip to content

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

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-hook entries in every clone of this repository from one committed lefthook remotes: entry, so each machine gets the same hooks from lefthook install and picks up upstream fixes automatically:

  • commit-msg-convention (commit-msg): the subject against the rule in 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.

Fix

  • lefthook.yml (new; the repository had no hook manager): one remotes: entry, git_url: https://github.com/melodic-software/claude-code-plugins, ref: main, refetch_frequency: 24h, config plugins/guardrails/git-hooks/lefthook-remote.yml.
  • That is the whole diff against main. The earlier revision of this PR vendored copies under .githooks/guardrails/ and added a .claude/source-control.md carrying subject_pattern; both are gone. The subject rule now comes from the standards-synced commit-convention.yml.
  • No other changes kept.

Verification

  • install.mjs verify --repo <worktree> (rc 0):
    ok	commit-msg-convention
    ok	pre-commit-content
    ok	reference-verify
    
  • install.mjs plan --scope remote afterwards: no decisions left.
  • lefthook install: sync hooks: ✔️(pre-push, commit-msg, pre-commit). This PR's commit ran the remote pre-commit-content (0.04 s) and commit-msg-convention (0.04 s), and its push ran reference-verify.

Observation runs from the earlier revision, still valid because the remote runs the same hook scripts:

Hook Observation Findings Classification
reference-verify pre-push replay of origin/main~100..origin/main (102 commits in all), 20 changed files, 5 of them .md/.sh, 0.5 s 0 none
pre-commit-content each of the last 100 non-merge commits replayed into the index (179 staged paths in all, no replay empty), 7 s total 0 none
commit-msg-convention subject rule tested against all 102 subjects on main 1 non-matching: Initial commit narrowly justified exception: the repository's root commit, written before the convention; no later subject misses

Related

🤖 Generated with Claude Code

… jobs

Commit the guardrails plugin's commit-msg-convention, pre-commit-content
and reference-verify entries as lefthook jobs over plugin-owned copies in
.githooks/guardrails/ (guardrails 0.55.4), and the subject_pattern they
enforce in .claude/source-control.md, so every clone gets them from
lefthook install instead of per-machine hook settings.

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 16:50
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

claude-review reviewed 04e624b7ac6b20aff766f74af3303679d8402238: 0 finding(s), 0 as inline comments.

No findings. I reviewed the single changed file, lefthook.yml, which is new and adds one remotes: entry for the claude-code-plugins guardrails config. I read the diff and the PR context; I did not run lefthook or the hooks.

  • Subject rule: docs/conventions/source-control/commit-convention.yml, which the PR says the commit-msg hook reads, exists in the repo.
  • Existing hooks: The repo had no lefthook, husky or .githooks config before this change, so nothing is duplicated or replaced.
  • Closing issue: The PR uses the "No related issue: …" escape, so there are no acceptance criteria to check.
  • PR body shape: The body has the required ## Summary, ## Fix, ## Verification and ## Related sections. The verification output and replay observations in the body are the author's own claims; I did not confirm them.
  • Manifests: No plugin manifests changed.
  • Hold: None. The change adds no model or API spend and touches none of the trust-gate files.
  • Floating ref: main (not raised as a finding): The remote uses ref: main with a 24h refetch, so hook scripts from another repository run in every clone. The PR states this is intended (upstream fixes arrive automatically). Whether that trust link is acceptable is a security-lane question, so I did not raise it here.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

claude-security-review reviewed 04e624b7ac6b20aff766f74af3303679d8402238: 1 finding(s), 1 as inline comments.

Security review: PR #108 (head 04e624b)

The PR diff is one new file, lefthook.yml. It adds a lefthook remotes: entry for melodic-software/claude-code-plugins at ref: main, refetched every 24h. The rest of the HEAD commit's stat (workflows, .claude/settings.json, bootstrap scripts and so on) is not in the PR diff, so I did not review it.

critical-findings: 0

Findings (1)

  • SUGGESTION lefthook.yml L2-3: the remote tracks the moving branch main.
    • Lefthook runs whatever plugins/guardrails/git-hooks/lefthook-remote.yml defines on every contributor's machine, and the vendored hook copies this replaces were reviewed in this repo.
    • Exploit path: a bad push to main in claude-code-plugins (a compromised account or a malicious merged PR) runs arbitrary commands on contributor machines at their next commit, with no review here.
    • Recommendation: pin ref to a tag or commit SHA and bump it through a reviewed PR. Dependabot can't bump a lefthook remote, so that bump is manual.
    • The remote is a first-party org repo, so this is low severity and does not hold the merge.

No manifest fields are touched, so there are no manifest <field> lines. The diff has no instruction-surface deletions and no trust-gate paths, so hold does not apply. The instruction exception register was not consulted because the diff removes no standing instructions.

@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: 40581c4daa

ℹ️ 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
@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:06:09.798575Z 04e624b 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.

kyle-sexton and others added 2 commits October 24, 2026 00:04
…lugins lefthook remote

Replace the vendored .githooks/guardrails/ copies, their lefthook jobs and
the lint exclusions they needed with one lefthook remotes: entry pointing at
melodic-software/claude-code-plugins (ref main, refetched every 24h). The
commit subject rule comes from docs/conventions/source-control/commit-convention.yml,
so .claude/source-control.md keeps no subject_pattern.

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:05
@kyle-sexton
kyle-sexton enabled auto-merge (squash) October 24, 2026 04:05
@kyle-sexton
kyle-sexton merged commit 2bc04d4 into main Oct 24, 2026
13 checks passed
@kyle-sexton
kyle-sexton deleted the chore/guardrails-shared-git-hooks branch October 24, 2026 04:05
Comment thread lefthook.yml
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