pan-wizard 3.32.0 → 3.34.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 (209) hide show
  1. package/README.md +23 -20
  2. package/agents/pan-conductor.md +18 -17
  3. package/agents/pan-counterfactual.md +2 -2
  4. package/agents/pan-debugger.md +27 -8
  5. package/agents/pan-design-checker.md +1 -1
  6. package/agents/pan-designer.md +2 -2
  7. package/agents/pan-distiller.md +3 -3
  8. package/agents/pan-document_code.md +16 -16
  9. package/agents/pan-executor.md +15 -11
  10. package/agents/pan-experiment-runner.md +15 -17
  11. package/agents/pan-hardener.md +15 -15
  12. package/agents/pan-integration-checker.md +2 -2
  13. package/agents/pan-knowledge.md +2 -2
  14. package/agents/pan-meta-reviewer.md +5 -5
  15. package/agents/pan-optimizer.md +40 -44
  16. package/agents/pan-phase-researcher.md +10 -10
  17. package/agents/pan-plan-checker.md +36 -30
  18. package/agents/pan-planner.md +77 -53
  19. package/agents/pan-previewer.md +1 -1
  20. package/agents/pan-project-researcher.md +21 -78
  21. package/agents/pan-release.md +1 -1
  22. package/agents/pan-research-synthesizer.md +2 -2
  23. package/agents/pan-reviewer.md +24 -2
  24. package/agents/pan-roadmapper.md +20 -62
  25. package/agents/pan-verifier.md +53 -30
  26. package/bin/install-lib.cjs +228 -38
  27. package/bin/install.js +86 -15
  28. package/commands/pan/army.md +16 -12
  29. package/commands/pan/assumptions.md +2 -2
  30. package/commands/pan/audit-deployment.md +11 -12
  31. package/commands/pan/cost.md +8 -4
  32. package/commands/pan/debug.md +10 -7
  33. package/commands/pan/design-phase.md +3 -3
  34. package/commands/pan/discuss-phase.md +2 -0
  35. package/commands/pan/exec-phase.md +21 -37
  36. package/commands/pan/experiment.md +11 -10
  37. package/commands/pan/focus-auto.md +33 -27
  38. package/commands/pan/focus-design.md +9 -6
  39. package/commands/pan/focus-doc-audit.md +4 -3
  40. package/commands/pan/focus-drift-walking.md +4 -3
  41. package/commands/pan/focus-exec.md +7 -7
  42. package/commands/pan/focus-plan.md +12 -11
  43. package/commands/pan/focus-scan.md +7 -10
  44. package/commands/pan/focus-sync.md +3 -2
  45. package/commands/pan/git.md +8 -8
  46. package/commands/pan/health.md +2 -2
  47. package/commands/pan/hud.md +3 -2
  48. package/commands/pan/hygiene.md +14 -7
  49. package/commands/pan/knowledge.md +9 -9
  50. package/commands/pan/learn.md +10 -7
  51. package/commands/pan/links.md +4 -1
  52. package/commands/pan/map-codebase.md +5 -5
  53. package/commands/pan/mcp-bridge.md +18 -18
  54. package/commands/pan/milestone-done.md +7 -5
  55. package/commands/pan/milestone-new.md +1 -1
  56. package/commands/pan/new-project.md +10 -10
  57. package/commands/pan/optimize.md +16 -14
  58. package/commands/pan/patches.md +2 -6
  59. package/commands/pan/pause.md +1 -1
  60. package/commands/pan/phase-tests.md +4 -3
  61. package/commands/pan/plan-phase.md +9 -19
  62. package/commands/pan/preview.md +1 -1
  63. package/commands/pan/profile.md +4 -4
  64. package/commands/pan/quick.md +1 -1
  65. package/commands/pan/remove-phase.md +1 -1
  66. package/commands/pan/report.md +2 -2
  67. package/commands/pan/research-phase.md +14 -15
  68. package/commands/pan/resume.md +9 -11
  69. package/commands/pan/retro.md +5 -3
  70. package/commands/pan/review-deep.md +10 -10
  71. package/commands/pan/settings.md +1 -1
  72. package/commands/pan/todo-add.md +2 -2
  73. package/commands/pan/todo-check.md +2 -2
  74. package/commands/pan/verify-phase.md +0 -11
  75. package/commands/pan/what-if.md +2 -2
  76. package/hooks/dist/pan-context-monitor.js +343 -44
  77. package/hooks/dist/pan-cost-logger.js +30 -0
  78. package/hooks/dist/pan-state-reinject.js +140 -15
  79. package/hooks/dist/pan-statusline.js +68 -22
  80. package/hooks/dist/pan-stop-guard.js +7 -2
  81. package/package.json +1 -1
  82. package/pan-wizard-core/bin/lib/agents-md.cjs +48 -7
  83. package/pan-wizard-core/bin/lib/bridge.cjs +6 -5
  84. package/pan-wizard-core/bin/lib/campaign.cjs +4 -2
  85. package/pan-wizard-core/bin/lib/commands-learnings.cjs +19 -2
  86. package/pan-wizard-core/bin/lib/commands.cjs +126 -5
  87. package/pan-wizard-core/bin/lib/config.cjs +112 -1
  88. package/pan-wizard-core/bin/lib/constants.cjs +29 -15
  89. package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
  90. package/pan-wizard-core/bin/lib/core.cjs +77 -23
  91. package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
  92. package/pan-wizard-core/bin/lib/cost.cjs +149 -10
  93. package/pan-wizard-core/bin/lib/distill.cjs +6 -3
  94. package/pan-wizard-core/bin/lib/doc-lint.cjs +30 -11
  95. package/pan-wizard-core/bin/lib/findings.cjs +15 -4
  96. package/pan-wizard-core/bin/lib/focus.cjs +13 -4
  97. package/pan-wizard-core/bin/lib/frontmatter.cjs +105 -26
  98. package/pan-wizard-core/bin/lib/hygiene.cjs +178 -17
  99. package/pan-wizard-core/bin/lib/init.cjs +12 -5
  100. package/pan-wizard-core/bin/lib/knowledge.cjs +17 -1
  101. package/pan-wizard-core/bin/lib/learn-index.cjs +111 -10
  102. package/pan-wizard-core/bin/lib/learn-lint.cjs +30 -3
  103. package/pan-wizard-core/bin/lib/memory-optimize.cjs +8 -4
  104. package/pan-wizard-core/bin/lib/memory.cjs +508 -54
  105. package/pan-wizard-core/bin/lib/milestone.cjs +8 -3
  106. package/pan-wizard-core/bin/lib/optimize.cjs +84 -16
  107. package/pan-wizard-core/bin/lib/phase-remove.cjs +85 -21
  108. package/pan-wizard-core/bin/lib/phase-report.cjs +8 -2
  109. package/pan-wizard-core/bin/lib/phase.cjs +67 -15
  110. package/pan-wizard-core/bin/lib/preview.cjs +3 -1
  111. package/pan-wizard-core/bin/lib/review-deep.cjs +2 -2
  112. package/pan-wizard-core/bin/lib/roadmap-compact.cjs +267 -0
  113. package/pan-wizard-core/bin/lib/roadmap.cjs +243 -9
  114. package/pan-wizard-core/bin/lib/runner.cjs +2 -1
  115. package/pan-wizard-core/bin/lib/state-compact.cjs +11 -6
  116. package/pan-wizard-core/bin/lib/state.cjs +47 -31
  117. package/pan-wizard-core/bin/lib/template.cjs +11 -4
  118. package/pan-wizard-core/bin/lib/verdict.cjs +54 -4
  119. package/pan-wizard-core/bin/lib/verify-drift.cjs +14 -5
  120. package/pan-wizard-core/bin/lib/verify-preflight.cjs +4 -13
  121. package/pan-wizard-core/bin/lib/verify-retro.cjs +5 -3
  122. package/pan-wizard-core/bin/lib/verify-scope.cjs +74 -4
  123. package/pan-wizard-core/bin/lib/verify.cjs +117 -35
  124. package/pan-wizard-core/bin/lib/whatif.cjs +5 -3
  125. package/pan-wizard-core/bin/pan-tools.cjs +111 -17
  126. package/pan-wizard-core/learnings/index.json +5 -5
  127. package/pan-wizard-core/mcp/server.cjs +18 -9
  128. package/pan-wizard-core/opencode/pan-wizard.js +111 -0
  129. package/pan-wizard-core/references/checkpoints.md +7 -5
  130. package/pan-wizard-core/references/continuation-format.md +3 -3
  131. package/pan-wizard-core/references/decimal-phase-calculation.md +2 -3
  132. package/pan-wizard-core/references/design-methodology.md +1 -1
  133. package/pan-wizard-core/references/git-integration.md +4 -6
  134. package/pan-wizard-core/references/git-planning-commit.md +2 -2
  135. package/pan-wizard-core/references/guardrails.md +2 -2
  136. package/pan-wizard-core/references/handoff-decisions.md +3 -3
  137. package/pan-wizard-core/references/model-profile-resolution.md +5 -5
  138. package/pan-wizard-core/references/model-profiles.md +14 -9
  139. package/pan-wizard-core/references/phase-argument-parsing.md +7 -7
  140. package/pan-wizard-core/references/planning-config.md +4 -4
  141. package/pan-wizard-core/references/tdd.md +10 -1
  142. package/pan-wizard-core/references/verdict-contract.md +2 -1
  143. package/pan-wizard-core/references/verification-patterns.md +5 -5
  144. package/pan-wizard-core/templates/codebase/architecture.md +2 -2
  145. package/pan-wizard-core/templates/codebase/best-practices.md +2 -2
  146. package/pan-wizard-core/templates/codebase/concerns.md +3 -3
  147. package/pan-wizard-core/templates/codebase/integrations.md +6 -6
  148. package/pan-wizard-core/templates/codebase/relationships.md +2 -2
  149. package/pan-wizard-core/templates/codebase/stack.md +2 -2
  150. package/pan-wizard-core/templates/codebase/structure.md +4 -4
  151. package/pan-wizard-core/templates/codebase/testing.md +4 -4
  152. package/pan-wizard-core/templates/continue-here.md +1 -1
  153. package/pan-wizard-core/templates/debug-subagent-prompt.md +3 -2
  154. package/pan-wizard-core/templates/debug.md +15 -1
  155. package/pan-wizard-core/templates/discovery.md +1 -1
  156. package/pan-wizard-core/templates/milestone-archive.md +6 -6
  157. package/pan-wizard-core/templates/milestone.md +1 -1
  158. package/pan-wizard-core/templates/phase-prompt.md +31 -18
  159. package/pan-wizard-core/templates/planner-subagent-prompt.md +3 -5
  160. package/pan-wizard-core/templates/research-project/architecture.md +3 -3
  161. package/pan-wizard-core/templates/research-project/features.md +1 -1
  162. package/pan-wizard-core/templates/research-project/pitfalls.md +1 -1
  163. package/pan-wizard-core/templates/research-project/stack.md +3 -3
  164. package/pan-wizard-core/templates/research.md +5 -5
  165. package/pan-wizard-core/templates/retrospective.md +1 -1
  166. package/pan-wizard-core/templates/roadmap.md +15 -15
  167. package/pan-wizard-core/templates/summary-complex.md +1 -0
  168. package/pan-wizard-core/templates/summary-minimal.md +1 -0
  169. package/pan-wizard-core/templates/summary-standard.md +2 -1
  170. package/pan-wizard-core/templates/summary.md +18 -2
  171. package/pan-wizard-core/templates/uat.md +3 -3
  172. package/pan-wizard-core/templates/user-setup.md +8 -8
  173. package/pan-wizard-core/templates/verification-report.md +54 -4
  174. package/pan-wizard-core/workflows/add-phase.md +1 -1
  175. package/pan-wizard-core/workflows/assumptions.md +1 -1
  176. package/pan-wizard-core/workflows/discuss-phase.md +9 -8
  177. package/pan-wizard-core/workflows/exec-phase.md +34 -60
  178. package/pan-wizard-core/workflows/execute-plan.md +8 -7
  179. package/pan-wizard-core/workflows/health.md +13 -11
  180. package/pan-wizard-core/workflows/help.md +8 -9
  181. package/pan-wizard-core/workflows/learn.md +13 -11
  182. package/pan-wizard-core/workflows/map-codebase.md +10 -10
  183. package/pan-wizard-core/workflows/milestone-audit.md +10 -10
  184. package/pan-wizard-core/workflows/milestone-gaps.md +17 -24
  185. package/pan-wizard-core/workflows/milestone-new.md +7 -6
  186. package/pan-wizard-core/workflows/new-project.md +10 -10
  187. package/pan-wizard-core/workflows/optimize.md +11 -9
  188. package/pan-wizard-core/workflows/pause.md +6 -1
  189. package/pan-wizard-core/workflows/phase-tests.md +4 -4
  190. package/pan-wizard-core/workflows/plan-phase.md +31 -34
  191. package/pan-wizard-core/workflows/profile.md +2 -2
  192. package/pan-wizard-core/workflows/progress.md +5 -7
  193. package/pan-wizard-core/workflows/quick.md +10 -8
  194. package/pan-wizard-core/workflows/remove-phase.md +1 -1
  195. package/pan-wizard-core/workflows/research-phase.md +9 -5
  196. package/pan-wizard-core/workflows/resume-project.md +4 -6
  197. package/pan-wizard-core/workflows/retro.md +3 -1
  198. package/pan-wizard-core/workflows/settings.md +16 -24
  199. package/pan-wizard-core/workflows/todo-check.md +1 -1
  200. package/pan-wizard-core/workflows/transition.md +12 -12
  201. package/pan-wizard-core/workflows/update.md +25 -17
  202. package/pan-wizard-core/workflows/verify-phase.md +24 -17
  203. package/pan-zcode/KNOWN-BETA-RISKS.md +2 -2
  204. package/pan-zcode/README.md +7 -7
  205. package/pan-zcode/bin/install-zcode.js +1 -1
  206. package/scripts/build-agent-plugin.js +19 -5
  207. package/scripts/build-plugin.js +3 -1
  208. package/scripts/generate-skills-docs.py +13 -4
  209. package/scripts/test-surface.cjs +4 -0
