Skip to content
affaan-m avatar

Gateguard

Fact-forcing PreToolUse gate that blocks first edits until the agent presents concrete investigation facts.

CCM score
63 of 100
skills.sh installs
10.1K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers Edit, Write, Bash, MultiEdit, and NotebookEdit, gating the first attempt per file until facts are presented
  • Asks for importers, public API surface, data schemas, and the user's instruction quoted verbatim, scaled to the change
  • Classifies targets by class (code, instruction, test, and others) so questions fit the file rather than applying one checklist
  • Designed for codebases where edits affect multiple modules and AI-generated changes must match existing patterns

Install

$ npx -y skills add affaan-m/ecc --skill gateguard -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

GateGuard — Fact-Forcing Pre-Action Gate

A PreToolUse hook that forces Claude to investigate before editing. Instead of self-evaluation ("are you sure?"), it demands concrete facts. The act of investigation creates awareness that self-evaluation never did.

When to Activate

  • Working on any codebase where file edits affect multiple modules
  • Projects with data files that have specific schemas or date formats
  • Teams where AI-generated code must match existing patterns
  • Any workflow where Claude tends to guess instead of investigating

Core Concept

LLM self-evaluation doesn't work. Ask "did you violate any policies?" and the answer is always "no." This is verified experimentally.

But asking "list every file that imports this module" forces the LLM to run Grep and Read. The investigation itself creates context that changes the output.

Three-stage gate:

1. DENY  — block the first Edit/Write/Bash attempt
2. FORCE — tell the model exactly which facts to gather
3. ALLOW — permit retry after facts are presented

No competitor does all three. Most stop at deny.

Evidence

Two independent A/B tests, identical agents, same task:

Details

Repository
github.com/affaan-m/ecc
Categories
Agent Workflow & Planning, Code Review & Quality
First seen
Jul 14, 2026

Questions

What does the gateguard skill do before Claude edits files?

GateGuard is a PreToolUse hook that denies the first Edit, Write or Bash attempt until the agent presents concrete facts such as importers, data schemas and the user's verbatim instruction. Once those facts are shown, it allows the retry, which the skill's own tests found improved design depth by about 2.25 points.

How do I install the gateguard skill?

Run npx -y skills add affaan-m/ecc --skill gateguard -y inside your project. That installs the skill from the affaan-m/ecc repository so the GateGuard gate is available to your agent.

Which other skills is gateguard compared with in Agent Workflow & Planning?

gateguard sits in the Agent Workflow & Planning category alongside grill-me, grill-with-docs, setup-matt-pocock-skills, grilling and prototype. Where those focus on questioning and planning, gateguard sets itself apart by blocking first-touch edits until the agent investigates.

Who should use the gateguard skill?

It suits teams working on codebases where file edits affect multiple modules, projects with data files that have specific schemas or date formats, and workflows where Claude tends to guess instead of investigating. It is also useful when AI-generated code must match existing patterns.

More from affaan-m/ecc

All 257

Similar to Gateguard

More Agent Workflow & Planning