# Markdown Cheat Sheet for AI-Native Repositories A quick reference for the most common Markdown formatting options used in documentation and Git repositories. --- ## 1. Headings ```markdown # H1 Title ## H2 Section ### H3 Subsection #### H4 ##### H5 ###### H6 ``` Example: ```markdown # Authentication System ## Requirements ### Login Flow ``` --- ## 2. Paragraphs Just write text with a blank line between paragraphs. ```markdown This is a paragraph. This is another paragraph. ``` --- ## 3. Bold ```markdown **bold text** ``` Example: ```markdown The **Knowledge Layer** defines the system. ``` --- ## 4. Italics ```markdown *italic text* ``` or ```markdown _italic text_ ``` --- ## 5. Bold + Italic ```markdown ***bold italic*** ``` --- ## 6. Bullet Lists ```markdown - item - item - item ``` Example: ```markdown - user login - password reset - multi-factor authentication ``` --- ## 7. Nested Lists ```markdown - item - sub item - sub item ``` --- ## 8. Numbered Lists ```markdown 1. step one 2. step two 3. step three ``` Example: ```markdown 1. Define requirements 2. Design architecture 3. Generate code ``` --- ## 9. Checklists (Very Useful) ```markdown - [ ] feature not done - [x] feature completed ``` Example: ```markdown - [ ] user login - [ ] API authentication - [x] database schema ``` --- ## 10. Links ```markdown [link text](https://example.com) ``` Example: ```markdown [Git Documentation](https://git-scm.com/docs) ``` --- ## 11. Internal Links ```markdown [Architecture](architecture.md) ``` or ```markdown [Data Model](docs/data-model.md) ``` --- ## 12. Images ```markdown ![alt text](image.png) ``` Example: ```markdown ![system diagram](architecture.png) ``` --- ## 13. Inline Code Use backticks. ```markdown `code` ``` Example: ```markdown The main file is `main.py` ``` --- ## 14. Code Blocks Use triple backticks. ````markdown ``` code here ``` ```` Example: ````markdown ```python def login(user): return True ``` ```` --- ## 15. Tables ```markdown | Field | Type | Description | |------|------|-------------| | id | integer | unique user id | | email | string | user email | ``` --- ## 16. Horizontal Divider ```markdown --- ``` Example: --- Used to separate sections. --- ## 17. Quotes ```markdown > quoted text ``` Example: > Context defines the system. --- ## 18. Collapsible Sections (GitHub Feature) ```markdown
Click to expand Hidden content
``` --- ## 19. Anchors (Link to a Section) Header: ```markdown ## Architecture ``` Link: ```markdown [Go to Architecture](#architecture) ``` --- ## 20. Comments (Hidden) ```markdown ``` Useful for leaving notes for AI. --- ## 21. File Tree Example ``` repo/ docs/ src/ tests/ ``` --- ## Recommended Style for System Documentation ```markdown # Authentication System ## Purpose Explain why this system exists. ## Requirements - Users can log in - Passwords must be hashed ## Architecture Describe services and infrastructure. ## Data Model | Field | Type | Description | |------|------|-------------| | id | integer | unique id | | email | string | user email | ## API Endpoints used by the system. ## Notes Future improvements. ``` --- ## Two Markdown Habits That Help AI ### 1. Use Consistent Headings ```markdown ## Purpose ## Requirements ## Architecture ## Data Model ## API ``` ### 2. Keep File Structure Predictable Predictable sections help AI navigate documentation and generate consistent code. --- ## Standard Section Headers AI performs far better when documents follow a consistent structure. It can quickly locate relevant sections. Example template for most docs: # Title ## Purpose Why this exists. ## Context Background information. ## Requirements What must be true. ## Architecture How the system works. ## Data Model Entities, fields, relationships. ## API External interactions. ## Constraints Limitations and rules. ## Future Work Potential improvements. ## Always Start Files With a System Summary Every major .md file should begin with a short system summary. AI quickly understands what the document is about without scanning the whole file. Improves retrieval, summarization, code generation. Example: # Authentication Service ## Purpose Handles user authentication, session creation, and credential validation. ## Scope - User login - Token validation - Password reset ## Use Explicit Entity Definitions When describing data or objects, define them clearly and consistently. Example: ## Entity: User | Field | Type | Description | |------|------|-------------| | id | UUID | unique identifier | | email | string | login credential | | password_hash | string | encrypted password | ## Use File Maps (Repo Navigation) Add file trees inside docs to help AI understand the system structure. AI tools often scan these maps first to understand project layout. Example: ## System Structure repo/ docs/ src/ services/ models/ routes/ tests/ ops/ ## Use Explicit Rules and Constraints Sections AI needs clear rules. AI uses these rules to avoid generating incorrect code. Without constraints, AI may guess. Example: ## Rules - Email must be unique - Password must be hashed - Tokens expire after 15 minutes or ## Constraints - PostgreSQL database - REST API - Python backend underline