Part of the Claude Code OS (CCOS) — a composable skill suite for AI-native engineering teams.
The Rules Engine manages the full lifecycle of your CLAUDE.md files: audit, generate, optimize, and ship to your team.
Your CLAUDE.md is the highest-leverage file in your Claude Code workflow. It determines whether Claude nails tasks on the first try or burns tokens guessing. Yet most developers either:
- Skip it entirely (relying on
/initand never touching it again) - Let it grow into 500+ lines of bloat that confuses more than it helps
The Rules Engine fixes this with a structured, repeatable process.
Copy the SKILL.md file into your Claude Code skills directory:
# Option 1: Project-level (recommended for teams)
mkdir -p .claude/skills
cp SKILL.md .claude/skills/rules-engine.md
# Option 2: Global (for personal use across all projects)
mkdir -p ~/.claude/skills
cp SKILL.md ~/.claude/skills/rules-engine.md# Score your current CLAUDE.md
/rules:audit
# Create one from scratch
/rules:generate
# Trim and sharpen an existing one
/rules:optimize
# Prep for team commit (strip personal paths, secrets)
/rules:ship
# Auto-detect what's needed
/rules:quick
Every audit scores your CLAUDE.md on 7 dimensions:
| Dimension | Weight | What Good Looks Like |
|---|---|---|
| Structure | 20% | Top-to-bottom priority; clear sections |
| Conciseness | 15% | Under 300 lines; no filler |
| Architecture | 15% | Tech stack, file structure, patterns |
| Validation | 20% | Build, test, lint commands (highest ROI) |
| Domain Context | 15% | Project-specific patterns and DSLs |
| Anti-patterns | 10% | "Never do X" rules for known failures |
| Examples | 5% | Code snippets showing correct patterns |
The Rules Engine is Layer 2 of the Claude Code OS:
Layer 4: Orchestration → Multi-instance juggling, parallel dev
Layer 3: Memory → Second brain, context persistence
Layer 2: Rules Engine → CLAUDE.md lifecycle (you are here)
Layer 1: Execution → GSD (get-shit-done)
Each layer is independent but composable. Use what you need.
- Before a GSD cycle →
/rules:auditensures good context - After repeated AI mistakes →
/rules:optimizeadds anti-patterns - Shipping to team →
/rules:shipalongside your PR
If Claude would make the same mistake even WITH this rule, the rule is too vague. If Claude would never make this mistake WITHOUT this rule, the rule is wasted tokens.
This is an early-stage project. Issues and PRs welcome. Key areas:
- Additional quality rubric dimensions
- Framework-specific rule templates (Next.js, Swift, Rust, etc.)
- Integration patterns with other CCOS layers
MIT
Inspired by the workflows described in 50 Claude Code Tips and built on top of the GSD skill.