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.00026 | $0.11056 |
| Opus 5 | $0.00013 | $0.05528 |
| Sonnet 5 | $0.00005 | $0.02211 |
| Haiku 4.5 | $0.00003 | $0.01106 |
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 10d 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 — 643 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.
@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.
Preserve the user's voice. If rules already exist, the user wrote them from experience. Keep their wording, organization, and emphasis. Only change what has a concrete reason (drift, gap, stale reference).
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.
- 10d 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 (2 stars, last pushed 8d ago), licensed MIT. It adds 26 tokens to every session and 11,056 once invoked, about $0.0001 per session on Opus 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
codex-agent
Use when you want a second-opinion review via Codex CLI, cross-verification after another agent implements changes, debugging help, or alternative implementation proposals. Requires Codex CLI to be installed and authenticated.
project-health-auditor
Comprehensive codebase health analysis. Use when reviewing code quality, identifying technical debt, checking dependencies, or assessing project structure.
review-gate
Use before an agent-produced diff is committed, pushed, opened as a PR, merged, landed, or applied to user files when explicit implementation approval is missing. Trigger for review gate, review pack, approve before landing, diff first then land, human approval, merge gate, commit gate, push gate, or PR readiness.…
pneuma-session
Instructions for renaming an active Pneuma session and replacing its default preview with a useful title and summary. A Pneuma session is one work area inside a larger project.
tokf-discover
Find missed token savings by scanning AI coding session files for commands that ran without tokf filtering.
docs
Use when documentation generally needs to catch up with a branch before pushing or merging, covering internal developer docs, external customer-facing docs, and release notes together — "update the docs", "do a docs pass before I merge", "make sure everything's documented". Prefer this when no single documentation…