Skip to content

fix: wire up enforcement hooks in plugin hooks.json - #56

Merged
accesswatch merged 3 commits into
Community-Access:mainfrom
tesles:hotfix/plugin-hooks-json-entries
Mar 13, 2026
Merged

fix: wire up enforcement hooks in plugin hooks.json#56
accesswatch merged 3 commits into
Community-Access:mainfrom
tesles:hotfix/plugin-hooks-json-entries

Conversation

@tesles

@tesles tesles commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Hotfix: the plugin's hooks/hooks.json was empty ({"hooks": {}}), so marketplace-only installs received zero hook enforcement. The three enforcement scripts existed in scripts/ but were never wired into hooks.json.

This means users who installed via claude plugin install accessibility-agents@community-access got agents, commands, and CLAUDE.md -- but not the edit-gate that blocks UI file edits without accessibility-lead review. The core enforcement guarantee of this plugin was silently missing for marketplace installs.

Problem

PR #48 (marketplace.json) stated in the step-by-step mapping table:

| Register 3 global hooks | Plugin hooks/hooks.json loaded on enable | Covered |

And in the hook enforcement section:

"The plugin already ships hooks/hooks.json with three hook entries and references the enforcement scripts in scripts/."

Both claims were incorrect. hooks.json contained {"hooks": {}}.

Fix

Wire all three enforcement hooks into hooks.json:

Event Matcher Script Timeout
UserPromptSubmit (all prompts) a11y-team-eval.sh 10s
PreToolUse Edit|Write a11y-enforce-edit.sh 10s
PostToolUse Agent a11y-mark-reviewed.sh 5s

All paths use ${CLAUDE_PLUGIN_ROOT} per the official plugin hooks spec.

Verification

  1. Copied updated hooks.json to local plugin cache
  2. Ran /reload-plugins -- hooks loaded (confirmed: 5 hook(s))
  3. Tested in web project directory -- UserPromptSubmit fires accessibility instruction
  4. Tested UI file edit without accessibility-lead -- PreToolUse blocks with deny
  5. Tested post-Agent marker -- PostToolUse creates session marker, subsequent edits allowed

Impact

  • Marketplace installs: Now receive full enforcement (edit-gate + prompt injection + session marker)
  • install.sh installs: No change -- global hooks in ~/.claude/settings.json continue to work independently
  • Both coexist: Users with both install methods get belt-and-suspenders enforcement

Files changed

  • claude-code-plugin/hooks/hooks.json -- added three hook entries (was empty)

The plugin ships three enforcement scripts in scripts/ but hooks.json
was empty, meaning marketplace-only installs got zero hook enforcement.
Users who installed via 'plugin install' received agents, commands, and
CLAUDE.md but not the edit-gate that blocks UI file changes without
accessibility-lead review.

Add all three hooks to hooks.json:
- UserPromptSubmit: a11y-team-eval.sh (web project detection)
- PreToolUse (Edit|Write): a11y-enforce-edit.sh (UI file gate)
- PostToolUse (Agent): a11y-mark-reviewed.sh (session marker)

All paths use ${CLAUDE_PLUGIN_ROOT} per the official plugin hooks spec.

Bump plugin version from 1.0.0 to 3.0.1 to align with the published
3.0.0 release and indicate a patch fix.
@tesles
tesles force-pushed the hotfix/plugin-hooks-json-entries branch from 2dee11a to 864ac55 Compare March 5, 2026 19:24
tesles added 2 commits March 6, 2026 09:23
…son-entries

# Conflicts:
#	claude-code-plugin/.claude-plugin/plugin.json

@accesswatch accesswatch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the hooks.json changes and verified all three target scripts exist on main. The enforce-edit script has proper safety exits (non-UI files pass through, python3 guard, symlink resolution). Patch version bump is appropriate. Safe to merge.

@accesswatch
accesswatch merged commit 3595730 into Community-Access:main Mar 13, 2026
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.

2 participants