Generate Operations Documentation
Overviewβ
Use CALM docify to generate support documentation and incident report templates directly from your architecture's operational metadata.
Learning objectivesβ
By the end of this tutorial, you will:
- Create three Handlebars templates for operations documentation
- Generate service runbooks, on-call references, and flow support guides with
calm docify - Understand how to integrate documentation generation into a CI/CD pipeline
- See how architecture becomes the single source of truth for operations docs
Prerequisitesβ
Complete Use CALM as Your Operations Advisor first. You will need your architectures/ecommerce-platform.json enriched with operational metadata from the Use CALM as Your Operations Advisor lesson.
Step-by-Step Guideβ
1. Understand the Ops Documentation Goalβ
Your architecture from the Use CALM as Your Operations Advisor lesson now contains:
- Owner and on-call contacts per service
- Health endpoints and runbook links
- Failure modes with symptoms and remediation
- Business impact per flow
- Monitoring dashboard links
Today you'll create templates that extract this into:
- Service Runbook β Per-service troubleshooting guide
- On-Call Quick Reference β Single-page contact sheet
- Flow Support Guide β Flow-organized support guide for support teams
2. Create the Ops Template Directoryβ
mkdir -p templates/ops
3. Create the Service Runbook Templateβ
File: templates/ops/service-runbook.md
4. Create the On-Call Quick Reference Templateβ
File: templates/ops/oncall-reference.md
5. Create the Flow Support Guide Templateβ
File: templates/ops/flow-support-guide.md
6. Generate the Operations Documentsβ
# Generate service runbooks
calm docify -a architectures/ecommerce-platform.json \
-t templates/ops/service-runbook.md \
-o docs/ops/service-runbooks.md
# Generate on-call quick reference
calm docify -a architectures/ecommerce-platform.json \
-t templates/ops/oncall-reference.md \
-o docs/ops/oncall-reference.md
# Generate flow support guide
calm docify -a architectures/ecommerce-platform.json \
-t templates/ops/flow-support-guide.md \
-o docs/ops/flow-support-guide.md
Note: HTTP resolution failure can be ignoredβexample.com is a fictitious domain used for demonstration purposes.
7. Review Generated Documentsβ
Open each generated document and verify:
- Service runbooks contain all your services with their failure modes
- On-call reference has correct contacts
- Flow support guide documents each business flow with its impact and troubleshooting steps
8. Integrate with CI/CD for Always Up-to-Date Docsβ
Your architecture is the source of truth. When it changes, docs should regenerate automatically.
Example GitHub Actions step:
- name: Generate operations documentation
run: |
calm docify -a architectures/ecommerce-platform.json \
-t templates/ops/service-runbook.md \
-o docs/ops/service-runbooks.md
calm docify -a architectures/ecommerce-platform.json \
-t templates/ops/oncall-reference.md \
-o docs/ops/oncall-reference.md
calm docify -a architectures/ecommerce-platform.json \
-t templates/ops/flow-support-guide.md \
-o docs/ops/flow-support-guide.md
Benefits:
- Documentation never goes stale
- No manual effort to keep docs updated
- Changes to architecture are automatically reflected
- Single source of truth for both architecture and docs
This is a good point to stage and commit your changes with git, preserving a clear record of your work.
Key conceptsβ
Template β Generated Doc Flowβ
Architecture JSON (source of truth)
β
βββ templates/ops/service-runbook.md (Handlebars template)
β β
β βΌ calm docify
β docs/ops/service-runbooks.md (generated)
β
βββ templates/ops/oncall-reference.md
β β
β βΌ calm docify
β docs/ops/oncall-reference.md
β
βββ templates/ops/flow-support-guide.md
β
βΌ calm docify
docs/ops/flow-support-guide.md
CI/CD Integration Optionsβ
| Strategy | Trigger | When to Use |
|---|---|---|
| On every PR | Architecture file changed | Catch stale docs before merge |
| On merge to main | Always | Keep published docs current |
| Scheduled | Nightly | Safety net for out-of-band changes |
Next stepsβ
In the next tutorial, you'll create your first CALM Pattern β turning architecture templates into reusable, enforceable scaffolds that can both generate new architectures and validate existing ones!