fix(setup): recognise the agent-guard plugin as a complete install - #1323
Merged
Merged
Conversation
potiuk
force-pushed
the
fix/update-skill-agent-guard-plugin
branch
from
September 21, 2026 15:53
b690ba3 to
0925d3c
Compare
Check 3 of `setup-isolated-setup-update` diffs
`~/.claude/scripts/agent-guard.py` and `~/.claude/scripts/guards.d/`
against the framework, and check 4 looks for an agent-guard
`hooks.PreToolUse` entry in `settings.json`. Neither exists on the
install path the tool's own README calls "the whole installation":
the `magpie-agent-guard` plugin registers the hook from its manifest
and resolves the engine and every skill-owned guard under
`${CLAUDE_PLUGIN_ROOT}`.
A drift run against a working plugin install therefore reports the
guard as missing and sends the operator installing a second copy of
something already running. Observed on an install where the plugin
was enabled and both guards demonstrably fired.
Establish the wiring first: read `enabledPlugins`, and on a plugin
install report the plugin's version against the framework's and any
leftover user-scope copy, rather than the absence of a script that
belongs to the other wiring. Keep the script/`guards.d` diff for the
user-scope path, and give both a behavioural canary — a `git commit`
carrying a `Co-Authored-By:` trailer must be denied — so the check
rests on the guard denying rather than on files being present.
Generated-by: Claude Opus 5
potiuk
force-pushed
the
fix/update-skill-agent-guard-plugin
branch
from
September 21, 2026 16:36
0925d3c to
064d772
Compare
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.
Summary
setup-isolated-setup-updateonly knows the user-scope agent-guard wiring: check 3 diffs~/.claude/scripts/agent-guard.pyand~/.claude/scripts/guards.d/, check 4 looks for an agent-guardhooks.PreToolUseentry insettings.json. Neither exists on the install pathtools/agent-guard/README.mdcalls "the whole installation" — themagpie-agent-guardplugin registers the hook from its manifest and resolves the engine plus every skill-owned guard under${CLAUDE_PLUGIN_ROOT}.magpie-agent-guard@apache-magpieenabled, no script copy, and both guards demonstrably firing.Type of change
.claude/skills/<name>/) — see test plan for why no eval fixturetools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)How it works
Check 3 reads
enabledPluginsfirst. Withmagpie-agent-guard@apache-magpiepresent, the absent script copy is stated to be the expected shape rather than drift, and what gets surfaced instead is the plugin's version against the framework's (refresh is/plugin) plus any leftover user-scope copy from an earlier hand-wiring. The existing script +guards.ddiff is kept verbatim for the non-plugin path. Check 4's agent-guard clause gains the same condition, so asettings.jsonwith no agent-guard hook reads as correct under the plugin.Both paths then share one canary: a
git commitwhose message carries aCo-Authored-By:trailer must be denied by the bundledcommit-trailerguard. A command that goes through means the hook is not firing, whatever the files say — which is the only claim the check is really trying to make.Test plan
prek run --all-filespasses (32 hooks, exit 0).git commitwith aCo-Authored-By:trailer → denied bycommit-trailer; a second commit → denied by the operator's own trailer guard. Under the old text this install reads "agent-guard not installed"; under the new text it reads as correctly wired.RFC-AI-0004 compliance
/pluginare named inside the skill's existing Claude Code branch, after the Codex / Gemini routing has already returned. See the note below about the generated score.Linked issues
None.
Notes for reviewers (optional)
docs/vendor-neutrality.mdshifts one skill from capability-pure (14 → 13) to portable (61 → 62), because the Claude branch now names a Claude plugin id.vendor-coupledstays 0. If you would rather the skill stay capability-pure, the alternative is a generic "the harness may supply the guard from an installed extension" phrasing — less useful, since the operator has to know the exact id to check for.docs/mode-economics.mdmoves because theskill-token-counthook remeasures the skill.allowedDomainsstaleness and the dispatcher hook flavour. Each is its own PR and they do not overlap in the file.🤖 Generated with Claude Code