@@ -0,0 +1,111 @@
1
+ 'use strict';
2
+ // PAN Wizard plugin for OpenCode (memory optimisation O12)
3
+ //
4
+ // OpenCode was the last host without PAN's state re-injection. It runs no command
5
+ // hooks, but its plugins can add to the prompt it compacts a session with:
6
+ // `experimental.session.compacting` fires before the model writes the continuation
7
+ // summary, and strings pushed onto `output.context` go into that prompt
8
+ // (opencode.ai/docs/plugins, read 2026-10-04). This plugin pushes PAN's position —
9
+ // the phase in flight, the plan, where it stopped — read from the planning tree on
10
+ // disk, so the summary carries it. The other hosts get the same block from
11
+ // hooks/pan-state-reinject.js after compaction.
12
+ //
13
+ // Installed by the PAN installer as <opencode config dir>/plugins/pan-wizard.js,
14
+ // beside the `{"type":"commonjs"}` package.json PAN writes there, so this file is
15
+ // CommonJS and exports the plugin module shape `{ id, server }`.
16
+ //
17
+ // Inert unless the project is a PAN project with work in flight (a state.md naming
18
+ // a current phase and a roadmap.md with an unticked phase). Never writes anything.
19
+ // Fail-open: an error adds nothing and never breaks a compaction.
20
+ //
21
+ // planningDirName(), field() and positionLines() are copies of the same logic in
22
+ // hooks/pan-state-reinject.js; tests/opencode-plugin.test.cjs pins the two to the
23
+ // same output.
24
+
25
+ const fs = require('fs');
26
+ const path = require('path');
27
+
28
+ function planningDirName() {
29
+ const raw = process.env.PAN_PLANNING_DIR || '';
30
+ if (raw.trim()) {
31
+ const rel = raw.trim().replace(/\\/g, '/');
32
+ const bad = rel.startsWith('/') || rel.startsWith('\\') || /^[A-Za-z]:/.test(rel)
33
+ || rel.split('/').includes('..');
34
+ if (!bad) return rel;
35
+ }
36
+ const track = (process.env.PAN_TRACK || '').trim();
37
+ if (track && /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(track)) {
38
+ return `.planning/tracks/${track}`;
39
+ }
40
+ return '.planning';
41
+ }
42
+
43
+ const UNTICKED_PHASE_RE = /^- \[ \] \*\*Phase (\d+(?:\.\d+)?):/m;
44
+ const FIELD_MAX = 240;
45
+ const BLOCK_MAX = 2000;
46
+
47
+ function field(content, name) {
48
+ const m = content.match(new RegExp(`\\*\\*${name}:\\*\\*[ \\t]*(.+)`, 'i'));
49
+ if (!m) return null;
50
+ const v = m[1].trim();
51
+ if (!v || /^\[.*\]$/.test(v) || /^none$/i.test(v)) return null;
52
+ return v.length > FIELD_MAX ? v.slice(0, FIELD_MAX - 1) + '…' : v;
53
+ }
54
+
55
+ /** The position lines for a planning tree, or null when nothing is in flight. */
56
+ function positionLines(stateContent, roadmapContent) {
57
+ if (typeof stateContent !== 'string' || typeof roadmapContent !== 'string') return null;
58
+ const phase = field(stateContent, 'Current Phase');
59
+ if (!phase) return null;
60
+ const unticked = roadmapContent.match(UNTICKED_PHASE_RE);
61
+ if (!unticked) return null;
62
+ const name = field(stateContent, 'Current Phase Name');
63
+ const plan = field(stateContent, 'Current Plan');
64
+ const plans = field(stateContent, 'Total Plans in Phase');
65
+ const status = field(stateContent, 'Status');
66
+ const stoppedAt = field(stateContent, 'Stopped At');
67
+ const lastDesc = field(stateContent, 'Last Activity Description');
68
+ const resume = field(stateContent, 'Resume File');
69
+ const lines = [];
70
+ let position = `- Current phase: ${phase}${name ? ` (${name})` : ''}`;
71
+ if (plan) position += `, plan ${plan}${plans ? ` of ${plans}` : ''}`;
72
+ lines.push(position);
73
+ if (status) lines.push(`- Status: ${status}`);
74
+ if (stoppedAt) lines.push(`- Stopped at: ${stoppedAt}`);
75
+ else if (lastDesc) lines.push(`- Last activity: ${lastDesc}`);
76
+ if (resume) lines.push(`- Resume file: ${resume}`);
77
+ lines.push(`- First unbuilt roadmap phase: Phase ${unticked[1]}`);
78
+ return lines;
79
+ }
80
+
81
+ function readIfExists(p) {
82
+ try { return fs.readFileSync(p, 'utf8'); } catch { return null; }
83
+ }
84
+
85
+ /** The block to add to the compaction prompt for a project, or null. */
86
+ function compactionContext(directory) {
87
+ const rel = planningDirName();
88
+ const dir = path.join(directory, ...rel.split('/'));
89
+ const lines = positionLines(readIfExists(path.join(dir, 'state.md')), readIfExists(path.join(dir, 'roadmap.md')));
90
+ if (!lines) return null;
91
+ const block = [
92
+ 'PAN project state at this compaction — keep it in the summary so the work resumes where it stopped:',
93
+ ...lines,
94
+ `After compaction, re-read ${rel}/state.md and the current phase's plan before the next step: continue the work in flight rather than re-planning finished work.`,
95
+ ].join('\n');
96
+ return block.length > BLOCK_MAX ? block.slice(0, BLOCK_MAX - 1) + '…' : block;
97
+ }
98
+
99
+ async function server(ctx) {
100
+ const directory = (ctx && (ctx.directory || ctx.worktree)) || process.cwd();
101
+ return {
102
+ 'experimental.session.compacting': async (input, output) => {
103
+ try {
104
+ const block = compactionContext(directory);
105
+ if (block && output && Array.isArray(output.context)) output.context.push(block);
106
+ } catch { /* fail open: a compaction without PAN's block beats a broken one */ }
107
+ },
108
+ };
109
+ }
110
+
111
+ module.exports = { id: 'pan-wizard', server };
@@ -8,7 +8,7 @@ Plans execute autonomously. Checkpoints formalize interaction points where human
8
8
  2. **Claude sets up the verification environment** - Start dev servers, seed databases, configure env vars
