hook-gating
Skill10 starsChanged todayMITView on GitHub
Hook gating and pre-tool validation for coding agents and MCP server recognition
In this repository44 other files it gives its agents.
- llms-full.txtllms.txt
- llms.txtllms.txt
- ai-prompt-engineering-safety-reviewSkill
- ast-codemapSkill
- ast-grepSkill
- autoharnessSkill
- autonomous-backlog-driverSkill
- claude-kimi-mcp-normalizationSkill
- cli-self-updaterSkill
- code-frugalitySkill
- codemode-gatewaySkill
- codemode-typesSkill
- consequence-simulationSkill
- context-pruningSkill
- github-update-checkerSkill
- google-agents-cli-evalSkill
- google-agents-cli-scaffoldSkill
- history-searchSkill
- hybrid-semantic-searchSkill
- kimi-code-agent-integrationSkill
- kimi-mcp-configurationSkill
- leann-vectorSkill
- log-summarizerSkill
- markdown-vagueSkill
- memory-reconciliationSkill
- mode-classificationSkill
- multiagent-orchestrationSkill
- output-compressionSkill
- prompt-injectionSkill
- python-anti-patternsSkill
- regression-sentinelSkill
- restart-trackingSkill
- rollback-guardSkill
- rust-call-graphSkill
- secrets-managementSkill
- security-best-practicesSkill
- session-compactorSkill
- sqlite-memorySkill
- swarm-barrierSkill
- swarm-dagSkill
- autoharnessSkill
- code-reliability-checksSkill
- skill-threat-rulesSkill
- autoharnessSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use when validating agent session hooks, managing pre-tool gates, and recognizing already-installed user-level or project-level MCP servers.
- Very specific: line 17
Check if an MCP server named in --domains is already in the installed server set.
- Very specific: line 19
Check against all installed servers so that existing user MCP servers (e.g.
- Very specific: line 25
Run pytest test cases verifying that writing args.json during pending state is permitted.
- Distinctive: line 26
Verify that an already configured MCP server in user/global settings satisfies domain requirements.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
hook-gating
When to use
Use when validating agent session hooks, managing pre-tool gates, and recognizing already-installed user-level or project-level MCP servers.
Steps
- Discover active and configured MCP servers:
- Query project-level MCP config (
project.agent.mcp_store(root)). - Query user-level global MCP config (
project.agent.user_mcp_store()), including.claude.jsonand.gemini/config/mcp_config.json. - Aggregate with kept MCP servers and builtin servers.
- Query project-level MCP config (
- In domain coverage checks (
_check_domains):- Check if an MCP server named in
--domainsis already in the installed server set. If so, treat it as valid coverage without demanding external registry searches.
- Check if an MCP server named in
- In post-brief pre-tool gate (
_skills_not_installed):- Check against all installed servers so that existing user MCP servers (e.g.
github,playwright) do not trigger spurious installation blockers.
- Check against all installed servers so that existing user MCP servers (e.g.
- In pending brief hook gate:
- Permit writing arguments files (
args.json,brief.json,*.args.json,*.brief.json) so agents can record briefs using--args-filewithout being deadlocked. - Exempt args files from
_writes_recordsdenial.
- Permit writing arguments files (
How to verify
- Run pytest test cases verifying that writing
args.jsonduring pending state is permitted. - Verify that an already configured MCP server in user/global settings satisfies domain requirements.
Facts found here
- Claude Code user MCP configuration resides in
~/.claude.jsonundermcpServers(source: https://modelcontextprotocol.io/). - Antigravity CLI user MCP configuration resides in
~/.gemini/config/mcp_config.jsonundermcpServers.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

