Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/imisic/claude-marketplacenpx agentmods add skills/imisic/claude-marketplace/a-rules-optimizerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/imisic/claude-marketplace/a-rules-optimizer)<a href="https://agentmods.dev/skills/imisic/claude-marketplace/a-rules-optimizer"><img src="https://agentmods.dev/badge/skills/imisic/claude-marketplace/a-rules-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/imisic/claude-marketplace/a-rules-optimizer"><img src="https://agentmods.dev/badge/skills/imisic/claude-marketplace/a-rules-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00036 | $0.12880 |
| Opus 5.5 | $0.00014 | $0.05152 |
| Sonnet 5.5 | $0.00007 | $0.02576 |
| Haiku 4.5 | $0.00004 | $0.01288 |
Grade A, and why
a-rules-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 699 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rules Optimizer
Audit .claude/rules/ and CLAUDE.md against the actual codebase. Creates missing rules, fixes drift, ensures coverage. Works on any project regardless of stack.
Input: optional flags
--full: full audit and optimization (default)--audit-only: report drift without making changes--sync: just fix stale references and drift, skip coverage analysis
If no .claude/rules/ directory exists, create it and build rules from scratch. That's the whole point of running this skill.
Core Principles
Rules are instructions, not code examples. Each rule is a declarative statement: "do X", "never Y", "Z must always include W". No code blocks longer than a single line. If a pattern needs showing, use Reference: path/file.py:42.
Rules prevent what reviews catch. Every rule should map to something that would otherwise be flagged during code review. If a rule doesn't prevent a real mistake, it's noise.
Path scoping saves context. Rules scoped to src/web/**/*.py don't load when editing src/core/. Use the narrowest glob that covers the files where the rule matters. It also fires later than it looks: a scoped rule loads after the tool call that touched the matching file, so it is reliable for reference material consulted during a read and for read-then-edit work, and too late for the first write of a new file or for an action that touches no file at all. Run the Phase 2e decision rule before adding it to any file.
@imports to rule files defeat path-scoping. If CLAUDE.md references a rule file with @.claude/rules/foo.md, that file is force-loaded at session start regardless of its paths: frontmatter. Always reference rule files by name only ("see services.md") so the path scoping the user wrote actually takes effect.
Rules are pointers, not inventories. Anything derivable by ls, grep, or reading one well-known file (base classes, enums, route configs) does not belong in a rule file. Lists of controllers, models, services, helpers, partials, URL routes, directory trees, base-class method signatures, design tokens, all rot the moment the code changes. Replace with one-liners: Inventory: ls app/src/Models/, Methods: read app/src/Core/View.php, Routes: app/config/routes.php. Keep the rule (the "must"/"never"), drop the catalog.
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago Changed · +15 lines 6ef0990b588f
- 14d ago Changed 0782534170b0
- 21d ago Changed · +41 lines · +10 tokens per session cbd07e45a6e7
- 1mo ago First seen · 643 lines · 26 tokens per session scan A d81c612133cf
a-rules-optimizer is a skill published in the GitHub repository imisic/claude-marketplace (1 stars, last pushed 8d ago), licensed MIT. It adds 36 tokens to every session and 12,880 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
ai-architect-review
Review the architecture of a system that calls a language model. Use when adding an agent loop, a retrieval path, a tool surface, or an MCP server to a codebase; when a system that worked in a demo is being prepared for production; or when asked to audit, review, or plan AI/agent architecture. Checks the four…
github-code-review
Comprehensive GitHub pull-request code review with multi-agent coordination. Use when reviewing a PR or diff, auditing changes for correctness/security/style before merge, or generating actionable inline review comments.
verification-quality
Truth scoring, code-quality verification, and automatic rollback with a high accuracy threshold. Use when validating agent output before it ships, gating changes on quality, or adding a verify-and-rollback safety loop.
santa-method
Send a finished change to two reviewers who did not write it, using one rubric, and stop after three rounds. Use before a public page, a priced artifact, or a pull request that changes behavior.
security-review
Scan a port or a diff before it lands, and apply the narrow deny list for this machine. Use before copying upstream skills, hooks, or commands into a repo or into the live Claude directory.
ia-orchestrating-swarms
Coordinate multi-agent swarms for parallel and pipeline workflows. Use when coordinating multiple agents, running parallel reviews, building pipeline workflows, or implementing divide-and-conquer patterns with subagents.