9
9
  3. **User only does what requires human judgment** - Visual checks, UX evaluation, "does this feel right?"
10
10
  4. **Secrets come from user, automation comes from Claude** - Ask for API keys, then Claude uses them via CLI
11
- 5. **Auto-mode bypasses verification/decision checkpoints** — When `workflow.auto_advance` is true in config: human-verify auto-approves, decision auto-selects first option, human-action still stops (auth gates cannot be automated)
11
+ 5. **Auto-mode bypasses verification checkpoints, and decisions only where the planner named a default** — When `workflow.auto_advance` is true in config: human-verify auto-approves; a decision with `auto_select="<option id>"` takes that option, and a decision without it stops for a human (auto mode never takes an option because it is listed first); human-action still stops (auth gates cannot be automated)
12
12
  </overview>
13
13
 
14
14
  <checkpoint_types>
@@ -105,7 +105,7 @@ Plans execute autonomously. Checkpoints formalize interaction points where human
105
105
 
106
106
  **Structure:**
107
107
  ```xml
108
- <task type="checkpoint:decision" gate="blocking">
108
+ <task type="checkpoint:decision" gate="blocking" auto_select="option-a">
109
109
  <decision>[What's being decided]</decision>
110
110
  <context>[Why this decision matters]</context>
111
111
  <options>
@@ -124,6 +124,8 @@ Plans execute autonomously. Checkpoints formalize interaction points where human
124
124
  </task>
125
125
  ```
