@pantion/dialogs 0.2.1

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 (260) hide show
  1. package/dialogs/dialog-builder/convergence-rules.md +64 -0
  2. package/dialogs/dialog-builder/dialog.json +10 -0
  3. package/dialogs/dialog-builder/prompts/convergence-intro.md +21 -0
  4. package/dialogs/dialog-builder/prompts/translate-intro.md +17 -0
  5. package/dialogs/dialog-builder/translate.md +46 -0
  6. package/dialogs/image/convergence-rules.md +55 -0
  7. package/dialogs/image/dialog.json +12 -0
  8. package/dialogs/image/prompts/convergence-intro.md +25 -0
  9. package/dialogs/image/prompts/translate-intro.md +37 -0
  10. package/dialogs/image/translate.md +67 -0
  11. package/dialogs/software/convergence-rules.md +29 -0
  12. package/dialogs/software/dialog.json +12 -0
  13. package/dialogs/software/prompts/convergence-intro.md +22 -0
  14. package/dialogs/software/prompts/translate-intro.md +19 -0
  15. package/dialogs/software/translate.md +74 -0
  16. package/dialogs/software-brownfield/convergence-rules.md +109 -0
  17. package/dialogs/software-brownfield/dialog.json +12 -0
  18. package/dialogs/software-brownfield/prompts/convergence-intro.md +26 -0
  19. package/dialogs/software-brownfield/prompts/translate-intro.md +13 -0
  20. package/dialogs/software-brownfield/translate.md +56 -0
  21. package/dialogs/video/convergence-rules.md +96 -0
  22. package/dialogs/video/dialog.json +12 -0
  23. package/dialogs/video/prompts/convergence-intro.md +28 -0
  24. package/dialogs/video/prompts/translate-intro.md +41 -0
  25. package/dialogs/video/translate.md +81 -0
  26. package/dist/core/canon/index-manager.d.ts +27 -0
  27. package/dist/core/canon/index-manager.d.ts.map +1 -0
  28. package/dist/core/canon/index-manager.js +127 -0
  29. package/dist/core/canon/index-manager.js.map +1 -0
  30. package/dist/core/canon/manifest.d.ts +21 -0
  31. package/dist/core/canon/manifest.d.ts.map +1 -0
  32. package/dist/core/canon/manifest.js +56 -0
  33. package/dist/core/canon/manifest.js.map +1 -0
  34. package/dist/core/canon/validator.d.ts +12 -0
  35. package/dist/core/canon/validator.d.ts.map +1 -0
  36. package/dist/core/canon/validator.js +320 -0
  37. package/dist/core/canon/validator.js.map +1 -0
  38. package/dist/core/dialog/canon-writer.d.ts +22 -0
  39. package/dist/core/dialog/canon-writer.d.ts.map +1 -0
  40. package/dist/core/dialog/canon-writer.js +96 -0
  41. package/dist/core/dialog/canon-writer.js.map +1 -0
  42. package/dist/core/dialog/registry.d.ts +10 -0
  43. package/dist/core/dialog/registry.d.ts.map +1 -0
  44. package/dist/core/dialog/registry.js +102 -0
  45. package/dist/core/dialog/registry.js.map +1 -0
  46. package/dist/core/dialog/selector.d.ts +11 -0
  47. package/dist/core/dialog/selector.d.ts.map +1 -0
  48. package/dist/core/dialog/selector.js +32 -0
  49. package/dist/core/dialog/selector.js.map +1 -0
  50. package/dist/core/index.d.ts +20 -0
  51. package/dist/core/index.d.ts.map +1 -0
  52. package/dist/core/index.js +30 -0
  53. package/dist/core/index.js.map +1 -0
  54. package/dist/core/protocol/convergence.d.ts +11 -0
  55. package/dist/core/protocol/convergence.d.ts.map +1 -0
  56. package/dist/core/protocol/convergence.js +30 -0
  57. package/dist/core/protocol/convergence.js.map +1 -0
  58. package/dist/core/protocol/loader.d.ts +6 -0
  59. package/dist/core/protocol/loader.d.ts.map +1 -0
  60. package/dist/core/protocol/loader.js +31 -0
  61. package/dist/core/protocol/loader.js.map +1 -0
  62. package/dist/core/protocol/stamp-parser.d.ts +46 -0
  63. package/dist/core/protocol/stamp-parser.d.ts.map +1 -0
  64. package/dist/core/protocol/stamp-parser.js +333 -0
  65. package/dist/core/protocol/stamp-parser.js.map +1 -0
  66. package/dist/core/protocol/system-prompt.d.ts +16 -0
  67. package/dist/core/protocol/system-prompt.d.ts.map +1 -0
  68. package/dist/core/protocol/system-prompt.js +68 -0
  69. package/dist/core/protocol/system-prompt.js.map +1 -0
  70. package/dist/core/session/canon-writer.d.ts +33 -0
  71. package/dist/core/session/canon-writer.d.ts.map +1 -0
  72. package/dist/core/session/canon-writer.js +152 -0
  73. package/dist/core/session/canon-writer.js.map +1 -0
  74. package/dist/core/session/manager.d.ts +10 -0
  75. package/dist/core/session/manager.d.ts.map +1 -0
  76. package/dist/core/session/manager.js +105 -0
  77. package/dist/core/session/manager.js.map +1 -0
  78. package/dist/core/skill/canon-writer.d.ts +22 -0
  79. package/dist/core/skill/canon-writer.d.ts.map +1 -0
  80. package/dist/core/skill/canon-writer.js +96 -0
  81. package/dist/core/skill/canon-writer.js.map +1 -0
  82. package/dist/core/skill/registry.d.ts +10 -0
  83. package/dist/core/skill/registry.d.ts.map +1 -0
  84. package/dist/core/skill/registry.js +102 -0
  85. package/dist/core/skill/registry.js.map +1 -0
  86. package/dist/core/skill/selector.d.ts +11 -0
  87. package/dist/core/skill/selector.d.ts.map +1 -0
  88. package/dist/core/skill/selector.js +32 -0
  89. package/dist/core/skill/selector.js.map +1 -0
  90. package/dist/core/soul/registry.d.ts +10 -0
  91. package/dist/core/soul/registry.d.ts.map +1 -0
  92. package/dist/core/soul/registry.js +73 -0
  93. package/dist/core/soul/registry.js.map +1 -0
  94. package/dist/core/types.d.ts +154 -0
  95. package/dist/core/types.d.ts.map +1 -0
  96. package/dist/core/types.js +6 -0
  97. package/dist/core/types.js.map +1 -0
  98. package/dist/core/utils/fs.d.ts +14 -0
  99. package/dist/core/utils/fs.d.ts.map +1 -0
  100. package/dist/core/utils/fs.js +44 -0
  101. package/dist/core/utils/fs.js.map +1 -0
  102. package/dist/core/utils/project-detect.d.ts +3 -0
  103. package/dist/core/utils/project-detect.d.ts.map +1 -0
  104. package/dist/core/utils/project-detect.js +38 -0
  105. package/dist/core/utils/project-detect.js.map +1 -0
  106. package/dist/feature-set.d.ts +14 -0
  107. package/dist/feature-set.d.ts.map +1 -0
  108. package/dist/feature-set.js +38 -0
  109. package/dist/feature-set.js.map +1 -0
  110. package/dist/index.d.ts +3 -0
  111. package/dist/index.d.ts.map +1 -0
  112. package/dist/index.js +56 -0
  113. package/dist/index.js.map +1 -0
  114. package/dist/prompts/convergence-prompts.d.ts +4 -0
  115. package/dist/prompts/convergence-prompts.d.ts.map +1 -0
  116. package/dist/prompts/convergence-prompts.js +76 -0
  117. package/dist/prompts/convergence-prompts.js.map +1 -0
  118. package/dist/prompts/index.d.ts +4 -0
  119. package/dist/prompts/index.d.ts.map +1 -0
  120. package/dist/prompts/index.js +7 -0
  121. package/dist/prompts/index.js.map +1 -0
  122. package/dist/prompts/workflow-prompts.d.ts +9 -0
  123. package/dist/prompts/workflow-prompts.d.ts.map +1 -0
  124. package/dist/prompts/workflow-prompts.js +265 -0
  125. package/dist/prompts/workflow-prompts.js.map +1 -0
  126. package/dist/resources/canon-resources.d.ts +4 -0
  127. package/dist/resources/canon-resources.d.ts.map +1 -0
  128. package/dist/resources/canon-resources.js +164 -0
  129. package/dist/resources/canon-resources.js.map +1 -0
  130. package/dist/server.d.ts +9 -0
  131. package/dist/server.d.ts.map +1 -0
  132. package/dist/server.js +47 -0
  133. package/dist/server.js.map +1 -0
  134. package/dist/tools/amend.d.ts +4 -0
  135. package/dist/tools/amend.d.ts.map +1 -0
  136. package/dist/tools/amend.js +106 -0
  137. package/dist/tools/amend.js.map +1 -0
  138. package/dist/tools/approve.d.ts +4 -0
  139. package/dist/tools/approve.d.ts.map +1 -0
  140. package/dist/tools/approve.js +60 -0
  141. package/dist/tools/approve.js.map +1 -0
  142. package/dist/tools/check-convergence.d.ts +4 -0
  143. package/dist/tools/check-convergence.d.ts.map +1 -0
  144. package/dist/tools/check-convergence.js +50 -0
  145. package/dist/tools/check-convergence.js.map +1 -0
  146. package/dist/tools/check.d.ts +4 -0
  147. package/dist/tools/check.d.ts.map +1 -0
  148. package/dist/tools/check.js +190 -0
  149. package/dist/tools/check.js.map +1 -0
  150. package/dist/tools/create-dialog.d.ts +4 -0
  151. package/dist/tools/create-dialog.d.ts.map +1 -0
  152. package/dist/tools/create-dialog.js +58 -0
  153. package/dist/tools/create-dialog.js.map +1 -0
  154. package/dist/tools/create-skill.d.ts +4 -0
  155. package/dist/tools/create-skill.d.ts.map +1 -0
  156. package/dist/tools/create-skill.js +58 -0
  157. package/dist/tools/create-skill.js.map +1 -0
  158. package/dist/tools/decompose.d.ts +4 -0
  159. package/dist/tools/decompose.d.ts.map +1 -0
  160. package/dist/tools/decompose.js +56 -0
  161. package/dist/tools/decompose.js.map +1 -0
  162. package/dist/tools/index.d.ts +4 -0
  163. package/dist/tools/index.d.ts.map +1 -0
  164. package/dist/tools/index.js +49 -0
  165. package/dist/tools/index.js.map +1 -0
  166. package/dist/tools/list-canons.d.ts +4 -0
  167. package/dist/tools/list-canons.d.ts.map +1 -0
  168. package/dist/tools/list-canons.js +28 -0
  169. package/dist/tools/list-canons.js.map +1 -0
  170. package/dist/tools/migrate.d.ts +4 -0
  171. package/dist/tools/migrate.d.ts.map +1 -0
  172. package/dist/tools/migrate.js +38 -0
  173. package/dist/tools/migrate.js.map +1 -0
  174. package/dist/tools/onboard.d.ts +4 -0
  175. package/dist/tools/onboard.d.ts.map +1 -0
  176. package/dist/tools/onboard.js +27 -0
  177. package/dist/tools/onboard.js.map +1 -0
  178. package/dist/tools/reconverge.d.ts +4 -0
  179. package/dist/tools/reconverge.d.ts.map +1 -0
  180. package/dist/tools/reconverge.js +68 -0
  181. package/dist/tools/reconverge.js.map +1 -0
  182. package/dist/tools/redialog.d.ts +4 -0
  183. package/dist/tools/redialog.d.ts.map +1 -0
  184. package/dist/tools/redialog.js +63 -0
  185. package/dist/tools/redialog.js.map +1 -0
  186. package/dist/tools/reflect.d.ts +4 -0
  187. package/dist/tools/reflect.d.ts.map +1 -0
  188. package/dist/tools/reflect.js +86 -0
  189. package/dist/tools/reflect.js.map +1 -0
  190. package/dist/tools/reject.d.ts +4 -0
  191. package/dist/tools/reject.d.ts.map +1 -0
  192. package/dist/tools/reject.js +57 -0
  193. package/dist/tools/reject.js.map +1 -0
  194. package/dist/tools/reskill.d.ts +4 -0
  195. package/dist/tools/reskill.d.ts.map +1 -0
  196. package/dist/tools/reskill.js +63 -0
  197. package/dist/tools/reskill.js.map +1 -0
  198. package/dist/tools/resume.d.ts +4 -0
  199. package/dist/tools/resume.d.ts.map +1 -0
  200. package/dist/tools/resume.js +56 -0
  201. package/dist/tools/resume.js.map +1 -0
  202. package/dist/tools/reverse.d.ts +4 -0
  203. package/dist/tools/reverse.d.ts.map +1 -0
  204. package/dist/tools/reverse.js +32 -0
  205. package/dist/tools/reverse.js.map +1 -0
  206. package/dist/tools/save-canon.d.ts +4 -0
  207. package/dist/tools/save-canon.d.ts.map +1 -0
  208. package/dist/tools/save-canon.js +97 -0
  209. package/dist/tools/save-canon.js.map +1 -0
  210. package/dist/tools/start.d.ts +4 -0
  211. package/dist/tools/start.d.ts.map +1 -0
  212. package/dist/tools/start.js +83 -0
  213. package/dist/tools/start.js.map +1 -0
  214. package/dist/tools/translate.d.ts +4 -0
  215. package/dist/tools/translate.d.ts.map +1 -0
  216. package/dist/tools/translate.js +102 -0
  217. package/dist/tools/translate.js.map +1 -0
  218. package/dist/tools/update.d.ts +4 -0
  219. package/dist/tools/update.d.ts.map +1 -0
  220. package/dist/tools/update.js +42 -0
  221. package/dist/tools/update.js.map +1 -0
  222. package/dist/tools/validate.d.ts +4 -0
  223. package/dist/tools/validate.d.ts.map +1 -0
  224. package/dist/tools/validate.js +86 -0
  225. package/dist/tools/validate.js.map +1 -0
  226. package/dist/utils/response.d.ts +12 -0
  227. package/dist/utils/response.d.ts.map +1 -0
  228. package/dist/utils/response.js +18 -0
  229. package/dist/utils/response.js.map +1 -0
  230. package/package.json +37 -0
  231. package/protocol/commands/amend.md +188 -0
  232. package/protocol/commands/build.md +90 -0
  233. package/protocol/commands/check.md +255 -0
  234. package/protocol/commands/create-dialog.md +81 -0
  235. package/protocol/commands/decompose.md +230 -0
  236. package/protocol/commands/dialog.md +173 -0
  237. package/protocol/commands/help.md +121 -0
  238. package/protocol/commands/migrate.md +173 -0
  239. package/protocol/commands/onboard.md +210 -0
  240. package/protocol/commands/quick.md +170 -0
  241. package/protocol/commands/redialog.md +73 -0
  242. package/protocol/commands/reflect.md +136 -0
  243. package/protocol/commands/resume.md +148 -0
  244. package/protocol/commands/reverse.md +312 -0
  245. package/protocol/commands/start.md +220 -0
  246. package/protocol/commands/translate.md +157 -0
  247. package/protocol/commands/update.md +205 -0
  248. package/protocol/core-advanced.md +188 -0
  249. package/protocol/core.md +274 -0
  250. package/protocol/pantion-future-prompt.md +88 -0
  251. package/protocol/pantion-intent.md +78 -0
  252. package/protocol/templates/acceptance-tests.md +116 -0
  253. package/protocol/templates/behavior-map.md +135 -0
  254. package/protocol/templates/traceability-map.md +56 -0
  255. package/souls/beginner/rules.md +34 -0
  256. package/souls/beginner/soul.json +6 -0
  257. package/souls/default/rules.md +25 -0
  258. package/souls/default/soul.json +6 -0
  259. package/souls/young/rules.md +67 -0
  260. package/souls/young/soul.json +6 -0
