AI-RULES skill
AI-RULES turns a project's architecture rules into a skill and prompts an agent can review code and repair violations against.
- 421 ★ on the repository
- Last commit
Minimal access
Why this level
- The skill reads project code and writes report files; it leaves source untouched during review.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/ai-rulesDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewMinimal accessThe tool runs nothing and makes no network calls.
- The skill reads project code and writes report files; it leaves source untouched during review.
This is third-party code. Review the repository files before installing.
What it does
The `ai-rules` skill in `skills/ai-rules` stores team conventions as Markdown and checks code against them. It initializes rules for real project paths, reviews current changes and writes an `ai-rule-report.json` with file references without modifying source. The separate `ai-law` CLI collects local AST evidence, builds prompts for audit and focused repair (`ai-law audit`, `ai-law fix`) and validates the report. 14 rule templates ship in English and Chinese.
Who it is for. Teams whose AI agents break architecture: network calls inside components, controllers reaching into repositories, missing error-path cleanup.
Good fit when
- The same review comments recur in every pull request and should be written down.
- A merge needs an audit of changes against project rules.
- A finding such as ISSUE-001 goes to an agent for a focused fix.
- One rule set must serve Cursor, Codex and Claude Code.
Not a fit when
- The project has no rules and nobody to write them.
- A strict automated CI check is needed; an agent's review is not equivalent.
- A check is wanted with no agent involved; `ai-law` only prepares prompts and evidence.
Example request
Use ai-rules to review the current changes against project rules and save the report to `ai-rule-report.json`.Limitations
An agent check is not equivalent to CLI validation, as the README states. Paths in `.ai-rules/config.json` must be mapped to your repository by hand. AST evidence and deterministic validation need Node.js 18+ and `ai-law`. The repository lists no license, so confirm usage terms with the author. An agent's report depends on the chosen model and context size, so recheck disputed findings by hand.
How to disable. Delete the skill folder from the agent skills directory and the `.ai-rules` directory from the project. Remove the CLI with `npm uninstall -g ai-law`.
FAQ
Is Node.js required?
Not for the in-chat skill. Node.js 18+ is only needed for the optional `ai-law` CLI.
What does the agent write into the project?
The `ai-rule-report.json` file and the `.ai-rules/cache/skill-review-coverage.json` cache. Source code is untouched during review.
How is the CLI installed?
With `npm install -g ai-law`, then `ai-law init`, `ai-law doctor` and `ai-law audit` in the target project.
Which agents are supported?
`ai-law setup --provider` accepts `claude-code`, `cursor`, `codex`, `copilot` and `custom`.
What do the templates include?
14 ready rule templates in English and Chinese. They are adapted to project paths in `.ai-rules/config.json`.
Discussion
No questions or reviews yet.
Related
SkillsOne rules directory generates instructions, skills, MCP and settings for 52 AI coding assistants and checks them in CI
Agent rules from programming books
AI agents Rules / Skills from Programming Books
Skills and AGENTS.md rules distilled from classic books: Clean Code, Refactoring, DDD, Clean Architecture, DDIA and more
Archgate turns architecture decisions into executable rules and blocks violations in CI, hooks and AI agent work
rpa-gen-rules: project rules for agents
rpa-gen-rules
Skill that generates matching project rules for Cursor, Claude Code and Codex built around layered development and BDD
A skill that analyzes a repository and generates files for AI agents: AGENTS.md, pointers, reviewers, CI and templates
AI Code Toolkit
aicode-toolkit
Plugins and MCP servers for coding agents: template-based projects, patterns before a file edit and review against YAML rules.
README in short
The repository describes code review against versioned rules with two paths: an in-chat skill with no Node.js and the `ai-law` CLI with local evidence.