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
@@ -11,8 +11,8 @@ Launch the autonomous refactor pipeline from within an AI CLI conversation. The
11
11
 
12
12
  Three execution modes are available. The user chooses one before configuring other options:
13
13
 
14
- 1. **Foreground** (recommended) — `.prizmkit/dev-pipeline/run-refactor.sh run`. Visible output, direct error feedback, no orphaned processes.
15
- 2. **Background daemon** — `.prizmkit/dev-pipeline/launch-refactor-daemon.sh`. Runs fully detached, survives AI CLI session closure.
14
+ 1. **Foreground** (recommended) — `python3 ./.prizmkit/dev-pipeline/cli.py refactor run`. Visible output, direct error feedback, no orphaned processes.
15
+ 2. **Background daemon** — `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json`. Runs fully detached, survives AI CLI session closure.
16
16
  3. **Manual** — Display the assembled command(s) only. Do not execute anything. User runs them on their own.
17
17
 
18
18
  ### When to Use
@@ -45,15 +45,15 @@ Three execution modes are available. The user chooses one before configuring oth
45
45
 
46
46
  Before any action, validate:
47
47
 
48
- 1. **refactor pipeline exists**: Confirm `.prizmkit/dev-pipeline/launch-refactor-daemon.sh` and `.prizmkit/dev-pipeline/run-refactor.sh` are present and executable
48
+ 1. **refactor pipeline exists**: Confirm `.prizmkit/dev-pipeline/cli.py` is present
49
49
  2. **For start**: `.prizmkit/plans/refactor-list.json` must exist in `.prizmkit/plans/` (or user-specified path)
50
- 3. **Dependencies**: `jq`, `python3`, AI CLI (`cbc` or `claude`) must be in PATH
51
- 4. **Python version**: Requires Python 3.8+ for dev-pipeline scripts
50
+ 3. **Dependencies**: `python3`, `git`, and AI CLI (`cbc` or `claude`) must be in PATH
51
+ 4. **Python version**: Requires Python 3.10+ for the unified dev-pipeline runtime
52
52
  5. **Browser tools** (optional): If any refactor has `browser_interaction` field, check the corresponding tool is available. Refactors may specify `tool: "playwright-cli"`, `tool: "opencli"`, or `tool: "auto"` (AI chooses at runtime).
53
53
 
54
54
  Quick check:
55
55
  ```bash
56
- command -v jq && command -v python3 && (command -v cbc || command -v claude) && echo "All dependencies OK"
56
+ command -v python3 && command -v git && (command -v cbc || command -v claude) && echo "All dependencies OK"
57
57
  # Optional: browser interaction support (check both tools — refactors may use either)
58
58
  command -v playwright-cli && echo "playwright-cli OK" || echo "playwright-cli not found (playwright browser verification will be skipped)"
59
59
  command -v opencli && echo "opencli OK" || echo "opencli not found (opencli browser verification will be skipped)"
@@ -79,7 +79,7 @@ Detect user intent from their message, then follow the corresponding workflow:
79
79
 
80
80
  2. **Check not already running**:
81
81
  ```bash
82
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh status 2>/dev/null
82
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status 2>/dev/null
83
83
  ```
84
84
  If running, inform user and ask: "Refactor pipeline is already running. Want to restart it, check status, or view logs?"
85
85
 
@@ -106,10 +106,7 @@ Detect user intent from their message, then follow the corresponding workflow:
106
106
  ```
107
107
  If pipeline state already exists, use the status command instead:
108
108
  ```bash
109
- python3 .prizmkit/dev-pipeline/scripts/update-refactor-status.py \
110
- --refactor-list .prizmkit/plans/refactor-list.json \
111
- --state-dir .prizmkit/state/refactor \
112
- --action status 2>/dev/null
109
+ python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
113
110
  ```
114
111
 
115
112
  4. **Run preflight checks** (behavior-preservation baseline):
@@ -168,34 +165,34 @@ Detect user intent from their message, then follow the corresponding workflow:
168
165
 
169
166
  **Foreground command:**
170
167
  ```bash
171
- VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 .prizmkit/dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
168
+ VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json
172
169
  ```
