create-rule

create-rule is a skill for Claude Code, Codex from paultyng/skill-issue. It costs 48 tokens per session (1,016 once invoked), scanned A, original, MIT.

A guide for creating instruction files for Claude Code, an AI coding assistant. These rules can apply to every project session or only when working with matching file paths.

In plain words
What is it for?
Use it to write or update .claude/rules files, choose path matching, and understand when to use rules, CLAUDE.md, or skills.
Why use it?
It helps prevent project instructions, reusable workflows, and file-specific guidance from being placed in the wrong kind of file. It also explains where shared and personal rules belong.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Good fit Use it to write or update .claude/rules files, choose path matching, and understand when to use rules, CLAUDE.md, or skills.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/paultyng/skill-issue/create-rule
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.

Any agent
npx skills add paultyng/skill-issue --skill create-rule
Clone the repo
git clone --depth 1 https://github.com/paultyng/skill-issue

Made for: Claude Code, Codex.

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 create-rule

README.md
[![agentmods](https://agentmods.dev/badge/skills/paultyng/skill-issue/create-rule/github.svg)](https://agentmods.dev/skills/paultyng/skill-issue/create-rule)
Your own site
<a href="https://agentmods.dev/skills/paultyng/skill-issue/create-rule"><img src="https://agentmods.dev/badge/skills/paultyng/skill-issue/create-rule/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 create-rule

Your own site · 80×15
<a href="https://agentmods.dev/skills/paultyng/skill-issue/create-rule"><img src="https://agentmods.dev/badge/skills/paultyng/skill-issue/create-rule.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,016 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.00048 $0.01016
Opus 5.5 $0.00019 $0.00406
Sonnet 5.5 $0.00010 $0.00203
Haiku 4.5 $0.00005 $0.00102

Measured 1mo ago against content hash dd8dab42fef7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

create-rule 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 1mo 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.

skills/create-rule/SKILL.md · 99 lines

How it starts

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

Create Rule

Rules vs CLAUDE.md vs Skills

Choose the right mechanism before writing anything:

Mechanism When to use Loads
Rule Behavioral instructions scoped to a topic or file type Every session (or on path match)
CLAUDE.md Broad project context: build commands, architecture, workflows Every session
Skill Repeatable on-demand workflows Only when invoked

If the instruction only makes sense for certain file types (e.g. Go, test files), use a path-scoped rule. If it's a repeatable task workflow, use a skill instead.

Storage Locations

Scope Path
Personal, all projects on this machine ~/.claude/rules/<topic>.md
Project, shared with team via git .claude/rules/<topic>.md

Rules in subdirectories are discovered recursively (e.g. .claude/rules/frontend/react.md works).

Rule File Format

---
paths:            # optional; omit for always-load
  - "**/*.go"
  - "**/*_test.go"
---

# rule-name

Instructions...

No paths frontmatter → rule loads every session. paths present → rule loads only when Claude opens a matching file.

Path Scoping Decision

Use always-load (no frontmatter) for:

  • Universal behaviors: commit style, escalation policy, output verbosity
  • Toolchain choices: task runner, package manager, CI tooling

Use path-scoped for:

  • Language conventions: **/*.go, **/*.ts, **/*.py
  • Test files: **/*_test.go, **/*.test.ts, **/*.spec.ts
  • Domain directories: src/api/**/*, e2e/**/*.go, migrations/**/*.sql

See references/rule-patterns.md for glob pattern examples.

Writing Effective Rules

  • Specific and verifiable: "Use 2-space indentation" not "format code nicely"
  • One topic per file with a descriptive filename (testing.md, api-design.md)
  • Under 200 lines. Longer files reduce adherence; split if growing large
  • Markdown structure: use headers and bullets, not dense paragraphs
  • No contradictions across rule files; audit when adding new ones
  • Use RFC 2119 key words for requirement levels (MUST / SHOULD / MAY), sparingly and only for genuine requirements. See the normative-language rule. For a requirement that is also frequently violated, add a short "Frequently missed:" lead-in.

Read the full file on GitHub · 99 lines

Files

What ships with it

1 file 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. 1mo ago First seen · 99 lines · 48 tokens per session scan A dd8dab42fef7

Subscribe to this mod's changes

create-rule is a skill published in the GitHub repository paultyng/skill-issue (8 stars, last pushed 2d ago), licensed MIT. It adds 48 tokens to every session and 1,016 once invoked, about $0.0002 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

chatcrystal-debug-recall

Recall ChatCrystal memories for debugging tasks involving failing tests, compiler errors, runtime exceptions, dependency issues, environment breakage, or performance regressions. Use when historical root causes, fixes, or pitfalls may accelerate diagnosis before proposing a fix.

ZengLiangYi/ChatCrystal · 54 tokens

verify

Fact-check claims encountered during reading — dates, names, events, citations. Use when encountering historical facts or disputed claims.

yha9806/academic-writing-toolkit · 26 tokens

megalinter-check

Collect MegaLinter lint errors for the current repository. Use when the user wants to know if the code passes linting, why the MegaLinter CI job fails, or before/after fixing lint errors. Two modes - watch a CI job (GitHub Actions, GitLab CI, Azure Pipelines, Bitbucket Pipelines) and parse its logs, or run MegaLinter…

ulises-jeremias/agent-toolkit · 96 tokens

assistant

Assistant — on any repo, scan README→docs→AGENTS→CONTRIBUTING→PR templates→task runners→devcontainer→CI→configs before code; cite sources; prefer AGENTS.md for agent behavior; portable across Cursor/Copilot/Claude; use agent-toolkit CLI when needed.

ulises-jeremias/agent-toolkit · 64 tokens

design-improvement

WHAT - Browser-grounded iterative design improvement. Consumes design-assessment findings, defines direction, prioritizes safe vs ambiguous changes, implements within existing design system, runs app, captures rendered evidence via browser, reviews and iterates. Reuses evidence model — no new scoring framework.

ulises-jeremias/agent-toolkit · 60 tokens

codeql

CodeQL operational workflow — discover/config, run/inspect, triage SARIF findings (rule/query ID, source→sink, evidence), remediate, re-validate. Distinguishes broad MegaLinter linting from semantic security analysis.

ulises-jeremias/agent-toolkit · 52 tokens