ivanmisic.net log in
Mine Skills

/a-rules-optimizer

Rules go stale quietly: a renamed directory, a deleted helper, a CLAUDE.md nobody trimmed. This checks them against the code and fixes what drifted.

Install
/plugin install dev-workflow-forge@imisic
Then run
/a-rules-optimizer

Rules go stale quietly. A directory gets renamed and the rule still names the old one. A helper the rules tell you to use was deleted in March. A CLAUDE.md grows to nine hundred lines, most of which are true of every project on earth and therefore worth nothing to this one. Nothing complains, and the file keeps loading into every session anyway.

a-rules-optimizer audits .claude/rules/ and CLAUDE.md against the code, then fixes what it finds.

It checks the rules against the codebase, not against a best-practice list. That is the whole difference. A rule that says "use prepared statements" is a fine sentiment and tells a model nothing it did not already know. A rule that names your actual base model class, your actual escaping helper, and the two places in this repo where the pattern is deliberately broken is worth its tokens. The audit is looking for the gap between what the rules claim and what the code does.

So it removes drift (references to things that moved or no longer exist), writes the rules that are missing (a real convention the codebase follows that nothing has written down), trims what is generic, and checks that path globs actually match files, because a rule scoped to a directory that got restructured is a rule that never loads.

It also cross-references the project's review skill where one exists, so the rules and the review are not making different demands on the same code.

Works on any stack. It reads what is there rather than assuming a framework.

Ships in the dev-workflow-forge plugin, alongside a-review-optimizer and a-self-learner. If the project has no review skill yet, run a-review-optimizer first so there is something to cross-check against.

/plugin marketplace add imisic/claude-marketplace
/plugin install dev-workflow-forge@imisic

Then the command is /a-rules-optimizer.

Everything mine on this shelf comes from my own working setup, shared for learning. Test it and adapt it to your project before relying on it; you run it at your own risk.