@pantion/mcp-server 0.1.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 (160) hide show
  1. package/dist/feature-set.d.ts +14 -0
  2. package/dist/feature-set.d.ts.map +1 -0
  3. package/dist/feature-set.js +38 -0
  4. package/dist/feature-set.js.map +1 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +56 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/prompts/convergence-prompts.d.ts +4 -0
  10. package/dist/prompts/convergence-prompts.d.ts.map +1 -0
  11. package/dist/prompts/convergence-prompts.js +76 -0
  12. package/dist/prompts/convergence-prompts.js.map +1 -0
  13. package/dist/prompts/index.d.ts +4 -0
  14. package/dist/prompts/index.d.ts.map +1 -0
  15. package/dist/prompts/index.js +7 -0
  16. package/dist/prompts/index.js.map +1 -0
  17. package/dist/prompts/workflow-prompts.d.ts +9 -0
  18. package/dist/prompts/workflow-prompts.d.ts.map +1 -0
  19. package/dist/prompts/workflow-prompts.js +249 -0
  20. package/dist/prompts/workflow-prompts.js.map +1 -0
  21. package/dist/resources/canon-resources.d.ts +4 -0
  22. package/dist/resources/canon-resources.d.ts.map +1 -0
  23. package/dist/resources/canon-resources.js +160 -0
  24. package/dist/resources/canon-resources.js.map +1 -0
  25. package/dist/server.d.ts +9 -0
  26. package/dist/server.d.ts.map +1 -0
  27. package/dist/server.js +47 -0
  28. package/dist/server.js.map +1 -0
  29. package/dist/tools/amend.d.ts +4 -0
  30. package/dist/tools/amend.d.ts.map +1 -0
  31. package/dist/tools/amend.js +106 -0
  32. package/dist/tools/amend.js.map +1 -0
  33. package/dist/tools/approve.d.ts +4 -0
  34. package/dist/tools/approve.d.ts.map +1 -0
  35. package/dist/tools/approve.js +60 -0
  36. package/dist/tools/approve.js.map +1 -0
  37. package/dist/tools/check-convergence.d.ts +4 -0
  38. package/dist/tools/check-convergence.d.ts.map +1 -0
  39. package/dist/tools/check-convergence.js +50 -0
  40. package/dist/tools/check-convergence.js.map +1 -0
  41. package/dist/tools/check.d.ts +4 -0
  42. package/dist/tools/check.d.ts.map +1 -0
  43. package/dist/tools/check.js +190 -0
  44. package/dist/tools/check.js.map +1 -0
  45. package/dist/tools/create-skill.d.ts +4 -0
  46. package/dist/tools/create-skill.d.ts.map +1 -0
  47. package/dist/tools/create-skill.js +58 -0
  48. package/dist/tools/create-skill.js.map +1 -0
  49. package/dist/tools/decompose.d.ts +4 -0
  50. package/dist/tools/decompose.d.ts.map +1 -0
  51. package/dist/tools/decompose.js +56 -0
  52. package/dist/tools/decompose.js.map +1 -0
  53. package/dist/tools/index.d.ts +4 -0
  54. package/dist/tools/index.d.ts.map +1 -0
  55. package/dist/tools/index.js +47 -0
  56. package/dist/tools/index.js.map +1 -0
  57. package/dist/tools/list-canons.d.ts +4 -0
  58. package/dist/tools/list-canons.d.ts.map +1 -0
  59. package/dist/tools/list-canons.js +28 -0
  60. package/dist/tools/list-canons.js.map +1 -0
  61. package/dist/tools/migrate.d.ts +4 -0
  62. package/dist/tools/migrate.d.ts.map +1 -0
  63. package/dist/tools/migrate.js +38 -0
  64. package/dist/tools/migrate.js.map +1 -0
  65. package/dist/tools/onboard.d.ts +4 -0
  66. package/dist/tools/onboard.d.ts.map +1 -0
  67. package/dist/tools/onboard.js +27 -0
  68. package/dist/tools/onboard.js.map +1 -0
  69. package/dist/tools/reconverge.d.ts +4 -0
  70. package/dist/tools/reconverge.d.ts.map +1 -0
  71. package/dist/tools/reconverge.js +68 -0
  72. package/dist/tools/reconverge.js.map +1 -0
  73. package/dist/tools/reject.d.ts +4 -0
  74. package/dist/tools/reject.d.ts.map +1 -0
  75. package/dist/tools/reject.js +57 -0
  76. package/dist/tools/reject.js.map +1 -0
  77. package/dist/tools/reskill.d.ts +4 -0
  78. package/dist/tools/reskill.d.ts.map +1 -0
  79. package/dist/tools/reskill.js +63 -0
  80. package/dist/tools/reskill.js.map +1 -0
  81. package/dist/tools/resume.d.ts +4 -0
  82. package/dist/tools/resume.d.ts.map +1 -0
  83. package/dist/tools/resume.js +56 -0
  84. package/dist/tools/resume.js.map +1 -0
  85. package/dist/tools/reverse.d.ts +4 -0
  86. package/dist/tools/reverse.d.ts.map +1 -0
  87. package/dist/tools/reverse.js +32 -0
  88. package/dist/tools/reverse.js.map +1 -0
  89. package/dist/tools/save-canon.d.ts +4 -0
  90. package/dist/tools/save-canon.d.ts.map +1 -0
  91. package/dist/tools/save-canon.js +97 -0
  92. package/dist/tools/save-canon.js.map +1 -0
  93. package/dist/tools/start.d.ts +4 -0
  94. package/dist/tools/start.d.ts.map +1 -0
  95. package/dist/tools/start.js +83 -0
  96. package/dist/tools/start.js.map +1 -0
  97. package/dist/tools/translate.d.ts +4 -0
  98. package/dist/tools/translate.d.ts.map +1 -0
  99. package/dist/tools/translate.js +102 -0
  100. package/dist/tools/translate.js.map +1 -0
  101. package/dist/tools/update.d.ts +4 -0
  102. package/dist/tools/update.d.ts.map +1 -0
  103. package/dist/tools/update.js +42 -0
  104. package/dist/tools/update.js.map +1 -0
  105. package/dist/utils/response.d.ts +12 -0
  106. package/dist/utils/response.d.ts.map +1 -0
  107. package/dist/utils/response.js +18 -0
  108. package/dist/utils/response.js.map +1 -0
  109. package/package.json +37 -0
  110. package/protocol/commands/amend.md +188 -0
  111. package/protocol/commands/build.md +90 -0
  112. package/protocol/commands/check.md +255 -0
  113. package/protocol/commands/create-skill.md +81 -0
  114. package/protocol/commands/decompose.md +230 -0
  115. package/protocol/commands/dialog.md +173 -0
  116. package/protocol/commands/help.md +121 -0
  117. package/protocol/commands/migrate.md +173 -0
  118. package/protocol/commands/onboard.md +210 -0
  119. package/protocol/commands/quick.md +170 -0
  120. package/protocol/commands/redialog.md +252 -0
  121. package/protocol/commands/reskill.md +73 -0
  122. package/protocol/commands/resume.md +148 -0
  123. package/protocol/commands/reverse.md +312 -0
  124. package/protocol/commands/start.md +220 -0
  125. package/protocol/commands/translate.md +157 -0
  126. package/protocol/commands/update.md +205 -0
  127. package/protocol/commands/validate.md +137 -0
  128. package/protocol/core-advanced.md +188 -0
  129. package/protocol/core.md +273 -0
  130. package/protocol/pantion-future-prompt.md +88 -0
  131. package/protocol/pantion-intent.md +78 -0
  132. package/protocol/templates/acceptance-tests.md +116 -0
  133. package/protocol/templates/behavior-map.md +135 -0
  134. package/protocol/templates/traceability-map.md +56 -0
  135. package/skills/image/convergence-rules.md +55 -0
  136. package/skills/image/prompts/convergence-intro.md +25 -0
  137. package/skills/image/prompts/translate-intro.md +37 -0
  138. package/skills/image/skill.json +12 -0
  139. package/skills/image/translate.md +67 -0
  140. package/skills/skill-builder/convergence-rules.md +64 -0
  141. package/skills/skill-builder/prompts/convergence-intro.md +21 -0
  142. package/skills/skill-builder/prompts/translate-intro.md +17 -0
  143. package/skills/skill-builder/skill.json +10 -0
  144. package/skills/skill-builder/translate.md +46 -0
  145. package/skills/software/convergence-rules.md +29 -0
  146. package/skills/software/prompts/convergence-intro.md +22 -0
  147. package/skills/software/prompts/translate-intro.md +19 -0
  148. package/skills/software/skill.json +12 -0
  149. package/skills/software/translate.md +74 -0
  150. package/skills/software-brownfield/convergence-rules.md +109 -0
  151. package/skills/software-brownfield/prompts/convergence-intro.md +26 -0
  152. package/skills/software-brownfield/prompts/translate-intro.md +13 -0
  153. package/skills/software-brownfield/skill.json +12 -0
  154. package/skills/software-brownfield/translate.md +56 -0
  155. package/souls/beginner/rules.md +34 -0
  156. package/souls/beginner/soul.json +6 -0
  157. package/souls/default/rules.md +25 -0
  158. package/souls/default/soul.json +6 -0
  159. package/souls/young/rules.md +67 -0
  160. package/souls/young/soul.json +6 -0
