th-44bace: smooth-agent plugin ships shared repo guardrail hooks#185
Merged
Conversation
Each SmooAI repo hand-copied identical .claude/hooks/ guardrails that drifted: smooth had th-curl-hint but smooai didn't, smooai had a repo- name-substituted enforce-worktree, and smooblue had no guardrails at all. Move them into the smooth-agent marketplace plugin as one source of truth, genericized so the same scripts guard any SmooAI repo — the main worktree, its parent, and the repo name are derived from `git worktree list` at runtime instead of being hardcoded per repo: - enforce-worktree.sh PreToolUse Edit|Write|Bash - session-worktree-warning.sh SessionStart startup - th-curl-hint.sh PreToolUse Bash - enforce-pearls-labels.sh PostToolUse Bash Wired in hooks/hooks.json; plugin bumped 0.1.0 -> 0.2.0. Repos enable via enabledPlugins and drop their local copies in follow-up per-repo changes (the SessionStart pearls-workflow context stays global via `th prime`). Verified: 8/8 direct script tests across smooth + smooai contexts (edit-on- main asks, .claude bypass, feature-worktree allow, git-commit ask, git -C worktree allow, non-git safe default, repo name in messages), th-curl-hint + enforce-pearls-labels smoke tests, all plugin JSON valid. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zP7baF7SHR89bPftsX1kp
🦋 Changeset detectedLatest commit: 048ee16 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
brentrager
added a commit
that referenced
this pull request
Jul 11, 2026
Enable smooth-agent@smooth via enabledPlugins + extraKnownMarketplaces and delete the local .claude/hooks/ copies (enforce-worktree, th-curl-hint, enforce-pearls-labels) — the plugin now provides them (PR #185), genericized so one source of truth guards every SmooAI repo. The SessionStart worktree warning moves to the plugin's session-worktree-warning.sh; the pearls-workflow context stays global via th prime. Claude-Session: https://claude.ai/code/session_015zP7baF7SHR89bPftsX1kp Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Each SmooAI repo hand-copies identical
.claude/hooks/guardrails, and they've drifted:th-curl-hint.sh; smooai doesn't.enforce-worktree.shis the same logic withsmooaipaths substituted in..claude/settings.jsonand no guardrails at all.Fix (Phase 1 — the plugin)
Move the shared guardrails into the
smooth-agentmarketplace plugin as one source of truth, genericized so the same scripts guard any SmooAI repo — the main worktree, its parent, and the repo name are derived fromgit worktree list --porcelainat runtime instead of being hardcoded:enforce-worktree.shsession-worktree-warning.shth-curl-hint.shenforce-pearls-labels.shWired in
hooks/hooks.json; plugin bumped 0.1.0 → 0.2.0. The SessionStart pearls-workflow context stays global viath prime(already one source of truth — untouched).Verification
Direct script tests, 8/8 across smooth + smooai contexts: edit-source-on-main asks,
.claude/bypass, feature-worktree allow,git commiton main asks,git -C <worktree>commit allows, non-git dir safe-defaults to allow, and the repo name is correctly substituted in messages (smooth vs smooai).th-curl-hint+enforce-pearls-labelssmoke-tested; all plugin JSON valid.Follow-up (Phase 2 — per-repo cutover, after this lands + marketplace refresh)
Each repo (smooth, smooai, smooblue) enables
smooth-agent@smoothviaenabledPlugins+extraKnownMarketplacesand deletes its local.claude/hooks/copies. Done only after verifying the live plugin fires, so no repo is left unguarded.🤖 Generated with Claude Code
https://claude.ai/code/session_015zP7baF7SHR89bPftsX1kp