chiltepin 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +249 -0
  3. package/dist/bin.js +3582 -0
  4. package/dist/bin.js.map +1 -0
  5. package/package.json +93 -0
  6. package/templates/chiltepin.config.json +5 -0
  7. package/templates/demo.md +2161 -0
  8. package/templates/docs/getting-started.md +155 -0
  9. package/templates/docs/tutorial.md +559 -0
  10. package/templates/skill/SKILL.md +172 -0
  11. package/templates/skill/reference/blocks/INDEX.md +141 -0
  12. package/templates/skill/reference/blocks/agentic.md +63 -0
  13. package/templates/skill/reference/blocks/algorithms.md +49 -0
  14. package/templates/skill/reference/blocks/api.md +40 -0
  15. package/templates/skill/reference/blocks/architecture.md +94 -0
  16. package/templates/skill/reference/blocks/business.md +70 -0
  17. package/templates/skill/reference/blocks/charts-overviews.md +74 -0
  18. package/templates/skill/reference/blocks/data-model.md +34 -0
  19. package/templates/skill/reference/blocks/design-system.md +50 -0
  20. package/templates/skill/reference/blocks/flows.md +74 -0
  21. package/templates/skill/reference/blocks/narrative.md +65 -0
  22. package/templates/skill/reference/blocks/planning.md +74 -0
  23. package/templates/skill/reference/blocks/quality.md +43 -0
  24. package/templates/skill/reference/blocks/tables-data.md +55 -0
  25. package/templates/skill/reference/check.md +62 -0
  26. package/templates/skill/reference/decks.md +198 -0
  27. package/templates/skill/reference/exemplars/adr.md +87 -0
  28. package/templates/skill/reference/exemplars/agent-system.md +113 -0
  29. package/templates/skill/reference/exemplars/api-reference.md +110 -0
  30. package/templates/skill/reference/exemplars/backend-arch.md +117 -0
  31. package/templates/skill/reference/exemplars/data-pipeline.md +107 -0
  32. package/templates/skill/reference/exemplars/frontend-arch.md +93 -0
  33. package/templates/skill/reference/exemplars/incident-postmortem.md +93 -0
  34. package/templates/skill/reference/exemplars/migration-plan.md +95 -0
  35. package/templates/skill/reference/exemplars/onboarding.md +78 -0
  36. package/templates/skill/reference/exemplars/product-spec.md +81 -0
  37. package/templates/skill/reference/intake.md +140 -0
  38. package/templates/skill/reference/mermaid.md +216 -0
  39. package/templates/skill/reference/organizing.md +118 -0
  40. package/templates/skill/reference/patterns-design.md +59 -0
  41. package/templates/skill/reference/patterns.md +167 -0
  42. package/templates/skill/reference/recipes.md +153 -0
  43. package/templates/skill/reference/style-ste.md +119 -0
  44. package/templates/skill/reference/system-design.md +161 -0
  45. package/templates/skill/reference/writing.md +132 -0
