prizmkit 1.1.99 → 1.1.101

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 (321) 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 +345 -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 +147 -0
  26. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +422 -0
  27. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +552 -0
  28. package/bundled/dev-pipeline/prizmkit_runtime/status.py +71 -0
  29. package/bundled/dev-pipeline/scripts/check-session-status.py +74 -1
  30. package/bundled/dev-pipeline/scripts/continuation.py +374 -0
  31. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +64 -52
  32. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +35 -25
  33. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +2 -2
  34. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +15 -20
  35. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +185 -16
  36. package/bundled/dev-pipeline/scripts/update-bug-status.py +214 -6
  37. package/bundled/dev-pipeline/scripts/update-feature-status.py +237 -6
  38. package/bundled/dev-pipeline/scripts/update-refactor-status.py +214 -6
  39. package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +8 -2
  40. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -0
  41. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +14 -5
  42. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +16 -6
  43. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +16 -6
  44. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +1 -1
  45. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +3 -3
  46. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +2 -0
  47. package/bundled/dev-pipeline/templates/sections/log-size-awareness.md +13 -69
  48. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +15 -7
  49. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +42 -29
  50. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +41 -39
  51. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +4 -0
  52. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +4 -0
  53. package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
  54. package/bundled/dev-pipeline/tests/conftest.py +1 -0
  55. package/bundled/dev-pipeline/tests/test_auto_skip.py +932 -0
  56. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +207 -0
  57. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +100 -0
  58. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +43 -0
  59. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +1138 -0
  60. package/bundled/dev-pipeline/tests/test_unified_cli.py +1045 -0
  61. package/bundled/skills/_metadata.json +1 -1
  62. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +29 -34
  63. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +6 -5
  64. package/bundled/skills/feature-pipeline-launcher/SKILL.md +29 -35
  65. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +7 -6
  66. package/bundled/skills/feature-workflow/SKILL.md +3 -6
  67. package/bundled/skills/recovery-workflow/SKILL.md +23 -32
  68. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +29 -35
  69. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +7 -6
  70. package/bundled/skills/refactor-workflow/SKILL.md +3 -6
  71. package/bundled/templates/hooks/commit-intent.json +2 -2
  72. package/bundled/templates/hooks/diff-prizm-docs.py +226 -0
  73. package/bundled/templates/hooks/prizm-pre-commit.py +45 -0
  74. package/bundled/templates/hooks/validate-prizm-docs.py +240 -0
  75. package/package.json +1 -1
  76. package/src/config.js +33 -12
  77. package/src/index.js +3 -6
  78. package/src/manifest.js +3 -2
  79. package/src/metadata.js +7 -18
  80. package/src/prompts.js +0 -12
  81. package/src/runtimes.js +18 -11
  82. package/src/scaffold.js +133 -116
  83. package/src/upgrade.js +1 -1
  84. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +0 -500
  85. package/bundled/dev-pipeline/launch-feature-daemon.sh +0 -657
  86. package/bundled/dev-pipeline/launch-refactor-daemon.sh +0 -502
  87. package/bundled/dev-pipeline/lib/branch.sh +0 -326
  88. package/bundled/dev-pipeline/lib/common.sh +0 -1257
  89. package/bundled/dev-pipeline/lib/heartbeat.sh +0 -469
  90. package/bundled/dev-pipeline/reset-bug.sh +0 -395
  91. package/bundled/dev-pipeline/reset-feature.sh +0 -406
  92. package/bundled/dev-pipeline/reset-refactor.sh +0 -393
  93. package/bundled/dev-pipeline/run-bugfix.sh +0 -1315
  94. package/bundled/dev-pipeline/run-feature.sh +0 -1602
  95. package/bundled/dev-pipeline/run-recovery.sh +0 -648
  96. package/bundled/dev-pipeline/run-refactor.sh +0 -1348
  97. package/bundled/dev-pipeline/scripts/monitor-log.sh +0 -104
  98. package/bundled/dev-pipeline/tests/test-path-resolution.sh +0 -100
  99. package/bundled/dev-pipeline-windows/.env.example +0 -36
  100. package/bundled/dev-pipeline-windows/README.md +0 -30
  101. package/bundled/dev-pipeline-windows/SCHEMA_ANALYSIS.md +0 -533
  102. package/bundled/dev-pipeline-windows/assets/feature-list-example.json +0 -146
  103. package/bundled/dev-pipeline-windows/assets/prizm-dev-team-integration.md +0 -137
  104. package/bundled/dev-pipeline-windows/launch-bugfix-daemon.ps1 +0 -9
  105. package/bundled/dev-pipeline-windows/launch-feature-daemon.ps1 +0 -9
  106. package/bundled/dev-pipeline-windows/launch-refactor-daemon.ps1 +0 -9
  107. package/bundled/dev-pipeline-windows/lib/branch.ps1 +0 -235
  108. package/bundled/dev-pipeline-windows/lib/common.ps1 +0 -829
  109. package/bundled/dev-pipeline-windows/lib/daemon.ps1 +0 -140
  110. package/bundled/dev-pipeline-windows/lib/pipeline.ps1 +0 -967
  111. package/bundled/dev-pipeline-windows/lib/reset.ps1 +0 -87
  112. package/bundled/dev-pipeline-windows/reset-bug.ps1 +0 -9
  113. package/bundled/dev-pipeline-windows/reset-feature.ps1 +0 -9
  114. package/bundled/dev-pipeline-windows/reset-refactor.ps1 +0 -9
  115. package/bundled/dev-pipeline-windows/run-bugfix.ps1 +0 -9
  116. package/bundled/dev-pipeline-windows/run-feature.ps1 +0 -9
  117. package/bundled/dev-pipeline-windows/run-recovery.ps1 +0 -179
  118. package/bundled/dev-pipeline-windows/run-refactor.ps1 +0 -9
  119. package/bundled/dev-pipeline-windows/scripts/check-session-status.py +0 -228
  120. package/bundled/dev-pipeline-windows/scripts/detect-stuck.py +0 -530
  121. package/bundled/dev-pipeline-windows/scripts/generate-bootstrap-prompt.py +0 -2282
  122. package/bundled/dev-pipeline-windows/scripts/generate-bugfix-prompt.py +0 -767
  123. package/bundled/dev-pipeline-windows/scripts/generate-recovery-prompt.py +0 -805
  124. package/bundled/dev-pipeline-windows/scripts/generate-refactor-prompt.py +0 -845
  125. package/bundled/dev-pipeline-windows/scripts/init-bugfix-pipeline.py +0 -316
  126. package/bundled/dev-pipeline-windows/scripts/init-dev-team.py +0 -134
  127. package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +0 -382
  128. package/bundled/dev-pipeline-windows/scripts/init-refactor-pipeline.py +0 -399
  129. package/bundled/dev-pipeline-windows/scripts/monitor-log.ps1 +0 -102
  130. package/bundled/dev-pipeline-windows/scripts/parse-stream-progress.py +0 -1232
  131. package/bundled/dev-pipeline-windows/scripts/patch-completion-notes.py +0 -191
  132. package/bundled/dev-pipeline-windows/scripts/prizmkit-test-gate.py +0 -446
  133. package/bundled/dev-pipeline-windows/scripts/update-bug-status.py +0 -913
  134. package/bundled/dev-pipeline-windows/scripts/update-checkpoint.py +0 -173
  135. package/bundled/dev-pipeline-windows/scripts/update-feature-status.py +0 -1558
  136. package/bundled/dev-pipeline-windows/scripts/update-refactor-status.py +0 -1119
  137. package/bundled/dev-pipeline-windows/scripts/utils.py +0 -542
  138. package/bundled/dev-pipeline-windows/templates/agent-prompts/critic-plan-challenge.md +0 -7
  139. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-fix.md +0 -7
  140. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-implement.md +0 -65
  141. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-resume.md +0 -5
  142. package/bundled/dev-pipeline-windows/templates/agent-prompts/reviewer-review.md +0 -7
  143. package/bundled/dev-pipeline-windows/templates/bootstrap-prompt.md +0 -73
  144. package/bundled/dev-pipeline-windows/templates/bootstrap-tier1.md +0 -589
  145. package/bundled/dev-pipeline-windows/templates/bootstrap-tier2.md +0 -710
  146. package/bundled/dev-pipeline-windows/templates/bootstrap-tier3.md +0 -791
  147. package/bundled/dev-pipeline-windows/templates/bug-fix-list-schema.json +0 -263
  148. package/bundled/dev-pipeline-windows/templates/bugfix-bootstrap-prompt.md +0 -326
  149. package/bundled/dev-pipeline-windows/templates/feature-list-schema.json +0 -237
  150. package/bundled/dev-pipeline-windows/templates/refactor-bootstrap-prompt.md +0 -340
  151. package/bundled/dev-pipeline-windows/templates/refactor-list-schema.json +0 -270
  152. package/bundled/dev-pipeline-windows/templates/sections/ac-verification-checklist.md +0 -7
  153. package/bundled/dev-pipeline-windows/templates/sections/checkpoint-system.md +0 -91
  154. package/bundled/dev-pipeline-windows/templates/sections/context-budget-rules.md +0 -34
  155. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-agent.md +0 -10
  156. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-full.md +0 -12
  157. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-lite.md +0 -7
  158. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-agent.md +0 -8
  159. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-full.md +0 -9
  160. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-lite.md +0 -6
  161. package/bundled/dev-pipeline-windows/templates/sections/failure-capture.md +0 -21
  162. package/bundled/dev-pipeline-windows/templates/sections/feature-context.md +0 -21
  163. package/bundled/dev-pipeline-windows/templates/sections/log-size-awareness.md +0 -78
  164. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-auto.md +0 -283
  165. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-opencli.md +0 -112
  166. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification.md +0 -168
  167. package/bundled/dev-pipeline-windows/templates/sections/phase-commit-full.md +0 -82
  168. package/bundled/dev-pipeline-windows/templates/sections/phase-commit.md +0 -75
  169. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-agent-suffix.md +0 -23
  170. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-base.md +0 -14
  171. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-lite-suffix.md +0 -19
  172. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan-full.md +0 -63
  173. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan.md +0 -42
  174. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-agent.md +0 -44
  175. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-full.md +0 -59
  176. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-lite.md +0 -39
  177. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-agent.md +0 -27
  178. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-lite.md +0 -27
  179. package/bundled/dev-pipeline-windows/templates/sections/phase-prizmkit-test.md +0 -39
  180. package/bundled/dev-pipeline-windows/templates/sections/phase-review-agent.md +0 -35
  181. package/bundled/dev-pipeline-windows/templates/sections/phase-review-full.md +0 -35
  182. package/bundled/dev-pipeline-windows/templates/sections/phase-specify-plan-full.md +0 -73
  183. package/bundled/dev-pipeline-windows/templates/sections/phase0-init.md +0 -13
  184. package/bundled/dev-pipeline-windows/templates/sections/phase0-test-baseline.md +0 -21
  185. package/bundled/dev-pipeline-windows/templates/sections/session-context.md +0 -5
  186. package/bundled/dev-pipeline-windows/templates/sections/subagent-timeout-recovery.md +0 -6
  187. package/bundled/dev-pipeline-windows/templates/sections/task-contract.md +0 -34
  188. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-agent.md +0 -48
  189. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-lite.md +0 -48
  190. package/bundled/dev-pipeline-windows/templates/session-status-schema.json +0 -83
  191. package/bundled/skills-windows/app-planner/SKILL.md +0 -296
  192. package/bundled/skills-windows/app-planner/assets/app-design-guide.md +0 -101
  193. package/bundled/skills-windows/app-planner/references/architecture-decisions.md +0 -52
  194. package/bundled/skills-windows/app-planner/references/brainstorm-guide.md +0 -101
  195. package/bundled/skills-windows/app-planner/references/frontend-design-guide.md +0 -71
  196. package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +0 -108
  197. package/bundled/skills-windows/app-planner/references/project-brief-guide.md +0 -82
  198. package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +0 -59
  199. package/bundled/skills-windows/app-planner/references/project-state-detection.md +0 -90
  200. package/bundled/skills-windows/app-planner/references/red-team-checklist.md +0 -40
  201. package/bundled/skills-windows/app-planner/references/rules/backend/derivation-rules.md +0 -619
  202. package/bundled/skills-windows/app-planner/references/rules/backend/fixed-rules.md +0 -285
  203. package/bundled/skills-windows/app-planner/references/rules/backend/question-bank.md +0 -249
  204. package/bundled/skills-windows/app-planner/references/rules/backend/question-manifest.json +0 -46
  205. package/bundled/skills-windows/app-planner/references/rules/backend/template.md +0 -173
  206. package/bundled/skills-windows/app-planner/references/rules/database/derivation-rules.md +0 -382
  207. package/bundled/skills-windows/app-planner/references/rules/database/fixed-rules.md +0 -211
  208. package/bundled/skills-windows/app-planner/references/rules/database/question-bank.md +0 -184
  209. package/bundled/skills-windows/app-planner/references/rules/database/question-manifest.json +0 -39
  210. package/bundled/skills-windows/app-planner/references/rules/database/template.md +0 -158
  211. package/bundled/skills-windows/app-planner/references/rules/frontend/derivation-rules.md +0 -820
  212. package/bundled/skills-windows/app-planner/references/rules/frontend/fixed-rules.md +0 -188
  213. package/bundled/skills-windows/app-planner/references/rules/frontend/question-bank.md +0 -319
  214. package/bundled/skills-windows/app-planner/references/rules/frontend/question-manifest.json +0 -51
  215. package/bundled/skills-windows/app-planner/references/rules/frontend/template.md +0 -339
  216. package/bundled/skills-windows/app-planner/references/rules/mobile/derivation-rules.md +0 -649
  217. package/bundled/skills-windows/app-planner/references/rules/mobile/fixed-rules.md +0 -290
  218. package/bundled/skills-windows/app-planner/references/rules/mobile/question-bank.md +0 -232
  219. package/bundled/skills-windows/app-planner/references/rules/mobile/question-manifest.json +0 -47
  220. package/bundled/skills-windows/app-planner/references/rules/mobile/template.md +0 -175
  221. package/bundled/skills-windows/app-planner/references/rules-configuration.md +0 -46
  222. package/bundled/skills-windows/bug-fix-workflow/SKILL.md +0 -379
  223. package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +0 -41
  224. package/bundled/skills-windows/bug-planner/SKILL.md +0 -402
  225. package/bundled/skills-windows/bug-planner/assets/bug-confirmation-template.md +0 -43
  226. package/bundled/skills-windows/bug-planner/references/critic-and-verification.md +0 -44
  227. package/bundled/skills-windows/bug-planner/references/error-recovery.md +0 -73
  228. package/bundled/skills-windows/bug-planner/references/input-formats.md +0 -53
  229. package/bundled/skills-windows/bug-planner/references/schema-validation.md +0 -25
  230. package/bundled/skills-windows/bug-planner/references/severity-rules.md +0 -16
  231. package/bundled/skills-windows/bug-planner/scripts/validate-bug-list.py +0 -322
  232. package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +0 -304
  233. package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +0 -84
  234. package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +0 -381
  235. package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +0 -67
  236. package/bundled/skills-windows/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
  237. package/bundled/skills-windows/feature-planner/SKILL.md +0 -397
  238. package/bundled/skills-windows/feature-planner/assets/evaluation-guide.md +0 -64
  239. package/bundled/skills-windows/feature-planner/assets/planning-guide.md +0 -214
  240. package/bundled/skills-windows/feature-planner/references/browser-interaction.md +0 -59
  241. package/bundled/skills-windows/feature-planner/references/completeness-review.md +0 -57
  242. package/bundled/skills-windows/feature-planner/references/decomposition-patterns.md +0 -75
  243. package/bundled/skills-windows/feature-planner/references/error-recovery.md +0 -90
  244. package/bundled/skills-windows/feature-planner/references/incremental-feature-planning.md +0 -112
  245. package/bundled/skills-windows/feature-planner/references/new-project-planning.md +0 -85
  246. package/bundled/skills-windows/feature-planner/scripts/validate-and-generate.py +0 -1020
  247. package/bundled/skills-windows/feature-workflow/SKILL.md +0 -374
  248. package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +0 -137
  249. package/bundled/skills-windows/prizm-kit/SKILL.md +0 -93
  250. package/bundled/skills-windows/prizmkit-code-review/SKILL.md +0 -161
  251. package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +0 -30
  252. package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +0 -31
  253. package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +0 -66
  254. package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +0 -186
  255. package/bundled/skills-windows/prizmkit-committer/SKILL.md +0 -89
  256. package/bundled/skills-windows/prizmkit-deploy/SKILL.md +0 -444
  257. package/bundled/skills-windows/prizmkit-deploy/references/ci-cd-workflows.md +0 -115
  258. package/bundled/skills-windows/prizmkit-deploy/references/cloud-platform-deploy.md +0 -93
  259. package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +0 -120
  260. package/bundled/skills-windows/prizmkit-deploy/references/database-setup.md +0 -46
  261. package/bundled/skills-windows/prizmkit-deploy/references/deploy-config-schema.md +0 -148
  262. package/bundled/skills-windows/prizmkit-deploy/references/deploy-history-schema.md +0 -62
  263. package/bundled/skills-windows/prizmkit-deploy/references/deployment-modes.md +0 -50
  264. package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +0 -26
  265. package/bundled/skills-windows/prizmkit-deploy/references/dns-setup.md +0 -42
  266. package/bundled/skills-windows/prizmkit-deploy/references/docker-deploy.md +0 -31
  267. package/bundled/skills-windows/prizmkit-deploy/references/firewall-setup.md +0 -37
  268. package/bundled/skills-windows/prizmkit-deploy/references/live-validation-notes.md +0 -21
  269. package/bundled/skills-windows/prizmkit-deploy/references/nginx-blue-green.md +0 -59
  270. package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
  271. package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
  272. package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +0 -20
  273. package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +0 -56
  274. package/bundled/skills-windows/prizmkit-implement/SKILL.md +0 -71
  275. package/bundled/skills-windows/prizmkit-init/SKILL.md +0 -356
  276. package/bundled/skills-windows/prizmkit-init/assets/project-brief-template.md +0 -82
  277. package/bundled/skills-windows/prizmkit-init/references/config-schema.md +0 -70
  278. package/bundled/skills-windows/prizmkit-init/references/rules/layer-detection.md +0 -41
  279. package/bundled/skills-windows/prizmkit-init/references/tech-stack-catalog.md +0 -13
  280. package/bundled/skills-windows/prizmkit-init/references/update-supplement.md +0 -9
  281. package/bundled/skills-windows/prizmkit-plan/SKILL.md +0 -102
  282. package/bundled/skills-windows/prizmkit-plan/assets/plan-template.md +0 -115
  283. package/bundled/skills-windows/prizmkit-plan/assets/spec-template.md +0 -73
  284. package/bundled/skills-windows/prizmkit-plan/references/clarify-guide.md +0 -67
  285. package/bundled/skills-windows/prizmkit-plan/references/examples.md +0 -85
  286. package/bundled/skills-windows/prizmkit-plan/references/verification-checklist.md +0 -60
  287. package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +0 -129
  288. package/bundled/skills-windows/prizmkit-prizm-docs/assets/prizm-docs-format.md +0 -613
  289. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-init.md +0 -45
  290. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-rebuild.md +0 -15
  291. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-status.md +0 -14
  292. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-update.md +0 -19
  293. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-validate.md +0 -17
  294. package/bundled/skills-windows/prizmkit-retrospective/SKILL.md +0 -87
  295. package/bundled/skills-windows/prizmkit-retrospective/references/knowledge-injection-steps.md +0 -50
  296. package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +0 -43
  297. package/bundled/skills-windows/prizmkit-test/SKILL.md +0 -227
  298. package/bundled/skills-windows/prizmkit-test/references/boundary-coverage-protocol.md +0 -220
  299. package/bundled/skills-windows/prizmkit-test/references/examples.md +0 -143
  300. package/bundled/skills-windows/prizmkit-test/references/service-boundary-test-catalog.md +0 -225
  301. package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +0 -109
  302. package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +0 -111
  303. package/bundled/skills-windows/prizmkit-test/scripts/validate_boundary_report.py +0 -347
  304. package/bundled/skills-windows/recovery-workflow/SKILL.md +0 -355
  305. package/bundled/skills-windows/recovery-workflow/evals/evals.json +0 -46
  306. package/bundled/skills-windows/recovery-workflow/references/detection.md +0 -58
  307. package/bundled/skills-windows/recovery-workflow/scripts/detect-recovery-state.py +0 -544
  308. package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +0 -346
  309. package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +0 -72
  310. package/bundled/skills-windows/refactor-planner/SKILL.md +0 -398
  311. package/bundled/skills-windows/refactor-planner/assets/planning-guide.md +0 -292
  312. package/bundled/skills-windows/refactor-planner/references/behavior-preservation.md +0 -301
  313. package/bundled/skills-windows/refactor-planner/references/fast-path.md +0 -59
  314. package/bundled/skills-windows/refactor-planner/references/planning-phases.md +0 -135
  315. package/bundled/skills-windows/refactor-planner/references/refactor-scoping-guide.md +0 -221
  316. package/bundled/skills-windows/refactor-planner/scripts/validate-and-generate-refactor.py +0 -858
  317. package/bundled/skills-windows/refactor-workflow/SKILL.md +0 -343
  318. package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +0 -116
  319. package/bundled/templates/hooks/diff-prizm-docs.sh +0 -158
  320. package/bundled/templates/hooks/prizm-pre-commit.sh +0 -108
  321. package/bundled/templates/hooks/validate-prizm-docs.sh +0 -139