173
170
  With all options:
174
171
  ```bash
175
172
  VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high \
176
- .prizmkit/dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
173
+ python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json
177
174
  ```
178
175
 
179
176
  **Background daemon command:**
180
177
  ```bash
181
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
178
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
182
179
  ```
183
180
  With all options:
184
181
  ```bash
185
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json \
182
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json \
186
183
  --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 ENABLE_DEPLOY=1"
187
184
  ```
188
185
 
189
186
  **Manual mode**: Print the assembled command(s) and **stop here**. Do not execute anything. Do not proceed to step 8.
190
187
  ```
191
188
  # To run in foreground:
192
- VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 .prizmkit/dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
189
+ VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json
193
190
 
194
191
  # To run in background (detached):
195
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
192
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
196
193
 
197
194
  # To check status:
198
- .prizmkit/dev-pipeline/run-refactor.sh status .prizmkit/plans/refactor-list.json
195
+ python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
199
196
  ```
200
197
 
201
198
  8. **Confirm and launch** (Foreground and Background only — Manual mode ends at step 7):
@@ -209,16 +206,16 @@ Detect user intent from their message, then follow the corresponding workflow:
209
206
  **If foreground**: Pipeline runs to completion in the terminal. After it finishes:
210
207
  - Summarize results: total refactors, succeeded, failed, skipped
211
208
  - If all succeeded: each refactor session has already run `prizmkit-retrospective` internally. Ask user what's next.
212
- - If some failed: show failed refactor IDs and suggest `reset-refactor.sh <R-XXX> --clean --run` for a fresh retry
209
+ - If some failed: show failed refactor IDs and suggest `python3 ./.prizmkit/dev-pipeline/cli.py reset refactor <R-XXX> --clean --run` for a fresh retry
213
210
 
214
211
  **If background daemon**:
215
212
  1. Verify launch:
216
213
  ```bash
217
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh status
214
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status
218
215
  ```
219
216
  2. Start log monitoring — Use the Bash tool with `run_in_background: true`:
220
217
  ```bash
221
- tail -f .prizmkit/state/refactor/pipeline-daemon.log
218
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --follow
222
219
  ```
223
220
  3. Report to user:
224
221
  - Pipeline PID
@@ -232,20 +229,17 @@ Detect user intent from their message, then follow the corresponding workflow:
232
229
 
233
230
  1. **Check daemon status**:
234
231
  ```bash
235
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh status
232
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status
236
233
  ```
237
234
 
238
235
  2. **Show refactor-level progress**:
239
236
  ```bash
240
- python3 .prizmkit/dev-pipeline/scripts/update-refactor-status.py \
241
- --refactor-list .prizmkit/plans/refactor-list.json \
242
- --state-dir .prizmkit/state/refactor \
243
- --action status
237
+ python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
244
238
  ```
245
239
 
246
240
  3. **Show recent log activity** (last 20 lines):
247
241
  ```bash
248
- tail -20 .prizmkit/state/refactor/pipeline-daemon.log
242
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --lines 20
249
243
  ```
250
244
 
251
245
  4. **Summarize** to user: total refactors, completed, in-progress, failed, pending.
@@ -256,12 +250,12 @@ Detect user intent from their message, then follow the corresponding workflow:
256
250
 
257
251
  1. **Stop the daemon**:
258
252
  ```bash
259
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh stop
253
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor stop
260
254
  ```
261
255
 
262
256
  2. **Verify stopped**:
263
257
  ```bash
264
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh status 2>/dev/null || true
258
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status 2>/dev/null || true
265
259
  ```
266
260
 
267
261
  3. **Inform user**: "Refactor pipeline stopped. State is preserved -- you can resume later with 'start refactoring' and it will pick up where it left off."
@@ -272,17 +266,17 @@ Detect user intent from their message, then follow the corresponding workflow:
272
266
 
273
267
  1. **Check if running**:
274
268
  ```bash
275
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh status 2>/dev/null
269
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status 2>/dev/null
276
270
  ```
277
271
 
278
272
  2. **If running** -- Start live tail with Bash tool `run_in_background: true`:
