ai-rulez

作者 Goldziher已验证

Directory-based AI governance for Claude, Cursor, Copilot, Windsurf and 14+ tools. Define rules, context, skills and agents in .ai-rulez/ — generate synchronized configs for all your AI assistants.

104
Stars
9
Forks
Go
语言
2026/8/24
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/Goldziher/ai-rulez

快速入门

使用 ai-rulez 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

AI-Rulez

ai-rulez

A complete development workflow for AI coding tools

npm version PyPI version License Documentation

Documentation · Quick Start · Examples


The Problem

Every AI coding tool wants its own config: Claude needs CLAUDE.md, Cursor wants .cursor/rules/, Copilot expects .github/copilot-instructions.md. Each has different formats, frontmatter, and directory conventions. If you use more than one tool, you're maintaining duplicate rules that inevitably drift apart.

The Solution

Write your rules, context, skills, agents, and commands once in .ai-rulez/. Run generate. Get native configs for every tool you use.

npx ai-rulez@latest init && npx ai-rulez@latest generate

ai-rulez generates correct, tool-native output for 20 platforms: Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Continue.dev, Codex, OpenCode, Hermes, Amp, Junie, Antigravity, and more. Each preset respects the target tool's conventions — proper frontmatter, directory structure, file extensions, agent formats.

Generate Plugins, Not Just Config

ai-rulez doesn't only write config into your repo — it also packages your project as distributable plugins. Run ai-rulez generate --plugin and the same .ai-rulez/ source (skills, commands, agents, MCP servers) becomes installable plugin bundles and a marketplace index for Claude, Cursor, Codex, Gemini, Kimi, OpenCode, Factory, and Hermes Agent.

ai-rulez generate --plugin           # write plugin bundles + marketplace.json
ai-rulez generate --plugin --dry-run # preview
ai-rulez verify --plugin             # prove committed output matches its sources

Write MCP launch commands and hooks once with the canonical ${PLUGIN_ROOT} variable; each runtime gets its own manifest with the variable and hook format rewritten to fit. Hermes generation emits both a project plugin and a buildable Python entry-point package. Use plugin.content_root to keep distributable skills separate from contributor governance. Supports single-plugin repos and monorepos ([marketplace].members), plus a Claude statusline passthrough. See Authoring Plugins.

What Ships Out of the Box

ai-rulez isn't just a config generator. It ships with 33 builtin domains containing opinionated rules, agents, and workflows that establish a professional development baseline immediately.

Builtin Rules (auto-included)

These activate automatically. No configuration needed.

DomainWhat it enforces
ai-governanceNo AI signatures in commits. Concise communication. Systematic debugging. Verification before claiming success. Critical review of subagent output.
code-qualityAnti-patterns prevention. Complexity limits. Dead code removal. Error handling standards. Readability.
testingTDD workflow (red-green-refactor, no exceptions). Testing anti-patterns. Meaningful assertions. Test independence.
git-workflowAtomic commits. Conventional commit messages. Safe operations. Branch hygiene.
securitySecrets handling. Input validation. Dependency auditing. Least privilege.
token-efficiencyTask runner usage. Incremental approach. Context preservation. Batch operations.
agent-delegationMulti-agent coordination and delegation patterns.

Builtin Agents

Specialized agents ready to use as subagents:

AgentDomainModelWhat it does
code-reviewerai-governancesonnetReviews changes for correctness, security, and conventions. Reports by severity.
test-writertestingsonnetWrites tests following strict TDD. Fails first, then implements.
security-auditorsecuritysonnetAudits dependencies, scans for CVEs, reviews input validation.
docs-writerai-governancehaikuWrites clear, concise documentation. No fluff.
devops-engineercicdhaikuCI/CD pipelines, GitHub Actions, Docker, deployment automation.
release-engineercicdhaikuVersion management, changelogs, multi-registry publishing.

Opt-in Domains

Enable these based on your stack:

Languages (10): rust, python, typescript, go, java, ruby, php, elixir, csharp, r

Bindings (10): pyo3, napi-rs, magnus, ext-php-rs, rustler, wasm, jni-rs, extendr, cgo, vite-plus

Operational: cicd, docker, observability, documentation, polyglot-bindings, default-commands

# .ai-rulez/config.toml
builtins = ["rust", "python", "pyo3", "cicd", "docker", "default-commands"]

Language, binding, polyglot-bindings, and security (OWASP + dependency) conventions are emitted as on-demand Agent Skills (.claude/skills/<id>/SKILL.md) rather than inlined into CLAUDE.md, so the always-loaded file stays small and the conventions load only when relevant. Always-on rules (code-quality, testing, git-workflow, ai-governance, …) remain inline. !domain and !domain/name exclusions work for skill entries too.

Content Types

TypePurposeExample
RulesWhat AI must/must not doSecurity standards, coding conventions
ContextWhat AI should knowArchitecture docs, domain knowledge
SkillsReusable prompts and workflowsDeployment checklist, review protocol
AgentsSpecialized AI personasCode reviewer, performance engineer
CommandsSlash commands across tools/review, /deploy, /test

Organization at Scale

ai-rulez scales from solo projects to large organizations:

Domains — Group content by feature, language, or team:

.ai-rulez/domains/backend/rules/
.ai-rulez/domains/frontend/rules/

Profiles — Generate different configs for different audiences:

[profiles]
backend = ["backend", "database"]
frontend = ["frontend", "ui"]

Remote Includes — Share rules across repositories:

[[includes]]
name = "company-standards"
source = "https://github.com/company/ai-rules.git"
merge_strategy = "local-override"

