intent-format 0.0.0-stage → 1.2.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 (175) hide show
  1. package/.github/ISSUE_TEMPLATE/1-something-wrong.yml +18 -0
  2. package/.github/ISSUE_TEMPLATE/2-idea.yml +11 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  4. package/AGENTS.md +11 -0
  5. package/CHANGELOG.md +287 -0
  6. package/CLAUDE.md +1 -0
  7. package/CODE_OF_CONDUCT.md +128 -0
  8. package/CONTRIBUTING.md +19 -0
  9. package/LICENSE +21 -0
  10. package/README.md +71 -2
  11. package/SECURITY.md +10 -0
  12. package/VERSION +1 -0
  13. package/examples/example-app/AGENTS.md +19 -0
  14. package/examples/example-app/CLAUDE.md +1 -0
  15. package/examples/example-app/V1.0/apis/_index.md +14 -0
  16. package/examples/example-app/V1.0/apis/ap000001-list-items.md +20 -0
  17. package/examples/example-app/V1.0/apis/ap000002-save-item.md +28 -0
  18. package/examples/example-app/V1.0/backend/_index.md +15 -0
  19. package/examples/example-app/V1.0/backend/bn000001-app-server.md +24 -0
  20. package/examples/example-app/V1.0/backend/bn000002-main-database.md +22 -0
  21. package/examples/example-app/V1.0/backend/bn000003-file-storage.md +22 -0
  22. package/examples/example-app/V1.0/comments/_index.md +13 -0
  23. package/examples/example-app/V1.0/comments/cm000001-empty-list-message.md +15 -0
  24. package/examples/example-app/V1.0/components/_index.md +16 -0
  25. package/examples/example-app/V1.0/components/cp000001-button.md +32 -0
  26. package/examples/example-app/V1.0/components/cp000002-text-field.md +31 -0
  27. package/examples/example-app/V1.0/components/cp000003-item-row.md +34 -0
  28. package/examples/example-app/V1.0/components/cp000004-top-bar.md +26 -0
  29. package/examples/example-app/V1.0/decisions/_index.md +13 -0
  30. package/examples/example-app/V1.0/decisions/dc000001-where-do-item-images-live.md +26 -0
  31. package/examples/example-app/V1.0/edge-cases/_index.md +13 -0
  32. package/examples/example-app/V1.0/edge-cases/ec000001-save-fails.md +24 -0
  33. package/examples/example-app/V1.0/features/_index.md +17 -0
  34. package/examples/example-app/V1.0/features/ft000001-items.md +22 -0
  35. package/examples/example-app/V1.0/features/ft000002-account.md +21 -0
  36. package/examples/example-app/V1.0/features/ft000003-browse-items.md +26 -0
  37. package/examples/example-app/V1.0/features/ft000004-edit-an-item.md +33 -0
  38. package/examples/example-app/V1.0/features/ft000005-change-settings.md +21 -0
  39. package/examples/example-app/V1.0/ia/_index.md +13 -0
  40. package/examples/example-app/V1.0/ia/ia000001-main-map.md +23 -0
  41. package/examples/example-app/V1.0/intent-format.md +12 -0
  42. package/examples/example-app/V1.0/project.md +51 -0
  43. package/examples/example-app/V1.0/roles/_index.md +14 -0
  44. package/examples/example-app/V1.0/roles/ro000001-member.md +22 -0
  45. package/examples/example-app/V1.0/roles/ro000002-admin.md +19 -0
  46. package/examples/example-app/V1.0/rules/_index.md +13 -0
  47. package/examples/example-app/V1.0/rules/rl000001-item-name-is-required.md +20 -0
  48. package/examples/example-app/V1.0/screens/_index.md +17 -0
  49. package/examples/example-app/V1.0/screens/sc000001-home.md +18 -0
  50. package/examples/example-app/V1.0/screens/sc000002-item-list.md +43 -0
  51. package/examples/example-app/V1.0/screens/sc000003-item-detail.md +24 -0
  52. package/examples/example-app/V1.0/screens/sc000004-edit-item.md +35 -0
  53. package/examples/example-app/V1.0/screens/sc000005-settings.md +19 -0
  54. package/examples/example-app/V1.0/shells/_index.md +8 -0
  55. package/examples/example-app/V1.0/tech/_index.md +14 -0
  56. package/examples/example-app/V1.0/tech/tc000001-ui-framework.md +23 -0
  57. package/examples/example-app/V1.0/tech/tc000002-relational-database.md +25 -0
  58. package/examples/example-app/V1.0/userflows/_index.md +14 -0
  59. package/examples/example-app/V1.0/userflows/uf000001-create-an-item.md +66 -0
  60. package/examples/example-app/V1.0/userflows/uf000002-edit-an-item.md +47 -0
  61. package/examples/example-app/V1.1/CHANGES.md +12 -0
  62. package/examples/example-app/V1.1/apis/_index.md +14 -0
  63. package/examples/example-app/V1.1/apis/ap000001-list-items.md +20 -0
  64. package/examples/example-app/V1.1/apis/ap000002-save-item.md +28 -0
  65. package/examples/example-app/V1.1/backend/_index.md +15 -0
  66. package/examples/example-app/V1.1/backend/bn000001-app-server.md +24 -0
  67. package/examples/example-app/V1.1/backend/bn000002-main-database.md +22 -0
  68. package/examples/example-app/V1.1/backend/bn000003-file-storage.md +22 -0
  69. package/examples/example-app/V1.1/comments/_index.md +14 -0
  70. package/examples/example-app/V1.1/comments/cm000001-empty-list-message.md +15 -0
  71. package/examples/example-app/V1.1/comments/cm000002-filter-placement.md +12 -0
  72. package/examples/example-app/V1.1/components/_index.md +16 -0
  73. package/examples/example-app/V1.1/components/cp000001-button.md +32 -0
  74. package/examples/example-app/V1.1/components/cp000002-text-field.md +32 -0
  75. package/examples/example-app/V1.1/components/cp000003-item-row.md +34 -0
  76. package/examples/example-app/V1.1/components/cp000004-top-bar.md +26 -0
  77. package/examples/example-app/V1.1/decisions/_index.md +13 -0
  78. package/examples/example-app/V1.1/decisions/dc000001-where-do-item-images-live.md +26 -0
  79. package/examples/example-app/V1.1/edge-cases/_index.md +13 -0
  80. package/examples/example-app/V1.1/edge-cases/ec000001-save-fails.md +24 -0
  81. package/examples/example-app/V1.1/features/_index.md +17 -0
  82. package/examples/example-app/V1.1/features/ft000001-items.md +22 -0
  83. package/examples/example-app/V1.1/features/ft000002-account.md +21 -0
  84. package/examples/example-app/V1.1/features/ft000003-browse-items.md +26 -0
  85. package/examples/example-app/V1.1/features/ft000004-edit-an-item.md +33 -0
  86. package/examples/example-app/V1.1/features/ft000005-change-settings.md +21 -0
  87. package/examples/example-app/V1.1/ia/_index.md +13 -0
  88. package/examples/example-app/V1.1/ia/ia000001-main-map.md +23 -0
  89. package/examples/example-app/V1.1/intent-format.md +13 -0
  90. package/examples/example-app/V1.1/project.md +51 -0
  91. package/examples/example-app/V1.1/roles/_index.md +14 -0
  92. package/examples/example-app/V1.1/roles/ro000001-member.md +22 -0
  93. package/examples/example-app/V1.1/roles/ro000002-admin.md +19 -0
  94. package/examples/example-app/V1.1/rules/_index.md +13 -0
  95. package/examples/example-app/V1.1/rules/rl000001-item-name-is-required.md +20 -0
  96. package/examples/example-app/V1.1/screens/_index.md +17 -0
  97. package/examples/example-app/V1.1/screens/sc000001-home.md +18 -0
  98. package/examples/example-app/V1.1/screens/sc000002-item-list.md +44 -0
  99. package/examples/example-app/V1.1/screens/sc000003-item-detail.md +24 -0
  100. package/examples/example-app/V1.1/screens/sc000004-edit-item.md +35 -0
  101. package/examples/example-app/V1.1/screens/sc000005-settings.md +19 -0
  102. package/examples/example-app/V1.1/shells/_index.md +8 -0
  103. package/examples/example-app/V1.1/tech/_index.md +14 -0
  104. package/examples/example-app/V1.1/tech/tc000001-ui-framework.md +23 -0
  105. package/examples/example-app/V1.1/tech/tc000002-relational-database.md +25 -0
  106. package/examples/example-app/V1.1/userflows/_index.md +14 -0
  107. package/examples/example-app/V1.1/userflows/uf000001-create-an-item.md +66 -0
  108. package/examples/example-app/V1.1/userflows/uf000002-edit-an-item.md +47 -0
  109. package/examples/example-app/_ids.md +78 -0
  110. package/examples/example-app/_index.md +14 -0
  111. package/examples/example-app/inputs/brief.md +3 -0
  112. package/examples/example-app/inputs/links.md +3 -0
  113. package/kit/cli/README.md +128 -0
  114. package/kit/cli/intent-format.mjs +342 -0
  115. package/kit/cli/lib/agents.mjs +39 -0
  116. package/kit/cli/lib/check.mjs +412 -0
  117. package/kit/cli/lib/create.mjs +190 -0
  118. package/kit/cli/lib/frame.mjs +182 -0
  119. package/kit/cli/lib/generate.mjs +418 -0
  120. package/kit/cli/lib/kit.mjs +203 -0
  121. package/kit/cli/lib/migrate.mjs +97 -0
  122. package/kit/cli/lib/model.mjs +409 -0
  123. package/kit/cli/lib/next.mjs +134 -0
  124. package/kit/cli/lib/open.mjs +34 -0
  125. package/kit/cli/lib/parse.mjs +260 -0
  126. package/kit/cli/lib/project.mjs +120 -0
  127. package/kit/cli/lib/regen.mjs +112 -0
  128. package/kit/cli/lib/relations.mjs +380 -0
  129. package/kit/cli/lib/rename.mjs +23 -0
  130. package/kit/cli/lib/schema.mjs +185 -0
  131. package/kit/cli/lib/templates.mjs +41 -0
  132. package/kit/cli/lib/util.mjs +165 -0
  133. package/kit/cli/test/nav.mjs +145 -0
  134. package/kit/cli/test/roles.mjs +85 -0
  135. package/kit/cli/test/smoke.mjs +716 -0
  136. package/kit/skills/intent-format/SKILL.md +91 -0
  137. package/kit/skills/intent-format/links.md +142 -0
  138. package/kit/skills/intent-format/types/_overview.md +73 -0
  139. package/kit/skills/intent-format/types/api.md +111 -0
  140. package/kit/skills/intent-format/types/backend.md +110 -0
  141. package/kit/skills/intent-format/types/comment.md +66 -0
  142. package/kit/skills/intent-format/types/component.md +139 -0
  143. package/kit/skills/intent-format/types/decision.md +91 -0
  144. package/kit/skills/intent-format/types/edge-case.md +107 -0
  145. package/kit/skills/intent-format/types/feature.md +154 -0
  146. package/kit/skills/intent-format/types/ia.md +106 -0
  147. package/kit/skills/intent-format/types/project.md +131 -0
  148. package/kit/skills/intent-format/types/role.md +98 -0
  149. package/kit/skills/intent-format/types/rule.md +100 -0
  150. package/kit/skills/intent-format/types/screen.md +153 -0
  151. package/kit/skills/intent-format/types/shell.md +156 -0
  152. package/kit/skills/intent-format/types/tech.md +109 -0
  153. package/kit/skills/intent-format/types/userflow.md +197 -0
  154. package/kit/skills/kb-cold-start/SKILL.md +124 -0
  155. package/kit/skills/kb-cold-start/kickoff-questionnaire.md +42 -0
  156. package/kit/skills/kb-cold-start/templates.md +108 -0
  157. package/package.json +30 -4
  158. package/rationale.md +180 -0
  159. package/schema.json +5895 -0
  160. package/spec.md +1173 -0
  161. package/templates/api.md +16 -0
  162. package/templates/backend.md +15 -0
  163. package/templates/comment.md +11 -0
  164. package/templates/component.md +15 -0
  165. package/templates/decision.md +23 -0
  166. package/templates/edge-case.md +14 -0
  167. package/templates/feature.md +14 -0
  168. package/templates/ia.md +14 -0
  169. package/templates/project.md +34 -0
  170. package/templates/role.md +14 -0
  171. package/templates/rule.md +14 -0
  172. package/templates/screen.md +14 -0
  173. package/templates/shell.md +24 -0
  174. package/templates/tech.md +18 -0
  175. package/templates/userflow.md +20 -0
