Back to list
hairihou

rules-optimizer

by hairihou

0🍴 0📅 Jan 24, 2026

SKILL.md


name: rules-optimizer description: Optimize and create Claude Rules (.claude/rules/*.md) following best practices. Use when asked to "create a rule", "optimize my rules", or "review my .claude/rules files".

Rules Optimizer

Create and optimize .claude/rules/*.md files for effective AI guidance.

Best Practices

File Structure

.claude/rules/
├── typescript.md        # Language-specific
├── python.md
├── frontend/
│   ├── react.md         # Framework-specific
│   ├── tailwind.md
│   └── component-structure.md
└── backend/
    └── api.md

Rule File Format

---
paths: "**/*.{ts,tsx}" # Glob pattern (quoted)
---

# [Topic] Rules

## [Category]

[Rule statement]

\`\`\`typescript
// ❌ BAD
[anti-pattern]

// ✅ GOOD
[correct pattern]
\`\`\`

Content Guidelines

  1. One topic per file — keep focused
  2. 150-200 lines ideal — enough for examples, not overwhelming
  3. Include examples — 1 BAD/GOOD pair per rule that needs clarity
  4. Skip obvious rules — focus on what AI gets wrong
  5. No "why" explanations — just the rule and example
  6. Use tables for mappings (e.g., v3→v4 migrations)

Path Patterns

PatternMatches
**/*.tsAll TS files
**/*.{ts,tsx}TS and TSX
src/**/*All under src/
components/**/*.tsxComponents only

What to Include

  • ❌ Anti-patterns AI commonly generates
  • ✅ Correct patterns with minimal example
  • Migration mappings (old → new)
  • Framework-specific conventions

What to Exclude

  • Self-evident rules (use semicolons, etc.)
  • Long explanations of "why"
  • Multiple examples for same rule
  • Style preferences (let linters handle)

Workflow

  1. Read existing rule file
  2. Identify: redundancy, missing examples, excessive length
  3. Compress to essentials with 1 example per rule
  4. Ensure paths pattern is appropriate
  5. Output optimized version

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon