Rules Gate Starter for Coding Agents

    1

    A Yes, No, Ask me first rules file with a tested checker and a Claude Code hook. Same rules, same answer.

    $50

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Rules Gate Starter for Coding Agents

    Example session with this skill installed

    I want rules for this project so an agent cannot push to main, cannot read .env files, and has to ask before installing packages. Set that up and show me it works.

    • Read your context and instructions
    • Compiled the rules gate starter

    Summary

    The agent copied the starter rules to .agent-rules.json, read each rule back in plain words, validated the file, and tested one action per rule. Output below is from running the checker on the starter rules.

    Validate

    $ python3 scripts/gate.py validate --rules .agent-rules.json
    ok: 12 rules
    

    One test per rule

    ActionAnswerRuleExit code
    git push origin mainNono-push-main2
    rm -rf buildNono-destructive-delete2
    Read app/.envNono-secret-files2
    pip install requestsAsk me firstask-install3
    Write src/app.pyAsk me firstask-write3
    git statusYesyes-git-look0
    git status && curl http://x.invalidAsk me firstask-chained-command3

    The last row matters. A safe-looking start cannot hide a second command, because the starter asks about any command that chains, pipes, redirects or spans lines.

    Next steps

    1. Review the rules and edit any you disagree with. Run validate again after each edit.
    2. The agent offers the Claude Code hook. It adds it to .claude/settings.json only if you say yes. Without the hook, the rules file does nothing.
    3. Test the hook in a live session: ask the agent to run git push origin main and confirm it is blocked with the rule id. Then ask for git status and confirm nothing is blocked.

    This is a cooperative check. It only sees what Claude Code sends to the hook, and it is not a sandbox.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Rules kept in an agent's memory get forgotten. This skill puts them in a file that answers every action.

    Three answers: Yes, No, Ask me first. Unclear means ask: no matching rule, a broken rules file or unreadable input never gives Yes. No beats Ask me first, which beats Yes. Same rules and same action give the same answer, because the check is plain code with no model in it.

    You get:

    • a starter rules file (no push to main, no destructive deletes, no secret files, no pipe to shell, ask before installs and pushes, web fetches and writes, ask on chained commands)
    • a checker with a validate command and exit codes 0, 2 and 3 (a crash is answered as Ask me first, never Yes)
    • a Claude Code PreToolUse hook that blocks on No and asks on Ask me first, with setup steps
    • a guided flow: the agent reads each rule in plain words, you edit it, then it tests an example for each rule before you rely on it

    Standard library only. Written for Python 3.10 or later, tested on 3.13 only. 25 tests.

    What it does not do It is cooperative: it only sees what an agent sends to its hook. It is not a sandbox and stops nothing that never asks. Rules match text, so a script written first and run later, or another tool, can get past them. The starter patterns catch common spellings only. There is no not operator. It keeps no logbook. The hook is for Claude Code only.

    Before you use this These skills are new and have not been tested widely. They come from a project that works and that I use. You are responsible for what you run and for reviewing what your agent does with them, so check results before you rely on them. The author is not liable for loss or damage, in line with the MIT licence.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Cooperative only; not a sandbox. No 'not' operator for exceptions. Text matching can be bypassed by obfuscation or variables. No built-in logging of decisions.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed today

    Software
    Git

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Environment Variables

    No network access. The scripts read the GATE_RULES and CLAUDE_PROJECT_DIR environment variables. The skill writes .agent-rules.json, and writes .claude/settings.json only if you agree to add the hook.

    Listedtoday

    What's inside

    Frequently Asked Questions

    A rule in a prompt lives in the agent's memory, and memory slips. These rules live in a file, and a plain-code checker answers every action. Same rules and same action give the same answer. It only covers actions the agent sends to the hook.

    The checker script runs anywhere with Python. The hook is for Claude Code only, and I have tested it with Claude Code only. Another agent could call the checker itself, but I have not tested that.

    The SKILL.md instructions, the checker (gate.py), the Claude Code hook (hook.py), a starter rules file with 12 rules, reference notes and 25 unit tests. Standard library only.

    No beats Ask me first, and Ask me first beats Yes. If no rule matches, or the rules file is broken or unreadable, the answer is Ask me first.

    Copy the starter rules to .agent-rules.json, run the validate command, test an example for each rule, and optionally add the hook to .claude/settings.json. Your agent walks you through it and edits settings only if you say yes.

    No. It is a cooperative check. It only sees what an agent sends to its hook, so a program that never asks is not stopped. Rules match text, so a script written first and run later can get past them. Keep your agent's own permission settings, and use an operating system sandbox for hard limits.

    New in Agents & Orchestration