126
126
 
127
+ **`auto_select` (optional)** names the option auto mode takes. Set it only when the choice is safe to make without the user: reversible, no new paid service, no credential, no data-model lock-in. It must name an `id` from this checkpoint's options; `verify plan-structure` fails one that names no option. Leave it out when a human must choose, and auto mode stops at this checkpoint. The examples below omit it: picking a vendor or a database is the user's call.
128
+
127
129
  **Example: Auth Provider Selection**
128
130
  ```xml
129
131
  <task type="checkpoint:decision" gate="blocking">
@@ -297,7 +299,7 @@ How to verify:
297
299
  4. Mobile (375px): Sidebar hidden, hamburger menu appears
298
300
 
299
301
  ────────────────────────────────────────────────────────
300
- → YOUR ACTION: Type "approved" or describe issues
302
+ → Type "approved" or describe issues
301
303
  ────────────────────────────────────────────────────────
302
304
  ```
303
305
 
@@ -328,7 +330,7 @@ Options:
328
330
  Cons: More setup work, DIY security updates
329
331
 
330
332
  ────────────────────────────────────────────────────────
331
- → YOUR ACTION: Select supabase, clerk, or nextauth
333
+ → Select: supabase / clerk / nextauth
332
334
  ────────────────────────────────────────────────────────
333
335
  ```
334
336
 
@@ -352,7 +354,7 @@ What you need to do:
352
354
  I'll verify: vercel whoami returns your account
353
355
 
354
356
  ────────────────────────────────────────────────────────
355
- → YOUR ACTION: Type "done" when authenticated
357
+ → Type "done" when authenticated
356
358
  ────────────────────────────────────────────────────────
357
359
  ```
358
360
  </execution_protocol>
@@ -191,7 +191,7 @@ Extract: `**Phase 2: Authentication** — JWT login flow with refresh tokens`
191
191
 
192
192
  ```markdown
193
193
  Plans:
194
- - [ ] 02-03: Add refresh token rotation
194
+ - [ ] 02-03-plan.md — Add refresh token rotation
195
195
  ```
196
196
 
197
197
  Or from plan.md `<objective>`:
@@ -240,10 +240,10 @@ Sounds like an afterthought. Use "Also available:" instead.
240
240
 
241
241
  ### Don't: Fenced code blocks for commands
242
242
 
243
- ```
243
+ ~~~
244
244
  ```
245
245
  /pan:plan-phase 3
246
246
  ```
247
- ```
247
+ ~~~
248
248
 
249
249
  Fenced blocks inside templates create nesting ambiguity. Use inline backticks instead.
@@ -32,9 +32,8 @@ With existing decimals:
32
32
  ## Extract Values
33
33
 
34
34
  ```bash
35
- DECIMAL_INFO=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phase next-decimal "${AFTER_PHASE}")
36
- DECIMAL_PHASE=$(echo "$DECIMAL_INFO" | jq -r '.next')
37
- BASE_PHASE=$(echo "$DECIMAL_INFO" | jq -r '.base_phase')
35
+ DECIMAL_PHASE=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs phase next-decimal "${AFTER_PHASE}" --raw)
36
+ BASE_PHASE="${DECIMAL_PHASE%.*}"
38
37
  ```
39
38
 
40
39
  Or with --raw flag:
@@ -2,7 +2,7 @@
2
2
 
3
3
  Single source of truth for how PAN designs a change **before** it is planned or
4
4
  executed. Cited by `pan-designer` (main flow, via `/pan:design-phase`) and by
5
- `focus-design` (the `/featureAI` feature pipeline). Both flows use the *same*
5
+ `/pan:focus-design` (the feature investigation and design pipeline). Both flows use the *same*
6
6
  method at different **depth tiers** so design quality can't drift between them.
