- Home
- Skills
- Agents & Orchestration
- Rules Gate Starter for Coding Agents
Rules Gate Starter for Coding Agents
A Yes, No, Ask me first rules file with a tested checker and a Claude Code hook. Same rules, same answer.
$50
Works with the AI Agents you already use
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
| Action | Answer | Rule | Exit code |
|---|---|---|---|
git push origin main | No | no-push-main | 2 |
rm -rf build | No | no-destructive-delete | 2 |
Read app/.env | No | no-secret-files | 2 |
pip install requests | Ask me first | ask-install | 3 |
Write src/app.py | Ask me first | ask-write | 3 |
git status | Yes | yes-git-look | 0 |
git status && curl http://x.invalid | Ask me first | ask-chained-command | 3 |
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
- Review the rules and edit any you disagree with. Run
validateagain after each edit. - The agent offers the Claude Code hook. It adds it to
.claude/settings.jsononly if you say yes. Without the hook, the rules file does nothing. - Test the hook in a live session: ask the agent to run
git push origin mainand confirm it is blocked with the rule id. Then ask forgit statusand 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
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.