rules-eval
npx machina-cli add skill athola/claude-night-market/rules-eval --openclawRules Evaluation Framework
Table of Contents
Overview
This skill evaluates Claude Code rules in .claude/rules/ directories against quality standards. It validates YAML frontmatter, glob pattern syntax, content quality, and directory organization. Rules files support path-scoped conditional loading via paths frontmatter and unconditional rules (no paths field).
Key validations: YAML syntax errors, unquoted glob patterns, Cursor-specific fields (alwaysApply, globs), overly broad patterns, content verbosity, and naming conventions.
Quick Start
# Evaluate rules in current project
/rules-eval
# Evaluate specific directory
/rules-eval .claude/rules/
# Detailed analysis with recommendations
/rules-eval --detailed
Evaluation Workflow
- Scan
.claude/rules/for all.mdfiles (including subdirectories) - Validate YAML frontmatter syntax and fields
- Analyze glob patterns for correctness and specificity
- Assess content quality (actionable, concise, non-conflicting)
- Check organization (naming, structure, symlinks)
- Measure token efficiency and redundancy
Scoring
| Category | Points | Focus |
|---|---|---|
| Frontmatter Validity | 25 | YAML syntax, required fields, correct field names |
| Glob Pattern Quality | 20 | Syntax, specificity, quoting |
| Content Quality | 25 | Actionable, concise, non-conflicting |
| Organization | 15 | Naming, structure, symlink usage |
| Token Efficiency | 15 | Rule size, redundancy detection |
| Score | Level |
|---|---|
| 91-100 | Excellent - Production-ready |
| 76-90 | Good - Minor improvements possible |
| 51-75 | Basic - Needs optimization |
| 26-50 | Below Standards - Significant issues |
| 0-25 | Critical - Invalid or broken rules |
Resources
Skill-Specific Modules
- Frontmatter Validation: See
modules/frontmatter-validation.md - Glob Pattern Analysis: See
modules/glob-pattern-analysis.md - Content Quality Metrics: See
modules/content-quality-metrics.md - Organization Patterns: See
modules/organization-patterns.md
Tools
- Rules Validator:
scripts/rules_validator.py
Related Skills
abstract:skills-eval- Skill evaluation frameworkabstract:hooks-eval- Hook evaluation framework
Source
git clone https://github.com/athola/claude-night-market/blob/master/plugins/abstract/skills/rules-eval/SKILL.mdView on GitHub Overview
This skill evaluates Claude Code rules in .claude/rules/ to confirm quality and readiness before deployment. It checks YAML frontmatter, glob patterns, content quality, and directory organization, flagging issues and recommendations. Note: avoid using it to author new rules or evaluate skills/hooks; see the rule authoring guides for those tasks.
How This Skill Works
The evaluation workflow scans .claude/rules/ for .md files, validates YAML frontmatter syntax and required fields, analyzes glob patterns for correctness and specificity, and assesses content quality and organization. It then produces a scoring breakdown across frontmatter validity, glob pattern quality, content quality, organization, and token efficiency, using the Rules Validator framework.
When to Use It
- Auditing existing rules for quality before deployment
- Validating YAML frontmatter syntax and required fields
- Checking glob patterns for correctness, specificity, and quoting
- Assessing rule organization: naming, structure, and symlink usage
- Measuring token efficiency and reducing redundancy in rules
Quick Start
- Step 1: Evaluate rules in the current project: /rules-eval
- Step 2: Evaluate a specific directory: /rules-eval .claude/rules/
- Step 3: Get detailed recommendations: /rules-eval --detailed
Best Practices
- Run the evaluation across all .md rule files in .claude/rules before release
- Validate frontmatter syntax and required fields prior to deeper checks
- Ensure glob patterns are specific, properly quoted, and non-greedy where possible
- Keep rule content actionable, concise, and free of conflicts with other rules
- Use --detailed for actionable recommendations and thorough analysis
Example Use Cases
- Audit a multi-module project to identify poorly scoped globs and verbose content in .claude/rules
- Fix unquoted or overly broad glob patterns flagged by the validator
- Reorganize rule files to improve naming consistency and directory structure
- Remove duplicate or redundant rules to reduce token usage
- Run rules-eval in CI to catch regressions in rule quality