7
7
 
8
8
  This reference defines: the depth tiers, what each tier must produce, and the
@@ -13,9 +13,9 @@ The git log should read like a changelog of what shipped, not a diary of plannin
13
13
 
14
14
  | Event | Commit? | Why |
15
15
  | ----------------------- | ------- | ------------------------------------------------ |
16
- | BRIEF + ROADMAP created | YES | Project initialization |
17
- | plan.md created | NO | Intermediate - commit with plan completion |
18
- | research.md created | NO | Intermediate |
16
+ | project.md + roadmap.md created | YES | Project initialization |
17
+ | plan.md created | YES | pan-planner: `docs({phase}): create phase plan` |
18
+ | research.md created | OPTIONAL | phase researcher: `docs({phase}): research phase domain` |
19
19
  | discovery.md created | NO | Intermediate |
20
20
  | **Task completed** | YES | Atomic unit of work (1 commit per task) |
21
21
  | **Plan completed** | YES | Metadata commit (SUMMARY + STATE + ROADMAP) |
@@ -40,7 +40,7 @@ If NO_GIT: Run `git init` silently. PAN projects always get their own repo.
40
40
  ```
41
41
  docs: initialize [project-name] ([N] phases)
42
42
 
43
- [One-liner from PROJECT.md]
43
+ [One-liner from project.md]
44
44
 
45
45
  Phases:
46
46
  1. [phase-name]: [goal]
@@ -205,8 +205,6 @@ Each plan produces 2-4 commits (tasks + metadata). Clear, granular, bisectable.
205
205
  <anti_patterns>
206
206
 
207
207
  **Still don't commit (intermediate artifacts):**
208
- - plan.md creation (commit with plan completion)
209
- - research.md (intermediate)
210
208
  - discovery.md (intermediate)
211
209
  - Minor planning tweaks
212
210
  - "Fixed typo in roadmap"
@@ -28,8 +28,8 @@ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs commit "" --files .planning/cod
28
28
  | execute-phase | phase | `docs(phase-03): complete authentication phase` |
29
29
  | new-milestone | milestone | `docs: start milestone v1.1` |
30
30
  | remove-phase | chore | `chore: remove phase 17 (dashboard)` |
31
- | insert-phase | phase | `docs: insert phase 16.1 (critical fix)` |
32
- | add-phase | phase | `docs: add phase 07 (settings page)` |
31
+ | insert-phase | — | no commit (the user decides when to commit) |
32
+ | add-phase | — | no commit |
33
33
 
34
34
  ## When to Skip
35
35
 
@@ -9,8 +9,8 @@ phase — context compaction may have dropped earlier sections.
9
9
 
10
10
  | Shortcut | Why it fails | Correct action |
11
11
  |----------|--------------|----------------|
12
- | "User's request is clear, no need to clarify" | You're guessing at intent. Phase 0 catches misunderstandings before scaffolding. | Run the Phase 0 4-question check (see `new-project.md` / `plan-phase.md`). |
13
- | "Phase tests passed locally, /pan:verify-phase isn't needed" | One run isn't validation. verify-phase checks state consistency, doc sync, blockers, and the full suite — not just the phase's own tests. | Always run `/pan:verify-phase` before marking a phase complete. |
12
+ | "User's request is clear, no need to clarify" | You're guessing at intent. Phase 0 catches misunderstandings before scaffolding. | Run the Phase 0 clarification check (see `new-project.md` / `plan-phase.md`). |
13
+ | "Phase tests passed locally, /pan:verify-phase isn't needed" | One run isn't validation. verify-phase checks the phase goal against the code (must-haves, artifacts, wiring, requirements, anti-patterns) and runs the full test suite — not just the phase's own tests. | Always run `/pan:verify-phase` before marking a phase complete. |
14
14
  | "I'll skip /pan:focus-scan and pick the next item myself" | Manual selection ignores priority/budget logic in `focus.cjs`. You'll bias toward easy items and miss higher-priority work. | Use `/pan:focus-scan` → `/pan:focus-plan` → `/pan:focus-exec`. |
15
15
  | "I'll bump the model / add a flag / refactor while I'm here" | Scope creep. The user asked for one change; surrounding cleanup belongs in a separate item. | Do only the requested change. Note unrelated cleanup as a TODO for a future focus-scan. |
16
16
  | "I'll mark this phase complete; the docs can lag behind" | Doc/state drift compounds. By the next session, the agent reads stale docs and proceeds on false assumptions. | Run the doc-sync step (update CHANGELOG/state and commit via `pan-tools commit`) before phase completion. CHANGELOG and version bumps are part of the phase, not after it. |
@@ -55,7 +55,7 @@ No decisions worth documenting — plan is mechanical implementation of must_hav
55
55
  - **Open** — Choices left to the executor's judgment, but bounded.
56
56
  The planner names the decision space and the constraints; the
57
57
  executor picks within them. The executor should log which option
58
- they took in the summary's `Decisions Taken`.
58
+ they took in the summary's `Implementation Decisions` → `Taken` bucket (DT-N).
59
59
  Example: "Hashing algorithm: bcrypt | argon2 | scrypt. Constraint:
60
60
  zero-deps Node builtin. Reason left open: equivalent for this use case."
61
61
 
@@ -74,7 +74,7 @@ No decisions worth documenting — plan is mechanical implementation of must_hav
74
74
 
75
75
  ## Schema — `## Implementation Decisions` (executor → verifier handoff)
76
76
 
77
- Lives in `summary.md`, after `## Files Changed`:
77
+ Lives in `summary.md`, after `## Files Created/Modified`:
78
78
 
79
79
  ```markdown
80
80
  ## Implementation Decisions
@@ -152,5 +152,5 @@ that field default to v1.
152
152
 
153
153
  - Cognition, "Don't Build Multi-Agents" (Jun 2025): https://cognition.ai/blog/dont-build-multi-agents
154
154
  - Anthropic, "How we built our multi-agent research system": https://www.anthropic.com/engineering/multi-agent-research-system
155
- - Internal: `pan-wizard-core/learnings/internal/external-research.md` P-RES-003
155
+ - Internal: P-RES-003 (PAN's source-only internal learnings)
156
156
  - Spec: this reference doc IS the spec; no separate doc.
@@ -5,7 +5,7 @@ Resolve model profile once at the start of orchestration, then use it for all Ta
5
5
  ## Resolution Pattern
6
6
 
7
7
  ```bash