package/spec.md ADDED
@@ -0,0 +1,1173 @@
1
+ # Intent Format 1.0 — Specification
2
+
3
+ `standard: IntentFormat/1.0` · Status: normative · Companion: `schema.json`
4
+
5
+ Intent Format is a format for the knowledge base (KB) of a software product, written as plain
6
+ Markdown files. This document is the normative text; `schema.json` is the machine-readable
7
+ source of the same rules — types, keys, sections, relations, generated sections, diagnostics,
8
+ grammar — and the two never disagree. Long tables live only in the schema and are cited by
9
+ path, e.g. `schema.json types.<type>.sections`.
10
+
11
+ **Reading the rules.** Rules are numbered `S-<TOPIC>-<n>`, stated once and cited by number
12
+ elsewhere. MUST, SHOULD and MAY have their RFC 2119 meaning. A bracketed code is the
13
+ diagnostic `intent-format check` reports when the rule is broken (`schema.json diagnostics`): a MUST on
14
+ KB content cites an error (`E…`) or warning (`W…`), a SHOULD an info (`I…`) where one exists.
15
+ A MUST on a tool cites the diagnostics that trigger or verify it, so fixtures can test it. Examples use the abstract `example-app`: screens Home, Item list, Item detail, Edit item
16
+ and Settings; features Items and Account.
17
+
18
+ ## 1 Scope and principles
19
+
20
+ A **KB** is a folder of cards plus generated machinery. A **card** documents one thing of a
21
+ product: a screen, component, user flow, IA map, rule, API call, feature, edge case, backend
22
+ node, technology, decision, comment — or the project itself. People write cards in any
23
+ Markdown editor; agents and tools parse the same files. Canvas positions and tool snapshots
24
+ are outside the standard.
25
+
26
+ **S-CORE-1 · One card = one file = one panel.** A card is one Markdown file holding what a tool
27
+ panel shows for it, in the same order. Parts shown inside a card — screen and component
28
+ variants, flow steps — are sub-documents of its file (S-SUB-1) and MUST NOT be files of their
29
+ own [E002]: no card type exists for them.
30
+
31
+ **S-CORE-2 · Truth Law.** The files are the database: everything a tool shows is read from them
32
+ or computed from them, and no hidden store, index or sidecar knows more. Edges are relation
33
+ lines in card bodies (chapter 5) or one of the two membership keys (S-FM-8); front matter
34
+ MUST NOT carry any other edge [W003].
35
+
36
+ **S-CORE-3 · Ownership Law.** The one who knows writes; the one who is referenced computes. A
37
+ definition lives once, on its own card; usage is written at the point of use, at any
38
+ granularity — a screen and one of its flow steps may both name the same API. Each relation has
39
+ exactly one authored end (`schema.json relations`); its reverse is generated into a `⚙`
40
+ section and MUST NOT be authored [W016] [W017]. Repetition across authored lines is never a
41
+ finding; generated lists de-duplicate.
42
+
43
+ **S-CORE-4 · Four kinds of empty.** A section body, sub-document body, value or relation target
44
+ is in exactly one state:
45
+
46
+ - **content** — anything else;
47
+ - **`—`** (U+2014) alone — a **blind spot**: the question exists, the answer is unknown;
48
+ counted in health (S-CONF-2);
49
+ - **`none`** alone — **verified none**: known to be empty; not counted;
50
+ - **generated** — a `⚙` section, written only when it has content (S-BODY-5).
51
+
52
+ A body state MUST be the whole body, never mixed with other lines [W015] — with one exception: in a
53
+ list section, a final item `—` (`- —` or `N. —`) marks the list as **incomplete** (more items
54
+ exist but are unknown) and counts as one blind spot. Values and relation targets use `—` only. An absent optional section means nothing to say; an absent required
55
+ section is a gap (S-BODY-3). `-`, `–`, `TBD` or `?` alone read as `—` and SHOULD be written
56
+ as `—` [I005]. The `Why` section adds two values of its own, `none — <note>` and `same as #<id>`
57
+ (S-BODY-7). A question for the owner inside a sentence is an `[ask: …]` marker (S-BODY-8).
58
+
59
+ **S-CORE-5 · Warn, never block.** An incomplete or inconsistent KB is a normal working state:
60
+ tools read, show, check and export it whatever its warnings and infos. Only errors stop
61
+ `regen` (regenerate), which MUST NOT run while one stands [E001] [E002] [E003] [E004] [E005].
62
+
63
+ **S-CORE-6 · Idempotency.** Generated content is a pure function of authored content: no dates,
64
+ clocks or tool names. Running `regen` twice with no authored change in between changes no
65
+ file; a conforming generator MUST meet this [I001] [I020].
66
+
67
+ ## 2 Package
68
+
69
+ **S-PKG-1 · Project root.** A project root holds:
70
+
71
+ ```
72
+ <project-root>/
73
+ _index.md ⚙ versions roster (version · lifecycle · based on)
74
+ _ids.md ⚙ project-wide ID register (S-ID-6)
75
+ AGENTS.md how a fresh agent starts; CLAUDE.md imports it (S-PKG-8)
76
+ inputs/ raw sources; URLs in inputs/links.md (S-PKG-7)
77
+ proposal/ cold-start working files; report.md beside it (S-PKG-8)
78
+ layout/ tool-private canvas positions (S-PKG-5)
79
+ V1.0/ one workspace per version (chapter 8)
80
+ intent-format.md manifest
81
+ project.md project card
82
+ CHANGES.md ⚙ only when based-on is set (S-VER-5)
83
+ roles/ screens/ components/ shells/ userflows/ ia/ rules/ apis/ features/
84
+ edge-cases/ backend/ tech/ decisions/ comments/
85
+ _index.md ⚙ folder roster
86
+ ```
87
+
88
+ Workspace folders are named `V<major>.<minor>`, explorations `V<major>.<minor>-<label>`.
89
+ `inputs/`, `layout/`, `proposal/` and the agent files MAY be absent.
90
+
91
+ **S-PKG-2 · Workspace.** A workspace holds one full KB and MUST contain exactly one manifest
92
+ `intent-format.md` and one project card `project.md` at its root [W032]. A card outside any
93
+ workspace is a valid fragment: it announces its own standard, type and identity.
94
+
95
+ **S-PKG-3 · Manifest.** `intent-format.md` describes the KB as an artifact; `project.md` describes
96
+ the product. The manifest's front matter MUST hold these keys in this order [W033]:
97
+ `standard`, `type: manifest`, `kb` (a lowercase slug), `name`, `version` (quoted, equal to the
98
+ folder name without `V`), `lifecycle` (S-VER-2), optional `based-on` (S-VER-3), `modules` (the
99
+ enabled type folders, e.g. `[screens, components, userflows]`), then optional `x-*` keys. Its
100
+ title is `# <name>`; its body is one paragraph on what the KB documents and who maintains it.
101
+ All workspaces of a project SHOULD share one `kb` [I023]; a copy that becomes a separate
102
+ project takes a new one.
103
+
104
+ **S-PKG-4 · Modules.** Each type folder is a module that works alone: arrangements (IA maps,
105
+ flows) reference libraries (screens, components), never the reverse, so any module is usable
106
+ and exportable by itself. A card MUST sit in an enabled module [W034]. Each enabled module
107
+ SHOULD have its folder, and the folder of a module that is not enabled SHOULD NOT exist
108
+ [I019]. A generated section is computed only when every module it reads is enabled; a required
109
+ section whose targets live only in a disabled module becomes optional (`relief` in the
110
+ registry).
111
+
112
+ **S-PKG-5 · Folders.** Type folders are flat, with the exact lowercase names above; grouping by
113
+ feature, state, platform or status is a computed perspective (S-FEAT-6), never a folder. A
114
+ card MUST sit directly in its type's folder — the project card at the workspace root — and
115
+ every `.md` file in a workspace MUST have front matter [W031]. A misfiled card is still what
116
+ its `type:` says; tools report it and MAY offer a move, never move silently. Names starting
117
+ with `_` are reserved for generated files; non-`.md` files are attachments, ignored by tools.
118
+ `layout/` is tool-private and outside the knowledge guarantee: it holds no fact. A canvas move
119
+ that changes hierarchy edits the IA map; a position-only move edits `layout/`.
120
+
121
+ **S-PKG-6 · Head files.** `_index.md` at the project root (versions roster) and in each module
122
+ folder (card roster) is fully generated: front matter `standard`, `type: index`, `name`; title
123
+ `# <name>`; a purpose line from the schema; a `## ⚙ Contents` table (`schema.json indexFile`).
124
+ Hand authors MAY omit head files; a missing or stale one SHOULD be regenerated [I020].
125
+ `_ids.md` and `CHANGES.md` are generated files of the same kind.
126
+
127
+ **S-PKG-7 · Inputs.** `inputs/` holds raw sources — documents, designs, exports, kickoff answers
128
+ — and `inputs/links.md` lists URLs. Cards MAY cite them as evidence (`Link` lines with
129
+ `type: Source`, S-LINK-6). `inputs/` belongs to no workspace and is not validated.
130
+
131
+ **S-PKG-8 · Agent entry and working files.** `AGENTS.md` at the project root tells a fresh
132
+ agent where the standard is and to start with `intent-format next`, which derives the next step from the
133
+ project's own files alone; `CLAUDE.md` holds `@AGENTS.md`. Tools create them when missing and
134
+ never overwrite them. `proposal/` (inventory, frames, decisions, questions, review) and
135
+ `report.md` are the cold start's working files; they are not cards and are never checked.
136
+ `.intent-format.lock` exists only while a writing command runs.
137
+
138
+ Filenames are defined with identifiers (S-ID-8).
139
+
140
+ ## 3 Cards
141
+
142
+ A card has four parts, in order: front matter, title line, optional status line, sections.
143
+
144
+ ```markdown
145
+ ---
146
+ standard: IntentFormat/1.0
147
+ type: screen
148
+ id: SC000002
149
+ name: Item list
150
+ status: In design
151
+ feature: FT000002
152
+ ---
153
+ # Item list · #SC000002
154
+ > ⚙ #SC000002V1.1 · V1.1 in-progress · based on V1.0 · changed: Components
155
+
156
+ ## Description
157
+ Shows all of a Member's items as rows; choosing a row opens Item detail.
158
+
159
+ ## Components
160
+ 1. [#CP000003 Item row](../components/cp000003-item-row.md) — one per item
161
+ ```
162
+
163
+ The top bar around it is not listed: it belongs to the shell that frames the page (section 6.4).
164
+
165
+ ### 3.1 Front matter
166
+
167
+ **S-FM-1 · Shape.** Front matter is a flat YAML subset between two `---` lines at the very top
168
+ of the file: one `key: value` per line; no nesting, block lists or comments; a list is a
169
+ one-line flow list `[a, b]`, only where the key allows one. Front matter MUST parse this way
170
+ [E001]. If a key repeats, the first occurrence wins.
171
+
172
+ **S-FM-2 · Sniff key.** The first key of every file — card, manifest or generated file — MUST
173
+ be `standard: IntentFormat/1.0` [W001].
174
+
175
+ **S-FM-3 · Keys and order.** Keys MUST follow this order [W002]: `standard`, `type`, `id`,
176
+ `name`, `status`, then `state` and `feature` where the type allows them, the type's extras in
177
+ schema order, `origin`, and `x-*` keys. Required keys MUST be present with a value, `—` when
178
+ unknown [W004]. A key not defined for the type MUST NOT be used [W003]; tools preserve it. Each
179
+ type's keys: `schema.json types.<type>.keys`.
180
+
181
+ **S-FM-4 · Type.** `type:` MUST name a card type (S-TYPE-1), `manifest`, `index` or an
182
+ extension type `x-<slug>` [E002].
183
+
184
+ **S-FM-5 · Name.** `name:` is the authored name; the title, reference text and filename slug
185
+ render it. It MUST NOT contain `[` or `]` [W007].
186
+
187
+ **S-FM-6 · Status.** `status:` MUST be a value of the type's status vocabulary, or `—` [W005].
188
+ Status is written only with evidence — a design, code, a release, an owner's answer. The
189
+ vocabularies (`schema.json statusVocabularies`):
190
+
191
+ - default: `Idea · In design · Approved · In build · Live · Parked`; Parked sets a card aside
192
+ from any stage; movement is free in both directions;
193
+ - tech: `Candidate · Evaluating · Adopted · Deprecated · Rejected`;
194
+ - decision: `Open · Proposed · Decided · Superseded · Dropped`;
195
+ - comment: `Open · Resolved`, the only representation of a comment's state.
196
+
197
+ **S-FM-7 · State.** `state:` (not on the project card or comments) is optional and holds a
198
+ State name, `Shared`, or a list of State names; omitted means Shared. It MUST NOT appear when
199
+ `project.md` declares no States [W009]. A userflow or IA map MUST carry at most one state
200
+ [W042]. Cards store State names, never codes.
201
+
202
+ **S-FM-8 · Membership keys.** `feature:`, `parent:`, `shell:` (S-SHELL-4) and a stepper
203
+ shell's `flow:` (S-SHELL-1) are the only front-matter keys holding a core, one value each. `feature:` (screens, userflows, components) names the card's single
204
+ **home**, a Feature or Sub-feature; `parent:` (features) names a Sub-feature's top-level
205
+ Feature. The core MUST resolve in the workspace [W019] to a feature card [W018]. Their reverses
206
+ are generated on the feature card (S-FEAT-3).
207
+
208
+ **S-FM-10 · Users.** `users:` on a screen or a user flow names the user types it is for: one
209
+ role card name, or a list. Omitted means every user type whose states include the card's
210
+ state. Tools read it as a lens (show the map as a Member), never as a boundary.
211
+
212
+ **S-FM-9 · Values.** A value is plain text to the end of the line, double-quoted only where YAML
213
+ requires it: it contains `: ` or ` #`, starts with a special character or a space, or would
214
+ read as a number, boolean or null (`\"` escapes a quote). `version`, `based-on` and
215
+ `tech-version` are always quoted; `—` never is. Quoting MUST follow these rules [W008].
216
+ Unneeded quotes SHOULD be dropped [I013]. A value MUST match its key's enum or pattern, and a
217
+ list MUST NOT stand where one value is allowed [W007]; vocabulary values follow S-VOC-2.
218
+
219
+ ### 3.2 Title and status line
220
+
221
+ **S-BODY-1 · Title.** The first body line MUST be the title [W010]: `# <name> · #<CORE>` for
222
+ cards — core only, no state code or version — and `# <name>` for manifests and generated
223
+ files. It SHOULD match `name:` and `id:`; `regen` rewrites it [I002].
224
+
225
+ **S-BODY-2 · Status line.** Directly under the title, `regen` writes the status line
226
+ `> ⚙ <rendered-id> · V<version> <lifecycle>[ · based on V<base>][ · new | unchanged | changed: <Part>, <Part>]`,
227
+ e.g. `> ⚙ #SC000006V1.1 · V1.1 in-progress · based on V1.0 · changed: Components` (rendered ID:
228
+ S-ID-7; change status: S-VER-4). It is machine-owned, never written by hand; a tool-grade card
229
+ SHOULD carry a current one [I001].
230
+
231
+ ### 3.3 Sections and zones
232
+
233
+ **S-BODY-3 · Section registry.** Sections are `## <Heading>` lines spelled exactly as in the
234
+ type's registry (`schema.json types.<type>.sections`), which marks each section required or
235
+ optional, authored or generated, and gives its default relation and content shape. A section
236
+ is required when its absence is a real knowledge gap for its type; `Links`, `Tags` and
237
+ `Comments` are never required. Each required section MUST be present, holding content,
238
+ `—` or `none` [W011]. Sections MUST follow registry order, authored before generated [W012],
239
+ and a heading MUST NOT repeat [W013].
240
+
241
+ **S-BODY-4 · Unknown sections.** A `##` heading outside the registry is preserved where it
242
+ stands among the authored sections; it SHOULD be a registry heading or an extension section
243
+ `## x-<name>` (S-EXT-1) [I008].
244
+
245
+ **S-BODY-5 · Zones.** The **authored zone** — front matter, sections without `⚙`,
246
+ sub-documents, a comment's remark — belongs to people. The **generated zone** — `## ⚙
247
+ <Heading>` sections and generated files — belongs to `regen`, which rewrites it whole; hand
248
+ edits there are lost. A `## ⚙` heading MUST be in the type's registry or be `## ⚙ x-<name>`
249
+ [W014]. Generated sections hold bound reference lines only, one fact per line (the
250
+ `⚙ Contents` table excepted), and exist only with content: an empty one, or one holding `—` or
251
+ `none`, SHOULD NOT exist [I009]. The registry is closed; counts and roll-ups outside it come
252
+ only from `intent-format check`.
253
+
254
+ **S-BODY-6 · Content shapes.** The registry fixes each section's content: prose; relation lines
255
+ (chapter 5); ordered lines (S-REL-3); an IA tree (S-IA-1); sub-documents; vocabularies
256
+ (S-VOC-1); user stories (S-TYPE-2); Do & Don'ts, one `✅ <do>` or `🚫 <don't>` line each; Tags,
257
+ one comma-separated line. Do & Don'ts and Tags SHOULD keep their shapes [I024]. Prose sections
258
+ hold prose first, then requirement blocks.
259
+
260
+ **S-BODY-7 · Why.** Every card type except `comment` has a `## Why` section directly after
261
+ `## Description` (after `## Question` on decisions): one or two sentences answering the type's
262
+ **why question** (schema `why.questions`). The question has one of three flavours: *purpose* —
263
+ why this exists at all (project, feature, userflow, role); *choice* — why this way and not
264
+ another (screen, component, shell, ia, api, backend, tech, decision); *constraint* — what goes
265
+ wrong without it (rule, edge-case). A screen's why is therefore not its feature's why: the
266
+ feature says what problem it solves, the screen says why it is a screen of its own.
267
+ The section is required on the types that carry intent — `project`, `feature`, `rule`,
268
+ `decision`, `userflow`, `shell`, `role`, `tech` — and optional elsewhere, where an absent `Why`
269
+ means nothing to say and a present one counts like a required one. Its body is one of:
270
+
271
+ - text — the answer, optionally ending with a confidence mark (below). It MAY mention other
272
+ cards (`… purpose: #FT000003`); a Why says what the Description does not;
273
+ - `none`, or `none — <note>` — no why is needed here (a divider, a plain button); not counted;
274
+ - `same as #<id>` — another card's why covers this one, any card by its core id. A checker MUST
275
+ follow the link and, when that card has no why (or borrows one that is missing), count this
276
+ card as missing [I030]. An id that names no card, or the card itself, is a warning [W051];
277
+ - `—` — nobody has asked yet; a blind spot of kind `why` (S-CONF-2).
278
+
279
+ **Confidence.** A Why text or a decision's `Outcome` MAY end with one mark: `[likely]` — the
280
+ statement follows from the inputs but none states it; `[assumed]` — a guess no input
281
+ supports. Unmarked means confirmed by the owner or an input; `[confirmed]` MAY be written and
282
+ `regen` removes it [I031]. A mark anywhere else in the body is a warning [W051]. Confirming a
283
+ why means removing its mark. Health counts both marks (S-CONF-2); `intent-format open` lists them.
284
+
285
+ **S-BODY-8 · Ask markers.** A question for the owner that no card value can hold yet — an
286
+ unknown fact, a doubt about one sentence — is written where it belongs, inside the sentence,
287
+ as `[ask: <question>]`. It is allowed in any authored body line of any card, never in front
288
+ matter, a status line or a generated section. It is not a blind spot (`—` says *unknown*) and
289
+ not a guess (`[assumed]` says *probably*): it says *somebody must answer this*. Health counts
290
+ ask markers as **asks** — open, later, and due (S-CONF-2); `intent-format open` lists each with its card
291
+ and line, due ones first. An answer rewrites the sentence and the marker goes. When the owner says
292
+ *later*, the marker gains ` · later <YYYY-MM-DD>` and stays counted; after `ask.again` days (2) it
293
+ is **due** and is asked again. *Unknown* is not an answer: the marker stays as it is. Only the
294
+ owner closes a question as not relevant; a tool or agent MUST NOT drop one.
295
+
296
+ ### 3.4 Requirement blocks
297
+
298
+ **S-REQ-1 · Presets.** A requirement block opens with `**R<n> · <Preset>**`; `n` is unique in
299
+ the file, never reused or renumbered. The presets:
300
+
301
+ - `User story` — `As a <role>, I want <goal>, so that <benefit>.`; "so that" is mandatory and
302
+ `<role>` the exact name of a role card (S-TYPE-15);
303
+ - `GWT` (Given/When/Then) — one keyword per line, in that order; `And` / `But` continue the
304
+ previous one;
305
+ - `EARS` — `[When <trigger> | While <state> | If <condition> | Where <feature>, [then ]]the
306
+ system shall <response>.`;
307
+ - `Checklist` — one `- [ ] <verifiable item>` per line, `[x]` when done.
308
+
309
+ A block MUST match its marker and preset [W036]. A slot written `—` is a counted blind spot.
310
+ Any preset MAY be used anywhere; templates and agents start with the type's default
311
+ (`schema.json requirementPresets.defaults`). Requirement blocks have no anchors and are not
312
+ link targets.
313
+
314
+ ### 3.5 Sub-documents
315
+
316
+ **S-SUB-1 · Heading and anchor.** A sub-document is a part of a card with its own core: a screen
317
+ variant (`SV`) or component variant (`CV`) in `## Variants`, a flow step (`FS`) in
318
+ `## Steps`. It opens with `### [<glyph> ]<Name> · #<CORE>` (glyphs on steps only), and its
319
+ next line is the anchor `<a id="<core-lowercase>"></a>`. The heading MUST sit in its host
320
+ section, the anchor MUST equal the lowercase core, and a variant name MUST NOT repeat within
321
+ its host [W023]; the prefix MUST fit the host section [E003]. A missing anchor SHOULD be
322
+ added; `regen` adds it [I006].
323
+
324
+ **S-SUB-2 · Passport line.** After its anchor a variant MAY carry one passport line
325
+ `key: value · key: value` with these keys, in order, each omitted at its default: `state` (one
326
+ State name or `Shared`; default the host's), `opens-as` (default the host's), `platform`
327
+ (comma-separated; default all), `flag` (a feature-flag name, one token). Flow variants take
328
+ only `platform` and `flag`; flow steps take no passport line. A passport line MUST use only its
329
+ allowed keys, in order, with legal values [W024].
330
+
331
+ ## 4 Card types
332
+
333
+ **S-TYPE-1 · Roster.** The card types are closed, each with one prefix and one folder:
334
+ `project` PR (`project.md`) · `role` RO `roles/` · `screen` SC `screens/` · `component` CP `components/` ·
335
+ `shell` SH `shells/` · `userflow` UF `userflows/` · `ia` IA `ia/` · `rule` RL `rules/` · `api` AP `apis/` ·
336
+ `feature` FT `features/` · `edge-case` EC `edge-cases/` · `backend` BN `backend/` · `tech` TC
337
+ `tech/` · `decision` DC `decisions/` · `comment` CM `comments/`. A KB MAY use any subset. Each
338
+ type's purpose, keys and sections are in `schema.json types`; below is what they leave
339
+ implicit.
340
+
341
+ **S-TYPE-2 · project (PR).** The front door, read first by every agent; one per workspace
342
+ (S-PKG-2). `Description` says what the product is and for whom. `Main use
343
+ cases` holds lines `- As a <Role>, I want <goal>, so that <benefit>.`: each MUST be a user
344
+ story whose role is the exact name of a role card, once role cards exist [W037]. There SHOULD be 5–10 of
345
+ them [I017]. `Keep in mind` holds non-functional requirements (performance, offline, privacy,
346
+ accessibility, languages) as requirement blocks, or `none`. `Built with` names project-wide
347
+ technologies. `industry:` (free text: Travel, Fintech …) and `audience:` (B2C, B2B, B2B2C,
348
+ Internal system, Marketplace; one or several) frame the product's domain; both optional, read
349
+ by agents before anything else so that suggestions use the domain's vocabulary, journeys and
350
+ rules.
351
+
352
+ **S-TYPE-3 · screen (SC).** A place the user can be — a page, a modal, a panel with its own
353
+ composition: what it is for and what it is made of. `opens-as` is its default presentation
354
+ (omitted = Page); acceptance criteria are GWT blocks. A screen never states where it sits (IA
355
+ maps) or how users move through it (flows). A piece placed inside places — a row, a toast, a
356
+ menu — is a component; the same place with another composition is a variant; a different
357
+ purpose is a new screen. Persistent UI — a top bar on every page, a section's breadcrumbs, a
358
+ sheet's chrome — is never a screen: it is a **shell** (section 6.4), and SHOULD NOT be a part
359
+ of one [I027]. `shell:` names the shell a
360
+ screen usually sits in; omitted = resolved per placement (S-SHELL-4).
361
+
362
+ **S-TYPE-4 · component (CP).** A reusable part placed in screens or other components: what it
363
+ does wherever it appears, never what one screen uses it for. `component-type` is `atom`,
364
+ `molecule`, `organism` or `integration` (wrapping a third-party capability); `provider`, who
365
+ provides that capability, SHOULD appear only on integrations [I018]. `Components` lists inner
366
+ components (`none` for atoms). Interactions are described on the component, not as cards. The
367
+ frame around places is not a component but a shell (S-TYPE-14).
368
+
369
+ **S-TYPE-5 · userflow (UF).** A journey in one file: typed steps, an ordered step list per
370
+ variant and fork wiring (section 6.1); `Description` gives its intent, for whom
371
+ and its success criteria; `platform:` limits it to some platforms (omitted = all). A KB SHOULD have one flow per main use case or recurring journey.
372
+
373
+ **S-TYPE-6 · ia (IA).** One IA map: screens arranged in a hierarchy plus lateral edges — pure
374
+ arrangement (section 6.2); `platform` limits it (omitted = all). A KB MAY hold several maps,
375
+ one per arrangement of the product (per State when States change which screens exist).
376
+
377
+ **S-TYPE-7 · rule (RL).** One business rule stated once, in plain words — one precise sentence
378
+ or an EARS block — with its exact numbers and conditions. Other cards cite it (`Applies rule`,
379
+ or `· rule:` on a fork branch) and SHOULD NOT restate it (Appendix B). An acceptance criterion
380
+ of one card stays in that card; a situation with its handling is an edge case.
381
+
382
+ **S-TYPE-8 · api (AP).** One call the product makes or exposes: `method` is an uppercase token
383
+ (GET, POST…), `endpoint` a path or address (`/items/{id}`). `Served by` MUST hold exactly one
384
+ line, the backend node serving the call [W022].
385
+
386
+ **S-TYPE-9 · edge-case (EC).** A named exceptional situation and every place it can happen;
387
+ `severity` (`High · Medium · Low`) is the impact if unhandled. `Description`
388
+ states the situation and its handling, as a GWT or EARS block with both parts; `Where` lists
389
+ every screen, variant, component, flow, step, API or backend node concerned. Status reads as a
390
+ risk register: Idea = spotted, Approved = handling agreed, Live = handled. An edge case that
391
+ grows steps SHOULD become a small flow attached where it applies.
392
+
393
+ **S-TYPE-10 · backend (BN).** A node of the product's backend: `backend-type` is `server`,
394
+ `service`, `database`, `storage`, `integration`, `repo` or `environment`. `Connections` lists
395
+ the nodes it talks to, `- <node> · kind: calls|stores|deploys|belongs`, or `none`; `kind` MUST
396
+ take one of these values [W021]. What a node runs on is tech; each call it serves is an api
397
+ card naming it in `Served by`.
398
+
399
+ **S-TYPE-11 · tech (TC).** A technology the product uses or considers: a language, framework,
400
+ library, platform or external service. `category` is one Tech category; `tech-version`
401
+ (quoted), `license` and `provider` are optional. Required: `Description` (what
402
+ it is, what it is used for here), `Why` (with evidence or a decision reference),
403
+ `Alternatives` (TC references, placeholders or `none`). Cards name it in `Built with`. An open
404
+ technology need SHOULD be a placeholder in a `Built with` section (`- [~ Graph canvas
405
+ library]`) plus an Open decision. A node of this product is backend; the provider wrapped by
406
+ an integration component is tech.
407
+
408
+ **S-TYPE-12 · decision (DC).** A question that needs or got a decision: `Question` (one or two
409
+ sentences), `Options` (each with its trade-off; the recommendation, if any), `Outcome` (`—`
410
+ while Open or Proposed, then the choice and why) and `Affects` (every card or sub-document the
411
+ outcome changes). A Decided or Superseded decision MUST state its Outcome [W039] and record
412
+ `decided: <YYYY-MM-DD>` (who, in `by:` — `owner`, `agent` or a role card name); a Superseded one
413
+ MUST name its successor in `superseded-by: <DC core>`; these keys on another status are a
414
+ warning [W052]. Once Decided, the Outcome is not edited: what happens later
415
+ (carried out, a later change that leaves the decision as it is) is a dated line in the optional
416
+ `History` section, after `Affects`; a new question reopens the decision instead. Rejected options are the `Options` lines that are not the Outcome. Every open
417
+ question, judgment call or conflict between inputs SHOULD become a decision with
418
+ `status: Open`. A remark is a comment; a runtime branch is a Fork step. Exports include
419
+ decisions.
420
+
421
+ **S-TYPE-13 · comment (CM).** One remark, with a short `name` like every card; `author` (name or
422
+ role) is required, `date` (`YYYY-MM-DD`) optional. The remark is the prose directly under the
423
+ title and status line and MUST be present [W011]; `Links` is the only optional section. A card
424
+ attaches a comment with a line in its `## Comments` (in a sub-document, `- Comment: …`);
425
+ `⚙ Attached to` lists those places. A remark that needs a choice SHOULD be a decision instead.
426
+ Exports exclude comments by default.
427
+
428
+ **S-TYPE-14 · shell (SH).** The frame around places (section 6.4): `shell-type` names its
429
+ kind; `platform` and `state` say whom it frames; `opens-as` (overlays) the presentation it
430
+ frames; `flow` (steppers) the flow it shows. `Components` are its own parts, `Navigation`
431
+ where it leads, `Places inside` the contract for what it frames, `Variants` the frame per
432
+ platform, state and level. Typically three to eight per product (S-SHELL-8); a KB without
433
+ shells is valid.
434
+
435
+ **S-TYPE-15 · role (RO).** A user type: who uses the product, why they come and how they use
436
+ it — Guest, Member, Admin, or back-office staff the product must know about. Not a persona (a
437
+ named person). `state:` lists the States the role can be in (omitted = all); `platform:` the
438
+ platforms it uses (omitted = all), so its frames are the app shells of those platforms.
439
+ Stories name a role by its exact card name — "As a Member, …" — and the role card lists them
440
+ in `⚙ Stories`; what a role wants is never restated on it. Role names MUST be unique in a
441
+ workspace [W049]; a role that no story names is a finding [I029]. A role whose screens differ
442
+ from another's maps to its own State; content that differs by role inside one State is
443
+ written on the screen, in prose or GWT.
444
+
445
+ ### 4.1 Features
446
+
447
+ **S-FEAT-1 · Two levels.** The `feature` type has two levels. A **Feature** is a top-level
448
+ product domain without `parent:`; it says why the domain exists and its scope in and out. A
449
+ **Sub-feature** is a user-facing capability named by its outcome, with `parent: <FT core of a
450
+ Feature>`; it says what capability, for whom, usually with User story blocks. `priority` is
451
+ `High`, `Medium` or `Low`. `parent:` MUST point to a top-level Feature — not itself, a
452
+ Sub-feature or another type [W030]. In `example-app`, Feature Items has Sub-features Browse
453
+ items and Edit an item; Feature Account has Change settings.
454
+
455
+ The feature tree groups by purpose, never by screen: a capability with a why, rules or decisions of
456
+ its own SHOULD be a Feature, wherever the user reaches it from (a loyalty programme opened from the
457
+ profile screen is its own Feature; the way there is navigation, S-IA-1 and S-SHELL-6). A Sub-feature's
458
+ `## Why` is normally `same as` its Feature's. When a Sub-feature outgrows its Feature, `parent:` is
459
+ removed and the id kept; the move is recorded as a decision.
460
+
461
+ **S-FEAT-2 · Home line.** A screen, userflow or component MAY name its single home with
462
+ `feature:` (S-FM-8); other features reach it through flows and touchpoints. When the workspace
463
+ has feature cards, every screen and userflow SHOULD have a home [I025].
464
+
465
+ **S-FEAT-3 · Generated lists.** A feature card lists only cards homed directly on it:
466
+ `⚙ Sub-features` (each with its one-liner, verbatim), `⚙ Screens`, `⚙ Also uses` (other
467
+ features' screens its flows pass through, with `· home:`), `⚙ User flows`, `⚙ Components`,
468
+ `⚙ Also connects` (other features' flows its flows run or hand off to, with `· home:`) and
469
+ `⚙ Decisions`. There is no roll-up from Sub-features, and the two "Also" lists skip unhomed
470
+ cards; tools MAY aggregate further in their UI.
471
+
472
+ **S-FEAT-4 · Touchpoints.** A Feature or Sub-feature MAY list in `## Touchpoints` delivery
473
+ points that homes and flows do not cover — a component, a variant (`#SV…`), a step. The
474
+ touched card shows the reverse in `⚙ Features`.
475
+
476
+ **S-FEAT-5 · Altitude rule.** Each level answers only its own question: Feature — why and
477
+ scope; Sub-feature — what capability, for whom; flow and step — how the user moves; screen —
478
+ what the place is for and made of; component — what the part does anywhere; rule — the exact
479
+ policy. A card's **one-liner** is the first sentence of its `Description`
480
+ (decision: `Question`; comment: the remark). Parents never summarise children; child lists are
481
+ generated. Numbers, limits and conditions live in rules or the lowest owner: a top-level
482
+ Feature's `Description` SHOULD contain no digits [I021].
483
+
484
+ **S-FEAT-6 · Perspectives.** Tools MAY group cards by feature, state, platform or status —
485
+ including a feature selector and the variants a feature touches — as views computed over the
486
+ files; nothing is stored for them.
487
+
488
+ ### 4.2 Vocabularies
489
+
490
+ **S-VOC-1 · Defined once.** Project vocabularies are defined only in `project.md`
491
+ `## Vocabularies`, in four optional subsections that start empty: `### States`, a table
492
+ `State · Code · Note`; and `### Platforms`, `### Opens-as`, `### Tech categories`, one
493
+ bullet per value, `- <value>[ — <note>]`. Tables MUST have exactly these columns, lists one
494
+ bullet per value, and a value MUST NOT repeat [W035]. An empty vocabulary is not in use. User
495
+ types are role cards (S-TYPE-15); a `### Roles` table (`Role · Description · States`) from
496
+ earlier KBs is still read — its names resolve stories while no role card exists — but is
497
+ deprecated [W050]; `intent-format migrate` turns each row into a role card.
498
+
499
+ **S-VOC-2 · Selection.** Cards select values by exact name and never define them inline. A
500
+ state, platform, opens-as or Tech category value MUST be declared in `project.md` or be
501
+ reserved, and a story's role MUST name a role card once role cards exist [W006]. The reserved values `Shared` (state), `All` (platform) and `Page`
502
+ (opens-as) are always legal unlisted, and are what an omitted state, platform or opens-as
503
+ means. `Shared` MUST NOT be a States row [W035].
504
+
505
+ **S-VOC-3 · Roles and States.** A **Role** is who uses the product — a card (S-TYPE-15); user
506
+ stories name it. A **State** is a mode of the product in which a different set of screens exists — typically
507
+ signed in versus signed out; an app-wide mode that does not change which screens exist is a
508
+ screen. Without States, cards carry no `state:` and IDs no state code. A State's code is `S`
509
+ plus its first letter; on a collision the later row takes two letters, then three, until
510
+ unique; `SG` is reserved for Shared; a code never changes, even when the State is renamed.
511
+ Codes MUST follow this rule [W035].
512
+
513
+ ## 5 Links and relations
514
+
515
+ **S-LINK-1 · Reference atoms.** A reference names its target by core, in one of four strengths:
516
+
517
+ - **bound** `[#<CORE> <Name>](<relative-path>[#<anchor>])`, e.g.
518
+ `[#SC000003 Item detail](../screens/sc000003-item-detail.md)`; a step in the same file is
519
+ `[#FS000004 Save the item](#fs000004)`;
520
+ - **hand** `#<CORE>` — a valid edge; `regen` upgrades it to bound;
521
+ - **placeholder** `[~ <Name>]` — should exist, does not yet (S-LINK-5);
522
+ - **unknown** `—` — a declared blind spot.
523
+
524
+ Only the core is load-bearing; name and path are courtesies that `regen` rewrites, and stale
525
+ text SHOULD be refreshed [I007]. A bound or hand reference MUST resolve to a card or
526
+ sub-document of its workspace [W019]. Nothing must exist before it is referenced: placeholders
527
+ and `—` are legal wherever a target is.
528
+
529
+ **S-LINK-2 · Relation lines.** In a relation context each line is one edge,
530
+ `- <Relation>: <atom>[ · <key>: <value>]…[ — <note>]`, with marker `- ` (`<n>. ` in ordered
531
+ sections). Such a line MUST be a relation line, a body state or an allowed sub-heading [W015].
532
+ A note follows ` — `, stays short and never restates the target card (Appendix B).
533
+
534
+ **S-LINK-3 · Qualifiers.** A qualifier ` · <key>: <value>` refines an edge. Keys are lowercase,
535
+ order-free and drawn from the relation's closed set (`schema.json
536
+ relations.<Relation>.qualifiers`); a valueless qualifier such as `· primary` is a mark. A value
537
+ is plain text, a placeholder or a bare core (`· rule: #RL000001`) — never a bound link — and is
538
+ quoted when it contains ` · `, `—` or `→`. Qualifiers MUST follow these rules, with values from
539
+ their enum or vocabulary [W021].
540
+
541
+ **S-LINK-4 · Mentions.** References MAY appear in prose, as untyped **mentions**: resolved and
542
+ refreshed, never a relation. A prose placeholder counts as unresolved; `—` in prose is
543
+ punctuation.
544
+
545
+ **S-LINK-5 · Placeholders and promotion.** Placeholders group by (relation target type,
546
+ whitespace-collapsed name), prose placeholders under target type "any"; each group is one
547
+ unresolved placeholder in health, and placeholders never feed generated sections. Promotion —
548
+ replacing `[~ X]` with a reference once the card exists — is an explicit edit; `regen` never
549
+ promotes. When a placeholder's name exactly matches a card of a target type, `check` reports
550
+ "`[~ X]` can now link to `#<CORE>`", and the author SHOULD promote it [I014].
551
+
552
+ **S-LINK-6 · External links.** `## Links` holds external links,
553
+ `- [<title>](<url or inputs/ path>) · type: <type>[ — <note>]`, with type `Design`, `Code`,
554
+ `Doc`, `Source`, `Analytics` or `Other`; `Source` marks evidence, a file in `inputs/` or a
555
+ URL. A `Source` path MUST point inside the project root's `inputs/` [W053]: nothing outside it
556
+ (a notebook, a scratch folder) is evidence until it is moved there. In a sub-document the line takes its prefix, `- Link: …` — e.g. a variant's own design.
557
+ Link lines MUST have this shape [W038].
558
+
559
+ **S-REL-1 · Closed vocabulary.** Relations come from `schema.json relations`, which gives each
560
+ one's meaning, authored places, target types, qualifiers and generated reverse. A relation word
561
+ outside it MUST NOT be used in a relation context, except an extension relation `x-<slug>`
562
+ [W016]. A relation MUST be legal where it is written — section, sub-document, step shape
563
+ [W017]; its target MUST be of an allowed type [W018]; its lines MUST respect its cardinality
564
+ [W022], such as exactly one `Served by` line. An explicit relation word overrides the section
565
+ default.
566
+
567
+ **S-REL-2 · Default relations.** A section with a default relation (`defaultRelation` in the
568
+ registry) takes prefix-less lines, `- <atom>[ · <key>: <value>]…[ — <note>]`. Writing the
569
+ default word anyway is tolerated and SHOULD be dropped [I003]. Sub-document lines and `Edge`,
570
+ `Branch`, `Entry`, `Outcome` and extension relations always carry their prefix.
571
+
572
+ **S-REL-3 · Ordered lines.** Where order is meaning — component lists and step lists — lines are numbered
573
+ `1.`, `2.`, … and the order is the truth. Such sections MUST use numbered lines that never nest
574
+ [W015]; the numbers SHOULD run 1..N, and `regen` renumbers them [I015].
575
+
576
+ **S-REL-4 · Generated reverses.** `regen` writes each authored relation's reverse on its target,
577
+ as listed in `schema.json generatedSections` — e.g. `Part` → `⚙ Used in`, `Built with` →
578
+ `⚙ Used by`, `Affects` → `⚙ Decisions`, `Leads to` → `⚙ Reached from`, membership keys → the
579
+ feature lists (S-FEAT-3), `shell:` and `· shell:` → `⚙ Wraps` on the shell (S-SHELL-4), a
580
+ stepper's `flow:` → `⚙ Shown in` on the flow. A source inside a sub-document appears as its host card
581
+ with `· at: #<core>`; a component reached through another carries `· via: #CP…`; qualifier
582
+ cores use the hand form; lines are de-duplicated and sorted by target type (roster order),
583
+ core, then first qualifier. `Step`, `Edge`, `Branch`, `Entry`, `Outcome` and `Alternative`
584
+ have no reverse. A hand-grade KB MAY lack all of them (S-CONF-3).
585
+
586
+ ## 6 Flows, IA maps, components, variants and shells
587
+
588
+ ### 6.1 Flows
589
+
590
+ **S-FLOW-1 · Order lives in lists.** A flow is one file (S-CORE-1) whose steps are
591
+ sub-documents in `## Steps`. Its order lives only in step lists and its fork wiring only in
592
+ `Branch` lines; steps never store their position. A step MAY appear in any number of step
593
+ lists and is written once. Steps have no passport line, state, status or variants of their
594
+ own.
595
+
596
+ **S-FLOW-2 · Step shapes.** The glyph in a step heading is its type — required, and the only
597
+ source of truth; a glyph on a step-list line is ignored. Shapes and their lines:
598
+
599
+ - `○` **Start** — `Entry` 1, `Screen` 0–1, `Component` any; first in every step list;
600
+ - `□` **Action** — `Screen` exactly 1, `Component` any; the default user step;
601
+ - `◇` **Fork** — `Branch` 2 or more; `Screen`, `API`, `Backend` 0–1 each; `Component` any;
602
+ its name is the question;
603
+ - `◎` **Finish** — `Outcome` 1, `Hand-off` 0–1, `Screen` 0–1, `Component` any; an ending,
604
+ successful or not;
605
+ - `⧉` **Connected flow** — `Connected flow` exactly 1: runs another flow, then continues;
606
+ - `⚡` **System action** — `API` and/or `Backend`, never `Screen`: a product-side step.
607
+
608
+ Any step MAY add `Applies rule`, `Uses API`, `Connected flow` (an attached side journey that
609
+ returns), `Comment` and `Link` lines. A step MUST have its glyph and required lines [W025],
610
+ stay within these counts [W022], and carry no other relation [W017].
611
+
612
+ **S-FLOW-3 · Step body.** A step body SHOULD run: heading; anchor; where-lines (`Screen`,
613
+ `Component`, `API`, `Backend`; on ⧉ the `Connected flow` line); boundary lines (`Entry`;
614
+ `Outcome`, `Hand-off`); `Branch` lines; prose and requirement blocks; other relation lines;
615
+ optional `⚙ Prev` / `⚙ Next`. `Entry` (on Start: the trigger, origin screen or hand-off) and
616
+ `Outcome` (on Finish: what is true at the end) are free-text slots whose atoms are mentions.
617
+
618
+ ```markdown
619
+ ### ◇ Name valid? · #FS000003
620
+ <a id="fs000003"></a>
621
+
622
+ - Branch: Yes → [#FS000004 Save the item](#fs000004) · primary
623
+ - Branch: No → [#FS000002 Enter item details](#fs000002) · rule: #RL000001
624
+ ```
625
+
626
+ **S-FLOW-4 · Step lists.** `## Step list` holds the default list as ordered `Step` lines
627
+ (`1. [#FS000001 Start from the list](#fs000001)`). Every step list MUST start with the flow's
628
+ one ○ Start step, hold no other Start, and list only steps of this flow [W026]; it SHOULD end
629
+ on a ◎ Finish or ◇ Fork [I012]. Every step SHOULD be reachable from a step list or a `Branch`
630
+ line [I011].
631
+
632
+ **S-FLOW-5 · Branches.** A Fork wires each outcome to the step that follows:
633
+ `- Branch: <label> → <step>[ · primary][ · rule: #RL…][ — <note>]`. The label names the
634
+ outcome (quoted when it contains ` · `, `—` or `→`); the target MUST be a step of the same
635
+ flow [W018]. Exactly one branch per Fork SHOULD carry `· primary` [I010]; the primary branches
636
+ from Start to a successful Finish form the happy path. Policy is cited with `· rule:`, never
637
+ paraphrased.
638
+
639
+ **S-FLOW-6 · Flow variants.** A flow variant is an alternative step list: a `### <Name>`
640
+ subsection of `## Step list` (no glyph, no core) with an optional passport line
641
+ `platform: <list> · flag: <token>` and its own full list drawn from the flow's steps. The list
642
+ directly under `## Step list` is the default. Variant names MUST be unique in the flow [W026].
643
+ A flow variant is referenced only by name, `· variant: <Name>` on a line targeting the flow,
644
+ and the name MUST exist [W028].
645
+
646
+ **S-FLOW-7 · Subflows and size.** A ⧉ step runs another flow in sequence (a subflow); a
647
+ `Connected flow` line on any other step, or in `## Connected flows`, attaches a side journey
648
+ that returns; a `Hand-off` on a Finish continues the journey in another flow and is the only
649
+ bridge into a flow of another State. Journeys are reused this way, never copied. A step list
650
+ longer than 15 steps SHOULD be split into subflows [I004].
651
+
652
+ **S-FLOW-8 · Prev and Next.** Tools MAY end a step with machine-owned
653
+ `- ⚙ Prev: <step>[ · variant: <name>]` and `- ⚙ Next: …` lines, one per step list containing
654
+ it, with no `⚙ Next` on a Fork. A `Prev` or `Next` line without `⚙` MUST NOT be written
655
+ [W017].
656
+
657
+ ### 6.2 IA maps
658
+
659
+ **S-IA-1 · Tree.** An IA map's `## Parts` is an indentation tree of `Node` lines, each a screen
660
+ reference after `- `, indented exactly two spaces per level, no tabs. A node's parent is the
661
+ nearest line above with one level less; several roots are allowed; a screen MAY be placed more
662
+ than once. Indentation MUST follow these rules and never go more than one level deeper than
663
+ its parent [W027]. Node qualifiers: `· variant:` pins a screen variant (unpinned = the default
664
+ composition); `· opens-as:` sets this placement's presentation; `· shell:` binds a shell to this
665
+ placement and the subtree below it (S-SHELL-4); `· group:` labels a cluster — an annotation,
666
+ never nesting. The root of a map is a real place, such as Home — never a shell.
667
+
668
+ ```markdown
669
+ ## Parts
670
+ - [#SC000001 Home](../screens/sc000001-home.md)
671
+ - [#SC000002 Item list](../screens/sc000002-item-list.md) · group: Items
672
+ - [#SC000003 Item detail](../screens/sc000003-item-detail.md) · group: Items
673
+ - [#SC000005 Settings](../screens/sc000005-settings.md)
674
+
675
+ ### Lateral
676
+ - Edge: [#SC000005 Settings](../screens/sc000005-settings.md) → [#SC000002 Item list](../screens/sc000002-item-list.md) · label: Back to items
677
+ ```
678
+
679
+ **S-IA-2 · Lateral edges.** `### Lateral`, under `## Parts`, holds lines
680
+ `- Edge: <screen> → <screen>[ · label: <text>][ — <note>]`; both endpoints MUST be placed on
681
+ the same map [W027].
682
+
683
+ **S-IA-3 · Pure arrangement.** A map holds only references: no canvas positions, screen facts
684
+ or reverse facts. It belongs to at most one state (S-FM-7); `default: true` marks the default
685
+ map of its state, and two default maps of one state MUST NOT exist [W040]. A screen on no map
686
+ is simply unplaced, which is no finding.
687
+
688
+ ### 6.3 Components and variants
689
+
690
+ **S-COMP-1 · Components.** `## Components` (screens, components) is the default composition: ordered
691
+ `Part` lines, top to bottom, `1. <component>[ · variant: <name or #CV core>][ — <note>]`.
692
+ Deeper composition lives in the child component. Part nesting among components MUST be
693
+ acyclic, directly or through variants [W029].
694
+
695
+ **S-COMP-2 · Variants.** `## Variants` (optional) holds named alternatives of the same place or
696
+ part: sub-documents `### <Name> · #SV…` (screens) or `### <Name> · #CV…` (components), each
697
+ with its anchor, an optional passport line (S-SUB-2), an optional prose line and its own full
698
+ list of `Part` lines (or `none` / `—`), never inherited from `## Components`; explicit
699
+ `- Comment:` and `- Link: … · type: Design` lines may follow. There is no Default variant: the
700
+ default is `## Components`, and an unpinned reference resolves to it. Error, empty and loading
701
+ presentations are ordinary variants. A `· variant:` pin, by name or `#SV`/`#CV` core, MUST
702
+ name an existing variant of its target [W028].
703
+
704
+ ```markdown
705
+ ## Variants
706
+ ### Picker · #SV000001
707
+ <a id="sv000001"></a>
708
+ opens-as: Side panel
709
+
710
+ 1. [#CP000003 Item row](../components/cp000003-item-row.md) · variant: Compact
711
+ ```
712
+
713
+ **S-COMP-3 · Presentation and platform.** A placement's presentation resolves from the most
714
+ specific source: its own `· opens-as:` (IA node or step `Screen` line), else the variant's
715
+ passport, else the screen's `opens-as:`, else Page. A variant's `platform` limits it to those
716
+ platforms (omitted = all). Tools MAY show resolved values; they are never stored. A placement's
717
+ shell resolves the same way (S-SHELL-4).
718
+
719
+ ### 6.4 Shells
720
+
721
+ > **Added in fix pass 2 (2026-10-16 → 2026-10-18).** Shells replace the earlier advice to
722
+ > model persistent UI as an *App shell screen at the IA root*. The root of a map is a real
723
+ > place (Home); the frame around places is a card of type `shell`, described once and resolved
724
+ > per placement. `schema.json shells` holds the same rules for tools.
725
+
726
+ **S-SHELL-1 · A shell is the frame.** A **shell** (S-TYPE-14) is what surrounds places: what
727
+ is always there (`## Components`), where it leads (`## Navigation`), and the rules for
728
+ whatever it frames (`## Places inside`). It is never a screen and never a `Part` of one
729
+ [W046]: it frames nodes of a map, it is not one. `shell-type` names its kind: `app` (the
730
+ home frame of a platform and state), `section` (back, breadcrumbs, section tabs), `stepper`
731
+ (progress and Continue; `flow:` names the flow it shows), `overlay` (the frame of a modal,
732
+ sheet or drawer; `opens-as:` names the presentation it frames), `focus` (nothing but an
733
+ exit), `split` (a list that stays while the detail changes), `embedded` (a host provides the
734
+ frame). `opens-as:` belongs to overlays only and `flow:` to steppers only, and each of
735
+ those needs its key [W047].
736
+
737
+ **S-SHELL-2 · Three things, each written once.** `opens-as` on a placement says *how*
738
+ content is shown: over the current screen, which stays. The overlay shell whose `opens-as`
739
+ matches says *what* frames everything shown that way: title, close, Confirm or Cancel, and
740
+ the rules. The content is the screen card, or a part of a shell. None of the three repeats
741
+ the others: a screen card SHOULD NOT hold a frame's control (Continue, Close, Back, the
742
+ product's tabs) [I027]; it declares its outcome and its primary action by name, and the frame
743
+ renders it. Links that are the place's own content — a row opening its detail — are not frame
744
+ navigation; flows and lateral edges hold them.
745
+
746
+ **S-SHELL-3 · Places and parts.** Does the user go somewhere with content and purpose of its
747
+ own? Then it is a screen, with `opens-as` on its placement (a size guide as a modal, the
748
+ cart as a side drawer). Does the frame unfold — a navigation drawer, an account menu, a
749
+ search overlay? Then it is a part of the shell: a `Part` line in the shell's `## Components`
750
+ with `· opens-as:` saying how it unfolds. `· opens-as:` on a `Part` line is legal only in
751
+ shells [W047]. An overlay shell frames shell parts the same way it frames places.
752
+
753
+ **S-SHELL-4 · Binding and resolution.** A screen MAY name its usual shell with `shell:` (an SH
754
+ core, or `none`); a screen variant in its passport; an IA node or a step's `Screen` line with
755
+ `· shell:`. Every such target MUST be a shell [W044]. A placement's shell resolves from the
756
+ most specific source, like its presentation (S-COMP-3):
757
+
758
+ 1. the placement's own `· shell:` (IA node or step `Screen` line); `none` = no shell;
759
+ 2. the variant's passport `shell:`;
760
+ 3. for a step of a flow, the `stepper` shell whose `flow:` is that flow — a stepper frames its
761
+ own flow's steps without a qualifier on each;
762
+ 4. the screen's `shell:`, only when the resolved presentation is Page — an overlay never
763
+ inherits a page shell;
764
+ 5. on a map, the nearest ancestor node's `· shell:` — one qualifier on a section's node frames
765
+ the whole subtree;
766
+ 6. the default: for a Page, the `app` shell whose `platform` and `state` match the map's or
767
+ flow's (an omitted key matches any value; a stated match beats an omitted one); for any
768
+ other presentation, the `overlay` shell whose `opens-as` equals it;
769
+ 7. none.
770
+
771
+ On every rung, a shell whose `platform:` excludes the placement's platform is skipped and
772
+ resolution goes on down the list — a desktop-only section shell bound on a node leaves the
773
+ app's placements to the app shell. Two shells MUST NOT be the default for the same kind,
774
+ platform, state and presentation, nor two steppers show one flow [W045]. Then the shell's variant (S-SHELL-5) is chosen. Tools MAY show the resolved shell and
775
+ variant; they are never stored. The reverse, `⚙ Wraps` on the shell, lists explicit bindings
776
+ only (S-REL-4); default bindings are computed.
777
+
778
+ **S-SHELL-5 · Variants stack.** `## Variants` of a shell holds sub-documents `### <Name> · #HV…`
779
+ whose passport takes `platform`, `state` and `level` (`1` = the root of the map, `2` = one
780
+ level down, `2+` = that level and deeper; omitted = any). A shell variant lists the parts it
781
+ **adds** to the host's `## Components` — the one place where a variant does not repeat the
782
+ host's list, because shell part lists are long and mostly shared (the consent banner, the
783
+ toast). **Every** variant whose passport matches the placement's platform, the map's or flow's
784
+ state and the node's depth applies, in variant order; the same part added twice appears once;
785
+ none matching = the host alone. So `Mobile`, `Signed in` and `Level 2+` are written once each
786
+ and a signed-in phone page deep in the map gets all three — a variant for a combination is
787
+ never needed. Variants carry parts only; navigation stays in the host's list (S-SHELL-6). A
788
+ part that some placements lack belongs in a variant, not in the host.
789
+
790
+ **S-SHELL-6 · Navigation.** `## Navigation` holds ordered `Leads to` lines,
791
+ `1. <screen>[ · kind: tab|menu|link][ · label: <text>][ · in: <parts>][ · platform: <list>][ · state: <State>][ — <note>]`
792
+ (kind omitted = link): the places the frame leads to, in display order. It is **one list** for
793
+ the host and all its variants: `· platform:` and `· state:` limit a line to some placements,
794
+ and a variant never carries navigation lines [W017]. `· in:` names the part of this shell that
795
+ holds the entry — the header, the footer, the tab bar, the account menu — by component name or
796
+ `#CP` core; with several, comma-separated, the resolved frame shows the one it has, and a
797
+ line none of whose `in:` parts is in the resolved frame is not shown there. Every
798
+ `in:` value MUST be a part of this shell, host or variant [W048]. A line shown in a State
799
+ where its screen does not exist is a finding [I028]. Written on the shell, never on the
800
+ screens reached; their reverse is `⚙ Reached from`. Breadcrumbs and back are parts; what they show is the map path,
801
+ computed. A stepper's order comes from its `flow:`, whose reverse is `⚙ Shown in`. A tool
802
+ reading a map treats a shell's navigation as reachable from every node the shell frames, so
803
+ lateral edges are for the rest.
804
+
805
+ **S-SHELL-7 · Places inside.** `## Places inside` is the contract for whatever the shell
806
+ frames, as ✅ / 🚫 lines and requirement blocks: what the frame provides, what it expects of a
807
+ place (a primary action by name, valid or not, done), what a place MUST NOT do (own
808
+ navigation, own close, own back), and what happens on complete, cancel, leave and error. An
809
+ agent, a designer or a developer reads the resolved shells' contracts before writing a place
810
+ (`intent-format frame <root> <screen>` prints them per placement); a place that lists a frame's control
811
+ is a review finding (Appendix B).
812
+
813
+ **S-SHELL-8 · New shell or variant.** A new shell when the frame does another job (another
814
+ `shell-type`) or follows another navigation model: mostly different destinations or parts, or
815
+ different rules in `## Places inside`, which a variant cannot change. A variant when the same
816
+ frame adds or swaps a part or two for a platform, a state or a level. The usual set: one app
817
+ shell per platform family whose frame is built differently (a desktop header against a native
818
+ tab bar), a section shell per area with its own wayfinding, a stepper per task flow, one
819
+ overlay shell per presentation — typically three to eight. Ask: is the user still in the same
820
+ place, only deeper or signed in (a variant), or in another mode — doing a task, inside an
821
+ area, looking at an overlay (another shell)?
822
+
823
+ ```markdown
824
+ ---
825
+ type: shell
826
+ id: SH000001
827
+ name: App shell
828
+ shell-type: app
829
+ ---
830
+ ## Components # common to every variant
831
+ 1. [#CP000003 Consent banner](../components/cp000003-consent-banner.md)
832
+
833
+ ## Navigation # one list, in display order
834
+ 1. [#SC000002 Home](../screens/sc000002-home.md) · kind: tab · in: Top bar, Navigation drawer
835
+ 2. [#SC000003 Shop](../screens/sc000003-shop.md) · kind: tab · in: Top bar, Navigation drawer
836
+ 3. [#SC000016 Sign in](../screens/sc000016-sign-in.md) · in: Top bar · state: Guest
837
+ 4. [#SC000018 My account](../screens/sc000018-my-account.md) · kind: menu · in: Account menu · state: Signed in
838
+ 5. [#SC000015 Contact](../screens/sc000015-contact.md) · in: Footer
839
+
840
+ ## Places inside
841
+ ✅ Declare one primary action by name; the frame renders it.
842
+ 🚫 Never show navigation of your own.
843
+
844
+ ## Variants
845
+ ### Desktop web · #HV000001
846
+ <a id="hv000001"></a>
847
+ platform: Desktop web
848
+
849
+ 1. [#CP000001 Top bar](../components/cp000001-top-bar.md)
850
+ 2. [#CP000002 Footer](../components/cp000002-footer.md)
851
+
852
+ ### Mobile web · #HV000002
853
+ <a id="hv000002"></a>
854
+ platform: Mobile web
855
+
856
+ 1. [#CP000011 Burger](../components/cp000011-burger.md)
857
+ 2. [#CP000012 Navigation drawer](../components/cp000012-navigation-drawer.md) · opens-as: Side drawer — opened by the burger
858
+
859
+ ### Signed in · #HV000003
860
+ <a id="hv000003"></a>
861
+ state: Signed in
862
+
863
+ 1. [#CP000013 Account menu](../components/cp000013-account-menu.md) · opens-as: Dropdown
864
+ ```
865
+
866
+ A signed-in desktop page gets the consent banner, the top bar, the footer and the account
867
+ menu: Desktop web and Signed in both match, and both apply.
868
+
869
+ The Payment screen is a page under Checkout, framed by the Checkout stepper through
870
+ `· shell:` on the checkout flow's step; in the edit-order flow its step says
871
+ `· opens-as: Modal`, so rule 3 skips the page shell and rule 5 gives it the Modal shell.
872
+ The Payment card has no Continue and no Save: the stepper renders its action as Continue, the
873
+ modal as Save. Nothing on the card changes between the two.
874
+
875
+ ## 7 Identifiers
876
+
877
+ **S-ID-1 · Core.** A **core** is a two-letter prefix plus six digits (`SC000006`), the only
878
+ load-bearing token of a reference. `id:` holds the core only — no `#`, state code or version.
879
+ A card without `id:`, with a malformed core, an unknown or reserved prefix, or another type's
880
+ prefix MUST NOT exist [E003]. `regen` never mints; `intent-format new` or `intent-format mint` fixes a missing id.
881
+
882
+ **S-ID-2 · Prefixes.** Card prefixes are in S-TYPE-1; sub-documents use `SV` (screen variant),
883
+ `CV` (component variant), `HV` (shell variant) and `FS` (flow step). `X?` and `Z?` are reserved for extensions,
884
+ which a KB MAY use without registration (S-EXT-1); `SS` for tool snapshots, which never appear
885
+ in a KB.
886
+
887
+ **S-ID-3 · Project-wide identity.** A core is unique across the project, all workspaces
888
+ included: the same core in two workspaces is the same card in two versions, and references
889
+ resolve within their own workspace. Two files or sub-documents with one core in a workspace
890
+ [E004], or one core with two types anywhere in the project [E005], MUST NOT exist.
891
+
892
+ **S-ID-4 · Minting.** The next core for a prefix is one above the highest number ever used for
893
+ it — in any file of any workspace, in the Retired table, or as its High-water mark —
894
+ zero-padded. Tools mint (`intent-format new`, `intent-format mint`) and every mint raises the High-water mark, so
895
+ a minted but unused core is never handed out again. Hand minting MAY follow the same rule. A
896
+ core is minted when its file or sub-document is created; until then a placeholder points at
897
+ the thing.
898
+
899
+ **S-ID-5 · Never reused.** A core is never edited or reused, even after deletion or merge: a
900
+ retired core MUST NOT appear in a file [W041].
901
+
902
+ **S-ID-6 · Register.** The project root's `_ids.md` (`schema.json projectRoot.idRegister`) has
903
+ three generated tables: `⚙ Resolved` (Core · Type · Name · Versions · Path in the newest
904
+ version; sub-documents included), `⚙ Retired` (Core · Type · Name · Last version · Merged
905
+ into; append-only) and `⚙ High-water marks` (Prefix · Highest; never lowered). Retired rows and
906
+ marks are memory, not derivable: `regen` keeps them, and deleting `_ids.md` can lose them. The
907
+ register SHOULD be current [I020]; it is a cache, since a core resolves by its file.
908
+
909
+ **S-ID-7 · Rendered ID.** A card's **rendered ID** is `#` + core + state code (only when the
910
+ project declares States) + `V` + workspace version: `#SC000006V1.1`, or `#SC000006SLV1.1`
911
+ with States. A card whose state is omitted, `Shared` or several States renders `SG`; one with
912
+ `state: —` renders no code. Rendered IDs appear only in status lines and tool UIs and MUST NOT be used in
913
+ references or front matter [W020].
914
+
915
+ **S-ID-8 · Filenames.** A card file is named `<core-lowercase>-<slug>.md`
916
+ (`sc000006-item-list.md`), the project card `project.md`; the core part MUST equal `id:`
917
+ [W031]. The slug is the name folded to lowercase ASCII with hyphens, at most 60 characters
918
+ (`schema.json ids.slug`); it SHOULD match the name [I016], and tools MAY rename files as a
919
+ courtesy, since references resolve by core.
920
+
921
+ ## 8 Versions
922
+
923
+ **S-VER-1 · Workspaces.** A version of the KB is a workspace folder `V<major>.<minor>/` holding a
924
+ full KB; an exploration — an alternative direction — is `V<major>.<minor>-<label>/`. The
925
+ workspace owns the version: cards carry no `version:` key (S-FM-3), and the manifest's
926
+ `version` MUST equal the folder name without `V` [W033].
927
+
928
+ **S-VER-2 · Lifecycle.** The manifest's `lifecycle` MUST be one of [W033]: `planned` (created
929
+ for a future version; work not started), `in-progress` (being changed now; several may be in
930
+ progress at once), `released` (matches what shipped; editable for corrections), `archived`
931
+ (read-only history, S-VER-6) or `exploration` (an alternative direction).
932
+
933
+ **S-VER-3 · Based on.** Versions form a tree: `based-on` names the version a workspace was
934
+ branched from, is omitted for a root version, and MUST name another existing workspace
935
+ [W033]. `intent-format branch <root> <from> <to>` copies a workspace and sets `version`,
936
+ `lifecycle: in-progress` and `based-on`.
937
+
938
+ **S-VER-4 · Change status.** In a workspace with `based-on`, each card is compared by core with
939
+ the base workspace's **current** content, part by part: **Passport** (front matter except
940
+ `standard`, plus the title name) and each authored section by heading, sub-documents counting
941
+ in their host section; references, anchors, status lines and `⚙` lines are normalised away
942
+ first (`schema.json versions.fingerprint`). The result is `new` (core absent from the base),
943
+ `unchanged`, or `changed: <Part>, <Part>` (Passport first, then sections in card order).
944
+ `regen` writes it into the status line; tools MAY show it anywhere.
945
+
946
+ **S-VER-5 · CHANGES.md.** A workspace with `based-on` has a generated `CHANGES.md`
947
+ (`type: index`, `name: Changes`; title `# Changes · V<version> · based on V<base>`) with
948
+ `⚙ New`, `⚙ Changed` (`· changed: <Part>, …`) and `⚙ Removed` (base cores missing here, as
949
+ `- #<CORE> — <name in the base>`): cards only, sorted by type, then core. It SHOULD be current,
950
+ and a workspace without `based-on` SHOULD have none [I020]. There is no other change log.
951
+
952
+ **S-VER-6 · Archived is read-only.** `regen` skips archived workspaces and `check` still reads
953
+ them; authors SHOULD NOT edit them. Released workspaces stay editable.
954
+
955
+ **S-VER-7 · Moving changes between versions.** A card MAY be carried to another version of the
956
+ same project by copying its file — same core — into that workspace and running `regen`.
957
+ Import and re-minting (S-OPS-4) are only for material from another project.
958
+
959
+ **S-VER-8 · Naming the version.** An agent changing a KB SHOULD name the version in every
960
+ change it reports — "In V1.1 (in-progress): …" — and SHOULD ask when the target version is
961
+ unclear.
962
+
963
+ ## 9 Conformance
964
+
965
+ **S-CONF-1 · Severities.** A checker MUST report every finding with the code and severity
966
+ listed in `schema.json diagnostics` [E001] … [I025]. The severities:
967
+
968
+ - **error** (`E`) — the KB cannot be trusted (unparsable front matter, unknown type,
969
+ malformed id, ID collisions) and `regen` stops (S-CORE-5);
970
+ - **warning** (`W`) — a MUST is broken; it never blocks authors;
971
+ - **info** (`I`) — a SHOULD is broken, or something `regen` will tidy.
972
+
973
+ `intent-format check` prints `severity · code · file:line · message` and health, and exits 1 when an
974
+ error exists.
975
+
976
+ **S-CONF-2 · Health.** Health is three numbers, reported side by side per card, module and
977
+ workspace, never combined into one score:
978
+
979
+ - **blind spots** — every authored `—`: the whole body of a required section or of a
980
+ sub-document component list or step, a front-matter or passport value, a requirement slot, a relation
981
+ target, the final `—` of an incomplete list; not counted: optional sections, `none`, generated content, table cells, and a
982
+ decision's `Outcome` while Open or Proposed;
983
+ - **unresolved placeholders** — distinct placeholder groups (S-LINK-5);
984
+ - **open decisions** — decisions with status Open or Proposed.
985
+
986
+ Beside them a checker reports **why** — filled · inherited · none · missing (the missing count is
987
+ the KB's *why debt*; it is also a blind-spot kind) — **confidence**: the number of `[assumed]`
988
+ and `[likely]` marks (S-BODY-7) — and **asks**: open, later and due `[ask: …]` markers (S-BODY-8).
989
+ `intent-format open` prints the one list behind these numbers: questions to the owner, open decisions,
990
+ marks to confirm, whys missing, other blind spots per card.
991
+
992
+ Tools SHOULD report diagnostic counts per severity beside them, and SHOULD break blind spots down
993
+ by kind (status, other keys, required sections, list items, requirement slots, relation targets, why).
994
+
995
+ **S-CONF-3 · Hand-grade and tool-grade.** A **hand-grade** KB — no generated sections, status
996
+ lines or generated files — is valid; a **tool-grade** KB adds them over the same authored
997
+ bytes. Generated content MAY be removed at any time without losing authored knowledge,
998
+ except the Retired rows and High-water marks of `_ids.md` (S-ID-6).
999
+
1000
+ **S-CONF-4 · Regenerate.** `regen <root>` writes, for every workspace not archived: the project
1001
+ `_index.md` and `_ids.md`, folder rosters, generated sections, status lines and `CHANGES.md`.
1002
+ In authored zones it changes only machine-owned tokens: title lines; status lines; names and
1003
+ paths in bound references, and hand references in relation lines (made bound); anchor lines;
1004
+ the numbering of ordered lines; forgiveness values; optional `⚙ Prev` / `⚙ Next` lines. It MAY
1005
+ rename files to their slug (S-ID-8). It never edits prose, front-matter values or relation
1006
+ targets, mints cores (S-ID-1) or promotes placeholders (S-LINK-5). A conforming `regen`
1007
+ MUST leave none of these findings in what it writes [I001] [I002] [I005] [I006] [I007] [I009]
1008
+ [I015] [I020]. `fixtures/` gives expected diagnostics for testing tools.
1009
+
1010
+ **S-CONF-5 · Review checks.** Judgment checks (Appendix B) are not validator rules. A reviewer
1011
+ — a person or a QA agent — SHOULD run them; they never change a diagnostic's severity.
1012
+
1013
+ ## 10 Operations
1014
+
1015
+ **S-OPS-1 · Merge.** Two cards that are one thing MAY be merged by hand: pick the survivor;
1016
+ rebind every reference to the other card, `feature:` and `parent:` included, to the survivor;
1017
+ delete the other file; add its core to `⚙ Retired` with `Merged into` = the survivor. The
1018
+ survivor keeps its own core and `origin`. Every reference to the retired core MUST be rebound
1019
+ [W041].
1020
+
1021
+ **S-OPS-7 · Renamed in 1.1.** Headings, one key, one vocabulary and one qualifier were renamed so
1022
+ files read as plain language (the full list: `renames` in `schema.json`; the changelog). A 1.0
1023
+ spelling MUST still be read as its 1.2 name; `intent-format migrate` and `regen` write the 1.2 names.
1024
+
1025
+ **S-OPS-2 · Duplicate.** A card MAY be started from a copy of another: take a new core from
1026
+ `intent-format mint`, set `id:` and rename the file; no provenance is stamped. A copy that keeps the
1027
+ original's core MUST NOT stay in the workspace [E004].
1028
+
1029
+ **S-OPS-3 · Export.** Export units are a workspace, a module folder and a single card. Export
1030
+ copies files without transforming them; a module or card export carries a manifest stub whose
1031
+ `modules` lists only what ships. Comments are excluded unless requested; decisions are
1032
+ included. Generated content MAY ship, but receivers never trust it. A unit MUST NOT be
1033
+ exported while an ID collision stands in it [E004] [E005].
1034
+
1035
+ **S-OPS-4 · Import.** Importing material from another project:
1036
+
1037
+ 1. re-mint every core, cards and sub-documents, into this project's counters, even without a
1038
+ collision;
1039
+ 2. rewrite references inside the imported set to the new cores;
1040
+ 3. turn references to targets outside the set into placeholders with a note,
1041
+ `[~ <Name>] — was #<core> in <kb>`;
1042
+ 4. rewrite `feature:` and `parent:` when the target is in the set; otherwise drop the key and
1043
+ report it [I022];
1044
+ 5. record `origin: <kb>/<core>` after the extras;
1045
+ 6. drop shipped `⚙` content and regenerate.
1046
+
1047
+ Files are placed by their front matter; missing module folders are created and enabled. A
1048
+ foreign vocabulary value is mapped, added to `project.md`, or kept and reported [W006] — never
1049
+ silently changed. A card whose `origin` already exists in the project is skipped with a
1050
+ warning; two cards with one `origin` in a workspace MUST NOT exist [W043]. Import is authoring:
1051
+ it never fails as a whole, and SHOULD be followed by `check`.
1052
+
1053
+ **S-OPS-5 · Migrate.** `intent-format migrate <root>` brings a KB written against an earlier reading of
1054
+ the current version up to date, idempotently: each `### Roles` row becomes a role card (Description →
1055
+ the card's description, States → `state:`), one core per role name across all workspaces so
1056
+ the same role is the same card in every version; read-only workspaces are skipped; the table
1057
+ is removed and the `roles` module enabled. Stories need no change.
1058
+
1059
+ ## 11 Extensions
1060
+
1061
+ **S-EXT-1 · No registration.** A KB MAY extend the standard without registering anything:
1062
+ extension types `x-<slug>` with `X?` or `Z?` prefixes; `x-*` front-matter keys, last and never
1063
+ validated; authored `## x-<name>` sections, kept where they stand; `## ⚙ x-<name>` sections
1064
+ generated by extension tools; and extension relations, always prefixed: `- x-<slug>: <atom>…`.
1065
+ Tools accept all of them and preserve them byte for byte.
1066
+
1067
+ **S-EXT-2 · Evolution.** A minor version of the standard only adds; a major version ships a
1068
+ migration map, which MAY promote widely used extensions into the core.
1069
+
1070
+ ## Appendix A · Grammar
1071
+
1072
+ A readable form of `schema.json grammar`: JavaScript regular expressions with the `u` flag,
1073
+ whose named groups are the parse result. Files are UTF-8 with LF line endings and a final
1074
+ newline; a U+FE0F variation selector after `⚙` or a step glyph is tolerated.
1075
+
1076
+ **A.1 Shapes**
1077
+
1078
+ ```
1079
+ relation line - <Relation>: <atom>[ · <key>: <value>]…[ — <note>]
1080
+ prefix-less line - <atom>[ · <key>: <value>]…[ — <note>]
1081
+ ordered line <n>. <atom>[ · <key>: <value>]…[ — <note>]
1082
+ edge line - Edge: <atom> → <atom>[ · label: <text>][ — <note>]
1083
+ branch line - Branch: <label> → <atom>[ · primary][ · rule: #RL…][ — <note>]
1084
+ text slot - Entry: <text> | - Outcome: <text>
1085
+ generated line - ⚙ Prev: <atom>[ · variant: <name>] | - ⚙ Next: …
1086
+ title line # <name> · #<CORE>
1087
+ status line > ⚙ <rendered-id> · V<version> <lifecycle>[ · based on V<base>][ · <change>]
1088
+ section heading ## [⚙ ]<Heading>
1089
+ sub-document ### [<glyph> ]<Name> · #<CORE>
1090
+ anchor line <a id="<core-lowercase>"></a>
1091
+ passport line <key>: <value>[ · <key>: <value>]…
1092
+ requirement **R<n> · <Preset>**[ <text>]
1093
+ IA node line <two spaces per level>- <atom>[ · <key>: <value>]…
1094
+ ```
1095
+
1096
+ Atoms: bound `[#<CORE> <Name>](<relative-path>[#<anchor>])` · hand `#<CORE>` · placeholder
1097
+ `[~ <Name>]` · unknown `—`. Bodies: `—` alone = blind spot · `none` alone = verified none ·
1098
+ `-`, `–`, `TBD`, `?` alone = forgiveness for `—`. In `## Why` also: `none — <note>` · `same as #<CORE>`
1099
+ (`sameAs`) · text ending ` [likely]` / ` [assumed]` (`confidenceMark`). In any authored body line:
1100
+ `[ask: <question>[ · later <date>]]` (`askMarker`).
1101
+
1102
+ **A.2 Parsing a relation line**
1103
+
1104
+ 1. Match the marker `- ` or `<n>. `; leading spaces are indentation.
1105
+ 2. A `⚙` directly before a relation word marks a machine-owned line (`⚙ Prev`, `⚙ Next`).
1106
+ 3. A vocabulary word or `x-<slug>` followed by `: ` makes an explicit relation; otherwise, in
1107
+ a section with a default relation, a body starting with an atom (in step lists, optionally
1108
+ after a glyph) is a prefix-less line; otherwise the line is prose.
1109
+ 4. `Entry` / `Outcome`: the rest is one text value whose atoms are mentions. Stop.
1110
+ 5. Split off the note at the first ` — ` outside `[]`, `()` and quotes.
1111
+ 6. `Edge` and `Branch`: split at the first ` → ` outside `[]`, `()` and quotes; the left side
1112
+ is an atom or the Branch label.
1113
+ 7. Split the rest at ` · ` outside `[]`, `()` and quotes: the first part is the atom, the
1114
+ others are qualifiers `<key>[: <value>]`.
1115
+ 8. Parse the atom — bound, hand, placeholder or `—`; anything else is a bad line shape.
1116
+
1117
+ **A.3 Tokens.** Core: two capitals and six digits. Slugs, `kb` values and labels: runs of
1118
+ lowercase letters and digits joined by single hyphens. Version `<major>.<minor>[-<label>]`;
1119
+ `origin` `<kb>/<CORE>`; state code `S` plus 1–4 capitals; `date` `YYYY-MM-DD`; front-matter
1120
+ keys of lowercase letters, digits and hyphens.
1121
+
1122
+ ## Appendix B · Review checks
1123
+
1124
+ Judgment checks for a reviewer (`schema.json reviewChecks`; S-CONF-5):
1125
+
1126
+ 1. **Paraphrased rule** — a card restates a rule's policy instead of citing `#RL`.
1127
+ 2. **Cross-card contradiction** — two cards state incompatible facts.
1128
+ 3. **Unobservable outcome** — a Then or shall-response that cannot be observed ("works
1129
+ correctly").
1130
+ 4. **Overlong or restating note** — a note longer than about half a line, or repeating the
1131
+ target card.
1132
+ 5. **Altitude** — a Feature's scope against its Sub-features' one-liners; a parent summarising
1133
+ its children.
1134
+ 6. **Wrong type** — an edge case describing the normal path; a screen without components of its
1135
+ own (a component); a requirement that is a policy (rule) or an exception (edge case); a
1136
+ place that lists a frame's control — Continue in a stepper, Close in a modal, the product's
1137
+ tabs on a page (S-SHELL-2).
1138
+ 7. **Duplicates** — two cards that are one thing (merge candidates, S-OPS-1).
1139
+ 8. **Evidence** — a status or fact without a source, owner answer or decision.
1140
+
1141
+ ## Appendix C · Glossary
1142
+
1143
+ - **Altitude rule** — each card level answers only its own question (S-FEAT-5).
1144
+ - **Blind spot** — `—`: a known question without an answer; counted in health.
1145
+ - **Card** — one file documenting one thing of the product.
1146
+ - **Confidence** — how sure a why or outcome is: unmarked (confirmed), `[likely]`, `[assumed]` (S-BODY-7).
1147
+ - **Core** — prefix plus six digits; a card's permanent, project-wide identity.
1148
+ - **Default relation** — the relation a section's prefix-less lines express.
1149
+ - **Feature / Sub-feature** — a product domain / a capability inside one.
1150
+ - **Hand-grade / tool-grade** — a KB without / with generated content.
1151
+ - **Health** — blind spots, unresolved placeholders and open decisions.
1152
+ - **Home** — the one feature a screen, flow or component belongs to.
1153
+ - **Membership key** — `feature:` or `parent:`, the only front-matter keys holding a core.
1154
+ - **Navigation** — a shell's ordered `Leads to` lines: the places it leads to (S-SHELL-6).
1155
+ - **One-liner** — the first sentence of `Description`.
1156
+ - **Ownership Law** — the one who knows writes; the referenced side is computed.
1157
+ - **Placeholder** — `[~ Name]`: something that should exist but is not a card yet.
1158
+ - **Rendered ID** — `#<CORE>[<state code>]V<version>`; for display only.
1159
+ - **Role / State** — who uses the product (a card) / a mode with its own set of screens (a vocabulary).
1160
+ - **Components / Variant** — a screen's or component's default composition / a named alternative with its own component list.
1161
+ - **Shell** — a card of type `shell`: the frame around places — its parts, where it leads,
1162
+ and the contract for what it frames; resolved per placement, variants by platform, state
1163
+ and level (section 6.4).
1164
+ - **Places inside** — a shell's contract for whatever it frames (S-SHELL-7).
1165
+ - **Status line** — `> ⚙ …` under the title: version, lifecycle, change status.
1166
+ - **Sub-document** — a variant or step with its own core inside its card.
1167
+ - **Truth Law** — the files are the database.
1168
+ - **Verified none** — `none`: known to be empty; not counted.
1169
+ - **Ask marker** — `[ask: …]` inside a sentence: a question for the owner; counted as *asks* (S-BODY-8).
1170
+ - **Why / why debt** — the `## Why` section of a card, answering the type's why question (purpose · choice · constraint) / the number of cards whose why is `—` (S-BODY-7, S-CONF-2).
1171
+ - **Why question** — the question a type's `## Why` answers (schema `why.questions`); `same as #<id>` borrows another card's answer (S-BODY-7).
1172
+ - **Workspace** — `V<major>.<minor>/`, holding one version of the KB.
1173
+ - **Zone** — authored (people write it) or generated (`⚙`, `regen` writes it).