gateguard
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).
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-14
- Stars
- ★ 25
- Forks
- 9
01 前言 Front Matter
- name
- gateguard
- owner
- pm
- scope
- common
- status
- active
- version
- 1.0.2
- metadata
- { "type": "process", "triggers": [ "gateguard", "/gateguard", "investigate file", "check before edit", "pre-edit check" ] }
- description
- 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).
- l2_propagate
- true
- last_reviewed
- 1794096000000
- prerequisites
- Bun runtime
03 SKILL.md 正文
Skill: gateguard
Context
GateGuard is a pre-edit quality gate that forces agents to investigate a file before making changes. It ensures agents understand:
- Which files import or depend on the target file
- What data schemas, interfaces, and type definitions the file exports
- Whether the user's instructions impose scope constraints
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
- Before editing any TypeScript, JSON, or configuration file that may be imported by other files
- When a user request involves modifying shared utilities, type definitions, or script infrastructure
- When the agent is unsure whether a change is safe to make without investigating dependencies
- As a pre-check before any architectural modification to workspace scripts, helpers, or registries
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):
- Receive target file path from arguments or user input
- Search for importers: Run
grepfor import patterns referencing the target file's basenamegrep -r "from ['\"].*<basename>['\"]" --include="*.ts" --include="*.js" --include="*.json" --include="*.md" . | grep -v node_modules | grep -v ".git" - Extract schemas: Scan the target file for
interface,type,enum,classexports - Summarize findings (1-3 sentences):
- List importers (if any) and their relationship to the target
- Note any exported schemas that downstream consumers depend on
- Flag any scope constraints from user instructions
- Present to agent: Output summary as
[GATEGUARD] Pre-edit investigation completewith 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
- CONSTITUTION.md §11.2 — GateGuard specification
scripts/hooks/gateguard-fact-force.ts— Hook layer implementation- ADR-0021 — Platform Settings Parity Policy
04 同仓库更多 Skills
discovery
暂无简介
x
暂无简介
root-skill
暂无简介
update-bun-packages
Scans, updates, and upgrades Bun dependencies and packages across the AI workspace (L0) or standalone project (L2/L3) while ensuring lockfile consistency, package.json version bumps, and security compliance. Use when: updating bun dependencies, upgrading packages to @latest, checking outdated packages in workspace or templates.
ui-ux-design-intelligence
Provides comprehensive UI/UX design capabilities including design system creation, component design, visual hierarchy, and user-centered design principles. Use when: building design systems, creating visual designs, designing UI components, or establishing design specifications.
translate
Translation helper for README and documentation files with diff preview and guidance