Documentation structure heuristics and sitemap patterns for different codebase types and team sizes. Covers horizontal (concern-based), vertical (domain-based), and hybrid patterns...
Guidelines for organizing technical documentation based on codebase characteristics and team structure.
| Pattern | Best For | Team Size | Example Projects |
|---|---|---|---|
| Pattern A (Horizontal) | Single codebase, clear concerns | 5-15 people | Fullstack SPA, monolithic API |
| Pattern B (Vertical) | Multiple domains, clear boundaries | 10-30 people | Multi-product platform, B2B SaaS |
| Pattern C (Hybrid) | Monorepo, microservices | 20+ people | Enterprise platform, large open source |
Use when:
Characteristics:
wiki/
βββ README.md # Project overview and quick links
βββ overview/
β βββ system-overview.md # What the system does
β βββ technology-stack.md # Languages, frameworks, tools
β βββ glossary.md # Domain terminology
βββ architecture/
β βββ system-architecture.md # High-level design
β βββ data-model.md # Database schema
β βββ api-design.md # API patterns and conventions
βββ development/
β βββ getting-started.md # Local setup guide
β βββ coding-standards.md # Style guide
β βββ testing.md # Test strategy
βββ deployment/
β βββ infrastructure.md # Cloud resources
β βββ ci-cd.md # Pipeline documentation
β βββ environments.md # Dev/staging/prod details
βββ operations/
βββ monitoring.md # Observability setup
βββ runbooks.md # Incident procedures
βββ security.md # Security practices
# Project Wiki
## Quick Links
- [Getting Started](development/getting-started.md)
- [Architecture Overview](architecture/system-architecture.md)
- [API Reference](architecture/api-design.md)
## Sections
| Section | Description |
|---------|-------------|
| [Overview](overview/) | System purpose and technology |
| [Architecture](architecture/) | Design and technical decisions |
| [Development](development/) | Setup and coding practices |
| [Deployment](deployment/) | Infrastructure and CI/CD |
| [Operations](operations/) | Monitoring and security |
Use when:
Characteristics:
wiki/
βββ README.md # Project overview
βββ overview/
β βββ system-overview.md
β βββ technology-stack.md
βββ domains/
β βββ user-management/
β β βββ README.md # Domain overview
β β βββ authentication.md
β β βββ authorization.md
β β βββ user-profiles.md
β βββ billing/
β β βββ README.md
β β βββ subscriptions.md
β β βββ payments.md
β β βββ invoicing.md
β βββ notifications/
β βββ README.md
β βββ email.md
β βββ push.md
β βββ in-app.md
βββ integrations/
β βββ stripe.md
β βββ sendgrid.md
β βββ twilio.md
βββ platform/
β βββ architecture.md
β βββ infrastructure.md
β βββ security.md
βββ development/
βββ getting-started.md
βββ contributing.md
# Project Wiki
## Domains
Each domain has its own documentation section:
| Domain | Owner | Description |
|--------|-------|-------------|
| [User Management](domains/user-management/) | Auth Team | Authentication, profiles |
| [Billing](domains/billing/) | Payments Team | Subscriptions, payments |
| [Notifications](domains/notifications/) | Platform Team | Email, push, in-app |
## Cross-Cutting
- [Integrations](integrations/) β Third-party services
- [Platform](platform/) β Shared infrastructure
- [Development](development/) β Setup and standards
Use when:
Characteristics:
wiki/
βββ README.md # Monorepo overview
βββ overview/
β βββ system-overview.md
β βββ architecture.md # System-wide architecture
β βββ technology-stack.md
βββ services/
β βββ api-gateway/
β β βββ README.md
β β βββ routing.md
β β βββ authentication.md
β βββ user-service/
β β βββ README.md
β β βββ api.md
β β βββ data-model.md
β βββ order-service/
β β βββ README.md
β β βββ api.md
β β βββ workflows.md
β βββ notification-service/
β βββ README.md
β βββ channels.md
βββ packages/
β βββ shared-ui/
β β βββ README.md
β βββ common-utils/
β β βββ README.md
β βββ api-client/
β βββ README.md
βββ infrastructure/
β βββ kubernetes.md
β βββ terraform.md
β βββ ci-cd.md
βββ development/
βββ getting-started.md
βββ local-development.md
βββ service-template.md
# Monorepo Wiki
## Services
| Service | Team | Port | Description |
|---------|------|------|-------------|
| [API Gateway](services/api-gateway/) | Platform | 3000 | Routing, auth |
| [User Service](services/user-service/) | Identity | 3001 | User management |
| [Order Service](services/order-service/) | Commerce | 3002 | Order processing |
| [Notification Service](services/notification-service/) | Platform | 3003 | Messaging |
## Shared Packages
| Package | Description |
|---------|-------------|
| [shared-ui](packages/shared-ui/) | React components |
| [common-utils](packages/common-utils/) | Utility functions |
| [api-client](packages/api-client/) | Generated API client |
## Platform
- [Infrastructure](infrastructure/) β Kubernetes, Terraform
- [Development](development/) β Setup, contributing
START
β
ββ Is it a monorepo with multiple services/packages?
β ββ YES β Pattern C (Hybrid)
β ββ NO β
β
ββ Are there 3+ distinct business domains?
β ββ YES β Pattern B (Vertical)
β ββ NO β
β
ββ Default β Pattern A (Horizontal)
Pattern A signals:
package.json or requirements.txt/src with /components, /services, /models structurePattern B signals:
/features/* or /domains/*)Pattern C signals:
package.json files (monorepo)/services/* or /packages/* structurekebab-case: user-management, api-gatewaykebab-case.md: system-architecture.md<area>-<topic>.md or <domain>-<feature>.mdEach folder should have:
README.md β Overview and navigationFor each page in your sitemap, define:
#### Page: `path/to/page.md`
**Purpose:** [1-2 sentences: what this page covers and why it matters]
**Required sections:**
- Section 1: [Description]
- Section 2: [Description]
- Code examples: Yes/No
- Tables: Yes/No
**Required diagrams:**
- [c4-context | c4-container | sequence | deployment | class | integration]
**Relevant source files:**
- `src/path/to/file.ts` β [Why relevant]
- `src/path/**/*.ts` β [Pattern/folder relevance]
**Cross-references:**
- Links to: [related pages]
- Linked from: [pages that reference this]
Every folder needs a README.md that:
All pages should include: Home > [Section] > [Page]
*[Home](../README.md) > [Architecture](./README.md) > System Architecture*
# System Architecture
...
[text](../path/to/page.md)Include in front matter:
---
title: Page Title
generated_at: 2026-01-22T10:00:00Z
commit: abc123 (if available)
last_updated: 2026-01-22T10:00:00Z
---
| Project Size | Recommended Pages | Pattern |
|---|---|---|
| Small (< 10k LOC) | 5-10 pages | Pattern A |
| Medium (10k-100k LOC) | 10-20 pages | Pattern A or B |
| Large (100k+ LOC) | 15-30 pages | Pattern B or C |
| Monorepo | 20-50 pages | Pattern C |
Warning signs of over-documentation:
Version: 1.0 Last Updated: 2026-01-22