prizmkit 1.1.100 → 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 (309) 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/generate-bootstrap-prompt.py +38 -23
  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 +7 -1
  34. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -0
  35. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +12 -3
  36. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +13 -3
  37. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +13 -3
  38. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +2 -0
  39. package/bundled/dev-pipeline/templates/sections/log-size-awareness.md +9 -30
  40. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +15 -7
  41. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +42 -29
  42. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +41 -39
  43. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +4 -0
  44. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +4 -0
  45. package/bundled/dev-pipeline/tests/test_auto_skip.py +436 -14
  46. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +104 -0
  47. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +40 -0
  48. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +1138 -0
  49. package/bundled/dev-pipeline/tests/test_unified_cli.py +1045 -0
  50. package/bundled/skills/_metadata.json +1 -1
  51. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +29 -34
  52. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +6 -5
  53. package/bundled/skills/feature-pipeline-launcher/SKILL.md +29 -35
  54. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +7 -6
  55. package/bundled/skills/feature-workflow/SKILL.md +3 -6
  56. package/bundled/skills/recovery-workflow/SKILL.md +23 -32
  57. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +29 -35
  58. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +7 -6
  59. package/bundled/skills/refactor-workflow/SKILL.md +3 -6
  60. package/bundled/templates/hooks/commit-intent.json +2 -2
  61. package/bundled/templates/hooks/diff-prizm-docs.py +226 -0
  62. package/bundled/templates/hooks/prizm-pre-commit.py +45 -0
  63. package/bundled/templates/hooks/validate-prizm-docs.py +240 -0
  64. package/package.json +1 -1
  65. package/src/config.js +33 -12
  66. package/src/index.js +3 -6
  67. package/src/manifest.js +3 -2
  68. package/src/metadata.js +7 -18
  69. package/src/prompts.js +0 -12
  70. package/src/runtimes.js +18 -11
  71. package/src/scaffold.js +133 -116
  72. package/src/upgrade.js +1 -1
  73. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +0 -500
  74. package/bundled/dev-pipeline/launch-feature-daemon.sh +0 -657
  75. package/bundled/dev-pipeline/launch-refactor-daemon.sh +0 -502
  76. package/bundled/dev-pipeline/lib/branch.sh +0 -326
  77. package/bundled/dev-pipeline/lib/common.sh +0 -1476
  78. package/bundled/dev-pipeline/lib/heartbeat.sh +0 -469
  79. package/bundled/dev-pipeline/reset-bug.sh +0 -425
  80. package/bundled/dev-pipeline/reset-feature.sh +0 -436
  81. package/bundled/dev-pipeline/reset-refactor.sh +0 -423
  82. package/bundled/dev-pipeline/run-bugfix.sh +0 -1430
  83. package/bundled/dev-pipeline/run-feature.sh +0 -1718
  84. package/bundled/dev-pipeline/run-recovery.sh +0 -648
  85. package/bundled/dev-pipeline/run-refactor.sh +0 -1463
  86. package/bundled/dev-pipeline/tests/test-path-resolution.sh +0 -100
  87. package/bundled/dev-pipeline-windows/.env.example +0 -36
  88. package/bundled/dev-pipeline-windows/README.md +0 -30
  89. package/bundled/dev-pipeline-windows/SCHEMA_ANALYSIS.md +0 -533
  90. package/bundled/dev-pipeline-windows/assets/feature-list-example.json +0 -146
  91. package/bundled/dev-pipeline-windows/assets/prizm-dev-team-integration.md +0 -137
  92. package/bundled/dev-pipeline-windows/launch-bugfix-daemon.ps1 +0 -9
  93. package/bundled/dev-pipeline-windows/launch-feature-daemon.ps1 +0 -9
  94. package/bundled/dev-pipeline-windows/launch-refactor-daemon.ps1 +0 -9
  95. package/bundled/dev-pipeline-windows/lib/branch.ps1 +0 -235
  96. package/bundled/dev-pipeline-windows/lib/common.ps1 +0 -991
  97. package/bundled/dev-pipeline-windows/lib/daemon.ps1 +0 -140
  98. package/bundled/dev-pipeline-windows/lib/pipeline.ps1 +0 -1051
  99. package/bundled/dev-pipeline-windows/lib/reset.ps1 +0 -121
  100. package/bundled/dev-pipeline-windows/reset-bug.ps1 +0 -10
  101. package/bundled/dev-pipeline-windows/reset-feature.ps1 +0 -10
  102. package/bundled/dev-pipeline-windows/reset-refactor.ps1 +0 -10
  103. package/bundled/dev-pipeline-windows/run-bugfix.ps1 +0 -9
  104. package/bundled/dev-pipeline-windows/run-feature.ps1 +0 -9
  105. package/bundled/dev-pipeline-windows/run-recovery.ps1 +0 -179
  106. package/bundled/dev-pipeline-windows/run-refactor.ps1 +0 -9
  107. package/bundled/dev-pipeline-windows/scripts/check-session-status.py +0 -301
  108. package/bundled/dev-pipeline-windows/scripts/continuation.py +0 -374
  109. package/bundled/dev-pipeline-windows/scripts/detect-stuck.py +0 -530
  110. package/bundled/dev-pipeline-windows/scripts/generate-bootstrap-prompt.py +0 -2279
  111. package/bundled/dev-pipeline-windows/scripts/generate-bugfix-prompt.py +0 -763
  112. package/bundled/dev-pipeline-windows/scripts/generate-recovery-prompt.py +0 -805
  113. package/bundled/dev-pipeline-windows/scripts/generate-refactor-prompt.py +0 -841
  114. package/bundled/dev-pipeline-windows/scripts/init-bugfix-pipeline.py +0 -316
  115. package/bundled/dev-pipeline-windows/scripts/init-dev-team.py +0 -134
  116. package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +0 -382
  117. package/bundled/dev-pipeline-windows/scripts/init-refactor-pipeline.py +0 -399
  118. package/bundled/dev-pipeline-windows/scripts/parse-stream-progress.py +0 -1362
  119. package/bundled/dev-pipeline-windows/scripts/patch-completion-notes.py +0 -191
  120. package/bundled/dev-pipeline-windows/scripts/prizmkit-test-gate.py +0 -446
  121. package/bundled/dev-pipeline-windows/scripts/update-bug-status.py +0 -1121
  122. package/bundled/dev-pipeline-windows/scripts/update-checkpoint.py +0 -173
  123. package/bundled/dev-pipeline-windows/scripts/update-feature-status.py +0 -1789
  124. package/bundled/dev-pipeline-windows/scripts/update-refactor-status.py +0 -1327
  125. package/bundled/dev-pipeline-windows/scripts/utils.py +0 -542
  126. package/bundled/dev-pipeline-windows/templates/agent-prompts/critic-plan-challenge.md +0 -7
  127. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-fix.md +0 -7
  128. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-implement.md +0 -65
  129. package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-resume.md +0 -5
  130. package/bundled/dev-pipeline-windows/templates/agent-prompts/reviewer-review.md +0 -7
  131. package/bundled/dev-pipeline-windows/templates/bootstrap-prompt.md +0 -73
  132. package/bundled/dev-pipeline-windows/templates/bootstrap-tier1.md +0 -589
  133. package/bundled/dev-pipeline-windows/templates/bootstrap-tier2.md +0 -710
  134. package/bundled/dev-pipeline-windows/templates/bootstrap-tier3.md +0 -791
  135. package/bundled/dev-pipeline-windows/templates/bug-fix-list-schema.json +0 -263
  136. package/bundled/dev-pipeline-windows/templates/bugfix-bootstrap-prompt.md +0 -326
  137. package/bundled/dev-pipeline-windows/templates/feature-list-schema.json +0 -237
  138. package/bundled/dev-pipeline-windows/templates/refactor-bootstrap-prompt.md +0 -340
  139. package/bundled/dev-pipeline-windows/templates/refactor-list-schema.json +0 -270
  140. package/bundled/dev-pipeline-windows/templates/sections/ac-verification-checklist.md +0 -7
  141. package/bundled/dev-pipeline-windows/templates/sections/checkpoint-system.md +0 -91
  142. package/bundled/dev-pipeline-windows/templates/sections/context-budget-rules.md +0 -34
  143. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-agent.md +0 -10
  144. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-full.md +0 -12
  145. package/bundled/dev-pipeline-windows/templates/sections/critical-paths-lite.md +0 -7
  146. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-agent.md +0 -8
  147. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-full.md +0 -9
  148. package/bundled/dev-pipeline-windows/templates/sections/directory-convention-lite.md +0 -6
  149. package/bundled/dev-pipeline-windows/templates/sections/failure-capture.md +0 -21
  150. package/bundled/dev-pipeline-windows/templates/sections/feature-context.md +0 -21
  151. package/bundled/dev-pipeline-windows/templates/sections/log-size-awareness.md +0 -41
  152. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-auto.md +0 -283
  153. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-opencli.md +0 -112
  154. package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification.md +0 -168
  155. package/bundled/dev-pipeline-windows/templates/sections/phase-commit-full.md +0 -82
  156. package/bundled/dev-pipeline-windows/templates/sections/phase-commit.md +0 -75
  157. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-agent-suffix.md +0 -23
  158. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-base.md +0 -14
  159. package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-lite-suffix.md +0 -19
  160. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan-full.md +0 -63
  161. package/bundled/dev-pipeline-windows/templates/sections/phase-critic-plan.md +0 -42
  162. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-agent.md +0 -44
  163. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-full.md +0 -59
  164. package/bundled/dev-pipeline-windows/templates/sections/phase-implement-lite.md +0 -39
  165. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-agent.md +0 -27
  166. package/bundled/dev-pipeline-windows/templates/sections/phase-plan-lite.md +0 -27
  167. package/bundled/dev-pipeline-windows/templates/sections/phase-prizmkit-test.md +0 -39
  168. package/bundled/dev-pipeline-windows/templates/sections/phase-review-agent.md +0 -35
  169. package/bundled/dev-pipeline-windows/templates/sections/phase-review-full.md +0 -35
  170. package/bundled/dev-pipeline-windows/templates/sections/phase-specify-plan-full.md +0 -73
  171. package/bundled/dev-pipeline-windows/templates/sections/phase0-init.md +0 -13
  172. package/bundled/dev-pipeline-windows/templates/sections/phase0-test-baseline.md +0 -21
  173. package/bundled/dev-pipeline-windows/templates/sections/session-context.md +0 -5
  174. package/bundled/dev-pipeline-windows/templates/sections/subagent-timeout-recovery.md +0 -6
  175. package/bundled/dev-pipeline-windows/templates/sections/task-contract.md +0 -34
  176. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-agent.md +0 -48
  177. package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-lite.md +0 -48
  178. package/bundled/dev-pipeline-windows/templates/session-status-schema.json +0 -83
  179. package/bundled/skills-windows/app-planner/SKILL.md +0 -296
  180. package/bundled/skills-windows/app-planner/assets/app-design-guide.md +0 -101
  181. package/bundled/skills-windows/app-planner/references/architecture-decisions.md +0 -52
  182. package/bundled/skills-windows/app-planner/references/brainstorm-guide.md +0 -101
  183. package/bundled/skills-windows/app-planner/references/frontend-design-guide.md +0 -71
  184. package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +0 -108
  185. package/bundled/skills-windows/app-planner/references/project-brief-guide.md +0 -82
  186. package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +0 -59
  187. package/bundled/skills-windows/app-planner/references/project-state-detection.md +0 -90
  188. package/bundled/skills-windows/app-planner/references/red-team-checklist.md +0 -40
  189. package/bundled/skills-windows/app-planner/references/rules/backend/derivation-rules.md +0 -619
  190. package/bundled/skills-windows/app-planner/references/rules/backend/fixed-rules.md +0 -285
  191. package/bundled/skills-windows/app-planner/references/rules/backend/question-bank.md +0 -249
  192. package/bundled/skills-windows/app-planner/references/rules/backend/question-manifest.json +0 -46
  193. package/bundled/skills-windows/app-planner/references/rules/backend/template.md +0 -173
  194. package/bundled/skills-windows/app-planner/references/rules/database/derivation-rules.md +0 -382
  195. package/bundled/skills-windows/app-planner/references/rules/database/fixed-rules.md +0 -211
  196. package/bundled/skills-windows/app-planner/references/rules/database/question-bank.md +0 -184
  197. package/bundled/skills-windows/app-planner/references/rules/database/question-manifest.json +0 -39
  198. package/bundled/skills-windows/app-planner/references/rules/database/template.md +0 -158
  199. package/bundled/skills-windows/app-planner/references/rules/frontend/derivation-rules.md +0 -820
  200. package/bundled/skills-windows/app-planner/references/rules/frontend/fixed-rules.md +0 -188
  201. package/bundled/skills-windows/app-planner/references/rules/frontend/question-bank.md +0 -319
  202. package/bundled/skills-windows/app-planner/references/rules/frontend/question-manifest.json +0 -51
  203. package/bundled/skills-windows/app-planner/references/rules/frontend/template.md +0 -339
  204. package/bundled/skills-windows/app-planner/references/rules/mobile/derivation-rules.md +0 -649
  205. package/bundled/skills-windows/app-planner/references/rules/mobile/fixed-rules.md +0 -290
  206. package/bundled/skills-windows/app-planner/references/rules/mobile/question-bank.md +0 -232
  207. package/bundled/skills-windows/app-planner/references/rules/mobile/question-manifest.json +0 -47
  208. package/bundled/skills-windows/app-planner/references/rules/mobile/template.md +0 -175
  209. package/bundled/skills-windows/app-planner/references/rules-configuration.md +0 -46
  210. package/bundled/skills-windows/bug-fix-workflow/SKILL.md +0 -379
  211. package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +0 -41
  212. package/bundled/skills-windows/bug-planner/SKILL.md +0 -402
  213. package/bundled/skills-windows/bug-planner/assets/bug-confirmation-template.md +0 -43
  214. package/bundled/skills-windows/bug-planner/references/critic-and-verification.md +0 -44
  215. package/bundled/skills-windows/bug-planner/references/error-recovery.md +0 -73
  216. package/bundled/skills-windows/bug-planner/references/input-formats.md +0 -53
  217. package/bundled/skills-windows/bug-planner/references/schema-validation.md +0 -25
  218. package/bundled/skills-windows/bug-planner/references/severity-rules.md +0 -16
  219. package/bundled/skills-windows/bug-planner/scripts/validate-bug-list.py +0 -322
  220. package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +0 -304
  221. package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +0 -84
  222. package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +0 -381
  223. package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +0 -67
  224. package/bundled/skills-windows/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
  225. package/bundled/skills-windows/feature-planner/SKILL.md +0 -397
  226. package/bundled/skills-windows/feature-planner/assets/evaluation-guide.md +0 -64
  227. package/bundled/skills-windows/feature-planner/assets/planning-guide.md +0 -214
  228. package/bundled/skills-windows/feature-planner/references/browser-interaction.md +0 -59
  229. package/bundled/skills-windows/feature-planner/references/completeness-review.md +0 -57
  230. package/bundled/skills-windows/feature-planner/references/decomposition-patterns.md +0 -75
  231. package/bundled/skills-windows/feature-planner/references/error-recovery.md +0 -90
  232. package/bundled/skills-windows/feature-planner/references/incremental-feature-planning.md +0 -112
  233. package/bundled/skills-windows/feature-planner/references/new-project-planning.md +0 -85
  234. package/bundled/skills-windows/feature-planner/scripts/validate-and-generate.py +0 -1020
  235. package/bundled/skills-windows/feature-workflow/SKILL.md +0 -374
  236. package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +0 -137
  237. package/bundled/skills-windows/prizm-kit/SKILL.md +0 -93
  238. package/bundled/skills-windows/prizmkit-code-review/SKILL.md +0 -161
  239. package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +0 -30
  240. package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +0 -31
  241. package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +0 -66
  242. package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +0 -186
  243. package/bundled/skills-windows/prizmkit-committer/SKILL.md +0 -89
  244. package/bundled/skills-windows/prizmkit-deploy/SKILL.md +0 -444
  245. package/bundled/skills-windows/prizmkit-deploy/references/ci-cd-workflows.md +0 -115
  246. package/bundled/skills-windows/prizmkit-deploy/references/cloud-platform-deploy.md +0 -93
  247. package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +0 -120
  248. package/bundled/skills-windows/prizmkit-deploy/references/database-setup.md +0 -46
  249. package/bundled/skills-windows/prizmkit-deploy/references/deploy-config-schema.md +0 -148
  250. package/bundled/skills-windows/prizmkit-deploy/references/deploy-history-schema.md +0 -62
  251. package/bundled/skills-windows/prizmkit-deploy/references/deployment-modes.md +0 -50
  252. package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +0 -26
  253. package/bundled/skills-windows/prizmkit-deploy/references/dns-setup.md +0 -42
  254. package/bundled/skills-windows/prizmkit-deploy/references/docker-deploy.md +0 -31
  255. package/bundled/skills-windows/prizmkit-deploy/references/firewall-setup.md +0 -37
  256. package/bundled/skills-windows/prizmkit-deploy/references/live-validation-notes.md +0 -21
  257. package/bundled/skills-windows/prizmkit-deploy/references/nginx-blue-green.md +0 -59
  258. package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
  259. package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
  260. package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +0 -20
  261. package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +0 -56
  262. package/bundled/skills-windows/prizmkit-implement/SKILL.md +0 -71
  263. package/bundled/skills-windows/prizmkit-init/SKILL.md +0 -356
  264. package/bundled/skills-windows/prizmkit-init/assets/project-brief-template.md +0 -82
  265. package/bundled/skills-windows/prizmkit-init/references/config-schema.md +0 -70
  266. package/bundled/skills-windows/prizmkit-init/references/rules/layer-detection.md +0 -41
  267. package/bundled/skills-windows/prizmkit-init/references/tech-stack-catalog.md +0 -13
  268. package/bundled/skills-windows/prizmkit-init/references/update-supplement.md +0 -9
  269. package/bundled/skills-windows/prizmkit-plan/SKILL.md +0 -102
  270. package/bundled/skills-windows/prizmkit-plan/assets/plan-template.md +0 -115
  271. package/bundled/skills-windows/prizmkit-plan/assets/spec-template.md +0 -73
  272. package/bundled/skills-windows/prizmkit-plan/references/clarify-guide.md +0 -67
  273. package/bundled/skills-windows/prizmkit-plan/references/examples.md +0 -85
  274. package/bundled/skills-windows/prizmkit-plan/references/verification-checklist.md +0 -60
  275. package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +0 -129
  276. package/bundled/skills-windows/prizmkit-prizm-docs/assets/prizm-docs-format.md +0 -613
  277. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-init.md +0 -45
  278. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-rebuild.md +0 -15
  279. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-status.md +0 -14
  280. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-update.md +0 -19
  281. package/bundled/skills-windows/prizmkit-prizm-docs/references/op-validate.md +0 -17
  282. package/bundled/skills-windows/prizmkit-retrospective/SKILL.md +0 -87
  283. package/bundled/skills-windows/prizmkit-retrospective/references/knowledge-injection-steps.md +0 -50
  284. package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +0 -43
  285. package/bundled/skills-windows/prizmkit-test/SKILL.md +0 -227
  286. package/bundled/skills-windows/prizmkit-test/references/boundary-coverage-protocol.md +0 -220
  287. package/bundled/skills-windows/prizmkit-test/references/examples.md +0 -143
  288. package/bundled/skills-windows/prizmkit-test/references/service-boundary-test-catalog.md +0 -225
  289. package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +0 -109
  290. package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +0 -111
  291. package/bundled/skills-windows/prizmkit-test/scripts/validate_boundary_report.py +0 -347
  292. package/bundled/skills-windows/recovery-workflow/SKILL.md +0 -355
  293. package/bundled/skills-windows/recovery-workflow/evals/evals.json +0 -46
  294. package/bundled/skills-windows/recovery-workflow/references/detection.md +0 -58
  295. package/bundled/skills-windows/recovery-workflow/scripts/detect-recovery-state.py +0 -544
  296. package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +0 -346
  297. package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +0 -72
  298. package/bundled/skills-windows/refactor-planner/SKILL.md +0 -398
  299. package/bundled/skills-windows/refactor-planner/assets/planning-guide.md +0 -292
  300. package/bundled/skills-windows/refactor-planner/references/behavior-preservation.md +0 -301
  301. package/bundled/skills-windows/refactor-planner/references/fast-path.md +0 -59
  302. package/bundled/skills-windows/refactor-planner/references/planning-phases.md +0 -135
  303. package/bundled/skills-windows/refactor-planner/references/refactor-scoping-guide.md +0 -221
  304. package/bundled/skills-windows/refactor-planner/scripts/validate-and-generate-refactor.py +0 -858
  305. package/bundled/skills-windows/refactor-workflow/SKILL.md +0 -343
  306. package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +0 -116
  307. package/bundled/templates/hooks/diff-prizm-docs.sh +0 -158
  308. package/bundled/templates/hooks/prizm-pre-commit.sh +0 -108
  309. package/bundled/templates/hooks/validate-prizm-docs.sh +0 -139
