Use when creating rule files in .claude/rules/, adding project conventions, or scoping guidelines to specific paths. Use when user says "add rule", "create convention", "scope guideline". NOT for laws (use <law> in CLAUDE.md).
View on GitHubplugins/rcc/skills/writing-rules/SKILL.md
February 5, 2026
Select agents to install to:
npx add-skill https://github.com/wayne930242/Reflexive-Claude-Code/blob/main/plugins/rcc/skills/writing-rules/SKILL.md -a claude-code --skill writing-rulesInstallation paths:
.claude/skills/writing-rules/# Writing Rules ## Overview **Writing rules IS creating scoped, auto-injected conventions.** Rules auto-inject into context when files match their `paths:` glob. Keep them concise—every line costs tokens. **Core principle:** Rules = conventions for specific files. Laws = immutable constraints for ALL responses. Don't confuse them. **Violating the letter of the rules is violating the spirit of the rules.** ## Task Initialization (MANDATORY) Before ANY action, create task list using TaskCreate: ``` TaskCreate for EACH task below: - Subject: "[writing-rules] Task N: <action>" - ActiveForm: "<doing action>" ``` **Tasks:** 1. Analyze requirements 2. RED - Test without rule 3. GREEN - Write rule file 4. Validate structure 5. REFACTOR - Quality review 6. Test activation Announce: "Created 6 tasks. Starting execution..." **Execution rules:** 1. `TaskUpdate status="in_progress"` BEFORE starting each task 2. `TaskUpdate status="completed"` ONLY after verification passes 3. If task fails → stay in_progress, diagnose, retry 4. NEVER skip to next task until current is completed 5. At end, `TaskList` to confirm all completed ## TDD Mapping for Rules | TDD Phase | Rule Creation | What You Do | |-----------|---------------|-------------| | **RED** | Test without rule | Work on matching files, note inconsistencies | | **Verify RED** | Document gaps | Note where conventions were forgotten | | **GREEN** | Write rule | Create `.claude/rules/` file addressing gaps | | **Verify GREEN** | Test injection | Verify rule activates on matching files | | **REFACTOR** | Optimize scope | Tighten `paths:` globs, reduce line count | ## Task 1: Analyze Requirements **Goal:** Understand what convention to encode and where it applies. **Questions to answer:** - What convention needs enforcement? - Which files should this apply to? - Is this a LAW (immutable) or RULE (convention)? - Does this rule already exist? **Decision:** ``` Is it IMMUTABLE (must display every response)? ├─ Yes →