agentleFS
D-SheyD-Shey/autoharness/.agents/skills/hook-gating/SKILL.md

hook-gating

Skill10 starsChanged todayMITView on GitHub

Hook gating and pre-tool validation for coding agents and MCP server recognition

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
  1. Distinctive:

    Use when validating agent session hooks, managing pre-tool gates, and recognizing already-installed user-level or project-level MCP servers.

    line 9
  2. Very specific:

    Check if an MCP server named in --domains is already in the installed server set.

    line 17
  3. Very specific:

    Check against all installed servers so that existing user MCP servers (e.g.

    line 19
  4. Very specific:

    Run pytest test cases verifying that writing args.json during pending state is permitted.

    line 25
  5. Distinctive:

    Verify that an already configured MCP server in user/global settings satisfies domain requirements.

    line 26

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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.json and .gemini/config/mcp_config.json.
    • Aggregate with kept MCP servers and builtin servers.
  2. In domain coverage checks (_check_domains):
    • Check if an MCP server named in --domains is already in the installed server set. If so, treat it as valid coverage without demanding external registry searches.
  3. 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.
  4. In pending brief hook gate:
    • Permit writing arguments files (args.json, brief.json, *.args.json, *.brief.json) so agents can record briefs using --args-file without being deadlocked.
    • Exempt args files from _writes_records denial.

How to verify

  1. Run pytest test cases verifying that writing args.json during pending state is permitted.
  2. 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.json under mcpServers (source: https://modelcontextprotocol.io/).
  • Antigravity CLI user MCP configuration resides in ~/.gemini/config/mcp_config.json under mcpServers.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.