rules

rules is a command for Claude Code from fockus/skill-memory-bank. It costs 78 tokens per session (1,729 once invoked), scanned A, original, MIT.

A command for managing coding rules stored in CLAUDE.md, AGENTS.md, and optional project RULES.md files. It can select built-in rules, add personal rules, change settings such as architecture or coverage, and control whether test-driven development (TDD) is required.

In plain words
What is it for?
Use it to view or change rules, enable or disable TDD and coverage settings, define project architecture guidance, and maintain rules for coding agents.
Why use it?
It keeps shared coding and quality rules in one managed place instead of requiring manual edits across project files. Project-level settings can override user-level settings while leaving text outside managed sections untouched.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

Good fit Use it to view or change rules, enable or disable TDD and coverage settings, define project architecture guidance, and maintain rules for coding agents.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/fockus/skill-memory-bank/rules
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/fockus/skill-memory-bank

Made for: Claude Code.

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 rules

README.md
[![agentmods](https://agentmods.dev/badge/commands/fockus/skill-memory-bank/rules/github.svg)](https://agentmods.dev/commands/fockus/skill-memory-bank/rules)
Your own site
<a href="https://agentmods.dev/commands/fockus/skill-memory-bank/rules"><img src="https://agentmods.dev/badge/commands/fockus/skill-memory-bank/rules/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 rules

Your own site · 80×15
<a href="https://agentmods.dev/commands/fockus/skill-memory-bank/rules"><img src="https://agentmods.dev/badge/commands/fockus/skill-memory-bank/rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,729 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.00078 $0.01729
Opus 5.5 $0.00031 $0.00692
Sonnet 5.5 $0.00016 $0.00346
Haiku 4.5 $0.00008 $0.00173

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

Security

Grade A, and why

rules 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 4d 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.

commands/rules.md · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/mb rules — Key rules selection: $ARGUMENTS

The ## Key rules block (<!-- mb-key-rules:start/end -->) sits at the top of CLAUDE.md and AGENTS.md: one line per rule from the catalog rules/key-rules.json plus the user's own rules, ending with a pointer to the detailed RULES.md. The selection lives in the key_rules field of the rules profile (references/rules-profile.schema.md); project overrides user. The architecture and test lines (TDD, Testing Trophy, coverage) and the four principles render from the profile's quality settings — architecture and quality — changed with set; that is their only place.

With --scope=project the same settings are also written, human-readable, into the project RULES.md (<repo>/RULES.md, else <bank>/RULES.md) between <!-- mb-project-rules:start --> and <!-- mb-project-rules:end -->: architecture(s) with the preset rules and severity, principles, TDD, Trophy, coverage thresholds. Text outside the block is the user's and never changes; only init --scope=project creates a missing RULES.md.

The only writer is scripts/mb-rules.sh — never edit the block or the profile by hand:

bash "${MB_SKILLS_ROOT:-$HOME/.claude/skills/memory-bank}/scripts/mb-rules.sh" <subcommand> [args] [--scope=user|project]

Subcommands

Subcommand Effect
list Numbered checklist by group: [x] on, [ ] off, [*] locked (always on); own rules numbered below
enable <id> / disable <id> Turn a catalog rule on/off; disabling a locked rule → exit 2 with the reason. For solid/dry/kiss/yagni, tdd, testing-trophy, coverage this flips the quality setting
add "<text>" Add an own rule (one line, ≤200 chars)
remove <n> Remove own rule number n from list
init [--enable=id,id] [--disable=id,id] [--custom="<text>"]... Replace the scope's whole selection (used by onboarding below)
set <key> <value> Change one quality setting (table below)
sync Re-render the block (and the project RULES.md block) from the profiles; --scope=project also refreshes the AGENTS.md Memory Bank block and existing per-host rule files — the command the session-start hint names when a block's mb-stamp is stale (MB_AUTO_REFRESH=on runs it automatically)

Read the full file on GitHub · 86 lines

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. 4d ago First seen · 86 lines · 78 tokens per session scan A 7e2dc86d2198

Subscribe to this mod's changes

rules is a command published in the GitHub repository fockus/skill-memory-bank (26 stars, last pushed 3d ago), licensed MIT. It adds 78 tokens to every session and 1,729 once invoked, about $0.0003 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-10-08.