Skip to content

Package gate.cat as a native Claude Code plugin (/plugin marketplace add) - #28

Open
BGMLAI wants to merge 3 commits into
masterfrom
feat/claude-code-plugin
Open

Package gate.cat as a native Claude Code plugin (/plugin marketplace add)#28
BGMLAI wants to merge 3 commits into
masterfrom
feat/claude-code-plugin

Conversation

@BGMLAI

@BGMLAI BGMLAI commented Jul 30, 2026

Copy link
Copy Markdown
Owner

What

Makes gate.cat installable as a native Claude Code plugin, so users onboard with:

/plugin marketplace add BGMLAI/gate.cat
/plugin install gate-cat@gate-cat

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-guidance pattern (also a Python-backed PreToolUse security hook). No engine is reimplemented — the plugin wires the same gatecat.hooks.claude_code engine as the gatecat-hook console script.

  • .claude-plugin/marketplace.json — single-plugin marketplace, source: "./"
  • .claude-plugin/plugin.json — manifest → hooks/hooks.json
  • hooks/hooks.jsonSessionStart bootstrap + PreToolUse veto (Bash|Write|Edit)
  • hooks/gatecat-python.sh — cross-platform Python ≥3.10 resolver (Windows Store-stub skip, cygpath, PEP 540 UTF-8), adapted from security-guidance
  • hooks/gatecat_bootstrap.py — idempotent SessionStart install of the (zero-dependency) engine into a plugin-managed venv
  • hooks/gatecat_veto_hook.py — PreToolUse launcher → packaged engine, fail-closed if the engine can't be resolved

Frictionless: /plugin install alone is enough — the engine is fetched on the next SessionStart. 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)

Tool call Result
Bash: ls -la ✅ exit 0
Write normal file / Bash: git status ✅ exit 0
Bash: rm -rf <protected> 🛑 DELETE_ANALYZER exit 2
Bash: git push --force 🛑 GIT_FORCE_PUSH exit 2
Bash: mkfs.ext4 /dev/sda1 🛑 DISK_DESTROY exit 2

Bootstrap 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 /plugin UI. 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 confirm rm -rf ~/throwaway-under-home is blocked.

Additive and reversible — no changes to the published product or the live site.

BGMLAI and others added 3 commits July 30, 2026 10:11
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>
@BGMLAI

BGMLAI commented Jul 31, 2026

Copy link
Copy Markdown
Owner Author

Merged master into this branch to pick up the CI fix from 5b46e90 (removed dead Lemon Squeezy ref-capture from the landing page + scoped the cookieless-funnel guard to allow the live gc_ref affiliate cookie). The two test_marketing_consistency failures were stale-landing failures inherited from a pre-fix merge-base, not caused by the plugin packaging. Full suite green locally: 1928 passed, 28 skipped, 0 failed. No conflicts; plugin files untouched. Ready for the 2-min /plugin marketplace add BGMLAI/gate.cat smoke test.

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