@ngockhoale/ukit 3.0.0 → 3.0.2

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 (445) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/manifests/documentation.yaml +75 -64
  3. package/manifests/engineConformance.yaml +32 -0
  4. package/manifests/hostCapabilities.yaml +2 -2
  5. package/manifests/instructionRules.yaml +55 -55
  6. package/manifests/platform.full.yaml +30 -4
  7. package/manifests/platform.user.yaml +4 -4
  8. package/package.json +8 -7
  9. package/scripts/bench/v3-ceremony.mjs +214 -0
  10. package/scripts/install/sync-installed-mirror.mjs +3 -3
  11. package/scripts/perf/audit-perf.mjs +9 -9
  12. package/scripts/perf/perf-findings.json +4 -4
  13. package/scripts/perf/perf-measure.md +20 -20
  14. package/src/cli/commands/doctor.js +38 -2
  15. package/src/core/buildPlan.js +3 -3
  16. package/src/core/compact/contextBudget.js +2 -2
  17. package/src/core/compact/threshold.js +3 -3
  18. package/src/core/docContracts.js +17 -17
  19. package/src/core/ensureGitignore.js +1 -1
  20. package/src/core/executionContracts.js +42 -2
  21. package/src/core/fileOps.js +3 -3
  22. package/src/core/gatewayProbe.js +2 -2
  23. package/src/core/gatewayResilienceEnv.js +2 -2
  24. package/src/core/handoffDocValidator.js +152 -0
  25. package/src/core/output/index.js +1 -1
  26. package/src/core/paths.js +2 -1
  27. package/src/core/reviewPanelAggregate.js +120 -0
  28. package/src/core/runInstallPipeline.js +6 -4
  29. package/src/core/runtimeConfig.js +13 -6
  30. package/src/core/sensitiveValueScanner.js +1 -1
  31. package/src/core/taskBudgetValidator.js +1 -1
  32. package/src/core/unattendedDoctor.js +1 -1
  33. package/src/core/update.js +1 -1
  34. package/src/index/buildIndex.js +2 -2
  35. package/src/index/impactCatalog.js +12 -12
  36. package/src/index/taskRouting.js +263 -5
  37. package/src/render/instructionRenderer.js +7 -7
  38. package/src/skill/auditSkill.js +1 -1
  39. package/{templates → template_project}/.claude/agents/code-reviewer.md +25 -0
  40. package/{templates → template_project}/.claude/agents/handoff-planner.md +17 -2
  41. package/{templates → template_project}/.claude/commands/ukit/handoff-create.md +1 -1
  42. package/{templates → template_project}/.claude/commands/ukit/handoff-fullstack.md +26 -6
  43. package/{templates → template_project}/.claude/commands/ukit/handoff-review.md +31 -6
  44. package/{templates → template_project}/.claude/hooks/handoff-model-guard.sh +1 -1
  45. package/{templates → template_project}/.claude/hooks/skill-router.sh +3 -3
  46. package/{templates → template_project}/.claude/skills/skill-quality/SKILL.md +1 -1
  47. package/{templates → template_project}/.claude/skills/skill-quality/pressure-scenario-template.md +1 -1
  48. package/template_project/.claude/ukit/index/handoff-doc-validator.mjs +193 -0
  49. package/{templates → template_project}/.claude/ukit/index/lib/index-core.mjs +12 -12
  50. package/template_project/.claude/ukit/index/review-panel-aggregate.mjs +174 -0
  51. package/{templates → template_project}/.claude/ukit/index/route-task.mjs +408 -12
  52. package/{templates → template_project}/.claude/ukit/index/unic-gateway.mjs +1 -1
  53. package/{templates → template_project}/.claude/ukit/runtime/execution-ledger.mjs +14 -5
  54. package/{templates → template_project}/.claude/ukit/runtime/safe-patch-core.mjs +3 -3
  55. package/{templates → template_project}/.claude/ukit/runtime/sensitive-value-scanner.mjs +1 -1
  56. package/{templates → template_project}/.claude/ukit/runtime/stop-coordinator.mjs +187 -8
  57. package/{templates → template_project}/.claude/ukit/runtime/task-watchdog.mjs +1 -1
  58. package/{templates → template_project}/.gitignore +2 -2
  59. package/{templates → template_project}/.omp/RULES.md +1 -1
  60. package/{templates → template_project}/.omp/agents/code-reviewer.md +27 -0
  61. package/{templates → template_project}/.omp/agents/handoff-planner.md +17 -2
  62. package/{templates → template_project}/.omp/config.yml +3 -3
  63. package/{templates → template_project}/AGENTS.md +2 -2
  64. package/{templates → template_project}/CLAUDE.md +2 -2
  65. package/{templates → template_project}/docs/AI_HANDOFF/RULES.md +1 -1
  66. package/{templates → template_project}/docs/UKIT_INTERNALS.md +3 -3
  67. package/{templates → template_project}/instructions/core.md +1 -1
  68. package/{templates → template_project}/instructions/layout.yaml +8 -8
  69. package/{templates → template_project}/instructions/overlays/claude.md +1 -1
  70. package/{templates → template_project}/instructions/overlays/repo.md +1 -1
  71. package/{templates → template_project}/ukit/storage/config.json +4 -1
  72. package/template_project/ukit/storage/memory/projects/.gitkeep +2 -0
  73. package/templates/ukit/storage/memory/projects/.gitkeep +0 -2
  74. /package/{templates → template_project}/.claude/agents/bug-debugger.md +0 -0
  75. /package/{templates → template_project}/.claude/agents/feature-implementer.md +0 -0
  76. /package/{templates → template_project}/.claude/agents/ukit-small-task-maintainer.md +0 -0
  77. /package/{templates → template_project}/.claude/agents/ukit-vision-analyst.md +0 -0
  78. /package/{templates → template_project}/.claude/commands/ukit/handoff-clear.md +0 -0
  79. /package/{templates → template_project}/.claude/commands/ukit/handoff-implement.md +0 -0
  80. /package/{templates → template_project}/.claude/commands/ukit/handoff-status.md +0 -0
  81. /package/{templates → template_project}/.claude/config/providers.md +0 -0
  82. /package/{templates → template_project}/.claude/hooks/auto-allow-bash.sh +0 -0
  83. /package/{templates → template_project}/.claude/hooks/auto-prune-bash.sh +0 -0
  84. /package/{templates → template_project}/.claude/hooks/block-dangerous.mjs +0 -0
  85. /package/{templates → template_project}/.claude/hooks/block-dangerous.sh +0 -0
  86. /package/{templates → template_project}/.claude/hooks/completion-gate.sh +0 -0
  87. /package/{templates → template_project}/.claude/hooks/compress-output.sh +0 -0
  88. /package/{templates → template_project}/.claude/hooks/context-hardcap-gate.sh +0 -0
  89. /package/{templates → template_project}/.claude/hooks/context-window-guard.sh +0 -0
  90. /package/{templates → template_project}/.claude/hooks/handoff-resume.sh +0 -0
  91. /package/{templates → template_project}/.claude/hooks/post-edit-verify.sh +0 -0
  92. /package/{templates → template_project}/.claude/hooks/pre-edit-backup.sh +0 -0
  93. /package/{templates → template_project}/.claude/hooks/project-important.sh +0 -0
  94. /package/{templates → template_project}/.claude/hooks/protect-files.sh +0 -0
  95. /package/{templates → template_project}/.claude/hooks/record-execution.mjs +0 -0
  96. /package/{templates → template_project}/.claude/hooks/record-execution.sh +0 -0
  97. /package/{templates → template_project}/.claude/hooks/reinject-context.sh +0 -0
  98. /package/{templates → template_project}/.claude/hooks/reset-compact-pressure.sh +0 -0
  99. /package/{templates → template_project}/.claude/hooks/sensitive-data-guard.mjs +0 -0
  100. /package/{templates → template_project}/.claude/hooks/sensitive-data-guard.sh +0 -0
  101. /package/{templates → template_project}/.claude/hooks/session-episode.sh +0 -0
  102. /package/{templates → template_project}/.claude/hooks/session-start.md +0 -0
  103. /package/{templates → template_project}/.claude/hooks/stale-spec-guard.sh +0 -0
  104. /package/{templates → template_project}/.claude/hooks/task-watchdog.sh +0 -0
  105. /package/{templates → template_project}/.claude/hooks/verification-guard.sh +0 -0
  106. /package/{templates → template_project}/.claude/hooks/vision-router.sh +0 -0
  107. /package/{templates → template_project}/.claude/settings.json +0 -0
  108. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -0
  109. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -0
  110. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -0
  111. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -0
  112. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -0
  113. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -0
  114. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -0
  115. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -0
  116. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -0
  117. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -0
  118. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -0
  119. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -0
  120. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -0
  121. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -0
  122. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -0
  123. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -0
  124. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -0
  125. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -0
  126. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -0
  127. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -0
  128. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -0
  129. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -0
  130. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -0
  131. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -0
  132. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -0
  133. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -0
  134. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -0
  135. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -0
  136. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -0
  137. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -0
  138. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -0
  139. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/mce/mc.xsd +0 -0
  140. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2010.xsd +0 -0
  141. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2012.xsd +0 -0
  142. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2018.xsd +0 -0
  143. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cex-2018.xsd +0 -0
  144. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cid-2016.xsd +0 -0
  145. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -0
  146. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-symex-2015.xsd +0 -0
  147. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/pack.py +0 -0
  148. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/unpack.py +0 -0
  149. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validate.py +0 -0
  150. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/__init__.py +0 -0
  151. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/base.py +0 -0
  152. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/docx.py +0 -0
  153. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/pptx.py +0 -0
  154. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/redlining.py +0 -0
  155. /package/{templates → template_project}/.claude/skills/backend-api/SKILL.md +0 -0
  156. /package/{templates → template_project}/.claude/skills/canvas-design/LICENSE.txt +0 -0
  157. /package/{templates → template_project}/.claude/skills/canvas-design/SKILL.md +0 -0
  158. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  159. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +0 -0
  160. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  161. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  162. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  163. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  164. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +0 -0
  165. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  166. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  167. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  168. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  169. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +0 -0
  170. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  171. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  172. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  173. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  174. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +0 -0
  175. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  176. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +0 -0
  177. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  178. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  179. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +0 -0
  180. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  181. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  182. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +0 -0
  183. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  184. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +0 -0
  185. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  186. /package/{templates → template_project}/.claude/skills/canvas-design/philosophy-examples.md +0 -0
  187. /package/{templates → template_project}/.claude/skills/code-review/SKILL.md +0 -0
  188. /package/{templates → template_project}/.claude/skills/debugging-toolkit/SKILL.md +0 -0
  189. /package/{templates → template_project}/.claude/skills/debugging-toolkit/reference-tables.md +0 -0
  190. /package/{templates → template_project}/.claude/skills/delivery/SKILL.md +0 -0
  191. /package/{templates → template_project}/.claude/skills/discover-security/SKILL.md +0 -0
  192. /package/{templates → template_project}/.claude/skills/docker-packaging/SKILL.md +0 -0
  193. /package/{templates → template_project}/.claude/skills/docs-manager/SKILL.md +0 -0
  194. /package/{templates → template_project}/.claude/skills/docs-manager/conventions-and-examples.md +0 -0
  195. /package/{templates → template_project}/.claude/skills/docs-manager/init-project-docs.sh +0 -0
  196. /package/{templates → template_project}/.claude/skills/docs-manager/templates/README.md.template +0 -0
  197. /package/{templates → template_project}/.claude/skills/docs-manager/templates/agent-roles.md.template +0 -0
  198. /package/{templates → template_project}/.claude/skills/docs-manager/templates/coding-conventions.md.template +0 -0
  199. /package/{templates → template_project}/.claude/skills/docs-manager/templates/memory.md.template +0 -0
  200. /package/{templates → template_project}/.claude/skills/docs-manager/templates/onboarding.md.template +0 -0
  201. /package/{templates → template_project}/.claude/skills/docs-manager/templates/project.md.template +0 -0
  202. /package/{templates → template_project}/.claude/skills/docs-quality/SKILL.md +0 -0
  203. /package/{templates → template_project}/.claude/skills/docx/LICENSE.txt +0 -0
  204. /package/{templates → template_project}/.claude/skills/docx/SKILL.md +0 -0
  205. /package/{templates → template_project}/.claude/skills/docx/docx-js.md +0 -0
  206. /package/{templates → template_project}/.claude/skills/docx/ooxml.md +0 -0
  207. /package/{templates → template_project}/.claude/skills/docx/redlining-reference.md +0 -0
  208. /package/{templates → template_project}/.claude/skills/docx/scripts/__init__.py +0 -0
  209. /package/{templates → template_project}/.claude/skills/docx/scripts/document.py +0 -0
  210. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/comments.xml +0 -0
  211. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/commentsExtended.xml +0 -0
  212. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/commentsExtensible.xml +0 -0
  213. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/commentsIds.xml +0 -0
  214. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/people.xml +0 -0
  215. /package/{templates → template_project}/.claude/skills/docx/scripts/utilities.py +0 -0
  216. /package/{templates → template_project}/.claude/skills/duraone/SKILL.md +0 -0
  217. /package/{templates → template_project}/.claude/skills/duraone/references/backend.md +0 -0
  218. /package/{templates → template_project}/.claude/skills/duraone/references/frontend.md +0 -0
  219. /package/{templates → template_project}/.claude/skills/duraone/references/sql.md +0 -0
  220. /package/{templates → template_project}/.claude/skills/duraone/references/workflow.md +0 -0
  221. /package/{templates → template_project}/.claude/skills/executing-plans/SKILL.md +0 -0
  222. /package/{templates → template_project}/.claude/skills/file-organizer/SKILL.md +0 -0
  223. /package/{templates → template_project}/.claude/skills/file-organizer/examples-and-practices.md +0 -0
  224. /package/{templates → template_project}/.claude/skills/frontend/SKILL.md +0 -0
  225. /package/{templates → template_project}/.claude/skills/frontend-design/LICENSE.txt +0 -0
  226. /package/{templates → template_project}/.claude/skills/frontend-design/SKILL.md +0 -0
  227. /package/{templates → template_project}/.claude/skills/frontend-vue/SKILL.md +0 -0
  228. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Box.vue +0 -0
  229. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Button.vue +0 -0
  230. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/ButtonBar.vue +0 -0
  231. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/ButtonFloat.vue +0 -0
  232. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/CheckButton.vue +0 -0
  233. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Checkbox.vue +0 -0
  234. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Datetime.vue +0 -0
  235. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Dropdownlist.vue +0 -0
  236. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Input.vue +0 -0
  237. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Label.vue +0 -0
  238. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Master/BoxColumn.vue +0 -0
  239. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/Confirm.vue +0 -0
  240. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/Info.vue +0 -0
  241. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/ModalInfo.vue +0 -0
  242. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/Reject.vue +0 -0
  243. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Tag.vue +0 -0
  244. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Upload.vue +0 -0
  245. /package/{templates → template_project}/.claude/skills/frontend-vue/components/ControlMobile/Dropdownlist.vue +0 -0
  246. /package/{templates → template_project}/.claude/skills/frontend-vue/components/ControlMobile/PagingBar.vue +0 -0
  247. /package/{templates → template_project}/.claude/skills/frontend-vue/components/ControlMobile/UploadImage.vue +0 -0
  248. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/AG.vue +0 -0
  249. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/AntTable.vue +0 -0
  250. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditor.vue +0 -0
  251. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditorEnable.vue +0 -0
  252. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/HtmlTable.vue +0 -0
  253. /package/{templates → template_project}/.claude/skills/frontend-vue/components/PDFViewer.vue +0 -0
  254. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Panel/FormView.vue +0 -0
  255. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Partial/Footer.vue +0 -0
  256. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Partial/Header.vue +0 -0
  257. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Partial/Sidebar.vue +0 -0
  258. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Template.vue +0 -0
  259. /package/{templates → template_project}/.claude/skills/frontend-vue/components/View/Form.vue +0 -0
  260. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/indexDBStore.js +0 -0
  261. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/masterApi.js +0 -0
  262. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/state.js +0 -0
  263. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useRequest.js +0 -0
  264. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useSession.js +0 -0
  265. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useTranslation.js +0 -0
  266. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useWebSocket.js +0 -0
  267. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/userObj.js +0 -0
  268. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/utils.js +0 -0
  269. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/composables-example.vue +0 -0
  270. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/form-example.vue +0 -0
  271. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/grid-example.vue +0 -0
  272. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/masterdata-example/[id].vue +0 -0
  273. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/masterdata-example/index.vue +0 -0
  274. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/popup-example.vue +0 -0
  275. /package/{templates → template_project}/.claude/skills/next-step/SKILL.md +0 -0
  276. /package/{templates → template_project}/.claude/skills/pdf/LICENSE.txt +0 -0
  277. /package/{templates → template_project}/.claude/skills/pdf/SKILL.md +0 -0
  278. /package/{templates → template_project}/.claude/skills/pdf/forms.md +0 -0
  279. /package/{templates → template_project}/.claude/skills/pdf/reference.md +0 -0
  280. /package/{templates → template_project}/.claude/skills/pdf/scripts/check_bounding_boxes.py +0 -0
  281. /package/{templates → template_project}/.claude/skills/pdf/scripts/check_bounding_boxes_test.py +0 -0
  282. /package/{templates → template_project}/.claude/skills/pdf/scripts/check_fillable_fields.py +0 -0
  283. /package/{templates → template_project}/.claude/skills/pdf/scripts/convert_pdf_to_images.py +0 -0
  284. /package/{templates → template_project}/.claude/skills/pdf/scripts/create_validation_image.py +0 -0
  285. /package/{templates → template_project}/.claude/skills/pdf/scripts/extract_form_field_info.py +0 -0
  286. /package/{templates → template_project}/.claude/skills/pdf/scripts/fill_fillable_fields.py +0 -0
  287. /package/{templates → template_project}/.claude/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -0
  288. /package/{templates → template_project}/.claude/skills/pdf-processing/SKILL.md +0 -0
  289. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/FORMS.md +0 -0
  290. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/OCR.md +0 -0
  291. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/SKILL.md +0 -0
  292. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/TABLES.md +0 -0
  293. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/scripts/analyze_form.py +0 -0
  294. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/workflows-and-troubleshooting.md +0 -0
  295. /package/{templates → template_project}/.claude/skills/postgres/SKILL.md +0 -0
  296. /package/{templates → template_project}/.claude/skills/postgres/reference/fn_get_examples.sql +0 -0
  297. /package/{templates → template_project}/.claude/skills/postgres/reference/fn_rpt_examples.sql +0 -0
  298. /package/{templates → template_project}/.claude/skills/postgres/reference/utility_functions.sql +0 -0
  299. /package/{templates → template_project}/.claude/skills/pptx/LICENSE.txt +0 -0
  300. /package/{templates → template_project}/.claude/skills/pptx/SKILL.md +0 -0
  301. /package/{templates → template_project}/.claude/skills/pptx/design-references.md +0 -0
  302. /package/{templates → template_project}/.claude/skills/pptx/html2pptx.md +0 -0
  303. /package/{templates → template_project}/.claude/skills/pptx/ooxml.md +0 -0
  304. /package/{templates → template_project}/.claude/skills/pptx/scripts/html2pptx.js +0 -0
  305. /package/{templates → template_project}/.claude/skills/pptx/scripts/inventory.py +0 -0
  306. /package/{templates → template_project}/.claude/skills/pptx/scripts/rearrange.py +0 -0
  307. /package/{templates → template_project}/.claude/skills/pptx/scripts/replace.py +0 -0
  308. /package/{templates → template_project}/.claude/skills/pptx/scripts/thumbnail.py +0 -0
  309. /package/{templates → template_project}/.claude/skills/pptx/template-replacement-reference.md +0 -0
  310. /package/{templates → template_project}/.claude/skills/pptx/utilities.md +0 -0
  311. /package/{templates → template_project}/.claude/skills/principle-attack-the-premise/SKILL.md +0 -0
  312. /package/{templates → template_project}/.claude/skills/principle-boundary-discipline/SKILL.md +0 -0
  313. /package/{templates → template_project}/.claude/skills/principle-encode-lessons-in-structure/SKILL.md +0 -0
  314. /package/{templates → template_project}/.claude/skills/principle-fix-root-causes/SKILL.md +0 -0
  315. /package/{templates → template_project}/.claude/skills/principle-foundational-thinking/SKILL.md +0 -0
  316. /package/{templates → template_project}/.claude/skills/principle-guard-the-context-window/SKILL.md +0 -0
  317. /package/{templates → template_project}/.claude/skills/principle-laziness-protocol/SKILL.md +0 -0
  318. /package/{templates → template_project}/.claude/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +0 -0
  319. /package/{templates → template_project}/.claude/skills/principle-minimize-reader-load/SKILL.md +0 -0
  320. /package/{templates → template_project}/.claude/skills/principle-model-the-domain/SKILL.md +0 -0
  321. /package/{templates → template_project}/.claude/skills/principle-never-block-on-the-human/SKILL.md +0 -0
  322. /package/{templates → template_project}/.claude/skills/principle-prove-it-works/SKILL.md +0 -0
  323. /package/{templates → template_project}/.claude/skills/principle-sequence-verifiable-units/SKILL.md +0 -0
  324. /package/{templates → template_project}/.claude/skills/principle-subtract-before-you-add/SKILL.md +0 -0
  325. /package/{templates → template_project}/.claude/skills/principle-test-behavior-not-implementation/SKILL.md +0 -0
  326. /package/{templates → template_project}/.claude/skills/project-learning/SKILL.md +0 -0
  327. /package/{templates → template_project}/.claude/skills/repo-maintenance/SKILL.md +0 -0
  328. /package/{templates → template_project}/.claude/skills/research/EXAMPLES.md +0 -0
  329. /package/{templates → template_project}/.claude/skills/research/REFERENCE.md +0 -0
  330. /package/{templates → template_project}/.claude/skills/research/SKILL.md +0 -0
  331. /package/{templates → template_project}/.claude/skills/root-cause-tracing/SKILL.md +0 -0
  332. /package/{templates → template_project}/.claude/skills/root-cause-tracing/diagrams.md +0 -0
  333. /package/{templates → template_project}/.claude/skills/root-cause-tracing/find-polluter.sh +0 -0
  334. /package/{templates → template_project}/.claude/skills/sharing-skills/SKILL.md +0 -0
  335. /package/{templates → template_project}/.claude/skills/sharing-skills/complete-example.md +0 -0
  336. /package/{templates → template_project}/.claude/skills/skill-quality/rationalization-table-template.md +0 -0
  337. /package/{templates → template_project}/.claude/skills/skill-quality/trigger-accuracy-template.md +0 -0
  338. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/SKILL.md +0 -0
  339. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/references/advanced-techniques.md +0 -0
  340. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/references/core-concepts.md +0 -0
  341. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/references/query-patterns.md +0 -0
  342. /package/{templates → template_project}/.claude/skills/subagent-driven-development/SKILL.md +0 -0
  343. /package/{templates → template_project}/.claude/skills/subagent-driven-development/example-workflow.md +0 -0
  344. /package/{templates → template_project}/.claude/skills/systematic-debugging/CREATION-LOG.md +0 -0
  345. /package/{templates → template_project}/.claude/skills/systematic-debugging/SKILL.md +0 -0
  346. /package/{templates → template_project}/.claude/skills/systematic-debugging/reference-tables.md +0 -0
  347. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-academic.md +0 -0
  348. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-pressure-1.md +0 -0
  349. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-pressure-2.md +0 -0
  350. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-pressure-3.md +0 -0
  351. /package/{templates → template_project}/.claude/skills/test-driven-development/SKILL.md +0 -0
  352. /package/{templates → template_project}/.claude/skills/test-driven-development/reference-tables.md +0 -0
  353. /package/{templates → template_project}/.claude/skills/testing-anti-patterns/SKILL.md +0 -0
  354. /package/{templates → template_project}/.claude/skills/testing-anti-patterns/reference-tables.md +0 -0
  355. /package/{templates → template_project}/.claude/skills/testing-quality/SKILL.md +0 -0
  356. /package/{templates → template_project}/.claude/skills/update-status/SKILL.md +0 -0
  357. /package/{templates → template_project}/.claude/skills/verification-before-completion/SKILL.md +0 -0
  358. /package/{templates → template_project}/.claude/skills/verification-before-completion/key-patterns.md +0 -0
  359. /package/{templates → template_project}/.claude/skills/webapp-testing/LICENSE.txt +0 -0
  360. /package/{templates → template_project}/.claude/skills/webapp-testing/SKILL.md +0 -0
  361. /package/{templates → template_project}/.claude/skills/webapp-testing/examples/console_logging.py +0 -0
  362. /package/{templates → template_project}/.claude/skills/webapp-testing/examples/element_discovery.py +0 -0
  363. /package/{templates → template_project}/.claude/skills/webapp-testing/examples/static_html_automation.py +0 -0
  364. /package/{templates → template_project}/.claude/skills/webapp-testing/scripts/with_server.py +0 -0
  365. /package/{templates → template_project}/.claude/ukit/index/anchor-search.mjs +0 -0
  366. /package/{templates → template_project}/.claude/ukit/index/build-index.mjs +0 -0
  367. /package/{templates → template_project}/.claude/ukit/index/cache-utils.mjs +0 -0
  368. /package/{templates → template_project}/.claude/ukit/index/extract-image.mjs +0 -0
  369. /package/{templates → template_project}/.claude/ukit/index/impact-context.mjs +0 -0
  370. /package/{templates → template_project}/.claude/ukit/index/post-edit-verify.mjs +0 -0
  371. /package/{templates → template_project}/.claude/ukit/index/pre-edit-backup.mjs +0 -0
  372. /package/{templates → template_project}/.claude/ukit/index/provision-worktree.mjs +0 -0
  373. /package/{templates → template_project}/.claude/ukit/index/query-index.mjs +0 -0
  374. /package/{templates → template_project}/.claude/ukit/index/refresh-index.mjs +0 -0
  375. /package/{templates → template_project}/.claude/ukit/index/reset-auto-permissions.mjs +0 -0
  376. /package/{templates → template_project}/.claude/ukit/index/resolve-context.mjs +0 -0
  377. /package/{templates → template_project}/.claude/ukit/index/route-catalog.mjs +0 -0
  378. /package/{templates → template_project}/.claude/ukit/index/safe-patch.mjs +0 -0
  379. /package/{templates → template_project}/.claude/ukit/index/stale-spec-check.mjs +0 -0
  380. /package/{templates → template_project}/.claude/ukit/index/task-budget-validator.mjs +0 -0
  381. /package/{templates → template_project}/.claude/ukit/index/triage.mjs +0 -0
  382. /package/{templates → template_project}/.claude/ukit/index/verify-context.mjs +0 -0
  383. /package/{templates → template_project}/.claude/ukit/runtime/async-lock.mjs +0 -0
  384. /package/{templates → template_project}/.claude/ukit/runtime/compact-threshold.mjs +0 -0
  385. /package/{templates → template_project}/.claude/ukit/runtime/context-capacity.mjs +0 -0
  386. /package/{templates → template_project}/.claude/ukit/runtime/hook-chain-budget.mjs +0 -0
  387. /package/{templates → template_project}/.claude/ukit/runtime/hook-chain-runner.mjs +0 -0
  388. /package/{templates → template_project}/.claude/ukit/runtime/hook-field-salvage.mjs +0 -0
  389. /package/{templates → template_project}/.claude/ukit/runtime/hook-input.mjs +0 -0
  390. /package/{templates → template_project}/.claude/ukit/runtime/hook-input.sh +0 -0
  391. /package/{templates → template_project}/.claude/ukit/runtime/hook-payload-store.mjs +0 -0
  392. /package/{templates → template_project}/.claude/ukit/runtime/hook-process.mjs +0 -0
  393. /package/{templates → template_project}/.claude/ukit/runtime/hook-telemetry.mjs +0 -0
  394. /package/{templates → template_project}/.claude/ukit/runtime/hook-telemetry.sh +0 -0
  395. /package/{templates → template_project}/.claude/ukit/runtime/output-compression.mjs +0 -0
  396. /package/{templates → template_project}/.claude/ukit/runtime/project-important.mjs +0 -0
  397. /package/{templates → template_project}/.claude/ukit/runtime/reinject-context.mjs +0 -0
  398. /package/{templates → template_project}/.claude/ukit/runtime/text-profile.mjs +0 -0
  399. /package/{templates → template_project}/.claude/ukit/runtime/token-utils.mjs +0 -0
  400. /package/{templates → template_project}/.claude/ukit/runtime/transcript-tail.mjs +0 -0
  401. /package/{templates → template_project}/.claude/ukit/skill-router-state.json +0 -0
  402. /package/{templates → template_project}/.codex/README.md +0 -0
  403. /package/{templates → template_project}/.codex/settings.json +0 -0
  404. /package/{templates → template_project}/.omp/AGENTS.md +0 -0
  405. /package/{templates → template_project}/.omp/README.md +0 -0
  406. /package/{templates → template_project}/.omp/agents/bug-debugger.md +0 -0
  407. /package/{templates → template_project}/.omp/agents/feature-implementer.md +0 -0
  408. /package/{templates → template_project}/.omp/agents/ukit-small-task-maintainer.md +0 -0
  409. /package/{templates → template_project}/.omp/agents/ukit-vision-analyst.md +0 -0
  410. /package/{templates → template_project}/.omp/hooks/pre/ukit-bridge.js +0 -0
  411. /package/{templates → template_project}/.ukit/storage/cache/hook-latency/unknown.jsonl +0 -0
  412. /package/{templates → template_project}/PROJECT_IMPORTANT.md +0 -0
  413. /package/{templates → template_project}/adapter-presets/claude/settings.local.json +0 -0
  414. /package/{templates → template_project}/adapter-presets/codex/settings.local.json +0 -0
  415. /package/{templates → template_project}/docs/AI_HANDOFF/ACTIVE.md +0 -0
  416. /package/{templates → template_project}/docs/AI_HANDOFF/HISTORY.md +0 -0
  417. /package/{templates → template_project}/docs/AI_HANDOFF/INDEX.md +0 -0
  418. /package/{templates → template_project}/docs/AI_HANDOFF/PLAN.md +0 -0
  419. /package/{templates → template_project}/docs/AI_HANDOFF/SPEC.md +0 -0
  420. /package/{templates → template_project}/docs/AI_HANDOFF/archive/.gitkeep +0 -0
  421. /package/{templates → template_project}/docs/AI_HANDOFF/tasks/.gitkeep +0 -0
  422. /package/{templates → template_project}/docs/AI_HANDOFF/tasks/_TEMPLATE.md +0 -0
  423. /package/{templates → template_project}/docs/BUGFIX.md +0 -0
  424. /package/{templates → template_project}/docs/BUG_INDEX.md +0 -0
  425. /package/{templates → template_project}/docs/BUG_METRICS.md +0 -0
  426. /package/{templates → template_project}/docs/BUG_TEMPLATE.md +0 -0
  427. /package/{templates → template_project}/docs/CODE_MAP.md +0 -0
  428. /package/{templates → template_project}/docs/MEMORY.md +0 -0
  429. /package/{templates → template_project}/docs/PROJECT.md +0 -0
  430. /package/{templates → template_project}/docs/PROMPT_CACHING.md +0 -0
  431. /package/{templates → template_project}/docs/WORKLOG.md +0 -0
  432. /package/{templates → template_project}/instructions/overlays/agents.md +0 -0
  433. /package/{templates → template_project}/instructions/overlays/omp-rules.md +0 -0
  434. /package/{templates → template_project}/instructions/repo-vars.yaml +0 -0
  435. /package/{templates → template_project}/ukit/README.md +0 -0
  436. /package/{templates → template_project}/ukit/storage/cache/compact-history.json +0 -0
  437. /package/{templates → template_project}/ukit/storage/cache/compact-pressure.json +0 -0
  438. /package/{templates → template_project}/ukit/storage/cache/output-history.json +0 -0
  439. /package/{templates → template_project}/ukit/storage/cache/prompt-cache.json +0 -0
  440. /package/{templates → template_project}/ukit/storage/memory/sessions/.gitkeep +0 -0
  441. /package/{templates → template_project}/ukit/storage/memory/user.json +0 -0
  442. /package/{templates/user → template_user}/README.md +0 -0
  443. /package/{templates/user → template_user}/playbooks/bug-fix.md +0 -0
  444. /package/{templates/user → template_user}/playbooks/issue-implementation.md +0 -0
  445. /package/{templates/user → template_user}/storage/config.json +0 -0
