5.3 KiB
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
# H1 Title
## H2 Section
### H3 Subsection
#### H4
##### H5
###### H6
Example:
# Authentication System
## Requirements
### Login Flow
2. Paragraphs
Just write text with a blank line between paragraphs.
This is a paragraph.
This is another paragraph.
3. Bold
**bold text**
Example:
The **Knowledge Layer** defines the system.
4. Italics
*italic text*
or
_italic text_
5. Bold + Italic
***bold italic***
6. Bullet Lists
- item
- item
- item
Example:
- user login
- password reset
- multi-factor authentication
7. Nested Lists
- item
- sub item
- sub item
8. Numbered Lists
1. step one
2. step two
3. step three
Example:
1. Define requirements
2. Design architecture
3. Generate code
9. Checklists (Very Useful)
- [ ] feature not done
- [x] feature completed
Example:
- [ ] user login
- [ ] API authentication
- [x] database schema
10. Links
[link text](https://example.com)
Example:
[Git Documentation](https://git-scm.com/docs)
11. Internal Links
[Architecture](architecture.md)
or
[Data Model](docs/data-model.md)
12. Images

Example:

13. Inline Code
Use backticks.
`code`
Example:
The main file is `main.py`
14. Code Blocks
Use triple backticks.
```
code here
```
Example:
```python
def login(user):
return True
```
15. Tables
| Field | Type | Description |
|------|------|-------------|
| id | integer | unique user id |
| email | string | user email |
16. Horizontal Divider
---
Example:
Used to separate sections.
17. Quotes
> quoted text
Example:
Context defines the system.
18. Collapsible Sections (GitHub Feature)
<details>
<summary>Click to expand</summary>
Hidden content
</details>
19. Anchors (Link to a Section)
Header:
## Architecture
Link:
[Go to Architecture](#architecture)
20. Comments (Hidden)
<!-- this will not show -->
Useful for leaving notes for AI.
21. File Tree Example
repo/
docs/
src/
tests/
Recommended Style for System Documentation
# 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
## 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 |
| 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