@@ -0,0 +1,205 @@
1
+ # /pantion-update — Upgrade the Pantion Protocol itself
2
+
3
+ This command upgrades the Pantion Protocol itself — the protocol files, commands, rules, and templates.
4
+ It uses the intent documents as source and your (newer) model capabilities to improve the protocol.
5
+
6
+ ---
7
+
8
+ ## WARNING
9
+
10
+ **This command modifies the protocol, not a project.**
11
+
12
+ Consequences:
13
+ - New commands may work differently than the previous version
14
+ - Existing canons may not be fully compatible with the new protocol
15
+ - Project specification files (spec/*) generated with the old version may be outdated
16
+
17
+ **This is NOT backward compatible by default.**
18
+
19
+ After an update, you must run `pantion_migrate` on every project that used the old version.
20
+
21
+ ---
22
+
23
+ ## WHEN YOU ARRIVE HERE
24
+
25
+ - You have access to a more powerful model than the one Pantion was originally built with
26
+ - You want to improve the protocol with new insights
27
+ - You want to regenerate the protocol files based on the intent documents
28
+
29
+ ---
30
+
31
+ ## STEP 0: CHECK PREREQUISITES
32
+
33
+ Verify the intent documents are present:
34
+
35
+ - [ ] `protocol/pantion-intent.md` — the intent and goals of Pantion
36
+ - [ ] `protocol/pantion-future-prompt.md` — instructions for future rebuilding
37
+
38
+ If these are missing:
39
+ "I cannot upgrade the protocol without the intent documents. These files describe WHAT Pantion should be — without them I have no source of truth for the rebuild. Do you have them available?"
40
+
41
+ ---
42
+
43
+ ## STEP 1: INVENTORY CURRENT VERSION
44
+
45
+ Read all current protocol files and produce a snapshot:
46
+
47
+ ```markdown
48
+ ## Pantion Version Snapshot
49
+
50
+ **Date:** [today]
51
+ **Files:** [count]
52
+ **Commands:** [list]
53
+ **Rules:** [list]
54
+ **Skills:** [list]
55
+
56
+ ### Core concepts in current version:
57
+ - [concept 1: short description]
58
+ - [concept 2: short description]
59
+ - ...
60
+ ```
61
+
62
+ Save as `protocol/snapshots/pantion-snapshot-[date].md` (keep this — you'll need it if the update fails).
63
+
64
+ ---
65
+
66
+ ## STEP 2: READ INTENT DOCUMENTS
67
+
68
+ Read both documents carefully:
69
+
70
+ ### From `protocol/pantion-intent.md` extract:
71
+ - The core principles (what MUST remain)
72
+ - The core promise (the touchstone)
73
+ - The two directions (forward/reverse)
74
+ - The scale levels
75
+
76
+ ### From `protocol/pantion-future-prompt.md` extract:
77
+ - What works well (KEEP)
78
+ - What can be improved (IMPROVE)
79
+ - What you must NOT do
80
+ - The ultimate test
81
+
82
+ ---
83
+
84
+ ## STEP 3: DELTA ANALYSIS
85
+
86
+ Compare the current protocol files with the intent documents and your own insights:
87
+
88
+ "Here is my analysis of what can be improved:
89
+
90
+ **Keep (works well):**
91
+ - [element]: [why it works]
92
+
93
+ **Improve (can be better with current model capabilities):**
94
+ - [element]: [what can be better] -> [how]
95
+
96
+ **Add (missing, fits the intent):**
97
+ - [element]: [why it fits]
98
+
99
+ **Remove (has become redundant):**
100
+ - [element]: [why it's no longer needed]
101
+
102
+ **Risks of this update:**
103
+ - [risk 1]: backward compatibility impact
104
+ - [risk 2]: ...
105
+
106
+ Would you like me to proceed with this update? You can also exclude specific items."
107
+
108
+ **WAIT FOR CONFIRMATION.** Do not proceed without explicit approval.
109
+
110
+ ---
111
+
112
+ ## STEP 4: REGENERATE
113
+
114
+ After confirmation, regenerate the protocol files:
115
+
116
+ ### Order:
117
+ 1. **`pantion-core.md`** first — this is the knowledge base everything depends on
118
+ 2. **Commands** in logical order
119
+ 3. **Skills**: update bundled dialog files if needed
120
+ 4. **Souls**: update bundled soul files if needed
121
+
122
+ ### Rules for regeneration:
123
+ - Each new file must respect the intent documents
124
+ - The core principles are HARD — they must not disappear
125
+ - The core promise is the touchstone: "code is replaceable, intent is rebuildable"
126
+ - New concepts may only be added if they fit the intent
127
+ - The protocol must remain simple — if it needs a 50-page manual, something is wrong
128
+
129
+ ---
130
+
131
+ ## STEP 5: SELF-CHECK
132
+
133
+ After regeneration, check the new version against the intent documents:
134
+
135
+ - [ ] Respects the core principles?
136
+ - [ ] Core promise intact?
137
+ - [ ] Not too complex?
138
+ - [ ] No DSL or formal schema introduced?
139
+ - [ ] Not tool-specific?
140
+ - [ ] No features added that nobody asked for?
141
+ - [ ] Ultimate test: can a human produce a buildable canon after one session?
142
+
143
+ ---
144
+
145
+ ## STEP 6: CHANGELOG
146
+
147
+ Produce a changelog:
148
+
149
+ ```markdown
150
+ # Pantion Changelog — [date]
151
+
152
+ ## Previous version: [snapshot date]
153
+ ## New version: [date]
154
+ ## Model: [which model performed this update]
155
+
156
+ ### Changed:
157
+ - [file]: [what changed and why]
158
+
159
+ ### Added:
160
+ - [file]: [why]
161
+
162
+ ### Removed:
163
+ - [file]: [why]
164
+
165
+ ### Backward compatibility:
166
+ - [breaking/compatible]: [impact on existing projects]
167
+
168
+ ### Migration needed:
169
+ - [project type]: use `pantion_migrate` with [instruction]
170
+ ```
171
+
172
+ Save as `protocol/snapshots/pantion-changelog-[date].md`.
173
+
174
+ ---
175
+
176
+ ## STEP 7: REPORT
177
+
178
+ "The Pantion Protocol has been updated.
179
+
180
+ **Changed:** [N] files
181
+ **Added:** [N] files
182
+ **Removed:** [N] files
183
+
184
+ **Breaking changes:** [yes/no]
185
+ [if yes: list]
186
+
187
+ **Previous version saved in:** `protocol/snapshots/pantion-snapshot-[date].md`
188
+ **Changelog:** `protocol/snapshots/pantion-changelog-[date].md`
189
+
190
+ If you have existing projects that use Pantion:
191
+ Run `pantion_migrate` in each project to update the project files.
192
+
193
+ Would you like to keep the snapshot as a rollback option, or are you satisfied with the update?"
194
+
195
+ ---
196
+
197
+ ## META NOTE
198
+
199
+ This command applies Pantion's own principles to Pantion itself:
200
+ - The intent documents are the canon of Pantion
201
+ - The protocol files are the derived implementation
202
+ - `pantion_update` is essentially `pantion_reverse` + `pantion_translate` on the protocol itself
203
+ - The snapshot is the amendment history
204
+
205
+ The protocol that says "code is replaceable, intent is rebuildable" must apply that to itself as well.
@@ -0,0 +1,188 @@
1
+ # Pantion DialogSpec — Advanced Protocol Knowledge
2
+
3
+ > This file contains advanced protocol knowledge that is loaded on-demand
4
+ > for specific commands (decompose, reverse, redialog, create-dialog, redialog).
5
+ > For core protocol knowledge loaded in every session, see core.md.
6
+
7
+ ## Decomposition — Full Protocol
8
+
9
+ Three levels:
10
+ - **Architect Canon**: decomposes the system, defines shared boundaries
11
+ - **Interface Canon**: describes the contract between two subsystems
12
+ - **Component Canon**: buildable part with its own convergence
13
+
14
+ Inheritance: constraints are additive (stricter is allowed, looser is not), authority budget Rights are a ceiling, Consumption is allocatable.
15
+
16
+ ## Interface Canon — Contract Fields
17
+
18
+ Each Interface Canon describes at minimum:
19
+ - Parties (which subsystems)
20
+ - Delivered value (both directions)
21
+ - Guarantees (what is always true)
22
+ - Expectations (what may the receiver assume)
23
+ - Failure behavior (what if something goes wrong)
24
+
25
+ Plus five additional fields:
26
+ - **Data Shape**: what is exchanged, described enumeratively (in natural language, not as a schema)
27
+ - **Versioning/Compat**: what breaks compatibility? What is a backward-compatible change?
28
+ - **Error Semantics**: what specific errors may B expect from A? How are they signaled?
29
+ - **Privacy/Classification**: which data is PII, confidential, or classified? Which side may see what?
30
+ - **Rate/Cost Expectations**: what is "normal" usage? What is a peak? Where are the limits?
31
+
32
+ ## Canon Anchors
33
+
34
+ Canon Anchors are references to specific dialog turns. They enable traceability from derived artifacts (behavior map, acceptance tests, implementation) back to the canonical dialog.
35
+
36
+ Notation: **H[N]** for HUMAN turn N, **A[N]** for ASSISTANT turn N (1-indexed).
37
+
38
+ Example: H1 = first human message, A3 = third assistant message.
39
+
40
+ Canon Anchors are used in:
41
+ - Behavior Maps: every behavior links to the dialog turn that defines it
42
+ - Acceptance Tests: every test cites the dialog turn it validates
43
+ - Traceability Maps: full mapping from Canon Anchor to requirement to test to implementation
44
+ - Implementation code comments: `// Canon Anchor: H3, A4`
45
+
46
+ ## Blind Reconstruction Test
47
+
48
+ The ultimate validation of a converged canon: can a coding agent, without seeing source code, reconstruct the system from only the canon?
49
+
50
+ Use `/pantion-reflect` to capture post-build observations. See `protocol/commands/reflect.md` for the full methodology.
51
+
52
+ ## Reverse Pantion (Code → Canon)
53
+
54
+ In addition to the normal flow (Intent → Canon → Code), Pantion supports the reverse direction: analyzing an existing codebase and reconstructing the intent as a canon.
55
+
56
+ Core principle: extract **what** the code does, not **how**. The output is a synthetic dialog that reads as if it were originally conducted.
57
+
58
+ Applications: legacy migration, technology swap, documentation, audit, proof that intent canonization works.
59
+
60
+ The output is a synthetic dialog that reads as if it were originally conducted. This dialog is the canon. A derived summary is generated alongside it.
61
+
62
+ The generated canon gets STATUS: CONVERGED (REVERSE) and contains an extra AMBIGUITIES field for "bug or feature?" points. Traceability points in reverse: from canon element to source code location, with a confidence level (high/medium/low).
63
+
64
+ The ultimate test: Code → Canon → Code' → behavior(Code) ≈ behavior(Code')
65
+
66
+ ## Re-convergence (Canon → Better Canon)
67
+
68
+ The dialog is conducted by a specific model at a specific time. A newer or more capable model may identify gaps: questions that should have been asked, assumptions that were never made explicit, edge cases that were not explored. The answers to never-asked questions are simply not in the canon.
69
+
70
+ **Re-convergence** is the solution: a better model reads the existing dialog, produces a gap analysis, and conducts a supplementary dialog with the user to fill those gaps. The original dialog stays intact (append-only).
71
+
72
+ ### How re-convergence differs from other commands
73
+
74
+ | | Resume | Amend | Reconverge |
75
+ |---|--------|-------|------------|
76
+ | **Entry condition** | DRAFT with open questions | CONVERGED — user wants a change | CONVERGED — model identifies gaps |
77
+ | **Who initiates** | User (wants to finish) | User (wants to change something) | Model (detects gaps) |
78
+ | **Primary action** | Answer remaining open questions | Apply a specific change | Gap analysis → targeted supplementary dialog |
79
+ | **Result status** | CONVERGED | AMENDED | RECONVERGED |
80
+
81
+ ### When to reconverge
82
+
83
+ - **Model upgrade**: a significantly better model is available
84
+ - **Periodic review**: important canons should be re-evaluated periodically
85
+ - **Dissatisfaction**: the implementation reveals that the original convergence was too shallow
86
+ - **New domain knowledge**: insights that weren't available during the original dialog
87
+ - **Check recommendation**: `/pantion-check` detected thin or missing elements
88
+
89
+ ### Gap analysis dimensions
90
+
91
+ 1. **Unexplored convergence elements** — checklist items that are thin or absent
92
+ 2. **Implicit assumptions** — things assumed without being made explicit
93
+ 3. **Ambiguous resolutions** — vague answers that should have been probed further
94
+ 4. **Missing edge cases** — failure modes, boundary conditions not discussed
95
+ 5. **Authority budget gaps** — rights, consumption, or forbidden actions underspecified
96
+ 6. **Interface gaps** — contracts between components incomplete (for decomposed systems)
97
+
98
+ ### The future-proof promise
99
+
100
+ The true future-proofing of Pantion is not just re-derivation (better artifacts from the same dialog) but **re-convergence** (a deeper dialog built on top of the original). The original dialog preserves the user's voice, decisions, priorities, and domain context — a better model uses this as a foundation, not a limitation.
101
+
102
+ Use `/pantion-redialog` (alias: `/pantion-reconverge`) to initiate a redialog.
103
+
104
+ ## Souls (Interaction Style)
105
+
106
+ A **soul** is a configurable interaction style that determines *how* the convergence dialog is conducted — the tone, pacing, jargon level, and questioning approach. It does NOT change *what* is discussed: convergence requirements (intent, constraints, success criteria, authority budget) remain identical regardless of soul.
107
+
108
+ ### How souls differ from skills
109
+
110
+ | | Dialog | Soul |
111
+ |---|-------|------|
112
+ | **Determines** | What convergence elements to cover (domain-specific) | How to communicate during convergence |
113
+ | **Examples** | Software Development, Image Description | Balanced Professional, Beginner Friendly, Young Builder |
114
+ | **Composable** | One skill per session | One soul per session, works with any skill |
115
+ | **Location** | `dialogs/` directory | `souls/` directory |
116
+
117
+ ### Soul structure
118
+
119
+ ```
120
+ souls/{name}/
121
+ ├── soul.json (manifest: name, displayName, description, version)
122
+ └── rules.md (interaction rules — injected into system prompt)
123
+ ```
124
+
125
+ ### Search order
126
+
127
+ Same as skills: project-local (`souls/`) → user-global (`~/.pantion/souls/`) → bundled.
128
+
129
+ ### Built-in souls
130
+
131
+ - **default** — Balanced Professional: clear, direct, systematic. Used when no soul is specified.
132
+ - **beginner** — Beginner Friendly: extra explanation, less jargon, smaller steps, understanding checks.
133
+ - **young** — Young Builder: simple language, concrete examples, encouraging tone. For young users building their first project.
134
+
135
+ ### Rules
136
+
137
+ - Soul rules are injected into the system prompt after skill rules
138
+ - The soul is saved in the session (traceability: which style was used)
139
+ - If no soul is specified, the "default" soul is used
140
+ - Soul rules must never weaken convergence requirements — they only change presentation
141
+ - Custom souls can be created by adding a directory to `souls/` (project-local or `~/.pantion/souls/`)
142
+
143
+ ## Dynamic Skills (Skills from Canons)
144
+
145
+ Skills can be created through Pantion dialogs, making them **model-proof**. Instead of hand-crafting dialog files, a user converges on domain knowledge through a dialog-builder dialog. The resulting canon is the source of truth from which all dialog files are derived.
146
+
147
+ ### Dialog Canon Structure
148
+
149
+ Dynamic dialogs store their source canon alongside the derived dialog files:
150
+
151
+ ```
152
+ dialogs/{name}/
153
+ ├── dialog.json ← DERIVED from skill-canon
154
+ ├── convergence-rules.md ← DERIVED from skill-canon
155
+ ├── translate.md ← DERIVED from skill-canon
156
+ ├── prompts/ ← DERIVED from skill-canon
157
+ │ ├── convergence-intro.md
158
+ │ └── translate-intro.md
159
+ └── canon/ ← SOURCE (model-proof)
160
+ ├── dialog.md ← THE CANON
161
+ └── summary.md ← DERIVED
162
+ ```
163
+
164
+ ### The Dialog-Builder Meta-Skill
165
+
166
+ The `dialog-builder` is a bundled meta-dialog that knows how to converge on domain knowledge. It guides the user through: what is this domain? What decisions matter? What do agents get wrong? What output should the dialog produce?
167
+
168
+ ### Dialog Canon Lifecycle
169
+
170
+ - `pantion_create-dialog`: start a dialog dialog using the dialog-builder
171
+ - `pantion_save-canon` (with `skill_name`): save the dialog canon to `dialogs/{name}/canon/`
172
+ - `pantion_translate`: translate the dialog canon into dialog files
173
+ - `pantion_redialog`: reconverge an existing dialog canon to deepen domain knowledge
174
+
175
+ ### Compatibility
176
+
177
+ - Existing bundled dialogs (software, image) work exactly as before — no canon needed
178
+ - Dynamic dialogs are loaded by the same registry with `source: 'dynamic'`
179
+ - The three-tier search (project > user > bundled) works for both hand-crafted and dynamic dialogs
180
+ - A dynamic dialog can override a bundled skill (project-local takes priority)
181
+
182
+ ### Rules
183
+
184
+ - The dialog dialog is the canon — dialog files are derived
185
+ - Dialog canons are stored in `dialogs/{name}/canon/`, NOT in the project `canon/` directory
186
+ - Dialog canons do NOT appear in the project `canon/index.md`
187
+ - Reconvergence on a dialog canon (`pantion_redialog`) uses dialog-builder rules
188
+ - The dialog-builder meta-dialog is bundled and evolves only through protocol updates
@@ -0,0 +1,274 @@
1
+ # Pantion DialogSpec — Core Knowledge
2
+
3
+ > This file contains the core knowledge of the Pantion DialogSpec Protocol.
4
+ > It is loaded by MCP clients via the protocol directory, and mirrored in .claude/rules/pantion-core.md for Claude Code.
5
+ > The developer does not need to read this — it guides agent behavior.
6
+
7
+ ## Language
8
+
9
+ Pantion protocol files are in English. When interacting with the user, always match the user's language. Canons are written in the language of the dialog. Generated project files follow the project's language convention.
10
+
11
+ ## What is Pantion?
12
+
13
+ Pantion is a protocol that lets natural-language dialogs converge into an unambiguous intent description. The result is not a program or schema, but a canonical intent that can be directly translated into project files and implementation.
14
+
15
+ ## Core Principles
16
+
17
+ 1. The verbatim dialog is the canon — the only source of truth
18
+ 2. Everything stays in natural language
19
+ 3. Structure is emergent, not imposed
20
+ 4. A dialog is complete when further questions yield no new behavior
21
+ 5. Implementation choices are NEVER made in the dialog (unless the human insists)
22
+ 6. All derived artifacts (summaries, project files, tests) may NEVER override the canon
23
+ 7. The dialog is always saved — this enables future models to re-derive better artifacts from the same canon
24
+
25
+ ## Canon Structure: Dialog is the Canon
26
+
27
+ The canon is the **verbatim dialog** (chronological Q/A log) between HUMAN and ASSISTENT. This is the only source of truth.
28
+
29
+ ### File structure per canon:
30
+
31
+ ```
32
+ canon/
33
+ ├── index.md ← Overview of all canons
34
+ ├── {naam}/
35
+ │ ├── dialog.md ← THE CANON (verbatim dialog)
36
+ │ ├── summary.md ← DERIVED: structured summary for navigation
37
+ │ ├── traceability.md ← DERIVED: canon → spec traceability
38
+ │ └── spec/ ← DERIVED: project specification files
39
+ │ ├── requirements.md
40
+ │ ├── constraints.md
41
+ │ └── ...
42
+ ```
43
+
44
+ ### Why the dialog is the canon, not the summary:
45
+
46
+ 1. **The dialog preserves nuance**: rejected options, hesitations, the order of discovery — information that a summary loses
47
+ 2. **Future-proof**: a smarter model can re-read the dialog and conduct a redialog (`/pantion-redialog`) — identifying gaps the original model missed and conducting a supplementary dialog to fill them. Additionally, better models can re-derive better summaries and project files from the same dialog
48
+ 3. **The summary is a convenience**: it helps humans and agents navigate, but it is never authoritative
49
+ 4. **Traceability is richer**: derived files can point to specific dialog passages (turns), not just summary sections
50
+
51
+ ### Rules:
52
+
53
+ - The dialog is ALWAYS saved verbatim (no editing, no cherry-picking)
54
+ - The summary is regenerated when the dialog changes (resume, amend)
55
+ - If the summary and dialog conflict, the dialog wins
56
+ - Traceability points to dialog passages where possible
57
+
58
+ ## Canon Lifecycle
59
+
60
+ A canon progresses through these statuses:
61
+
62
+ - **DRAFT**: dialog has started but has not yet converged (OPEN QUESTIONS exist)
63
+ - **CONVERGED**: all questions answered, stamp set, ready for translation/building
64
+ - **CONVERGED (DIALOG)**: converged in dialog mode with conservative assumptions (⚡ marked) — the fast variant
65
+ - **CONVERGED (QUICK)**: legacy name for CONVERGED (DIALOG), kept for backward compatibility
66
+ - **CONVERGED (REVERSE)**: intent reconstructed from existing code
67
+ - **AMENDED**: converged and later modified via amendment
68
+ - **RECONVERGED**: a converged canon re-evaluated by a newer/better model that identified and explored gaps in the original convergence
69
+
70
+
71
+ Large projects often span multiple sessions: DRAFT → resume → resume → CONVERGED. This is normal and expected. A RECONVERGED canon may be reconverged again as models improve (iterative deepening).
72
+
73
+ ## Canon Index
74
+
75
+ Each project has a `canon/index.md` as an overview page:
76
+ - Which canons exist, with type and status
77
+ - For each canon: reference to both the dialog file (canon) and the summary file (derived)
78
+ - Open Questions backlog (all unanswered questions collected)
79
+ - Last modified + amendments per canon
80
+
81
+ The index is updated with EVERY canon change (start, resume, amend, decompose).
82
+
83
+ ## HARD vs FLEX
84
+
85
+ - **HARD**: invariants that must never change — recognize by: "must", "never", "always", security, privacy, cost, retention, isolation
86
+ - **FLEX**: defaults that may evolve — recognize by: "MVP", "makes no difference", "prefer", "handy", "default"
87
+ - **Unclear**: mark as OPEN QUESTION
88
+
89
+ ## Inference Policy
90
+
91
+ 1. Explicit wins over implicit
92
+ 2. Only one interpretation allowed
93
+ 3. Multiple interpretations → OPEN QUESTION (don't guess)
94
+ 4. Non-goals block "convenient" additions
95
+ 5. Constraints win over everything
96
+
97
+ **Conservative** (default): smallest scope, least power, safest option.
98
+ **Strict**: rule 2 extremely strict, no implicit interpretation whatsoever.
99
+
100
+ ## Authority Budget (always cover)
101
+
102
+ The Authority Budget consists of two categories:
103
+
104
+ ### Rights (ceiling per component — not additive)
105
+ - Allowed Actions: what may the system do?
106
+ - Forbidden Actions: what NEVER?
107
+ - Data Access: what may it see?
108
+ - Data Retention: does it store anything? For how long?
109
+ - User Notification: when to inform the user?
110
+ - Auditability: what must be reconstructable?
111
+
112
+ ### Consumption (rate/cost budget — additive and allocatable)
113
+ - Rate Limits: frequency limits per time unit
114
+ - Cost Limits: cost/token limits per period
115
+ - Budget Allocation: during decomposition, the Architect Canon can include an allocation (e.g., "component A max 30% of daily API budget")
116
+
117
+ During decomposition: Rights are a ceiling (component may have less, never more). Consumption is allocatable (total of components must not exceed system budget).
118
+
119
+ ## Convergence Elements (always cover)
120
+
121
+ - Intent (what, not how)
122
+ - Inputs (explicit + implicit + defaults)
123
+ - Outputs (observable)
124
+ - Success criteria (externally verifiable)
125
+ - Failure behavior (no silent failure)
126
+ - Non-goals (what it does NOT do)
127
+ - Authority budget (Rights + Consumption)
128
+ - Persistence/restart behavior
129
+
130
+ ## Decomposition (for large systems)
131
+
132
+ Signals that decomposition is needed (Decompose Score 0–5):
133
+ - (+1) More than 3 clearly independent behavior clusters
134
+ - (+1) Fundamentally different authority budgets per part
135
+ - (+1) Dialog is getting too long / context is being lost
136
+ - (+1) The human talks about "modules", "parts", "separate pieces"
137
+ - (+1) Different parts have different users or interfaces
138
+
139
+ Score 0–1: probably standalone. Score 2–3: discuss with the user. Score 4–5: actively propose decomposition.
140
+
141
+ ## Canon → File Translation
142
+
143
+ After convergence, the canon is the primary instruction set for any connected agent (served via MCP resources). Additionally, project specification files may be derived. The source for translation is the dialog (canon). The summary is used for navigation but never as authoritative source.
144
+
145
+ ### Primary Path (MCP-native)
146
+
147
+ Any MCP client reads the canon directly via:
148
+ - `pantion://canons/{name}/dialog` — the full dialog (source of truth)
149
+ - `pantion://canons/{name}/summary` — derived summary (for navigation)
150
+ - `pantion://dialogs/{name}/rules` — dialog-specific rules and translation instructions
151
+
152
+ No agent-specific intermediate files are needed. The canon IS the instruction set.
153
+
154
+ ### Project Specification Files (via translate)
155
+
156
+ The translate step produces project-specific deliverables (not agent-specific instruction files):
157
+
158
+ | Canon element | Project specification file |
159
+ |--------------|--------------------------|
160
+ | System intent, requirements, success criteria | canon/{naam}/spec/requirements.md |
161
+ | HARD constraints, forbidden actions, data policies | canon/{naam}/spec/constraints.md |
162
+ | Success criteria, failure behavior | canon/{naam}/spec/success-criteria.md |
163
+ | API behavior (if applicable) | canon/{naam}/spec/api-spec.md |
164
+ | Data entities and retention (if applicable) | canon/{naam}/spec/data-model.md |
165
+ | Component structure (if applicable) | canon/{naam}/spec/architecture.md |
166
+ | Interfaces (if decomposed) | canon/{naam}/spec/interfaces/interface-*.md |
167
+
168
+ All derived files are generated from the dialog. The summary is itself a derived file.
169
+
170
+ ## Traceability (always-on)
171
+
172
+ Traceability is not just a step in `/pantion-translate`. It is a discipline:
173
+
174
+ - With EVERY generation or regeneration of derived files → update `canon/{naam}/traceability.md`
175
+ - With EVERY amendment → update traceability for affected files
176
+ - During decomposition → traceability covers all canon levels
177
+
178
+ Each derived file contains a comment: `<!-- Derived from: canon/{naam}/dialog.md, [date] -->`
179
+ The summary file also contains this comment, as it is itself derived from the dialog.
180
+
181
+ ## Convergence Verification Table
182
+
183
+ Before setting the DIALOGSPEC STAMP, the converger produces a Convergence Verification Table as proof that all 12 categories have been treated. This table is part of the last assistant message in the dialog, directly before the stamp.
184
+
185
+ Format (12 rows matching the Readiness Checklist categories):
186
+
187
+ | Criterium | Status |
188
+ |-----------|--------|
189
+ | Canon status | ✅ / ❌ |
190
+ | Intent clarity | ✅ / ❌ |
191
+ | Observable success | ✅ / ❌ |
192
+ | Inputs complete | ✅ / ❌ |
193
+ | Outputs unambiguous | ✅ / ❌ |
194
+ | Failure specified | ✅ / ❌ |
195
+ | Constraints absolute | ✅ / ❌ |
196
+ | Non-goals documented | ✅ / ❌ |
197
+ | Ambiguity handled | ✅ / ❌ |
198
+ | Authority Budget | ✅ / ❌ |
199
+ | Inference Policy | ✅ / ❌ |
200
+ | Dialog stability | ✅ / ❌ |
201
+
202
+ For quick mode: use ⚡ ASSUMPTION for items handled by conservative defaults.
203
+
204
+ The table concludes with: "A competent coding agent can, without further interaction, build a functionally equivalent system." (or the reason why not).
205
+
206
+ ## DIALOGSPEC STAMP — Required Fields
207
+
208
+ Every converged dialog ends with a machine-readable `=== DIALOGSPEC STAMP ===` block. The stamp contains at minimum:
209
+
210
+ - **STATUS**: CONVERGED | CONVERGED (DIALOG) | CONVERGED (QUICK) | CONVERGED (REVERSE) | AMENDED | RECONVERGED | DRAFT
211
+ - **DATE**: YYYY-MM-DD
212
+ - **MODEL**: model-id and display name, format: `model-id (Display Name)` (e.g. `claude-opus-4-6 (Claude Opus 4.6)`, `gpt-4o-2025-01 (GPT-4o)`)
213
+ - **CANON TYPE**: standalone | architect | interface | component
214
+ - **PARENT**: canonical name or "none"
215
+ - **OPEN QUESTIONS**: "none" for converged stamps, list otherwise
216
+ - **INFERENCE POLICY**: conservative | strict
217
+ - **STABILITY ZONES**: HARD constraints (list)
218
+ - **FLEX ZONES**: FLEX defaults (list)
219
+
220
+ Additional fields depend on status and command (see command-specific documentation). The MODEL field enables reconvergence decisions: which canons were produced by older models that might benefit from redialog with a newer model.
221
+
222
+ A canon cannot be saved without a valid stamp. The server enforces this structurally.
223
+
224
+ ## HUMAN STAMP — Authorization Gate
225
+
226
+ Every saved canon includes a `=== HUMAN STAMP ===` block that tracks human authorization. This is a mandatory gate between convergence and translation/building.
227
+
228
+ ### Structure
229
+
230
+ ```
231
+ === HUMAN STAMP ===
232
+ DATE: [not set]
233
+ ROLE: [not set]
234
+ STATUS: PENDING
235
+ NOTE: [not set]
236
+ === /HUMAN STAMP ===
237
+ ```
238
+
239
+ ### Status values
240
+
241
+ - **PENDING**: default for new canons in full mode — awaiting human review
242
+ - **APPROVED**: human has reviewed and authorized the canon for translation/building
243
+ - **REJECTED**: human has reviewed and rejected the canon — needs changes
244
+ - **AUTO-APPROVED**: automatically approved in dialog mode — the canon is immediately ready for translation
245
+
246
+ ### Rules
247
+
248
+ 1. A canon with STATUS other than APPROVED or AUTO-APPROVED may NOT be translated (`pantion_translate` blocks)
249
+ 2. The HUMAN STAMP is set via `pantion_approve` or `pantion_reject`, or automatically to AUTO-APPROVED in dialog mode
250
+ 3. When a canon is amended (`pantion_amend`) or reconverged (`pantion_redialog`), the HUMAN STAMP resets to PENDING
251
+ 4. Existing canons without a HUMAN STAMP block are treated as PENDING
252
+ 5. The HUMAN STAMP is the only allowed in-place mutation of a saved dialog file (all other changes are append-only)
253
+ 6. `pantion_check` reports HUMAN STAMP status as a warning if not APPROVED or AUTO-APPROVED
254
+ 7. `pantion_list-canons` includes the HUMAN STAMP status for each canon
255
+
256
+ ### Design rationale
257
+
258
+ The HUMAN STAMP ensures that no canon proceeds to translation or building without authorization. In full mode (the default), this requires explicit human approval (`pantion_approve`). In dialog mode, canons are auto-approved for fast iteration. The fill-in-place design (rather than append-only) avoids cluttering the dialog with administrative stamps.
259
+
260
+ ## Phase Transitions
261
+
262
+ The transition from convergence to building is ALWAYS a deliberate moment:
263
+
264
+ 1. Convergence reached → verification table produced
265
+ 2. All 12 categories ✅ → stamp set
266
+ 3. Checklist completed → all ✅
267
+ 4. **HUMAN STAMP authorized** → human approves (`pantion_approve`) or auto-approved in dialog mode
268
+ 5. Files generated → traceable to canon via Canon Anchors
269
+ 6. ONLY THEN → build mode (following `protocol/commands/build.md`)
270
+
271
+ In full mode (the default), all steps require explicit completion. In dialog mode, steps 2-4 are accelerated: conservative assumptions are made and the canon is auto-approved.
272
+
273
+ Large projects may remain in DRAFT across multiple sessions. Use `/pantion-resume` to continue converging later.
274
+