@@ -0,0 +1,173 @@
1
+ # /pantion-dialog — Dialog convergence (default mode)
2
+
3
+ You are now in Pantion Dialog mode. This is the default mode for fast, focused convergence.
4
+ You follow the same protocol as full dialog mode, but with these adjustments:
5
+
6
+ ---
7
+
8
+ ## Difference from full dialog mode
9
+
10
+ | Aspect | Full dialog mode | Dialog mode (default) |
11
+ |--------|-----------------|----------------------|
12
+ | Questions | Resolve all ambiguity | Only ask critical questions |
13
+ | Assumptions | None (OPEN QUESTION) | Make conservative assumptions |
14
+ | Authority Budget | Cover completely | Cover basics, rest with conservative defaults |
15
+ | Non-goals | Document explicitly | Document basics |
16
+ | Build speed | After full convergence | After sufficient convergence |
17
+ | Marking | Everything is checked | Assumptions are marked with lightning |
18
+
19
+ ---
20
+
21
+ ## PHASE 1: DIALOG CONVERGENCE
22
+
23
+ ### Start
24
+ Say:
25
+
26
+ "I'll get moving fast. I'll only ask the crucial questions and make conservative assumptions for the rest. I'll mark those so you can adjust them later. Tell me what you want to build."
27
+
28
+ ### Rules
29
+ 1. Ask ONE question at a time — wait for the answer before asking the next
30
+ 2. Ask at most 5-8 essential questions (don't exhaustively converge)
31
+ 3. Focus on: what does it do, for whom, what are the hard boundaries
32
+ 4. On ambiguity: make a conservative assumption and mark with ASSUMPTION
33
+ 5. Authority budget: use conservative defaults where not explicitly discussed
34
+ 6. Non-goals: base on what logically is NOT in scope
35
+ 7. You may use `OPEN QUESTION [OQ-NNN]:` IDs for tracking, but this is not required in dialog mode
36
+
37
+ ### Conservative defaults for undiscussed elements:
38
+ - **Data retention**: store nothing unless explicitly requested
39
+ - **Data access**: only what is minimally necessary
40
+ - **Rate limits**: no explicit limits (but note as ASSUMPTION)
41
+ - **Auditability**: basic logging
42
+ - **Failure behavior**: graceful fail with user notification
43
+ - **Inference policy**: conservative
44
+
45
+ ### Saving the dialog (CRITICAL — the dialog IS the canon)
46
+
47
+ Same principle as full dialog mode: the verbatim dialog is always saved.
48
+
49
+ **Two files are always produced:**
50
+ - `canon/{naam}/dialog.md` — THE CANON: the verbatim dialog (dialog status is in the stamp, not the filename)
51
+ - `canon/{naam}/summary.md` — DERIVED: structured summary for navigation
52
+
53
+ ### Pre-stamp quality check (recommended)
54
+
55
+ Before setting the convergence stamp, it is recommended to run `pantion_check` on the dialog. This provides a structural quality scorecard that can surface gaps before the stamp is finalized. This is not blocking — the HUMAN STAMP remains the actual authorization gate.
56
+
57
+ ### Convergence Verification Table (dialog variant)
58
+
59
+ Before the stamp, include the verification table (with assumptions marked):
60
+
61
+ **Convergence Verification:**
62
+
63
+ | Criterium | Status |
64
+ |-----------|--------|
65
+ | Canon status | ✅ |
66
+ | Intent clarity | ✅ |
67
+ | Observable success | ✅ |
68
+ | Inputs complete | ✅ |
69
+ | Outputs unambiguous | ✅ |
70
+ | Failure specified | ⚡ ASSUMPTION: graceful fail |
71
+ | Constraints absolute | ✅ |
72
+ | Non-goals documented | ⚡ ASSUMPTION: basic non-goals |
73
+ | Ambiguity handled | ⚡ ASSUMPTION: conservative |
74
+ | Authority Budget | ⚡ ASSUMPTION: conservative defaults |
75
+ | Inference Policy | ✅ conservative |
76
+ | Dialog stability | ✅ |
77
+
78
+ **Conclusion:** Sufficient for prototype. [N] assumptions made — see assumptions list.
79
+
80
+ ### Convergence Stamp (dialog variant)
81
+
82
+ The stamp is placed at the top of the dialog file:
83
+
84
+ === DIALOGSPEC STAMP ===
85
+ STATUS: CONVERGED (DIALOG)
86
+ DATE: [today]
87
+ MODEL: [model-id (Display Name), e.g. claude-opus-4-6 (Claude Opus 4.6)]
88
+ CANON TYPE: standalone
89
+ PARENT: none
90
+ OPEN QUESTIONS: none (assumptions marked)
91
+ INFERENCE POLICY: conservative
92
+ AUTHORITY BUDGET: partial (conservative defaults for undiscussed elements)
93
+ STABILITY ZONES: [HARD invariants]
94
+ FLEX ZONES: [FLEX defaults + assumptions]
95
+ ASSUMPTIONS: [list of all assumptions]
96
+ === /DIALOGSPEC STAMP ===
97
+
98
+ Save the verbatim dialog as `canon/{naam}/dialog.md`.
99
+ Generate the derived summary as `canon/{naam}/summary.md`.
100
+
101
+ ---
102
+
103
+ ## PHASE 2: DIALOG TRANSLATION
104
+
105
+ Generate the same files as full dialog mode, but:
106
+ - Mark all assumptions with `ASSUMPTION:` in the files
107
+ - Keep files shorter and more pragmatic
108
+ - Skip command files unless there are clear workflows
109
+
110
+ All derived files point to the dialog: `<!-- Derived from: canon/{naam}/dialog.md, [date] -->`
111
+
112
+ ### Extra file:
113
+
114
+ **`canon/assumptions.md`**
115
+
116
+ List all assumptions made in dialog mode with their conservative defaults. Reference to the dialog turns where the assumption was made. Each assumption can be replaced with an explicit choice via /pantion-amend.
117
+
118
+ ---
119
+
120
+ ## PHASE 3: DIALOG BUILD
121
+
122
+ Build the system with the same rules as full dialog mode.
123
+
124
+ ### Extra after building:
125
+
126
+ Say:
127
+
128
+ "Prototype is built. I made [N] assumptions.
129
+ Here are the most important ones:
130
+
131
+ 1. [assumption 1]
132
+ 2. [assumption 2]
133
+ 3. [assumption 3]
134
+
135
+ Want to adjust any of these? Or would you like to run the full protocol with /pantion-start for a deeper convergence?"
136
+
137
+ ---
138
+
139
+ ## When to escalate
140
+
141
+ ### To full dialog mode
142
+
143
+ If during dialog mode it becomes clear that:
144
+ - There are safety-critical aspects that cannot be covered by assumptions
145
+ - The user corrects assumptions multiple times
146
+ - Authority Budget questions are too complex for conservative defaults
147
+
148
+ Then say:
149
+ "This system has aspects that cannot be covered by assumptions. I recommend switching to full dialog mode for the complete protocol. The dialog will be carried over as a starting point."
150
+
151
+ ### To /pantion-decompose (split up)
152
+
153
+ If during dialog mode it becomes clear that:
154
+ - Multiple independent modules/interfaces are emerging
155
+ - The Decompose Score is 3 or higher (see full dialog mode for criteria)
156
+ - Different parts have fundamentally different rights/restrictions
157
+
158
+ Then say:
159
+ "This system is too large for a single dialog canon. I recommend switching to /pantion-decompose. I'll carry the dialog over as input for the Architect Canon — what we already know doesn't need to be discussed again."
160
+
161
+ When switching to decompose:
162
+ 1. Save the current dialog as DRAFT
163
+ 2. Start /pantion-decompose
164
+ 3. Use the dialog as starting point (don't start from scratch)
165
+ 4. Mark in `canon/index.md` that the dialog canon has been absorbed into the Architect Canon
166
+
167
+ ## Canon Index
168
+
169
+ Update `canon/index.md` when completing a dialog session:
170
+ - Status: CONVERGED (DIALOG)
171
+ - References to both dialog file and summary file
172
+ - List of all assumptions
173
+ - Reference to `canon/assumptions.md`
@@ -0,0 +1,121 @@
1
+ # /pantion-help — Guide to all Pantion commands
2
+
3
+ Give the user a clear overview, tailored to what they want to do.
4
+
5
+ ---
6
+
7
+ ## STEP 1: RECOGNIZE THE SITUATION
8
+
9
+ Look at the context:
10
+ - Is there already a `canon/` directory? → existing Pantion project
11
+ - Is there code but no `canon/`? → existing project without Pantion
12
+ - Is there nothing? → new project
13
+
14
+ ---
15
+
16
+ ## STEP 2: SHOW THE OVERVIEW
17
+
18
+ Say:
19
+
20
+ "Here are all Pantion commands. I've grouped them by what you want to do:
21
+
22
+ ---
23
+
24
+ ### 🆕 Build something new
25
+
26
+ | Command | What it does |
27
+ |---------|-------------|
28
+ | `/pantion-start` | Full protocol: describe your idea → I ask questions → canon → project files → build |
29
+ | `/pantion-quick` | Quick variant: fewer questions, conservative assumptions (⚡), ideal for prototypes |
30
+
31
+ ---
32
+
33
+ ### 📦 Existing project
34
+
35
+ | Command | What it does |
36
+ |---------|-------------|
37
+ | `/pantion-onboard` | Add Pantion to a project that already has code (three strategies: forward-only / full reverse / partial) |
38
+ | `/pantion-reverse` | Extract intent from existing codebase → generate canon (not describing the code, but the intent) |
39
+
40
+ ---
41
+
42
+ ### 🔧 Continue working on a canon
43
+
44
+ | Command | What it does |
45
+ |---------|-------------|
46
+ | `/pantion-resume` | Continue converging on a DRAFT canon (across multiple sessions) |
47
+ | `/pantion-amend` | Apply a change to an existing CONVERGED canon |
48
+ | `/pantion-redialog` | Re-evaluate a converged canon with a better model (gap analysis + supplementary dialog) |
49
+ | `/pantion-translate` | Translate canon to project specification files (requirements, constraints, specs) |
50
+
51
+ ---
52
+
53
+ ### 🏗️ Scale & structure
54
+
55
+ | Command | What it does |
56
+ |---------|-------------|
57
+ | `/pantion-decompose` | Split large system into architect canon + interface canons + component canons |
58
+
59
+ ---
60
+
61
+ ### ✅ Quality
62
+
63
+ | Command | What it does |
64
+ |---------|-------------|
65
+ | `/pantion-check` | Check whether canons are complete, consistent, and build-ready |
66
+
67
+ ---
68
+
69
+ ### 🔄 Protocol evolution
70
+
71
+ | Command | What it does |
72
+ |---------|-------------|
73
+ | `/pantion-update` | Upgrade the protocol itself — ⚠️ may introduce breaking changes |
74
+ | `/pantion-migrate` | Update project to new protocol after an upgrade |
75
+
76
+ ---
77
+
78
+ ### ❓ This command
79
+
80
+ | Command | What it does |
81
+ |---------|-------------|
82
+ | `/pantion-help` | This overview |
83
+
84
+ ---
85
+
86
+ **Not sure which command you need?** Just tell me what you want to do, and I'll point you in the right direction."
87
+
88
+ ---
89
+
90
+ ## STEP 3: REDIRECT
91
+
92
+ If the user asks a question or describes what they want after seeing the overview, redirect:
93
+
94
+ | The user says... | Redirect to |
95
+ |-----------------|-------------|
96
+ | "I want to build something new" | `/pantion-start` or `/pantion-quick` |
97
+ | "I already have code and want to use Pantion" | `/pantion-onboard` |
98
+ | "I want to understand what my code does" | `/pantion-reverse` |
99
+ | "I was working on something but stopped" | `/pantion-resume` |
100
+ | "I want to change something in an existing canon" | `/pantion-amend` |
101
+ | "I just want to generate the project files" | `/pantion-translate` |
102
+ | "My system is too big" | `/pantion-decompose` |
103
+ | "I want to check if everything is correct" | `/pantion-check` |
104
+ | "I have a better model now" / "My canon is too shallow" | `/pantion-redialog` |
105
+ | "I want to upgrade Pantion itself" | `/pantion-update` |
106
+ | "My project doesn't work anymore after a Pantion update" | `/pantion-migrate` |
107
+ | "What is Pantion?" | Explain briefly (see below) |
108
+
109
+ ---
110
+
111
+ ## IF THE USER ASKS: "WHAT IS PANTION?"
112
+
113
+ Say:
114
+
115
+ "Pantion is a protocol that helps you go from idea to working system through a structured conversation.
116
+
117
+ Instead of writing a spec, you describe what you want to build. I ask the right questions until your intent is clear — no more guesswork. That conversation becomes the source of truth (the 'canon'). Everything that follows — code, configuration, documentation — is derived from that canon.
118
+
119
+ Core principle: **code is replaceable, intent is rebuildable.**
120
+
121
+ Want to get started? Type `/pantion-start` for the full protocol, or `/pantion-quick` if you want to prototype quickly."
@@ -0,0 +1,173 @@
1
+ # /pantion-migrate — Update project to new protocol version
2
+
3
+ After a `pantion_update`, the protocol may have changed. This command updates an existing project
4
+ so that canons and derived files are compatible with the new version.
5
+
6
+ ---
7
+
8
+ ## WHEN YOU ARRIVE HERE
9
+
10
+ - After a `pantion_update` that contained breaking changes
11
+ - When opening a project created with an older Pantion version
12
+ - When `pantion_check` reports issues indicating protocol mismatch
13
+
14
+ ---
15
+
16
+ ## STEP 1: DETECT VERSION MISMATCH
17
+
18
+ Check:
19
+
20
+ 1. **Protocol version**: which protocol commands/rules are installed?
21
+ 2. **Canon version**: which canons exist, and when were they created?
22
+ 3. **Changelog**: is there a `protocol/snapshots/pantion-changelog-[date].md` available?
23
+
24
+ If there's a changelog, read the breaking changes.
25
+ If there's no changelog, compare the current protocol files with the structure of the canons.
26
+
27
+ Report:
28
+
29
+ "This project uses Pantion canons from [date/version].
30
+ The installed Pantion protocol is from [date/version].
31
+
32
+ **Changes found:**
33
+ - [change 1]: impact on this project: [yes/no]
34
+ - [change 2]: impact on this project: [yes/no]
35
+
36
+ **Action needed:**
37
+ - [list of what needs to be updated]
38
+
39
+ Would you like me to perform the migration?"
40
+
41
+ ---
42
+
43
+ ## STEP 2: EVALUATE CANONS
44
+
45
+ Read all canons in `canon/` and check per canon:
46
+
47
+ ### Structural checks:
48
+ - [ ] Stamp format: does it contain all fields the new version expects?
49
+ - [ ] Canon Type: is it recognized by the new version?
50
+ - [ ] Authority Budget: does it fit the new structure (e.g., Rights/Consumption split)?
51
+ - [ ] Interface Canons: do they contain the fields the new version expects?
52
+
53
+ ### Content checks:
54
+ - [ ] Are there new convergence elements the old version didn't cover?
55
+ - [ ] Are there concepts that have been renamed or restructured?
56
+
57
+ ### Classification per canon:
58
+
59
+ | Canon | Status | Migration needed |
60
+ |-------|--------|-----------------|
61
+ | [name] | compatible | no |
62
+ | [name] | stamp outdated | update stamp |
63
+ | [name] | missing fields | supplement or OPEN QUESTION |
64
+ | [name] | incompatible | redialog needed |
65
+
66
+ ---
67
+
68
+ ## STEP 3: PERFORM MIGRATION
69
+
70
+ ### Level 1 — Automatic (no content changes)
71
+
72
+ Safe updates that don't affect intent:
73
+
74
+ - **Update stamps**: add fields the new version expects, with values derived from the canon
75
+ - **Update index**: adjust `canon/index.md` to new template format
76
+ - **Update traceability**: adjust format
77
+ - **Update comments**: `<!-- Derived from: ... -->` in derived files
78
+
79
+ Execute this automatically after confirmation.
80
+
81
+ ### Level 2 — Semi-automatic (minor content additions)
82
+
83
+ Updates that require interpretation but are likely safe:
84
+
85
+ - **Restructure Authority Budget**: if the new version distinguishes Rights/Consumption, split existing budget items
86
+ - **Supplement interface fields**: if the new version expects additional contract fields, derive from existing canon or mark as OPEN QUESTION
87
+ - **Add new metadata**: e.g., Decompose Score, session count
88
+
89
+ Present each change to the user: "I want to supplement [X] with [Y], derived from [Z]. Agree?"
90
+
91
+ ### Level 3 — Manual (redialog needed)
92
+
93
+ If a canon is substantively insufficient for the new version:
94
+
95
+ "Canon [name] is missing [element] that the new version requires. I cannot supplement this automatically — it requires a new convergence dialog.
96
+
97
+ Options:
98
+ A) Start a short convergence session to supplement the missing element (via `pantion_resume`)
99
+ B) Mark as OPEN QUESTION and update later
100
+ C) Leave it as-is (the canon remains valid but is not fully compliant with the new standard)"
101
+
102
+ ---
103
+
104
+ ## STEP 4: REGENERATE DERIVED FILES
105
+
106
+ After updating the canons, regenerate all derived files:
107
+
108
+ 1. Read the updated canons
109
+ 2. Run the translation step again (as in `pantion_translate`)
110
+ 3. Keep a backup of the old files (for diff/review)
111
+ 4. Generate the new files
112
+ 5. Update `canon/traceability.md`
113
+
114
+ ### Present diff:
115
+
116
+ "Here are the changes in the derived files:
117
+
118
+ **spec/requirements.md:**
119
+ - [what changed]
120
+
121
+ **spec/constraints.md:**
122
+ - [what changed]
123
+
124
+ **[etc.]**
125
+
126
+ Would you like to accept the changes?"
127
+
128
+ ---
129
+
130
+ ## STEP 5: VALIDATION
131
+
132
+ Automatically run `pantion_check` on all updated canons.
133
+
134
+ If all pass:
135
+ "Migration successful. All canons are compatible with the new version."
136
+
137
+ If there are issues:
138
+ "Migration mostly successful, but there are [N] open items:
139
+ [list]
140
+
141
+ Use `pantion_resume` to answer the open items."
142
+
143
+ ---
144
+
145
+ ## STEP 6: REPORT
146
+
147
+ "Migration completed for [project name].
148
+
149
+ **Canons updated:** [N] of [total]
150
+ - Automatic: [N]
151
+ - Semi-automatic: [N]
152
+ - Open for redialog: [N]
153
+
154
+ **Derived files regenerated:** [N]
155
+ **Validation:** PASS | [N] open items
156
+
157
+ Backup of old files: [location]"
158
+
159
+ ---
160
+
161
+ ## SPECIAL SITUATIONS
162
+
163
+ ### No changelog available
164
+ If there's no changelog (e.g., the update was done manually), compare the structure:
165
+ - Which stamp fields does the new version expect?
166
+ - Which command structure has changed?
167
+ - Make a best-effort analysis and present it to the user.
168
+
169
+ ### Multiple projects
170
+ "You have multiple projects that use Pantion. `pantion_migrate` works per project. Run it in each project separately."
171
+
172
+ ### Project with DRAFT canons
173
+ DRAFT canons are not migrated — they are still in flux. After migration, use `pantion_resume` to finalize them with the new version.
@@ -0,0 +1,210 @@
1
+ # /pantion-onboard — Add Pantion to an existing project
2
+
3
+ You have an existing project with code. You want to introduce Pantion.
4
+ This command guides you through the choice of how, and executes it.
5
+
6
+ ---
7
+
8
+ ## STEP 1: EXPLORE THE PROJECT
9
+
10
+ Scan the project:
11
+
12
+ - How much code is there? (files, lines, languages)
13
+ - Is there documentation? (README, docs/, comments)
14
+ - Are there tests?
15
+ - Is there already a `.claude/` directory?
16
+ - Are there existing specs, PRDs, tickets, or other intent descriptions?
17
+
18
+ Report:
19
+
20
+ "I've explored your project:
21
+
22
+ **Code:** [N] files, [N] lines, languages: [list]
23
+ **Documentation:** [present/not present, what]
24
+ **Tests:** [present/not present, coverage if estimable]
25
+ **Existing specs:** [present/not present, what]
26
+
27
+ Based on this, I'll present you with three options."
28
+
29
+ ---
30
+
31
+ ## STEP 2: CHOOSE STRATEGY
32
+
33
+ Present the three strategies:
34
+
35
+ "How do you want to use Pantion in this project?
36
+
37
+ **A) Forward only** — Pantion for all new changes
38
+ - Existing code stays as-is
39
+ - Every new feature, change, or bugfix goes through a canon
40
+ - Lightest approach, immediately productive
41
+ - No traceability to existing code
42
+
43
+ **B) Full reverse** — First canonize the entire codebase
44
+ - I'll run /pantion-reverse on the complete codebase
45
+ - You get a complete canon of what the system currently does
46
+ - Then you continue working via the canon
47
+ - Heaviest approach, but full traceability
48
+
49
+ **C) Partial** — Only canonize what you're going to touch
50
+ - You point out which part you're going to change
51
+ - I'll run /pantion-reverse on only that part
52
+ - The rest stays undocumented until you touch it
53
+ - Pragmatic, grows organically
54
+
55
+ Which fits your situation?"
56
+
57
+ ---
58
+
59
+ ## STEP 3A: FORWARD ONLY
60
+
61
+ ### Installation
62
+ 1. Create `canon/` directory
63
+ 2. Initialize `canon/index.md`
64
+ 3. Create `canon/baseline.md`:
65
+
66
+ ```markdown
67
+ # Baseline
68
+
69
+ This project existed before Pantion was introduced.
70
+ The code present on [date] has no canon.
71
+
72
+ Pantion is active for all changes from [date] onward.
73
+ Existing code will be canonized when it is touched (see strategy C: partial).
74
+
75
+ ## Existing project
76
+ - **Languages:** [list]
77
+ - **Size:** [estimate]
78
+ - **Documentation:** [what exists]
79
+ - **Tests:** [what exists]
80
+ ```
81
+
82
+ 4. Project specification files (`spec/`) come with the first canon via `/pantion-translate`.
83
+
84
+ ### Wrap up
85
+
86
+ "Pantion has been installed alongside your existing project.
87
+
88
+ From now on:
89
+ - New feature: use `pantion_start`
90
+ - Change to canonized code: use `pantion_amend`
91
+ - Touching existing code: use `pantion_onboard` again (strategy C for that part)
92
+
93
+ The existing codebase has no canon. That's fine — you build up organically."
94
+
95
+ ---
96
+
97
+ ## STEP 3B: FULL REVERSE
98
+
99
+ ### Size estimation
100
+ Scale the approach based on project size:
101
+
102
+ **Small (< 20 files, < 2000 lines):**
103
+ - Run `/pantion-reverse` directly on the entire codebase
104
+ - One standalone canon
105
+
106
+ **Medium (20-100 files, 2000-15000 lines):**
107
+ - Run `/pantion-reverse` on the entire codebase
108
+ - Consider hierarchical decomposition if there are clearly distinct parts
109
+
110
+ **Large (> 100 files, > 15000 lines):**
111
+ - Hierarchical approach is almost certainly needed
112
+ - Start with an Architect Canon (system overview)
113
+ - Decompose into components
114
+ - Reverse per component
115
+
116
+ ### Execution
117
+ 1. Run `/pantion-reverse` (see that command for the full process)
118
+ 2. Let the user review the generated canon
119
+ 3. Resolve OPEN QUESTIONS and AMBIGUITIES with the user
120
+ 4. Generate project files via `/pantion-translate`
121
+
122
+ ### Wrap up
123
+
124
+ "The complete codebase has been canonized.
125
+
126
+ - Canon (dialog): `canon/dialogspec-dialog.md`
127
+ - Summary (derived): `canon/dialogspec-summary.md`
128
+ - Status: [CONVERGED (REVERSE) | DRAFT with N open questions]
129
+ - Traceability: `canon/traceability.md` (canon -> source code)
130
+
131
+ From now on, the project works entirely via Pantion.
132
+ Changes via `pantion_amend`, new features via `pantion_start`."
133
+
134
+ ---
135
+
136
+ ## STEP 3C: PARTIAL
137
+
138
+ ### Determine scope
139
+
140
+ Ask: "Which part of the project are you going to touch? Describe it in your own words, or point me to the files/directories."
141
+
142
+ Identify the scope:
143
+ - Which files/modules/directories belong to it?
144
+ - Where does this part touch the rest of the project? (interfaces)
145
+ - Is this part independent enough to canonize separately?
146
+
147
+ ### Boundary detection
148
+
149
+ Analyze the boundaries of the selected part:
150
+
151
+ "This part touches the rest of the project at these points:
152
+ - [interface 1: description]
153
+ - [interface 2: description]
154
+
155
+ Would you like to canonize these interfaces as well, or treat them as 'existing environment'?"
156
+
157
+ **Option 1 — Include interfaces:** Generate Interface Canons for the couplings. This gives sharper contracts but takes more time.
158
+
159
+ **Option 2 — Treat interfaces as given:** Describe the interfaces as external constraints in the component canon. Faster, but less traceability.
160
+
161
+ ### Execution
162
+ 1. Run `/pantion-reverse` on only the selected part
163
+ 2. Treat the rest of the project as context (not as code to be canonized)
164
+ 3. Generate a component canon with:
165
+ - `INHERITED CONSTRAINTS: derived from the broader codebase`
166
+ - `EXTERNAL INTERFACES: [description of how this part touches the rest]`
167
+ 4. Resolve OPEN QUESTIONS with the user
168
+ 5. Generate project files for this part
169
+
170
+ ### Wrap up
171
+
172
+ "Part [name] has been canonized.
173
+
174
+ - Canon (dialog): `canon/components/component-[name]-dialog.md`
175
+ - Summary (derived): `canon/components/component-[name]-summary.md`
176
+ - Status: [CONVERGED (REVERSE) | DRAFT]
177
+ - Interfaces: [canonized | described as constraint]
178
+
179
+ The rest of the project has no canon. When you touch another part,
180
+ run `pantion_onboard` again for that part — it grows organically."
181
+
182
+ ---
183
+
184
+ ## STEP 4: HYGIENE CHECK
185
+
186
+ Regardless of the chosen strategy, check at the end:
187
+
188
+ - [ ] `canon/index.md` has been created and is current
189
+ - [ ] `canon/baseline.md` describes the starting situation
190
+ - [ ] Existing project configuration has not been broken
191
+ - [ ] Existing documentation has been supplemented, not overwritten
192
+ - [ ] The user knows which flow to follow for their next change
193
+
194
+ ---
195
+
196
+ ## SPECIAL SITUATIONS
197
+
198
+ ### There are already specs/PRDs/tickets
199
+ "I see there are already specification documents: [list]. Would you like me to include these as input for the canonization? They then become part of the dialog — not the canon itself."
200
+
201
+ Use existing specs as context during the reverse process, but the canon remains the verbatim dialog.
202
+
203
+ ### The project already uses another spec method
204
+ "This project uses [method]. Pantion doesn't necessarily replace it — it adds a canonical intent layer. The existing [specs/tickets/PRDs] can serve as input for convergence. Would you like to work side by side, or switch over completely?"
205
+
206
+ ### Multiple developers
207
+ "Are multiple people working on this project? If so, it's important that everyone knows:
208
+ - The canon in `canon/` is the source of truth
209
+ - Changes go through `pantion_amend`
210
+ - The generated files in `spec/` are derived — don't edit them manually"