8
- MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
8
+ MODEL_PROFILE=$(cat .planning/config.json 2>/dev/null | grep -o '"model_profile"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"'); MODEL_PROFILE=${MODEL_PROFILE:-balanced}
9
9
  ```
10
10
 
11
11
  Default: `balanced` if not set or config missing.
@@ -14,13 +14,13 @@ Default: `balanced` if not set or config missing.
14
14
 
15
15
  @~/.claude/pan-wizard-core/references/model-profiles.md
16
16
 
17
- Look up the agent in the table for the resolved profile. Pass the model parameter to Task calls:
17
+ Prefer the `*_model` fields your workflow's `init` call returns, or `pan-tools resolve-model <agent> --raw`: both apply `model_overrides` and the provider mapping, which a table lookup skips. A phase's `<!-- model_tier: … -->` pin applies only when the phase is passed: `resolve-model <agent> --metadata '{"phaseNum":"N"}' --raw`. `routing.strategy: complexity` applies to any `--metadata`, and scores only its `fileCount`, `waveCount`, `requirementCount` and `isArchitectural`: metadata without them, a bare `phaseNum` included, scores as a simple task and drops the agent one tier (an agent already on the fast tier stays there). Otherwise look up the agent in the table for the resolved profile. Pass the model parameter to Task calls:
18
18
 
19
19
  ```
20
20
  Task(
21
21
  prompt="...",
22
22
  subagent_type="pan-planner",
23
- model="{resolved_model}" # "inherit", "sonnet", or "haiku"
23
+ model="{resolved_model}" # "inherit" for the reasoning tier, otherwise the provider's model name ("sonnet"/"haiku" on Anthropic)
24
24
  )
25
25
  ```
26
26
 
@@ -30,5 +30,5 @@ Task(
30
30
 
31
31
  1. Resolve once at orchestration start
32
32
  2. Store the profile value
33
- 3. Look up each agent's model from the table when spawning
34
- 4. Pass model parameter to each Task call (values: `"inherit"`, `"sonnet"`, `"haiku"`)
33
+ 3. Take each agent's model from the init `*_model` field or `resolve-model` (the table only when neither is available)
34
+ 4. Pass that value to each Task call as is
@@ -105,10 +105,13 @@ Use `/pan:profile <profile>` to see estimated cost differences before switching.
105
105
  Model resolution follows this priority chain:
106
106
 
107
107
  ```
108
- 1. Per-agent override (model_overrides in config.json) ← highest priority
109
- 2. Per-phase override (<!-- model_tier: X --> in roadmap)
110
- 3. Complexity routing (if strategy = "complexity")
111
- 4. Profile lookup (MODEL_PROFILES[agent][profile]) ← lowest priority
108
+ 1. Per-agent override (model_overrides in config.json) ← highest priority; used as-is
109
+ 2. Per-phase override (<!-- model_tier: X --> in roadmap) ← used as-is
110
+ 3. Profile lookup (MODEL_PROFILES[agent][profile]) ← the base tier
111
+ 4. Complexity routing (if strategy = "complexity") ← moves that tier ±1
112
+ 5. Capability hints (context_estimate / needs_thinking / cache_warm)
113
+ 6. Failure escalation (attempt > 1, capped by routing.max_escalations)
114
+ 7. Provider resolution (tier → model id)
112
115
  ```
113
116
 
114
117
  ### Provider Detection
@@ -117,8 +120,9 @@ PAN auto-detects the LLM provider to map tiers to the right model names:
117
120
 
118
121
  1. **Explicit config** — `routing.provider` in config.json (if not `"auto"`)
119
122
  2. **Environment variable** — `PAN_PROVIDER` env var
120
- 3. **Runtime directory** — `.claude/` → Anthropic, `.codex/` → OpenAI, `.gemini/` → Google, `.opencode/` → OpenAI, `.github/` → default (first match wins)
121
- 4. **Fallback** — Default provider map (Anthropic-style names)
123
+ 3. **OpenCode's configured model** — on an OpenCode install, the provider prefix (anthropic, openai or google) of `model` in `opencode.json` or `.opencode/opencode.json`
124
+ 4. **Runtime directory** — `.claude/` → Anthropic, `.codex/` → OpenAI, `.gemini/` → Google, `.opencode/` → OpenAI, `.github/` → default (first match wins)
125
+ 5. **Fallback** — Default provider map (Anthropic-style names)
122
126
 
123
127
  ---
124
128
 
@@ -136,7 +140,7 @@ Set in `.planning/config.json` under the `routing` section:
136
140
  }
137
141
  ```
138
142
 
139
- Every agent always gets the tier assigned by its profile. Predictable and simple.
143
+ Every agent gets the tier its profile assigns, with no complexity scoring; only capability hints and failure escalation (steps 5–6 above) can still move it, when the caller passes them. Predictable and simple.
140
144
 
141
145
  ### Complexity
142
146
 
@@ -232,6 +236,7 @@ Full routing config in `.planning/config.json`:
232
236
  | `routing.cascade_quality_gate` | `true`, `false` | `true` | Reserved for future cascade routing |
233
237
  | `routing.complexity_thresholds.downgrade_max` | number | `2` | Max complexity score to downgrade tier |
234
238
  | `routing.complexity_thresholds.upgrade_min` | number | `6` | Min complexity score to upgrade tier |
239
+ | `routing.max_escalations` | integer | `1` | How many tiers a retry may climb (failure escalation) |
235
240
 
236
241
  ---
237
242
 
@@ -243,12 +248,12 @@ Runtime: `/pan:profile <profile>`
243
248
 
244
249
  | Direction | Example | Behavior |
245
250
  |-----------|---------|----------|
246
- | Downgrade | quality → balanced | Confirmation required |
251
+ | Same tier | quality → balanced | Proceeds silently (both resolve every agent to the reasoning tier) |
247
252
  | Downgrade | balanced → budget | Confirmation required |
248
253
  | Upgrade | budget → balanced | Proceeds silently |
249
254
  | Same | balanced → balanced | Proceeds silently |
250
255
 
251
- **Tier Order:** `quality` (3) > `balanced` (2) > `budget` (1)
256
+ **Tier Order:** `quality` = `balanced` (2) > `budget` (1)
252
257
 
253
258
  ---
254
259
 
@@ -19,11 +19,11 @@ PHASE_INFO=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs find-phase "${PHAS
19
19
 
20
20
  Returns JSON with:
21
21
  - `found`: true/false