@@ -1,398 +0,0 @@
1
- ---
2
- name: "refactor-planner"
3
- description: "Interactive refactoring planner. Understands refactoring intent through dialogue, analyzes current code structure, produces validated .prizmkit/plans/refactor-list.json for dev-pipeline execution. Use whenever users discuss refactoring planning, code restructuring scope, or preparing .prizmkit/plans/refactor-list.json."
4
- ---
5
-
6
- # refactor planner
7
-
8
- Plan executable refactoring items for dev-pipeline:
9
- - **Scope Assessment**: analyze current code structure and identify refactoring targets
10
- - **Item Decomposition**: break refactoring goals into well-ordered, behavior-preserving items
11
-
12
- Always produce a validated `.prizmkit/plans/refactor-list.json` that conforms to `dev-pipeline-refactor-list-v1`.
13
-
14
- ## Invocation Commitment (Hard Rule)
15
-
16
- **When the user invokes `/refactor-planner`, you MUST execute the refactor-planner workflow.** You must NEVER:
17
- - Decide on the user's behalf that the task "doesn't need refactor-planner"
18
- - Skip refactor-planner to jump directly to refactor-workflow or any other skill
19
- - Bypass the interactive phases because you judge the task to be "simple" or "obvious"
20
-
21
- If you believe the task is better suited for a different workflow (e.g., single-file refactor via `/refactor-workflow`), you MUST:
22
- 1. **Explain why** you think a different path is more appropriate
23
- 2. **Ask the user explicitly** whether they want to switch or continue with refactor-planner
24
- 3. **Only switch if the user confirms** — otherwise proceed with refactor-planner as invoked
25
-
26
- The user chose this skill intentionally. Respect that choice.
27
-
28
- ## Scope Boundary (Hard Rule)
29
-
30
- **This skill is PLANNING ONLY.** You must NEVER:
31
- - Create, modify, or delete source code files (*.js, *.ts, *.py, *.go, *.html, *.css, etc.)
32
- - Execute refactoring operations (rename, move, extract, etc.)
33
- - Run build/install/test commands
34
- - Execute any implementation action beyond writing `.prizmkit/plans/refactor-list.json`
35
-
36
- **Your ONLY writable outputs are:**
37
- 1. `.prizmkit/plans/refactor-list.json` (`.prizmkit/plans/`)
38
- 2. Draft backups in `.prizmkit/plans/` (e.g., `refactor-list.draft.json`)
39
-
40
- **After planning is complete**, you MUST:
41
- 1. Present the summary and recommended next step
42
- 2. **Ask the user explicitly** whether they want to proceed to execution
43
- 3. If the user agrees → recommend invoking `refactor-pipeline-launcher` (do NOT execute it yourself)
44
- 4. If the user wants to adjust → continue refining `.prizmkit/plans/refactor-list.json`
45
- 5. **NEVER auto-execute** the pipeline, launcher, or any implementation step
46
-
47
- ## User-Provided Content Priority (Hard Rule)
48
-
49
- When the user provides detailed specifications, rules, or implementation requirements:
50
-
51
- 1. **Verbatim preservation**: The user's exact wording MUST be preserved in `description` and `acceptance_criteria` fields. Do NOT paraphrase, summarize, abstract, or simplify.
52
- 2. **No autonomous simplification**: A 200-word user specification must NOT become a 30-word description. Match the detail level of the user's input.
53
- 3. **Clarify, don't assume**: If any user-provided rule is ambiguous or potentially conflicts with another, ASK the user to clarify. No limit on clarification rounds. Do NOT proceed with unresolved ambiguities.
54
- 4. **Populate `user_context`**: ALL user-provided materials (supplementary content, rules, file path references) MUST be written into the `user_context` array of each refactor item in the generated `.prizmkit/plans/refactor-list.json`. Format:
55
- - Supplementary content or rules → store as-is (verbatim text)
56
- - File references → store as path string, e.g. `src/auth/login.ts:42-78` or `src/utils/validate.ts — focus on validateEmail function`
57
-
58
- ## When to Use
59
- - "Plan refactoring", "Scope a restructuring"
60
- - "Prepare .prizmkit/plans/refactor-list.json", "Prepare dev-pipeline input for refactoring"
61
- - "Assess code for refactoring", "Identify refactoring targets"
62
- - "Plan a code migration", "Decompose a large refactor"
63
-
64
- Do NOT use this skill when the user wants to:
65
- - Execute a single refactor directly (use `refactor-workflow`)
66
- - Plan new features (use `feature-planner`)
67
- - Fix bugs (use `bug-planner`)
68
-
69
- ## Resource Loading Rules (Mandatory)
70
-
71
- 1. **Read decomposition guide**:
72
- - Read `${SKILL_DIR}/assets/planning-guide.md` for decomposition patterns and description guidelines
73
-
74
- 2. **Read scope assessment reference**:
75
- - Read `${SKILL_DIR}/references/refactor-scoping-guide.md` for scope classification and risk assessment
76
-
77
- 3. **Read behavior preservation reference**:
78
- - Read `${SKILL_DIR}/references/behavior-preservation.md` for preservation strategy selection
79
-
80
- 4. **Load on-demand references when triggered**:
81
- - Validation errors or interrupted session -> see the "Error Recovery & Resume" section below
82
-
83
- 5. **Define the PowerShell Python helper before running validation scripts**:
84
- ```powershell
85
- function Invoke-PrizmPython {
86
- param([Parameter(ValueFromRemainingArguments = $true)][string[]]$Arguments)
87
- $python = Get-Command python -ErrorAction SilentlyContinue
88
- if ($python) {
89
- & $python.Source -c 'import sys; raise SystemExit(0 if sys.version_info[0] == 3 else 1)' *> $null
90
- if ($LASTEXITCODE -eq 0) {
91
- & $python.Source @Arguments
92
- return
93
- }
94
- }
95
- $py = Get-Command py -ErrorAction SilentlyContinue
96
- if ($py) {
97
- & $py.Source -3 -c 'import sys; raise SystemExit(0 if sys.version_info[0] == 3 else 1)' *> $null
98
- if ($LASTEXITCODE -eq 0) {
99
- & $py.Source -3 @Arguments
100
- return
101
- }
102
- }
103
- throw "Python 3 is required. Install Python and ensure python or py is in PATH."
104
- }
105
- ```
106
-
107
- 6. **Always validate output via script**:
108
- - Run:
109
- ```powershell
110
- Invoke-PrizmPython ${SKILL_DIR}/scripts/validate-and-generate-refactor.py validate --input <output-path>
111
- ```
112
-
113
- 7. **Use script output as source of truth**:
114
- - If validation fails, **MUST** fix and re-run until pass
115
-
116
- ## Prerequisites
117
-
118
- Before questions, check optional context files (never block if absent):
119
- - `.prizmkit/prizm-docs/root.prizm` (architecture/project context)
120
- - `.prizmkit/config.json` (existing stack preferences and detected tech stack)
121
- - Existing test suite (critical for behavior preservation assessment)
122
- - Existing `.prizmkit/plans/refactor-list.json` (if appending additional items)
123
- - If `.prizmkit/prizm-docs/root.prizm` is absent and the project has existing source code, scan the directory structure:
124
- ```powershell
125
- Get-ChildItem -Path . -Directory -Recurse -Depth 2 -ErrorAction SilentlyContinue |
126
- Where-Object { $_.FullName -notmatch '\\(node_modules|\.git|dist|build|__pycache__|vendor)(\\|$)' } |
127
- Select-Object -ExpandProperty FullName
128
- ```
129
-
130
- **Test suite detection:**
131
- - Scan for test runner config files (`jest.config.*`, `vitest.config.*`, `pytest.ini`, `.mocharc.*`, `karma.conf.*`)
132
- - If no test suite detected, WARN: "No test suite found. Behavior preservation will rely on manual verification. Consider writing tests before refactoring."
133
- - Record test suite status in planning context for downstream use
134
-
135
- ## Operation Modes
136
-
137
- ### Mode A: Interactive (default)
138
- Full Q&A -> code analysis -> item generation. Useful when starting from scratch or exploring refactoring scope.
139
-
140
- ### Mode B: From Analysis
141
- When an existing analysis report (e.g., `refactor-analysis.md`) is available, skip the analysis phase and proceed directly to item decomposition.
142
-
143
- ### Mode C: Validate
144
- Validate an existing `.prizmkit/plans/refactor-list.json` without regenerating it:
145
- ```powershell
146
- Invoke-PrizmPython ${SKILL_DIR}/scripts/validate-and-generate-refactor.py validate --input .prizmkit/plans/refactor-list.json
147
- ```
148
-
149
- ### Mode D: Summary
150
- Display a human-readable summary of an existing `.prizmkit/plans/refactor-list.json`:
151
- - Item count, dependency graph, complexity distribution, behavior preservation strategies
152
-
153
- ## Interactive Mode — Core Workflow
154
-
155
- Execute the planning workflow in conversation mode with mandatory checkpoints:
156
-
157
- ### Phase 1: Project Context
158
-
159
- **Goal**: Understand the current codebase structure and tech stack.
160
-
161
- 1. Read `.prizmkit/prizm-docs/root.prizm` and relevant L1 docs
162
- 2. Read `.prizmkit/config.json` for tech stack info
163
- 3. Identify existing test suite and coverage
164
- 4. Summarize project context to the user: "Here's what I found about your project..."
165
- 5. **Collect reference materials** — **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: (a) Acknowledge what was received: "I received the following materials: [list]"; (b) Read/fetch all provided materials immediately; (c) You MUST still ask: "Are there any additional materials you'd like to provide?"; (d) NEVER skip this collection step just because the user already provided some materials.
166
-
167
- If the user has NOT provided any materials upfront, explicitly ask whether they have any supplementary materials for you to review before planning the refactoring:
168
- > "Do you have any reference materials I should review before planning the refactoring? This can include:
169
- > - **Code paths** — specific files or directories that are refactoring targets or dependencies
170
- > - **Documents** — design docs, architecture proposals, refactoring RFCs, or technical debt analyses
171
- > - **Knowledge docs** — `.prizmkit/prizm-docs/` files, README files, or internal wiki pages for the affected area
172
- > - **Images** — architecture diagrams, dependency graphs, or whiteboard photos
173
- > - **Web links** — reference implementations, design pattern articles, or migration guides
174
- >
175
- > If none, we'll proceed with what's available in the codebase."
176
-
177
- If the user provides materials, read/fetch them all before proceeding to Phase 2. For web links, use web fetch to retrieve and analyze the content. For images, read and analyze them visually. This context is critical for refactoring — understanding the target architecture and constraints prevents risky structural changes.
178
-
179
- **CHECKPOINT CP-RP-0**: Project context loaded, tech stack and test suite status known.
180
-
181
- ### Phase 2: Refactor Goal Collection
182
-
183
- **Goal**: Through interactive dialogue, understand what the user wants to refactor and why.
184
-
185
- Support 4 input formats (users may mix formats):
186
-
187
- **Format A — Natural language**:
188
- > "This module is too large and hard to maintain"
189
- > "The auth logic is scattered across too many files"
190
-
191
- **Format B — Code smell pointer**:
192
- > "src/api/handler.js is 800 lines"
193
- > "There are 5 files that all implement similar validation logic"
194
-
195
- **Format C — Architecture migration**:
196
- > "Convert callbacks to async/await"
197
- > "Migrate from class components to hooks"
198
- > "Move from monolith to modular architecture"
199
-
200
- **Format D — Dependency decoupling**:
201
- > "There's a circular dependency between auth and user modules"
202
- > "The database layer is tightly coupled to the HTTP layer"
203
-
204
- For each input, ask clarifying questions:
205
- - What is the specific target (files, modules, patterns)?
206
- - What is the desired end state?
207
- - Are there constraints (must preserve API, must not touch certain files)?
208
- - What is the motivation (maintainability, performance, testability)?
209
-
210
- Continue collecting goals until the user says they're done. There is no limit on rounds.
211
-
212
- **CHECKPOINT CP-RP-1**: All refactoring goals collected and understood.
213
-
214
- ### Phase 3: Code Analysis
215
-
216
- **Goal**: Analyze the target code to inform item decomposition.
217
-
218
- Dispatch **parallel Agent reads** of target files:
219
- - **Agent A (Structure)**: File inventory, dependency graph, module boundaries, public API surface
220
- - **Agent B (Quality)**: Code smells, complexity hotspots, duplication, coupling metrics
221
- - **Agent C (Tests)**: Test coverage of target areas, existing test patterns, behavior contracts
222
-
223
- Present consolidated findings:
224
- ```
225
- ## Code Analysis Results
226
-
227
- ### Structure
228
- - [file inventory, dependency graph]
229
-
230
- ### Quality Issues
231
- - [code smells, complexity hotspots, duplication]
232
-
233
- ### Test Coverage
234
- - [test status for target areas]
235
- - [behavior contracts that must be preserved]
236
-
237
- ### Recommended Decomposition
238
- - [suggested refactoring order based on findings]
239
- ```
240
-
241
- Ask: "Based on this analysis, here's how I'd recommend decomposing the refactoring. Does this align with your expectations?"
242
-
243
- **CHECKPOINT CP-RP-2**: Code analysis complete, user agrees with recommended approach.
244
-
245
- ### Phase 4: Item Decomposition
246
-
247
- **Goal**: Split refactoring goals into executable, well-ordered items.
248
-
249
- Read `${SKILL_DIR}/references/planning-phases.md` for the full Phase 4-6 procedures — item decomposition patterns, per-item confirmation loop, and completeness review checklist.
250
-
251
- **CHECKPOINT CP-RP-3**: All items decomposed with dependencies and preservation strategies.
252
-
253
- ### Phase 5: Per-Item Confirmation
254
-
255
- **Goal**: Present each item to the user for confirmation, modification, or rejection.
256
-
257
- See `${SKILL_DIR}/references/planning-phases.md` for the display template and confirm/modify/skip loop procedure.
258
-
259
- **CHECKPOINT CP-RP-4**: All items confirmed by user.
260
-
261
- ### Phase 6: Completeness Review
262
-
263
- **Goal**: Check the full item set for consistency, gaps, and headless execution readiness.
264
-
265
- See `${SKILL_DIR}/references/planning-phases.md` for the full 5-step review checklist and review summary table format.
266
-
267
- **CHECKPOINT CP-RP-5**: Completeness review passed, all issues resolved.
268
-
269
- ### Phase 7: Generate & Validate
270
-
271
- **Goal**: Produce `.prizmkit/plans/refactor-list.json` and validate it.
272
-
273
- **IMPORTANT: Do NOT hand-write the final JSON file.** Instead:
274
- 1. Write a draft JSON to `.prizmkit/plans/refactor-list.draft.json` with all collected refactor data.
275
- 2. Call the generate script to validate and produce the final file:
276
- ```powershell
277
- Invoke-PrizmPython ${SKILL_DIR}/scripts/validate-and-generate-refactor.py generate --input .prizmkit/plans/refactor-list.draft.json --output .prizmkit/plans/refactor-list.json
278
- ```
279
- The script fills in defaults (`$schema`, `created_at`, `created_by`), validates all fields, and writes the final file only if validation passes.
280
- 3. If validation fails -> fix the draft and retry (max 3 attempts)
281
- 4. If validation passes -> present final summary
282
-
283
- **CHECKPOINT CP-RP-6**: `.prizmkit/plans/refactor-list.json` generated and validated.
284
-
285
- ## Checkpoints (Mandatory Gates)
286
-
287
- | Checkpoint | Artifact/State | Criteria | Phase |
288
- |-----------|----------------|----------|-------|
289
- | **CP-RP-0** | Project Context | Tech stack, test suite status, .prizmkit/prizm-docs loaded | 1 |
290
- | **CP-RP-1** | Goals Collected | All refactoring goals understood, no open ambiguities | 2 |
291
- | **CP-RP-2** | Code Analyzed | Analysis complete, user agrees with approach | 3 |
292
- | **CP-RP-3** | Items Decomposed | All items have deps, complexity, preservation strategy | 4 |
293
- | **CP-RP-4** | Items Confirmed | User confirmed/modified/skipped each item | 5 |
294
- | **CP-RP-5** | Completeness OK | DAG valid, preservation strategies declared, no gaps | 6 |
295
- | **CP-RP-6** | Output Valid | `.prizmkit/plans/refactor-list.json` passes validation script | 7 |
296
-
297
- ## Output Rules
298
-
299
- `.prizmkit/plans/refactor-list.json` must satisfy:
300
- - `$schema` = `dev-pipeline-refactor-list-v1`
301
- - Non-empty `refactors` array
302
- - Sequential IDs: `R-001`, `R-002`, ...
303
- - Valid dependency DAG (no cycles)
304
- - Each item has a declared `behavior_preservation` object with `strategy` field: `"test-gate"`, `"snapshot"`, or `"manual"`. Optional fields: `existing_tests` (boolean), `new_tests_needed` (string array). See `.prizmkit/dev-pipeline/templates/refactor-list-schema.json` for the full schema.
305
- - `priority` must be a string: `"critical"`, `"high"`, `"medium"`, or `"low"`
306
- - New items default `status: "pending"`
307
- - English titles for stable slug generation
308
- - `type` field must be one of: `extract`, `rename`, `restructure`, `simplify`, `decouple`, `migrate`
309
- - Descriptions minimum 15 words (error). Recommended: 30/50/80 words for low/medium/high complexity (warning).
310
- - `model` field is optional — omitting it means the pipeline uses $MODEL env or CLI default
311
- - `scope` object with nested structure: `files` array (target file paths) and `modules` array (module names)
312
-
313
- ## Adversarial Critic Defaults
314
-
315
- Set default critic fields for each refactor item. The user can override per-item.
316
-
317
- | Priority | Complexity | `critic` | `critic_count` |
318
- |----------|-----------|----------|----------------|
319
- | critical | high | `true` | `3` |
320
- | critical | medium/low | `true` | `1` |
321
- | high | high | `true` | `1` |
322
- | other combinations | any | `false` | (omitted) |
323
-
324
- ---
325
-
326
- ## Fast Path
327
-
328
- For simple refactoring with minimal scope (1-2 items, low/medium complexity, no cross-module impact, existing test coverage). Read `${SKILL_DIR}/references/fast-path.md` for eligibility criteria, full workflow (including AskUserQuestion format), conditions NOT to use, and an example session.
329
-
330
- ## Browser Verification
331
-
332
- Browser verification is a feature-pipeline capability only. Refactors use `behavior_preservation` strategy instead. Read `${SKILL_DIR}/references/planning-phases.md` for strategy details and UI refactoring examples.
333
-
334
- ---
335
-
336
- ## Refactoring-Specific Features
337
-
338
- ### Behavior Preservation Check
339
-
340
- Every item MUST declare a behavior preservation strategy. Read `${SKILL_DIR}/references/behavior-preservation.md` for strategy details. See `${SKILL_DIR}/references/planning-phases.md` for the strategy selection table and manual-strategy flagging rules.
341
-
342
- ### Dependency Ordering
343
-
344
- Auto-detect inter-item dependencies and enforce safe ordering. Read `${SKILL_DIR}/references/planning-phases.md` for the full dependency ordering rules (safe renames -> extract/inline -> structural -> migrations).
345
-
346
- ### Complexity Assessment
347
-
348
- Assess each item's complexity based on file count, cross-module scope, test coverage, and pattern familiarity. Read `${SKILL_DIR}/references/planning-phases.md` for the full complexity assessment criteria and scoring rules.
349
-
350
- ## Next-Step Execution Policy (after planning)
351
-
352
- Recommend invoking `refactor-pipeline-launcher` to configure and launch the dev-pipeline. Do NOT recommend running shell scripts directly — that is the launcher's responsibility.
353
-
354
- ## Error Recovery & Resume
355
-
356
- Key behaviors:
357
- - Warnings only -> proceed with user approval
358
- - Critical errors -> group by type, auto-fix where possible, max 3 total attempts
359
- - Interrupted session -> detect checkpoint from existing artifacts, offer resume or restart
360
- - `.prizmkit/plans/refactor-list.json` MUST be written to `.prizmkit/plans/` (project root level: `./{root}/.prizmkit/plans/refactor-list.json`)
361
-
362
- ### Resume Detection
363
-
364
- If existing artifacts are found, offer to resume from the appropriate checkpoint/phase:
365
-
366
- | Artifact Found | Resume From |
367
- |---------------|------------|
368
- | Nothing | Phase 1: Project Context |
369
- | Draft in `.prizmkit/plans/` | Phase matching draft state |
370
- | Partial `.prizmkit/plans/refactor-list.json` | Phase 6: Completeness Review |
371
- | Valid `.prizmkit/plans/refactor-list.json` | Mode D: Summary |
372
-
373
- ### Session Exit Gate
374
-
375
- Prevent accidental session exit without deliverable completion.
376
-
377
- **Trigger conditions** — activate the exit gate when ALL are true:
378
- - User invoked `/refactor-planner` (not just mentioned refactoring)
379
- - Current phase < Phase 7 (validation not yet passed)
380
- - No valid `.prizmkit/plans/refactor-list.json` has been written in this session
381
-
382
- **Gate behavior** — when the session appears to be ending:
383
- 1. **Remind**: "You set out to produce `.prizmkit/plans/refactor-list.json` but we haven't completed it yet."
384
- 2. **Offer 3 options**:
385
- - **(a) Continue to completion** — resume from current phase
386
- - **(b) Save draft & exit** — write current progress as draft, exit session
387
- - **(c) Abandon** — exit without saving
388
- 3. **If (b)**: Write draft and remind: "This is a draft, not validated. Run `/refactor-planner` again to resume."
389
- 4. **If (c)**: Accept without further prompting.
390
-
391
- ## Handoff Message Template
392
-
393
- After successful validation, report:
394
- 1. Output file path
395
- 2. Total refactor items
396
- 3. Dependency ordering highlights (which items must run first)
397
- 4. Behavior preservation strategy distribution (N items with test-gate, M with snapshot, etc.)
398
- 5. Recommended next action: `refactor-pipeline-launcher`
@@ -1,292 +0,0 @@
1
- # Refactor Planning Reference Guide
2
-
3
- This guide provides structured patterns, decision matrices, and templates for decomposing refactoring goals into well-scoped, executable items. It is intended as a practical reference for the AI during interactive refactor planning sessions.
4
-
5
- ---
6
-
7
- ## 1. Identifying Refactoring Boundaries
8
-
9
- Refactoring boundaries define where one refactor item ends and another begins. Good boundaries produce items that are independently executable and independently verifiable.
10
-
11
- ### Boundary Heuristics
12
-
13
- | Signal | Boundary Type | Example |
14
- |--------|--------------|---------|
15
- | Different files/modules | Module boundary | "Extract auth logic" vs "Extract validation logic" |
16
- | Different refactoring operations | Operation boundary | "Rename function" vs "Extract class" |
17
- | Different risk levels | Risk boundary | "Safe rename" vs "Restructure module internals" |
18
- | Different test suites affected | Test boundary | "Changes unit tests only" vs "Changes integration tests" |
19
- | Sequential dependency | Dependency boundary | "Rename X" must complete before "Move X to new module" |
20
-
21
- ### Rules for Setting Boundaries
22
-
23
- 1. **One operation type per item.** Don't mix a rename with a structural extraction in the same item.
24
- 2. **One module scope per item** (unless the refactoring specifically targets cross-module concerns like decoupling).
25
- 3. **Each item should be independently testable.** After completing item R-001, all tests should pass before starting R-002.
26
- 4. **If an item requires more than 3 files to change simultaneously**, consider splitting it.
27
- 5. **If behavior preservation requires different strategies for different parts**, split into separate items with appropriate strategies.
28
-
29
- ---
30
-
31
- ## 2. Description Writing Guide
32
-
33
- Refactor item descriptions are the primary input for autonomous pipeline sessions. A thin description forces the AI to guess about scope and safety constraints.
34
-
35
- ### Minimum Word Counts
36
-
37
- | Complexity | Minimum Words | Warning Threshold |
38
- |------------|---------------|-------------------|
39
- | low | 15 | 30 |
40
- | medium | 15 | 50 |
41
- | high | 15 | 80 |
42
-
43
- Below 15 words is a validation error. Below the threshold triggers a warning.
44
-
45
- ### What to Include
46
-
47
- Every refactor description should cover:
48
-
49
- 1. **What to change** — specific files, functions, classes, or patterns being refactored
50
- 2. **How to change it** — the refactoring operation (extract, rename, move, inline, simplify)
51
- 3. **Why** — the motivation (reduce complexity, improve testability, remove duplication)
52
- 4. **Constraints** — what must NOT change (public API, behavior contracts, external interfaces)
53
- 5. **Verification** — how to confirm the refactoring succeeded without breaking behavior
54
-
55
- ### Good vs Bad Examples
56
-
57
- **Bad** (12 words — too thin):
58
- ```
59
- "Extract the validation logic from the handler into a separate module."
60
- ```
61
-
62
- **Good** (55 words — implementation-ready):
63
- ```
64
- "Extract all input validation functions from src/api/handler.js (validateEmail, validatePassword, validateUsername) into a new src/utils/validators.js module. Update all imports in handler.js and any other files that import these functions directly. Preserve the exact function signatures and return types. The handler.js file should import from the new location. All existing tests must continue to pass without modification."
65
- ```
66
-
67
- **Bad** (14 words):
68
- ```
69
- "Convert the user service from callbacks to async/await pattern throughout."
70
- ```
71
-
72
- **Good** (72 words — implementation-ready):
73
- ```
74
- "Convert src/services/user-service.js from callback-based functions to async/await. Target functions: createUser, findUserById, updateUser, deleteUser (4 functions total). Each function currently accepts a callback as the last parameter and calls it with (err, result). Convert to return Promises and use async/await internally. Update all callers in src/routes/user-routes.js to use await instead of passing callbacks. Preserve all error handling behavior — errors that were passed to callbacks should now be thrown."
75
- ```
76
-
77
- ---
78
-
79
- ## 3. Common Refactoring Patterns
80
-
81
- Use these patterns as starting points when decomposing refactoring goals.
82
-
83
- ### Pattern A: Extract Method/Function
84
-
85
- **When**: A function is too long, has multiple responsibilities, or contains duplicated logic.
86
-
87
- ```
88
- R-001: Extract [specific logic] from [source function] into [new function name]
89
- Type: extract
90
- Scope: [source file]
91
- Complexity: low
92
- Preservation: test-gate
93
- ```
94
-
95
- ### Pattern B: Extract Class/Module
96
-
97
- **When**: A file/class is too large, a group of functions share a common concern, or a module has multiple responsibilities.
98
-
99
- ```
100
- R-001: Create new module [name] with extracted [concern] logic
101
- Type: extract
102
- Scope: [source file, new file]
103
- Complexity: medium
104
- Preservation: test-gate
105
-
106
- R-002: Update imports to use new [name] module (deps: R-001)
107
- Type: restructure
108
- Scope: [all importing files]
109
- Complexity: low
110
- Preservation: test-gate
111
- ```
112
-
113
- ### Pattern C: Move Module/File
114
-
115
- **When**: A file is in the wrong directory, module organization needs restructuring.
116
-
117
- ```
118
- R-001: Move [file] from [old path] to [new path]
119
- Type: restructure
120
- Scope: [file, all importers]
121
- Complexity: low-medium (depends on import count)
122
- Preservation: test-gate
123
- ```
124
-
125
- ### Pattern D: Inline (Reverse of Extract)
126
-
127
- **When**: An abstraction is unnecessary, a wrapper adds no value, or indirection hurts readability.
128
-
129
- ```
130
- R-001: Inline [function/module] into [target]
131
- Type: simplify
132
- Scope: [source file, target file]
133
- Complexity: low
134
- Preservation: test-gate
135
- ```
136
-
137
- ### Pattern E: Rename (Variable, Function, Class, File)
138
-
139
- **When**: Names are misleading, inconsistent, or don't follow conventions.
140
-
141
- ```
142
- R-001: Rename [old name] to [new name] across codebase
143
- Type: rename
144
- Scope: [all files containing the name]
145
- Complexity: low
146
- Preservation: test-gate
147
- ```
148
-
149
- ### Pattern F: Decouple Dependencies
150
-
151
- **When**: Circular dependencies, tight coupling between modules, or difficulty testing in isolation.
152
-
153
- ```
154
- R-001: Define interface/contract for [dependency] (deps: none)
155
- Type: decouple
156
- Scope: [new interface file]
157
- Complexity: medium
158
- Preservation: test-gate
159
-
160
- R-002: Implement [dependency] behind new interface (deps: R-001)
161
- Type: decouple
162
- Scope: [implementation file]
163
- Complexity: medium
164
- Preservation: test-gate
165
-
166
- R-003: Update consumers to use interface instead of concrete (deps: R-002)
167
- Type: decouple
168
- Scope: [all consumer files]
169
- Complexity: medium
170
- Preservation: test-gate
171
- ```
172
-
173
- ### Pattern G: Architecture Migration
174
-
175
- **When**: Converting between paradigms (callbacks to promises, classes to functions, monolith to modules).
176
-
177
- ```
178
- R-001: Add new [pattern] alongside old [pattern] (deps: none)
179
- Type: migrate
180
- Scope: [target files]
181
- Complexity: medium-high
182
- Preservation: test-gate or snapshot
183
-
184
- R-002: Migrate [specific area] to new pattern (deps: R-001)
185
- Type: migrate
186
- Scope: [area files]
187
- Complexity: medium
188
- Preservation: test-gate
189
-
190
- R-003: Remove old [pattern] code (deps: R-002)
191
- Type: simplify
192
- Scope: [cleaned files]
193
- Complexity: low
194
- Preservation: test-gate
195
- ```
196
-
197
- ---
198
-
199
- ## 4. Dependency Ordering Rules
200
-
201
- Correct ordering minimizes risk and ensures each step is independently verifiable.
202
-
203
- ### Ordering Priority (execute in this order)
204
-
205
- 1. **Safe renames** — Lowest risk. Pure name changes with no structural impact. Can be reverted trivially.
206
- 2. **Extract/inline** — Moderate risk. Changes module boundaries but doesn't reorganize architecture.
207
- 3. **Structural changes** — Higher risk. Reorganizes file layout, module hierarchy, or dependency graph.
208
- 4. **Migrations** — Highest risk. Changes programming patterns or paradigms.
209
-
210
- ### Dependency Rules
211
-
212
- 1. **No circular dependencies.** Dependencies MUST form a directed acyclic graph (DAG).
213
- 2. **Minimal dependency sets.** Each item should depend only on items it directly needs.
214
- 3. **Rename before restructure.** If you're renaming something AND moving it, rename first (easier to track).
215
- 4. **Create before consume.** If item A creates a new module and item B uses it, B depends on A.
216
- 5. **Interface before implementation.** If decoupling, define the interface before implementing behind it.
217
- 6. **Preserve before remove.** If migrating, ensure new code works before removing old code.
218
-
219
- ### Validation Checklist
220
-
221
- - [ ] No item depends on itself
222
- - [ ] No circular dependency chains exist
223
- - [ ] Every item ID referenced in a dependency list is defined in the plan
224
- - [ ] The graph can be topologically sorted
225
- - [ ] Renames appear before structural changes that reference the renamed entities
226
-
227
- ---
228
-
229
- ## 5. Acceptance Criteria for Refactoring
230
-
231
- Refactoring acceptance criteria focus on structural improvement AND behavior preservation. They differ from feature acceptance criteria.
232
-
233
- ### Standard Criteria Templates
234
-
235
- **For extract operations:**
236
- - [ ] New module/function exists at [target path]
237
- - [ ] Original location imports from new location (no duplication)
238
- - [ ] All existing tests pass without modification
239
- - [ ] No new circular dependencies introduced
240
-
241
- **For rename operations:**
242
- - [ ] Old name does not appear anywhere in codebase (except git history)
243
- - [ ] All references updated to new name
244
- - [ ] All existing tests pass without modification
245
-
246
- **For restructure operations:**
247
- - [ ] Files are in their new locations
248
- - [ ] All import paths updated
249
- - [ ] Module boundary is clean (no reaching into internal paths)
250
- - [ ] All existing tests pass without modification
251
-
252
- **For decouple operations:**
253
- - [ ] Interface/contract defined and documented
254
- - [ ] Implementation satisfies interface
255
- - [ ] Consumers depend on interface, not implementation
256
- - [ ] No circular dependencies remain
257
- - [ ] All existing tests pass without modification
258
-
259
- **For migrate operations:**
260
- - [ ] New pattern is used in target area
261
- - [ ] Old pattern code is removed (no dead code)
262
- - [ ] All existing tests pass (may need test updates to use new pattern)
263
- - [ ] Behavior is identical (verified via test-gate or snapshot)
264
-
265
- ### Writing Principles
266
-
267
- 1. **Always include "all existing tests pass"** — this is the fundamental refactoring invariant.
268
- 2. **Be specific about structural outcomes** — "files are organized by feature" is vague; "auth files are in src/features/auth/" is concrete.
269
- 3. **Include negative criteria** — "no circular dependencies", "no dead code", "no duplicated logic".
270
- 4. **Keep count manageable** — 3-5 criteria per item. More than 6 suggests the item should be split.
271
-
272
- ---
273
-
274
- ## 6. Complexity Estimation for Refactoring
275
-
276
- | Factor | Low | Medium | High |
277
- |--------|-----|--------|------|
278
- | File count | 1-2 files | 3-5 files | 6+ files |
279
- | Cross-module scope | Same module | 2 modules | 3+ modules |
280
- | Test coverage | High (>80%) | Moderate (40-80%) | Low (<40%) |
281
- | Pattern familiarity | Well-known (rename, extract) | Common (restructure) | Novel (custom migration) |
282
- | Dependency changes | None | Minor (1-2 imports) | Significant (module graph changes) |
283
-
284
- **Rule**: Take the highest individual factor as the overall complexity. When in doubt, estimate higher.
285
-
286
- ### Complexity Red Flags (Consider Splitting)
287
-
288
- - Item touches more than 5 files
289
- - Item requires changes to both test files and source files in non-trivial ways
290
- - Item involves both structural change AND pattern migration
291
- - Item has more than 6 acceptance criteria
292
- - Item's description exceeds 100 words (suggests multiple operations combined)