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.
- package/LICENSE +21 -0
- package/README.md +249 -0
- package/dist/bin.js +3582 -0
- package/dist/bin.js.map +1 -0
- package/package.json +93 -0
- package/templates/chiltepin.config.json +5 -0
- package/templates/demo.md +2161 -0
- package/templates/docs/getting-started.md +155 -0
- package/templates/docs/tutorial.md +559 -0
- package/templates/skill/SKILL.md +172 -0
- package/templates/skill/reference/blocks/INDEX.md +141 -0
- package/templates/skill/reference/blocks/agentic.md +63 -0
- package/templates/skill/reference/blocks/algorithms.md +49 -0
- package/templates/skill/reference/blocks/api.md +40 -0
- package/templates/skill/reference/blocks/architecture.md +94 -0
- package/templates/skill/reference/blocks/business.md +70 -0
- package/templates/skill/reference/blocks/charts-overviews.md +74 -0
- package/templates/skill/reference/blocks/data-model.md +34 -0
- package/templates/skill/reference/blocks/design-system.md +50 -0
- package/templates/skill/reference/blocks/flows.md +74 -0
- package/templates/skill/reference/blocks/narrative.md +65 -0
- package/templates/skill/reference/blocks/planning.md +74 -0
- package/templates/skill/reference/blocks/quality.md +43 -0
- package/templates/skill/reference/blocks/tables-data.md +55 -0
- package/templates/skill/reference/check.md +62 -0
- package/templates/skill/reference/decks.md +198 -0
- package/templates/skill/reference/exemplars/adr.md +87 -0
- package/templates/skill/reference/exemplars/agent-system.md +113 -0
- package/templates/skill/reference/exemplars/api-reference.md +110 -0
- package/templates/skill/reference/exemplars/backend-arch.md +117 -0
- package/templates/skill/reference/exemplars/data-pipeline.md +107 -0
- package/templates/skill/reference/exemplars/frontend-arch.md +93 -0
- package/templates/skill/reference/exemplars/incident-postmortem.md +93 -0
- package/templates/skill/reference/exemplars/migration-plan.md +95 -0
- package/templates/skill/reference/exemplars/onboarding.md +78 -0
- package/templates/skill/reference/exemplars/product-spec.md +81 -0
- package/templates/skill/reference/intake.md +140 -0
- package/templates/skill/reference/mermaid.md +216 -0
- package/templates/skill/reference/organizing.md +118 -0
- package/templates/skill/reference/patterns-design.md +59 -0
- package/templates/skill/reference/patterns.md +167 -0
- package/templates/skill/reference/recipes.md +153 -0
- package/templates/skill/reference/style-ste.md +119 -0
- package/templates/skill/reference/system-design.md +161 -0
- package/templates/skill/reference/writing.md +132 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Writing blocks — step 6 of the procedure
|
|
2
|
+
|
|
3
|
+
Read this file when a YAML question is not answered by `chiltepin block <type>`.
|
|
4
|
+
It holds the block grammar, the full terse-item table, the YAML traps, the
|
|
5
|
+
reference scheme, and the naming rules. The field contract and an example
|
|
6
|
+
for every block come from `npx -y chiltepin block <type>`.
|
|
7
|
+
|
|
8
|
+
## How a block looks
|
|
9
|
+
|
|
10
|
+
````
|
|
11
|
+
## Request flow
|
|
12
|
+
|
|
13
|
+
```sequence
|
|
14
|
+
id: seq-place-order
|
|
15
|
+
endpoint: { method: POST, path: /orders }
|
|
16
|
+
actors:
|
|
17
|
+
- { id: Client, name: Client }
|
|
18
|
+
- { id: API, name: Orders API }
|
|
19
|
+
messages:
|
|
20
|
+
- Client -> API: POST /orders
|
|
21
|
+
- API --> Client: 201 Created
|
|
22
|
+
```
|
|
23
|
+
````
|
|
24
|
+
|
|
25
|
+
Rules:
|
|
26
|
+
|
|
27
|
+
- The info-string is exactly one of the block types listed by `chiltepin block`
|
|
28
|
+
(`blocks/INDEX.md` is the same list). Never invent a type. The 12 old
|
|
29
|
+
merged names remain valid as permanent aliases.
|
|
30
|
+
- The body is **YAML**. JSON is valid YAML and also parses — write JSON when a value is full of commas or colons. A `mermaid`
|
|
31
|
+
fence is also accepted for five diagram grammars — see `mermaid.md`.
|
|
32
|
+
- Use only the fields documented for that block. The schemas are strict: an
|
|
33
|
+
unknown field is an error. Keep prose outside blocks.
|
|
34
|
+
- A block MAY carry a top-level `id:` (a slug) so other blocks can reference
|
|
35
|
+
it.
|
|
36
|
+
- Most diagram blocks accept optional `title`, `description`, and `lede`.
|
|
37
|
+
A `##` heading directly above a block IS its title — omit the block `title`
|
|
38
|
+
unless it must say something the heading does not.
|
|
39
|
+
- A `description` is at most 2 sentences. Longer narrative goes in prose.
|
|
40
|
+
- Never paste raw HTML, `<svg>`, or `<style>` into a doc.
|
|
41
|
+
|
|
42
|
+
## Terse arrows & items — the default for chatty lists
|
|
43
|
+
|
|
44
|
+
Most list fields accept a **terse one-line string** per item. Write this form
|
|
45
|
+
by default; it expands to the object form at parse time, so validation and
|
|
46
|
+
rendering are identical.
|
|
47
|
+
|
|
48
|
+
**Arrows & diagrams**
|
|
49
|
+
|
|
50
|
+
| Field | Terse item | Grammar |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| `sequence.messages` | `Client -> API: POST /orders` | `from -> to: label` — `->` sync · `-->` response · `-x->` error · `-> +to` opens an activation bar on `to` · `--> -to` closes the sender's bar |
|
|
53
|
+
| `sequence.messages` frames | `alt: token valid` · `else: expired` · `end` | `alt` `opt` `loop` `par` `break` `critical` open a frame (`: guard` optional) · `else: guard` starts the next branch · a bare `end` closes the frame |
|
|
54
|
+
| `flow`/`graph`/`block` `edges` · `c4.edges` · `cluster.links` | `build -> deploy: on green` | `->` solid · `-->` dashed · `-x->` error |
|
|
55
|
+
| `dfd.edges` · `swimlane.links` | `a -> b: writes` | `from -> to: label` |
|
|
56
|
+
| `state.transitions` | `idle -> active: submit` | the label is the **event** |
|
|
57
|
+
| `flow`/`graph`/`block`/`dfd`/`state` **nodes** | `rx: Receive` — or just `Receive` | `id: Label`; a bare name is both id and label |
|
|
58
|
+
| `erd` entity `columns` | `id uuid pk` · `org_id: uuid fk` | `name [type…] [pk] [fk]` |
|
|
59
|
+
| `erd.relations` | `users \|\|--o{ orders: places` | crow's-foot — `\|\|--\|\|` 1:1 · `\|\|--o{` 1:N · `}o--o{` N:M · plain `->` = no cardinality |
|
|
60
|
+
|
|
61
|
+
**Text & cards** (split on ` — ` em dash · `·` middle dot)
|
|
62
|
+
|
|
63
|
+
| Field | Terse item | Grammar |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| `glossary.terms` | `SLO — the target` | `term — def` |
|
|
66
|
+
| `faq.items` | `Why fast? — The cache is warm.` | `q — a` |
|
|
67
|
+
| `takeaways` / `list` / `steps` items | `Ship small — five beats one.` | `lead — detail?` |
|
|
68
|
+
| `kanban` cards | `Core parser` · `Validation · priority` | `title · tag?` |
|
|
69
|
+
| `stats.stats` | `p95 · 120ms · -30%` | `label · value · delta?` — trend inferred from the sign |
|
|
70
|
+
| `team.members` | `Ana · Backend · payments` | `name · role? · focus?` |
|
|
71
|
+
| `agenda.items` | `09:00 · 20m · Standup — round robin` | `[time ·] [duration ·] title [— desc]` |
|
|
72
|
+
| `okr` key results | `[on-track] Signups · 60%` | optional `[status]`, then `kr · progress` |
|
|
73
|
+
| `timeline.items` | `[done] 2026-07 · Ship beta · Behind a flag` | optional `[status]`, then `date · label · desc` |
|
|
74
|
+
|
|
75
|
+
The label is everything after the **first** `:` (arrows) or the first ` — `
|
|
76
|
+
(text pairs). Mix terse strings and objects freely in one list; switch to the
|
|
77
|
+
object form when an item needs fields the grammar cannot say.
|
|
78
|
+
|
|
79
|
+
## YAML pitfalls — quote when in doubt
|
|
80
|
+
|
|
81
|
+
Most "schema errors" are YAML mis-parses. **Quote the value** whenever it
|
|
82
|
+
contains:
|
|
83
|
+
|
|
84
|
+
| Character | What goes wrong unquoted | Fix |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `,` (comma) | Inside `{ a, b }` flow style it is a separator; a sentence becomes 3 keys. | `desc: "40 blocks, themes, agent skill"` |
|
|
87
|
+
| `:` (colon) | Read as `key: value`; `1:N` becomes a number sequence. | `card: "1:N"` |
|
|
88
|
+
| `#` (hash) | Starts a comment. | `label: "POST /orders #idempotent"` |
|
|
89
|
+
| Leading `*` `&` `!` `\|` `>` `%` `@` `` ` `` | YAML anchor / tag / fold characters. | Quote the whole value. |
|
|
90
|
+
| Leading `-` + space | Looks like a list item. | Quote. |
|
|
91
|
+
| Numeric-looking (`0`, `02`, `1e3`) | Parsed as a number; fails `string` schemas. | `delta: "0"`, `version: "1.0"` |
|
|
92
|
+
| `yes` / `no` / `true` / `false` / `null` | YAML 1.1 booleans. | Quote. |
|
|
93
|
+
| Empty | Parsed as null. | `name: ""` |
|
|
94
|
+
|
|
95
|
+
Inline `{ k: v }` maps are fine for short records (under ~5 fields). For
|
|
96
|
+
anything longer, use block style — easier diffs, fewer comma traps. When a
|
|
97
|
+
`desc` / `note` / `summary` / `description` contains prose, **always quote
|
|
98
|
+
it** — those fields are the top source of validation errors.
|
|
99
|
+
|
|
100
|
+
## Cross-references (`doc#id`)
|
|
101
|
+
|
|
102
|
+
Blocks become a connected model through references:
|
|
103
|
+
|
|
104
|
+
- Give a block a unique `id:` (unique across the **whole repo**).
|
|
105
|
+
- Reference it as `doc#id`, where `doc` is the target file's path under the
|
|
106
|
+
docs root without `.md` (e.g. `orders-api`, `architecture/overview`).
|
|
107
|
+
- A bare `#id` means the current document. **Always prefer `#id` inside the
|
|
108
|
+
same doc** — it survives renames. Do not repeat the current doc's slug.
|
|
109
|
+
- A reference to an id that does not exist is a **dangling reference** and
|
|
110
|
+
fails validation. Only add a `ref` to an id that exists (or that you create
|
|
111
|
+
in the same change).
|
|
112
|
+
|
|
113
|
+
The only reference-bearing field in v1 is `userstory.links[].ref`.
|
|
114
|
+
|
|
115
|
+
## Names, titles, voice
|
|
116
|
+
|
|
117
|
+
- **Use the user's nouns, verbatim.** They say "tenants" — do not write
|
|
118
|
+
"customers". Carry their exact terms into labels, headings, node names.
|
|
119
|
+
- **One consistent world.** The service named `orders-api` in the `c4` keeps
|
|
120
|
+
that exact name in the `sequence`, the `erd`, and the prose.
|
|
121
|
+
- **Headings state what the reader sees** ("Request flow", "Rollout plan"),
|
|
122
|
+
never the block type ("Sequence").
|
|
123
|
+
- **`meta` cover**: `title` = what the document is, in the user's domain
|
|
124
|
+
language; `subtitle` = the question it answers; `tag` = a short pill
|
|
125
|
+
(`RFC`, `Runbook`). If the user named the doc, use that name as-is.
|
|
126
|
+
- **Match their register.** Do not inflate "quick notes on auth" into "Authn
|
|
127
|
+
& Authz Architecture Specification". "DRAFT" left in a finished doc is a
|
|
128
|
+
bug.
|
|
129
|
+
- `frontend` is a top-down tree; `felogic` (or `variant: be`) is a module
|
|
130
|
+
graph with edges. Do not swap them.
|
|
131
|
+
- Do not add a `prose` block AND raw `##` headings for the same idea. Pick
|
|
132
|
+
one.
|