@@ -0,0 +1,256 @@
1
+ """Heartbeat and stale-session primitives."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import os
7
+ import shutil
8
+ import threading
9
+ import time
10
+ from dataclasses import dataclass, field
11
+ from pathlib import Path
12
+
13
+ from .processes import ProcessHandle, is_process_running, terminate_process_tree
14
+
15
+
16
+ @dataclass(frozen=True)
17
+ class HeartbeatConfig:
18
+ """Heartbeat file and timeout policy for runtime porting."""
19
+
20
+ heartbeat_file: Path
21
+ session_log: Path | None = None
22
+ progress_file: Path | None = None
23
+ marker_dir: Path | None = None
24
+ interval_seconds: float = 30
25
+ stale_after_seconds: float = 300
26
+ kill_after_seconds: float = 600
27
+ grace_seconds: float = 10
28
+
29
+
30
+ @dataclass(frozen=True)
31
+ class HeartbeatState:
32
+ """Current heartbeat freshness observation."""
33
+
34
+ last_seen_epoch: float | None
35
+ stale: bool
36
+ details: str
37
+ stale_seconds: float = 0
38
+ log_size: int = 0
39
+ progress_signature: str = ""
40
+ child_activity_signature: str = ""
41
+
42
+
43
+ @dataclass(frozen=True)
44
+ class HeartbeatStopResult:
45
+ """Outcome from stopping a heartbeat monitor."""
46
+
47
+ killed: bool
48
+ reason: str | None
49
+ marker_path: Path | None
50
+ state: HeartbeatState
51
+
52
+
53
+ def _file_size(path: Path | None) -> int:
54
+ if path is None:
55
+ return 0
56
+ try:
57
+ return path.stat().st_size
58
+ except OSError:
59
+ return 0
60
+
61
+
62
+ def _progress_signature(path: Path | None) -> tuple[str, str]:
63
+ if path is None or not path.is_file():
64
+ return "", ""
65
+ try:
66
+ data = json.loads(path.read_text(encoding="utf-8"))
67
+ except (OSError, json.JSONDecodeError):
68
+ return "", ""
69
+ child_signature = str(data.get("child_activity_signature") or "")
70
+ signature = json.dumps(
71
+ [
72
+ data.get("current_phase") or "",
73
+ data.get("current_tool") or "",
74
+ int(data.get("message_count") or 0),
75
+ int(data.get("total_tool_calls") or 0),
76
+ int(data.get("active_subagent_count") or 0),
77
+ int(data.get("subagent_spawn_count") or 0),
78
+ child_signature,
79
+ int(data.get("child_total_bytes") or 0),
80
+ data.get("fatal_error_code") or "",
81
+ data.get("terminal_result_text") or "",
82
+ ],
83
+ separators=(",", ":"),
84
+ )
85
+ return signature, child_signature
86
+
87
+
88
+ def observe_heartbeat_state(
89
+ config: HeartbeatConfig,
90
+ previous: HeartbeatState | None = None,
91
+ ) -> HeartbeatState:
92
+ """Observe log/progress activity and compute staleness."""
93
+ now = time.time()
94
+ log_size = _file_size(config.session_log)
95
+ progress_signature, child_signature = _progress_signature(config.progress_file)
96
+ prev_log_size = previous.log_size if previous else 0
97
+ progressed = (
98
+ previous is None
99
+ or log_size > prev_log_size
100
+ or (progress_signature and progress_signature != previous.progress_signature)
101
+ or (child_signature and child_signature != previous.child_activity_signature)
102
+ )
103
+ stale_seconds = 0 if progressed else (previous.stale_seconds + config.interval_seconds if previous else 0)
104
+ stale = bool(config.stale_after_seconds > 0 and stale_seconds >= config.stale_after_seconds)
105
+ details = "progress" if progressed else "no progress"
106
+ return HeartbeatState(
107
+ last_seen_epoch=now if progressed else (previous.last_seen_epoch if previous else now),
108
+ stale=stale,
109
+ details=details,
110
+ stale_seconds=stale_seconds,
111
+ log_size=log_size,
112
+ progress_signature=progress_signature,
113
+ child_activity_signature=child_signature,
114
+ )
115
+
116
+
117
+ def _utc_marker_time() -> str:
118
+ return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
119
+
120
+
121
+ def _progress_fatal_error_code(path: Path | None) -> str:
122
+ if path is None or not path.is_file():
123
+ return ""
124
+ try:
125
+ data = json.loads(path.read_text(encoding="utf-8"))
126
+ except (OSError, json.JSONDecodeError):
127
+ return ""
128
+ return str(data.get("fatal_error_code") or "")
129
+
130
+
131
+ def write_stale_marker(
132
+ marker_dir: Path,
133
+ *,
134
+ reason: str,
135
+ stale_seconds: float,
136
+ threshold: float,
137
+ fatal_error_code: str | None = None,
138
+ ) -> Path:
139
+ """Write a stale/fatal marker compatible with shell artifact shape."""
140
+ marker_dir.mkdir(parents=True, exist_ok=True)
141
+ marker_path = marker_dir / "stale-kill.json"
142
+ payload = {
143
+ "killed_at": _utc_marker_time(),
144
+ "reason": reason,
145
+ "stale_seconds": int(stale_seconds),
146
+ "threshold": int(threshold),
147
+ }
148
+ if fatal_error_code:
149
+ payload["fatal_error_code"] = fatal_error_code
150
+ marker_path.write_text(json.dumps(payload, sort_keys=True) + "\n", encoding="utf-8")
151
+ return marker_path
152
+
153
+
154
+ def write_fatal_marker(
155
+ marker_dir: Path,
156
+ *,
157
+ fatal_error_code: str,
158
+ stale_seconds: float,
159
+ threshold: float,
160
+ ) -> tuple[Path, Path]:
161
+ """Write shell-compatible fatal-error and stale-kill marker files."""
162
+ marker_dir.mkdir(parents=True, exist_ok=True)
163
+ payload = {
164
+ "killed_at": _utc_marker_time(),
165
+ "reason": fatal_error_code,
166
+ "fatal_error_code": fatal_error_code,
167
+ "stale_seconds": int(stale_seconds),
168
+ "threshold": int(threshold),
169
+ }
170
+ fatal_path = marker_dir / "fatal-error.json"
171
+ stale_path = marker_dir / "stale-kill.json"
172
+ encoded = json.dumps(payload, sort_keys=True) + "\n"
173
+ fatal_path.write_text(encoded, encoding="utf-8")
174
+ stale_path.write_text(encoded, encoding="utf-8")
175
+ return fatal_path, stale_path
176
+
177
+
178
+ class HeartbeatMonitor:
179
+ """Background heartbeat monitor that can stale-kill a process tree."""
180
+
181
+ def __init__(self, handle: ProcessHandle, config: HeartbeatConfig):
182
+ self.handle = handle
183
+ self.config = config
184
+ self._stop_event = threading.Event()
185
+ self._thread: threading.Thread | None = None
186
+ self._state = HeartbeatState(last_seen_epoch=None, stale=False, details="not started")
187
+ self._killed = False
188
+ self._reason: str | None = None
189
+ self._marker_path: Path | None = None
190
+
191
+ @property
192
+ def state(self) -> HeartbeatState:
193
+ return self._state
194
+
195
+ def start(self) -> None:
196
+ if self._thread is not None:
197
+ return
198
+ self.config.heartbeat_file.parent.mkdir(parents=True, exist_ok=True)
199
+ self.config.heartbeat_file.write_text("started\n", encoding="utf-8")
200
+ self._thread = threading.Thread(target=self._run, name="prizmkit-heartbeat", daemon=True)
201
+ self._thread.start()
202
+
203
+ def _run(self) -> None:
204
+ while not self._stop_event.wait(max(0.01, self.config.interval_seconds)):
205
+ if not is_process_running(self.handle):
206
+ break
207
+ self._state = observe_heartbeat_state(self.config, self._state)
208
+ self.config.heartbeat_file.write_text(
209
+ json.dumps(
210
+ {
211
+ "last_seen_epoch": self._state.last_seen_epoch,
212
+ "stale": self._state.stale,
213
+ "stale_seconds": self._state.stale_seconds,
214
+ "details": self._state.details,
215
+ },
216
+ sort_keys=True,
217
+ )
218
+ + "\n",
219
+ encoding="utf-8",
220
+ )
221
+ fatal_error_code = _progress_fatal_error_code(self.config.progress_file)
222
+ if fatal_error_code:
223
+ marker_dir = self.config.marker_dir or (self.config.session_log.parent if self.config.session_log else self.config.heartbeat_file.parent)
224
+ _fatal_path, self._marker_path = write_fatal_marker(
225
+ marker_dir,
226
+ fatal_error_code=fatal_error_code,
227
+ stale_seconds=self._state.stale_seconds,
228
+ threshold=self.config.stale_after_seconds,
229
+ )
230
+ terminate_process_tree(self.handle, fatal_error_code, grace_seconds=self.config.grace_seconds)
231
+ self._killed = True
232
+ self._reason = fatal_error_code
233
+ break
234
+ if self._state.stale and self.config.kill_after_seconds > 0:
235
+ marker_dir = self.config.marker_dir or (self.config.session_log.parent if self.config.session_log else self.config.heartbeat_file.parent)
236
+ self._marker_path = write_stale_marker(
237
+ marker_dir,
238
+ reason="stale_session",
239
+ stale_seconds=self._state.stale_seconds,
240
+ threshold=self.config.stale_after_seconds,
241
+ )
242
+ terminate_process_tree(self.handle, "stale_session", grace_seconds=self.config.grace_seconds)
243
+ self._killed = True
244
+ self._reason = "stale_session"
245
+ break
246
+
247
+ def stop(self) -> HeartbeatStopResult:
248
+ self._stop_event.set()
249
+ if self._thread is not None:
250
+ self._thread.join(timeout=max(1.0, self.config.interval_seconds * 2))
251
+ return HeartbeatStopResult(
252
+ killed=self._killed,
253
+ reason=self._reason,
254
+ marker_path=self._marker_path,
255
+ state=self._state,
256
+ )
@@ -0,0 +1,109 @@
1
+ """Interoperability contracts for Python utility entrypoints."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ import subprocess
7
+ import sys
8
+ from collections.abc import Mapping, Sequence
9
+ from dataclasses import dataclass, field
10
+ from pathlib import Path
11
+
12
+ from .paths import RuntimePaths, resolve_runtime_paths
13
+
14
+ UTILITY_ENTRYPOINTS = {
15
+ "check-session-status": "scripts/check-session-status.py",
16
+ "detect-stuck": "scripts/detect-stuck.py",
17
+ "generate-bootstrap-prompt": "scripts/generate-bootstrap-prompt.py",
18
+ "generate-bugfix-prompt": "scripts/generate-bugfix-prompt.py",
19
+ "generate-recovery-prompt": "scripts/generate-recovery-prompt.py",
20
+ "generate-refactor-prompt": "scripts/generate-refactor-prompt.py",
21
+ "init-bugfix-pipeline": "scripts/init-bugfix-pipeline.py",
22
+ "init-dev-team": "scripts/init-dev-team.py",
23
+ "init-pipeline": "scripts/init-pipeline.py",
24
+ "init-refactor-pipeline": "scripts/init-refactor-pipeline.py",
25
+ "parse-stream-progress": "scripts/parse-stream-progress.py",
26
+ "patch-completion-notes": "scripts/patch-completion-notes.py",
27
+ "prizmkit-test-gate": "scripts/prizmkit-test-gate.py",
28
+ "update-bug-status": "scripts/update-bug-status.py",
29
+ "update-checkpoint": "scripts/update-checkpoint.py",
30
+ "update-feature-status": "scripts/update-feature-status.py",
31
+ "update-refactor-status": "scripts/update-refactor-status.py",
32
+ }
33
+
34
+ UTILITY_LIBRARY_ONLY = {
35
+ "continuation.py": "shared continuation helpers imported by prompt generators",
36
+ "utils.py": "shared utility helpers imported by runtime scripts",
37
+ }
38
+
39
+ ENTRYPOINT_GROUPS = {
40
+ "utility": UTILITY_ENTRYPOINTS,
41
+ }
42
+
43
+
44
+ @dataclass(frozen=True)
45
+ class ScriptInvocation:
46
+ """Description of a Python runtime utility invocation."""
47
+
48
+ script_path: Path
49
+ arguments: tuple[str, ...] = ()
50
+ cwd: Path | None = None
51
+ environment_overrides: Mapping[str, str] = field(default_factory=dict)
52
+ entrypoint_kind: str = "unknown"
53
+ entrypoint_name: str = "unknown"
54
+
55
+ def command_line(self) -> tuple[str, ...]:
56
+ """Return the executable command line for this invocation."""
57
+ return (str(self.script_path), *self.arguments)
58
+
59
+
60
+ def _resolve_script_path(kind: str, name: str, paths: RuntimePaths) -> Path:
61
+ group = ENTRYPOINT_GROUPS.get(kind)
62
+ if group is None:
63
+ valid = ", ".join(sorted(ENTRYPOINT_GROUPS))
64
+ raise KeyError(f"Unknown entrypoint kind '{kind}'. Valid kinds: {valid}")
65
+ rel_path = group.get(name)
66
+ if rel_path is None:
67
+ valid = ", ".join(sorted(group))
68
+ raise KeyError(f"Unknown {kind} entrypoint '{name}'. Valid names: {valid}")
69
+ return paths.pipeline_root / rel_path
70
+
71
+
72
+ def describe_existing_entrypoint(
73
+ kind: str,
74
+ name: str,
75
+ *,
76
+ paths: RuntimePaths | None = None,
77
+ arguments: Sequence[str] = (),
78
+ cwd: str | Path | None = None,
79
+ env: Mapping[str, str] | None = None,
80
+ ) -> ScriptInvocation:
81
+ """Describe a Python utility entrypoint without executing it."""
82
+ runtime_paths = paths or resolve_runtime_paths()
83
+ return ScriptInvocation(
84
+ script_path=_resolve_script_path(kind, name, runtime_paths),
85
+ arguments=tuple(arguments),
86
+ cwd=Path(cwd).expanduser().resolve() if cwd is not None else runtime_paths.project_root,
87
+ environment_overrides={} if env is None else dict(env),
88
+ entrypoint_kind=kind,
89
+ entrypoint_name=name,
90
+ )
91
+
92
+
93
+ def run_existing_entrypoint(invocation: ScriptInvocation) -> subprocess.CompletedProcess[str]:
94
+ """Run a Python utility entrypoint through a standard-library subprocess bridge."""
95
+ process_env = None
96
+ if invocation.environment_overrides:
97
+ process_env = {**os.environ, **invocation.environment_overrides}
98
+ command = invocation.command_line()
99
+ if invocation.script_path.suffix == ".py":
100
+ command = (sys.executable, *command)
101
+ return subprocess.run(
102
+ command,
103
+ cwd=invocation.cwd,
104
+ env=process_env,
105
+ text=True,
106
+ stdout=subprocess.PIPE,
107
+ stderr=subprocess.PIPE,
108
+ check=False,
109
+ )
@@ -0,0 +1,110 @@
1
+ """Cross-platform path contracts for the unified runtime skeleton."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+ from pathlib import Path
7
+
8
+
9
+ @dataclass(frozen=True)
10
+ class RuntimePaths:
11
+ """Cohesive runtime path model derived with pathlib only."""
12
+
13
+ pipeline_root: Path
14
+ project_root: Path
15
+ prizmkit_dir: Path
16
+ plans_dir: Path
17
+ state_dir: Path
18
+ logs_dir: Path
19
+ specs_dir: Path
20
+ feature_plan: Path
21
+ bugfix_plan: Path
22
+ refactor_plan: Path
23
+ feature_state_dir: Path
24
+ bugfix_state_dir: Path
25
+ refactor_state_dir: Path
26
+ recovery_state_dir: Path
27
+ layout: str
28
+
29
+ def path_values(self) -> tuple[Path, ...]:
30
+ """Return all path fields for tests and diagnostics."""
31
+ return (
32
+ self.pipeline_root,
33
+ self.project_root,
34
+ self.prizmkit_dir,
35
+ self.plans_dir,
36
+ self.state_dir,
37
+ self.logs_dir,
38
+ self.specs_dir,
39
+ self.feature_plan,
40
+ self.bugfix_plan,
41
+ self.refactor_plan,
42
+ self.feature_state_dir,
43
+ self.bugfix_state_dir,
44
+ self.refactor_state_dir,
45
+ self.recovery_state_dir,
46
+ )
47
+
48
+
49
+ def _default_pipeline_root() -> Path:
50
+ return Path(__file__).resolve().parents[1]
51
+
52
+
53
+ def _normalize_path(value: str | Path | None) -> Path | None:
54
+ if value is None:
55
+ return None
56
+ return Path(value).expanduser().resolve()
57
+
58
+
59
+ def _derive_layout(pipeline_root: Path) -> str:
60
+ if pipeline_root.name == "dev-pipeline" and pipeline_root.parent.name == ".prizmkit":
61
+ return "installed"
62
+ return "framework-source"
63
+
64
+
65
+ def resolve_runtime_paths(
66
+ pipeline_root: str | Path | None = None,
67
+ project_root: str | Path | None = None,
68
+ prizmkit_dir: str | Path | None = None,
69
+ ) -> RuntimePaths:
70
+ """Resolve runtime paths for framework-source or installed layouts."""
71
+ resolved_pipeline_root = _normalize_path(pipeline_root) or _default_pipeline_root()
72
+ layout = _derive_layout(resolved_pipeline_root)
73
+
74
+ resolved_project_root = _normalize_path(project_root)
75
+ resolved_prizmkit_dir = _normalize_path(prizmkit_dir)
76
+
77
+ if resolved_project_root is None:
78
+ if layout == "installed":
79
+ resolved_project_root = resolved_pipeline_root.parent.parent
80
+ else:
81
+ resolved_project_root = resolved_pipeline_root.parent
82
+
83
+ if resolved_prizmkit_dir is None:
84
+ if layout == "installed":
85
+ resolved_prizmkit_dir = resolved_pipeline_root.parent
86
+ else:
87
+ resolved_prizmkit_dir = resolved_project_root / ".prizmkit"
88
+
89
+ plans_dir = resolved_prizmkit_dir / "plans"
90
+ state_dir = resolved_prizmkit_dir / "state"
91
+ logs_dir = state_dir / "logs"
92
+ specs_dir = resolved_prizmkit_dir / "specs"
93
+
94
+ return RuntimePaths(
95
+ pipeline_root=resolved_pipeline_root,
96
+ project_root=resolved_project_root,
97
+ prizmkit_dir=resolved_prizmkit_dir,
98
+ plans_dir=plans_dir,
99
+ state_dir=state_dir,
100
+ logs_dir=logs_dir,
101
+ specs_dir=specs_dir,
102
+ feature_plan=plans_dir / "feature-list.json",
103
+ bugfix_plan=plans_dir / "bug-fix-list.json",
104
+ refactor_plan=plans_dir / "refactor-list.json",
105
+ feature_state_dir=state_dir / "features",
106
+ bugfix_state_dir=state_dir / "bugfix",
107
+ refactor_state_dir=state_dir / "refactor",
108
+ recovery_state_dir=state_dir / "recovery",
109
+ layout=layout,
110
+ )