ar-optimizer

Audit and optimize AI rule files for redundancies, conflicts, staleness, and bloat.

1|2|Updated Jul 11, 2026
One-click install
npx skills add https://github.com/mahsanamin/agentic-repos --skill ar-optimizer-mahsanamin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ar-optimizer
Source: https://github.com/mahsanamin/agentic-repos/tree/main/skills/ar-optimizer
Command: npx skills add https://github.com/mahsanamin/agentic-repos --skill ar-optimizer-mahsanamin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI rule files like CLAUDE.md, AGENTS.md, and .cursorrules accumulate redundant, conflicting, stale, and bloated instructions over time, which wastes context window tokens and causes AI assistants to ignore or misinterpret your team's conventions. ## Core Features & Use Cases - Full-Project Discovery: Finds every AI configuration file across the project (CLAUDE.md, .cursorrules, AGENTS.md, copilot-instructions.md, and more) and builds a token-impact manifest. - 14 Automated Checks: Detects redundancy, in-file repetition, conflicts, staleness, example bloat, fragmentation, inferable-from-code rules, missing emphasis, oversized CLAUDE.md files, heavy imports, and rationale bloat. - Interactive Cleanup: Presents findings for explicit approval, proposes a concrete changeset, applies optimizations, and re-validates with before/after token counts. - Scoped Mode: Audits only files touched by an upgrade run, leaving untouched tuning undisturbed. - Use Case: After months of edits, your CLAUDE.md has grown to 4,500 tokens and contradicts your .cursorrules on export style. Run the optimizer to consolidate rules into a single source of truth and cut context usage per session. ## Quick Start Say "optimize AI rules" or "run ar-optimizer" to audit this project's AI rule files and get cleanup recommendations.

Frequently Asked Questions about ar-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce the size of my CLAUDE.md file?▼

Run the optimizer to detect inferable-from-code rules, standard conventions, embedded documentation, and heavy imports that inflate CLAUDE.md. It recommends moving domain knowledge to skills and linking external docs, targeting under 2000 tokens.

How to find conflicting instructions across AI config files?▼

The optimizer parses every rule in CLAUDE.md, AGENTS.md, .cursorrules, and similar files, then runs a conflict check that flags contradictory instructions with exact file and line references so you can pick a resolution.

Does the optimizer work with Cursor and Copilot rule files?▼

Yes, discovery covers .cursorrules, .cursor/rules/*.mdc, .github/copilot-instructions.md, .windsurfrules, GEMINI.md, and generic files like AGENTS.md and CONVENTIONS.md, not just Claude Code configs.

Will the optimizer change my files without asking?▼

No. It presents all findings and requires explicit approval per issue before proposing a changeset, and asks for final confirmation before applying any deletions, modifications, or consolidations.

What is scoped mode in the optimizer?▼

Scoped mode audits only a provided list of files, typically those touched by an ar-upgrade run, skipping full-project discovery. It avoids disturbing tuning in files outside the upgrade scope.