279
273
  ```bash
280
- tail -f .prizmkit/state/refactor/pipeline-daemon.log
274
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --follow
281
275
  ```
282
276
 
283
277
  3. **If not running** -- Show last 50 lines:
284
278
  ```bash
285
- tail -50 .prizmkit/state/refactor/pipeline-daemon.log
279
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --lines 50
286
280
  ```
287
281
 
288
282
  4. **For per-refactor session logs** (when user asks about a specific refactor):
@@ -300,12 +294,12 @@ Detect user intent from their message, then follow the corresponding workflow:
300
294
  When user says "retry R-001" or "clean retry R-001":
301
295
 
302
296
  ```bash
303
- .prizmkit/dev-pipeline/reset-refactor.sh R-001 --clean --run .prizmkit/plans/refactor-list.json
297
+ python3 ./.prizmkit/dev-pipeline/cli.py reset refactor R-001 --clean --run .prizmkit/plans/refactor-list.json
304
298
  ```
305
299
 
306
300
  Notes:
307
- - `reset-refactor.sh --clean --run` performs a full clean (deletes session history and artifacts) before retrying — this gives a fresh start.
308
- - Keep pipeline daemon mode for main run management (`launch-refactor-daemon.sh`).
301
+ - `python3 ./.prizmkit/dev-pipeline/cli.py reset refactor <R-XXX> --clean --run .prizmkit/plans/refactor-list.json` performs a full clean (deletes session history and artifacts) before retrying the selected refactor — this gives a fresh start.
302
+ - Keep pipeline daemon mode for main run management (`python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start`, `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status`, or `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor stop`).
309
303
 
310
304
  ---
311
305
 
@@ -37,17 +37,18 @@ Not exposed in interactive menu, pass via `--env`:
37
37
  | `.prizmkit/plans/refactor-list.json` not found | Tell user to run `refactor-planner` skill first |
38
38
  | Circular dependencies in refactor list | Fix dependency graph in `.prizmkit/plans/refactor-list.json` before launching |
39
39
  | Test baseline failing | Fix failing tests before starting refactoring — behavior preservation requires a green baseline |
40
- | `jq` not installed | Suggest: `brew install jq` |
40
+ | `python3` not installed | Install Python 3.10+ and rerun the Python runtime command |
41
+ | `git` not installed | Install git; the Python runtime uses git for branch/worktree/status operations |
41
42
  | `cbc`/`claude` not in PATH | Check AI CLI installation |
42
43
  | Refactor pipeline already running | Show status, ask if user wants to stop and restart |
43
- | PID file stale (process dead) | `launch-refactor-daemon.sh` auto-cleans, retry start |
44
- | Launch failed (process died immediately) | Show last 20 lines of log: `tail -20 .prizmkit/state/refactor/pipeline-daemon.log` |
45
- | Refactor stuck/blocked | Use `reset-refactor.sh <R-XXX> --clean --run` for a fresh retry |
46
- | All refactors blocked/failed | Show status, suggest recovery: `.prizmkit/dev-pipeline/reset-refactor.sh <R-XXX> --clean --run .prizmkit/plans/refactor-list.json` |
44
+ | PID file stale (process dead) | `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json` auto-cleans, retry start |
45
+ | Launch failed (process died immediately) | Show last 20 lines of log: `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --lines 20` |
46
+ | Refactor stuck/blocked | Use `python3 ./.prizmkit/dev-pipeline/cli.py reset refactor <R-XXX> --clean --run` for a fresh retry |
47
+ | All refactors blocked/failed | Show status, suggest recovery: `python3 ./.prizmkit/dev-pipeline/cli.py reset refactor <R-XXX> --clean --run .prizmkit/plans/refactor-list.json` |
47
48
  | `playwright-cli` not installed | Browser verification skipped for playwright refactors (non-blocking). Suggest: `npm install -g @playwright/cli@latest && playwright-cli install --skills` |
48
49
  | `opencli` not installed | Browser verification skipped for opencli refactors (non-blocking). Install opencli for Chrome session-based browser verification |
