Gateguard

From 5throck/ai-workspace-standards · View interactive version

Gateguard is an AI agent skill from the GitHub repository 5throck/ai-workspace-standards. Pre-edit fact-forcing quality gate. Ensures agents investigate a file's importers, schemas, and scope constraints before making changes. Part of the 3-layer enforcement model (Hook → Prompt → Skill).

How to use this skill

Skill file

Skill: gateguard

Context

GateGuard is a pre-edit quality gate that forces agents to investigate a file before making changes. It ensures agents understand:

This is the manual/skill layer of the 3-layer enforcement model. The hook layer (PreToolUse/BeforeTool) provides automatic enforcement on Claude CLI and Gemini CLI. This skill covers manual invocation and Antigravity (where hooks don't fire).

Enforcement Coverage

| Platform | Hook | Prompt | Skill |

|----------|:----:|:------:|:-----:|

| Claude Code CLI | ✅ PreToolUse | ✅ | ✅ |

| Claude Desktop App | ✅* (bundled CLI) | ✅ | ✅ |

| Gemini CLI | ✅ BeforeTool | ✅ | ✅ |

| Antigravity | ❌ | ✅ | ✅ |

\* Claude Desktop App: documented by Anthropic but workspace testing (2026-05) observed intermittent behavior.

When to Use

Output Format

[GATEGUARD] Pre-edit investigation complete
  Target: <file-path>
  Importers: <list of importing files, or "none">
  Exported schemas: <list of interfaces/types/classes, or "none">
  Scope constraints: <user-imposed constraints, or "none">
  Risk level: low | medium | high
  Recommendation: proceed | proceed with caution | escalate to architect

Execution Steps

When invoked (via /gateguard <file-path> or trigger match):

  1. Receive target file path from arguments or user input
  2. Search for importers: Run grep for import patterns referencing the target file's basename

```bash

grep -r "from ['\"].<basename>['\"]" --include=".ts" --include=".js" --include=".json" --include="*.md" . | grep -v node_modules | grep -v ".git"

```

  1. Extract schemas: Scan the target file for interface, type, enum, class exports
  2. Summarize findings (1-3 sentences):
  1. Present to agent: Output summary as [GATEGUARD] Pre-edit investigation complete with findings

Agent Behavior After Investigation

After completing the GateGuard investigation, the agent may proceed with the edit. If importers were found, the agent should verify that changes won't break downstream consumers.

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.