prizmkit 1.1.100 → 1.1.102

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 (317) hide show
  1. package/bin/create-prizmkit.js +4 -4
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/dev-pipeline/.env.example +3 -3
  4. package/bundled/dev-pipeline/README.md +110 -90
  5. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +1 -1
  6. package/bundled/dev-pipeline/cli.py +27 -0
  7. package/bundled/dev-pipeline/prizmkit_runtime/__init__.py +13 -0
  8. package/bundled/dev-pipeline/prizmkit_runtime/__main__.py +9 -0
  9. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +193 -0
  10. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +313 -0
  11. package/bundled/dev-pipeline/prizmkit_runtime/compat.py +32 -0
  12. package/bundled/dev-pipeline/prizmkit_runtime/config.py +410 -0
  13. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +478 -0
  14. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +734 -0
  15. package/bundled/dev-pipeline/prizmkit_runtime/heartbeat.py +256 -0
  16. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +109 -0
  17. package/bundled/dev-pipeline/prizmkit_runtime/paths.py +110 -0
  18. package/bundled/dev-pipeline/prizmkit_runtime/processes.py +373 -0
  19. package/bundled/dev-pipeline/prizmkit_runtime/reset.py +389 -0
  20. package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +51 -0
  21. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +179 -0
  22. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +355 -0
  23. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +118 -0
  24. package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +187 -0
  25. package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +153 -0
  26. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +425 -0
  27. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +560 -0
  28. package/bundled/dev-pipeline/prizmkit_runtime/status.py +71 -0
  29. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +51 -36
  30. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +20 -5
  31. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +2 -2
  32. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +39 -0
  33. package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +8 -2
  34. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +1 -1
  35. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +6 -2
  36. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +14 -6
  37. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +14 -4
  38. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +14 -4
  39. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +2 -0
  40. package/bundled/dev-pipeline/templates/sections/log-size-awareness.md +9 -30
  41. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +15 -7
  42. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +42 -29
  43. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +41 -39
  44. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +8 -17
  45. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +2 -2
  46. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +1 -3
  47. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +1 -3
  48. package/bundled/dev-pipeline/templates/sections/phase0-test-baseline.md +3 -8
  49. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +6 -2
  50. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +5 -1
  51. package/bundled/dev-pipeline/tests/test_auto_skip.py +436 -14
  52. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +115 -7
  53. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +40 -0
  54. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +1226 -0
  55. package/bundled/dev-pipeline/tests/test_unified_cli.py +1045 -0
  56. package/bundled/skills/_metadata.json +1 -1
  57. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +29 -34
  58. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +6 -5
  59. package/bundled/skills/feature-pipeline-launcher/SKILL.md +29 -35
  60. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +7 -6
  61. package/bundled/skills/feature-workflow/SKILL.md +3 -6
  62. package/bundled/skills/recovery-workflow/SKILL.md +23 -32
  63. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +29 -35
  64. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +7 -6
  65. package/bundled/skills/refactor-workflow/SKILL.md +3 -6
  66. package/bundled/templates/hooks/commit-intent.json +2 -2
  67. package/bundled/templates/hooks/diff-prizm-docs.py +226 -0
  68. package/bundled/templates/hooks/prizm-pre-commit.py +45 -0
  69. package/bundled/templates/hooks/validate-prizm-docs.py +240 -0
  70. package/package.json +1 -1
  71. package/src/config.js +42 -19
  72. package/src/external-skills.js +14 -14
  73. package/src/index.js +3 -6
  74. package/src/manifest.js +11 -5
  75. package/src/metadata.js +7 -18
  76. package/src/platforms.js +25 -0
  77. package/src/prompts.js +0 -12
  78. package/src/runtimes.js +18 -11
  79. package/src/scaffold.js +144 -122
  80. package/src/upgrade.js +12 -3
  81. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +0 -500
  82. package/bundled/dev-pipeline/launch-feature-daemon.sh +0 -657
  83. package/bundled/dev-pipeline/launch-refactor-daemon.sh +0 -502
  84. package/bundled/dev-pipeline/lib/branch.sh +0 -326
  85. package/bundled/dev-pipeline/lib/common.sh +0 -1476
  86. package/bundled/dev-pipeline/lib/heartbeat.sh +0 -469
  87. package/bundled/dev-pipeline/reset-bug.sh +0 -425
  88. package/bundled/dev-pipeline/reset-feature.sh +0 -436
  89. package/bundled/dev-pipeline/reset-refactor.sh +0 -423
  90. package/bundled/dev-pipeline/run-bugfix.sh +0 -1430
  91. package/bundled/dev-pipeline/run-feature.sh +0 -1718
  92. package/bundled/dev-pipeline/run-recovery.sh +0 -648
  93. package/bundled/dev-pipeline/run-refactor.sh +0 -1463
  94. package/bundled/dev-pipeline/tests/test-path-resolution.sh +0 -100
  95. package/bundled/dev-pipeline-windows/.env.example +0 -36
  96. package/bundled/dev-pipeline-windows/README.md +0 -30
  97. package/bundled/dev-pipeline-windows/SCHEMA_ANALYSIS.md +0 -533
  98. package/bundled/dev-pipeline-windows/assets/feature-list-example.json +0 -146
  99. package/bundled/dev-pipeline-windows/assets/prizm-dev-team-integration.md +0 -137
  100. package/bundled/dev-pipeline-windows/launch-bugfix-daemon.ps1 +0 -9
  101. package/bundled/dev-pipeline-windows/launch-feature-daemon.ps1 +0 -9
  102. package/bundled/dev-pipeline-windows/launch-refactor-daemon.ps1 +0 -9
  103. package/bundled/dev-pipeline-windows/lib/branch.ps1 +0 -235
  104. package/bundled/dev-pipeline-windows/lib/common.ps1 +0 -991
  105. package/bundled/dev-pipeline-windows/lib/daemon.ps1 +0 -140
  106. package/bundled/dev-pipeline-windows/lib/pipeline.ps1 +0 -1051
  107. package/bundled/dev-pipeline-windows/lib/reset.ps1 +0 -121
  108. package/bundled/dev-pipeline-windows/reset-bug.ps1 +0 -10
  109. package/bundled/dev-pipeline-windows/reset-feature.ps1 +0 -10
  110. package/bundled/dev-pipeline-windows/reset-refactor.ps1 +0 -10
  111. package/bundled/dev-pipeline-windows/run-bugfix.ps1 +0 -9
  112. package/bundled/dev-pipeline-windows/run-feature.ps1 +0 -9
  113. package/bundled/dev-pipeline-windows/run-recovery.ps1 +0 -179
  114. package/bundled/dev-pipeline-windows/run-refactor.ps1 +0 -9
  115. package/bundled/dev-pipeline-windows/scripts/check-session-status.py +0 -301
  116. package/bundled/dev-pipeline-windows/scripts/continuation.py +0 -374
  117. package/bundled/dev-pipeline-windows/scripts/detect-stuck.py +0 -530
  118. package/bundled/dev-pipeline-windows/scripts/generate-bootstrap-prompt.py +0 -2279
  119. package/bundled/dev-pipeline-windows/scripts/generate-bugfix-prompt.py +0 -763
  120. package/bundled/dev-pipeline-windows/scripts/generate-recovery-prompt.py +0 -805
  121. package/bundled/dev-pipeline-windows/scripts/generate-refactor-prompt.py +0 -841
  122. package/bundled/dev-pipeline-windows/scripts/init-bugfix-pipeline.py +0 -316
  123. package/bundled/dev-pipeline-windows/scripts/init-dev-team.py +0 -134
  124. package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +0 -382
  125. package/bundled/dev-pipeline-windows/scripts/init-refactor-pipeline.py +0 -399
  126. package/bundled/dev-pipeline-windows/scripts/parse-stream-progress.py +0 -1362
  127. package/bundled/dev-pipeline-windows/scripts/patch-completion-notes.py +0 -191
  128. package/bundled/dev-pipeline-windows/scripts/prizmkit-test-gate.py +0 -446
  129. package/bundled/dev-pipeline-windows/scripts/update-bug-status.py +0 -1121
  130. package/bundled/dev-pipeline-windows/scripts/update-checkpoint.py +0 -173
  131. package/bundled/dev-pipeline-windows/scripts/update-feature-status.py +0 -1789
  132. package/bundled/dev-pipeline-windows/scripts/update-refactor-status.py +0 -1327
  133. package/bundled/dev-pipeline-windows/scripts/utils.py +0 -542
  134. package/bundled/dev-pipeline-windows/templates/agent-prompts/critic-plan-challenge.md +0 -7
  135. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-fix.md +0 -7
  136. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-implement.md +0 -65
  137. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-resume.md +0 -5
  138. package/bundled/dev-pipeline-windows/templates/agent-prompts/reviewer-review.md +0 -7
  139. package/bundled/dev-pipeline-windows/templates/bootstrap-prompt.md +0 -73
  140. package/bundled/dev-pipeline-windows/templates/bootstrap-tier1.md +0 -589
  141. package/bundled/dev-pipeline-windows/templates/bootstrap-tier2.md +0 -710
  142. package/bundled/dev-pipeline-windows/templates/bootstrap-tier3.md +0 -791
  143. package/bundled/dev-pipeline-windows/templates/bug-fix-list-schema.json +0 -263
  144. package/bundled/dev-pipeline-windows/templates/bugfix-bootstrap-prompt.md +0 -326
  145. package/bundled/dev-pipeline-windows/templates/feature-list-schema.json +0 -237
  146. package/bundled/dev-pipeline-windows/templates/refactor-bootstrap-prompt.md +0 -340
  147. package/bundled/dev-pipeline-windows/templates/refactor-list-schema.json +0 -270
  148. package/bundled/dev-pipeline-windows/templates/sections/ac-verification-checklist.md +0 -7
  149. package/bundled/dev-pipeline-windows/templates/sections/checkpoint-system.md +0 -91
  150. package/bundled/dev-pipeline-windows/templates/sections/context-budget-rules.md +0 -34
  151. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-agent.md +0 -10
  152. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-full.md +0 -12
  153. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-lite.md +0 -7
  154. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-agent.md +0 -8
  155. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-full.md +0 -9
  156. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-lite.md +0 -6
  157. package/bundled/dev-pipeline-windows/templates/sections/failure-capture.md +0 -21
  158. package/bundled/dev-pipeline-windows/templates/sections/feature-context.md +0 -21
  159. package/bundled/dev-pipeline-windows/templates/sections/log-size-awareness.md +0 -41
  160. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-auto.md +0 -283
  161. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-opencli.md +0 -112
  162. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification.md +0 -168
  163. package/bundled/dev-pipeline-windows/templates/sections/phase-commit-full.md +0 -82
  164. package/bundled/dev-pipeline-windows/templates/sections/phase-commit.md +0 -75
  165. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-agent-suffix.md +0 -23
  166. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-base.md +0 -14
  167. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-lite-suffix.md +0 -19
  168. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan-full.md +0 -63
  169. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan.md +0 -42
  170. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-agent.md +0 -44
  171. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-full.md +0 -59
  172. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-lite.md +0 -39
  173. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-agent.md +0 -27
  174. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-lite.md +0 -27
  175. package/bundled/dev-pipeline-windows/templates/sections/phase-prizmkit-test.md +0 -39
  176. package/bundled/dev-pipeline-windows/templates/sections/phase-review-agent.md +0 -35
  177. package/bundled/dev-pipeline-windows/templates/sections/phase-review-full.md +0 -35
  178. package/bundled/dev-pipeline-windows/templates/sections/phase-specify-plan-full.md +0 -73
  179. package/bundled/dev-pipeline-windows/templates/sections/phase0-init.md +0 -13
  180. package/bundled/dev-pipeline-windows/templates/sections/phase0-test-baseline.md +0 -21
  181. package/bundled/dev-pipeline-windows/templates/sections/session-context.md +0 -5
  182. package/bundled/dev-pipeline-windows/templates/sections/subagent-timeout-recovery.md +0 -6
  183. package/bundled/dev-pipeline-windows/templates/sections/task-contract.md +0 -34
  184. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-agent.md +0 -48
  185. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-lite.md +0 -48
  186. package/bundled/dev-pipeline-windows/templates/session-status-schema.json +0 -83
  187. package/bundled/skills-windows/app-planner/SKILL.md +0 -296
  188. package/bundled/skills-windows/app-planner/assets/app-design-guide.md +0 -101
  189. package/bundled/skills-windows/app-planner/references/architecture-decisions.md +0 -52
  190. package/bundled/skills-windows/app-planner/references/brainstorm-guide.md +0 -101
  191. package/bundled/skills-windows/app-planner/references/frontend-design-guide.md +0 -71
  192. package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +0 -108
  193. package/bundled/skills-windows/app-planner/references/project-brief-guide.md +0 -82
  194. package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +0 -59
  195. package/bundled/skills-windows/app-planner/references/project-state-detection.md +0 -90
  196. package/bundled/skills-windows/app-planner/references/red-team-checklist.md +0 -40
  197. package/bundled/skills-windows/app-planner/references/rules/backend/derivation-rules.md +0 -619
  198. package/bundled/skills-windows/app-planner/references/rules/backend/fixed-rules.md +0 -285
  199. package/bundled/skills-windows/app-planner/references/rules/backend/question-bank.md +0 -249
  200. package/bundled/skills-windows/app-planner/references/rules/backend/question-manifest.json +0 -46
  201. package/bundled/skills-windows/app-planner/references/rules/backend/template.md +0 -173
  202. package/bundled/skills-windows/app-planner/references/rules/database/derivation-rules.md +0 -382
  203. package/bundled/skills-windows/app-planner/references/rules/database/fixed-rules.md +0 -211
  204. package/bundled/skills-windows/app-planner/references/rules/database/question-bank.md +0 -184
  205. package/bundled/skills-windows/app-planner/references/rules/database/question-manifest.json +0 -39
  206. package/bundled/skills-windows/app-planner/references/rules/database/template.md +0 -158
  207. package/bundled/skills-windows/app-planner/references/rules/frontend/derivation-rules.md +0 -820
  208. package/bundled/skills-windows/app-planner/references/rules/frontend/fixed-rules.md +0 -188
  209. package/bundled/skills-windows/app-planner/references/rules/frontend/question-bank.md +0 -319
  210. package/bundled/skills-windows/app-planner/references/rules/frontend/question-manifest.json +0 -51
  211. package/bundled/skills-windows/app-planner/references/rules/frontend/template.md +0 -339
  212. package/bundled/skills-windows/app-planner/references/rules/mobile/derivation-rules.md +0 -649
  213. package/bundled/skills-windows/app-planner/references/rules/mobile/fixed-rules.md +0 -290
  214. package/bundled/skills-windows/app-planner/references/rules/mobile/question-bank.md +0 -232
  215. package/bundled/skills-windows/app-planner/references/rules/mobile/question-manifest.json +0 -47
  216. package/bundled/skills-windows/app-planner/references/rules/mobile/template.md +0 -175
  217. package/bundled/skills-windows/app-planner/references/rules-configuration.md +0 -46
  218. package/bundled/skills-windows/bug-fix-workflow/SKILL.md +0 -379
  219. package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +0 -41
  220. package/bundled/skills-windows/bug-planner/SKILL.md +0 -402
  221. package/bundled/skills-windows/bug-planner/assets/bug-confirmation-template.md +0 -43
  222. package/bundled/skills-windows/bug-planner/references/critic-and-verification.md +0 -44
  223. package/bundled/skills-windows/bug-planner/references/error-recovery.md +0 -73
  224. package/bundled/skills-windows/bug-planner/references/input-formats.md +0 -53
  225. package/bundled/skills-windows/bug-planner/references/schema-validation.md +0 -25
  226. package/bundled/skills-windows/bug-planner/references/severity-rules.md +0 -16
  227. package/bundled/skills-windows/bug-planner/scripts/validate-bug-list.py +0 -322
  228. package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +0 -304
  229. package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +0 -84
  230. package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +0 -381
  231. package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +0 -67
  232. package/bundled/skills-windows/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
  233. package/bundled/skills-windows/feature-planner/SKILL.md +0 -397
  234. package/bundled/skills-windows/feature-planner/assets/evaluation-guide.md +0 -64
  235. package/bundled/skills-windows/feature-planner/assets/planning-guide.md +0 -214
  236. package/bundled/skills-windows/feature-planner/references/browser-interaction.md +0 -59
  237. package/bundled/skills-windows/feature-planner/references/completeness-review.md +0 -57
  238. package/bundled/skills-windows/feature-planner/references/decomposition-patterns.md +0 -75
  239. package/bundled/skills-windows/feature-planner/references/error-recovery.md +0 -90
  240. package/bundled/skills-windows/feature-planner/references/incremental-feature-planning.md +0 -112
  241. package/bundled/skills-windows/feature-planner/references/new-project-planning.md +0 -85
  242. package/bundled/skills-windows/feature-planner/scripts/validate-and-generate.py +0 -1020
  243. package/bundled/skills-windows/feature-workflow/SKILL.md +0 -374
  244. package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +0 -137
  245. package/bundled/skills-windows/prizm-kit/SKILL.md +0 -93
  246. package/bundled/skills-windows/prizmkit-code-review/SKILL.md +0 -161
  247. package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +0 -30
  248. package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +0 -31
  249. package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +0 -66
  250. package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +0 -186
  251. package/bundled/skills-windows/prizmkit-committer/SKILL.md +0 -89
  252. package/bundled/skills-windows/prizmkit-deploy/SKILL.md +0 -444
  253. package/bundled/skills-windows/prizmkit-deploy/references/ci-cd-workflows.md +0 -115
  254. package/bundled/skills-windows/prizmkit-deploy/references/cloud-platform-deploy.md +0 -93
  255. package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +0 -120
  256. package/bundled/skills-windows/prizmkit-deploy/references/database-setup.md +0 -46
  257. package/bundled/skills-windows/prizmkit-deploy/references/deploy-config-schema.md +0 -148
  258. package/bundled/skills-windows/prizmkit-deploy/references/deploy-history-schema.md +0 -62
  259. package/bundled/skills-windows/prizmkit-deploy/references/deployment-modes.md +0 -50
  260. package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +0 -26
  261. package/bundled/skills-windows/prizmkit-deploy/references/dns-setup.md +0 -42
  262. package/bundled/skills-windows/prizmkit-deploy/references/docker-deploy.md +0 -31
  263. package/bundled/skills-windows/prizmkit-deploy/references/firewall-setup.md +0 -37
  264. package/bundled/skills-windows/prizmkit-deploy/references/live-validation-notes.md +0 -21
  265. package/bundled/skills-windows/prizmkit-deploy/references/nginx-blue-green.md +0 -59
  266. package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
  267. package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
  268. package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +0 -20
  269. package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +0 -56
  270. package/bundled/skills-windows/prizmkit-implement/SKILL.md +0 -71
  271. package/bundled/skills-windows/prizmkit-init/SKILL.md +0 -356
  272. package/bundled/skills-windows/prizmkit-init/assets/project-brief-template.md +0 -82
  273. package/bundled/skills-windows/prizmkit-init/references/config-schema.md +0 -70
  274. package/bundled/skills-windows/prizmkit-init/references/rules/layer-detection.md +0 -41
  275. package/bundled/skills-windows/prizmkit-init/references/tech-stack-catalog.md +0 -13
  276. package/bundled/skills-windows/prizmkit-init/references/update-supplement.md +0 -9
  277. package/bundled/skills-windows/prizmkit-plan/SKILL.md +0 -102
  278. package/bundled/skills-windows/prizmkit-plan/assets/plan-template.md +0 -115
  279. package/bundled/skills-windows/prizmkit-plan/assets/spec-template.md +0 -73
  280. package/bundled/skills-windows/prizmkit-plan/references/clarify-guide.md +0 -67
  281. package/bundled/skills-windows/prizmkit-plan/references/examples.md +0 -85
  282. package/bundled/skills-windows/prizmkit-plan/references/verification-checklist.md +0 -60
  283. package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +0 -129
  284. package/bundled/skills-windows/prizmkit-prizm-docs/assets/prizm-docs-format.md +0 -613
  285. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-init.md +0 -45
  286. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-rebuild.md +0 -15
  287. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-status.md +0 -14
  288. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-update.md +0 -19
  289. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-validate.md +0 -17
  290. package/bundled/skills-windows/prizmkit-retrospective/SKILL.md +0 -87
  291. package/bundled/skills-windows/prizmkit-retrospective/references/knowledge-injection-steps.md +0 -50
  292. package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +0 -43
  293. package/bundled/skills-windows/prizmkit-test/SKILL.md +0 -227
  294. package/bundled/skills-windows/prizmkit-test/references/boundary-coverage-protocol.md +0 -220
  295. package/bundled/skills-windows/prizmkit-test/references/examples.md +0 -143
  296. package/bundled/skills-windows/prizmkit-test/references/service-boundary-test-catalog.md +0 -225
  297. package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +0 -109
  298. package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +0 -111
  299. package/bundled/skills-windows/prizmkit-test/scripts/validate_boundary_report.py +0 -347
  300. package/bundled/skills-windows/recovery-workflow/SKILL.md +0 -355
  301. package/bundled/skills-windows/recovery-workflow/evals/evals.json +0 -46
  302. package/bundled/skills-windows/recovery-workflow/references/detection.md +0 -58
  303. package/bundled/skills-windows/recovery-workflow/scripts/detect-recovery-state.py +0 -544
  304. package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +0 -346
  305. package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +0 -72
  306. package/bundled/skills-windows/refactor-planner/SKILL.md +0 -398
  307. package/bundled/skills-windows/refactor-planner/assets/planning-guide.md +0 -292
  308. package/bundled/skills-windows/refactor-planner/references/behavior-preservation.md +0 -301
  309. package/bundled/skills-windows/refactor-planner/references/fast-path.md +0 -59
  310. package/bundled/skills-windows/refactor-planner/references/planning-phases.md +0 -135
  311. package/bundled/skills-windows/refactor-planner/references/refactor-scoping-guide.md +0 -221
  312. package/bundled/skills-windows/refactor-planner/scripts/validate-and-generate-refactor.py +0 -858
  313. package/bundled/skills-windows/refactor-workflow/SKILL.md +0 -343
  314. package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +0 -116
  315. package/bundled/templates/hooks/diff-prizm-docs.sh +0 -158
  316. package/bundled/templates/hooks/prizm-pre-commit.sh +0 -108
  317. package/bundled/templates/hooks/validate-prizm-docs.sh +0 -139