49
50
  | Deploy session failed | Pipeline completed but deploy session exited non-zero. Check `.prizmkit/state/refactor/deploy/<session_id>/logs/session.log`. Retry manually: `/prizmkit-deploy`. |
50
- | Permission denied on script | Run `chmod +x .prizmkit/dev-pipeline/launch-refactor-daemon.sh .prizmkit/dev-pipeline/run-refactor.sh` |
51
+ | Permission denied running Python CLI | Ensure Python is installed and the command uses `python3 ./.prizmkit/dev-pipeline/cli.py ...` |
51
52
 
52
53
  ## Advanced Configuration Round
53
54
 
@@ -234,7 +234,7 @@ AskUserQuestion:
234
234
 
235
235
  1. **Initial status check**:
236
236
  ```bash
237
- .prizmkit/dev-pipeline/launch-refactor-daemon.sh status
237
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status
238
238
  ```
239
239
 
240
240
  2. **Offer monitoring options**:
@@ -244,10 +244,7 @@ AskUserQuestion:
244
244
 
245
245
  3. **Periodic progress reports** (when user asks):
246
246
  ```bash
247
- python3 .prizmkit/dev-pipeline/scripts/update-refactor-status.py \
248
- --refactor-list .prizmkit/plans/refactor-list.json \
249
- --state-dir .prizmkit/state/refactor \
250
- --action status
247
+ python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
251
248
  ```
252
249
 
253
250
  4. **Completion report** (when pipeline finishes all refactor items):
@@ -306,7 +303,7 @@ While the pipeline runs, the user can continue the conversation:
306
303
  | No tests exist for target module | WARN user, recommend writing tests first before refactoring |
307
304
  | `refactor-planner` cannot parse goals | Refine the goals summary and retry |
308
305
  | `.prizmkit/plans/refactor-list.json` generation failed | Show error, retry with refined input |
309
- | Pipeline launch failed | Show daemon log, suggest manual start |
306
+ | Pipeline launch failed | Show daemon log, suggest manual start with `python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json` or `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json` |
310
307
  | All refactor items blocked/failed | Show status, suggest retrying specific items |
311
308
  | User wants to cancel mid-brainstorming | Save conversation context, offer to resume later |
312
309
  | Behavior regression detected during pipeline | Pipeline handles per-item — failed items are retried or reported |
@@ -6,7 +6,7 @@
6
6
  "hooks": [
7
7
  {
8
8
  "type": "command",
9
- "command": "SRC=$(git diff --cached --name-only 2>/dev/null | grep -cE '\\.(ts|tsx|js|jsx|py|go|rs|java)$'); if [ \"$SRC\" -gt 0 ]; then PRIZM=$(git diff --cached --name-only 2>/dev/null | grep -c '^\\.prizmkit/prizm-docs/'); if [ \"$PRIZM\" -gt 0 ]; then echo \"PRIZMKIT_DOC_STATUS: $SRC source file(s) staged | .prizmkit/prizm-docs/ updated ($PRIZM file(s))\"; else echo \"PRIZMKIT_DOC_STATUS: $SRC source file(s) staged | .prizmkit/prizm-docs/ NOT UPDATED — update if this is a feature change\"; fi; fi"
9
+ "command": "python3 -c \"import subprocess,sys; r=subprocess.run(['git','diff','--cached','--name-only'],text=True,encoding='utf-8',errors='replace',stdout=subprocess.PIPE,stderr=subprocess.DEVNULL); files=[p for p in r.stdout.splitlines() if p.strip()] if r.returncode==0 else []; src=[p for p in files if p.endswith(('.ts','.tsx','.js','.jsx','.py','.go','.rs','.java'))]; prizm=[p for p in files if p.startswith('.prizmkit/prizm-docs/')]; print(f'PRIZMKIT_DOC_STATUS: {len(src)} source file(s) staged | .prizmkit/prizm-docs/ updated ({len(prizm)} file(s))' if src and prizm else (f'PRIZMKIT_DOC_STATUS: {len(src)} source file(s) staged | .prizmkit/prizm-docs/ NOT UPDATED — update if this is a feature change' if src else ''), end='')\""
10
10
  }
11
11
  ]