@@ -0,0 +1,155 @@
1
+ ```meta
2
+ title: Getting started with Chiltepin
3
+ subtitle: The 80/20 tour — what Chiltepin is, how a doc is built, and the handful of commands you'll use every day.
4
+ tag: GUIDE · START HERE
5
+ ```
6
+
7
+ ## What is Chiltepin?
8
+
9
+ Chiltepin is **documentation-as-code**: a doc is plain Markdown with typed, fenced
10
+ YAML blocks, and the `.md` file on disk is the single source of truth. Prose stays
11
+ prose. Anything structured — a diagram, a table, a roadmap, a user story — goes in
12
+ a block that renders to clean HTML, slides, or PDF.
13
+
14
+ ```callout
15
+ tone: tip
16
+ title: The one rule
17
+ body: "The .md file is the source of truth. Edit a block surgically — never regenerate a whole document — and run `chiltepin check` until it passes. A passing check is the definition of done."
18
+ ```
19
+
20
+ ## Anatomy of a block
21
+
22
+ Every block is a fenced code block whose **info-string is the block type** and
23
+ whose **body is YAML**. Give a block an `id:` when you want to reference it; set a
24
+ `title:` so the rendered section reads like a document.
25
+
26
+ ```code
27
+ title: A sequence block
28
+ lang: markdown
29
+ code: |
30
+ ```sequence
31
+ id: seq-gs-checkout
32
+ title: Place an order
33
+ actors:
34
+ - { id: Client, name: Client }
35
+ - { id: API, name: Orders API }
36
+ messages:
37
+ - Client -> API: POST /orders
38
+ - API --> Client: 201 Created
39
+ ```
40
+ ```
41
+
42
+ Messages use the terse arrow form — `->` is a call, `-->` a response,
43
+ `-x->` an error; the text after the colon is the label. (An item can also be a
44
+ full object when it needs more fields — `kind: async`, a `summary`, a `code`
45
+ snippet.)
46
+
47
+ That block renders as a real SVG sequence diagram — here it is live:
48
+
49
+ ```sequence
50
+ id: seq-gs-checkout
51
+ title: Place an order
52
+ lede: The client gets 201 only after the order row is in Postgres.
53
+ endpoint: { method: POST, path: /orders }
54
+ actors:
55
+ - { id: Client, name: Client, sub: web / mobile }
56
+ - { id: API, name: Orders API, sub: orders handler }
57
+ - { id: DB, name: Postgres, sub: orders }
58
+ messages:
59
+ - Client -> API: POST /orders
60
+ - API -> DB: INSERT order
61
+ - DB --> API: order_id
62
+ - API --> Client: 201 Created
63
+ ```
64
+
65
+ ## The everyday workflow
66
+
67
+ Four steps, over and over: scaffold once, then edit → validate → render.
68
+
69
+ ```flow
70
+ title: Author → validate → render
71
+ nodes:
72
+ - { id: init, col: 1, row: 1, kind: start, label: chiltepin init }
73
+ - { id: edit, col: 2, row: 1, kind: process, label: Edit the .md }
74
+ - { id: check, col: 3, row: 1, kind: decision, label: chiltepin check passes? }
75
+ - { id: render, col: 4, row: 1, kind: end, label: render / preview }
76
+ - { id: fix, col: 3, row: 2, kind: process, label: Fix diagnostics }
77
+ edges:
78
+ - init -> edit
79
+ - edit -> check
80
+ - check -> render: "yes"
81
+ - check -x-> fix: "no"
82
+ - fix -> edit
83
+ ```
84
+
85
+ ## The CLI you'll actually use
86
+
87
+ ```table
88
+ columns: [Command, What it does]
89
+ rows:
90
+ - ["chiltepin init", Scaffold docs/ and chiltepin.config.json]
91
+ - ["chiltepin check [globs]", "Validate schemas, references, and duplicate ids — exits non-zero on errors"]
92
+ - ["chiltepin <file.md>", Render to a temp HTML file and open it in your browser]
93
+ - ["chiltepin html / slides / pdf <file>", Render one doc to a standalone HTML page, a slide deck, or a PDF]
94
+ - ["chiltepin demo [-s]", Render the built-in showcase of every block (-s for slides)]
95
+ - ["chiltepin block [type]", "Every block on one line — or one block's fields, terse forms, and example"]
96
+ - ["chiltepin new <name>", Scaffold a whole doc (adr, runbook, …) or a single block]
97
+ - ["npx skills add jdiejim/chiltepin", "Install the authoring skill into your AI agent — Claude Code, Cursor, Codex, and more"]
98
+ - ["chiltepin sync openapi <spec>", Generate an API doc straight from an OpenAPI file]
99
+ ```
100
+
101
+ ## A few blocks to get the feel
102
+
103
+ You compose a doc from **2–5 blocks, each a different lens**. A KPI strip:
104
+
105
+ ```stats
106
+ stats:
107
+ - { value: "76", label: Block types, trend: flat }
108
+ - { value: "12", label: Block families, trend: flat }
109
+ - { value: "3", label: Export formats, trend: flat }
110
+ ```
111
+
112
+ A roadmap as a timeline:
113
+
114
+ Timeline items take a terse one-liner — `[status] date · label · description`:
115
+
116
+ ```timeline
117
+ items:
118
+ - "[current] now · Write your first doc · Edit this file, run chiltepin check"
119
+ - "[next] next · Wire it into review · Run chiltepin check in CI on every PR"
120
+ - "[future] later · Present it · chiltepin slides turns headings into a deck"
121
+ ```
122
+
123
+ ## Connect blocks with `doc#id`
124
+
125
+ Give a block an `id:`, then point at it as `doc#id` (or bare `#id` in the same
126
+ file). The only reference-bearing field today is `userstory.links[].ref`, and a
127
+ dangling reference fails `chiltepin check` — so the model stays honest.
128
+
129
+ ```userstory
130
+ id: US-1
131
+ role: new user
132
+ want: see how a cross-reference works
133
+ soThat: I can wire stories to the diagrams that satisfy them
134
+ priority: High
135
+ points: 2
136
+ criteria:
137
+ - { given: I open this doc, when: I follow the link, then: I land on the request flow }
138
+ links:
139
+ - { ref: "#seq-gs-checkout", mode: sequence, label: Request flow }
140
+ ```
141
+
142
+ ## Look & slides
143
+
144
+ - **Look.** One editorial skin for every export. Pages follow your OS
145
+ light/dark setting. There is nothing to pick.
146
+ - **Slides.** Any doc is a deck: `chiltepin slides <file>`. Each `#`/`##` heading starts
147
+ a new slide and is its title; everything under it rides along. See the advanced
148
+ tutorial (`docs/tutorial.md`) for a deck-first walkthrough of the whole feature
149
+ set.
150
+
151
+ ```callout
152
+ tone: note
153
+ title: Next steps
154
+ body: "Edit this file and run `chiltepin check`. Then open `docs/tutorial.md` for the full feature tour, and run `chiltepin block <type>` for any block's fields."
155
+ ```
@@ -0,0 +1,559 @@
1
+ ```meta
2
+ title: The Chiltepin tutorial
3
+ subtitle: A deck-first tour of the full feature set — render it with `chiltepin slides docs/tutorial.md`.
4
+ tag: TUTORIAL · FULL TOUR
5
+ ```
6
+
7
+ ## What you'll learn {center}
8
+
9
+ Every `#`/`##` heading you see is one slide. This deck tours the whole block
10
+ vocabulary — architecture, data, process, planning, RBAC, and narrative — plus
11
+ cross-references and how slides themselves work.
12
+
13
+ ```drivers
14
+ title: The four things Chiltepin gives you
15
+ items:
16
+ - { title: One source of truth, body: "Diagrams live in the .md file, not a separate tool.", tag: "WHAT", icon: doc, accent: blue }
17
+ - { title: Typed blocks, body: "107 block types with strict schemas.", tag: "HOW", icon: grid, accent: green }
18
+ - { title: Validated, body: "chiltepin check gates every change.", tag: "WHY", icon: check, accent: purple }
19
+ - { title: Many outputs, body: "HTML, slides, and PDF from one file.", tag: "WHERE", icon: layers, accent: amber }
20
+ ```
21
+
22
+ ## Documentation as code
23
+
24
+ The shift: stop maintaining diagrams in one tool and prose in another. One file,
25
+ validated, rendered many ways.
26
+
27
+ ```cvt
28
+ title: Before and after
29
+ current:
30
+ label: Prose-only docs
31
+ items: [Diagrams rot in a separate tool, Nothing validates them, Copy-paste drift]
32
+ target:
33
+ label: Chiltepin
34
+ items: [Structure lives in the file, chiltepin check gates every change, One source of truth]
35
+ note: The .md on disk is always the truth.
36
+ ```
37
+
38
+ ## The one rule {center}
39
+
40
+ ```pullquote
41
+ text: The .md file is the source of truth — edit a block surgically, never regenerate the whole doc.
42
+ attribution: The one rule
43
+ ```
44
+
45
+ ```callout
46
+ tone: tip
47
+ title: Definition of done
48
+ body: "A change isn't finished until `chiltepin check` passes — schemas, references, and duplicate ids all green."
49
+ ```
50
+
51
+ ## A block = type + YAML
52
+
53
+ A block is a fenced section whose info-string is the **type** and whose body is
54
+ **YAML**. Add an `id:` to reference it; add a `title:` so it reads like a document.
55
+
56
+ ```code
57
+ blocks:
58
+ - title: The shape of every block
59
+ lang: markdown
60
+ code: |
61
+ ```stats
62
+ stats:
63
+ - { value: "76", label: Block types, trend: flat }
64
+ ```
65
+ ```
66
+
67
+ ## System context
68
+
69
+ Start a system doc with who uses it and what it touches — that's a `c4` context
70
+ diagram.
71
+
72
+ ```c4
73
+ title: Chiltepin in context
74
+ level: context
75
+ nodes:
76
+ - { id: author, col: 1, row: 1, kind: person, name: Author, desc: Writes docs. }
77
+ - { id: chiltepin, col: 2, row: 1, kind: system, name: Chiltepin }
78
+ - { id: ci, col: 3, row: 1, kind: external, name: CI }
79
+ edges:
80
+ - { from: author, to: chiltepin, label: edits .md }
81
+ - { from: chiltepin, to: ci, label: "chiltepin check" }
82
+ ```
83
+
84
+ ## The build pipeline
85
+
86
+ Use `block` for topology — boxes and arrows. A `preset:` (`infra` / `event` /
87
+ `ddd` / `network`) picks the domain framing; `layers:` switches to horizontal
88
+ bands.
89
+
90
+ ```block
91
+ preset: infra
92
+ title: Markdown in, many outputs out
93
+ systemLabel: "@chiltepin/*"
94
+ layers:
95
+ - { label: Author }
96
+ - { label: Core }
97
+ - { label: Output }
98
+ nodes:
99
+ - { id: md, layer: 0, kind: external, name: Markdown }
100
+ - { id: core, layer: 1, kind: service, name: parse + validate }
101
+ - { id: render, layer: 1, kind: service, name: render }
102
+ - { id: html, layer: 2, kind: cdn, name: HTML }
103
+ - { id: pdf, layer: 2, kind: store, name: PDF }
104
+ edges:
105
+ - md -> core
106
+ - core -> render
107
+ - render -> html
108
+ - render -> pdf
109
+ ```
110
+
111
+ ## Behavior over time
112
+
113
+ When A calls B, then B replies — that's temporal, so use `sequence`, not a flow.
114
+
115
+ ```sequence
116
+ id: seq-tour
117
+ title: Validate a document
118
+ endpoint: { method: POST, path: /check }
119
+ actors:
120
+ - { id: CLI, name: chiltepin CLI }
121
+ - { id: Core, name: "@chiltepin/core" }
122
+ - { id: User, name: Terminal }
123
+ messages:
124
+ - User -> CLI: chiltepin check
125
+ - CLI -> Core: parse + validate
126
+ - Core --> CLI: diagnostics
127
+ - CLI --> User: OK / errors
128
+ ```
129
+
130
+ The terse arrow form is the default — `->` a call, `-->` a response,
131
+ `-x->` an error. Switch to the object form when a message needs `kind: async`,
132
+ a `summary`, or a `code` snippet.
133
+
134
+ ## Decisions and branches
135
+
136
+ A `flow` is for decisions and branches (`variant: dag` frames it as a
137
+ pipeline, and its cousins `dfd` and `swimlane` cover data-flow and cross-team
138
+ processes).
139
+
140
+ ```flow
141
+ title: Does it pass?
142
+ nodes:
143
+ - { id: start, col: 1, row: 1, kind: start, label: Edit }
144
+ - { id: check, col: 2, row: 1, kind: decision, label: chiltepin check? }
145
+ - { id: ship, col: 3, row: 1, kind: end, label: Ship }
146
+ - { id: fix, col: 2, row: 2, kind: process, label: Fix it }
147
+ edges:
148
+ - start -> check
149
+ - check -> ship: pass
150
+ - check -x-> fix: fail
151
+ - fix -> check
152
+ ```
153
+
154
+ ## A state machine
155
+
156
+ Use `state` when one object has a lifecycle — the reader asks which states
157
+ exist and what forces each transition.
158
+
159
+ ```state
160
+ title: Document lifecycle
161
+ states:
162
+ - { id: s0, col: 1, row: 1, kind: start }
163
+ - { id: draft, col: 2, row: 1, kind: wait, name: DRAFT }
164
+ - { id: review, col: 3, row: 1, kind: active, name: REVIEW }
165
+ - { id: pub, col: 4, row: 1, kind: active, name: PUBLISHED }
166
+ - { id: end, col: 5, row: 1, kind: terminal }
167
+ transitions:
168
+ - { from: s0, to: draft, event: create }
169
+ - { from: draft, to: review, event: "chiltepin check" }
170
+ - { from: review, to: pub, event: merge }
171
+ - { from: pub, to: end, event: archive }
172
+ ```
173
+
174
+ ## The data model
175
+
176
+ `erd` is for tables, keys, and relationships — never flatten a schema into a plain
177
+ table.
178
+
179
+ ```erd
180
+ entities:
181
+ - name: docs
182
+ columns:
183
+ - { name: slug, type: text, pk: true }
184
+ - { name: theme, type: text }
185
+ - name: blocks
186
+ columns:
187
+ - { name: id, type: text, pk: true }
188
+ - { name: doc_slug, type: text, fk: true }
189
+ - { name: type, type: text }
190
+ relations:
191
+ - docs ||--o{ blocks: contains
192
+ ```
193
+
194
+ Relations use crow's-foot sugar — `||--||` 1:1, `||--o{` 1:N, `}o--||` N:1,
195
+ `}o--o{` N:M.
196
+
197
+ ## Backend internals
198
+
199
+ Use `felogic` for module internals — the frontend by default, `variant: be`
200
+ for the backend controller → service → repository chain.
201
+
202
+ ```felogic
203
+ variant: be
204
+ title: How chiltepin html works
205
+ nodes:
206
+ - { id: cmd, col: 1, row: 1, kind: controller, name: renderCmd, note: "chiltepin html" }
207
+ - { id: svc, col: 2, row: 1, kind: service, name: Renderer, note: blocks → HTML }
208
+ - { id: reg, col: 1, row: 2, kind: repository, name: BlockRegistry, note: lookup }
209
+ - { id: theme, col: 2, row: 2, kind: gateway, name: ThemeLoader, note: CSS vars }
210
+ edges:
211
+ - { from: cmd, to: svc, kind: uses }
212
+ - { from: svc, to: reg, kind: uses }
213
+ - { from: svc, to: theme, kind: uses }
214
+ ```
215
+
216
+ ## The component tree
217
+
218
+ Use `frontend` when the reader asks how the UI is composed — root, layouts,
219
+ pages, hooks, stores.
220
+
221
+ ```frontend
222
+ title: A docs viewer
223
+ nodes:
224
+ - { id: app, kind: root, name: App }
225
+ - { id: layout, parent: app, kind: layout, name: DocLayout }
226
+ - { id: page, parent: layout, kind: page, name: DocPage }
227
+ - { id: doc, parent: page, kind: component, name: ChiltepinDoc }
228
+ - { id: hook, parent: doc, kind: hook, name: useTheme }
229
+ ```
230
+
231
+ ## Access = intersected gates
232
+
233
+ For RBAC, use `composition` when access is the AND of independent checks — not
234
+ a sequence of steps.
235
+
236
+ ```composition
237
+ title: How edit access is decided
238
+ result: May edit the doc
239
+ gates:
240
+ - { kicker: "L1 · Identity", label: Signed in, desc: A valid user., source: "Source: JWT" }
241
+ - { kicker: "L2 · Scope", label: In range, desc: The doc is in scope., source: "Source: lookup" }
242
+ - { kicker: "L3 · Permission", label: Granted, desc: Edit is allowed., source: "Source: app DB" }
243
+ ```
244
+
245
+ ## Anatomy of an identifier
246
+
247
+ Use `anatomy` when one delimited string carries the meaning — a permission, a
248
+ URN, a path.
249
+
250
+ ```anatomy
251
+ title: Anatomy of a permission
252
+ separator: ":"
253
+ parts:
254
+ - { label: App, value: chiltepin, note: Which product. }
255
+ - { label: Feature, value: docs, note: The area. }
256
+ - { label: Action, value: edit, note: The capability. }
257
+ ```
258
+
259
+ ## Role × capability
260
+
261
+ Use `matrix` when the reader asks who can do what — roles down, resources
262
+ across, a level per cell.
263
+
264
+ ```matrix
265
+ title: Who can do what
266
+ corner: Role / Action
267
+ cols: [Read, Edit, Publish]
268
+ rows:
269
+ - { label: Viewer, cells: [Full, "—", "—"] }
270
+ - { label: Author, cells: [Full, Full, "—"] }
271
+ - { label: Maintainer, cells: [Full, Full, Full] }
272
+ ```
273
+
274
+ ## Weighing approaches
275
+
276
+ Use `options` to record the approaches you weighed — the rejected ones explain
277
+ the chosen one.
278
+
279
+ ```options
280
+ title: How should themes work?
281
+ items:
282
+ - { kicker: Option 1, title: Hard-code CSS, how: One stylesheet per theme., pros: [Simple], cons: ["Rebuild to change"], verdict: "REJECTED", tone: rejected }
283
+ - { kicker: Option 2, title: JSON theme files, how: Friendly names → CSS vars., pros: [No rebuild, Editable], cons: ["A tiny loader"], verdict: "CHOSEN", tone: chosen }
284
+ ```
285
+
286
+ ## A one-thing fact sheet
287
+
288
+ `spec` is a compact label → value sheet for one thing; a `steps:` row holds a
289
+ short procedure.
290
+
291
+ ```spec
292
+ title: The editorial look
293
+ accent: amber
294
+ rows:
295
+ - { label: Look, value: "Warm paper, near-black ink, one rust accent." }
296
+ - { label: Dark mode, value: "Follows the reader's OS setting." }
297
+ - { label: Apply, steps: [Write Markdown, "chiltepin html", Done] }
298
+ ```
299
+
300
+ ## Numbers that matter
301
+
302
+ Use `stats` when a handful of numbers tells the story — each carries a delta
303
+ and a trend.
304
+
305
+ ```stats
306
+ stats:
307
+ - { value: "76", label: Block types, trend: flat }
308
+ - { value: "12", label: Block families, trend: flat }
309
+ - { value: "3", label: Output formats, trend: flat }
310
+ ```
311
+
312
+ ## Plan in phases
313
+
314
+ Use `timeline` when the reader asks what happens in what order.
315
+
316
+ Items take a terse one-liner — `[status] date · label · description`:
317
+
318
+ ```timeline
319
+ items:
320
+ - "[current] now · Write your first doc · Edit, then chiltepin check"
321
+ - "[next] next · Gate it in CI · chiltepin check on every PR"
322
+ - "[future] later · Present it · chiltepin slides"
323
+ ```
324
+
325
+ ## Schedule with dates
326
+
327
+ When phases have real durations, `gantt` draws bars across periods.
328
+
329
+ ```gantt
330
+ periods: [Q1, Q2, Q3, Q4]
331
+ tasks:
332
+ - { label: Core, start: 0, span: 1, kind: done }
333
+ - { label: CLI + render, start: 1, span: 2, kind: active }
334
+ - { label: "1.0", start: 3, span: 1, kind: milestone }
335
+ ```
336
+
337
+ ## Now / Next / Later
338
+
339
+ Use `kanban` for work in flight — any named columns of cards.
340
+
341
+ ```kanban
342
+ columns:
343
+ - label: Now
344
+ cards:
345
+ - { title: First doc }
346
+ - { title: Pick a theme, tag: design }
347
+ - label: Next
348
+ cards:
349
+ - { title: Wire CI }
350
+ - label: Later
351
+ cards:
352
+ - { title: Author a deck }
353
+ ```
354
+
355
+ ## Track the work
356
+
357
+ `statustable` tracks work in a table — free columns plus one status per row,
358
+ in your own status vocabulary or the defaults.
359
+
360
+ ```statustable
361
+ columns: [Task, Update]
362
+ rows:
363
+ - { cells: [Scaffold the repo, chiltepin init ran clean], status: done }
364
+ - { cells: [Write getting-started, Draft out for review], status: in progress }
365
+ - { cells: [Add to CI, Waiting on repo admin], status: todo }
366
+ ```
367
+
368
+ ## Tell it as a pyramid
369
+
370
+ Use `pyramid` when tiers have rank — vision over strategy, the test pyramid.
371
+
372
+ ```pyramid
373
+ levels:
374
+ - { label: Meta, desc: Title + intent }
375
+ - { label: Big picture, desc: Architecture / landscape }
376
+ - { label: Detail, desc: One flow or module }
377
+ - { label: Plan, desc: Roadmap + tracker }
378
+ ```
379
+
380
+ ## Prioritize on two axes
381
+
382
+ `quadrant` plots items in a 2×2 — effort vs impact, risk vs reward, anything.
383
+
384
+ ```quadrant
385
+ xAxis: { label: Effort, low: Low, high: High }
386
+ yAxis: { label: Impact, low: Low, high: High }
387
+ items:
388
+ - { x: 0.25, y: 0.8, label: Add a callout }
389
+ - { x: 0.75, y: 0.85, label: Author a deck }
390
+ - { x: 0.3, y: 0.3, label: Tweak a color }
391
+ ```
392
+
393
+ ## Map the journey
394
+
395
+ Use `journey` when the reader asks what an experience feels like across
396
+ stages.
397
+
398
+ ```journey
399
+ stages: [{ label: Discover }, { label: Author }, { label: Validate }, { label: Ship }]
400
+ rows:
401
+ - { label: Tool, cells: ["chiltepin init", "edit .md", "chiltepin check", "chiltepin pdf"] }
402
+ - { label: Feeling, cells: [Curious, Focused, Tense, Proud] }
403
+ emotion: [0.6, 0.7, 0.4, 0.9]
404
+ ```
405
+
406
+ ## Explain in layers
407
+
408
+ Use `layers` when each tier answers one question — an L1/L2/L3 model.
409
+
410
+ ```layers
411
+ title: A doc in three layers
412
+ items:
413
+ - { kicker: L1, title: Prose, source: Markdown, question: "What's the story?", body: Plain paragraphs carry the narrative. }
414
+ - { kicker: L2, title: Blocks, source: typed YAML, question: "What's the structure?", body: "Diagrams, tables, and stories." }
415
+ - { kicker: L3, title: Refs, source: "doc#id", question: "How do they connect?", body: Stories point at the flows that satisfy them. }
416
+ ```
417
+
418
+ ## Weigh the trade-offs
419
+
420
+ `proscons` weighs two sides of one decision.
421
+
422
+ ```proscons
423
+ prosLabel: HTML output
424
+ consLabel: PDF output
425
+ pros: [Interactive, Live theme switch, Tiny files]
426
+ cons: [Print-ready, Email-friendly, Needs Chromium once]
427
+ ```
428
+
429
+ ## Break it down (MECE)
430
+
431
+ `tree` with `variant: issue` decomposes one thing into exhaustive,
432
+ non-overlapping parts.
433
+
434
+ ```tree
435
+ variant: issue
436
+ title: What goes in a doc?
437
+ nodes:
438
+ - { id: root, label: A doc }
439
+ - { id: prose, parent: root, label: Prose }
440
+ - { id: struct, parent: root, label: Structure }
441
+ - { id: diag, parent: struct, label: Diagrams }
442
+ - { id: tab, parent: struct, label: Tables }
443
+ ```
444
+
445
+ ## An HTTP endpoint
446
+
447
+ `endpoint` is a Swagger-style card; `chiltepin sync openapi` can generate a whole set.
448
+
449
+ ```endpoint
450
+ method: POST
451
+ path: /docs/{slug}/check
452
+ title: Validate a document
453
+ description: Run schema + reference checks on one doc.
454
+ params:
455
+ - { name: slug, in: path, type: string, required: true, desc: Doc to validate }
456
+ responses:
457
+ - { status: 200, desc: No diagnostics }
458
+ - { status: 422, desc: Diagnostics found }
459
+ ```
460
+
461
+ ## What the user sees
462
+
463
+ Use `wireframe` when the reader asks what the user sees — low-fi screens, no
464
+ design tool.
465
+
466
+ ```wireframe
467
+ title: The rendered page
468
+ screens:
469
+ - device: browser
470
+ title: Rendered doc
471
+ url: localhost/out.html
472
+ label: A Chiltepin page in the browser
473
+ elements:
474
+ - { type: header, label: The Chiltepin tutorial }
475
+ - { type: text, rows: 2 }
476
+ - { type: image, label: sequence diagram }
477
+ - { type: button, label: Switch theme, tone: accent }
478
+ ```
479
+
480
+ ## Connect with `doc#id`
481
+
482
+ Give a block an `id:`, then reference it with `doc#id` (or bare `#id` in the same
483
+ file). A dangling ref fails `chiltepin check`. This story links to the flow above.
484
+
485
+ ```userstory
486
+ id: US-tour
487
+ role: doc author
488
+ want: link a story to the flow that satisfies it
489
+ soThat: the document becomes a connected, checkable model
490
+ priority: Med
491
+ points: 3
492
+ criteria:
493
+ - { given: a sequence has an id, when: I add a matching ref, then: chiltepin check resolves it }
494
+ links:
495
+ - { ref: "#seq-tour", mode: sequence, label: The validate flow }
496
+ ```
497
+
498
+ ## Key terms
499
+
500
+ `glossary` is plain term → definition rows.
501
+
502
+ ```glossary
503
+ terms:
504
+ - { term: Block, def: A fenced section whose info-string is a typed block name. }
505
+ - { term: "doc#id", def: "A cross-reference to a block id, checked by chiltepin check." }
506
+ - { term: Skin, def: "The one editorial look every export uses, in light and dark." }
507
+ ```
508
+
509
+ ## One look, light and dark
510
+
511
+ ```table
512
+ columns: [Mode, When]
513
+ rows:
514
+ - [Light, "The default — warm paper, near-black ink, one rust accent"]
515
+ - [Dark, "When your OS prefers dark; nothing to configure"]
516
+ note: Every export — HTML, slides, PDF — uses the same editorial skin.
517
+ ```
518
+
519
+ ## How slides work {top}
520
+
521
+ This whole file is a deck. The rules:
522
+
523
+ ```callout
524
+ tone: note
525
+ title: Authoring for slides
526
+ body: "Each `#`/`##` heading starts a slide and is its title. Everything under it — prose and blocks — rides along, so a slide can stack several blocks. Alignment is automatic; force it with a heading marker: `{top}`, `{center}`, or `{bottom}`."
527
+ ```
528
+
529
+ ## Always validate {center}
530
+
531
+ ```code
532
+ blocks:
533
+ - title: The loop
534
+ lang: bash
535
+ code: |
536
+ chiltepin check # validate everything
537
+ chiltepin preview docs/x.md # render + open
538
+ chiltepin slides docs/x.md # present it
539
+ chiltepin block # every block, one line each
540
+ chiltepin pdf docs/x.md # one doc to PDF
541
+ ```
542
+
543
+ ## Recap
544
+
545
+ ```table
546
+ columns: [If you want to show…, Reach for]
547
+ rows:
548
+ - [Who uses the system, "c4 (context)"]
549
+ - [Boxes and arrows / topology, "block (presets: infra · event · ddd · network)"]
550
+ - [A call-and-response over time, sequence]
551
+ - [Branches and decisions, "flow (variant: dag) · swimlane · dfd"]
552
+ - [Tables, keys, relationships, erd]
553
+ - [Module internals, "felogic (variant: be) · frontend · uml"]
554
+ - [Access rules, "composition · anatomy · matrix"]
555
+ - [A weighed decision, "options · proscons · cvt"]
556
+ - [A plan, "timeline · gantt · kanban · statustable"]
557
+ - [A story or chart, "pyramid · quadrant · journey · stats · chart"]
558
+ note: The skill lives in skills/chiltepin/SKILL.md; chiltepin block <type> prints any block's fields.
559
+ ```