writing-rules

Installation
SKILL.md

Writing Rules

Scope: covers .claude/rules/ file authoring. For CLAUDE.md conventions, see [[writing-plugins]]. For system prompts generally, see [[writing-prompts]].

1. The Golden Format

Every rule should have three parts:

**Use X, not Y.** Without X, [concrete bad thing happens]. Y causes [specific problem] because [mechanism].
Part Purpose Example
Imperative What to do Use Result<T, AppError> for all API handler returns.
Consequence What goes wrong without it Without it, errors propagate as 500s with no context.
Mechanism Why it fails Raw panics bypass the error middleware and crash the worker.

One-Line Rules (when mechanism is obvious)

Related skills
Installs
1
GitHub Stars
44
First Seen
5 days ago