Use when creating CLAUDE.md, improving existing CLAUDE.md, or setting up project configuration. Use when user says "create CLAUDE.md", "setup project", "add laws", "configure agent".
View on GitHubSelect agents to install to:
npx add-skill https://github.com/wayne930242/Reflexive-Claude-Code/blob/main/plugins/rcc/skills/writing-claude-md/SKILL.md -a claude-code --skill writing-claude-mdInstallation paths:
.claude/skills/writing-claude-md/# Writing CLAUDE.md ## Overview **Writing CLAUDE.md IS establishing a constitution for your project.** The `<law>` block mechanism forces Claude to actively repeat constraints each response, preventing context drift over long conversations. **Core principle:** Laws without Self-Reinforcing Display drift out of context. The display IS the enforcement. **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-claude-md] Task N: <action>" - ActiveForm: "<doing action>" ``` **Tasks:** 1. Analyze current state 2. RED - Test without proper laws 3. GREEN - Write constitution 4. Add project content 5. Validate structure 6. REFACTOR - Quality review 7. Test with new session Announce: "Created 7 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 CLAUDE.md | TDD Phase | CLAUDE.md Creation | What You Do | |-----------|-------------------|-------------| | **RED** | Test without laws | Observe agent without proper `<law>` block | | **Verify RED** | Document drift | Note where agent forgot constraints | | **GREEN** | Write constitution | Create `<law>` block addressing drift | | **Verify GREEN** | Test enforcement | Verify laws displayed every response | | **REFACTOR** | Improve laws | Make laws more specific, verifiable | ## Task 1: Analyze Current State **Goal:** Understand what exists and what's needed. **If CLAUDE.md exists:** 1. Read current content 2. Check for `<law>` blocks 3. Identify missing or weak laws 4. Note project structure accuracy **If no CLAUDE.md:** Document project basics (name, purpose