Agent skill

Add Rule

by Eigenwise in Eigenwise/eigenwise-toolshed

Create or edit a live-rules instruction in the project's atomic rule set.

MITAuto-check passedAI & LLM Engineering

Install Add Rule

skills CLI
$ npx skills add Eigenwise/eigenwise-toolshed --skill add-rule -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Eigenwise/eigenwise-toolshed add-rule --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Eigenwise/eigenwise-toolshed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/live-rules/skills/add-rule .claude/skills/add-rule && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-rule
GitHub stars
277
Token cost
~1.9k tokens
SKILL.md length
1,019 words
Files
3 (incl. references)
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

Create or edit a live-rules instruction in the project's atomic rule set.

  • Works in 4 steps: Understand the rule → Write the rule and sync it → Validate → …
  • Coding guideline
  • SKILL.md covers Atomic storage, Step 1: Understand the rule, Step 2: Write the rule and… and Step 3: Validate, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Add Rule is an agent skill from Eigenwise/eigenwise-toolshed. Create or edit a live-rules instruction in the project's atomic rule set. Use to add a rule, coding guideline, guardrail, convention, or automatic reminder.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/example-rules.md` and `references/rule-format.md`).

It sits in AI & LLM Engineering. The repository describes itself as: Six Claude Code plugins for the work that keeps coming back: repo maps, conditional rules, ticketed parallel work, extra subscription models, local usage metrics, and guided setup. The licence is MIT.

When your agent uses it

  • Coding guideline
  • Automatic reminder

Example prompts

  • “/add-rule”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Understand the rule
  2. Write the rule and sync it
  3. Validate
  4. Confirm

What it can do on your machine

Read from SKILL.md and the folder at commit 0140ec1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Rule loads about 1.9k tokens when it runs, and up to ~4.6k if it reads all its reference files. Until then it costs about 41 tokens; SKILL.md has 1,019 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~41
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Eigenwise/eigenwise-toolshed at commit 0140ec1, republished under its MIT licence (© Eigenwise). 1,019 words, ~1,891 tokens.

Download SKILL.mdSave it as .claude/skills/add-rule/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
add-rule
description
Create or edit a live-rules instruction in the project's atomic rule set. Use to add a rule, coding guideline, guardrail, convention, or automatic reminder.

Add Rule

Turn a request like "always run the linter before committing" or "when editing *.tsx, prefer function components" into a rule. New workspaces keep one rule per Markdown file under .claude/live-rules/rules/, with a generated manifest beside them. The hooks inject a rule at SessionStart when it applies, then only when it newly matches or its content/hash changes during the session.

Read references/rule-format.md for the full frontmatter spec and references/example-rules.md for ready-to-adapt examples before writing a rule.

Do not edit CLAUDE.md. Live Rules owns its rule files and generated manifest; the hooks are the delivery mechanism.

Atomic storage

For new workspaces, create or edit one rule file under .claude/live-rules/rules/. Use a stable, descriptive filename such as commit-checks.md. After adding or editing a rule, run the plugin-owned sync command from the project root:

text
node "${CLAUDE_PLUGIN_ROOT}/scripts/sync-atomic-rules.js" --project "${CLAUDE_PROJECT_DIR}"

Sync derives every manifest hash and metadata field from the rule files, validates a stable read, and atomically replaces only the generated manifest under a writer lock. Rule files remain authoritative and are never rewritten by sync. Never author or repair .claude/live-rules/manifest.json by hand. If sync fails, fix the exact file it names, then run the same command again.

Existing projects may still have a legacy .claude/live-rules.md file. The default SessionStart migration converts it to atomic files, verifies that the rules match, and removes the old file. An explicit LIVE_RULES_PATH is preserved, and a failed verification keeps the legacy file. Treat the single-file format as migration or explicit-override storage only. Do not choose it for new work.

Step 1: Understand the rule

