a-rules-optimizer

a-rules-optimizer is a skill for Claude Code, Codex from imisic/claude-marketplace. It costs 36 tokens per session (12,880 once invoked), scanned A, original, MIT.

A codebase audit tool for checking whether Claude instructions in .claude/rules/ and CLAUDE.md match the project’s actual behavior.

In plain words
What is it for?
Use it to audit instructions, report drift without editing, synchronize stale references, or create a rules directory and rules from scratch.
Why use it?
It finds outdated instructions, missing guidance, and rules that do not cover real review risks, reducing confusion for coding assistants.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is | ../CLAUDE.md (ancestor) | 240 lines | always | TRIM: loads for this project, user unaware |.

Part of the dev-workflow-forge plugin — 4 skills shipped together

Good fit Use it to audit instructions, report drift without editing, synchronize stale references, or create a rules directory and rules from scratch.

Compare 6 skills from other repositories ↓
Install

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.

Clone the repo
git clone --depth 1 https://github.com/imisic/claude-marketplace
agentmods
npx agentmods add skills/imisic/claude-marketplace/a-rules-optimizer

Made for: Claude Code, Codex.

Or install dev-workflow-forge, the plugin that ships this one along with the rest of its 4 skills.

Wrote 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.

agentmods badge for a-rules-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/imisic/claude-marketplace/a-rules-optimizer/github.svg)](https://agentmods.dev/skills/imisic/claude-marketplace/a-rules-optimizer)
Your own site
<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.

agentmods 80×15 button for a-rules-optimizer

Your own site · 80×15
<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>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 12,880 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 8d ago against content hash 6ef0990b588f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify-rule-globs.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/dev-workflow-forge/skills/a-rules-optimizer/SKILL.md · 699 lines

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.

Read the full file on GitHub · 699 lines

Files

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.

Changes

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.

  1. 8d ago Changed · +15 lines 6ef0990b588f
  2. 14d ago Changed 0782534170b0
  3. 21d ago Changed · +41 lines · +10 tokens per session cbd07e45a6e7
  4. 1mo ago First seen · 643 lines · 26 tokens per session scan A d81c612133cf

Subscribe to this mod's changes

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.

Related

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…

frankxai/claude-skills-library · 88 tokens

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.

frankxai/claude-skills-library · 41 tokens

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.

frankxai/claude-skills-library · 43 tokens

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.

frankxai/claude-skills-library · 45 tokens

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.

frankxai/claude-skills-library · 43 tokens

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.

iliaal/whetstone · 44 tokens