Documentation Conventions
Documentation-as-code keeps Python fleet knowledge discoverable: ADRs explain why, runbooks explain 3am steps, specs explain what ships, and READMEs route newcomers - all reviewed in PRs like application logic.
Search across all documentation pages
Documentation-as-code keeps Python fleet knowledge discoverable: ADRs explain why, runbooks explain 3am steps, specs explain what ships, and READMEs route newcomers - all reviewed in PRs like application logic.
Quick-reference recipe card - copy-paste ready.
docs/
adr/0001-use-fastapi.md
rfc/TEMPLATE.md
runbooks/orders-api.md
specs/2026-pdf-export.md
README.md # links to above# Service README minimum
- Purpose
- Local dev (uv sync, pytest)
- Deploy / rollback (link runbook)
- Owners (@team, CODEOWNERS)
- Dashboards + on-callWhen to reach for this:
# docs/adr/0002-celery-for-billing.md
## Status
Accepted
## Context
Billing emails and PDFs take 5-120s; API must return 202 quickly.
## Decision
Use Celery with Redis broker; DLQ `billing_dlq`.
## Consequences
### Positive
- Independent worker scaling
### Negative
- Operate Redis HA; monitor queue depth
## Review trigger
Queue sustained >50k or need sub-second latency# docs/runbooks/orders-api.md (excerpt)
## Rollback
kubectl rollout undo deployment/orders-api -n production
## Flag kill
CHECKOUT_MODE=checkout_v1
## Dashboards
- Grafana: Orders API SLOWhat this demonstrates:
docs/.runbook_url points to markdown in default branch.| Type | When |
|---|---|
| README | Always per service |
| ADR | Costly-to-reverse decision |
| RFC | Pre-implementation design |
| Runbook | On-call execution |
| Spec | Feature acceptance |
## Module docstring pointer
"""billing_tasks.py - see docs/runbooks/orders-api.md#celery"""docs/specs/ copy in PR.docs/.| Alternative | Use When | Don't Use When |
|---|---|---|
| Backstage TechDocs | Large catalog | Tiny fleet |
| Notion for PM specs | PM workflow | Engineering runbooks |
| Inline only | Scripts <100 LOC | Production services |
| Confluence audit | Legal mandate | Day-to-day on-call |
Markdown default; Sphinx/MyST for public API libs if publishing docs site.
Service owner; platform reviews yearly.
Per repo sequential; central index links across repos.
FastAPI generates; commit snapshot optional for diff review.
English canonical first; translate-es pipeline post-launch per site policy.
Why in ADR; how in runbook; API in docstrings for public modules.
docs/post-mortems/INC-123.md or incident tool export linked from ADR.
Mermaid in markdown preferred for git diff.
Same reviewers for code+docs when behavior changes.
Follow same conventions; contribution guidelines apply.
Stack versions: This page was written for Python 3.14.0 (stable 3.14, maintenance 3.13), FastAPI 0.115+, Django 5.2, Flask 3.1, Pydantic 2, PyTorch 2.6+, pandas 2.2+, Polars 1.x, ruff 0.9+, and uv 0.6+.
Reviewed by Chris St. John·Last updated Jul 16, 2026