Lesson templates
Templates are small, ready-to-edit specs that teach one architecture idea in steps. Each caption explains what is happening, so you can reuse them in tutorials, talks and onboarding docs.
sh
pcosmo init --list
pcosmo init cache.cosmo.json --template lesson-cache-aside
pcosmo build cache.cosmo.json --steps --png # one SVG per step for slides| Template | Teaches |
|---|---|
starter | A minimal users, server, database spec to edit |
lesson-request-lifecycle | DNS, CDN, load balancer, app and database for one web request |
lesson-cache-aside | Cache miss, database read, cache fill, cache hit |
lesson-circuit-breaker | Closed, open and half-open states with a fallback |
lesson-rag-basics | Offline ingest and online retrieval for an LLM |
lesson-blue-green | Deploy to the idle environment, switch traffic, roll back |
Writing your own
- Copy a template and rename the nodes to your system.
- Keep one idea per diagram and one sentence per step caption.
- Use
setfor what changes (a node degrades, a pod becomes healthy) andflowsfor where traffic goes. - Export per-step SVGs with
--stepsfor slides, or the animated SVG for the web.
Template contributions are welcome: add a *.cosmo.json to examples/templates/.