ClaudedocumentationDocumentation

Documentation Claude Rules

Claude rules for writing excellent documentation: README structure, API docs, code comments, and architecture docs.

CLAUDE.md
- Write READMEs with: quick start, install, usage examples, configuration, contributing
- Document the why in comments, not the what (code already shows the what)
- Maintain an ARCHITECTURE.md or DECISIONS.md for key technical decisions (ADRs)
- Generate API reference docs from code annotations; keep them in sync with CI
- Write runbooks for all operational procedures (deploy, rollback, incident response)
- Use diagrams-as-code (Mermaid) for architecture diagrams; commit them with the code
- Document environment variables in .env.example with descriptions for all keys
- Add examples for every non-trivial function; examples are documentation too

How to use with Claude

Create a `CLAUDE.md` file in your project root. Claude Code reads this on startup and follows your conventions throughout the session.

#documentation#claude#readme#adr#coding-rules

Related Rules