@@ -16,10 +16,14 @@
16
16
  * `docs/AI_HANDOFF/RUN.md` carries `Phase:` other than `done`/`blocked`, a
17
17
  * handoff-fullstack run is still in flight and the stop is bounced back with
18
18
  * the cursor's `Next:` step — this is what keeps an overnight run moving
19
- * after a recap instead of stalling idle. A stalled-cursor breaker releases
20
- * the stop if the cursor has not advanced across `stopGateMaxStalledBlocks`
21
- * consecutive blocked stops (same liveness shape as the ledger's
22
- * noProgressCount breaker);
19
+ * after a recap instead of stalling idle. When RUN.md carries an
20
+ * `ExitPredicate:` line (mechanic #7), `Phase: done` is accepted only if the
21
+ * predicate evaluates true — `all(index:all-done, git:clean,
22
+ * file-exists:<relpath>)` terms checked mechanically, no eval, no shell-out.
23
+ * A stalled-cursor breaker releases the stop if the cursor has not advanced
24
+ * across `stopGateMaxStalledBlocks` consecutive blocked stops (same liveness
25
+ * shape as the ledger's noProgressCount breaker), and its advisory reports
26
+ * the predicate state so a plateau is visible;
23
27
  * - it merges the three evaluator results with a deterministic owner order —
24
28
  * fail-closed completion failure > completion block > handoff-cursor block >
25
29
  * watchdog block > merged advisory > silent release — and emits AT MOST ONE
@@ -71,7 +75,7 @@
71
75
  import fs from 'node:fs/promises';
72
76
  import fsSync from 'node:fs';
73
77
  import path from 'node:path';
74
- import { spawn } from 'node:child_process';
78
+ import { spawn, spawnSync } from 'node:child_process';
75
79
 
76
80
  import { withAsyncLock } from './async-lock.mjs';
77
81
 
@@ -447,9 +451,141 @@ function parseRunCursor(text) {
447
451
  phase: field('Phase'),
448
452
  cursor: field('Cursor'),
449
453
  next: field('Next'),
454
+ exitPredicate: field('ExitPredicate'),
450
455
  };
451
456
  }
452
457
 
458
+ // ─── Exit predicate (mechanic #7 — exit-predicate-first loop) ─────────────
459
+ //
460
+ // The planner writes one `ExitPredicate:` line into RUN.md at P2 and the gate
461
+ // evaluates it mechanically when the cursor claims `Phase: done`. The grammar
462
+ // is deliberately tiny — `all(<term>[,<term>...])` or a single term, where a
463
+ // term is `index:all-done`, `git:clean`, or `file-exists:<relpath>` — so the
464
+ // whole check stays inside the hook deadline: ≤3 file reads + one
465
+ // `git status --porcelain`, no eval, no shell-out of predicate text.
466
+
467
+ /**
468
+ * Parse the ExitPredicate expression into a term list. Returns null when the
469
+ * expression is malformed — a malformed predicate is unsatisfiable, so a run
470
+ * that wrote garbage cannot claim `done` through it.
471
+ */
472
+ export function parseExitPredicate(expr) {
473
+ const trimmed = String(expr || '').trim();
474
+ if (!trimmed) return null;
475
+ const inner = trimmed.match(/^all\((.*)\)$/s)?.[1] ?? trimmed;
476
+ const terms = inner
477
+ .split(',')
478
+ .map((t) => t.trim())
479
+ .filter(Boolean);
480
+ if (terms.length === 0) return null;
481
+ const TERM_RE = /^(index:all-done|git:clean|file-exists:[^\s,]+)$/;
482
+ return terms.every((t) => TERM_RE.test(t)) ? terms : null;
483
+ }
484
+
485
+ /**
486
+ * `index:all-done` — every TASK-xxx row in docs/AI_HANDOFF/INDEX.md is in a
487
+ * terminal-success status (`done` or `cancelled_superseded`). An unreadable or
488
+ * taskless INDEX cannot prove all-done, so the term fails.
489
+ */
490
+ async function evalIndexAllDone(projectRoot) {
491
+ let text;
492
+ try {
493
+ text = await fs.readFile(path.join(projectRoot, 'docs', 'AI_HANDOFF', 'INDEX.md'), 'utf8');
494
+ } catch {
495
+ return { pass: false, detail: 'INDEX.md unreadable' };
496
+ }
497
+ const rows = String(text)
498
+ .split('\n')
499
+ .map((line) => line.trim())
500
+ .filter((line) => /^\|TASK-/i.test(line));
501
+ if (rows.length === 0) return { pass: false, detail: 'INDEX.md has no task rows' };
502
+ const failing = [];
503
+ for (const row of rows) {
504
+ const cells = row.split('|').map((c) => c.trim()).filter(Boolean);
505
+ const status = (cells[4] || '').toLowerCase();
506
+ if (status !== 'done' && status !== 'cancelled_superseded') {
507
+ failing.push(`${cells[0]}=${cells[4] || '?'}`);
508
+ }
509
+ }
510
+ return failing.length === 0
511
+ ? { pass: true, detail: `${rows.length} task row(s) done` }
512
+ : { pass: false, detail: `not done: ${failing.join(', ')}` };
513
+ }
514
+
515
+ /**
516
+ * `git:clean` — `git status --porcelain` is empty. A non-git directory (or a
517
+ * missing git binary) cannot prove clean, so the term fails without throwing.
518
+ */
519
+ function evalGitClean(projectRoot) {
520
+ try {
521
+ if (!fsSync.existsSync(path.join(projectRoot, '.git'))) {
522
+ return { pass: false, detail: 'not a git worktree' };
523
+ }
524
+ const res = spawnSync('git', ['status', '--porcelain'], {
525
+ cwd: projectRoot,
526
+ encoding: 'utf8',
527
+ timeout: 2000,
528
+ });
529
+ if (res.error || res.status !== 0) {
530
+ return { pass: false, detail: 'git status failed' };
531
+ }
532
+ return String(res.stdout).trim() === ''
533
+ ? { pass: true, detail: 'clean' }
534
+ : { pass: false, detail: 'dirty worktree' };
535
+ } catch {
536
+ return { pass: false, detail: 'git status failed' };
537
+ }
538
+ }
539
+
540
+ /**
541
+ * `file-exists:<relpath>` — the repo-relative path exists. Absolute paths and
542
+ * `..` segments are rejected outright: the predicate may only look inside the
543
+ * project root.
544
+ */
545
+ async function evalFileExists(projectRoot, rel) {
546
+ const segments = String(rel).split(/[\\/]/);
547
+ if (path.isAbsolute(rel) || segments.includes('..')) {
548
+ return { pass: false, detail: 'path escapes project root' };
549
+ }
550
+ try {
551
+ await fs.stat(path.join(projectRoot, rel));
552
+ return { pass: true, detail: 'exists' };
553
+ } catch {
554
+ return { pass: false, detail: 'missing' };
555
+ }
556
+ }
557
+
558
+ /**
559
+ * Evaluate the RUN.md `ExitPredicate:` expression. Returns
560
+ * `{ ok, terms: [{term, pass, detail}] }`; `ok` is false when the expression is
561
+ * malformed (unsatisfiable). Advisory like the rest of the lane — a thrown
562
+ * error becomes a failed term, never an exception.
563
+ */
564
+ async function evaluateExitPredicate(projectRoot, expr) {
565
+ const terms = parseExitPredicate(expr);
566
+ if (!terms) {
567
+ return { ok: false, terms: [{ term: String(expr || '').trim() || '(empty)', pass: false, detail: 'malformed predicate' }] };
568
+ }
569
+ const results = [];
570
+ for (const term of terms) {
571
+ let r;
572
+ try {
573
+ if (term === 'index:all-done') r = await evalIndexAllDone(projectRoot);
574
+ else if (term === 'git:clean') r = evalGitClean(projectRoot);
575
+ else r = await evalFileExists(projectRoot, term.slice('file-exists:'.length));
576
+ } catch (err) {
577
+ r = { pass: false, detail: `evaluator error: ${err?.message || err}` };
578
+ }
579
+ results.push({ term, pass: r.pass, detail: r.detail });
580
+ }
581
+ return { ok: results.every((r) => r.pass), terms: results };
582
+ }
583
+
584
+ /** One-line per-term predicate state for block reasons and stall advisories. */
585
+ function formatPredicateState(result) {
586
+ return result.terms.map((t) => `${t.term}=${t.pass ? 'pass' : `FAIL (${t.detail})`}`).join(', ');
587
+ }
588
+
453
589
  /**
454
590
  * Mutate `.ukit/storage/cache/stop-coordinator/state.json`'s `handoff` slot:
455
591
  * { signature, count }. Same signature as last time → count+1; a moved cursor
@@ -506,6 +642,13 @@ async function bumpHandoffStallCount({ projectRoot, signature, lockBudgetMs }) {
506
642
  * un-advancing cursor has already bounced `maxStalledBlocks` stops in a row
507
643
  * (liveness breaker — the gate must never be an unstoppable loop).
508
644
  *
645
+ * Exit predicate (mechanic #7): when RUN.md carries an `ExitPredicate:` line,
646
+ * `Phase: done` is only accepted if the predicate evaluates true — a `done`
647
+ * claim with failing terms is bounced back with the per-term state. A missing
648
+ * predicate keeps the legacy phase-only release; `Phase: blocked` stays
649
+ * terminal either way. The predicate is never relaxed: the stalled-cursor
650
+ * advisory reports its state so a plateau is visible, not silent.
651
+ *
509
652
  * Advisory lane: EVERY failure path returns { kind: 'none' }, never throws.
510
653
  */
511
654
  export async function evaluateHandoffCursor({ projectRoot, now = Date.now(), lockBudgetMs = LOCK_BUDGET_MS } = {}) {
@@ -518,21 +661,57 @@ export async function evaluateHandoffCursor({ projectRoot, now = Date.now(), loc
518
661
  } catch {
519
662
  return { kind: 'none' };
520
663
  }
521
- const { goal, phase, cursor, next } = parseRunCursor(text);
522
- if (!phase || /^done\b/i.test(phase) || /^blocked\b/i.test(phase)) {
664
+ const { goal, phase, cursor, next, exitPredicate } = parseRunCursor(text);
665
+ // Shared terminal predicate — tests/handoff/cycle21 greps this exact shape across
666
+ // all four RUN.md consumers; keep `^(done|blocked)` as one expression.
667
+ const terminal = String(phase).match(/^(done|blocked)\b/i)?.[1]?.toLowerCase() || '';
668
+ if (!phase || terminal === 'blocked') {
523
669
  return { kind: 'none' };
524
670
  }
671
+ if (terminal === 'done') {
672
+ if (!exitPredicate) return { kind: 'none' }; // legacy phase-only release
673
+ let predicate;
674
+ try {
675
+ predicate = await evaluateExitPredicate(projectRoot, exitPredicate);
676
+ } catch {
677
+ return { kind: 'none' }; // advisory lane: evaluator failure never wedges a stop
678
+ }
679
+ if (predicate.ok) return { kind: 'none' };
680
+ const lines = [
681
+ 'UKit handoff run claims `Phase: done` but its ExitPredicate is not satisfied — this',
682
+ 'stop is refused. "Done" means the predicate the planner wrote at P2 evaluates true;',
683
+ 'a plateau is not a stop and the predicate is never relaxed.',
684
+ '',
685
+ ` Goal: ${goal || '(not recorded)'}`,
686
+ ` ExitPredicate: ${exitPredicate}`,
687
+ ` Predicate state: ${formatPredicateState(predicate)}`,
688
+ '',
689
+ 'CONTINUE IMMEDIATELY: read docs/AI_HANDOFF/RUN.md and docs/AI_HANDOFF/INDEX.md, finish',
690
+ 'the work the failing terms name (or record the real external blocker and set',
691
+ '`Phase: blocked`), then rewrite the run cursor.',
692
+ ];
693
+ return { kind: 'block', reason: lines.join('\n') };
694
+ }
525
695
 
526
696
  const signature = `${phase}|${cursor}|${next}`;
527
697
  const streak = await bumpHandoffStallCount({ projectRoot, signature, lockBudgetMs });
528
698
  if (streak !== null && streak > gate.maxStalledBlocks) {
699
+ let predicateState = 'no ExitPredicate recorded';
700
+ if (exitPredicate) {
701
+ try {
702
+ predicateState = formatPredicateState(await evaluateExitPredicate(projectRoot, exitPredicate));
703
+ } catch {
704
+ predicateState = 'predicate evaluation failed';
705
+ }
706
+ }
529
707
  return {
530
708
  kind: 'advisory',
531
709
  systemMessage:
532
710
  `[ukit-stop-coordinator] handoff-cursor released this stop: the run cursor ` +
533
711
  `("${signature}") has not advanced across ${streak - 1} consecutive blocked stops ` +
534
712
  `(cap ${gate.maxStalledBlocks}), so the gate treats the run as stalled rather than ` +
535
- `looping forever. Inspect docs/AI_HANDOFF/RUN.md and docs/AI_HANDOFF/INDEX.md; ` +
713
+ `looping forever. ExitPredicate state: ${predicateState}. ` +
714
+ `Inspect docs/AI_HANDOFF/RUN.md and docs/AI_HANDOFF/INDEX.md; ` +
536
715
  `the run can be resumed with /ukit:handoff-fullstack or cleared with /ukit:handoff-clear.`,
537
716
  };
538
717
  }
@@ -14,7 +14,7 @@
14
14
  * Exports:
15
15
  * DEFAULT_CONFIG — fail-open defaults; identical to the
16
16
  * `handoff.taskBudgets` / `handoff.milestoneIntervalMin`
17
- * keys seeded into templates/ukit/storage/config.json.
17
+ * keys seeded into template_project/ukit/storage/config.json.
18
18
  * parseTaskFile(markdown) — minimal twin of src/core/taskProgressGuard's
19
19
  * parser; reads id, status, size, lastProgressIso.
20
20
  * evaluateBudgets(...) — per in_progress task returns
@@ -49,9 +49,9 @@ Thumbs.db
49
49
  # legacy: Antigravity adapter removed in v2.2.0; leftovers must stay ignored
50
50
  .antigravity/
51
51
  # NOTE (C12): runtime dirs (.claude/ .codex/ .omp/ .ukit/) are deliberately NOT
52
- # ignored here. This file is a per-directory .gitignore for templates/, so an
52
+ # ignored here. This file is a per-directory .gitignore for template_project/, so an
53
53
  # unanchored `.claude/` silently hid NEW template files (it swallowed
54
- # templates/.claude/ukit/index/task-budget-validator.mjs). The root .gitignore
54
+ # template_project/.claude/ukit/index/task-budget-validator.mjs). The root .gitignore
55
55
  # already carries the anchored /.claude/ /.codex/ /.omp/ /.ukit/ exclusions.
56
56
  opencode.json
57
57
  /AGENTS.md
@@ -1,5 +1,5 @@
1
1
  # .omp/RULES.md — sticky always-apply rules
2
- <!-- generated: templates/instructions/ — edit sources, then yarn docs:render -->
2
+ <!-- generated: template_project/instructions/ — edit sources, then yarn docs:render -->
3
3
 
4
4
  omp re-attaches this file near every turn from its native location (`.omp/RULES.md` only, never a
5
5
  copy elsewhere). It carries the always-apply subset of root `AGENTS.md` that must survive even when
@@ -56,6 +56,8 @@ If any input is missing, return `CHANGES-REQUESTED` with reason "incomplete hand
56
56
  VERDICT: APPROVED | APPROVED-WITH-MINOR | CHANGES-REQUESTED | CRITICAL
57
57
  REVIEWER_MODEL: [model name actually used]
58
58
  EXECUTOR_MODEL: [from executor report]
59
+ PANEL_MEMBER: [panel tier — `@slow`/`@default`/`@smol`, or `solo` when the panel degenerates; `-` outside panel runs]
60
+ AGREEMENT_MAP: [lead member only — finding → panel members reporting it, from review-panel-aggregate.mjs output; `-` otherwise]
59
61
  VERIFICATION_RERUN:
60
62
  command: [exact command]
61
63
  result: [N pass / M fail]
@@ -120,6 +122,31 @@ Same model is the most common silent failure. Do not skip this check.
120
122
  - Keep the verdict block <= 30 lines. Findings are bullet points, not essays.
121
123
  - The same-model refusal above is non-negotiable: bypassing it defeats the entire Quality Gate.
122
124
 
125
+
126
+ ## Panel review (diversity review)
127
+
128
+ When the orchestrator spawns you as one member of the `modelRoles['review-panel']`
129
+ panel (`.ukit/storage/config.json` → `modelRoles`, default `['smart','code','lite']`
130
+ — the omp tier aliases `@slow`/`@default`/`@smol`), everything above applies
131
+ unchanged — same Review order, same severity ladder, same verdict block — with these
132
+ additions:
133
+
134
+ - Set `PANEL_MEMBER: <tier>` in the verdict to your panel tier (e.g. `@slow`,
135
+ `@default`, `@smol`). Every member runs the same rubric independently; do not read
136
+ or wait for other members' verdicts.
137
+ - Leave `AGREEMENT_MAP` as `-` unless you are the **lead member** (the first entry in
138
+ `modelRoles['review-panel']` = the judgment tier). After the orchestrator runs
139
+ `node .claude/ukit/index/review-panel-aggregate.mjs <TASK-xxx.md...>` and hands you
140
+ the output, the lead fills `AGREEMENT_MAP` with the emitted finding → members map
141
+ and applies the lead-judgment buckets to every finding: **Act on** / **Consider** /
142
+ **Noted** / **Dismissed**.
143
+ - `consensus≥2 identical findings = high signal`: a finding reported by two or more
144
+ panel members is high-signal and must not be bucketed below **Consider** without a
145
+ stated reason.
146
+ - Degenerate panel: if `modelRoles['review-panel']` is empty or has one entry, the
147
+ panel collapses to a single reviewer — run the normal solo review, set
148
+ `PANEL_MEMBER: solo`, and note the fallback in `NOTES`.
149
+
123
150
  ## Spec/Plan Review (REVIEW_TARGET_TYPE=spec|plan)
124
151
 
125
152
  ### Inputs you expect
@@ -75,7 +75,7 @@ verification — link both files' `## Discussion` threads.
75
75
 
76
76
  ## Phase 0.5 — Write SPEC.md
77
77
 
78
- Write `docs/AI_HANDOFF/SPEC.md` from the template at `templates/docs/AI_HANDOFF/SPEC.md`
78
+ Write `docs/AI_HANDOFF/SPEC.md` from the template at `template_project/docs/AI_HANDOFF/SPEC.md`
79
79
  (15 sections). The spec is the contract executors implement against — concrete enough that
80
80
  nothing is guessed: exact paths, module and API names, schemas, validation rules,
81
81
  permissions, empty/error states, migration behavior, test expectations. Every section is
@@ -134,7 +134,7 @@ Use `_TEMPLATE.md` structure (from pre-read context or file).
134
134
  | Dependencies | `TASK-xxx` or `none` — wave order is inferred from this |
135
135
  | Test Cases | Type \| Test Name \| Expected — ≥1 happy + ≥2 edge cases of different kinds |
136
136
  | Test Files | Exact test file paths to create/modify |
137
- | Verification Commands | Runnable shell commands — MUST include the project's lint/typecheck command if one exists (see §5 rule above). Apply the "Test selection" resolution order from docs/AI_HANDOFF/RULES.md: `src/`/`scripts/` targets → the `tests` array in `.cache/index/tests-map.json`; `templates/.claude/**`/`.claude/**` targets → path convention (hooks → `tests/hooks/` + `tests/handoff/cycle*/`; manifest/settings → `tests/manifest/`; runtime `.mjs` mirrors → `tests/core/*Parity*` + `tests/index/`); if both resolve to fewer than one test file the task MUST fall back to `yarn test:release-core` — never the full suite by default, never an empty selection |
137
+ | Verification Commands | Runnable shell commands — MUST include the project's lint/typecheck command if one exists (see §5 rule above). Apply the "Test selection" resolution order from docs/AI_HANDOFF/RULES.md: `src/`/`scripts/` targets → the `tests` array in `.cache/index/tests-map.json`; `template_project/.claude/**`/`.claude/**` targets → path convention (hooks → `tests/hooks/` + `tests/handoff/cycle*/`; manifest/settings → `tests/manifest/`; runtime `.mjs` mirrors → `tests/core/*Parity*` + `tests/index/`); if both resolve to fewer than one test file the task MUST fall back to `yarn test:release-core` — never the full suite by default, never an empty selection |
138
138
  | Acceptance Criteria | Verifiable checklist |
139
139
 
140
140
  Missing any field → `needs_breakdown`. Never mark incomplete tasks `ready`.
@@ -195,6 +195,21 @@ Status: planning_done — ready for executor
195
195
  ```
196
196
  Wave structure is NOT stored here — inferred from task `Dependencies` fields at runtime.
197
197
 
198
+ **RUN.md** — write the run's `ExitPredicate:` line before iteration 1 (the orchestrator
199
+ keeps it verbatim on every cursor rewrite):
200
+
201
+ ```
202
+ ExitPredicate: all(index:all-done, git:clean)
203
+ ```
204
+
205
+ Grammar: `all(<term>[,<term>...])` or a single term; terms are `index:all-done`,
206
+ `git:clean`, `file-exists:<relpath>` (repo-relative, no `..` segments). Default to
207
+ `all(index:all-done, git:clean)`; add `file-exists:` terms only for artifacts the plan
208
+ itself must produce. The stop gate evaluates this mechanically when the cursor claims
209
+ `Phase: done` — a `done` claim with failing terms is bounced back with the per-term
210
+ state. **Never relax the predicate mid-run**: if the run cannot satisfy it, the plan is
211
+ wrong — fix the plan, not the gate.
212
+
198
213
  ## Self-Audit — run before reporting, every time
199
214
 
200
215
  The downstream pipeline is unattended: an incomplete or wrong plan is not caught by a human
@@ -57,7 +57,7 @@ tools:
57
57
  computer: allow
58
58
 
59
59
  bash:
60
- # Translated from templates/.claude/hooks/block-dangerous.sh's DANGEROUS_PATTERNS array.
60
+ # Translated from template_project/.claude/hooks/block-dangerous.sh's DANGEROUS_PATTERNS array.
61
61
  # `deny`/`prompt` fire on the WHOLE command or on ANY compound segment (e.g. `foo && rm -rf /`
62
62
  # still hits the `rm -rf /*` entry below) — so a `deny` entry below the trailing allow still
63
63
  # catches it. `allow` only ever matches an ENTIRE, non-compound command, so the trailing "*"
@@ -121,9 +121,9 @@ memory:
121
121
  # Auto-compact must trigger BEFORE context-hardcap-gate.sh starts blocking tool
122
122
  # calls (compact.hardCapTokens, default 500000). Rendered at install time from the
123
123
  # same derived number as env.CLAUDE_CODE_AUTO_COMPACT_WINDOW in
124
- # templates/.claude/settings.json (70% of hardCapTokens), so omp and Claude Code
124
+ # template_project/.claude/settings.json (70% of hardCapTokens), so omp and Claude Code
125
125
  # cannot drift apart and retuning both is a single edit to
126
- # templates/ukit/storage/config.json.
126
+ # template_project/ukit/storage/config.json.
127
127
  #
128
128
  # Key VERIFIED against omp v17.4.2 (2026-08-22): `compaction.thresholdTokens` is a
129
129
  # fixed token limit for context maintenance and overrides the percentage threshold
@@ -1,5 +1,5 @@
1
1
  # AGENTS.md — {{project.name}}
2
- <!-- generated: templates/instructions/ — edit sources, then yarn docs:render -->
2
+ <!-- generated: template_project/instructions/ — edit sources, then yarn docs:render -->
3
3
 
4
4
  ## Core Rule
5
5
  <!-- RULES: CORE-01 CORE-02 -->
@@ -64,7 +64,7 @@
64
64
  - Missing/corrupt runtime or stale workspace → rerun `ukit install`.
65
65
 
66
66
  ## Skill Quality (maintainer-only)
67
- - Editing `templates/.claude/` skills/agents → read `.claude/skills/skill-quality/SKILL.md` first.
67
+ - Editing `template_project/.claude/` skills/agents → read `.claude/skills/skill-quality/SKILL.md` first.
68
68
 
69
69
  ## UKit v{{ukit.version}} Shared Runtime
70
70
  - Runtime state: `.ukit/storage/`; `config.json` holds toggles (compact, token pipeline, router, memory, validation, Safe Patch). `ukit memory recall "<task>"` before asking users to restate decisions; `learn`/`promote`/`episode` manage memory; inspect via `ukit status` / `ukit memory export`. Route memory: `.claude/ukit/skill-router-state.json` (`previous-context`/`recent-output` first); cache: `.ukit/storage/cache/output-history.json` + `retriever-lanes.jsonl` + `tee/`. Hooks degrade to exit 0; missing/corrupt runtime → rerun `ukit install`.
@@ -1,5 +1,5 @@
1
1
  # CLAUDE.md — {{project.name}}
2
- <!-- generated: templates/instructions/ — edit sources, then yarn docs:render -->
2
+ <!-- generated: template_project/instructions/ — edit sources, then yarn docs:render -->
3
3
 
4
4
  ## Core Rule
5
5
  <!-- RULES: CORE-01 CORE-02 -->
@@ -64,7 +64,7 @@
64
64
  - Missing/corrupt runtime or stale workspace → rerun `ukit install`.
65
65
 
66
66
  ## Skill Quality (maintainer-only)
67
- - Editing `templates/.claude/` skills/agents → read `.claude/skills/skill-quality/SKILL.md` first.
67
+ - Editing `template_project/.claude/` skills/agents → read `.claude/skills/skill-quality/SKILL.md` first.
68
68
 
69
69
  ## UKit v{{ukit.version}} Shared Runtime
70
70
  - Runtime state: `.ukit/storage/`; `config.json` holds toggles (compact, token pipeline, router, memory, validation, Safe Patch). `ukit memory recall "<task>"` before asking users to restate decisions; `learn`/`promote`/`episode` manage memory; inspect via `ukit status` / `ukit memory export`. Route memory: `.claude/ukit/skill-router-state.json` (`previous-context`/`recent-output` first); cache: `.ukit/storage/cache/output-history.json` + `retriever-lanes.jsonl` + `tee/`. Hooks degrade to exit 0; missing/corrupt runtime → rerun `ukit install`.
@@ -170,7 +170,7 @@ chạy **đến khi không còn gì để làm**:
170
170
  Resolution order — exactly three steps, in this order. A task's Verification Commands MUST NOT default to the full suite:
171
171
 
172
172
  1. Target File under `src/` or `scripts/` → read `.cache/index/tests-map.json` and take the `tests` array for that `sourceFile`.
173
- 2. Target File under `templates/.claude/**` or `.claude/**` → `tests-map.json` has no coverage of these paths, so use the path convention: hooks → `tests/hooks/` + `tests/handoff/cycle*/`; manifest/settings → `tests/manifest/`; runtime `.mjs` mirrors → `tests/core/*Parity*` + `tests/index/`.
173
+ 2. Target File under `template_project/.claude/**` or `.claude/**` → `tests-map.json` has no coverage of these paths, so use the path convention: hooks → `tests/hooks/` + `tests/handoff/cycle*/`; manifest/settings → `tests/manifest/`; runtime `.mjs` mirrors → `tests/core/*Parity*` + `tests/index/`.
174
174
  3. **Mandatory non-empty floor** — if steps 1–2 resolve to fewer than one test file, the task MUST fall back to `yarn test:release-core`. An empty selection is never permitted. This floor is a fallback for a single task's narrowed selection, not a default — most tasks resolve via steps 1–2 and never reach it.
175
175
 
176
176
  **Wave/cycle boundary regression net** — the three steps above narrow one task's Verification Commands only; they are not a substitute for full-suite coverage. A full `yarn test` run at each wave/cycle boundary MUST happen and is the regression net for every per-task narrowed selection made under this policy. `code-reviewer.md`'s "wave-boundary full `yarn test` ... is the regression net" sentence refers to this paragraph.
@@ -58,7 +58,7 @@ the root contract is the only carrier — keep both in sync with
58
58
 
59
59
  ## Skill Quality (maintainer-only)
60
60
 
61
- - When editing a template skill/agent under `templates/.claude/`, read
61
+ - When editing a template skill/agent under `template_project/.claude/`, read
62
62
  `.claude/skills/skill-quality/SKILL.md` before shipping the change.
63
63
 
64
64
  ## Shared Runtime — detail
@@ -289,12 +289,12 @@ Internals: `src/core/permissionPolicy.js` compiles the semantic policy (preceden
289
289
  line). To surface diagnostics from an earlier step, have the step that owns the
290
290
  verdict include them.
291
291
  - The same test also guards the settings↔bridge mirror: `HOOK_EVENT_MAP` in
292
- `templates/.omp/hooks/pre/ukit-bridge.js` must equal the settings chain args 1:1
292
+ `template_project/.omp/hooks/pre/ukit-bridge.js` must equal the settings chain args 1:1
293
293
  per event/matcher.
294
294
 
295
295
  ## Compressed contract detail (cycle 45 diet)
296
296
 
297
- Detail dropped from `templates/instructions/core.md` during the ~25% system-prompt diet; semantics unchanged.
297
+ Detail dropped from `template_project/instructions/core.md` during the ~25% system-prompt diet; semantics unchanged.
298
298
 
299
299
  - **Prompt Caching one-liners** — CTX-01 deterministic segment bytes · CTX-02 keep roles and order · CTX-03 keep tool IDs and continuation state · CTX-04 no clock/random IDs in static blocks · CTX-05 compaction starts a new epoch · CTX-06 never change data to match a cache · CTX-07 no unconfirmed cache fields · CTX-08 tool-result reuse needs valid freshness · CTX-09 missing usage is unknown, not zero · CTX-10 never cut a required check to reduce calls. Full ruleset: `docs/PROMPT_CACHING.md`.
300
300
  - **Common skill triggers** — review/audit/diff/PR → `code-review` · bug/error/crash/triage → `debugging-toolkit` · test/spec/coverage → `testing-quality` · docs/README/changelog/`docs/` edits → `docs-quality` · open-ended/status/continue/queued task → `next-step` · wrap up/`docs/STATUS.md` → `update-status` · auth/security/token/permission/risky → `discover-security` · stale workspace/reinstall/cleanup → `repo-maintenance` (all under `.claude/skills/<name>/SKILL.md`).
@@ -61,7 +61,7 @@
61
61
  - Missing/corrupt runtime or stale workspace → rerun `ukit install`.
62
62
 
63
63
  ## Skill Quality (maintainer-only)
64
- - Editing `templates/.claude/` skills/agents → read `.claude/skills/skill-quality/SKILL.md` first.
64
+ - Editing `template_project/.claude/` skills/agents → read `.claude/skills/skill-quality/SKILL.md` first.
65
65
 
66
66
  ## UKit v{{ukit.version}} Shared Runtime
67
67
  - Runtime state: `.ukit/storage/`; `config.json` holds toggles (compact, token pipeline, router, memory, validation, Safe Patch). `ukit memory recall "<task>"` before asking users to restate decisions; `learn`/`promote`/`episode` manage memory; inspect via `ukit status` / `ukit memory export`. Route memory: `.claude/ukit/skill-router-state.json` (`previous-context`/`recent-output` first); cache: `.ukit/storage/cache/output-history.json` + `retriever-lanes.jsonl` + `tee/`. Hooks degrade to exit 0; missing/corrupt runtime → rerun `ukit install`.
@@ -6,9 +6,9 @@ description: >-
6
6
  verbatim with no ## prefix) and `*` (all ## sections of the source in file
7
7
  order). Every source ## section must be referenced by ≥1 output (FR-006).
8
8
  outputs:
9
- - target: templates/CLAUDE.md
9
+ - target: template_project/CLAUDE.md
10
10
  h1: '# CLAUDE.md — {{project.name}}'
11
- banner: '<!-- generated: templates/instructions/ — edit sources, then yarn docs:render -->'
11
+ banner: '<!-- generated: template_project/instructions/ — edit sources, then yarn docs:render -->'
12
12
  resolve_vars: false
13
13
  sections:
14
14
  - { from: core, heading: Core Rule }
@@ -38,9 +38,9 @@ outputs:
38
38
  - { from: core, heading: Handoff Fullstack Rules }
39
39
  - { from: core, heading: Compact Instructions }
40
40
  trailer: '{{codegraphSection}}'
41
- - target: templates/AGENTS.md
41
+ - target: template_project/AGENTS.md
42
42
  h1: '# AGENTS.md — {{project.name}}'
43
- banner: '<!-- generated: templates/instructions/ — edit sources, then yarn docs:render -->'
43
+ banner: '<!-- generated: template_project/instructions/ — edit sources, then yarn docs:render -->'
44
44
  resolve_vars: false
45
45
  sections:
46
46
  - { from: core, heading: Core Rule }
@@ -71,16 +71,16 @@ outputs:
71
71
  - { from: core, heading: Handoff Fullstack Rules }
72
72
  - { from: core, heading: Compact Instructions }
73
73
  trailer: '{{codegraphSection}}'
74
- - target: templates/.omp/RULES.md
74
+ - target: template_project/.omp/RULES.md
75
75
  h1: '# .omp/RULES.md — sticky always-apply rules'
76
- banner: '<!-- generated: templates/instructions/ — edit sources, then yarn docs:render -->'
76
+ banner: '<!-- generated: template_project/instructions/ — edit sources, then yarn docs:render -->'
77
77
  resolve_vars: false
78
78
  sections:
79
79
  - { from: 'overlay:omp-rules', heading: __preamble__ }
80
80
  - { from: 'overlay:omp-rules', heading: '*' }
81
81
  - target: CLAUDE.md
82
82
  h1: '# CLAUDE.md — @ngockhoale/ukit'
83
- banner: '<!-- generated: templates/instructions/ + repo overlay — edit sources, then yarn docs:render -->'
83
+ banner: '<!-- generated: template_project/instructions/ + repo overlay — edit sources, then yarn docs:render -->'
84
84
  resolve_vars: true
85
85
  sections:
86
86
  - { from: 'overlay:repo', heading: Release Policy (mandatory — never replace) }
@@ -113,7 +113,7 @@ outputs:
113
113
  trailer: '{{codegraphSection}}'
114
114
  - target: AGENTS.md
115
115
  h1: '# AGENTS.md — @ngockhoale/ukit'
116
- banner: '<!-- generated: templates/instructions/ + repo overlay — edit sources, then yarn docs:render -->'
116
+ banner: '<!-- generated: template_project/instructions/ + repo overlay — edit sources, then yarn docs:render -->'
117
117
  resolve_vars: true
118
118
  sections:
119
119
  - { from: 'overlay:repo', heading: Release Policy (mandatory — never replace) }
@@ -1,3 +1,3 @@
1
1
  <!-- Claude-only overlay. Intentionally carries no ## sections today: every
2
- section of templates/CLAUDE.md is shared core. Kept as a comment-only
2
+ section of template_project/CLAUDE.md is shared core. Kept as a comment-only
3
3
  source so the overlay allowlist mechanism is exercised (SPEC §7.5). -->
@@ -6,4 +6,4 @@
6
6
  - **npm and git always hold the same latest version.** After publish, `npm view @ngockhoale/ukit version` must equal the `package.json` version; if they ever diverge, publishing wins and happens first.
7
7
  - **Never ask the user for npm publish permission** — approval is permanently granted for this package. Use `npm publish --dry-run` for pre-verification, then run the real publish in the same cycle.
8
8
  - Users update with `ukit update`, which pulls from npm — an unpublished fix reaches no one. Git is code history/tracking only; npm is the distribution channel.
9
- - **Repo-only rule:** this policy applies to the UKit development repo itself and must NEVER be added to `templates/CLAUDE.md` / `templates/AGENTS.md` (it must not ship to installed projects). Mirrored at the top of root CLAUDE.md + AGENTS.md; those copies can be wiped by a `ukit update` run inside this repo — if missing, restore them from this section.
9
+ - **Repo-only rule:** this policy applies to the UKit development repo itself and must NEVER be added to `template_project/CLAUDE.md` / `template_project/AGENTS.md` (it must not ship to installed projects). Mirrored at the top of root CLAUDE.md + AGENTS.md; those copies can be wiped by a `ukit update` run inside this repo — if missing, restore them from this section.
@@ -84,7 +84,10 @@
84
84
  "defaultModel": "claude-sonnet-5"
85
85
  },
86
86
  "routing": {
87
- "routeSchema": { "stage": "off" }
87
+ "routeSchema": { "stage": "off" },
88
+ "rigor": { "stage": "shadow" },
89
+ "fastPath": { "stage": "shadow" },
90
+ "escalation": { "stage": "shadow" }
88
91
  },
89
92
  "modelRoles": {
90
93
  "code": "code",
@@ -0,0 +1,2 @@
1
+ ,
2
+ 'template_project/ukit/storage/memory/sessions/.gitkeep':
@@ -1,2 +0,0 @@
1
- ,
2
- 'templates/ukit/storage/memory/sessions/.gitkeep':