Package gate.cat as a native Claude Code plugin (/plugin marketplace add) - #28
Open
BGMLAI wants to merge 3 commits into
Open
Package gate.cat as a native Claude Code plugin (/plugin marketplace add)#28BGMLAI wants to merge 3 commits into
BGMLAI wants to merge 3 commits into
Conversation
Raw page_view fires on SPA fallback for any probed path (/impressum, /alternatives, /free-trial ...), inflating the real-human funnel ~4x (79 raw -> 19 landing-only today). Report landing_page_views (referer=/) so the STOP/PIVOT tripwire reads qualified traffic, not bot enumeration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a Claude Code marketplace + plugin manifest so users can install the
veto with:
/plugin marketplace add BGMLAI/gate.cat
/plugin install gate-cat@gate-cat
instead of hand-editing .claude/settings.json. The plugin wires the SAME
engine (gatecat.hooks.claude_code) as the gatecat-hook console script into a
PreToolUse hook matching Bash|Write|Edit.
Frictionless install: the (zero-dependency) engine is fetched into a
plugin-managed venv on SessionStart, so `/plugin install` alone is enough.
Fail-closed throughout: if the engine can't be resolved, the PreToolUse hook
BLOCKS (exit 2) rather than waving the action through.
Files:
- .claude-plugin/marketplace.json single-plugin marketplace (source "./")
- .claude-plugin/plugin.json plugin manifest -> hooks/hooks.json
- hooks/hooks.json SessionStart bootstrap + PreToolUse veto
- hooks/gatecat-python.sh cross-platform py>=3.10 resolver
(adapted from claude-plugins-official
security-guidance: Win Store stub, cygpath,
PEP 540 UTF-8)
- hooks/gatecat_bootstrap.py idempotent SessionStart engine install
- hooks/gatecat_veto_hook.py PreToolUse launcher -> packaged engine
- README one-command install section
Tested locally (engine via plugin venv): safe Bash/Write/git-status -> exit 0;
rm -rf under protected root -> DELETE_ANALYZER exit 2; git force-push ->
GIT_FORCE_PUSH exit 2; mkfs /dev/sda1 -> DISK_DESTROY exit 2. Bootstrap builds
the venv + pip-installs gate.cat and no-ops when the engine already imports.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
Merged |
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.
What
Makes gate.cat installable as a native Claude Code plugin, so users onboard with:
instead of
pip install+ hand-editing.claude/settings.json. This is the exact-ICP distribution channel: everyone who installs a Claude Code plugin is, by definition, running an AI coding agent — the audience the veto is for. It also unblocks submission to Claude-Code-plugin registries/awesome-lists that require the tool to be packaged as a plugin.How
Mirrors the proven
claude-plugins-official/security-guidancepattern (also a Python-backed PreToolUse security hook). No engine is reimplemented — the plugin wires the samegatecat.hooks.claude_codeengine as thegatecat-hookconsole script..claude-plugin/marketplace.json— single-plugin marketplace,source: "./".claude-plugin/plugin.json— manifest →hooks/hooks.jsonhooks/hooks.json—SessionStartbootstrap +PreToolUseveto (Bash|Write|Edit)hooks/gatecat-python.sh— cross-platform Python ≥3.10 resolver (Windows Store-stub skip,cygpath, PEP 540 UTF-8), adapted fromsecurity-guidancehooks/gatecat_bootstrap.py— idempotent SessionStart install of the (zero-dependency) engine into a plugin-managed venvhooks/gatecat_veto_hook.py— PreToolUse launcher → packaged engine, fail-closed if the engine can't be resolvedFrictionless:
/plugin installalone is enough — the engine is fetched on the nextSessionStart. Fail-closed throughout: if the engine can't load, the action is BLOCKED (exit 2), never waved through.Tested (locally, engine resolved via the plugin venv)
Bash: ls -laWritenormal file /Bash: git statusBash: rm -rf <protected>DELETE_ANALYZERexit 2Bash: git push --forceGIT_FORCE_PUSHexit 2Bash: mkfs.ext4 /dev/sda1DISK_DESTROYexit 2Bootstrap verified to build the venv +
pip install gate.cat, and to no-op when the engine already imports. All three JSON manifests validate.Needs a human 2-min smoke test before merge
This session can't drive the interactive
/pluginUI. Before merging, in a real Claude Code session run/plugin marketplace add BGMLAI/gate.cat→/plugin install gate-cat@gate-cat, start a fresh session (SessionStart bootstrap runs), and confirmrm -rf ~/throwaway-under-homeis blocked.Additive and reversible — no changes to the published product or the live site.