@@ -1,343 +0,0 @@
1
- ---
2
- name: "refactor-workflow"
3
- description: "One-stop entry point for code refactoring. Brainstorms refactoring goals with the user until fully clarified, then orchestrates refactor-planner → refactor-pipeline-launcher → execution. Handles multi-refactor batch development from a single request. Use this skill whenever the user wants to restructure, clean up, or optimize code without changing behavior. Trigger on: 'refactor', 'clean up code', 'restructure', 'optimize code structure', 'extract module', 'code refactoring', 'batch refactor'."
4
- ---
5
-
6
- # Refactor Workflow
7
-
8
- One-stop entry point for code refactoring. Covers the complete journey from a rough refactoring idea to verified, behavior-preserving code changes: deep goal clarification → structured planning → autonomous pipeline execution.
9
-
10
- ## When to Use
11
-
12
- User says:
13
- - "Refactor the auth module", "Clean up this code", "Restructure the payment service"
14
- - "Extract shared logic into a separate module", "Optimize code structure"
15
- - "Batch refactor these modules", "Code refactoring across multiple files"
16
- - Code has accumulated tech debt that needs structural improvement
17
- - Module needs to be split, merged, or reorganized
18
-
19
- **Do NOT use this skill when:**
20
- - User only wants to plan refactoring (use `refactor-planner` directly)
21
- - User only wants to launch pipeline for existing .prizmkit/plans/refactor-list.json (use `refactor-pipeline-launcher`)
22
- - User wants to add features (use `feature-workflow`)
23
- - User wants to fix bugs (use `bug-planner` + `bugfix-pipeline-launcher`)
24
-
25
- ---
26
-
27
- ## Overview
28
-
29
- Four phases take a rough refactoring idea to verified, behavior-preserving code so the user doesn't have to manually chain planner → launcher → monitoring:
30
-
31
- 1. **Brainstorm** — clarify type, collect reference materials, parallel deep read code & docs, discuss plan grounded in real code → fully clarified refactoring goals
32
- 2. **Plan** — call `refactor-planner` → `.prizmkit/plans/refactor-list.json` with N refactor items
33
- 3. **Launch** — call `refactor-pipeline-launcher` → pipeline started (execution mode chosen by user via launcher)
34
- 4. **Monitor** — track progress → status updates, completion report
35
-
36
- ### Branch Management
37
-
38
- The dev-pipeline handles branch management per-refactor automatically:
39
- - Each refactor item is implemented on its own branch by the pipeline
40
- - Branches are created, committed, and managed by the pipeline session
41
- - This workflow does NOT create a top-level branch — the pipeline manages granular per-refactor branches
42
-
43
- ---
44
-
45
- ## Input Modes
46
-
47
- **Mode A: From natural language description** (default)
48
-
49
- Natural language description of the refactoring goals. Can be:
50
- - A module target: "Refactor the auth module — extract shared middleware, simplify the token flow"
51
- - A batch of refactors: "Clean up the payment service, decouple the notification module, and extract common utilities"
52
- - An incremental request: "Also refactor the logging layer to use structured logging"
53
-
54
- Flow: brainstorm → refactor-planner → refactor-pipeline-launcher → monitor
55
-
56
- **Mode B: From existing `.prizmkit/plans/refactor-list.json`** — user says "run pipeline from existing file", or the file already exists. Skip ahead per the [Resume table](#resume--interruption-recovery).
57
-
58
- **Mode C: Incremental (add to existing refactor plan)** — user says "add more refactors". Brainstorm new goals, then invoke `refactor-planner` in incremental mode (appends to existing list) → launch → monitor.
59
-
60
- ---
61
-
62
- ## Phase 1: Brainstorm — Deep Refactoring Goal Clarification
63
-
64
- **Goal**: Through interactive Q&A and deep code reading, transform the user's rough refactoring idea into fully clarified, implementation-ready refactoring goals. This phase is the foundation for safe, behavior-preserving code changes — vague goals produce risky refactors.
65
-
66
- **CRITICAL RULE**: The number of questions is **unlimited**. Do NOT rush through this phase. Ask as many rounds as needed until every aspect is clear. Refactoring is inherently risky — thorough understanding prevents broken behavior.
67
-
68
- ### Step 1.1: Clarify Refactoring Type
69
-
70
- **First question** — ask the user to classify the refactoring approach:
71
-
72
- | Type | Description | Example |
73
- |------|-------------|---------|
74
- | **Incremental** | Piece-by-piece restructuring, each step independently safe | "Gradually extract shared utilities over several PRs" |
75
- | **Comprehensive** | Full rewrite of a module/area in one pass | "Rewrite the auth module with new architecture" |
76
- | **Targeted** | Specific, focused change to a particular part | "Extract the validation logic from the controller" |
77
-
78
- Then ask:
79
- - **What** code needs restructuring (modules, files, patterns)
80
- - **Why** it needs refactoring (tech debt, coupling, complexity, readability, performance structure)
81
- - **What outcome** they want (target architecture, desired structure, quality goals)
82
-
83
- ### Step 1.2: Collect Reference Materials
84
-
85
- **Upfront Material Detection (Hard Rule)**: If the user has already provided materials (file paths, URLs, rules, specifications, code snippets) in the same message that invoked this skill:
86
- 1. Acknowledge what was received: "I received the following materials: [list]"
87
- 2. Read/fetch all provided materials immediately
88
- 3. You MUST still ask: "Are there any additional materials you'd like to provide?"
89
- 4. NEVER skip this collection step just because the user already provided some materials
90
-
91
- **If the user has NOT provided any materials upfront**, ask the user explicitly what resources they have. Do NOT skip this step — user-provided materials are far more valuable than blind directory scanning.
92
-
93
- Ask:
94
- 1. **Code paths** — "Which files or directories are the main targets? Any specific files I should look at?"
95
- 2. **Design documents** — "Do you have any design docs, architecture diagrams, or refactoring proposals I should read?"
96
- 3. **Knowledge docs** — "Are there related `.prizmkit/prizm-docs/`, README files, or internal wiki pages for the target area?"
97
- 4. **Related issues/PRs** — "Any related issues, PRs, or previous refactoring attempts I should be aware of?"
98
-
99
- Record everything the user provides — these become inputs for Step 1.3.
100
-
101
- ### Step 1.3: Parallel Deep Reading
102
-
103
- Read `${SKILL_DIR}/references/brainstorm-guide.md` §Step 1.3 for the parallel agent dispatch procedure — spawn 4 agents (A: code paths, B: documents, C: prizm-docs, D: test files) to build comprehensive understanding before discussion. Synthesize findings before proceeding.
104
-
105
- ### Step 1.4: Discuss Refactoring Plan
106
-
107
- Read `${SKILL_DIR}/references/brainstorm-guide.md` §Step 1.4 for the full discussion framework — code structure, scope, behavior preservation, risk assessment, and constraints. Present what was learned from parallel reading, then ask targeted questions grounded in real code. **Adapt question depth to the refactoring complexity.**
108
-
109
- ### Step 1.5: Confirm and Supplement
110
-
111
- After the discussion:
112
-
113
- 1. **Summarize** the refactoring plan — present it back to the user
114
- 2. **Ask explicitly**: "Is there anything else you'd like to discuss or supplement before we proceed to formal planning?"
115
- 3. **Identify gaps** — if any areas are still unclear, list them explicitly and ask follow-up questions
116
- 4. **Repeat** until the user confirms: "That covers everything" or "Let's proceed"
117
-
118
- Read `${SKILL_DIR}/references/brainstorm-guide.md` §Completion Signs for the full checklist of when brainstorming is complete vs when more questions are needed.
119
-
120
- ### Step 1.6: Requirements Summary
121
-
122
- Once brainstorming is complete, produce a structured goals summary. Read `${SKILL_DIR}/references/brainstorm-guide.md` §Refactoring Goals Summary Template for the structured output format. Present the summary to the user and get explicit confirmation before proceeding.
123
-
124
- **CHECKPOINT CP-RW-0**: Refactoring goals fully clarified and confirmed by user.
125
-
126
- ---
127
-
128
- ### Step 1.7: Complexity Assessment & Approach Selection
129
-
130
- After confirming refactoring goals, assess whether this refactor needs the full pipeline or can be done directly in the current session.
131
-
132
- **Simple refactor → Fast Path candidate** (ALL must be true):
133
- - Single module, no cross-module impact
134
- - ≤3 files affected
135
- - No public API or interface changes
136
- - Straightforward transformation (extract method, rename, move file, simplify logic)
137
- - Existing tests fully cover the affected code paths
138
- - No risk of behavior change
139
-
140
- **Complex refactor → Planning Path** (ANY is true):
141
- - Cross-module impact (>2 modules affected)
142
- - Public API or interface changes required
143
- - Multiple interrelated refactoring steps with dependency ordering
144
- - Comprehensive rewrite of a module
145
- - Insufficient test coverage in target area (risk of hidden behavior changes)
146
- - Requires coordination with other ongoing work
147
-
148
- **User choice required (mandatory)** — Use `AskUserQuestion` to present interactive selectable options. Tailor the question text to the assessment ("This refactoring appears straightforward…" for simple, "This refactoring is complex and will benefit from structured planning…" for complex), but the two options are always the same:
149
-
150
- ```
151
- AskUserQuestion:
152
- question: <tailored to simple vs complex assessment>
153
- header: "Approach"
154
- options:
155
- - label: "Refactor now (fast path)"
156
- description: "Plan and refactor directly in this session using /prizmkit-plan + /prizmkit-implement"
157
- - label: "Add to refactor list (pipeline)"
158
- description: "Generate .prizmkit/plans/refactor-list.json via refactor-planner, then launch pipeline for autonomous execution"
159
- ```
160
-
161
- - **Refactor now** → Fast Path: `/prizmkit-plan` (goals → `spec.md` + `plan.md`) → `/prizmkit-implement` (behavior preservation verified by tests) → `/prizmkit-code-review` → `/prizmkit-committer` (`refactor(<scope>):` prefix) → `/prizmkit-retrospective` (sync `.prizmkit/prizm-docs/`). **End workflow** — skip Phase 2/3/4.
162
- - **Add to refactor list** → Continue to Phase 2 (Plan via pipeline).
163
-
164
- **NEVER proceed without explicit user confirmation via `AskUserQuestion`. Do NOT render options as plain text — the user must be able to click/select.**
165
-
166
- **CHECKPOINT CP-RW-0.5**: Approach selected by user (fast path or pipeline).
167
-
168
- ---
169
-
170
- ## Phase 2: Plan
171
-
172
- **Goal**: Generate structured .prizmkit/plans/refactor-list.json from the clarified refactoring goals.
173
-
174
- **STEPS**:
175
-
176
- 1. **Invoke `refactor-planner` skill** with the full goals summary from Phase 1:
177
- - Pass the structured goals summary as input — NOT the raw user conversation
178
- - For new refactoring: standard planning mode
179
- - For existing projects with `--incremental`: incremental planning mode
180
- - **Input**: Markdown goals summary (refactor targets, scope, behavior preservation strategy)
181
- - **Output**: `.prizmkit/plans/refactor-list.json` (schema: `dev-pipeline-refactor-list-v1`) containing `project_name`, `refactors[]` with id (R-NNN), title, description, scope, type, priority, complexity, behavior_preservation, acceptance_criteria, dependencies, status
182
-
183
- 2. **Interactive planning** (if refactor-planner requires clarification):
184
- - Because Phase 1 was thorough, refactor-planner should need minimal clarification
185
- - If questions arise, answer from the Phase 1 context or pass through to user
186
-
187
- 3. **Validate output**:
188
- - Confirm `.prizmkit/plans/refactor-list.json` exists
189
- - Show summary: total refactor items, complexity distribution, dependencies
190
-
191
- **CHECKPOINT CP-RW-1**: `.prizmkit/plans/refactor-list.json` generated and validated.
192
-
193
- **If `.prizmkit/plans/refactor-list.json` already exists or user says `--from <file>`**: skip ahead per the [Resume table](#resume--interruption-recovery).
194
-
195
- ---
196
-
197
- ## Phase 3: Launch
198
-
199
- **Goal**: Start the refactoring pipeline.
200
-
201
- **STEPS**:
202
-
203
- 1. **Show refactor summary** before launching:
204
- ```
205
- Ready to launch pipeline with N refactor items:
206
- R-001: Extract auth middleware (medium complexity)
207
- R-002: Decouple notification service (high complexity)
208
- R-003: Simplify token flow (low complexity)
209
-
210
- Proceed? (Y/n)
211
- ```
212
-
213
- 2. **Invoke `refactor-pipeline-launcher` skill**:
214
- - **Input**: Path to validated `.prizmkit/plans/refactor-list.json`
215
- - The launcher handles all prerequisites checks
216
- - The launcher presents execution mode choices to the user (foreground/background/manual)
217
- - Do NOT duplicate execution mode selection here — let the launcher handle it
218
- - **Output**: PID/status, log file path, execution mode selected
219
- - Returns PID/status and log file location
220
-
221
- 3. **Verify launch success**:
222
- - Confirm pipeline is running
223
- - Record PID and log path for Phase 4
224
-
225
- **CHECKPOINT CP-RW-2**: Pipeline launched successfully.
226
-
227
- ---
228
-
229
- ## Phase 4: Monitor
230
-
231
- **Goal**: Track pipeline progress and report to user.
232
-
233
- **STEPS**:
234
-
235
- 1. **Initial status check**:
236
- ```powershell
237
- .\.prizmkit\dev-pipeline\launch-refactor-daemon.ps1 status
238
- ```
239
-
240
- 2. **Offer monitoring options**:
241
- - "I'll check progress periodically. Say 'status' anytime for an update."
242
- - "Say 'logs' to see recent activity."
243
- - "Say 'stop' to pause the pipeline."
244
-
245
- 3. **Periodic progress reports** (when user asks):
246
- ```powershell
247
- function Invoke-PrizmPython {
248
- param([Parameter(ValueFromRemainingArguments = $true)][string[]]$Arguments)
249
- $python = Get-Command python -ErrorAction SilentlyContinue
250
- if ($python) {
251
- & $python.Source -c 'import sys; raise SystemExit(0 if sys.version_info[0] == 3 else 1)' *> $null
252
- if ($LASTEXITCODE -eq 0) {
253
- & $python.Source @Arguments
254
- return
255
- }
256
- }
257
- $py = Get-Command py -ErrorAction SilentlyContinue
258
- if ($py) {
259
- & $py.Source -3 -c 'import sys; raise SystemExit(0 if sys.version_info[0] == 3 else 1)' *> $null
260
- if ($LASTEXITCODE -eq 0) {
261
- & $py.Source -3 @Arguments
262
- return
263
- }
264
- }
265
- throw "Python 3 is required. Install Python and ensure python or py is in PATH."
266
- }
267
- Invoke-PrizmPython .prizmkit/dev-pipeline/scripts/update-refactor-status.py `
268
- --refactor-list .prizmkit/plans/refactor-list.json `
269
- --state-dir .prizmkit/state/refactor `
270
- --action status
271
- ```
272
-
273
- 4. **Completion report** (when pipeline finishes all refactor items):
274
- ```
275
- Pipeline completed: 3/3 refactor items
276
-
277
- Summary:
278
- - R-001: Extract auth middleware → COMMITTED (refactor(auth): extract shared middleware)
279
- - R-002: Decouple notification service → COMMITTED (refactor(notifications): decouple from core)
280
- - R-003: Simplify token flow → COMMITTED (refactor(auth): simplify token refresh)
281
-
282
- Next steps:
283
- - Review changes: git log --oneline -5
284
- - Run tests: npm test
285
- - Push when ready: git push
286
- ```
287
-
288
- **CHECKPOINT CP-RW-3**: All refactor items completed or user stopped pipeline.
289
-
290
- ---
291
-
292
- ## Resume — Interruption Recovery
293
-
294
- The workflow supports resuming by detecting existing state:
295
-
296
- | State Found | Resume From |
297
- |-------------|------------|
298
- | No `.prizmkit/plans/refactor-list.json` | Phase 1: Brainstorm |
299
- | `.prizmkit/plans/refactor-list.json` exists, no pipeline state | Phase 3: Launch |
300
- | `.prizmkit/plans/refactor-list.json` + pipeline state exists | Phase 4: Monitor (check status) |
301
- | All refactors completed | Report completion, suggest next steps |
302
-
303
- **Resume**: If `.prizmkit/plans/refactor-list.json` exists, ask user: "Existing refactor plan found with N items. Resume pipeline or re-plan?"
304
-
305
- ---
306
-
307
- ## Interaction During Pipeline
308
-
309
- While the pipeline runs, the user can continue the conversation:
310
-
311
- | User says | Action |
312
- |-----------|--------|
313
- | "status" / "progress" | Show current progress |
314
- | "logs" | Show recent log activity |
315
- | "stop" | Stop the pipeline (state preserved) |
316
- | "show R-002 logs" | Show specific refactor item's session log |
317
-
318
- ---
319
-
320
- ## Error Handling
321
-
322
- | Error | Action |
323
- |-------|--------|
324
- | User's refactoring goal is too vague | Ask for more context: "Can you describe what's wrong with the current code structure?" |
325
- | Brainstorming stalls | Offer concrete options: "Would you prefer incremental or comprehensive refactoring?" |
326
- | No tests exist for target module | WARN user, recommend writing tests first before refactoring |
327
- | `refactor-planner` cannot parse goals | Refine the goals summary and retry |
328
- | `.prizmkit/plans/refactor-list.json` generation failed | Show error, retry with refined input |
329
- | Pipeline launch failed | Show daemon log, suggest manual start |
330
- | All refactor items blocked/failed | Show status, suggest retrying specific items |
331
- | User wants to cancel mid-brainstorming | Save conversation context, offer to resume later |
332
- | Behavior regression detected during pipeline | Pipeline handles per-item — failed items are retried or reported |
333
-
334
-
335
-
336
- ## Output
337
-
338
- - Structured refactoring goals summary (Phase 1 artifact)
339
- - `.prizmkit/plans/refactor-list.json` (Phase 2 artifact)
340
- - Pipeline execution (Phase 3)
341
- - Progress updates (Phase 4)
342
- - Multiple git commits with `refactor(<scope>):` prefix
343
- - Updated `.prizmkit/prizm-docs/` (via prizmkit-retrospective per refactor item)
@@ -1,116 +0,0 @@
1
- # Brainstorm Guide — Refactoring Context
2
-
3
- Procedural details for deep code analysis and discussion during refactor-workflow Phase 1.
4
-
5
- ## Step 1.3: Parallel Deep Reading
6
-
7
- **Goal**: Build comprehensive understanding of the target code and context before discussing plans. Spawn multiple agents in parallel to read all relevant materials simultaneously.
8
-
9
- **Parallel reading tasks** (launch concurrently):
10
-
11
- | Agent | What to read | Purpose |
12
- |-------|-------------|---------|
13
- | Agent A | User-provided code paths — read full source files | Understand current structure, interfaces, dependencies |
14
- | Agent B | User-provided documents — design docs, proposals, wiki pages | Understand intended direction and constraints |
15
- | Agent C | `.prizmkit/prizm-docs/` for affected modules — L1/L2 docs, TRAPS, RULES | Understand existing architecture knowledge and known pitfalls |
16
- | Agent D | Test files for the target area — find and read existing tests | Understand current test coverage and behavior contracts |
17
-
18
- **Also gather** (can be included in any agent's task):
19
- - `.prizmkit/config.json` → tech stack preferences
20
- - Directory structure of the target area
21
- - Dependency relationships (imports/exports between target and other modules)
22
-
23
- **After all agents complete**: Synthesize findings into a coherent understanding before proceeding to discussion.
24
-
25
- ## Step 1.4: Discuss Refactoring Plan
26
-
27
- **Now** — with deep knowledge of the actual code and documents — discuss the refactoring plan with the user. This discussion is grounded in real code, not abstract questions.
28
-
29
- Present what you learned from the parallel reading:
30
- - Current code structure and its problems (with specific file/function references)
31
- - Existing test coverage status (which areas are safe, which are risky)
32
- - Known TRAPS and pitfalls from `.prizmkit/prizm-docs/`
33
- - Dependencies and potential impact on other modules
34
-
35
- Then ask targeted questions based on what you read. **Adapt question depth to the refactoring complexity** — a simple extract-method refactor needs fewer questions than a full module decomposition.
36
-
37
- ### Code Structure
38
- - "I see the current structure does X — is the target state Y, or something different?"
39
- - What's the target state? What should the code look like after refactoring?
40
- - Are there specific code smells you've noticed? (duplication, deep nesting, god classes, tight coupling)
41
-
42
- ### Scope
43
- - Based on the code I read, these modules are affected: [list]. Anything else in/out of scope?
44
- - For incremental refactoring: what's the order of priority?
45
-
46
- ### Behavior Preservation
47
- - "These public APIs/interfaces exist: [list]. Which must remain unchanged?"
48
- - "I found these tests: [list]. Are they passing currently?"
49
- - Any undocumented behavior that callers depend on?
50
-
51
- ### Risk Assessment
52
- - "I found these TRAPS in .prizmkit/prizm-docs/: [list]. Any other known gotchas?"
53
- - Does this code have external consumers (other teams, published APIs)?
54
- - Any concurrent development happening in the target area?
55
-
56
- ### Constraints
57
- - Timeline or urgency? (affects whether to do incremental vs comprehensive)
58
- - Team coordination needed? (other developers working in the same area)
59
- - Deployment concerns? (feature flags, backward compatibility, migration)
60
-
61
- ## Completion Signs
62
-
63
- **Signs that brainstorming is complete:**
64
- - All refactoring goals have concrete target state descriptions
65
- - Scope boundaries are clearly defined (in/out)
66
- - Behavior preservation contracts are identified
67
- - Risk areas are acknowledged and mitigation is discussed
68
- - The user has confirmed the summary is accurate
69
-
70
- **Signs that more questions are needed:**
71
- - User's answers contain vague terms ("clean it up", "make it better", "fix the structure")
72
- - Scope is undefined ("refactor everything" without specifics)
73
- - No awareness of test coverage for the target area
74
- - Risk areas are handwaved ("it should be fine")
75
- - User says "I'm not sure" — help them think through it with concrete options
76
-
77
- ## Refactoring Goals Summary Template
78
-
79
- Once brainstorming is complete, produce a structured goals summary using this template:
80
-
81
- ```markdown
82
- ## Refactoring Goals Summary
83
-
84
- ### Target: [Module/area name]
85
-
86
- ### Refactoring Type: [Incremental / Comprehensive / Targeted]
87
-
88
- ### Refactoring Objectives
89
- - [Bullet list of what structural changes are needed and why]
90
-
91
- ### Current Problems
92
- - [What's wrong with the current structure — with specific code references]
93
-
94
- ### Target State
95
- - [What the code should look like after refactoring]
96
-
97
- ### Scope
98
- - **In scope**: [files, modules, directories]
99
- - **Out of scope**: [explicitly excluded areas]
100
-
101
- ### Behavior Preservation Contracts
102
- - [What behavior must remain unchanged]
103
- - [Key APIs/interfaces that must be preserved]
104
- - [Existing test coverage status]
105
-
106
- ### Risk Assessment
107
- - [Risk]: [Mitigation strategy]
108
-
109
- ### Reference Materials Reviewed
110
- - [List of code paths, documents, .prizmkit/prizm-docs/ files that were read]
111
-
112
- ### Constraints
113
- - [Timeline, coordination, deployment concerns]
114
-
115
- ### Confirmed by user: ✓
116
- ```
@@ -1,158 +0,0 @@
1
- #!/bin/sh
2
- # PrizmKit: diff-prizm-docs.sh
3
- # Outputs structural differences between .prizmkit/prizm-docs/ and source code.
4
- # Silent (exit 0) if no differences or if .prizmkit/prizm-docs doesn't exist.
5
- # POSIX sh only — no arrays, no bashisms.
6
-
7
- set -e
8
-
9
- ROOT_PRIZM=".prizmkit/prizm-docs/root.prizm"
10
-
11
- # 1. Exit silently if no root.prizm
12
- [ -f "$ROOT_PRIZM" ] || exit 0
13
-
14
- # 2. Detect language from LANG: field
15
- LANG_VAL=$(grep '^LANG:' "$ROOT_PRIZM" | head -1 | sed 's/^LANG:[[:space:]]*//' | tr '[:upper:]' '[:lower:]')
16
-
17
- case "$LANG_VAL" in
18
- go)
19
- FILE_PATTERN="*.go"
20
- ;;
21
- javascript|typescript|javascript/typescript|typescript/javascript)
22
- FILE_PATTERN="*.ts *.tsx *.js *.jsx"
23
- ;;
24
- python)
25
- FILE_PATTERN="*.py"
26
- ;;
27
- rust)
28
- FILE_PATTERN="*.rs"
29
- ;;
30
- *)
31
- FILE_PATTERN=""
32
- ;;
33
- esac
34
-
35
- # Helper: count source files in a directory (maxdepth 1) by language
36
- count_source_files() {
37
- _dir="$1"
38
- [ -d "$_dir" ] || { echo 0; return; }
39
- if [ -z "$FILE_PATTERN" ]; then
40
- # All non-hidden files
41
- find "$_dir" -maxdepth 1 -type f ! -name '.*' 2>/dev/null | wc -l | tr -d ' '
42
- else
43
- _count=0
44
- for _pat in $FILE_PATTERN; do
45
- _c=$(find "$_dir" -maxdepth 1 -type f -name "$_pat" 2>/dev/null | wc -l | tr -d ' ')
46
- _count=$((_count + _c))
47
- done
48
- echo "$_count"
49
- fi
50
- }
51
-
52
- # 3. Parse MODULE_INDEX from root.prizm
53
- # Extract lines between MODULE_INDEX: and next ALL-CAPS header or EOF
54
- # Each module line: "- src/auth: ..." -> source path is text before first ":" after "- "
55
- REGISTERED_PATHS=""
56
- _in_index=0
57
- while IFS= read -r line; do
58
- case "$line" in
59
- MODULE_INDEX:*)
60
- _in_index=1
61
- continue
62
- ;;
63
- esac
64
- if [ "$_in_index" -eq 1 ]; then
65
- # Check for next ALL-CAPS section header (word followed by colon, all uppercase letters)
66
- _header=$(echo "$line" | grep '^[A-Z_][A-Z_]*:' || true)
67
- if [ -n "$_header" ]; then
68
- break
69
- fi
70
- # Extract source path from "- src/auth: ..."
71
- case "$line" in
72
- "- "*)
73
- _path=$(echo "$line" | sed 's/^- //' | sed 's/:.*//')
74
- if [ -n "$_path" ]; then
75
- REGISTERED_PATHS="${REGISTERED_PATHS}${_path}
76
- "
77
- fi
78
- ;;
79
- esac
80
- fi
81
- done < "$ROOT_PRIZM"
82
-
83
- # 4. Check each registered module for drift
84
- echo "$REGISTERED_PATHS" | while IFS= read -r source_path; do
85
- [ -z "$source_path" ] && continue
86
-
87
- # Derive L1 prizm file path
88
- l1_file=".prizmkit/prizm-docs/${source_path}.prizm"
89
-
90
- if [ ! -f "$l1_file" ]; then
91
- continue
92
- fi
93
-
94
- # Read declared FILES: count
95
- declared=$(grep '^FILES:' "$l1_file" | head -1 | awk '{print $2}')
96
- [ -z "$declared" ] && continue
97
-
98
- # Count actual source files
99
- actual=$(count_source_files "$source_path")
100
-
101
- if [ "$actual" -gt 0 ] && [ "$declared" != "$actual" ]; then
102
- echo "MODULE_DRIFT: $source_path | declared FILES: $declared | actual: $actual"
103
- fi
104
- done
105
-
106
- # 5. Find orphan docs
107
- find .prizmkit/prizm-docs -name '*.prizm' 2>/dev/null | while IFS= read -r prizm_file; do
108
- _basename=$(basename "$prizm_file")
109
- case "$_basename" in
110
- root.prizm)
111
- continue
112
- ;;
113
- esac
114
-
115
- # Derive source path: remove .prizmkit/prizm-docs/ prefix and .prizm suffix
116
- source_path=$(echo "$prizm_file" | sed 's|^\.prizmkit/prizm-docs/||' | sed 's|\.prizm$||')
117
-
118
- if [ ! -d "$source_path" ]; then
119
- echo "ORPHAN_DOC: $prizm_file | source dir missing"
120
- fi
121
- done
122
-
123
- # 6. Find unregistered directories
124
- find . -mindepth 1 -maxdepth 3 -type d \
125
- ! -path '*/.*' \
126
- ! -path '*/node_modules/*' ! -path './node_modules' \
127
- ! -path '*/vendor/*' ! -path './vendor' \
128
- ! -path '*/dist/*' ! -path './dist' \
129
- ! -path '*/build/*' ! -path './build' \
130
- ! -path '*/__pycache__/*' ! -path './__pycache__' \
131
- ! -path '*/target/*' ! -path './target' \
132
- ! -path '*/tests/*' ! -path './tests' \
133
- ! -path '*/__tests__/*' ! -path './__tests__' \
134
- ! -path '*/.prizmkit/prizm-docs/*' ! -path './.prizmkit/prizm-docs' \
135
- ! -path '*/.claude/*' ! -path './.claude' \
136
- ! -path '*/.codebuddy/*' ! -path './.codebuddy' \
137
- ! -path '*/dev-pipeline/*' ! -path './dev-pipeline' \
138
- ! -path '*/coverage/*' ! -path './coverage' \
139
- ! -path '*/.nyc_output/*' ! -path './.nyc_output' \
140
- ! -path '*/out/*' ! -path './out' \
141
- ! -path '*/tmp/*' ! -path './tmp' \
142
- 2>/dev/null | while IFS= read -r candidate; do
143
- # Normalize: remove leading ./
144
- candidate_clean=$(echo "$candidate" | sed 's|^\./||')
145
-
146
- # Count source files
147
- file_count=$(count_source_files "$candidate_clean")
148
-
149
- if [ "$file_count" -ge 3 ]; then
150
- # Check if registered in MODULE_INDEX
151
- _match=$(echo "$REGISTERED_PATHS" | grep -Fx "$candidate_clean" || true)
152
- if [ -z "$_match" ]; then
153
- echo "UNREGISTERED: $candidate_clean | $file_count source files | not in MODULE_INDEX"
154
- fi
155
- fi
156
- done
157
-
158
- exit 0