rules-eval
Evaluate Claude Code rules in .claude/rules/. Use for frontmatter, globs, and quality audits.
Install
npx skills add https://github.com/athola/claude-night-market/tree/master/plugins/abstract/skills/rules-eval
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install athola-claude-night-market@llmmart
git clone https://github.com/athola/claude-night-market.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole athola/claude-night-market collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Rules Evaluation Framework
When NOT To Use
- Evaluating skills (use
abstract:skills-eval) - Evaluating hooks (use
abstract:hooks-eval) - Writing a new rule (use
hookify:writing-rules)
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
Exit Criteria
- Every
.mdfile under.claude/rules/(including subdirectories) receives a quality score (0-100) with per-category breakdown across the five dimensions. - YAML frontmatter syntax errors and unquoted glob patterns are listed as blocking findings before any score is reported.
- Rules using Cursor-specific fields (
alwaysApply,globs) are flagged as non-compliant with the expected Claude Code schema. - Any rule scoring below 26 (Critical tier) is reported with at least one concrete corrective action, not just a score.
Files (claude-night-market)
-
modules
-
content-quality-metrics.md 909 B
# Content Quality Metrics ## Quality Criteria ### Actionability Rules should provide clear, actionable guidance. Descriptions alone are insufficient. ```markdown <!-- BAD: Just a description --> This project uses TypeScript. <!-- GOOD: Actionable guidance --> Use strict TypeScript. Enable `noImplicitAny` and `strictNullChecks`. Prefer interfaces over type aliases for object shapes. ``` ### Conciseness Each rule file should be focused and concise (< 500 tokens typical). ### Non-Conflicting Rules across files should not contradict each other. ### Single Topic Each rule file should address one focused topic. ## Scoring (25 points, deductive) Starts at 25, deducts for issues found: | Issue | Deduction | Criteria | |-------|-----------|----------| | Empty content | -25 | Rule file has no body text | | Too short | -5 | Fewer than 10 words | | Too verbose | -5 | Exceeds 500 estimated tokens | -
frontmatter-validation.md 1.3 KB
# Frontmatter Validation ## Valid Frontmatter Fields Claude Code rules support these frontmatter fields: | Field | Type | Required | Purpose | |-------|------|----------|---------| | `paths` | `list[string]` | No | Glob patterns for conditional loading | | `description` | `string` | No | Brief description of rule purpose | Rules without `paths` are unconditional (apply to all files). ## Common Errors ### YAML Syntax Errors ```yaml # INVALID - unquoted glob starting with * --- paths: - **/*.ts # YAML parse error --- # VALID - quoted glob --- paths: - "**/*.ts" --- ``` ### Wrong Field Names ```yaml # INVALID - Cursor-specific fields --- globs: # Wrong! Use 'paths' - "*.ts" alwaysApply: true # Wrong! Cursor-only, not Claude Code --- ``` ### Invalid Structure ```yaml # INVALID - paths must be a list --- paths: "**/*.ts" # Should be a list --- # VALID --- paths: - "**/*.ts" --- ``` ## Scoring (25 points, deductive) Starts at 25, deducts for issues found: | Issue | Deduction | Criteria | |-------|-----------|----------| | YAML parse error | -25 | Frontmatter fails to parse | | Cursor-specific field | -5 each | `globs`, `alwaysApply`, etc. | | Invalid `paths` type | -5 | `paths` is not a list | | Unknown field | -2 each | Field not in valid set | | Empty `paths` list | -1 | `paths: []` (likely unintended) | -
glob-pattern-analysis.md 1.1 KB
# Glob Pattern Analysis ## Pattern Quality Assessment ### Good Patterns ``` "src/api/**/*.ts" # Specific scope "tests/**/*.test.ts" # Clear intent "{src,lib}/**/*.ts" # Multiple dirs, quoted "*.config.{js,ts}" # Config files only ``` ### Problem Patterns ``` "**/*" # Too broad - matches everything "*" # Root only, usually too narrow **/*.ts # Unquoted - YAML parse error "." # Invalid glob ``` ## Validation Rules 1. **Syntax validity**: Pattern must be valid glob syntax 2. **Quoting**: Patterns with `*`, `{`, `}`, `[`, `]` must be quoted 3. **Specificity**: Patterns should not match everything (`**/*`) 4. **Intent clarity**: Pattern should clearly indicate target files ## Scoring (20 points, deductive) Starts at 20, deducts for issues found. Files without `paths` receive full score. | Issue | Deduction | Criteria | |-------|-----------|----------| | Overly broad pattern | -5 each | Matches `**/*`, `*`, etc. | | Empty pattern | -4 each | Blank or whitespace-only pattern | -
organization-patterns.md 1.2 KB
# Organization Patterns ## Directory Structure ### Recommended Layout ``` .claude/rules/ api-validation.md # Descriptive names testing-standards.md # Topic-based naming frontend/ # Subdirectories for grouping react-patterns.md css-conventions.md ``` ### Anti-Patterns ``` .claude/rules/ rules1.md # Non-descriptive names misc.md # Catch-all files RULES.md # Shouting case my rules file.md # Spaces in filenames ``` ## Naming Conventions - Use kebab-case: `api-validation.md` - Be descriptive: name should indicate rule content - Use subdirectories for 5+ rule files - Avoid generic names: `rules.md`, `misc.md`, `todo.md` ## Symlink Support Symlinks enable shared rules across projects: ```bash ln -s ~/shared-rules/code-style.md .claude/rules/code-style.md ``` Validate that symlink targets exist and are readable. ## Scoring (15 points) | Check | Points | Criteria | |-------|--------|----------| | Descriptive filenames | 5 | Names indicate content | | Kebab-case naming | 4 | Consistent formatting | | Logical grouping | 3 | Subdirectories when needed | | No broken symlinks | 3 | All symlinks resolve |
-
-
SKILL.md 3.6 KB
--- name: rules-eval description: 'Evaluate Claude Code rules in .claude/rules/. Use for frontmatter, globs, and quality audits.' alwaysApply: false category: rule-management tags: - evaluation - rules - validation - quality-assurance - glob-patterns - frontmatter dependencies: - skills-eval provides: infrastructure: - rules-evaluation - frontmatter-validation - glob-pattern-analysis patterns: - rule-auditing - content-quality - organization-analysis estimated_tokens: 400 evaluation_criteria: frontmatter_validity: 25 glob_pattern_quality: 20 content_quality: 25 organization: 15 token_efficiency: 15 model_hint: standard role: entrypoint --- # Rules Evaluation Framework ## When NOT To Use - Evaluating skills (use `abstract:skills-eval`) - Evaluating hooks (use `abstract:hooks-eval`) - Writing a new rule (use `hookify:writing-rules`) ## 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 ```bash # Evaluate rules in current project /rules-eval # Evaluate specific directory /rules-eval .claude/rules/ # Detailed analysis with recommendations /rules-eval --detailed ``` ## Evaluation Workflow 1. Scan `.claude/rules/` for all `.md` files (including subdirectories) 2. Validate YAML frontmatter syntax and fields 3. Analyze glob patterns for correctness and specificity 4. Assess content quality (actionable, concise, non-conflicting) 5. Check organization (naming, structure, symlinks) 6. 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 framework - `abstract:hooks-eval` - Hook evaluation framework ## Exit Criteria - [ ] Every `.md` file under `.claude/rules/` (including subdirectories) receives a quality score (0-100) with per-category breakdown across the five dimensions. - [ ] YAML frontmatter syntax errors and unquoted glob patterns are listed as blocking findings before any score is reported. - [ ] Rules using Cursor-specific fields (`alwaysApply`, `globs`) are flagged as non-compliant with the expected Claude Code schema. - [ ] Any rule scoring below 26 (Critical tier) is reported with at least one concrete corrective action, not just a score.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.