22
- - `directory`: Full path to phase directory
22
+ - `directory`: Phase directory, relative to the project root (e.g., ".planning/phases/06-foundation")
23
23
  - `phase_number`: Normalized number (e.g., "06", "06.1")
24
24
  - `phase_name`: Name portion (e.g., "foundation")
25
- - `plans`: Array of PLAN.md files
26
- - `summaries`: Array of SUMMARY.md files
25
+ - `plans`: Array of plan file names (e.g., "06-01-plan.md")
26
+ - `summaries`: Array of summary file names (e.g., "06-01-summary.md")
27
27
 
28
28
  ## Manual Normalization (Legacy)
29
29
 
@@ -33,10 +33,10 @@ Zero-pad integer phases to 2 digits. Preserve decimal suffixes.
33
33
  # Normalize phase number
34
34
  if [[ "$PHASE" =~ ^[0-9]+$ ]]; then
35
35
  # Integer: 8 → 08
36
- PHASE=$(printf "%02d" "$PHASE")
36
+ PHASE=$(printf "%02d" "$((10#$PHASE))")
37
37
  elif [[ "$PHASE" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
38
38
  # Decimal: 2.1 → 02.1
39
- PHASE=$(printf "%02d.%s" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}")
39
+ PHASE=$(printf "%02d.%s" "$((10#${BASH_REMATCH[1]}))" "${BASH_REMATCH[2]}")
40
40
  fi
41
41
  ```
42
42
 
@@ -45,8 +45,8 @@ fi
45
45
  Use `roadmap get-phase` to validate phase exists:
46
46
 
47
47
  ```bash
48
- PHASE_CHECK=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${PHASE}")
49
- if [ "$(echo "$PHASE_CHECK" | jq -r '.found')" = "false" ]; then
48
+ PHASE_SECTION=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${PHASE}" --raw) # empty when the phase is not in the roadmap
49
+ if [ -z "$PHASE_SECTION" ]; then
50
50
  echo "ERROR: Phase ${PHASE} not found in roadmap"
51
51
  exit 1
52
52
  fi
@@ -14,7 +14,7 @@ Configuration options for `.planning/` directory behavior.
14
14
  | Option | Default | Description |
15
15
  |--------|---------|-------------|
16
16
  | `commit_docs` | `true` | Whether to commit planning artifacts to git |
17
- | `search_gitignored` | `false` | Add `--no-ignore` to broad rg searches |
17
+ | `search_gitignored` | `false` | Reserved — no workflow or agent acts on it; to include `.planning/` in a broad rg search, add `--no-ignore` yourself |
18
18
  | `branching_strategy` | `"none"` | Git branching approach: `"none"`, `"phase"`, or `"milestone"` |
19
19
  | `phase_branch_template` | `"pan/phase-{phase}-{slug}"` | Branch template for phase strategy |
20
20
  | `milestone_branch_template` | `"pan/{milestone}-{slug}"` | Branch template for milestone strategy |
@@ -49,7 +49,7 @@ INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init execute-phase "1")
49
49
  # commit_docs is included in all init command outputs
50
50
  ```
51
51
 
52
- **Auto-detection:** If `.planning/` is gitignored, `commit_docs` is automatically `false` regardless of config.json. This prevents git errors when users have `.planning/` in `.gitignore`.
52
+ **Gitignored planning tree:** if `.planning/` is gitignored, `pan-tools commit` and `phase complete` skip their commit (`commit` reports `reason: skipped_gitignored`, exit 0) whatever `commit_docs` says; `commit_docs` itself still reads as configured, and `/pan:health` reports the mismatch as I005.
53
53
 
54
54
  **Commit via CLI (handles checks automatically):**
55
55
 
@@ -68,8 +68,8 @@ The CLI checks `commit_docs` config and gitignore status internally — no manua
68
68
  - Direct path searches work: `rg "pattern" .planning/` finds files
69
69
  - Broad searches skip gitignored: `rg "pattern"` skips `.planning/`
70
70
 
71
- **When `search_gitignored: true`:**
72
- - Add `--no-ignore` to broad rg searches that should include `.planning/`
71
+ **When `search_gitignored: true`:** nothing changes — no workflow or agent reads the setting.
72
+ - To include `.planning/` in a broad rg search, add `--no-ignore` to that `rg` call yourself
73
73
  - Only needed when searching entire repo and expecting `.planning/` matches
74
74
 
75
75
  **Note:** Most PAN operations use direct file reads or explicit paths, which work regardless of gitignore status.
@@ -41,6 +41,15 @@ Each TDD plan implements **one feature** through the full RED-GREEN-REFACTOR cyc
41
41
  phase: XX-name
42
42
  plan: NN
43
43
  type: tdd
44
+ wave: N
45
+ depends_on: []
46
+ files_modified: []
47
+ autonomous: true
48
+ requirements: []
49
+ must_haves:
50
+ truths: []
51
+ artifacts: []
52
+ key_links: []
44
53
  ---
45
54
 
46
55
  <objective>
@@ -51,7 +60,7 @@ Output: [Working, tested feature]
51
60
 
52
61
  <context>
53
62
  @.planning/project.md
54
- @.planning/roadmap.md
63
+ @.planning/phases/XX-name/{phase}-roadmap-slice.md
55
64
  @relevant/source/files.ts
56
65
  </context>
57
66
 
@@ -26,6 +26,7 @@ A judging agent ends its report with one fenced `pan-verdict` block. The block i
26
26
  | `verdict` | yes | your own verdict word (table below) |
27
27
  | `outcome` | yes | `pass`, `fail` or `needs_human` |
28
28
  | `findings` | yes (may be empty) | a list of `{class, severity, where, summary}` |
29
+ | `not_checked` | when a check could not run | a list of `{check, reason}`: a check you were asked to make and could not run, and why (no test script, no browser, a file you could not read). Never fold it into `pass`: a verdict with entries here says what it did not see |
29
30
 
30
31
  | Agent | `verdict` → `outcome` |
31
32
  |---|---|
@@ -33,7 +34,7 @@ A judging agent ends its report with one fenced `pan-verdict` block. The block i
33
34
  | pan-reviewer | `PASS` → `pass` · `PASS_WITH_WARNINGS` → `pass` · `NEEDS_FIXES` → `fail` |
34
35
  | pan-design-checker | `PASS` → `pass` · `GAPS` → `fail` |
35
36
 
36
- The verifier does not emit this block. Its verification.md frontmatter (`status`, `gaps`, `human_verification`, `unrequested`) is its machine contract, and the recorder reads that directly.
37
+ The verifier does not emit this block. Its verification.md frontmatter (`status`, `gaps`, `human_verification`, `unrequested`, `test_gate`, `not_checked`) is its machine contract, and the recorder reads that directly. `test_gate` is `passed`, `failed` or `skipped`. A skipped gate is recorded as a `tests` entry in `not_checked` even when the list leaves it out, and a verification that does not record `test_gate` at all is recorded with a `test_gate_unrecorded` warning.
37
38
 
38
39
  ## `class`: what kind of finding
39
40
 
@@ -316,7 +316,7 @@ grep -E "^$VAR_NAME=" .env .env.local 2>/dev/null
316
316
  **Substantive check:**
317
317
  ```bash
318
318
  # Variable has actual value (not placeholder)
319
- grep -E "^$VAR_NAME=.+" .env .env.local 2>/dev/null | grep -v "your-.*-here|xxx|placeholder|TODO" -i
319
+ grep -E "^$VAR_NAME=.+" .env .env.local 2>/dev/null | grep -viE "your-.*-here|xxx|placeholder|TODO"
320
320
 
321
321
  # Value looks valid for type:
322
322
  # - URLs should start with http
@@ -336,7 +336,7 @@ NEXT_PUBLIC_API_URL=http://localhost:3000 # Still pointing to localhost in prod
336
336
  **Wiring check:**
337
337
  ```bash
338
338
  # Variable is actually used in code
339
- grep -r "process\.env\.$VAR_NAME|env\.$VAR_NAME" src/ --include="*.ts" --include="*.tsx"
339
+ grep -rE "process\.env\.$VAR_NAME|env\.$VAR_NAME" src/ --include="*.ts" --include="*.tsx"
340
340
 
341
341
  # Variable is in validation schema (if using zod/etc for env)
342
342
  grep -E "$VAR_NAME" src/env.ts src/env.mjs 2>/dev/null
@@ -530,7 +530,7 @@ check_exists() {
530
530
  # 2. Check for stub patterns
531
531
  check_stubs() {
532
532
  local file="$1"
533
- local stubs=$(grep -c -E "TODO|FIXME|placeholder|not implemented" "$file" 2>/dev/null || echo 0)
533
+ local stubs=$(grep -c -E "TODO|FIXME|placeholder|not implemented" "$file" 2>/dev/null); stubs=${stubs:-0}
534
534
  [ "$stubs" -gt 0 ] && echo "STUB_PATTERNS: $stubs in $file"
535
535
  }
536
536
 
@@ -547,7 +547,7 @@ check_substantive() {
547
547
  local min_lines="$2"
548
548
  local pattern="$3"
549
549
  local lines=$(wc -l < "$file" 2>/dev/null || echo 0)
550
- local has_pattern=$(grep -c -E "$pattern" "$file" 2>/dev/null || echo 0)
550
+ local has_pattern=$(grep -c -E "$pattern" "$file" 2>/dev/null); has_pattern=${has_pattern:-0}
551
551
  [ "$lines" -ge "$min_lines" ] && [ "$has_pattern" -gt 0 ] && echo "SUBSTANTIVE: $file" || echo "THIN: $file ($lines lines, $has_pattern matches)"
552
552
  }
553
553
  ```
@@ -652,7 +652,7 @@ Fixture the wrong-shape case explicitly: feed the loader `[]`, `null`, `{}`, and
652
652
 
653
653
  **Implication for the agents:** `pan-plan-checker`, `pan-verifier`, `pan-reviewer`, `pan-meta-reviewer`, `pan-hardener` should each periodically audit their own prose-vs-mechanical check ratio. If a dimension is 100% prose, ask whether the role earns its compute or whether the structural reset (fresh context, forced re-reading of plan/code) is doing the real work.
654
654
 
655
- **Source:** `pan-wizard-core/learnings/internal/external-research.md` P-RES-006 (S2R / RLVR, ACL 2025).
655
+ **Source:** P-RES-006 (S2R / RLVR, ACL 2025), recorded in PAN's source-only internal learnings.
656
656
 
657
657
  ---
658
658
 
@@ -8,7 +8,7 @@ Template for `.planning/codebase/architecture.md` - captures conceptual code org
8
8
 
9
9
  ## File Template
10
10
 
11
- ```markdown
11
+ ~~~markdown
12
12
  # Architecture
13
13
 
14
14
  **Analysis Date:** [YYYY-MM-DD]
@@ -129,7 +129,7 @@ sequenceDiagram
129
129
 
130
130
  *Architecture analysis: [date]*
131
131
  *Update when major patterns change*
132
- ```
132
+ ~~~
133
133
 
134
134
  <good_examples>
135
135
  ```markdown
@@ -8,7 +8,7 @@ Template for `.planning/codebase/best-practices.md` - assesses coding practices
8
8
 
9
9
  ## File Template
10
10
 
11
- ```markdown
11
+ ~~~markdown
12
12
  # Best Practices Assessment
13
13
 
14
14
  **Analysis Date:** [YYYY-MM-DD]
@@ -98,7 +98,7 @@ Top 3 improvements ranked by impact:
98
98
 
99
99
  *Best practices assessment: [date]*
100
100
  *Update after significant codebase changes*
101
- ```
101
+ ~~~
102
102
 
103
103
  <guidelines>
104
104
  **What belongs in best-practices.md:**
@@ -8,7 +8,7 @@ Template for `.planning/codebase/concerns.md` - captures known issues and areas
8
8
 
9
9
  ## File Template
10
10
 
11
- ```markdown
11
+ ~~~markdown
12
12
  # Codebase Concerns
13
13
 
14
14
  **Analysis Date:** [YYYY-MM-DD]
@@ -132,7 +132,7 @@ quadrantChart
132
132
 
133
133
  *Concerns audit: [date]*
134
134
  *Update as issues are fixed or new ones discovered*
135
- ```
135
+ ~~~
136
136
 
137
137
  <good_examples>
138
138
  ```markdown
@@ -321,5 +321,5 @@ quadrantChart
321
321
  - Planning refactoring work
322
322
 
323
323
  **How this gets populated:**
324
- Explore agents detect these during codebase mapping. Manual additions welcome for human-discovered issues. This is living documentation, not a complaint list.
324
+ The `pan-document_code` mapper agents detect these during codebase mapping. Manual additions welcome for human-discovered issues. This is living documentation, not a complaint list.
325
325
  </guidelines>