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
package/src/platforms.js CHANGED
@@ -10,6 +10,31 @@ export function expandPlatforms(platform) {
10
10
  return PLATFORM_GROUPS[platform] || LEGACY_PLATFORM_GROUPS[platform] || [platform];
11
11
  }
12
12
 
13
+ export function platformFromAiCli(aiCli) {
14
+ if (!aiCli || typeof aiCli !== 'string') return null;
15
+ const token = aiCli.trim().split(/\s+/)[0]?.replace(/^['"]|['"]$/g, '');
16
+ const name = token.split(/[\\/]/).pop()?.toLowerCase() || '';
17
+ if (name.includes('claude')) return 'claude';
18
+ if (name.includes('codex')) return 'codex';
19
+ if (name.includes('cbc') || name.includes('codebuddy')) return 'codebuddy';
20
+ return null;
21
+ }
22
+
23
+ export function uniquePlatforms(platforms) {
24
+ return [...new Set(platforms.filter(p => PLATFORM_IDS.includes(p)))];
25
+ }
26
+
27
+ export function resolvePayloadPlatforms(platform, aiCli = '') {
28
+ const selected = uniquePlatforms(expandPlatforms(platform));
29
+ const cliPlatform = platformFromAiCli(aiCli);
30
+ return uniquePlatforms([...selected, cliPlatform].filter(Boolean));
31
+ }
32
+
33
+ export function payloadPlatformLabel(platform, aiCli = '') {
34
+ const payload = resolvePayloadPlatforms(platform, aiCli);
35
+ return payload.map(platformLabel).join(' + ');
36
+ }
37
+
13
38
  export function isKnownPlatform(platform) {
14
39
  return PLATFORM_IDS.includes(platform) || Object.hasOwn(PLATFORM_GROUPS, platform);
15
40
  }
package/src/prompts.js CHANGED
@@ -6,7 +6,6 @@
6
6
  import { select, confirm, checkbox, input } from '@inquirer/prompts';
7
7
  import chalk from 'chalk';
8
8
  import { platformLabel } from './platforms.js';
9
- import { normalizeRuntime } from './runtimes.js';
10
9
 
11
10
  let selectPlatformPrompt = select;
12
11
 
@@ -18,17 +17,6 @@ export function __resetSelectPlatformPromptForTests() {
18
17
  selectPlatformPrompt = select;
19
18
  }
20
19
 
21
- export async function selectRuntime(currentRuntime) {
22
- return select({
23
- message: '选择运行系统 (决定安装 macOS/Linux 或 Windows 版本的流水线与编排技能):',
24
- choices: [
25
- { name: 'macOS/Linux — 使用 Bash 流水线', value: 'unix' },
26
- { name: 'Windows PowerShell — 使用原生 PowerShell 流水线', value: 'windows' },
27
- ],
28
- default: normalizeRuntime(currentRuntime),
29
- });
30
- }
31
-
32
20
  /**
33
21
  * Select target platform (codebuddy, claude, codex, or all).
34
22
  * @param {string} currentPlatform - current platform value
package/src/runtimes.js CHANGED
@@ -1,20 +1,27 @@
1
- export const RUNTIME_UNIX = 'unix';
2
- export const RUNTIME_WINDOWS = 'windows';
3
- export const RUNTIME_IDS = [RUNTIME_UNIX, RUNTIME_WINDOWS];
1
+ export const RUNTIME_PYTHON = 'python';
2
+ export const RUNTIME_IDS = [RUNTIME_PYTHON];
3
+
4
+ export const LEGACY_UNIX_RUNTIME_ALIASES = ['unix', 'macos-linux', 'macos', 'linux'];
5
+ export const RETIRED_WINDOWS_RUNTIME_ALIASES = ['windows', 'win', 'powershell'];
6
+ export const LEGACY_RUNTIME_ALIASES = [
7
+ ...LEGACY_UNIX_RUNTIME_ALIASES,
8
+ ...RETIRED_WINDOWS_RUNTIME_ALIASES,
9
+ ];
4
10
 
5
11
  export function detectDefaultRuntime() {
6
- return process.platform === 'win32' ? RUNTIME_WINDOWS : RUNTIME_UNIX;
12
+ return RUNTIME_PYTHON;
7
13
  }
8
14
 
9
15
  export function normalizeRuntime(runtime) {
10
- if (!runtime || runtime === 'auto') return detectDefaultRuntime();
11
- if (runtime === 'macos-linux' || runtime === 'macos' || runtime === 'linux') return RUNTIME_UNIX;
12
- if (runtime === 'win' || runtime === 'powershell') return RUNTIME_WINDOWS;
13
- if (RUNTIME_IDS.includes(runtime)) return runtime;
14
- throw new Error(`Unknown runtime "${runtime}". Expected unix or windows.`);
16
+ if (!runtime) return RUNTIME_PYTHON;
17
+ const normalized = String(runtime).trim().toLowerCase();
18
+ if (!normalized || normalized === 'auto') return RUNTIME_PYTHON;
19
+ if (LEGACY_RUNTIME_ALIASES.includes(normalized)) return RUNTIME_PYTHON;
20
+ if (RUNTIME_IDS.includes(normalized)) return normalized;
21
+ throw new Error(`Unknown runtime "${runtime}". Expected python runtime, legacy compatibility alias, or auto.`);
15
22
  }
16
23
 
17
24
  export function runtimeLabel(runtime) {
18
- const normalized = normalizeRuntime(runtime);
19
- return normalized === RUNTIME_WINDOWS ? 'Windows PowerShell' : 'macOS/Linux';
25
+ normalizeRuntime(runtime);
26
+ return 'Python runtime';
20
27
  }
package/src/scaffold.js CHANGED
@@ -27,8 +27,8 @@ import {
27
27
  } from './metadata.js';
28
28
  import { generateGitignore } from './gitignore-template.js';
29
29
  import { buildManifest, writeManifest } from './manifest.js';
30
- import { defaultCliForPlatform, expandPlatforms, isKnownPlatform, platformLabel, projectMemoryFile } from './platforms.js';
31
- import { normalizeRuntime, runtimeLabel, RUNTIME_UNIX, RUNTIME_WINDOWS } from './runtimes.js';
30
+ import { defaultCliForPlatform, expandPlatforms, isKnownPlatform, platformLabel, projectMemoryFile, resolvePayloadPlatforms } from './platforms.js';
31
+ import { normalizeRuntime, runtimeLabel } from './runtimes.js';
32
32
 
33
33
  const __scaffoldDirname = dirname(fileURLToPath(import.meta.url));
34
34
  const scaffoldPkg = JSON.parse(readFileSync(join(__scaffoldDirname, '..', 'package.json'), 'utf-8'));
@@ -50,6 +50,37 @@ const PIPELINE_MANAGED_TOP_LEVEL_PATTERNS = [
50
50
  /^README\.md$/i,
51
51
  /^SCHEMA_ANALYSIS\.md$/i,
52
52
  ];
53
+ const RETIRED_SHELL_RUNTIME_FILES = new Set([
54
+ 'run-feature.sh',
55
+ 'run-bugfix.sh',
56
+ 'run-refactor.sh',
57
+ 'run-recovery.sh',
58
+ 'launch-feature-daemon.sh',
59
+ 'launch-bugfix-daemon.sh',
60
+ 'launch-refactor-daemon.sh',
61
+ 'reset-feature.sh',
62
+ 'reset-bug.sh',
63
+ 'reset-refactor.sh',
64
+ 'lib/branch.sh',
65
+ 'lib/common.sh',
66
+ 'lib/heartbeat.sh',
67
+ ]);
68
+ const RETIRED_POWERSHELL_RUNTIME_FILES = new Set([
69
+ 'run-feature.ps1',
70
+ 'run-bugfix.ps1',
71
+ 'run-refactor.ps1',
72
+ 'run-recovery.ps1',
73
+ 'launch-feature-daemon.ps1',
74
+ 'launch-bugfix-daemon.ps1',
75
+ 'launch-refactor-daemon.ps1',
76
+ 'reset-feature.ps1',
77
+ 'reset-bug.ps1',
78
+ 'reset-refactor.ps1',
79
+ 'lib/common.ps1',
80
+ 'lib/pipeline.ps1',
81
+ 'lib/branch.ps1',
82
+ 'lib/heartbeat.ps1',
83
+ ]);
53
84
 
54
85
  // ============================================================
55
86
  // Adapter 动态加载
@@ -101,11 +132,10 @@ export async function resolveSkillList(suite) {
101
132
  return suiteDef.skills;
102
133
  }
103
134
 
104
- export function resolveRuleNamesForRuntime(rulesMeta, rulesPreset = 'recommended', runtime = 'unix') {
135
+ export function resolveRuleNamesForRuntime(rulesMeta, rulesPreset = 'recommended', runtime = 'python') {
136
+ normalizeRuntime(runtime);
105
137
  const preset = rulesMeta.presets[rulesPreset] || rulesMeta.presets.recommended;
106
- const ruleNames = preset?.rules || [];
107
- if (normalizeRuntime(runtime) !== RUNTIME_WINDOWS) return ruleNames;
108
- return ruleNames.filter(name => name !== 'general/prefer-linux-commands');
138
+ return preset?.rules || [];
109
139
  }
110
140
 
111
141
  // ============================================================
@@ -115,7 +145,7 @@ export function resolveRuleNamesForRuntime(rulesMeta, rulesPreset = 'recommended
115
145
  /**
116
146
  * 安装 Skills(纯 Copy 模式)
117
147
  */
118
- export async function installSkills(platform, skills, projectRoot, dryRun, runtime = 'unix') {
148
+ export async function installSkills(platform, skills, projectRoot, dryRun, runtime = 'python') {
119
149
  const { parseFrontmatter, buildMarkdown } = await loadSharedFrontmatter();
120
150
 
121
151
  // Load metadata to get skill -> category + subcategory mapping
@@ -435,8 +465,8 @@ export async function installTeamConfig(platform, projectRoot, dryRun) {
435
465
  /**
436
466
  * 安装平台配置文件(settings/hooks/rules)
437
467
  */
438
- export async function installSettings(platform, projectRoot, options, dryRun, runtime = 'unix') {
439
- const normalizedRuntime = normalizeRuntime(runtime);
468
+ export async function installSettings(platform, projectRoot, options, dryRun, runtime = 'python') {
469
+ normalizeRuntime(runtime);
440
470
  // 从文件加载 rules
441
471
  const rulesMeta = await loadRulesMetadata();
442
472
  const rulesPreset = options.rules || 'recommended';
@@ -464,11 +494,8 @@ export async function installSettings(platform, projectRoot, options, dryRun, ru
464
494
  await fs.ensureDir(path.dirname(settingsPath));
465
495
 
466
496
  // Read hook definition from unified template.
467
- // Windows runtime intentionally omits POSIX shell hook commands.
468
497
  const templatesDir = getTemplatesDir();
469
- const hookTemplate = normalizedRuntime === RUNTIME_WINDOWS
470
- ? { hooks: {} }
471
- : await fs.readJSON(path.join(templatesDir, 'hooks', 'commit-intent.json'));
498
+ const hookTemplate = await fs.readJSON(path.join(templatesDir, 'hooks', 'commit-intent.json'));
472
499
 
473
500
  await fs.writeFile(settingsPath, JSON.stringify(hookTemplate, null, 2));
474
501
  console.log(chalk.green(` ✓ .codebuddy/settings.json`));
@@ -492,17 +519,26 @@ export async function installSettings(platform, projectRoot, options, dryRun, ru
492
519
  await fs.ensureDir(claudeDir);
493
520
 
494
521
  // Read hook definition from unified template.
495
- // Windows runtime intentionally omits POSIX shell hook commands.
496
522
  const templatesDir = getTemplatesDir();
497
- const hookTemplate = normalizedRuntime === RUNTIME_WINDOWS
498
- ? { hooks: {} }
499
- : await fs.readJSON(path.join(templatesDir, 'hooks', 'commit-intent.json'));
523
+ const hookTemplate = await fs.readJSON(path.join(templatesDir, 'hooks', 'commit-intent.json'));
500
524
 
501
525
  // Settings
502
- const permissions = normalizedRuntime === RUNTIME_WINDOWS ? [] : [
526
+ const permissions = [
527
+ 'Bash(python3 .prizmkit/dev-pipeline/cli.py *)',
528
+ 'Bash(python .prizmkit/dev-pipeline/cli.py *)',
529
+ 'Bash(py -3 .prizmkit/dev-pipeline/cli.py *)',
530
+ 'Bash(python3 ./.prizmkit/dev-pipeline/cli.py *)',
531
+ 'Bash(python ./.prizmkit/dev-pipeline/cli.py *)',
532
+ 'Bash(py -3 ./.prizmkit/dev-pipeline/cli.py *)',
503
533
  'Bash(python3 .prizmkit/dev-pipeline/scripts/*)',
534
+ 'Bash(python3 .prizmkit/scripts/*.py *)',
535
+ 'Bash(python3 -c *)',
504
536
  'Bash(python .prizmkit/dev-pipeline/scripts/*)',
537
+ 'Bash(python .prizmkit/scripts/*.py *)',
538
+ 'Bash(python -c *)',
505
539
  'Bash(py -3 .prizmkit/dev-pipeline/scripts/*)',
540
+ 'Bash(py -3 .prizmkit/scripts/*.py *)',
541
+ 'Bash(py -3 -c *)',
506
542
  'Bash(git add *)',
507
543
  'Bash(git commit *)',
508
544
  'Bash(git diff *)',
@@ -510,26 +546,10 @@ export async function installSettings(platform, projectRoot, options, dryRun, ru
510
546
  'Bash(git log *)',
511
547
  'Bash(jq *)',
512
548
  ];
513
- if (options.pipeline && normalizedRuntime !== RUNTIME_WINDOWS) {
514
- // 动态扫描 pipeline 目录中的入口脚本,自动添加执行权限
515
- const pipelineDir = getPipelineDir(runtime);
516
- try {
517
- const pipelineEntries = await fs.readdir(pipelineDir);
518
- const entryRe = normalizedRuntime === RUNTIME_WINDOWS
519
- ? /^(run-|launch-|retry-|reset-).*\.ps1$/i
520
- : /^(run-|launch-|retry-|reset-).*\.sh$/;
521
- const entryScripts = pipelineEntries.filter(f => entryRe.test(f));
522
- for (const script of entryScripts) {
523
- permissions.push(`Bash(./.prizmkit/dev-pipeline/${script} *)`);
524
- }
525
- } catch {
526
- // Fallback: if readdir fails, add no pipeline permissions
527
- }
528
- }
529
549
 
530
550
  const settings = {
531
551
  permissions: { allow: permissions },
532
- hooks: normalizedRuntime === RUNTIME_WINDOWS ? {} : {
552
+ hooks: {
533
553
  ...hookTemplate.hooks,
534
554
  SessionStart: [
535
555
  {
@@ -628,15 +648,55 @@ function buildStandalonePrizmHook(templateContent) {
628
648
  ].join('\n');
629
649
  }
630
650
 
631
- function buildAppendedPrizmHook(templateContent) {
651
+ function buildShellPythonLauncherHook() {
632
652
  return [
633
653
  PRIZMKIT_HOOK_MARKER_START,
634
- templateContent.trimEnd(),
654
+ '# PrizmKit Python validation launcher',
655
+ 'PRIZMKIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) || PRIZMKIT_ROOT=""',
656
+ 'if [ -n "$PRIZMKIT_ROOT" ] && [ -f "$PRIZMKIT_ROOT/.prizmkit/prizm-docs/root.prizm" ]; then',
657
+ ' PRIZMKIT_VALIDATE="$PRIZMKIT_ROOT/.prizmkit/scripts/validate-prizm-docs.py"',
658
+ ' [ -f "$PRIZMKIT_VALIDATE" ] || PRIZMKIT_VALIDATE="$PRIZMKIT_ROOT/.prizmkit/dev-pipeline/scripts/validate-prizm-docs.py"',
659
+ ' if [ -f "$PRIZMKIT_VALIDATE" ]; then',
660
+ ' if command -v python3 >/dev/null 2>&1; then',
661
+ ' python3 "$PRIZMKIT_VALIDATE" --staged || exit $?',
662
+ ' elif command -v python >/dev/null 2>&1; then',
663
+ ' python "$PRIZMKIT_VALIDATE" --staged || exit $?',
664
+ ' elif command -v py >/dev/null 2>&1; then',
665
+ ' py -3 "$PRIZMKIT_VALIDATE" --staged || exit $?',
666
+ ' else',
667
+ ' echo "PrizmKit: Python 3 is required for .prizm docs validation." >&2',
668
+ ' exit 1',
669
+ ' fi',
670
+ ' fi',
671
+ 'fi',
635
672
  PRIZMKIT_HOOK_MARKER_END,
636
673
  '',
637
674
  ].join('\n');
638
675
  }
639
676
 
677
+ function buildAppendedPrizmHook(templateContent, userHookContent) {
678
+ if (/^#!.*\bpython[0-9.]*\b/i.test(userHookContent)) {
679
+ return [
680
+ PRIZMKIT_HOOK_MARKER_START,
681
+ 'import pathlib, subprocess, sys',
682
+ 'prizmkit_root_result = subprocess.run(["git", "rev-parse", "--show-toplevel"], text=True, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, check=False)',
683
+ 'if prizmkit_root_result.returncode == 0:',
684
+ ' prizmkit_root = pathlib.Path(prizmkit_root_result.stdout.strip())',
685
+ ' prizmkit_validate = prizmkit_root / ".prizmkit/scripts/validate-prizm-docs.py"',
686
+ ' if not prizmkit_validate.is_file():',
687
+ ' prizmkit_validate = prizmkit_root / ".prizmkit/dev-pipeline/scripts/validate-prizm-docs.py"',
688
+ ' if prizmkit_validate.is_file():',
689
+ ' prizmkit_result = subprocess.run([sys.executable, str(prizmkit_validate), "--staged"], cwd=prizmkit_root, check=False)',
690
+ ' if prizmkit_result.returncode != 0:',
691
+ ' raise SystemExit(prizmkit_result.returncode)',
692
+ PRIZMKIT_HOOK_MARKER_END,
693
+ '',
694
+ ].join('\n');
695
+ }
696
+
697
+ return buildShellPythonLauncherHook();
698
+ }
699
+
640
700
  function insertPrizmHookIntoUserHook(userHookContent, prizmHookBlock) {
641
701
  const content = userHookContent.trimEnd();
642
702
  const terminalSuccessExitPattern = /(^|\n)([ \t]*exit[ \t]+0[ \t]*(?:#.*)?)[ \t]*$/;
@@ -724,48 +784,29 @@ function hasUserHookContent(content) {
724
784
  .length > 0;
725
785
  }
726
786
 
727
- export async function installGitHook(projectRoot, dryRun, runtime = 'unix') {
787
+ export async function installGitHook(projectRoot, dryRun, runtime = 'python') {
728
788
  const gitDir = path.join(projectRoot, '.git');
729
- const normalizedRuntime = normalizeRuntime(runtime);
789
+ normalizeRuntime(runtime);
730
790
 
731
791
  if (dryRun) {
732
- const hookLabel = normalizedRuntime === RUNTIME_WINDOWS
733
- ? '.git/hooks/pre-commit skipped (Windows runtime: no shell hook)'
734
- : '.git/hooks/pre-commit (prizm format check)';
735
- console.log(chalk.gray(` [dry-run] ${hookLabel}`));
792
+ console.log(chalk.gray(` [dry-run] .git/hooks/pre-commit (prizm format check)`));
736
793
  return;
737
794
  }
738
795
 
739
796
  if (!fs.existsSync(gitDir)) return;
740
797
 
741
- const templatePath = path.join(getTemplatesDir(), 'hooks', 'prizm-pre-commit.sh');
798
+ const templatePath = path.join(getTemplatesDir(), 'hooks', 'prizm-pre-commit.py');
742
799
  const hooksDir = path.join(gitDir, 'hooks');
743
800
  const preCommitPath = path.join(hooksDir, 'pre-commit');
744
801
  const hookContent = fs.readFileSync(templatePath, 'utf8');
745
802
 
746
- if (normalizedRuntime === RUNTIME_WINDOWS) {
747
- if (fs.existsSync(preCommitPath)) {
748
- const existing = fs.readFileSync(preCommitPath, 'utf8');
749
- const cleaned = stripManagedPrizmHook(existing);
750
- if (!hasUserHookContent(cleaned)) {
751
- await fs.remove(preCommitPath);
752
- console.log(chalk.gray(' • .git/hooks/pre-commit shell hook removed for Windows runtime'));
753
- } else if (cleaned !== existing.trimEnd()) {
754
- fs.writeFileSync(preCommitPath, ensureTrailingNewline(cleaned));
755
- console.log(chalk.gray(' • PrizmKit shell hook block removed for Windows runtime'));
756
- }
757
- }
758
- console.log(chalk.gray(' • Git hook skipped (Windows runtime uses no shell hook)'));
759
- return;
760
- }
761
-
762
803
  fs.mkdirSync(hooksDir, { recursive: true });
763
804
 
764
805
  if (fs.existsSync(preCommitPath)) {
765
806
  const existing = fs.readFileSync(preCommitPath, 'utf8');
766
807
  const cleaned = stripManagedPrizmHook(existing);
767
808
  if (hasUserHookContent(cleaned)) {
768
- fs.writeFileSync(preCommitPath, insertPrizmHookIntoUserHook(cleaned, buildAppendedPrizmHook(hookContent)));
809
+ fs.writeFileSync(preCommitPath, insertPrizmHookIntoUserHook(cleaned, buildAppendedPrizmHook(hookContent, cleaned)));
769
810
  } else {
770
811
  fs.writeFileSync(preCommitPath, buildStandalonePrizmHook(hookContent));
771
812
  }
@@ -779,36 +820,41 @@ export async function installGitHook(projectRoot, dryRun, runtime = 'unix') {
779
820
  }
780
821
 
781
822
  /**
782
- * 安装 PrizmKit 脚本到 .prizmkit/scripts/(Windows runtime 跳过 shell-only 脚本)
823
+ * 安装 PrizmKit 脚本到 .prizmkit/scripts/
783
824
  */
784
- export async function installPrizmkitScripts(projectRoot, dryRun, runtime = 'unix') {
825
+ export async function installPrizmkitScripts(projectRoot, dryRun, runtime = 'python') {
785
826
  const scriptsDir = path.join(projectRoot, '.prizmkit', 'scripts');
786
827
  const templateHooksDir = path.join(getTemplatesDir(), 'hooks');
787
- const normalizedRuntime = normalizeRuntime(runtime);
828
+ normalizeRuntime(runtime);
788
829
 
789
830
  const scripts = [
831
+ 'validate-prizm-docs.py',
832
+ 'diff-prizm-docs.py',
833
+ ];
834
+ const legacyManagedScripts = [
790
835
  'validate-prizm-docs.sh',
791
836
  'diff-prizm-docs.sh',
792
837
  ];
793
838
 
794
839
  if (dryRun) {
795
840
  for (const s of scripts) {
796
- const action = normalizedRuntime === RUNTIME_WINDOWS ? 'skip shell script' : `.prizmkit/scripts/${s}`;
797
- console.log(chalk.gray(` [dry-run] ${action}`));
841
+ console.log(chalk.gray(` [dry-run] .prizmkit/scripts/${s}`));
798
842
  }
799
843
  return;
800
844
  }
801
845
 
802
- if (normalizedRuntime === RUNTIME_WINDOWS) {
803
- for (const s of scripts) {
804
- await fs.remove(path.join(scriptsDir, s));
846
+ await fs.ensureDir(scriptsDir);
847
+
848
+ for (const legacy of legacyManagedScripts) {
849
+ const legacyPath = path.join(scriptsDir, legacy);
850
+ if (!fs.existsSync(legacyPath)) continue;
851
+ const legacyContent = await fs.readFile(legacyPath, 'utf8');
852
+ const isManagedLegacy = legacyContent.includes(`# ${legacy}`) || legacyContent.includes(`PrizmKit: ${legacy}`);
853
+ if (isManagedLegacy) {
854
+ await fs.remove(legacyPath);
805
855
  }
806
- console.log(chalk.gray(' • shell-only PrizmKit scripts skipped for Windows runtime'));
807
- return;
808
856
  }
809
857
 
810
- await fs.ensureDir(scriptsDir);
811
-
812
858
  for (const s of scripts) {
813
859
  const src = path.join(templateHooksDir, s);
814
860
  if (!fs.existsSync(src)) continue;
@@ -896,10 +942,17 @@ Codex discovers repository skills from \`.agents/skills/\`. When a user or promp
896
942
  * Recursively collect all file paths under a directory.
897
943
  * Returns paths relative to `base`.
898
944
  */
945
+ function shouldSkipRecursivePipelineEntry(entryName, relativePath) {
946
+ const normalized = normalizePipelineRelPath(relativePath);
947
+ if (normalized === '.env.example') return false;
948
+ return entryName.startsWith('.') || entryName === '__pycache__' || entryName === 'node_modules' || entryName.endsWith('.pyc');
949
+ }
950
+
899
951
  function collectFilesRecursive(dir, base = '') {
900
952
  let files = [];
901
953
  for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
902
954
  const rel = path.join(base, entry.name);
955
+ if (shouldSkipRecursivePipelineEntry(entry.name, rel)) continue;
903
956
  if (entry.isDirectory()) {
904
957
  files.push(...collectFilesRecursive(path.join(dir, entry.name), rel));
905
958
  } else {
@@ -937,7 +990,7 @@ function collectInstallablePipelineFiles(pipelineSource) {
937
990
  * Used by upgrade to compute diff before actual installation.
938
991
  * @returns {string[]} relative file paths
939
992
  */
940
- export function resolvePipelineFileList(runtime = 'unix') {
993
+ export function resolvePipelineFileList(runtime = 'python') {
941
994
  const pipelineSource = getPipelineDir(runtime);
942
995
  if (!pipelineSource || !fs.pathExistsSync(pipelineSource)) return [];
943
996
  return collectInstallablePipelineFiles(pipelineSource);
@@ -959,6 +1012,7 @@ function isLikelyManagedPipelineFile(relativeFile) {
959
1012
  const normalized = normalizePipelineRelPath(relativeFile);
960
1013
  const segments = normalized.split('/');
961
1014
  if (segments.length === 0 || isPreservedPipelineRuntimeFile(normalized)) return false;
1015
+ if (RETIRED_SHELL_RUNTIME_FILES.has(normalized) || RETIRED_POWERSHELL_RUNTIME_FILES.has(normalized)) return true;
962
1016
  if (segments.length > 1 && PIPELINE_MANAGED_DIRS.has(segments[0])) return true;
963
1017
  return PIPELINE_MANAGED_TOP_LEVEL_PATTERNS.some(pattern => pattern.test(normalized));
964
1018
  }
@@ -986,7 +1040,7 @@ async function collectTargetPipelineFiles(dir, base = '') {
986
1040
  * This intentionally avoids arbitrary top-level files and runtime/state
987
1041
  * directories so user scratch files are preserved.
988
1042
  */
989
- export async function findStaleManagedPipelineFiles(projectRoot, runtime = 'unix') {
1043
+ export async function findStaleManagedPipelineFiles(projectRoot, runtime = 'python') {
990
1044
  const pipelineTarget = path.join(projectRoot, '.prizmkit', 'dev-pipeline');
991
1045
  if (!await fs.pathExists(pipelineTarget)) return [];
992
1046
 
@@ -1038,44 +1092,6 @@ export async function removeStaleManagedPipelineFiles(projectRoot, staleFiles, d
1038
1092
  return removedCount;
1039
1093
  }
1040
1094
 
1041
- async function pruneStalePipelineRuntimeFiles(pipelineTarget, runtime) {
1042
- if (!await fs.pathExists(pipelineTarget)) return false;
1043
-
1044
- const staleRuntime = runtime === RUNTIME_WINDOWS ? RUNTIME_UNIX : RUNTIME_WINDOWS;
1045
- const staleFiles = resolvePipelineFileList(staleRuntime);
1046
- const currentFiles = new Set(resolvePipelineFileList(runtime));
1047
- const staleDirs = new Set();
1048
- let prunedRuntimeSpecificFiles = false;
1049
-
1050
- for (const relativeFile of staleFiles) {
1051
- if (currentFiles.has(relativeFile)) continue;
1052
-
1053
- const targetFile = path.join(pipelineTarget, relativeFile);
1054
- if (await fs.pathExists(targetFile)) {
1055
- const stat = await fs.stat(targetFile);
1056
- if (stat.isFile()) {
1057
- await fs.remove(targetFile);
1058
- prunedRuntimeSpecificFiles = true;
1059
- }
1060
- }
1061
-
1062
- const relativeDir = path.dirname(relativeFile);
1063
- if (relativeDir && relativeDir !== '.') staleDirs.add(relativeDir);
1064
- }
1065
-
1066
- const dirsByDepth = [...staleDirs].sort((a, b) => b.split(path.sep).length - a.split(path.sep).length);
1067
- for (const relativeDir of dirsByDepth) {
1068
- const targetDir = path.join(pipelineTarget, relativeDir);
1069
- if (!await fs.pathExists(targetDir)) continue;
1070
- const entries = await fs.readdir(targetDir);
1071
- if (entries.length === 0) {
1072
- await fs.remove(targetDir);
1073
- }
1074
- }
1075
-
1076
- return prunedRuntimeSpecificFiles;
1077
- }
1078
-
1079
1095
  /**
1080
1096
  * 安装 dev-pipeline(纯 Copy 模式)
1081
1097
  * 安装目标:.prizmkit/dev-pipeline/
@@ -1101,8 +1117,9 @@ export async function installPipeline(projectRoot, dryRun, options = {}) {
1101
1117
  await fs.ensureDir(path.join(projectRoot, '.prizmkit', 'state', 'refactor'));
1102
1118
 
1103
1119
  const runtimeSwitched = previousRuntime !== runtime;
1104
- const prunedStaleRuntimeFiles = await pruneStalePipelineRuntimeFiles(pipelineTarget, runtime);
1105
- const overwriteExisting = forceOverwrite || runtimeSwitched || prunedStaleRuntimeFiles;
1120
+ const staleManagedFiles = await findStaleManagedPipelineFiles(projectRoot, runtime);
1121
+ await removeStaleManagedPipelineFiles(projectRoot, staleManagedFiles, false);
1122
+ const overwriteExisting = forceOverwrite || runtimeSwitched || staleManagedFiles.length > 0;
1106
1123
 
1107
1124
  const installedFiles = collectInstallablePipelineFiles(pipelineSource);
1108
1125
  let copiedCount = 0;
@@ -1399,7 +1416,7 @@ export const EXTRAS_REGISTRY = {
1399
1416
  * 执行纯净安装
1400
1417
  * @param {Object} config
1401
1418
  * @param {string} config.platform - 'codebuddy' | 'claude' | 'codex' | 'all'
1402
- * @param {string} [config.runtime] - 'unix' | 'windows'
1419
+ * @param {string} [config.runtime] - 'python' (legacy aliases accepted: 'unix' | 'windows')
1403
1420
  * @param {string} config.skills - 'core' | 'minimal' | 'recommended:<type>'
1404
1421
  * @param {boolean} config.team - 是否启用团队模式
1405
1422
  * @param {boolean} config.pipeline - 是否安装 dev-pipeline
@@ -1419,6 +1436,7 @@ export async function scaffold(config) {
1419
1436
  throw new Error(`Unknown platform "${platform}". Expected codebuddy, claude, codex, or all.`);
1420
1437
  }
1421
1438
  const platforms = expandPlatforms(platform);
1439
+ const payloadPlatforms = resolvePayloadPlatforms(platform, aiCli);
1422
1440
 
1423
1441
  if (dryRun) {
1424
1442
  console.log(chalk.yellow('\n [DRY RUN] 预览将要安装的内容:\n'));
@@ -1429,8 +1447,8 @@ export async function scaffold(config) {
1429
1447
 
1430
1448
  console.log('');
1431
1449
 
1432
- for (const p of platforms) {
1433
- console.log(chalk.bold(` 正在安装 ${platformLabel(p)} 环境...\n`));
1450
+ for (const p of payloadPlatforms) {
1451
+ console.log(chalk.bold(` 正在安装 ${platformLabel(p)} 环境...${platforms.includes(p) ? '' : chalk.gray(' (AI CLI payload)')}\n`));
1434
1452
 
1435
1453
  // 1. Skills
1436
1454
  console.log(chalk.blue(' 技能文件:'));
@@ -1498,7 +1516,7 @@ export async function scaffold(config) {
1498
1516
  const skillDef = knownSkills.find(s => s.name === name);
1499
1517
  if (skillDef) {
1500
1518
  try {
1501
- await installExternalSkill(skillDef, platform, projectRoot, dryRun);
1519
+ await installExternalSkill(skillDef, platform, projectRoot, dryRun, aiCli);
1502
1520
  console.log(chalk.green(` ✓ ${name} (external)`));
1503
1521
  } catch (e) {
1504
1522
  console.log(chalk.yellow(` ⚠ ${name} 安装失败,跳过: ${e.message}`));
@@ -1506,7 +1524,7 @@ export async function scaffold(config) {
1506
1524
  }
1507
1525
  }
1508
1526
  if (!dryRun) {
1509
- await cleanExternalSkillArtifacts(projectRoot, platform);
1527
+ await cleanExternalSkillArtifacts(projectRoot, platform, aiCli);
1510
1528
  }
1511
1529
  }
1512
1530
 
@@ -1528,7 +1546,7 @@ export async function scaffold(config) {
1528
1546
  // 11. Clean up stray .codebuddy/ directory left by third-party tools (e.g. npx skills)
1529
1547
  // when installing for Claude Code only. CodeBuddy files should never appear in a
1530
1548
  // claude-only install.
1531
- if (!dryRun && !platforms.includes('codebuddy')) {
1549
+ if (!dryRun && !payloadPlatforms.includes('codebuddy')) {
1532
1550
  const strayCbDir = path.join(projectRoot, '.codebuddy');
1533
1551
  if (await fs.pathExists(strayCbDir)) {
1534
1552
  const entries = await fs.readdir(strayCbDir);
@@ -1567,6 +1585,7 @@ export async function scaffold(config) {
1567
1585
  aiCli,
1568
1586
  rulesPreset: rulesPresetName,
1569
1587
  extras: activeExtras,
1588
+ payloadPlatforms,
1570
1589
  });
1571
1590
  await writeManifest(projectRoot, manifest);
1572
1591
  console.log(chalk.green(' ✓ .prizmkit/manifest.json'));
@@ -1615,7 +1634,10 @@ export async function scaffold(config) {
1615
1634
  console.log(chalk.gray(` 安装统计:`));
1616
1635
  console.log(chalk.gray(` 技能: ${suiteLabel}`));
1617
1636
  console.log(chalk.gray(` 平台: ${platforms.map(platformLabel).join(' + ')}`));
1618
- console.log(chalk.gray(` 运行系统: ${runtimeLabel(runtime)}`));
1637
+ if (payloadPlatforms.length !== platforms.length || payloadPlatforms.some(p => !platforms.includes(p))) {
1638
+ console.log(chalk.gray(` AI CLI 载荷平台: ${payloadPlatforms.map(platformLabel).join(' + ')}`));
1639
+ }
1640
+ console.log(chalk.gray(` 运行时: ${runtimeLabel(runtime)}`));
1619
1641
  console.log(chalk.gray(` 团队: ${team ? '已启用' : '未启用'}`));
1620
1642
  console.log(chalk.gray(` 流水线: ${pipeline ? '已安装' : '未安装'}`));
1621
1643
  const browserTools = [playwrightCli && 'playwright-cli', openCli && 'opencli'].filter(Boolean);
package/src/upgrade.js CHANGED
@@ -27,6 +27,7 @@ import {
27
27
  installGitHook,
28
28
  installGitignore,
29
29
  installProjectMemory,
30
+ installTeamConfig,
30
31
  resolvePipelineFileList,
31
32
  findStaleManagedPipelineFiles,
32
33
  removeStaleManagedPipelineFiles,
@@ -34,7 +35,7 @@ import {
34
35
  resolveSkillList,
35
36
  EXTRAS_REGISTRY,
36
37
  } from './scaffold.js';
37
- import { expandPlatforms, platformLabel } from './platforms.js';
38
+ import { platformLabel, resolvePayloadPlatforms } from './platforms.js';
38
39
  import { normalizeRuntime, runtimeLabel } from './runtimes.js';
39
40
 
40
41
  const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -220,7 +221,7 @@ export async function runUpgrade(directory, options = {}) {
220
221
 
221
222
  // 3. Resolve new skill list using old manifest's suite + platform (or defaults)
222
223
  const suite = oldManifest?.suite || 'core';
223
- const runtime = normalizeRuntime(oldManifest?.runtime || 'unix');
224
+ const runtime = normalizeRuntime(oldManifest?.runtime);
224
225
  const team = oldManifest?.options?.team ?? true;
225
226
  const pipeline = oldManifest?.options?.pipeline ?? true;
226
227
  const rulesPreset = oldManifest?.options?.rules || 'recommended';
@@ -276,6 +277,8 @@ export async function runUpgrade(directory, options = {}) {
276
277
  ...(!oldManifest?.files?.extras ? Object.keys(EXTRAS_REGISTRY) : []),
277
278
  ])].filter(name => EXTRAS_REGISTRY[name]); // only keep extras that still exist in registry
278
279
 
280
+ const payloadPlatforms = resolvePayloadPlatforms(platform, aiCli);
281
+
279
282
  // 4. Build new manifest and compute diff
280
283
  const newManifest = buildManifest({
281
284
  version: pkg.version,
@@ -290,6 +293,7 @@ export async function runUpgrade(directory, options = {}) {
290
293
  aiCli,
291
294
  rulesPreset,
292
295
  extras: extrasToInstall,
296
+ payloadPlatforms,
293
297
  });
294
298
 
295
299
  // Preserve original installedAt
@@ -349,7 +353,7 @@ export async function runUpgrade(directory, options = {}) {
349
353
  }
350
354
 
351
355
  // 7. Execute
352
- const platforms = expandPlatforms(platform);
356
+ const platforms = payloadPlatforms;
353
357
 
354
358
  // 7a. Remove orphaned files
355
359
  if (diff.skills.removed.length || diff.agents.removed.length || diff.rules.removed.length || diff.pipeline.removed.length || staleManagedPipelineFiles.length) {
@@ -396,6 +400,11 @@ export async function runUpgrade(directory, options = {}) {
396
400
  console.log(chalk.blue('\n Settings & Rules:'));
397
401
  await installSettings(p, projectRoot, { pipeline, rules: rulesPreset }, dryRun, runtime);
398
402
 
403
+ if (team) {
404
+ console.log(chalk.blue('\n Team Config:'));
405
+ await installTeamConfig(p, projectRoot, dryRun);
406
+ }
407
+
399
408
  console.log('');
400
409
  }
401
410