Include sources can use a bare/flattened layout — expose rules/, context/, skills/, agents/ directly (at the repo root or a sub-path via path = "modules/core") with no .ai-rulez/ wrapper. Recommended for shared, skill-first modules.

Local overrides — Personal, machine-local instructions that never get committed:

ai-rulez add rule my-scratch-notes --local   # → .ai-rulez/local/rules/, generates CLAUDE.local.md

.ai-rulez/local/ and the generated *.local.md outputs are gitignored unconditionally. See docs/local-overrides.md.

Reasoning effort across providers — Tune how hard each AI tool thinks:

# .ai-rulez/agents/security-reviewer.md
---
name: security-reviewer
description: Reviews code for security regressions
effort: high
---
# .ai-rulez/config.toml
[defaults]
effort = "medium"  # global default for every supported preset

[defaults.effort_by_preset]
codex = "high"     # overrides the global default for Codex
claude = "xhigh"   # …and for Claude

Accepted values: low, medium, high, xhigh, max, inherit. ai-rulez emits the right field per preset:

  • Claudeeffort in .claude/agents/*.md frontmatter (per-agent)
  • Codexmodel_reasoning_effort in .codex/config.toml and .codex/agents/*.toml
  • Ampamp.anthropic.effort in .amp/settings.json (global)
  • Windsurfreasoning_effort in .windsurf/agents/*.md frontmatter (per-agent)
  • OpencodereasoningEffort in .opencode/agents/*.md frontmatter (per-agent)

Each preset maps the value to its own vocabulary; tools without a documented config surface (Cursor, Copilot, Gemini, etc.) are silently skipped. See docs/configuration.md for the full mapping table.

Per-preset model selection for subagents — Model strings differ per provider, so the same agent can declare a different model for each preset it targets:

# .ai-rulez/agents/research-helper.md
---
name: research-helper
description: Multi-provider research subagent
claude_model: opus
copilot_model: gpt-5
cursor_model: claude-3.7-sonnet
---
# .ai-rulez/config.toml — project-wide defaults
[defaults.model_by_preset]
claude = "sonnet"   # used when an agent doesn't set its own claude_model
copilot = "gpt-5"

Per-agent <preset>_model wins over defaults.model_by_preset; the legacy single model: field on an agent is the lowest-priority fallback for backward compatibility.

Installed Skills — Pull reusable skills from external repos:

[[installed_skills]]
name = "kreuzberg"
source = "https://github.com/kreuzberg-dev/kreuzberg"

MCP Server

ai-rulez includes a built-in MCP server with 35+ tools that lets AI assistants manage their own governance. Add rules, update context, generate configs — all programmatically.

[[mcp_servers]]
name = "ai-rulez"
command = "npx"
args = ["-y", "ai-rulez@latest", "mcp"]

Installation

No install needed — npx ai-rulez@latest <command> works out of the box. Pick a permanent option below:

Homebrew (macOS / Linux)
brew install goldziher/tap/ai-rulez
npx (no install)
npx ai-rulez@latest <command>
npm (global)
npm install -g ai-rulez
uvx (no install)
uvx ai-rulez <command>
uv tool
uv tool install ai-rulez
pip / pipx
pip install ai-rulez
# or, isolated:
pipx install ai-rulez
pre-commit hook

Add to .pre-commit-config.yaml:

repos:
  - repo: https://github.com/Goldziher/ai-rulez
    rev: v4.11.2
    hooks:
      - id: ai-rulez-recursive # generate outputs across the repo
      - id: ai-rulez-validate # dry-run validation

Available hook ids: ai-rulez-validate, ai-rulez-generate, ai-rulez-recursive, ai-rulez-plugin-generate, ai-rulez-plugin-verify, ai-rulez-enforce, and ai-rulez-enforce-fix. They trigger on root or nested .ai-rulez/ changes.

poly hook source

Add ai-rulez as a managed source in your existing poly.toml and select the hooks your repository needs. This requires AI-Rulez 4.9.0+ and Poly 0.14.0+:

[[hooks.sources]]
id = "ai-rulez"
git = "https://github.com/Goldziher/ai-rulez.git"
revision = "v4.11.2"
hooks = ["ai-rulez-recursive", "ai-rulez-plugin-verify"]

The source also provides ai-rulez-validate, ai-rulez-generate, ai-rulez-enforce, ai-rulez-enforce-fix, and ai-rulez-plugin-generate. Plugin hooks use --if-configured, so they skip consumer-only repositories that do not contain a producer [plugin] or multi-member [marketplace] block.

Resolve and commit the source lock, then install the Git shims:

poly hooks update
git add poly.toml poly-hooks.lock
poly hooks install

See the Poly hooks guide for local sources, machine install preferences, hook behavior, and the producer catalog.

lefthook

Add to lefthook.yml:

pre-commit:
  commands:
    ai-rulez:
      glob: ".ai-rulez/**"
      run: ai-rulez generate --recursive

Or run ai-rulez init --setup-hooks while initializing a repo to wire hooks in automatically.

Documentation

Full documentation at goldziher.github.io/ai-rulez.

License

MIT

常见问题

What is ai-rulez?

ai-rulez is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Goldziher. Directory-based AI governance for Claude, Cursor, Copilot, Windsurf and 14+ tools. Define rules, context, skills and agents in .ai-rulez/ — generate synchronized configs for all your AI assistants. It has 104 GitHub stars.

Is ai-rulez safe to use?

Yes. ai-rulez passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install ai-rulez?

Clone the repository with "git clone https://github.com/Goldziher/ai-rulez" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is ai-rulez written in?

ai-rulez is primarily written in Go. It is open-source under Goldziher on GitHub, so you can review or fork the full source.

Are there alternatives to ai-rulez?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh ai-rulez against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情