Przejdź do treści
Biblioteka skilli
AI i agenci · Budowanie i kod

create-rule

/create-rule

Pomaga tworzyć i aktualizować pliki reguł Claude Code w .claude/rules, z formatem, zakresem ścieżek i dobrymi praktykami.

Repozytorium
skill-issue ↗
Licencja
MIT
Ostatnia zmiana repozytorium
16.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 16.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pomaga tworzyć i aktualizować pliki reguł Claude Code w .claude/rules, z formatem, zakresem ścieżek i dobrymi praktykami.

Oryginalny opis (EN)

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.

Jak działa

  1. Rules vs CLAUDE.md vs Skills
  2. Storage Locations
  3. Rule File Format
  4. Path Scoping Decision
  5. Writing Effective Rules
  6. Workflow
  7. Authoring Checklist
  8. Anti-Patterns
  9. Additional Resources
Sekcje z nagłówków SKILL.md, w oryginale · 95 linii, 551 słów
Podgląd SKILL.md
---
name: create-rule
description: 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.
---

# 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

```markdown
---
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](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.

## Workflow

1. **New or update?** Check existing rules in the target directory for overlap
2. **Scope**: personal (`~/.claude/rules/`) or project (`.claude/rules/`)?
3. **Path scope**: universal (no frontmatter) or file-type specific?
4. **Check for conflicts**: scan existing rules for contradictions or duplication
5. **Write the file**: concrete, verifiable instructions; one topic
6. **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](references/rule-patterns.md)
- Official docs: https://code.claude.com/docs/en/memory#organize-rules-with-clauderules
Pliki w paczce (2)
  • SKILL.md 4 KB
  • references/rule-patterns.md 4 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · paultyng/skill-issue100MIT
coco-research/coco100MIT
ShenQingchuan/skills100MIT
kensaurus/cursor-kenji100MIT
seqra/opentaint96Apache-2.0
NeoLabHQ/context-engineering-kit95GPL-3.0

Migawka bazy z 13.11.2026 · wersja paczki b585768a9dea (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100rule-creator
    Tworzy ścieżkowe pliki reguł w .claude/rules, które dołączają się automatycznie, gdy dotykane są pasujące pliki projektu.
  • 84check
    Weryfikuje reguły Claude Code z zakresem ścieżek: każdy glob w .claude/rules/ musi się rozwiązywać, a indeks reguł zgadzać się z dyskiem.
  • 100blueprint-rules
    Zarządza plikami reguł w .claude/rules/: dodaje, edytuje, wylicza i waliduje frontmatter paths, przy regułach ograniczonych do ścieżek i naprawie wzorców glob.
  • 95rules-authoring
    Pomaga pisać pliki reguł .claude/rules/*.md, czyli ograniczenia stosowane automatycznie do wybranych plików.
  • 100skill-developer
    Tworzy i zarządza skillami Claude Code zgodnie z dobrymi praktykami, modyfikuje skill-rules.json i diagnozuje aktywację skilli.
  • 100writing-hookify-rules
    Pomaga pisać reguły hookify, czyli konfigurację i składnię reguł dla hooków Claude Code.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.