Skip to content
Skills Library
AI & agents · Building & coding

creating-claude-rules

/creating-claude-rules

Use when creating or fixing .claude/rules/ files - provides correct paths frontmatter (not globs), glob patterns, and avoids Cursor-specific fields like alwaysApply

Repository
relay ↗
Licence
Apache-2.0
Last repository change
27.10.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Use when creating or fixing .claude/rules/ files - provides correct paths frontmatter (not globs), glob patterns, and avoids Cursor-specific fields like alwaysApply

Original author description

Use when creating or fixing .claude/rules/ files - provides correct paths frontmatter (not globs), glob patterns, and avoids Cursor-specific fields like alwaysApply

How it works

  1. Overview
  2. When to Use
  3. Quick Reference
  4. Frontmatter
  5. Common Mistakes
  6. Directory Structure
  7. Glob Patterns
  8. Reference
Original SKILL.md headings · 116 lines, 312 words
SKILL.md preview
---
name: creating-claude-rules
description: Use when creating or fixing .claude/rules/ files - provides correct paths frontmatter (not globs), glob patterns, and avoids Cursor-specific fields like alwaysApply
---

# 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 (`globs` instead of `paths`)
- 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

```yaml
---
paths:
  - 'src/api/**/*.ts'
  - 'tests/**/*.test.ts'
---
```

Or single pattern:

```yaml
---
paths: src/**/*.{ts,tsx}
---
```

### Global Rules

Omit frontmatter entirely - applies to all files:

```markdown
# TypeScript Conventions

Use .js extensions in imports.
```

## Common Mistakes

```yaml
# ❌ WRONG - globs is Cursor format
---
globs:
  - '**/*.ts'
---
# ✅ CORRECT - Claude uses paths
---
paths:
  - '**/*.ts'
---
```

```yaml
# ❌ WRONG - alwaysApply is Cursor-only
---
alwaysApply: true
---
# ✅ CORRECT - just omit paths for global rules
# (no frontmatter needed)
```

```yaml
# ❌ 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.md
```

Files 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/

Versions

RepositoryScoreLicence
This page · agentworkforce/relay95Apache-2.0
pr-pm/prpm100MIT

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 2c4683fcf969 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100rules-eval
    Evaluate Claude Code rules in .claude/rules/. Use for frontmatter, globs, and quality audits.
  • 100blueprint-rules
    Rule files in .claude/rules/: add, edit, list, or validate paths: frontmatter. Use when adding a path-scoped rule file, listing which rules load, or fixing rule globs.
  • 100creating-continue-packages
    Use when creating Continue rules - provides required name field, alwaysApply semantics, glob/regex patterns, and markdown format with optional frontmatter
  • 100eval-rules
    Audit Claude Code instruction rules in .claude/rules/ and ~/.claude/rules/: frontmatter, paths glob validity against real files, symlink load status, and day-to-day usefulness, then update rules with the user. Use for first-time rules setup, rules that apply too often or never,…
  • 84check
    Pass/fail gate over path-scoped instruction surfaces: every .claude/rules/ glob must resolve, and the always-loaded rules index must match disk. Failures are SILENT in Claude Code. Use when: 'check my rules', 'are my path-scoped rules actually firing', 'is the rules index…
  • 100eval-rules
    Audit .claude/rules/ files for structural correctness, glob validity, and real-world usefulness. Resolves each paths: pattern against actual project files, then asks the user whether each rule is still relevant and useful. Can update rules in-place based on answers. Use when…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.