Pin down two things from the user's request:

  1. The instruction itself: what should Claude do, prefer, or avoid? Keep it concrete and testable ("use httpx, not requests) rather than vague ("write good code").
  2. When it applies (the scope). Listen for the trigger in how they phrase it:
The user says...ScopeFrontmatter
"always", "in general", "house style", no conditionglobalno scope fields
"when editing / for / in *.tsx", a file type or pathpath/globglobs:
"when working in packages/api", a directory/areadirectorydirs:
"when I ask about / mention deploy/migration/auth"prompt-keywordprompt:

A rule can combine scopes, such as globs plus prompt; it is injected when any condition matches. If you are unsure whether something is global or scoped, ask one short question rather than guessing, because an over-broad rule adds noise.

Including a live file. If the request is "load my codebase map", "keep <file> in front of you", or "inject the contents of <file>", use the include: field, not a scope. Add include: <path> and write the body as the protocol for using that file. The file is read fresh each time the rule is injected, and a missing include makes the rule silent. A pure-include rule is global. See the "Including a live file" section of references/rule-format.md.

Step 2: Write the rule and sync it

Create or edit one file under .claude/live-rules/rules/, then run the sync command from Atomic storage. Do not edit the manifest. A rule file contains one frontmatter block and one body:

markdown
---
description: Short human title (also shown as the rule's heading when injected)
globs: ["**/*.tsx"]     # include only the scope fields that apply; omit the rest
priority: 0              # optional; higher injects first (default 0)
enabled: true            # optional; default true
---
- Write the rule body as tight, imperative bullet points.
- One concern per file; add another rule file rather than overloading this one.

For a project that deliberately sets LIVE_RULES_PATH, maintain the explicitly requested legacy file only when the user wants that override. Keep the same frontmatter and body rules, and do not claim it is the default storage path.

Guidelines for a good rule:

  • Imperative and concrete. "Do X", "Never Y", with a real symbol, path, or command where possible.
  • Short. Injected context is capped at about 10k characters across all matching rules, so keep each body to a handful of lines. Long rationale belongs in a linked doc.
  • Atomic. One concern per file. It keeps scoping precise and lets the user disable just that one.
  • No bare --- in the body. A line that is exactly --- would be read as another rule's fence. Use *** or ___ for a horizontal rule inside a body.
  • Globs are gitignore-style: a pattern with no / (like *.sql) matches that name at any depth; a pattern with a / (like src/**/*.ts) is anchored to the repo-relative path.
Show full SKILL.md (359 more words)Show less

Step 3: Validate

Before finishing:

  • Confirm any globs correspond to files that exist, or clearly will, in this repo. If a glob matches nothing, say so.
  • If a prompt entry is a /regex/flags, make sure it is valid.
  • Re-read the body: is it short, concrete, and free of contradictions with the other rules? Skim them for overlap or conflicts.
  • Make sure the frontmatter fences are intact and the file contains exactly one rule.
  • Run the sync command and confirm it succeeds. If the manifest is missing or malformed, sync rebuilds it from the rule files; do not patch the JSON by hand.

Step 4: Confirm

Tell the user what you added: the rule's title, the scope, and a one-line summary. Explain that SessionStart injects applicable rules first, then the hooks inject only newly matching or changed unseen hashes during the session. A content change takes effect on the next prompt or relevant edit; unchanged rules do not repeat on every prompt. Remind them to review and commit the atomic rule files and generated manifest so the team shares the rules. They can disable a rule any time by setting enabled: false or using manage-rules.

Guidelines

  • Never touch CLAUDE.md or CLAUDE.local.md.
  • One concern per file. Prefer several small rules over one large one.
  • Scope tightly. Global rules hit every prompt that has not already seen that rule in the session; reserve them for instructions that truly apply everywhere.
  • Don't leak secrets. A rule can say where config lives, never actual credential values.

Success criteria

  • A new or edited rule file exists under .claude/live-rules/rules/, unless the user explicitly requested a LIVE_RULES_PATH override
  • The rule has a description, the correct scope fields, and a concise body
  • Scope is verified (globs match real paths; any regex compiles)
  • The rule file parses as exactly one rule with intact fences and no stray --- in its body
  • The plugin-owned sync command succeeds and the generated manifest matches the rule files
  • User told the rule's title, when it fires, and the SessionStart/changed-hash cadence
  • CLAUDE.md is untouched

References

  • references/rule-format.md - full frontmatter spec, atomic storage, migration, cadence, scope semantics, and glob syntax
  • references/example-rules.md - copy-and-adapt examples for each scope type

© Eigenwise, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in plugins/live-rules/skills/add-rule of Eigenwise/eigenwise-toolshed.

  • SKILL.md
  • references/example-rules.md
  • references/rule-format.md

Open the folder on GitHubat commit 0140ec1

Compare with similar skills

Add Rule next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Rule compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Rule this skillEigenwise/eigenwise-toolshed277—~1.9kAutomated safety check: PassMIT
Agent BuildershareAI-lab/learn-claude-code78k6 repos~1.2kAutomated safety check: PassMIT
Add Uint Supportpytorch/pytorch104k2 repos~2.3kAutomated safety check: PassCustom licence
Peft Fine TuningOrchestra-Research/AI-Research-SKILLs13k9 repos~3.1kAutomated safety check: PassMIT
Segment Anything Model GuideOrchestra-Research/AI-Research-SKILLs13k9 repos~3.3kAutomated safety check: PassMIT
1passwordtrpc-group/trpc-agent-go1.8k13 repos~656Automated safety check: PassApache-2.0

Similar skills

  • Agent Builder

    shareAI-lab/learn-claude-code

    Design and build AI agents for any domain. An agent skill from shareAI-lab/learn-claude-code.

    78k GitHub starsUsed in 6 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Add Uint Support

    pytorch/pytorch

    Add unsigned integer (uint) type support to PyTorch operators by updating ATDISPATCH macros.

    104k GitHub starsUsed in 2 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Peft Fine Tuning

    Orchestra-Research/AI-Research-SKILLs

    Parameter-efficient fine-tuning for LLMs using LoRA, QLoRA, and 25+ methods.

    13k GitHub starsUsed in 9 repos~3.1k tokens
    AI & LLM EngineeringAuto-check passed
  • Segment Anything Model Guide

    Orchestra-Research/AI-Research-SKILLs

    Guide to using Meta's Segment Anything Model for zero-shot image segmentation with point, box or mask prompts, or automatic mask generation.

    13k GitHub starsUsed in 9 repos~3.3k tokens
    AI & LLM EngineeringAuto-check passed
  • 1password

    trpc-group/trpc-agent-go

    Set up and use 1Password CLI (op). An agent skill from trpc-group/trpc-agent-go.

    1.8k GitHub starsUsed in 13 repos~656 tokens
    AI & LLM EngineeringAuto-check passed
  • Chroma Vector Database

    Orchestra-Research/AI-Research-SKILLs

    Shows how to store documents and embeddings in Chroma, query them by similarity with metadata filters, and persist them to disk for RAG and semantic search projects.

    13k GitHub starsUsed in 8 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed

More from Eigenwise/eigenwise-toolshed

All 14 skills in this repo
  • Map Codebase

    Eigenwise/eigenwise-toolshed

    Create a self-maintaining codebase map in .claude/.codebase-info/.

    277 GitHub stars~4.2k tokensUpdated 2 days ago
    Auto-check passed
  • Setup

    Eigenwise/eigenwise-toolshed

    Set up a Claude Code workspace for a new or existing project, informed by hindsight from the user's whole session history.

    277 GitHub stars~4.5k tokensUpdated 2 days ago
    Auto-check passed
  • Groom

    Eigenwise/eigenwise-toolshed

    Audit a Sidequest board for completed, stale, duplicate, or superseded tickets, then safely close clear cases.

    277 GitHub stars~3.4k tokensUpdated 2 days ago
    Auto-check passed
  • Manage Rules

    Eigenwise/eigenwise-toolshed

    Inspect, audit, enable, or disable project live-rules. An agent skill from Eigenwise/eigenwise-toolshed.

    277 GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed
  • Toolshed Doctor

    Eigenwise/eigenwise-toolshed

    Run a read-only health check for Quartermaster and installed Toolshed plugins.

    277 GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Enable Project Telemetry

    Eigenwise/eigenwise-toolshed

    Opt the current project into local Claude Code usage telemetry, or verify its setup.

    277 GitHub stars~2.9k tokensUpdated 2 days ago
    Auto-check: warnings

Questions about Add Rule

What does Add Rule do?

Create or edit a live-rules instruction in the project's atomic rule set. Add Rule is an agent skill from Eigenwise/eigenwise-toolshed. Create or edit a live-rules instruction in the project's atomic rule set.

When should I use Add Rule?

Add Rule fits situations like: coding guideline; automatic reminder.

How do I install Add Rule in Claude Code?

Run `npx skills add Eigenwise/eigenwise-toolshed --skill add-rule -a claude-code`. Or copy the skill folder (plugins/live-rules/skills/add-rule in Eigenwise/eigenwise-toolshed) into .claude/skills/add-rule in your project. Claude Code loads it when a task matches its description.

How do I install Add Rule in Codex?

Run `npx skills add Eigenwise/eigenwise-toolshed --skill add-rule -a codex`. Or copy the skill folder (plugins/live-rules/skills/add-rule in Eigenwise/eigenwise-toolshed) into .agents/skills/add-rule in your project. Codex loads it when a task matches its description.

Can I use Add Rule in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Eigenwise/eigenwise-toolshed --skill add-rule -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-rule, .gemini/skills/add-rule, .github/skills/add-rule and .opencode/skills/add-rule in your project.

What does Add Rule need to run?

SKILL.md names no scripts, command-line tools or credentials: Add Rule is instructions for the agent only.

Does Add Rule access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Add Rule safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Rule use?

Add Rule is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Rule use?

About 1.9k tokens (SKILL.md is roughly 7.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.7k tokens, read only when the agent opens those files.

What are the alternatives to Add Rule?

Skills that share tags, products or a category with Add Rule: Agent Builder (shareAI-lab/learn-claude-code, 78k stars), Add Uint Support (pytorch/pytorch, 104k stars), Peft Fine Tuning (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Segment Anything Model Guide (Orchestra-Research/AI-Research-SKILLs, 13k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Rule?

Eigenwise (a GitHub user) maintains it in Eigenwise/eigenwise-toolshed, which has 277 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 5, 2026.

Source: Eigenwise/eigenwise-toolshed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.