Documentation Rules
Defines when to create, update, or delete documentation in a `/docs` folder, with examples of good and bad file structures.
What this file does
Defines when to create, update, or delete documentation in a /docs folder, with examples of good and bad file structures.
When to use it
- Setting up documentation conventions for a new project
- Enforcing a clean project root with docs in a subfolder
- Establishing rules for what belongs in docs vs git history
- Onboarding a team to consistent documentation practices
Documentation Rules
Documentation Location
- All documentation files MUST be placed in the
/docsfolder - Never create markdown documentation files in the project root
- Keep the root clean with only essential files (README.md, package.json, etc.)
When to Create Documentation
Documentation should be created and kept in source control ONLY if it meets these criteria:
✅ CREATE DOCUMENTATION FOR:
- Complex Integrations - Thirdweb, Supabase, external APIs
- Architecture Decisions - Why certain approaches were chosen
- Setup Guides - Required environment variables, configuration steps
- User Guides - How end-users should use major features
- Cross-Cutting Concerns - Authentication, caching, deployment
- Known Gotchas - Issues that future developers will encounter (e.g., smart account auth)
❌ DO NOT CREATE DOCUMENTATION FOR:
- Simple Bug Fixes - These are documented in commit messages
- Feature Implementation Details - Code should be self-documenting
- Debugging Sessions - Temporary troubleshooting notes
- Implementation Changelogs - Use git history instead
- Duplicate Information - If it exists elsewhere, link to it
- Prototype Summaries - Once feature is complete, document the final version only
Documentation Format
When creating documentation:
- Use a clear, descriptive filename - e.g.,
FEATURE_NAME_GUIDE.md - Include these sections:
- Overview - What is this?
- Setup/Prerequisites - What's needed?
- Usage - How to use it?
- Technical Details - How does it work?
- Troubleshooting - Common issues
- Update
/docs/README.md- Add your new doc to the index - Keep it current - Update docs when implementation changes
- Avoid duplication - Reference existing docs instead of repeating
Documentation Maintenance
When to Delete Documentation:
- Feature has been removed
- Information is outdated and no longer relevant
- Content has been consolidated into another doc
- Temporary debugging guides after issue is resolved
When to Update Documentation:
- Implementation has changed
- New configuration options added
- Known issues have been resolved
- User workflows have changed
Example Good Documentation Structure:
/docs
README.md # Index of all docs
THIRDWEB_API.md # Integration guide
GIFT_EXCHANGE_SETUP.md # Complex feature setup
SIWE_AUTHENTICATION.md # Cross-cutting concern
USER_GUIDE_EXCHANGES.md # End-user documentation
Example Bad Documentation Structure:
/docs
BUG_FIX_PURCHASER_123.md # ❌ Bug fixes don't need docs
IMPLEMENTATION_NOTES_V1.md # ❌ Use git history
DEBUGGING_SESSION_NOV_2.md # ❌ Temporary troubleshooting
COMPONENT_DETAILS.md # ❌ Code should be self-documenting
CHANGELOG_FEATURE_X.md # ❌ Use git commits
What's inside
6 sections covering location, creation criteria, format, maintenance, and two example directory trees
Change this for your project
- Replace
/docswith your own documentation folder path if different - Replace example filenames like
THIRDWEB_API.mdwith your own integration names - Replace
GIFT_EXCHANGE_SETUP.mdwith your own feature-specific doc names
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Separating doc-worthy topics (complex integrations, architecture) from git-history-only items (bug fixes, debugging)
- Maintaining a
/docs/README.mdindex that must be updated when new docs are added - Using clear filename conventions like
FEATURE_NAME_GUIDE.mdfor discoverability
Related Documents
dbt Core
Defines a complete dbt project setup with layered architecture, SQL style, Jinja best practices, and CI/CD workflow guidance.
HarmonyOS 主题与样式 - Cursor Rules
Defines HarmonyOS theming rules for dark/light mode, page brightness, and screen-on control with code examples.
Cursor Development Environment
Documents a Docker-based dev container setup with test commands and OpenClaw agent configuration for the ClawDrive project.
Journey from Concept to Code: Transforming Cursor into a Devin-like AI Assistant
Documents the creation of aicode.cursorrules, a set of rules that turns Cursor/Windsurf into a Devin-like AI assistant with automated planning and self-evolution.