gateguard
यह क्या करती है
GateGuard एक checker है जो AI को संदर्भ (context) समझे बिना code फ़ाइलें बदलने या नई फ़ाइलें बनाने से रोकता है। बदलाव की इजाज़त देने से पहले यह AI के लिए ज़रूरी जानकारी पेश करना अनिवार्य कर देता है।
कब इस्तेमाल करें
- ✓ऐसे code projects पर काम करते समय जिनमें बहुत सारी आपस में जुड़ी फ़ाइलें हों।
- ✓जब AI से बना code किसी खास pattern को मानना ज़रूरी हो।
- ✓ऐसे projects पर जिनमें data files हों, जिनका format या structure तय हो।
Skill का लिंक
https://github.com/affaan-m/ECC/blob/main/skills/gateguard/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“'utils.js' फ़ाइल में बदलाव करने से पहले कृपया ये तथ्य पेश करो: इस फ़ाइल को import करने वाली सभी फ़ाइलों की सूची दो, इस बदलाव से प्रभावित होने वाले सभी public functions बताओ, इस फ़ाइल द्वारा पढ़ी या लिखी जाने वाली data files का structure दिखाओ, और यूज़र का मूल निर्देश हूबहू उद्धृत करो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
जब AI किसी फ़ाइल को बदलने या बनाने की कोशिश करता है, तो GateGuard पहले उस काम को रोक देता है। फिर वह AI को कहता है कि code और data के बारे में खास जानकारी इकट्ठा करे। सिर्फ़ तब, जब AI यह जानकारी पेश कर देता है, वह दोबारा कोशिश कर सकता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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:
| Task | Gated | Ungated | Gap |
|---|---|---|---|
| Analytics module | 8.0/10 | 6.5/10 | +1.5 |
| Webhook validator | 10.0/10 | 7.0/10 | +3.0 |
| Average | 9.0 | 6.75 | +2.25 |
Both agents produce code that runs and passes tests. The difference is design depth.
Gate Types
Edit / MultiEdit Gate (first edit per file)
MultiEdit is handled identically — each file in the batch is gated individually;
entries without their own file_path are gated as the call's file_path.
NotebookEdit is gated as an Edit of its notebook_path: same class, checked
key, credit and cap rules, the full questions (the cell change is not read),
and never a comment-only pass.
The questions depend on the target's class (see Questions by target class). For code targets the Edit gate asks:
Before editing {file_path}, present these facts:
1. List ALL files that import/require this file (search the tree — Glob/Grep, or find/grep via Bash)
2. List the public functions/classes affected by this change
3. If this file reads/writes data files, show field names, structure,
and date format (use redacted or synthetic values, not raw production data)
4. Quote the user's current instruction verbatim
These four are the full set, asked whenever the change cannot be read with confidence. When it can (see Questions fit the change), an edit that touches no public declaration asks instead for the call sites in the file or its module that rely on the changed behaviour, and item 3 is dropped when the change handles no data.
Write Gate (first new file creation)
For code targets the Write gate asks:
Before creating {file_path}, present these facts:
1. Name the file(s) and line(s) that will call this new file
2. Confirm no existing file serves the same purpose (search the tree — Glob/Grep, or find/grep via Bash)
3. If this file reads/writes data files, show field names, structure,
and date format (use redacted or synthetic values, not raw production data)
4. Quote the user's current instruction verbatim
Item 3 is dropped when the new content handles no data.
Questions fit the change
For code targets the gate reads the change it is about to allow (Edit
old_string/new_string, every MultiEdit entry for the file, Write
content) and decides three things:
- Public surface: a line on either side declares or exposes a public name.
JS/TS:
export,exports,public,declare(.d.tsfiles always); Python:def/classnot starting with_, dunders,__all__, a module-level public assignment such asBASE_URL = ...(__init__.pyalways); Go: capitalisedfunc/type/var/constnames,package, lines starting with a capital; Rust:pub,impl,trait,extern,#[macro_export],#[derive],#[repr],#[no_mangle]; shell: function definitions,export,declare -x; PowerShell:function,filter,param,Export-ModuleMember,[CmdletBinding. A member of an exported container counts too, judged from the file: lines inside an exported interface, enum, type, object or export list, member declarations of an exported class,__all__entries, public class attributes and dataclass fields, and members
…
अक्सर पूछे जाने वाले सवाल
AI को तथ्य पेश करने की ज़रूरत क्यों है?
AI अंदाज़े से लगाकर गलतियाँ कर सकता है। तथ्य माँगने से पक्का होता है कि वह अपने कदमों के असर को समझता है, जिससे code ज़्यादा सुरक्षित और बेहतर बनता है।
AI को किस तरह की जानकारी पेश करनी होती है?
यह फ़ाइल के प्रकार और बदलाव पर निर्भर करता है। आम तौर पर इसमें यह शामिल होता है कि बदली जा रही फ़ाइल को कौन-सी दूसरी फ़ाइलें इस्तेमाल करती हैं, code के कौन-से public हिस्से प्रभावित होंगे, और इसमें शामिल data files की जानकारी।
क्या GateGuard AI को काम करने से रोक देता है?
नहीं, यह बस यह पक्का करता है कि AI ज़्यादा समझदारी और सुरक्षा से काम करे, खासकर code के अहम हिस्सों पर, क्योंकि उसे कदम उठाने से पहले सोचना पड़ता है।
जानकारी
लेखक का मूल विवरण
PreToolUse fact-forcing gate that denies the first Edit/Write/Bash (including MultiEdit and NotebookEdit) attempt until the agent presents concrete facts (importers, data schemas, verbatim user instruction), then allows retry; A/B-tested at +2.25 quality points. Use when enabling or configuring the GateGuard hook, exempting paths via env vars, or handling first-touch denials.
repo: affaan-m/ECC
लोकप्रियता
- GitHub स्टार
- 280k
- रैंकिंग में स्थान
- #320
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
accessibility
280kयह आपके एजेंट को ऐसे इंटरफ़ेस बनाने में मदद करता है जिन्हें हर कोई इस्तेमाल कर सके। यह पक्का करता है कि वेबसाइट और ऐप दिव्यांग लोगों के लिए भी अच्छे से काम करें, जैसे नेत्रहीन या जिन्हें चलने-फिरने में दिक्कत होती है।
agent-architecture-audit
280kयह आपके एजेंट को जाँचने देता है कि सब कुछ सही से चल रहा है। यह AI सिस्टम में समस्याएँ ढूँढकर ठीक करता है, ताकि वे उम्मीद के मुताबिक काम करें।
agent-eval
280kयह आपके एजेंट को अलग-अलग AI coding tools की तुलना करने में मदद करता है। यह मापता है कि किसी खास काम के लिए कौन सा टूल ज़्यादा तेज़, सस्ता और भरोसेमंद है।
agent-harness-construction
280kयह आपके एजेंट को काम कैसे करना है, यह बेहतर समझने में मदद करता है। यह उन tools और instructions को बेहतर बनाता है जिनका एजेंट इस्तेमाल करता है, ताकि उसकी सफलता की संभावना बढ़े।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।