12
12
  }
@@ -17,7 +17,7 @@
17
17
  "hooks": [
18
18
  {
19
19
  "type": "command",
20
- "command": "TOOL_INPUT=\"${CLAUDE_TOOL_INPUT:-${CODEBUDDY_TOOL_INPUT:-}}\"; if echo \"$TOOL_INPUT\" | grep -qE 'git (commit|merge|rebase)' 2>/dev/null; then DRIFT=$(sh .prizmkit/scripts/diff-prizm-docs.sh 2>/dev/null); if [ -n \"$DRIFT\" ]; then echo \"PRIZMKIT_DRIFT_DETECTED: prizm-docs structural differences found:\"; echo \"$DRIFT\"; echo \"Please update affected .prizmkit/prizm-docs/ files.\"; fi; fi"
20
+ "command": "python3 -c \"import os,re,subprocess,sys; data=os.environ.get('CLAUDE_TOOL_INPUT') or os.environ.get('CODEBUDDY_TOOL_INPUT') or ''; script='.prizmkit/scripts/diff-prizm-docs.py'; should=bool(re.search(r'git\\s+(commit|merge|rebase)', data)); res=subprocess.run([sys.executable, script],text=True,encoding='utf-8',errors='replace',stdout=subprocess.PIPE,stderr=subprocess.DEVNULL) if should and os.path.isfile(script) else None; drift=(res.stdout.strip() if res else ''); print('PRIZMKIT_DRIFT_DETECTED: prizm-docs structural differences found:\\n'+drift+'\\nPlease update affected .prizmkit/prizm-docs/ files.') if drift else None\""
21
21
  }
22
22
  ]
23
23
  }
