creating-claude-rules
Skill124 starsChanged 8 months agoMITView on GitHub
Use when creating or fixing .claude/rules/ files - provides correct paths frontmatter (not globs), glob patterns, and avoids Cursor-specific fields like alwaysApply
Files
Creating Claude Rules
Overview
Rules in .claude/rules/ are modular instructions scoped to specific files via glob patterns. They load automatically with same priority as CLAUDE.md.
When to Use
- Creating new rules in
.claude/rules/ - Fixing rules that use wrong frontmatter (
globsinstead ofpaths) - Migrating Cursor rules to Claude format
- Organizing project-specific conventions
Quick Reference
| Field | Claude | Cursor |
| Path patterns | paths | globs |
| Always apply | Omit paths | alwaysApply: true |
| Description | Not documented | description |
Frontmatter
Path-Scoped Rules
---
paths:
- "src/api/**/*.ts"
- "tests/**/*.test.ts"
---Or single pattern:
---
paths: src/**/*.{ts,tsx}
---Global Rules
Omit frontmatter entirely - applies to all files:
# TypeScript Conventions
Use .js extensions in imports.Common Mistakes
# ❌ WRONG - globs is Cursor format
---
globs:
- "**/*.ts"
---
# ✅ CORRECT - Claude uses paths
---
paths:
- "**/*.ts"
---# ❌ WRONG - alwaysApply is Cursor-only
---
alwaysApply: true
---
# ✅ CORRECT - just omit paths for global rules
# (no frontmatter needed)# ❌ WRONG - unquoted patterns
---
paths:
- **/*.ts
---
# ✅ CORRECT - quote glob patterns
---
paths:
- "**/*.ts"
---Directory Structure
.claude/rules/
├── testing.md # Path-scoped or global
├── typescript.md
└── frontend/ # Subdirectories supported
└── react.mdFiles discovered recursively. Use subdirectories to organize.
Glob Patterns
| Pattern | Matches |
**/*.ts | All .ts files anywhere |
src/**/* | Everything under src/ |
*.md | Markdown in root only |
**/*.{ts,tsx} | .ts and .tsx files |
{src,lib}/**/*.ts | .ts in src/ or lib/ |
Reference
https://code.claude.com/docs/en/memory#modular-rules-with-claude/rules/
Other versions2 projects use a version of this.
Word for word · 1
- nek1987/auto-agent-harness★ 4100% same
Edited · 1
- AgentWorkforce/relay★ 1.1k100% same
Wrote their own version · 0
None found.
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.
In this repository64 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- beanstalk-deployCursor rule
- .cursor/rules/core-principles.mdcCursor rule
- .cursor/rules/creating-agents-md.mdcCursor rule
- .cursor/rules/creating-claude-agents.mdCursor rule
- .cursor/rules/creating-claude-commands.mdCursor rule
- .cursor/rules/creating-claude-hooks.mdCursor rule
- .cursor/rules/creating-continue-packages.mdCursor rule
- .cursor/rules/creating-copilot-packages.mdCursor rule
- .cursor/rules/creating-cursor-commands.mdCursor rule
- .cursor/rules/creating-cursor-rules.mdcCursor rule
- .cursor/rules/creating-kiro-agents.mdcCursor rule
- .cursor/rules/creating-kiro-packages.mdCursor rule
- .cursor/rules/creating-skills.mdcCursor rule
- .cursor/rules/creating-windsurf-packages.mdCursor rule
- .cursor/rules/elastic-beanstalk-deployment.mdCursor rule
- .cursor/rules/format-conversion.mdcCursor rule
- .cursor/rules/github-actions-testing.mdcCursor rule
- .cursor/rules/karen-repo-reviewer.mdcCursor rule
- .cursor/rules/prpm-json-best-practices.mdcCursor rule
- .cursor/rules/self-improve-cursor.mdcCursor rule
- .cursor/rules/testing-patterns.mdcCursor rule
- .cursor/rules/typescript-type-safety.mdcCursor rule
- .cursor/rules/typescript-type-specialist.mdcCursor rule
- creating-agent-skillsSkill
- adding-new-ai-formatSkill
- agent-builderSkill
- aws-beanstalk-expertSkill
- beanstalk-deploySkill
- claude-hook-writerSkill
- creating-agents-mdSkill
- creating-claude-agentsSkill
- creating-claude-commandsSkill
- creating-claude-hooksSkill
- creating-continue-packagesSkill
- creating-copilot-packagesSkill
- creating-cursor-commandsSkill
- creating-cursor-rules-skillSkill
- creating-kiro-agentsSkill
- creating-kiro-packagesSkill
- creating-opencode-agentsSkill
- creating-opencode-pluginsSkill
- creating-skillsSkill
- creating-windsurf-packagesSkill
- creating-zed-extensionsSkill
- documentation-standardsSkill
- elastic-beanstalk-deploymentSkill
- github-actions-testingSkill
- human-writingSkill
- integrating-stripe-webhooksSkill
- karen-repo-reviewerSkill
- npm-trusted-publishingSkill
- osgrepSkill
- postgres-migrationsSkill
- prpm-developmentSkill
- prpm-json-best-practicesSkill
- pulumi-troubleshootingSkill
- self-improvingSkill
- slash-command-builderSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

