create-rule
Skill8 starsChanged 3 months agoMITView on GitHub
Use when creating, writing, or updating a Claude Code rule file (.claude/rules/*.md or ~/.claude/rules/*.md), or when asking about rule format, path scoping, or rule best practices.
We split this skill into the rules it gives an agent
8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
If the instruction only makes sense for certain file types (e.g.
- Distinctive: line 48
Use always-load (no frontmatter) for:
- Very specific: line 54
Test files: /*_test.go, /*.test.ts, /*.spec.ts
- Distinctive: line 64
Markdown structure: use headers and bullets, not dense paragraphs
- Very specific: line 66
Use RFC 2119 key words for requirement levels (MUST / SHOULD / MAY), sparingly and only for genuine requirements.
- Distinctive: line 70
New or update?: Check existing rules in the target directory for overlap
- Distinctive: line 89
Duplicating defaults: don't document what Claude already does correctly
- Distinctive: line 93
Workflow steps in rules: if it's a multi-step process, use a skill instead
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 thenormative-languagerule. For a requirement that is also frequently violated, add a short "Frequently missed:" lead-in.
Workflow
- New or update? Check existing rules in the target directory for overlap
- Scope: personal (
~/.claude/rules/) or project (.claude/rules/)? - Path scope: universal (no frontmatter) or file-type specific?
- Check for conflicts: scan existing rules for contradictions or duplication
- Write the file: concrete, verifiable instructions; one topic
- Verify: confirm file is under 200 lines and uses specific language
Authoring Checklist
- Description starts with "Use when..." if this is actually a skill (wrong tool if so)
- Topic is focused: one concern per file
- Path scope matches actual applicability (don't always-load a Go-only rule)
- Instructions are concrete and verifiable, not vague
- No contradictions with existing rules in the same directory
- File is under 200 lines
Anti-Patterns
- Vague rules: "write clean code", "be consistent". Not actionable
- Duplicating defaults: don't document what Claude already does correctly
- Over-specifying: bloated rule files cause Claude to ignore them
- Wrong scope: file-type-specific rules (Go, SQL) in always-load waste context
- Contradictions: two rules giving conflicting guidance on the same behavior
- Workflow steps in rules: if it's a multi-step process, use a skill instead
Additional Resources
- Full glob pattern examples and good/bad rule samples: references/rule-patterns.md
- Official docs: https://code.claude.com/docs/en/memory#organize-rules-with-clauderules
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- cartography-cncf/cartography★ 4.2ksame name
- ComplianceAsCode/content★ 2.8ksame name
- OffchainLabs/arbitrum-docs★ 252same name
- seqra/opentaint★ 170same name
- mgiovani/cc-arsenal★ 8same name
- ArangoGutierrez/claude-toolkit★ 4same name
- ralphkrauss/agent-orchestrator★ 4same name
- 0mlkrizzz655335v/claude-skills-zh★ 2same name
- 32103210/cursor-skills★ 1same name
- Goodnessmbakara/codex-skills★ 1same name
8 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use review-bugbot, update-cli-config and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
0mlkrizzz655335vSkillreview-bugbot
缺陷导向代码审查。用 Bugbot 子代理找 bug。
Also in 5 projects that use this
PandelisZSkillupdate-cli-config
View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.
Also in 7 projects that use this
0mlkrizzz655335vSkillorigin
origin CLI 管理。安装、登录、更新、修复 origin.cursor.com 的 CLI。"disabled-environments:
Also in 3 projects that use this
Tsumugii24Skillsplit-to-prs
Split current work into small reviewable PRs. Use when the user asks to split a chat, set of changes, branch, or PR.
Also in 7 projects that use this
MicrosoftSkillcreate-hook
Create a hook (.json) to enforce policy or automate agent lifecycle events.
Also in 9 projects that use this
ffsshhttiikkSkillshell
Shell command-line interpreters and environments
Also in 7 projects that use this
- +3 more from 0mlkrizzz655335v
In this repository38 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- active-readSkill
- active-reviewSkill
- analyze-knowledgeSkill
- audit-accomplishmentsSkill
- audit-historySkill
- bisectSkill
- ci-debug-loopSkill
- create-decision-documentSkill
- create-jira-itemSkill
- create-prSkill
- create-skillSkill
- discover-patternsSkill
- evaluate-dependencySkill
- fix-pr-conflictSkill
- implement-planSkill
- match-voiceSkill
- push-and-watchSkill
- rebase-pr-chainSkill
- review-allSkill
- review-api-compatSkill
- review-ciSkill
- review-codeSkill
- review-coverageSkill
- review-databaseSkill
- review-documentationSkill
- review-infrastructureSkill
- review-observabilitySkill
- review-performanceSkill
- review-planSkill
- review-reliabilitySkill
- review-securitySkill
- review-trajectorySkill
- set-session-contextSkill
- ship-itSkill
- simplify-proseSkill
- start-daySkill
- verify-when-completeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