@@ -0,0 +1,226 @@
1
+ #!/usr/bin/env python3
2
+ """Report structural drift between .prizmkit/prizm-docs and source files."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import os
7
+ import re
8
+ from pathlib import Path, PurePosixPath
9
+
10
+ DOCS_ROOT = Path(".prizmkit/prizm-docs")
11
+ ROOT_PRIZM = DOCS_ROOT / "root.prizm"
12
+ SUPPORTED_EXTENSIONS = {
13
+ "go": [".go"],
14
+ "javascript": [".js", ".jsx"],
15
+ "typescript": [".ts", ".tsx"],
16
+ "javascript/typescript": [".ts", ".tsx", ".js", ".jsx"],
17
+ "typescript/javascript": [".ts", ".tsx", ".js", ".jsx"],
18
+ "python": [".py"],
19
+ "rust": [".rs"],
20
+ }
21
+ EXCLUDED_DIR_NAMES = {
22
+ "node_modules",
23
+ "vendor",
24
+ "dist",
25
+ "build",
26
+ "__pycache__",
27
+ "target",
28
+ "tests",
29
+ "__tests__",
30
+ ".claude",
31
+ ".codebuddy",
32
+ "dev-pipeline",
33
+ "coverage",
34
+ ".nyc_output",
35
+ "out",
36
+ "tmp",
37
+ }
38
+ ALL_CAPS_HEADER_RE = re.compile(r"^[A-Z_][A-Z_]*:")
39
+
40
+
41
+ def read_text(path: Path) -> str:
42
+ return path.read_text(encoding="utf-8", errors="replace")
43
+
44
+
45
+ def section_lines(lines: list[str], section: str) -> list[str]:
46
+ in_section = False
47
+ collected: list[str] = []
48
+ for line in lines:
49
+ stripped = line.strip()
50
+ if stripped == f"{section}:":
51
+ in_section = True
52
+ continue
53
+ if in_section and ALL_CAPS_HEADER_RE.match(stripped):
54
+ break
55
+ if in_section:
56
+ collected.append(line.rstrip("\n"))
57
+ return collected
58
+
59
+
60
+ def strip_tags(value: str) -> str:
61
+ return re.sub(r"\s+\[[^\]]*\]", "", value).strip()
62
+
63
+
64
+ def parse_module_line(line: str) -> tuple[str, str | None] | None:
65
+ stripped = line.strip()
66
+ if not stripped.startswith("- "):
67
+ return None
68
+ body = stripped[2:].strip()
69
+ pointer: str | None = None
70
+ if "->" in body:
71
+ body, pointer_part = body.split("->", 1)
72
+ pointer = pointer_part.strip().split()[0] if pointer_part.strip() else None
73
+ if ":" in body:
74
+ body = body.split(":", 1)[0]
75
+ source_path = strip_tags(body).strip()
76
+ if not source_path:
77
+ return None
78
+ return source_path, pointer
79
+
80
+
81
+ def parse_registered_modules(root_text: str) -> dict[str, str | None]:
82
+ lines = root_text.splitlines()
83
+ modules: dict[str, str | None] = {}
84
+ for section in ["MODULE_INDEX", "MODULE_GROUPS"]:
85
+ for line in section_lines(lines, section):
86
+ parsed = parse_module_line(line)
87
+ if parsed:
88
+ source_path, pointer = parsed
89
+ modules[source_path] = pointer
90
+ return modules
91
+
92
+
93
+ def parse_lang(root_text: str) -> list[str] | None:
94
+ for line in root_text.splitlines():
95
+ if line.startswith("LANG:"):
96
+ lang_value = line.split(":", 1)[1].strip().lower()
97
+ if lang_value in SUPPORTED_EXTENSIONS:
98
+ return SUPPORTED_EXTENSIONS[lang_value]
99
+ extensions: list[str] = []
100
+ for key, value in SUPPORTED_EXTENSIONS.items():
101
+ if key in lang_value:
102
+ extensions.extend(value)
103
+ return sorted(set(extensions)) or None
104
+ return None
105
+
106
+
107
+ def count_source_files(source_dir: Path, extensions: list[str] | None) -> int:
108
+ if not source_dir.is_dir():
109
+ return 0
110
+ count = 0
111
+ for child in source_dir.iterdir():
112
+ if not child.is_file() or child.name.startswith("."):
113
+ continue
114
+ if extensions is None or child.suffix in extensions:
115
+ count += 1
116
+ return count
117
+
118
+
119
+ def l1_path_for(source_path: str, pointer: str | None) -> Path:
120
+ if pointer:
121
+ pointer_path = PurePosixPath(pointer)
122
+ if pointer_path.is_absolute():
123
+ return Path(pointer)
124
+ if pointer.startswith(".prizmkit/prizm-docs/"):
125
+ return Path(pointer)
126
+ return DOCS_ROOT / pointer
127
+ return DOCS_ROOT / f"{source_path}.prizm"
128
+
129
+
130
+ def parse_declared_files(l1_path: Path) -> int | None:
131
+ if not l1_path.is_file():
132
+ return None
133
+ lines = read_text(l1_path).splitlines()
134
+ for index, line in enumerate(lines):
135
+ if not line.startswith("FILES:"):
136
+ continue
137
+ inline = line.split(":", 1)[1].strip()
138
+ if inline:
139
+ first = inline.split()[0]
140
+ if first.isdigit():
141
+ return int(first)
142
+ if "," in inline:
143
+ return len([part for part in inline.split(",") if part.strip()])
144
+ return 1
145
+ count = 0
146
+ for section_line in lines[index + 1 :]:
147
+ stripped = section_line.strip()
148
+ if ALL_CAPS_HEADER_RE.match(stripped):
149
+ break
150
+ if stripped.startswith("- "):
151
+ count += 1
152
+ return count
153
+ return None
154
+
155
+
156
+ def iter_prizm_docs() -> list[Path]:
157
+ return sorted(path for path in DOCS_ROOT.rglob("*.prizm") if path.is_file())
158
+
159
+
160
+ def source_path_for_doc(prizm_file: Path) -> str | None:
161
+ if prizm_file.name == "root.prizm":
162
+ return None
163
+ rel = prizm_file.relative_to(DOCS_ROOT).as_posix()
164
+ if len(PurePosixPath(rel).parts) > 1:
165
+ return None
166
+ return rel[: -len(".prizm")] if rel.endswith(".prizm") else rel
167
+
168
+
169
+ def should_skip_dir(dir_path: Path) -> bool:
170
+ parts = dir_path.parts
171
+ return any(part.startswith(".") for part in parts) or any(part in EXCLUDED_DIR_NAMES for part in parts)
172
+
173
+
174
+ def iter_candidate_dirs(max_depth: int = 3) -> list[Path]:
175
+ candidates: list[Path] = []
176
+ for root, dirs, _files in os.walk("."):
177
+ root_path = Path(root)
178
+ rel_path = Path(".") if root_path == Path(".") else root_path.relative_to(".")
179
+ depth = 0 if rel_path == Path(".") else len(rel_path.parts)
180
+ dirs[:] = [d for d in dirs if not should_skip_dir(rel_path / d)]
181
+ if depth == 0:
182
+ continue
183
+ if depth > max_depth:
184
+ dirs[:] = []
185
+ continue
186
+ if not should_skip_dir(rel_path):
187
+ candidates.append(rel_path)
188
+ return candidates
189
+
190
+
191
+ def main() -> int:
192
+ if not ROOT_PRIZM.is_file():
193
+ return 0
194
+
195
+ root_text = read_text(ROOT_PRIZM)
196
+ extensions = parse_lang(root_text)
197
+ registered = parse_registered_modules(root_text)
198
+ registered_paths = set(registered.keys())
199
+
200
+ for source_path, pointer in registered.items():
201
+ l1_file = l1_path_for(source_path, pointer)
202
+ declared = parse_declared_files(l1_file)
203
+ if declared is None:
204
+ continue
205
+ actual = count_source_files(Path(source_path), extensions)
206
+ if actual > 0 and declared != actual:
207
+ print(f"MODULE_DRIFT: {source_path} | declared FILES: {declared} | actual: {actual}")
208
+
209
+ for prizm_file in iter_prizm_docs():
210
+ source_path = source_path_for_doc(prizm_file)
211
+ if source_path is None:
212
+ continue
213
+ if not Path(source_path).is_dir():
214
+ print(f"ORPHAN_DOC: {prizm_file.as_posix()} | source dir missing")
215
+
216
+ for candidate in iter_candidate_dirs():
217
+ candidate_clean = candidate.as_posix()
218
+ file_count = count_source_files(candidate, extensions)
219
+ if file_count >= 3 and candidate_clean not in registered_paths:
220
+ print(f"UNREGISTERED: {candidate_clean} | {file_count} source files | not in MODULE_INDEX")
221
+
222
+ return 0
223
+
224
+
225
+ if __name__ == "__main__":
226
+ raise SystemExit(main())
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env python3
2
+ """Git pre-commit hook that runs Prizm docs validation."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import subprocess
7
+ import sys
8
+ from pathlib import Path
9
+
10
+
11
+ def run_git(args: list[str]) -> subprocess.CompletedProcess[str]:
12
+ return subprocess.run(
13
+ ["git", *args],
14
+ text=True,
15
+ encoding="utf-8",
16
+ errors="replace",
17
+ stdout=subprocess.PIPE,
18
+ stderr=subprocess.DEVNULL,
19
+ check=False,
20
+ )
21
+
22
+
23
+ def main() -> int:
24
+ root_result = run_git(["rev-parse", "--show-toplevel"])
25
+ if root_result.returncode != 0:
26
+ return 0
27
+
28
+ project_root = Path(root_result.stdout.strip())
29
+ if not (project_root / ".prizmkit/prizm-docs/root.prizm").is_file():
30
+ return 0
31
+
32
+ candidates = [
33
+ project_root / ".prizmkit/scripts/validate-prizm-docs.py",
34
+ project_root / ".prizmkit/dev-pipeline/scripts/validate-prizm-docs.py",
35
+ ]
36
+ validate_script = next((candidate for candidate in candidates if candidate.is_file()), None)
37
+ if validate_script is None:
38
+ return 0
39
+
40
+ result = subprocess.run([sys.executable, str(validate_script), "--staged"], cwd=project_root, check=False)
41
+ return result.returncode
42
+
43
+
44
+ if __name__ == "__main__":
45
+ raise SystemExit(main())