@joshuafolkken/kit 1.1050.0 → 1.1128.0

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 (630) hide show
  1. package/.claude/settings.json +9 -8
  2. package/.claude/skills/epic-commands/SKILL.md +5 -7
  3. package/.claude/skills/workflow-commands/SKILL.md +20 -12
  4. package/.claude/skills/workflow-commands/background-commands.md +36 -84
  5. package/.claude/skills/workflow-commands/backlogrun-child.md +1 -1
  6. package/.claude/skills/workflow-commands/backlogrun-lanes.md +8 -6
  7. package/.claude/skills/workflow-commands/backlogrun-progress.md +30 -33
  8. package/.claude/skills/workflow-commands/backlogrun-steps.md +12 -12
  9. package/.claude/skills/workflow-commands/backlogrun.md +2 -2
  10. package/.claude/skills/workflow-commands/chain-rule.md +4 -2
  11. package/.claude/skills/workflow-commands/delegation.md +3 -3
  12. package/.claude/skills/workflow-commands/followup-reference.md +1 -1
  13. package/.claude/skills/workflow-commands/followup.md +7 -3
  14. package/.claude/skills/workflow-commands/fullrun-steps.md +3 -2
  15. package/.claude/skills/workflow-commands/fullrun.md +8 -6
  16. package/.claude/skills/workflow-commands/halfrun.md +19 -21
  17. package/.claude/skills/workflow-commands/issue-comments.md +1 -1
  18. package/.claude/skills/workflow-commands/issue-fold-existing.md +10 -10
  19. package/.claude/skills/workflow-commands/issue-scout.md +1 -1
  20. package/.claude/skills/workflow-commands/kickoff.md +9 -4
  21. package/.claude/skills/workflow-commands/latest-gate.md +8 -16
  22. package/.claude/skills/workflow-commands/needs-human-review.md +1 -1
  23. package/.claude/skills/workflow-commands/observation-filing.md +3 -3
  24. package/.claude/skills/workflow-commands/pre-gate-cut.md +4 -8
  25. package/.claude/skills/workflow-commands/prerequisite.md +1 -1
  26. package/.claude/skills/workflow-commands/prrun.md +36 -0
  27. package/.claude/skills/workflow-commands/retrospective.md +1 -1
  28. package/.claude/skills/workflow-commands/split-assessment.md +4 -18
  29. package/.claude/skills/workflow-commands/working-tree-hold.md +22 -2
  30. package/.codex/hooks.json +16 -20
  31. package/.github/actions/setup-node/action.yml +33 -0
  32. package/.github/actions/setup-pnpm/action.yml +93 -0
  33. package/.github/dependabot.yml +5 -1
  34. package/.github/workflows/auto-tag.yml +2 -3
  35. package/.github/workflows/ci.yml +31 -134
  36. package/.github/workflows/dependabot-auto-merge.yml +1 -0
  37. package/.github/workflows/pr-classification.yml +6 -44
  38. package/.github/workflows/production.yml +1 -0
  39. package/.github/workflows/publish.yml +43 -47
  40. package/.github/workflows/sonar-qube.yml +41 -4
  41. package/.pnpmfile.mjs +29 -0
  42. package/AGENTS.md +5 -2
  43. package/CLAUDE.md +33 -27
  44. package/GEMINI.md +5 -2
  45. package/README.md +66 -20
  46. package/SECURITY.md +37 -6
  47. package/cspell/index.yaml +6 -1
  48. package/dist/CLAUDE.basic.md +6 -6
  49. package/dist/CLAUDE.md +33 -27
  50. package/dist/CLAUDE.static.md +6 -6
  51. package/dist/config-merge/index.js +48 -12
  52. package/dist/hooks/batch-guard.js +4 -4
  53. package/dist/hooks/{chunk-7VPDUBRN.js → chunk-4JZDP5X5.js} +152 -155
  54. package/dist/hooks/{chunk-HJIISEAC.js → chunk-5SD2YM7Z.js} +5 -13
  55. package/dist/hooks/{chunk-NAS4C7GP.js → chunk-77J7IEQM.js} +2 -2
  56. package/dist/hooks/{chunk-DMQN45FN.js → chunk-7HVB7SZG.js} +3 -3
  57. package/dist/hooks/{chunk-RLDX5SOC.js → chunk-AIOIOMPX.js} +4413 -1970
  58. package/dist/hooks/{chunk-5BK3K7V4.js → chunk-M7QKEKWO.js} +873 -2049
  59. package/dist/hooks/{chunk-WQ4OSBSS.js → chunk-MKVGBQPA.js} +2 -2
  60. package/dist/hooks/{chunk-EJDX2TOB.js → chunk-NXYMNPUQ.js} +7 -88
  61. package/dist/hooks/{chunk-NJQOBE6L.js → chunk-QVLT52OV.js} +2 -7
  62. package/dist/hooks/{chunk-GQ7KP45M.js → chunk-XYUIQOW3.js} +2 -2
  63. package/dist/hooks/codex-hook-adapter.js +12 -48
  64. package/dist/hooks/duplicate-read-guard.js +5 -5
  65. package/dist/hooks/format-edited.js +2 -2
  66. package/dist/hooks/inputs.json +280 -0
  67. package/dist/hooks/investigation-guard.js +5 -5
  68. package/dist/hooks/pretool-guard.js +9 -9
  69. package/dist/hooks/session-lang.js +0 -1
  70. package/dist/hooks/stop-guard.js +192 -333
  71. package/dist/josh.js +240 -148
  72. package/dist/managed-marker/index.js +2 -1
  73. package/dist/version/index.js +70 -78
  74. package/eslint/rules/promise.js +5 -0
  75. package/eslint/rules/unicorn.js +3 -2
  76. package/package.json +26 -5
  77. package/pnpm-workspace.yaml +5 -7
  78. package/prompts/collaboration-workflow/glossary.md +17 -0
  79. package/prompts/collaboration-workflow/issue-citation.md +5 -5
  80. package/prompts/collaboration-workflow/issue-template.md +1 -1
  81. package/prompts/collaboration-workflow/operating-rules.md +5 -5
  82. package/prompts/collaboration-workflow/overview.md +13 -1
  83. package/prompts/collaboration-workflow/principles.md +9 -0
  84. package/prompts/collaboration-workflow/report-format.md +1 -1
  85. package/prompts/collaboration-workflow/residency.md +3 -3
  86. package/prompts/collaboration-workflow/rule-delivery.md +1 -1
  87. package/prompts/collaboration-workflow/turn-batching.md +3 -3
  88. package/prompts/collaboration-workflow/upstream-interrupt.md +1 -1
  89. package/prompts/collaboration-workflow/wip-cap.md +25 -22
  90. package/prompts/collaboration-workflow.md +6 -8
  91. package/prompts/review-rubric.md +1 -1
  92. package/prompts/review.md +3 -3
  93. package/prompts/sonar-hotspot-handling.md +11 -3
  94. package/prompts/testing-guide.md +3 -3
  95. package/scripts/adopt/adopt-toolkits.ts +0 -2
  96. package/scripts/adopt/adopt.ts +0 -2
  97. package/scripts/agent/agent-argv.ts +0 -2
  98. package/scripts/agent/agent-diagnostics.ts +1 -1
  99. package/scripts/agent/agent-role-profile.ts +0 -7
  100. package/scripts/agent/claude-agent-argv.ts +0 -2
  101. package/scripts/agent/codex-agent-argv.ts +1 -1
  102. package/scripts/agent/codex-hooks.ts +92 -0
  103. package/scripts/agent/interactive-ask.ts +1 -1
  104. package/scripts/auto-ok/auto-ok-cli.ts +6 -16
  105. package/scripts/backlog/backlog-arrival.ts +30 -10
  106. package/scripts/backlog/backlog-budget-cli.ts +15 -16
  107. package/scripts/backlog/backlog-budget.ts +0 -2
  108. package/scripts/backlog/backlog-defect-priority.ts +2 -2
  109. package/scripts/backlog/backlog-drive-cli.ts +10 -8
  110. package/scripts/backlog/backlog-drive-named-offer.ts +16 -3
  111. package/scripts/backlog/backlog-drive-named.ts +2 -1
  112. package/scripts/backlog/backlog-drive.ts +76 -16
  113. package/scripts/backlog/backlog-named.ts +0 -3
  114. package/scripts/backlog/backlog-next.ts +9 -15
  115. package/scripts/backlog/backlog-offer-cli.ts +6 -19
  116. package/scripts/backlog/backlog-plan-cli.ts +1 -7
  117. package/scripts/backlog/backlog-plan.ts +30 -19
  118. package/scripts/backlog/backlog-pool.ts +3 -6
  119. package/scripts/backlog/backlog-rank.ts +2 -2
  120. package/scripts/backlog/backlog-ready.ts +39 -10
  121. package/scripts/backlog/backlog-scope.ts +1 -3
  122. package/scripts/backlog/backlog-stalled-detect.ts +2 -2
  123. package/scripts/backlog/backlog-stalled.ts +0 -1
  124. package/scripts/backlog/backlog-waves.ts +5 -2
  125. package/scripts/behavior/behavior-cli.ts +1 -1
  126. package/scripts/build/build-codex-hooks.ts +26 -0
  127. package/scripts/build/build-hooks.ts +85 -9
  128. package/scripts/build/hook-bundle-stamp.ts +111 -0
  129. package/scripts/cases/cases-cli.ts +1 -1
  130. package/scripts/cases/cases-logic.ts +1 -1
  131. package/scripts/ci/composite-actions.ts +30 -0
  132. package/scripts/ci/pr-classification.ts +3 -3
  133. package/scripts/claude/workflow-destination.ts +10 -1
  134. package/scripts/clone/clone-fingerprint.ts +0 -1
  135. package/scripts/clone/clone-scan-cli.ts +1 -1
  136. package/scripts/clone/clone-scan.ts +1 -1
  137. package/scripts/config-merge/json-format.ts +0 -1
  138. package/scripts/config-merge/parse-jsonc.ts +33 -3
  139. package/scripts/config-merge/patch-json-key.ts +13 -6
  140. package/scripts/config-merge/patch-yaml-list.ts +1 -1
  141. package/scripts/cost-runtime/codex-usage.ts +2 -9
  142. package/scripts/cost-runtime/cost-attribute.ts +0 -1
  143. package/scripts/cost-runtime/cost-cli.ts +3 -10
  144. package/scripts/cost-runtime/cost-corpus.ts +0 -2
  145. package/scripts/cost-runtime/cost-format.ts +0 -3
  146. package/scripts/cost-runtime/cost-pricing.ts +0 -1
  147. package/scripts/cost-runtime/cost-tokens.ts +0 -1
  148. package/scripts/delegation/delegation-cli.ts +1 -1
  149. package/scripts/delegation/delegation-policy.ts +0 -1
  150. package/scripts/delegation/duplicate-read-guard.ts +0 -8
  151. package/scripts/delegation/fanout-cli.ts +1 -1
  152. package/scripts/delegation/fanout.ts +0 -2
  153. package/scripts/delegation/investigation-reads.ts +1 -164
  154. package/scripts/discovery/repo-map-logic.ts +0 -1
  155. package/scripts/discovery/repo-party-cli.ts +1 -1
  156. package/scripts/doctor/doctor-consumer.ts +6 -10
  157. package/scripts/doctor/doctor-io.ts +9 -13
  158. package/scripts/doctor/doctor-logic.ts +0 -4
  159. package/scripts/doctor/doctor.ts +14 -9
  160. package/scripts/document/backlogrun-parent-read-set.ts +12 -1
  161. package/scripts/document/document-byte-budget.ts +5 -5
  162. package/scripts/document/document-byte-check.ts +0 -1
  163. package/scripts/document/document-read-cli.ts +0 -2
  164. package/scripts/document/document-section-cli.ts +1 -1
  165. package/scripts/document/document-section.ts +0 -3
  166. package/scripts/document/edit-files-cli.ts +0 -1
  167. package/scripts/document/entry-read-budget.ts +21 -7
  168. package/scripts/document/entry-read-set.ts +32 -8
  169. package/scripts/document/lane-child-read-set.ts +8 -6
  170. package/scripts/document/read-files-cli.ts +0 -4
  171. package/scripts/document/read-set-cli.ts +0 -2
  172. package/scripts/document/read-set-point-of-use.ts +9 -3
  173. package/scripts/document/read-set-pricing.ts +0 -1
  174. package/scripts/document/read-set-trim.ts +4 -2
  175. package/scripts/epic/epic-add.ts +1 -1
  176. package/scripts/epic/epic-audit-cli.ts +1 -4
  177. package/scripts/epic/epic-audit-orphans.ts +1 -3
  178. package/scripts/epic/epic-audit-rationale.ts +0 -1
  179. package/scripts/epic/epic-audit-report.ts +0 -2
  180. package/scripts/epic/epic-audit.ts +8 -22
  181. package/scripts/epic/epic-bundle-cli.ts +1 -1
  182. package/scripts/epic/epic-bundle-evidence.ts +0 -1
  183. package/scripts/epic/epic-bundle-referenced.ts +1 -5
  184. package/scripts/epic/epic-bundle.ts +0 -4
  185. package/scripts/epic/epic-busy.ts +4 -5
  186. package/scripts/epic/epic-candidate-confirm.ts +0 -5
  187. package/scripts/epic/epic-classify.ts +2 -2
  188. package/scripts/epic/epic-cli-argv.ts +0 -1
  189. package/scripts/epic/epic-close-comment.ts +1 -1
  190. package/scripts/epic/epic-close.ts +5 -2
  191. package/scripts/epic/epic-cross-repo.ts +2 -4
  192. package/scripts/epic/epic-decision.ts +0 -1
  193. package/scripts/epic/epic-fetch.ts +2 -2
  194. package/scripts/epic/epic-index.ts +2 -3
  195. package/scripts/epic/epic-issue.ts +1 -15
  196. package/scripts/epic/epic-lane-offer.ts +9 -8
  197. package/scripts/epic/epic-nested.ts +1 -1
  198. package/scripts/epic/epic-next-read.ts +1 -3
  199. package/scripts/epic/epic-next-views.ts +0 -1
  200. package/scripts/epic/epic-next.ts +1 -10
  201. package/scripts/epic/epic-parse.ts +0 -1
  202. package/scripts/epic/epic-promote.ts +0 -9
  203. package/scripts/epic/epic-rank.ts +2 -2
  204. package/scripts/epic/epic-read.ts +1 -2
  205. package/scripts/epic/epic-reconcile.ts +1 -1
  206. package/scripts/epic/epic-reference.ts +1 -13
  207. package/scripts/epic/epic-relation-recheck.ts +1 -1
  208. package/scripts/epic/epic-relations.ts +1 -1
  209. package/scripts/epic/epic-remove.ts +1 -1
  210. package/scripts/epic/epic-report.ts +0 -1
  211. package/scripts/epic/epic-run.ts +2 -3
  212. package/scripts/epic/epic-shape.ts +1 -1
  213. package/scripts/epic/epic-solo-stale.ts +107 -0
  214. package/scripts/epic/epic-solo.ts +3 -2
  215. package/scripts/epic/epic-triage.ts +1 -1
  216. package/scripts/epic/epic-validate.ts +1 -1
  217. package/scripts/epic/epic.ts +1 -1
  218. package/scripts/exports/unused-members-cli.ts +53 -0
  219. package/scripts/{git → followup}/followup-issue-number.ts +1 -6
  220. package/scripts/{git → followup}/git-followup-cleanup.ts +2 -1
  221. package/scripts/{git → followup}/git-followup-finish.ts +1 -3
  222. package/scripts/{git → followup}/git-followup-flush.ts +2 -2
  223. package/scripts/{git → followup}/git-followup-issue-close.ts +2 -2
  224. package/scripts/{git → followup}/git-followup-label.ts +4 -4
  225. package/scripts/followup/git-followup-merged.ts +112 -0
  226. package/scripts/{git → followup}/git-followup-pending.ts +1 -1
  227. package/scripts/{git → followup}/git-followup-workflow.ts +19 -11
  228. package/scripts/{git → followup}/git-pr-followup-wrapup.ts +9 -3
  229. package/scripts/{git → followup}/git-pr-followup.ts +53 -16
  230. package/scripts/gate/core-budget.ts +3 -9
  231. package/scripts/gate/gate-plan.ts +7 -4
  232. package/scripts/gate/gate-report.ts +0 -6
  233. package/scripts/gate/gate-tree.ts +1 -1
  234. package/scripts/gate/pre-commit-type-check.ts +0 -6
  235. package/scripts/gate/project-checks.ts +7 -8
  236. package/scripts/gate/scoped-green.ts +0 -1
  237. package/scripts/gate/type-check-step.ts +1 -1
  238. package/scripts/gate/verification-gate.ts +0 -2
  239. package/scripts/gh/fix-gh-packages.ts +15 -12
  240. package/scripts/gh/gh-spawn.ts +2 -2
  241. package/scripts/{git → gh}/git-ai-review-scan.ts +1 -5
  242. package/scripts/{git → gh}/git-gh-check.ts +2 -1
  243. package/scripts/{git → gh}/git-gh-exec.ts +1 -1
  244. package/scripts/{git → gh}/git-gh-failure.ts +1 -1
  245. package/scripts/{git → gh}/git-gh-helpers.ts +0 -1
  246. package/scripts/{git → gh}/git-gh-issue-list.ts +13 -10
  247. package/scripts/{git → gh}/git-gh-issue-read.ts +1 -1
  248. package/scripts/{git → gh}/git-gh-issue-rest.ts +6 -3
  249. package/scripts/{git → gh}/git-gh-issue-write.ts +4 -1
  250. package/scripts/{git → gh}/git-gh-pr-auto-merge.ts +4 -1
  251. package/scripts/{git → gh}/git-gh-pr-read.ts +24 -0
  252. package/scripts/{git → gh}/git-gh-pr-rest.ts +5 -2
  253. package/scripts/{git → gh}/git-gh-pr-review.ts +2 -2
  254. package/scripts/{git → gh}/git-gh-pr-rollup.ts +1 -3
  255. package/scripts/{git → gh}/git-gh-pr.ts +3 -1
  256. package/scripts/{git → gh}/git-pr-ai-review.ts +2 -5
  257. package/scripts/{git → gh}/git-pr-checks-eval.ts +0 -10
  258. package/scripts/{git → gh}/git-pr-checks-parse.ts +4 -20
  259. package/scripts/{git → gh}/git-pr-checks.ts +2 -1
  260. package/scripts/{git → gh}/git-pr-coderabbit.ts +2 -5
  261. package/scripts/{git → gh}/git-pr-confirmation.ts +1 -3
  262. package/scripts/{git → gh}/git-pr-managed-config.ts +2 -3
  263. package/scripts/{git → gh}/git-pr.ts +3 -3
  264. package/scripts/git/changed-file-scope.ts +0 -1
  265. package/scripts/git/git-branch.ts +3 -6
  266. package/scripts/git/git-command.ts +6 -1
  267. package/scripts/git/git-commit.ts +1 -1
  268. package/scripts/git/git-common-directory.ts +80 -24
  269. package/scripts/git/git-error.ts +66 -9
  270. package/scripts/git/git-issue.ts +1 -1
  271. package/scripts/git/git-preflight.ts +2 -2
  272. package/scripts/git/git-prompt.ts +6 -31
  273. package/scripts/git/git-push.ts +1 -1
  274. package/scripts/git/git-spawn-sync.ts +65 -0
  275. package/scripts/git/git-spawn.ts +5 -4
  276. package/scripts/git/git-staging.ts +1 -0
  277. package/scripts/git/git-status.ts +1 -1
  278. package/scripts/git/git-workflow.ts +1 -1
  279. package/scripts/git/gone-branch.ts +1 -0
  280. package/scripts/git/listing-cutoff.ts +1 -1
  281. package/scripts/git/main-merge.ts +1 -1
  282. package/scripts/git/main-sync.ts +19 -1
  283. package/scripts/git/parse-json-array.ts +0 -3
  284. package/scripts/git/repository-lock.ts +16 -16
  285. package/scripts/git/{git-stash.ts → stash/git-stash.ts} +1 -1
  286. package/scripts/git/{stash-pop-args.ts → stash/stash-pop-args.ts} +2 -7
  287. package/scripts/git/{stash-pop-cli.ts → stash/stash-pop-cli.ts} +0 -1
  288. package/scripts/git/{stash-sweep-lock.ts → stash/stash-sweep-lock.ts} +3 -3
  289. package/scripts/hooks/codex-hook-adapter.ts +0 -1
  290. package/scripts/hooks/edited-cspell.ts +1 -1
  291. package/scripts/hooks/format-edited-file.ts +2 -0
  292. package/scripts/hooks/pre-push-unit.ts +0 -4
  293. package/scripts/hooks/pretool-guard.ts +22 -4
  294. package/scripts/hooks/reserved-run.ts +1 -1
  295. package/scripts/hooks/step-zero-notice.ts +76 -0
  296. package/scripts/hooks/stop-guard.ts +47 -21
  297. package/scripts/init/claude-plugin-config.ts +4 -5
  298. package/scripts/init/hook-command-rewrite.ts +16 -8
  299. package/scripts/init/hook-launch.ts +41 -15
  300. package/scripts/init/init-basic.ts +2 -5
  301. package/scripts/init/init-file-action.ts +54 -0
  302. package/scripts/init/init-logic-migrate.ts +35 -17
  303. package/scripts/init/init-logic-secretlint.ts +1 -1
  304. package/scripts/init/init-logic.ts +10 -19
  305. package/scripts/init/init.ts +11 -71
  306. package/scripts/init/kit-written-paths.ts +2 -0
  307. package/scripts/init/project-profile.ts +9 -17
  308. package/scripts/init/start-exec.ts +1 -1
  309. package/scripts/init/start-setup-pr.ts +6 -6
  310. package/scripts/init/start-steps.ts +3 -1
  311. package/scripts/issue/behavior-change-lint.ts +0 -1
  312. package/scripts/issue/defect-rate-cli.ts +64 -23
  313. package/scripts/issue/defect-rate.ts +1 -2
  314. package/scripts/{git → issue}/git-next-issues.ts +3 -3
  315. package/scripts/issue/issue-backlinks-cli.ts +1 -5
  316. package/scripts/issue/issue-backlinks.ts +7 -14
  317. package/scripts/issue/issue-cite-cli.ts +2 -6
  318. package/scripts/issue/issue-cite.ts +12 -8
  319. package/scripts/issue/issue-classification.ts +1 -9
  320. package/scripts/issue/issue-closing-pr.ts +4 -4
  321. package/scripts/issue/issue-comment-cli.ts +2 -2
  322. package/scripts/issue/issue-file-cli.ts +5 -5
  323. package/scripts/issue/issue-file.ts +7 -14
  324. package/scripts/issue/issue-fold-cli.ts +1 -1
  325. package/scripts/issue/issue-fold-existing-cli.ts +1 -1
  326. package/scripts/{git → issue}/issue-labels.ts +8 -0
  327. package/scripts/issue/issue-lint-cli.ts +1 -1
  328. package/scripts/issue/issue-merged.ts +2 -2
  329. package/scripts/{git → issue}/issue-rank.ts +1 -1
  330. package/scripts/issue/issue-read-cli.ts +8 -47
  331. package/scripts/issue/issue-read.ts +0 -2
  332. package/scripts/issue/issue-report-failures.ts +80 -0
  333. package/scripts/issue/issue-scout-cli.ts +1 -7
  334. package/scripts/issue/issue-scout-closed.ts +2 -2
  335. package/scripts/issue/issue-scout.ts +0 -2
  336. package/scripts/issue/issue-state-cli.ts +5 -46
  337. package/scripts/issue/issue-state.ts +1 -5
  338. package/scripts/issue/markdown-section.ts +21 -6
  339. package/scripts/issue/measure-rerun-cli.ts +74 -15
  340. package/scripts/issue/reproduction-measure.ts +1 -1
  341. package/scripts/josh/cli-body.ts +1 -1
  342. package/scripts/josh/file-map-stamp.ts +0 -3
  343. package/scripts/josh/josh-command-map.ts +2 -0
  344. package/scripts/josh/josh-commands-ai.ts +9 -102
  345. package/scripts/josh/josh-commands-backlog.ts +5 -1
  346. package/scripts/josh/josh-commands-development.ts +8 -1
  347. package/scripts/josh/josh-commands-issue.ts +2 -2
  348. package/scripts/josh/josh-commands-maintenance.ts +7 -0
  349. package/scripts/josh/josh-commands-project.ts +7 -1
  350. package/scripts/josh/josh-commands-run.ts +114 -0
  351. package/scripts/josh/josh-commands-versioning.ts +8 -0
  352. package/scripts/josh/josh-commands-workflow.ts +3 -3
  353. package/scripts/josh/path-decision.ts +0 -3
  354. package/scripts/josh/process-owner.ts +16 -0
  355. package/scripts/josh/run-github-prerequisite.ts +3 -6
  356. package/scripts/josh/session-language-cli.ts +0 -1
  357. package/scripts/lane/lane-await.ts +46 -19
  358. package/scripts/lane/lane-capacity.ts +6 -3
  359. package/scripts/lane/lane-child-invocation.ts +20 -7
  360. package/scripts/lane/lane-cli.ts +1 -4
  361. package/scripts/lane/lane-close.ts +5 -4
  362. package/scripts/lane/lane-dispatch.ts +3 -4
  363. package/scripts/lane/lane-environment.ts +0 -9
  364. package/scripts/lane/lane-handoff.ts +38 -0
  365. package/scripts/lane/lane-launch-cli.ts +31 -27
  366. package/scripts/lane/lane-open.ts +0 -3
  367. package/scripts/lane/lane-output.ts +0 -1
  368. package/scripts/lane/lane-registry.ts +9 -0
  369. package/scripts/lane/openai-lane-ship.ts +2 -0
  370. package/scripts/lane/openai-lane-supervisor-decision.ts +2 -1
  371. package/scripts/lane/openai-lane-supervisor.ts +6 -4
  372. package/scripts/lane/openai-review-broker.ts +7 -1
  373. package/scripts/lib/bounded-pool.ts +1 -0
  374. package/scripts/lib/cli-flags.ts +31 -2
  375. package/scripts/lib/error-message.ts +12 -1
  376. package/scripts/lib/json-value.ts +5 -4
  377. package/scripts/lib/poll.ts +3 -1
  378. package/scripts/lib/timed-fetch.ts +15 -0
  379. package/scripts/lib/timeouts.ts +13 -0
  380. package/scripts/{yaml → lib}/yaml-document.ts +3 -1
  381. package/scripts/{bytes → lines}/bytes-command.ts +0 -2
  382. package/scripts/lines/line-targets.ts +0 -11
  383. package/scripts/lines/lines-command.ts +5 -4
  384. package/scripts/lint/lint-related-scope.ts +0 -1
  385. package/scripts/lint/lint-related.ts +1 -1
  386. package/scripts/{git → notify}/telegram-notify.ts +2 -2
  387. package/scripts/{git → notify}/telegram-test.ts +4 -4
  388. package/scripts/observations/observation-ledger-home.ts +0 -1
  389. package/scripts/observations/observation-ledger-line.ts +0 -1
  390. package/scripts/observations/observation-ledger-migrate.ts +1 -1
  391. package/scripts/observations/observations-flush-landing.ts +3 -3
  392. package/scripts/observations/observations-flush.ts +2 -2
  393. package/scripts/overrides/lockfile-overrides.ts +1 -1
  394. package/scripts/overrides/overrides-logic.ts +1 -1
  395. package/scripts/package/package-scout-cli.ts +2 -7
  396. package/scripts/package/package-scout.ts +0 -2
  397. package/scripts/propagate/propagate-git-failure.ts +0 -1
  398. package/scripts/propagate/propagate-git.ts +3 -10
  399. package/scripts/propagate/propagate-publish.ts +2 -3
  400. package/scripts/propagate/propagate-run.ts +0 -2
  401. package/scripts/propagate/propagate-steps.ts +3 -5
  402. package/scripts/propagate/propagate-targets.ts +0 -4
  403. package/scripts/propagate/propagate.ts +0 -4
  404. package/scripts/refactor/import-graph.ts +0 -1
  405. package/scripts/refactor/refactor-lint.ts +0 -2
  406. package/scripts/refactor/refactor-scan.ts +2 -2
  407. package/scripts/refactor/refactor-targets.ts +0 -1
  408. package/scripts/registry-migration/migrate-logic.ts +28 -21
  409. package/scripts/registry-migration/migrate.ts +25 -14
  410. package/scripts/release/github-release-cli.ts +19 -6
  411. package/scripts/release/github-release-environment.ts +46 -0
  412. package/scripts/release/github-release.ts +151 -94
  413. package/scripts/release/release-history.ts +0 -1
  414. package/scripts/release/release-plan.ts +0 -1
  415. package/scripts/release/release-publish.ts +38 -5
  416. package/scripts/release/release-scope-cli.ts +1 -2
  417. package/scripts/release/release-tag.ts +2 -4
  418. package/scripts/release/release-worktree.ts +97 -2
  419. package/scripts/repo/auto-merge-setting-logic.ts +1 -4
  420. package/scripts/repo/repo-setting.ts +1 -1
  421. package/scripts/repo/repository-labels.ts +3 -3
  422. package/scripts/repo/required-checks-logic.ts +206 -0
  423. package/scripts/repo/required-checks-report.ts +71 -0
  424. package/scripts/repo/ruleset-check-cli.ts +53 -0
  425. package/scripts/repo/ruleset-check.ts +147 -0
  426. package/scripts/report/report-lint-cli.ts +0 -4
  427. package/scripts/review/disposition-cli.ts +1 -1
  428. package/scripts/review/live-evidence.ts +1 -1
  429. package/scripts/review/review-attest-cli.ts +0 -6
  430. package/scripts/review/review-attest.ts +4 -16
  431. package/scripts/review/review-brief-cli.ts +23 -6
  432. package/scripts/review/review-brief.ts +21 -8
  433. package/scripts/review/review-checkout.ts +3 -2
  434. package/scripts/review/review-diff-parts.ts +89 -0
  435. package/scripts/review/review-diff-write.ts +97 -0
  436. package/scripts/review/review-finding-ledger.ts +0 -1
  437. package/scripts/review/review-record-cli.ts +10 -17
  438. package/scripts/review/review-record.ts +0 -1
  439. package/scripts/review/review-round2-cli.ts +1 -1
  440. package/scripts/review/review-stamps.ts +0 -3
  441. package/scripts/review/review-tree.ts +14 -2
  442. package/scripts/rules/decision-oracle-stage.ts +18 -0
  443. package/scripts/rules/decision-oracle.ts +10 -7
  444. package/scripts/rules/delivered-rules.ts +9 -1
  445. package/scripts/rules/destructive-command.ts +119 -0
  446. package/scripts/rules/direct-filing.ts +1 -1
  447. package/scripts/rules/early-heartbeat.ts +4 -3
  448. package/scripts/rules/file-body.ts +0 -3
  449. package/scripts/rules/filing-cap.ts +0 -2
  450. package/scripts/rules/gh-api.ts +7 -2
  451. package/scripts/rules/git-argv.ts +18 -7
  452. package/scripts/rules/git-force.ts +0 -2
  453. package/scripts/rules/implementation-cut.ts +0 -1
  454. package/scripts/rules/index-guard.ts +71 -0
  455. package/scripts/rules/issue-citation.ts +50 -25
  456. package/scripts/rules/lane-background.ts +15 -7
  457. package/scripts/rules/lane-park.ts +22 -6
  458. package/scripts/rules/last-prompt.ts +1 -0
  459. package/scripts/rules/oracle-consulted.ts +1 -1
  460. package/scripts/rules/oracle-firing.ts +1 -0
  461. package/scripts/rules/oracle-list-cli.ts +0 -3
  462. package/scripts/rules/permission-guards.ts +14 -0
  463. package/scripts/rules/protected-files.ts +74 -0
  464. package/scripts/rules/reply-language.ts +1 -1
  465. package/scripts/rules/rule-body-guard.ts +0 -3
  466. package/scripts/rules/rule-value-cli.ts +0 -1
  467. package/scripts/rules/shell-body-trigger.ts +0 -1
  468. package/scripts/rules/shell-segments.ts +0 -1
  469. package/scripts/rules/stop-rules.ts +20 -9
  470. package/scripts/rules/tail-commands.ts +1 -1
  471. package/scripts/rules/test-declared-commit.ts +1 -1
  472. package/scripts/rules/third-party-write.ts +0 -1
  473. package/scripts/rules/worktree-guard.ts +26 -9
  474. package/scripts/run/run-carry-args.ts +8 -12
  475. package/scripts/run/run-carry-cli.ts +0 -2
  476. package/scripts/run/run-carry-stash.ts +2 -2
  477. package/scripts/run/run-carry-streak.ts +1 -1
  478. package/scripts/run/run-cut-args.ts +1 -6
  479. package/scripts/run/run-cut-cli.ts +0 -7
  480. package/scripts/run/run-cut.ts +8 -54
  481. package/scripts/run/run-ending-cli.ts +2 -6
  482. package/scripts/run/run-ending.ts +1 -4
  483. package/scripts/run/run-entry-cli.ts +133 -25
  484. package/scripts/run/run-entry-stop.ts +104 -0
  485. package/scripts/run/run-entry.ts +0 -1
  486. package/scripts/run/run-event-cli.ts +0 -2
  487. package/scripts/run/run-event-follow.ts +1 -0
  488. package/scripts/run/run-event-render.ts +1 -1
  489. package/scripts/run/run-event-scope.ts +53 -4
  490. package/scripts/run/run-event-stream-emit.ts +7 -2
  491. package/scripts/run/run-event-stream.ts +0 -3
  492. package/scripts/run/run-event-watch.ts +1 -0
  493. package/scripts/run/run-halfrun-resume.ts +20 -7
  494. package/scripts/run/run-headless.ts +2 -2
  495. package/scripts/run/run-hold-cli.ts +33 -10
  496. package/scripts/run/run-hold.ts +29 -6
  497. package/scripts/run/run-issue-number.ts +1 -1
  498. package/scripts/run/run-liveness-cli.ts +2 -6
  499. package/scripts/run/run-liveness.ts +2 -3
  500. package/scripts/run/run-merge-cli.ts +7 -23
  501. package/scripts/run/run-merge-steps.ts +5 -5
  502. package/scripts/run/run-merge.ts +1 -1
  503. package/scripts/run/run-next-cli.ts +1 -1
  504. package/scripts/run/run-parent-cut-hook.ts +4 -2
  505. package/scripts/run/run-preflight.ts +2 -9
  506. package/scripts/run/run-prep-cli.ts +6 -3
  507. package/scripts/run/run-prep-locate.ts +1 -1
  508. package/scripts/run/run-progress-args.ts +20 -4
  509. package/scripts/run/run-progress-cli.ts +35 -36
  510. package/scripts/run/run-progress-clock.ts +10 -35
  511. package/scripts/run/run-progress-config.ts +0 -4
  512. package/scripts/run/run-progress-read.ts +1 -2
  513. package/scripts/run/run-progress.ts +1 -2
  514. package/scripts/run/run-prrun-resume.ts +117 -0
  515. package/scripts/run/run-report-cli.ts +1 -2
  516. package/scripts/run/run-report.ts +0 -1
  517. package/scripts/run/run-retrospective.ts +1 -1
  518. package/scripts/run/run-review-cli.ts +0 -3
  519. package/scripts/run/run-review-steps.ts +2 -0
  520. package/scripts/run/run-review.ts +0 -2
  521. package/scripts/run/run-ship-cli.ts +29 -19
  522. package/scripts/run/run-ship-detach.ts +1 -0
  523. package/scripts/run/run-ship-next.ts +106 -0
  524. package/scripts/run/run-ship-preflight.ts +1 -1
  525. package/scripts/run/run-ship-probe.ts +4 -1
  526. package/scripts/run/run-ship-return.ts +8 -3
  527. package/scripts/run/run-ship-review-steps.ts +18 -4
  528. package/scripts/run/run-ship-review.ts +11 -0
  529. package/scripts/run/run-ship-scoped.ts +1 -0
  530. package/scripts/run/run-ship-steps.ts +1 -1
  531. package/scripts/run/run-ship.ts +0 -1
  532. package/scripts/run/run-stage-read.ts +62 -0
  533. package/scripts/run/run-stage.ts +160 -0
  534. package/scripts/run/run-status-cli.ts +3 -16
  535. package/scripts/run/run-step-cli.ts +21 -14
  536. package/scripts/run/run-step.ts +1 -1
  537. package/scripts/run/run-stop-notify.ts +1 -3
  538. package/scripts/run/run-stranded-cli.ts +0 -4
  539. package/scripts/run/run-stranded-detect.ts +2 -2
  540. package/scripts/run/run-tail-cli.ts +17 -11
  541. package/scripts/run/run-tail.ts +2 -0
  542. package/scripts/run/run-tidy-lanes.ts +6 -2
  543. package/scripts/run/run-tidy-stashes.ts +12 -12
  544. package/scripts/run/run-wake-cli.ts +4 -13
  545. package/scripts/run/run-wake-loop.ts +2 -2
  546. package/scripts/run/run-wake.ts +2 -4
  547. package/scripts/run/run-watcher-guard-cli.ts +0 -4
  548. package/scripts/run/run-watcher-guard.ts +18 -12
  549. package/scripts/run/run-watcher-hook.ts +1 -1
  550. package/scripts/safe-chain/ci-installer-pin.ts +11 -5
  551. package/scripts/safe-chain/pack-hook.ts +92 -0
  552. package/scripts/safe-chain/project-config.ts +1 -1
  553. package/scripts/security/security-audit-provision-logic.ts +0 -1
  554. package/scripts/security/security-audit-provision.ts +3 -2
  555. package/scripts/security/security-audit.ts +0 -1
  556. package/scripts/security/security-updates-logic.ts +0 -1
  557. package/scripts/sonar/sonar-hotspots-cli.ts +10 -52
  558. package/scripts/sonar/sonar-hotspots.ts +0 -1
  559. package/scripts/sonar/sonar-new-code-cli.ts +150 -0
  560. package/scripts/sonar/sonar-new-code.ts +79 -0
  561. package/scripts/sonar/sonar-project.ts +97 -0
  562. package/scripts/split/split-assess-cli.ts +1 -1
  563. package/scripts/split/split-assess.ts +2 -5
  564. package/scripts/sync/managed-config-scope-cli.ts +1 -1
  565. package/scripts/sync/skill-migration.ts +0 -1
  566. package/scripts/sync/sync-ai-files.ts +4 -0
  567. package/scripts/sync/sync-hook-safety.ts +2 -3
  568. package/scripts/sync/sync.ts +1 -8
  569. package/scripts/sync/template-source-logic.ts +0 -1
  570. package/scripts/sync/workflow-pin-logic.ts +16 -28
  571. package/scripts/test/test-declared-changed.ts +13 -16
  572. package/scripts/test/test-declared-logic.ts +0 -1
  573. package/scripts/test/test-declared.ts +3 -9
  574. package/scripts/test/test-red-commit.ts +2 -2
  575. package/scripts/test/test-red.ts +14 -7
  576. package/scripts/test/test-type-logic.ts +1 -1
  577. package/scripts/test/unit-worker-share.ts +7 -16
  578. package/scripts/time-runtime/time-batch-guard.ts +1 -2
  579. package/scripts/time-runtime/time-bundle-call.ts +0 -1
  580. package/scripts/time-runtime/time-bundles.ts +0 -4
  581. package/scripts/time-runtime/time-density-hook.ts +0 -2
  582. package/scripts/time-runtime/time-followup-stage.ts +1 -1
  583. package/scripts/time-runtime/time-format.ts +0 -73
  584. package/scripts/time-runtime/time-round-trips.ts +0 -4
  585. package/scripts/time-runtime/time-single-check.ts +1 -1
  586. package/scripts/time-runtime/time-spans.ts +1 -1
  587. package/scripts/time-runtime/time-transcript-line.ts +1 -2
  588. package/scripts/ui/ui-routes-cli.ts +0 -5
  589. package/scripts/ui/ui-routes.ts +0 -5
  590. package/scripts/version/effective-upstream.ts +2 -2
  591. package/scripts/version/latest-corepack.ts +7 -9
  592. package/scripts/version/latest-scope-cli.ts +0 -2
  593. package/scripts/version/latest-update.ts +0 -2
  594. package/scripts/version/npm-registry.ts +2 -2
  595. package/scripts/version/publishable-range-check.ts +1 -1
  596. package/scripts/version/release-hold.ts +0 -4
  597. package/scripts/version/running-binary.ts +2 -2
  598. package/scripts/version/version-check-logic.ts +0 -2
  599. package/scripts/version/version-commands.ts +11 -1
  600. package/scripts/version/version-remote.ts +3 -3
  601. package/scripts/version/version-targets.ts +4 -4
  602. package/templates/CLAUDE.basic.md +6 -6
  603. package/templates/sonar-project.properties +28 -1
  604. package/templates/workflows/ci.yml +16 -82
  605. package/templates/workflows/dependabot-auto-merge.yml +6 -3
  606. package/templates/workflows/github-release.yml +79 -0
  607. package/tsconfig.sonar.json +4 -22
  608. package/prompts/collaboration-workflow/cross-repo-epic.md +0 -5
  609. package/prompts/collaboration-workflow/epic-audit.md +0 -5
  610. package/prompts/collaboration-workflow/epic-bundle.md +0 -5
  611. package/scripts/init/plugin-install-hint.ts +0 -47
  612. package/scripts/version/parse-json.ts +0 -13
  613. /package/scripts/{git → followup}/git-followup-stages.ts +0 -0
  614. /package/scripts/{git → gh}/git-gh-api-path.ts +0 -0
  615. /package/scripts/{git → gh}/git-gh-command.ts +0 -0
  616. /package/scripts/{git → gh}/git-gh-issue.ts +0 -0
  617. /package/scripts/{git → gh}/git-gh-pr-snapshot.ts +0 -0
  618. /package/scripts/{git → gh}/git-gh-reachability.ts +0 -0
  619. /package/scripts/{git → gh}/git-gh-repo.ts +0 -0
  620. /package/scripts/{git → gh}/git-gh-rest-state.ts +0 -0
  621. /package/scripts/{git → gh}/git-pr-checks-watch.ts +0 -0
  622. /package/scripts/{git → gh}/git-pr-error.ts +0 -0
  623. /package/scripts/{git → gh}/git-pr-messages.ts +0 -0
  624. /package/scripts/{git → gh}/github-issue-url.ts +0 -0
  625. /package/scripts/git/{stash-orphans.ts → stash/stash-orphans.ts} +0 -0
  626. /package/scripts/{git → issue}/issue-reference.ts +0 -0
  627. /package/scripts/{git → lib}/animation-helpers.ts +0 -0
  628. /package/scripts/{git → lib}/git-animation.ts +0 -0
  629. /package/scripts/{git → notify}/git-notify.ts +0 -0
  630. /package/scripts/{git → notify}/telegram-test-logic.ts +0 -0
@@ -66,6 +66,19 @@ import { existsSync, readFileSync } from "node:fs";
66
66
  import { createRequire } from "node:module";
67
67
  import path from "node:path";
68
68
 
69
+ // scripts/lib/json-value.ts
70
+ function parse_or_undefined(text) {
71
+ try {
72
+ return JSON.parse(text);
73
+ } catch {
74
+ return void 0;
75
+ }
76
+ }
77
+ function is_record(value) {
78
+ return typeof value === "object" && value !== null && !Array.isArray(value);
79
+ }
80
+ var json_value = { parse_or_undefined, is_record };
81
+
69
82
  // scripts/lib/schemas.ts
70
83
  import { z } from "zod";
71
84
  var overrides_snapshot_schema = z.record(z.string(), z.string());
@@ -98,22 +111,13 @@ var json_object_schema = z.record(z.string(), z.unknown());
98
111
  var string_array_schema = z.array(z.string());
99
112
  var string_record_schema = z.record(z.string(), z.string());
100
113
 
101
- // scripts/version/parse-json.ts
102
- function safe_json_parse(raw) {
103
- try {
104
- return JSON.parse(raw);
105
- } catch {
106
- return void 0;
107
- }
108
- }
109
-
110
114
  // scripts/version/effective-upstream.ts
111
115
  var PACKAGE_JSON = "package.json";
112
116
  var MAX_WALK_DEPTH = 64;
113
117
  function read_matching_version(manifest_path, package_name) {
114
118
  if (!existsSync(manifest_path)) return void 0;
115
119
  const parsed = package_named_version_schema.safeParse(
116
- safe_json_parse(readFileSync(manifest_path, "utf8"))
120
+ json_value.parse_or_undefined(readFileSync(manifest_path, "utf8"))
117
121
  );
118
122
  if (!parsed.success) return void 0;
119
123
  if (parsed.data.name !== package_name) return void 0;
@@ -258,13 +262,9 @@ function build_release_hold_notes(version, latest, installable, minimum_age_minu
258
262
  return [format_release_hold_note(version, latest, installable, minimum_age_minutes)];
259
263
  }
260
264
  var release_hold = {
261
- HOLD_LABEL,
262
- is_at_or_above,
263
- is_latest_withheld,
264
265
  resolve_installable,
265
266
  is_release_age_hold,
266
267
  format_window,
267
- format_release_hold_note,
268
268
  build_release_hold_notes
269
269
  };
270
270
 
@@ -283,7 +283,7 @@ function read_running_version(self_directory) {
283
283
  const package_path = resolve_self_package_path(self_directory);
284
284
  if (!existsSync2(package_path)) return void 0;
285
285
  const parsed = package_version_schema.safeParse(
286
- safe_json_parse(readFileSync3(package_path, "utf8"))
286
+ json_value.parse_or_undefined(readFileSync3(package_path, "utf8"))
287
287
  );
288
288
  return parsed.success ? parsed.data.version : void 0;
289
289
  }
@@ -463,19 +463,23 @@ var version_check_logic = {
463
463
  format_dual_version_output,
464
464
  format_running_line,
465
465
  format_upstream_lines,
466
- format_upstream_global_line,
467
466
  build_dual_upgrade_commands,
468
467
  build_upstream_upgrade_commands,
469
468
  build_upstream_upgrade_notes,
470
469
  build_effective_upgrade_commands,
471
470
  build_effective_upgrade_notes,
472
- build_project_upgrade_commands,
473
471
  format_update_command,
474
472
  format_effective_outcome,
475
473
  build_upgrade_shell_command,
476
474
  unique_upgrade_commands
477
475
  };
478
476
 
477
+ // scripts/git/git-execa-error.ts
478
+ function has_timed_out(error) {
479
+ if (typeof error !== "object" || error === null || !("timedOut" in error)) return false;
480
+ return error.timedOut === true;
481
+ }
482
+
479
483
  // scripts/josh/agent-session-environment.ts
480
484
  var SESSION_ID_KEY = "CLAUDE_CODE_SESSION_ID";
481
485
  var PARENT_SESSION_KEYS = [
@@ -561,24 +565,27 @@ var agent_session_environment = {
561
565
  function message_of(error) {
562
566
  return error instanceof Error ? error.message : String(error);
563
567
  }
564
- var error_text = { message_of };
568
+ var DEBUG_ENV_KEY = "JOSH_DEBUG";
569
+ function trace_swallowed(where, error) {
570
+ if ((process.env[DEBUG_ENV_KEY] ?? "").trim() === "") return;
571
+ process.stderr.write(`josh debug: ${where}: ${message_of(error)}
572
+ `);
573
+ }
574
+ var error_text = { message_of, trace_swallowed };
565
575
 
566
- // scripts/git/git-gh-exec.ts
576
+ // scripts/gh/git-gh-exec.ts
567
577
  import { execa as execa2, execaSync } from "execa";
568
578
 
569
- // scripts/git/git-execa-error.ts
570
- function has_timed_out(error) {
571
- if (typeof error !== "object" || error === null || !("timedOut" in error)) return false;
572
- return error.timedOut === true;
573
- }
579
+ // scripts/lib/timeouts.ts
580
+ var COMMAND_TIMEOUT_MS = 3e4;
574
581
 
575
- // scripts/git/git-gh-check.ts
582
+ // scripts/gh/git-gh-check.ts
576
583
  import { execa } from "execa";
577
584
  var GH_NOT_INSTALLED_MSG = "gh CLI is not installed. Install it from https://cli.github.com/";
578
585
  var gh_check = {};
579
586
  async function run_gh_check() {
580
587
  try {
581
- await execa("gh", ["--version"]);
588
+ await execa("gh", ["--version"], { timeout: COMMAND_TIMEOUT_MS });
582
589
  } catch {
583
590
  delete gh_check.promise;
584
591
  throw new Error(GH_NOT_INSTALLED_MSG);
@@ -589,9 +596,6 @@ async function check_gh_installed() {
589
596
  await gh_check.promise;
590
597
  }
591
598
 
592
- // scripts/git/git-gh-failure.ts
593
- import { z as z3 } from "zod";
594
-
595
599
  // scripts/git/parse-json-array.ts
596
600
  var MALFORMED_JSON = /* @__PURE__ */ Symbol("malformed-json");
597
601
  function parse_json_loose(raw_json) {
@@ -602,37 +606,17 @@ function parse_json_loose(raw_json) {
602
606
  throw error;
603
607
  }
604
608
  }
605
- function parse_json_array_or_undefined(raw_json, element_schema) {
606
- const value = parse_json_loose(raw_json);
607
- if (value === MALFORMED_JSON || !Array.isArray(value)) return void 0;
608
- return element_schema.array().parse(value);
609
- }
610
- function read_json_listing(raw_json, element_schema) {
611
- try {
612
- const rows = parse_json_array_or_undefined(raw_json, element_schema);
613
- return rows === void 0 ? { kind: "unreadable" } : { kind: "read", rows };
614
- } catch {
615
- return { kind: "unexpected_shape" };
616
- }
617
- }
618
- function parse_json_array_safe(raw_json, element_schema) {
619
- const value = parse_json_loose(raw_json);
620
- if (value === MALFORMED_JSON) return [];
621
- return element_schema.array().parse(value);
622
- }
623
609
  function parse_json_object_safe(raw_json, schema) {
624
610
  const value = parse_json_loose(raw_json);
625
611
  if (value === MALFORMED_JSON) return void 0;
626
612
  return schema.parse(value);
627
613
  }
628
614
  var parse_json = {
629
- parse_json_array_safe,
630
- parse_json_array_or_undefined,
631
- parse_json_object_safe,
632
- read_json_listing
615
+ parse_json_object_safe
633
616
  };
634
617
 
635
- // scripts/git/git-gh-failure.ts
618
+ // scripts/gh/git-gh-failure.ts
619
+ import { z as z3 } from "zod";
636
620
  var error_document_schema = z3.object({ status: z3.union([z3.string(), z3.number()]).optional() }).catch({});
637
621
  var GH_FAILURE_FIELD = "gh_failure";
638
622
  function has_gh_failure(error) {
@@ -660,7 +644,7 @@ function failure_of(error) {
660
644
  }
661
645
  var gh_failure = { attach, classify_stdout, failure_of, parse_response_status };
662
646
 
663
- // scripts/git/git-gh-exec.ts
647
+ // scripts/gh/git-gh-exec.ts
664
648
  var BODY_FROM_STDIN = "-";
665
649
  var GH_REQUEST_TIMEOUT_MS = 6e4;
666
650
  function to_timeout_option(timeout_ms) {
@@ -1031,18 +1015,23 @@ function is_package_entry(line) {
1031
1015
  function is_github_tarball_line(line) {
1032
1016
  return line.trimStart().startsWith("tarball: https://npm.pkg.github.com/");
1033
1017
  }
1034
- function clean_kit_line(line, version, integrities) {
1035
- if (!version) return line;
1018
+ function package_id(key) {
1019
+ const name = fix_gh_packages_logic.package_path_from_key(key);
1020
+ return `${name}@${fix_gh_packages_logic.package_version_from_key(key)}`;
1021
+ }
1022
+ function clean_scoped_line(line, id, integrities) {
1023
+ if (!id) return line;
1036
1024
  if (is_github_tarball_line(line)) return void 0;
1037
1025
  const cleaned = remove_flow_tarball(line);
1038
- const pair = integrities.get(version);
1026
+ const pair = integrities.get(id);
1039
1027
  if (pair === void 0) return cleaned;
1040
1028
  return cleaned.split(`integrity: ${pair[0]}`).join(`integrity: ${pair[1]}`);
1041
1029
  }
1042
- function next_kit_version(line, version) {
1043
- if (!is_package_entry(line)) return version;
1044
- const prefix = " '@joshuafolkken/kit@";
1045
- return line.startsWith(prefix) ? line.slice(prefix.length).split("'", 1)[0] ?? "" : "";
1030
+ function next_scoped_id(line, id) {
1031
+ if (!is_package_entry(line)) return id;
1032
+ const prefix = ` '${SCOPE}/`;
1033
+ if (!line.startsWith(prefix)) return "";
1034
+ return package_id(line.slice(" '".length).split("'", 1)[0] ?? "");
1046
1035
  }
1047
1036
  function integrity_pair(old_integrity, npm_integrity) {
1048
1037
  if (old_integrity === void 0 || npm_integrity === void 0) return void 0;
@@ -1051,24 +1040,24 @@ function integrity_pair(old_integrity, npm_integrity) {
1051
1040
  function lock_integrities(lockfile, npm_integrities) {
1052
1041
  const packages = fix_gh_packages_logic.parse_lockfile_packages(lockfile);
1053
1042
  const pairs = /* @__PURE__ */ new Map();
1054
- const kit_entries = Object.entries(packages).filter(([key]) => key.startsWith(`${SCOPE}/kit@`));
1055
- for (const [key, entry] of kit_entries) {
1056
- const version = fix_gh_packages_logic.package_version_from_key(key);
1057
- const pair = integrity_pair(entry.resolution?.integrity, npm_integrities.get(version));
1058
- if (pair !== void 0) pairs.set(version, pair);
1043
+ const scoped_entries = Object.entries(packages).filter(([key]) => key.startsWith(`${SCOPE}/`));
1044
+ for (const [key, entry] of scoped_entries) {
1045
+ const id = package_id(key);
1046
+ const pair = integrity_pair(entry.resolution?.integrity, npm_integrities.get(id));
1047
+ if (pair !== void 0) pairs.set(id, pair);
1059
1048
  }
1060
1049
  return pairs;
1061
1050
  }
1062
1051
  function push_if_defined(lines, cleaned) {
1063
1052
  if (cleaned !== void 0) lines.push(cleaned);
1064
1053
  }
1065
- function rewrite_kit_lockfile(lockfile, npm_integrities) {
1066
- let kit_version = "";
1054
+ function rewrite_scoped_lockfile(lockfile, npm_integrities) {
1055
+ let id = "";
1067
1056
  const lines = [];
1068
1057
  const integrities = lock_integrities(lockfile, npm_integrities);
1069
1058
  for (const line of lockfile.split("\n")) {
1070
- kit_version = next_kit_version(line, kit_version);
1071
- const cleaned = clean_kit_line(line, kit_version, integrities);
1059
+ id = next_scoped_id(line, id);
1060
+ const cleaned = clean_scoped_line(line, id, integrities);
1072
1061
  push_if_defined(lines, cleaned);
1073
1062
  }
1074
1063
  return lines.join("\n");
@@ -1098,7 +1087,7 @@ function previous_registry(project_npmrc, user_npmrc) {
1098
1087
  }
1099
1088
  function plan(project_npmrc, user_npmrc, lockfile) {
1100
1089
  const packages = scoped_packages(lockfile);
1101
- const blocked = packages.filter((name) => name !== `${SCOPE}/kit`);
1090
+ const blocked = [];
1102
1091
  if (has_duplicate_mapping(project_npmrc, user_npmrc)) blocked.push("duplicate registry mappings");
1103
1092
  const unsupported = unsupported_registry(project_npmrc);
1104
1093
  if (unsupported !== void 0) blocked.push(unsupported);
@@ -1110,9 +1099,7 @@ var migrate_logic = {
1110
1099
  plan,
1111
1100
  github_tarballs,
1112
1101
  is_github_tarball,
1113
- rewrite_kit_lockfile,
1114
- registry_of,
1115
- scoped_packages,
1102
+ rewrite_scoped_lockfile,
1116
1103
  scoped_versions
1117
1104
  };
1118
1105
 
@@ -1146,7 +1133,7 @@ function read_packument(package_name, accept) {
1146
1133
  { reject: false, timeout: REQUEST_TIMEOUT_MS }
1147
1134
  );
1148
1135
  if (result.exitCode !== 0) return void 0;
1149
- return safe_json_parse(result.stdout);
1136
+ return json_value.parse_or_undefined(result.stdout);
1150
1137
  }
1151
1138
  function is_github_scope(scope) {
1152
1139
  const is_cached_github = github_scopes.get(scope);
@@ -1211,7 +1198,7 @@ function read_github_release_times(versions_endpoint) {
1211
1198
  const endpoint = with_page_size(versions_endpoint, TIMES_PAGE_SIZE);
1212
1199
  const stdout = git_gh_exec.read_gh_api_sync({ path: endpoint, jq_filter: TIMES_JQ });
1213
1200
  if (stdout === void 0) return void 0;
1214
- const parsed = release_age.release_times_schema.safeParse(safe_json_parse(stdout));
1201
+ const parsed = release_age.release_times_schema.safeParse(json_value.parse_or_undefined(stdout));
1215
1202
  return parsed.success ? parsed.data : void 0;
1216
1203
  }
1217
1204
  function fetch_release_times(versions_endpoint, package_name) {
@@ -1256,13 +1243,13 @@ function build_pnpm_ls_arguments(package_name) {
1256
1243
  return ["ls", "-g", "--json", package_name];
1257
1244
  }
1258
1245
  function parse_global_version(stdout, package_name) {
1259
- const parsed = pnpm_ls_global_schema.safeParse(safe_json_parse(stdout));
1246
+ const parsed = pnpm_ls_global_schema.safeParse(json_value.parse_or_undefined(stdout));
1260
1247
  if (!parsed.success) return void 0;
1261
1248
  return parsed.data[0]?.dependencies?.[package_name]?.version;
1262
1249
  }
1263
1250
  function parse_project_version(raw) {
1264
1251
  if (raw === void 0) return void 0;
1265
- const parsed = package_version_schema.safeParse(safe_json_parse(raw));
1252
+ const parsed = package_version_schema.safeParse(json_value.parse_or_undefined(raw));
1266
1253
  return parsed.success ? parsed.data.version : void 0;
1267
1254
  }
1268
1255
  function read_global_version(package_name) {
@@ -1300,6 +1287,7 @@ var version_targets = {
1300
1287
  var FAILURE_EXIT_CODE = 1;
1301
1288
  var ALREADY_UP_TO_DATE = "Already up to date";
1302
1289
  var NO_QUARANTINE_MINUTES2 = 0;
1290
+ var UPGRADE_TIMEOUT_MS = 6e5;
1303
1291
  function read_release_hold(package_config, latest, versions) {
1304
1292
  if (versions.every((version) => version === void 0 || version === latest)) return void 0;
1305
1293
  const minimum_age_minutes = release_age.read_nearest_minimum_release_age(process.cwd());
@@ -1384,7 +1372,11 @@ function run_check(config) {
1384
1372
  );
1385
1373
  }
1386
1374
  function run_upgrade_command(command) {
1387
- const result = execaSync4("sh", ["-c", command], { stdio: "inherit", reject: false });
1375
+ const result = execaSync4("sh", ["-c", command], {
1376
+ stdio: "inherit",
1377
+ reject: false,
1378
+ timeout: UPGRADE_TIMEOUT_MS
1379
+ });
1388
1380
  return result.exitCode ?? FAILURE_EXIT_CODE;
1389
1381
  }
1390
1382
  function run_all_upgrade_commands(commands) {
@@ -5,6 +5,11 @@ export const promise_rules = {
5
5
  'promise/param-names': 'error',
6
6
  'promise/no-nesting': 'error',
7
7
 
8
+ // ループ内で 1 つずつ await すると、独立した処理まで直列になる。Sonar の S9382 と同じ指摘を
9
+ // ローカルのゲートで先に出す。ポーリングや順序が意味を持つ処理など意図的な逐次は、
10
+ // `// eslint-disable-next-line no-await-in-loop -- <理由>` で理由を残して抑止する。
11
+ 'no-await-in-loop': 'error',
12
+
8
13
  // `promise-function-async` を有効にしている以上、`require-await` は同時に満たせない。
9
14
  // Promise を返す契約の関数(execa モックなど)は async である必要がある一方、
10
15
  // 実際に await する対象を持たないため `require-await` が必ず発火する。
@@ -80,8 +80,9 @@ export const unicorn_rules = {
80
80
  'unicorn/custom-error-definition': 'error',
81
81
  // throw new Error()の形式を強制
82
82
  'unicorn/throw-new-error': 'error',
83
- // 空の配列をチェック
84
- 'unicorn/no-empty-file': 'error',
83
+ // 空ファイルを禁止する。コメントだけのファイルは許可する: `sv create` の足場 `src/lib/index.ts` は
84
+ // コメント 1 行だけで、手を加えていないプロジェクトで lint が落ちてしまうため(#3069)
85
+ 'unicorn/no-empty-file': ['error', { allowComments: true }],
85
86
  // 静的なみずからのみのクラスを禁止
86
87
  'unicorn/no-static-only-class': 'error',
87
88
  // this別名を禁止(arrow functionを使うべき)
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
- "version": "1.1050.0",
2
+ "version": "1.1128.0",
3
3
  "name": "@joshuafolkken/kit",
4
4
  "description": "Development toolkit for AI-assisted projects: formatting, AI assistant rules and a Git/GitHub Issue workflow for any repository, plus lint, type check, tests and hooks for Node projects",
5
5
  "keywords": [
6
6
  "ai",
7
7
  "claude-code",
8
8
  "cli",
9
+ "codex",
9
10
  "developer-tools",
10
11
  "eslint",
11
12
  "prettier",
@@ -58,6 +59,7 @@
58
59
  ".ncurc.json",
59
60
  ".prettierignore",
60
61
  "pnpm-workspace.yaml",
62
+ ".pnpmfile.mjs",
61
63
  "tsconfig.sonar.json",
62
64
  "playwright.config.ts",
63
65
  "!**/*.test.ts",
@@ -85,12 +87,16 @@
85
87
  "!scripts/build/shim-shell.ts",
86
88
  "!scripts/claude/skill-meta.ts",
87
89
  "!scripts/document/document-scan.ts",
90
+ "!scripts/exports/member-usage.ts",
91
+ "!scripts/exports/namespace-escape.ts",
92
+ "!scripts/exports/namespace-members.ts",
93
+ "!scripts/exports/unused-members.ts",
88
94
  "!scripts/document/generate-catalog.ts",
89
95
  "!scripts/document/retired-phrases.ts",
90
96
  "!scripts/document/review-agent-type.ts",
91
97
  "!scripts/document/single-source.ts",
98
+ "!scripts/hooks/hook-bundle-ready.ts",
92
99
  "!scripts/hooks/prompt-hooks.ts",
93
- "!scripts/init/hook-command-bootstrap.ts",
94
100
  "!scripts/josh/josh-script-reader.ts",
95
101
  "!scripts/package/production-dependency-graph.ts",
96
102
  "!scripts/rules/delivered-rules-harness.ts",
@@ -156,6 +162,7 @@
156
162
  "peerDependencies": {
157
163
  "@eslint/compat": "^2.1.1",
158
164
  "@eslint/js": "^10.0.1",
165
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.1",
159
166
  "@playwright/test": ">=1.0.0",
160
167
  "@stylistic/eslint-plugin": "^5.10.0",
161
168
  "eslint": "^10.0.0",
@@ -166,6 +173,9 @@
166
173
  "eslint-plugin-sonarjs": "^4.2.1",
167
174
  "eslint-plugin-unicorn": "^76.0.0",
168
175
  "globals": "^17.12.0",
176
+ "prettier": "^3.9.9",
177
+ "prettier-plugin-svelte": "^4.1.1",
178
+ "prettier-plugin-tailwindcss": "^0.8.1",
169
179
  "typescript": "^6.0.3",
170
180
  "typescript-eslint": "^8.70.1"
171
181
  },
@@ -179,6 +189,9 @@
179
189
  "@eslint/js": {
180
190
  "optional": true
181
191
  },
192
+ "@ianvs/prettier-plugin-sort-imports": {
193
+ "optional": true
194
+ },
182
195
  "@stylistic/eslint-plugin": {
183
196
  "optional": true
184
197
  },
@@ -206,6 +219,15 @@
206
219
  "globals": {
207
220
  "optional": true
208
221
  },
222
+ "prettier": {
223
+ "optional": true
224
+ },
225
+ "prettier-plugin-svelte": {
226
+ "optional": true
227
+ },
228
+ "prettier-plugin-tailwindcss": {
229
+ "optional": true
230
+ },
209
231
  "typescript": {
210
232
  "optional": true
211
233
  },
@@ -238,7 +260,7 @@
238
260
  "prettier": "^3.9.9",
239
261
  "prettier-plugin-svelte": "^4.1.1",
240
262
  "prettier-plugin-tailwindcss": "^0.8.1",
241
- "rollup": "^4.63.6",
263
+ "rollup": "^4.64.0",
242
264
  "rollup-plugin-dts": "^6.5.1",
243
265
  "secretlint": "^13.0.6",
244
266
  "typescript": "^6.0.3",
@@ -251,7 +273,6 @@
251
273
  "jsonc-parser": "^3.3.1",
252
274
  "ora": "^9.4.1",
253
275
  "semver": "^7.8.5",
254
- "strip-json-comments": "^5.0.3",
255
276
  "tsx": "^4.23.15",
256
277
  "zod": "^4.6.5"
257
278
  },
@@ -263,7 +284,7 @@
263
284
  }
264
285
  },
265
286
  "scripts": {
266
- "build": "tsx scripts/build/build-bin.ts && tsx scripts/build/build-hooks.ts && tsx scripts/build/build-version.ts && tsx scripts/build/build-config-merge.ts && tsx scripts/build/build-managed-marker.ts && tsx scripts/build/build-self-sync-guard.ts && tsx scripts/build/build-claude-md.ts",
287
+ "build": "tsx scripts/build/build-bin.ts && tsx scripts/build/build-hooks.ts && tsx scripts/build/build-version.ts && tsx scripts/build/build-config-merge.ts && tsx scripts/build/build-managed-marker.ts && tsx scripts/build/build-self-sync-guard.ts && tsx scripts/build/build-claude-md.ts && tsx scripts/build/build-codex-hooks.ts",
267
288
  "josh": "tsx scripts/josh/josh.ts"
268
289
  }
269
290
  }
@@ -28,11 +28,9 @@ minimumReleaseAgeExclude:
28
28
 
29
29
  overrides:
30
30
  svelte: ^5.55.7
31
- devalue: ^5.8.1
32
- # Indirect deps a within-range re-resolution could not lift past their parents' pins, floored at the
33
- # smallest release clearing each OSV advisory (joshuafolkken/kit#2200; user-approved 2026-09-21 to
34
- # override indirect packages). Carets so `josh latest`'s re-resolution keeps them current within the
35
- # major without reintroducing the advisory.
31
+ # An indirect dep a within-range re-resolution could not lift past its parents' pins, floored at the
32
+ # smallest release clearing its OSV advisory (joshuafolkken/kit#2200; user-approved 2026-09-21 to
33
+ # override indirect packages). A caret so `josh latest`'s re-resolution keeps it current within the
34
+ # major without reintroducing the advisory. The devalue, postcss and nanoid floors were removed once
35
+ # their parents' ranges exceeded them (joshuafolkken/kit#3091).
36
36
  vite: ^8.0.16 # OSV — vite 8.0.8 → 8.0.16
37
- postcss: ^8.5.23 # OSV — postcss 8.5.16 → 8.5.23
38
- nanoid: ^3.3.18 # OSV — nanoid 3.3.15 → 3.3.18
@@ -0,0 +1,17 @@
1
+ # ワークフロー用語集
2
+
3
+ **これは定義集であり、規則を定める場所ではない。** 各語は 1〜2 行の定義と、その語の本文がある単一ソースへのポインタだけを持つ。手順・条件・数値は指し先が持ち、ここでは言い換えない — 言い換えた行は指し先より先に古くなる(joshuafolkken/kit#3080)。
4
+
5
+ `scripts/document/workflow-glossary.test.ts` が、下の主要語が定義されていることと、各ポインタが実在する節に解決することを検査する。
6
+
7
+ - **lane** — `backlogrun` が子 Issue を並行実行するための、専用ブランチ・`.env`・ポートを持つ git worktree。実装・ゲート・レビューは並行し、マージは直列。→ `.claude/skills/workflow-commands/backlogrun-lanes.md` → "Lanes — running more than one child at a time"
8
+ - **cut** — 実行中のプロセスを意図して終わらせ、新しいプロセスが同じ作業を引き継ぐ境界。レーン子のゲート前の cut と、`backlogrun` のセッション cut がある。→ `.claude/skills/workflow-commands/pre-gate-cut.md` → "The pre-gate cut"、`.claude/skills/workflow-commands/backlogrun-progress.md` → "The hand-off"
9
+ - **hold** — 1 つの作業ツリーを 1 つのランが占有しているという記録。`pnpm josh run:hold` が取り、`pnpm josh run:release` が外す。→ `.claude/skills/workflow-commands/working-tree-hold.md` → "The working-tree hold"
10
+ - **park** — `backlogrun` が自分で決められない子を `needs-decision` で止め、バッチ全体は止めずに次の子へ進むこと。→ `.claude/skills/workflow-commands/backlogrun-park.md` → "park and continue"
11
+ - **point of use** — 文書を入口ではなく、その文書に従うべき操作と同じターンで、その操作の直前に読むこと。→ `.claude/skills/workflow-commands/SKILL.md` → "Four documents are read at the point of use, not at the entry"
12
+ - **entry read** — コマンド起動時に読む文書の集合。`pnpm josh read:set` がその集合と費用を答える。→ `.claude/skills/workflow-commands/SKILL.md` → "Which file to read"
13
+ - **oracle** — 機械的に読める入力だけから規則の答えを計算するコマンド。一覧は `pnpm josh oracle:list`。→ `prompts/collaboration-workflow/residency.md` → "第 0 問"
14
+ - **interrupt** — WIP 上限を超えても起票できる、3 条件で決まる発見。別パッケージ起因の上流起票(割り込み Issue)とは別の区分。→ `prompts/collaboration-workflow/wip-cap.md` → "割り込み起票"、`prompts/collaboration-workflow/upstream-interrupt.md` → "別パッケージ起因の問題は割り込み Issue で対応する"
15
+ - **Tier** — 判断点の 3 区分。A は可逆で自分で決める、B は拮抗していて人に聞く、C は不可逆・共有状態で明示指示が要る。→ `CLAUDE.md` → "Decision autonomy"、`prompts/collaboration-workflow/operating-rules.md` → "意思決定の自律ポリシー"
16
+ - **carry** — `backlogrun` の 1 回の起動の予算と進捗を、セッション cut をまたいで引き継ぐ記録(`pnpm josh run:carry`)。→ `.claude/skills/workflow-commands/backlogrun-steps.md` → "The session cut is inside the invocation"
17
+ - **wave** — エピックの子をまとめて並行実行する組。仕組みではなく、依存宣言で表す形。→ `.claude/skills/epic-commands/SKILL.md` → "Execution waves"
@@ -1,13 +1,13 @@
1
- # セッション向け出力で Issue はリンク+短い日本語要約で参照する
1
+ # セッション向け出力で Issue はリンク+セッション言語の短い要約で参照する
2
2
 
3
- ## セッション向け出力で Issue はリンク+短い日本語要約で参照する(joshuafolkken/kit#1758)
3
+ ## セッション向け出力で Issue はリンク+セッション言語の短い要約で参照する(joshuafolkken/kit#1758)
4
4
 
5
5
  セッション向けの出力で Issue を指すとき、番号だけを書くと読み手は何の話か判断できず、番号を内容に解決するために毎回 GitHub を開くことになる。実際、実行中の backlogrun の報告が番号の羅列になり、オーナーから「番号だけ言われても詳細がわからない」という指摘を受けた。配布ドキュメントは Issue / PR の**タイトル**を英語に固定しているが、**セッション向け出力の中で Issue をどう言及するか**は定めていなかったため、番号だけの言及が規則に反しない状態だった。
6
6
 
7
7
  **規則**: セッション向け出力で Issue を指すときは、次の 2 つを必ず添える。
8
8
 
9
9
  1. 番号にチケットへの markdown リンク
10
- 2. 短い日本語の要約タイトル
10
+ 2. セッション言語(`JOSH_SESSION_LANG`、既定 `ja`)の短い要約タイトル
11
11
 
12
12
  書き方の例:
13
13
 
@@ -15,7 +15,7 @@
15
15
 
16
16
  **この引用行は手で組み立てるものではなく、`pnpm josh issue:cite <N> [<N> ...]` が出す。** 番号を並べて渡すと、貼れる引用行を 1 呼び出しでまとめて出す(複数 Issue に 1 回、他リポジトリは `--repo <owner/repo>` あるいは `owner/repo#N` 表記)。正しい形にタイトル取得の往復が要るために裸の `#N` に落ちていたので、安い道と正しい道を同じコマンドにした。要約はその Issue のタイトルをそのまま用いる。詳細は [docs/josh-commands.md](https://github.com/joshuafolkken/kit/blob/main/docs/josh-commands.md) の `josh issue:cite` を参照。
17
17
 
18
- **日本語タイトルは全訳ではなく要約でよい。** 何をするものか分かれば足りる。長い訳を作ることが目的ではない。`issue:cite` が出すタイトルを、必要ならセッション言語に言い換えて使う。
18
+ **要約タイトルは全訳ではなく要約でよい。** 何をするものか分かれば足りる。長い訳を作ることが目的ではない。`issue:cite` が出すタイトルを、必要ならセッション言語に言い換えて使う。
19
19
 
20
20
  **対応前の言及も対象である。** 「これから走らせる」「待機中」「対象外」を並べる場面こそ、読み手が内容を知らないまま番号を読むことになるため、事後の報告だけを対象にすると指摘の半分しか解決しない。
21
21
 
@@ -27,7 +27,7 @@
27
27
 
28
28
  ### 英語固定の 3 つとは衝突しない
29
29
 
30
- 英語のままにするものは従来どおり 3 つ — Issue / PR のタイトル、コード内コメント・テスト名・コミットメッセージ、スクリプトが出力する固定文字列。この規則が変えるのは、セッション向け出力の地の文における言及の書き方だけである。番号に添える日本語要約は GitHub 上の**タイトル**ではなく、セッション内の散文の一部なので、タイトルの英語固定とは別物であり矛盾しない。
30
+ 英語のままにするものは従来どおり 3 つ — Issue / PR のタイトル、コード内コメント・テスト名・コミットメッセージ、スクリプトが出力する固定文字列。この規則が変えるのは、セッション向け出力の地の文における言及の書き方だけである。番号に添えるセッション言語の要約は GitHub 上の**タイトル**ではなく、セッション内の散文の一部なので、タイトルの英語固定とは別物であり矛盾しない。
31
31
 
32
32
  ### なぜ CLAUDE.md に常駐させるか
33
33
 
@@ -76,7 +76,7 @@ Issue には次の要素を必ず含める。
76
76
  - **互換性を壊す変更は影響を本文で宣言する。** 既存の利用者、API、設定の契約を変える場合は、`## 背景` の直下に `- 互換性: 破壊的変更` を書き、廃止対象と影響を説明する。移行措置や事前案内があっても破壊的変更なら宣言する。この宣言があれば `pnpm josh issue:file` が `breaking-change` ラベルを同じ作成リクエストに付ける。互換性を保つ変更には付けない。影響が曖昧なら起票文案で対象の利用者と契約を明確にしてから分類する
77
77
  - **本文が宣言する分類ラベルは `pnpm josh issue:file` がすべて起票時に付ける。** `bug`、`enhancement`、`breaking-change` は組み合わせて付くことがある。`depth`・`route` などのラベルと併せて 1 回の作成リクエストで付け、宣言が無いとき(`issue:lint` の `labels: none`)は分類ラベルを付けない。Issue が `enhancement` と `breaking-change` の両方を持つとき、PR のリリース分類は `breaking-change` 一つにする。Issue の目的の分類と PR のリリース分類を区別する
78
78
  - **`## 発火点`** には、その規則が破れる瞬間に最初に呼ばれるツールコール名を 1 つ書く。名前は `prompts/collaboration-workflow/rule-delivery.md` の配送表に載る、フックで配送可能なツール(`Bash` / `Edit` / `Read` / `Write` / `AskUserQuestion`)と突き合わせる。**表に無い名前**(そもそもツールコール名でない)と**不一致**(既知のツールだが配送できない)は区別して印字され、joshuafolkken/kit#2201 の「規則は正しいが名指ししたコールが実際に破れるコールの 1 つ後ろ」を起票時に検出する
79
- - **`## ベースライン`** は **「コマンド + 値」** で書く。``- `<測定コマンド>` → <現在の値>`` の形に限り、自然文だけの測定説明は受け付けない(再実行できないため)。マージ後に `pnpm josh measure:rerun` が同じコマンドをやり直し、**before / after の対**を印字する。値が動かなかったとき、反証された前提として `docs/maintainers/observations/` の、その時点のブランチが指す Issue のファイルに 1 行追記される(既存の append-only 台帳を使い、別の台帳は作らない)
79
+ - **`## ベースライン`** は **「コマンド + 値」** で書く。``- `<測定コマンド>` → <現在の値>`` の形に限り、自然文だけの測定説明は受け付けない(再実行できないため)。マージ後に `pnpm josh measure:rerun <N>` が同じコマンドをやり直し(本文は shell として実行されるため、作者が `OWNER` / `MEMBER` / `COLLABORATOR` の Issue に限る)、**before / after の対**を印字する。値が動かなかったとき、反証された前提として `docs/maintainers/observations/` の、その時点のブランチが指す Issue のファイルに 1 行追記される(既存の append-only 台帳を使い、別の台帳は作らない)
80
80
  - **`## 再現`** は **「コマンド + 実際の出力」** で書く。コマンドを backtick、出力をフェンス(``` または ~~~)で囲む。自然文の「確認した」は再実行できないため受け付けない(`## ベースライン` と同じ理由)。読みだけの起票を起票時に弾くためである
81
81
  - **検査は `pnpm josh issue:lint <path>` が行う。** 対象判定・3 見出しの有無・発火点の配送可否・ベースラインが「コマンド + 値」か・再現が「コマンド + 実際の出力」かと、起票時に必要な分類ラベルを、起票前の本文ファイルからまとめて答える(`pnpm josh issue:file` は起票前に同じ検査を行い、問題があれば起票しない)
82
82
 
@@ -27,11 +27,11 @@
27
27
 
28
28
  PR マージ・ブランチ削除・force push・共有ブランチへの push・外部通知の追加送信・リポジトリ設定の変更など、**共有状態に影響する操作はその場でユーザーに明示指示されたものだけ実行する**。
29
29
 
30
- - `fullrun` の auto-merge は `fullrun` の指示自体に含まれるため許可される(本文は [`followup.md`](../../.claude/skills/workflow-commands/followup.md))。それ以外の状況で勝手にマージしてはならない
30
+ - `fullrun` と `backlogrun` の auto-merge は、それぞれの指示自体に含まれるため許可される(本文は [`followup.md`](../../.claude/skills/workflow-commands/followup.md)、`backlogrun` の子への継承は [`backlogrun-child.md`](../../.claude/skills/workflow-commands/backlogrun-child.md))。`prrun` はマージを認可しない。それ以外の状況で勝手にマージしてはならない
31
31
  - `kickoff` / `pnpm josh followup` 単独実行は文書化されたスコープで終了する。PR が OPEN のまま完了したら状態を報告して停止する
32
32
  - 「チェックが全部 green だから次のステップに進む」は承認ではない
33
- - **`gh pr merge` の直接実行は kit 配布の `.claude/settings.json` の `deny`(`Bash(gh pr merge*)`)で機械的に遮断されている。** `fullrun` の auto-merge は `pnpm josh followup` が node スクリプト内部から gh を起動するため影響を受けない — Bash マッチャに見えるのは `pnpm josh …` だけである。**ただし deny は実装であって規則ではない** — パターンが取りこぼす綴りを禁じているのは本節の規則のほうである
34
- - **同じ規則が禁じる force push とブランチ削除も deny に載っている**(joshuafolkken/kit#1062)。`Bash(git push *--force*)` / `Bash(git push * -f)` はフラグを引数の後ろに書いた綴りを、`Bash(git push *--delete*)` / `Bash(git branch -d*)` / `Bash(git branch -D*)` / `Bash(gh api *DELETE*git/refs/heads/*)` はブランチ削除を止める。**deny は規則より狭いが、その差は配送ガードが埋めている** — `git -C` を前置した綴り、短縮フラグをまとめた綴り(`git push -uf`)、`:` をリテラルにできず glob が照合できない `git push origin :branch` は、いずれも `pnpm josh rule:guard` の `git-force` 行が argv を解析して拒否する(joshuafolkken/kit#2120)。**「マージ経路は deny が保証している」とは読まないこと**
33
+ - **`gh pr merge` の直接実行は kit 配布の `.claude/settings.json` の `permissions.deny` で機械的に遮断されている。** パターンの一覧はそのファイルが一次情報であり、ここでは書き写さない。 `fullrun` の auto-merge は `pnpm josh followup` が node スクリプト内部から gh を起動するため影響を受けない — Bash マッチャに見えるのは `pnpm josh …` だけである。**ただし deny は実装であって規則ではない** — パターンが取りこぼす綴りを禁じているのは本節の規則のほうである
34
+ - **同じ規則が禁じる force push とブランチ削除も deny に載っている**(joshuafolkken/kit#1062)。**deny は規則より狭いが、その差は配送ガードが埋めている** — `git -C` を前置した綴り、短縮フラグをまとめた綴り(`git push -uf`)、`:` をリテラルにできず glob が照合できない `git push origin :branch` は、いずれも `pnpm josh rule:guard` の `git-force` 行が argv を解析して拒否する(joshuafolkken/kit#2120)。**「マージ経路は deny が保証している」とは読まないこと**
35
35
  - **共有状態に影響する操作(このセクションの対象=Tier C)は迷ったら確認する。** 確認のコストは低いが、意図しない操作の巻き戻しは高コスト
36
36
  - ただしこの「迷ったら確認」は Tier C に限る。**可逆な実装・設計判断(Tier A)は別ルール**(下記「意思決定の自律ポリシー」)に従う
37
37
 
@@ -51,8 +51,8 @@ PR マージ・ブランチ削除・force push・共有ブランチへの push
51
51
  - **レーンの中で競合を解決したあとの「解決済み」の記録は、ケース 2 に含まれる(Tier A)。** レーンは run 専用の作業ツリーで、守るべき利用者の staging はない。利用者に `git add` の許可を求めず、`pnpm josh git -y` で記録する。手順は `.claude/skills/workflow-commands/chain-rule.md` →「origin/main is merged in before the gate」の 1 か所にだけ書く(joshuafolkken/kit#2445)
52
52
  - 同じ理由で、`git reset` / `git checkout -- <path>` / `git restore <path>` など index や作業ツリーを破壊的に書き換える操作も、自分の判断で実行しない
53
53
  - **`git stash` は例外的に、明文化されたフローの中でのみ自動実行してよい**: `fullrun new` / `halfrun new` の手順 5(作業ツリーに変更がある状態で `josh latest` を回す前の退避)、`backlogrun` のラン開始時の `josh latest`、「別パッケージ起因の問題は割り込み Issue で対応する」、および `backlogrun` が epic の子を始める前の preflight(`pnpm josh run:hold <N>` が `reclaim` と答えたときの回収 — joshuafolkken/kit#926, joshuafolkken/kit#1965)。**この 5 番目だけが復元を伴わない。前の 4 つはいずれも直後に `pnpm josh stash:pop "<メッセージ>"` で復元することが手順に含まれている**(stash はリポジトリ単位の 1 本のスタックを全 work tree が共有するため、位置指定や引数なしの `git stash pop` は別のレーンが最後に積んだ stash を取り込む — メッセージで対象を特定する。joshuafolkken/kit#2050)。 回収するのは異常終了したランの置き土産であって、いま実行中のランの作業ではないから、pop して戻す先がない。**代わりに stash を子の Issue にコメントで記録する** — 前提 Issue で中断するときの stash(`SKILL.md` §2d)と同じく、**その記録だけが後で pop させられる唯一の手がかり**であり、記録し忘れた stash は誰にも拾われない。これら以外の場面で退避したくなったときは、実行せずに先に確認する
54
- - **この禁止は kit 配布の `.claude/settings.json` の `deny`(`Bash(git add*)` / `Bash(git stage*)` / `Bash(git rm*)` / `Bash(git mv*)` / `Bash(git reset*)` / `Bash(git restore --staged*)` / `Bash(git restore -S*)` / `Bash(git commit*)`)で機械的にも遮断されている。** `pnpm josh git` は node スクリプト内部から git を起動するため影響を受けず、承認済みのコミットフロー(上記ケース 2)は従来どおり動く。**deny には「そのターンでユーザーが明示指示した」という例外がないため、上記ケース 1 も AI 側では実行できない** — その場合はユーザー自身の端末で実行してもらう。**ユーザーが明示的にコミットを指示した場合も同じで**、承認済みのコミットは `pnpm josh git` を通す(`git commit` まで deny に入れた理由は `docs/maintainers/operating-rules-rationale.md` → "Why the index is the user's")
55
- - **「拒否される操作」と「禁止された操作」は同じ集合ではない。** deny に載っているのは上記の直接実行だけだが、このセクションが同じく禁じている `git checkout -- <path>` / `git restore <path>` / 認可外の `git stash`(bare・メッセージ無し push・位置指定 pop など。メッセージ付き `git stash push -m` と `pnpm josh stash:pop` は認可済みなので通る)は、`pnpm josh rule:guard` の `worktree-mutation` 行が拒否する(joshuafolkken/kit#2120)。**ツールが通したことを許可と読み替えてはならない** — 何をしてよいかを決めるのは deny でも配送ガードでもなくこのルールである(フックは Claude Code にしか届かない)
54
+ - **この禁止は kit 配布の `.claude/settings.json` の `permissions.deny`(staging・index の書き換え・`git commit` の直接実行)で機械的にも遮断されている。** `pnpm josh git` は node スクリプト内部から git を起動するため影響を受けず、承認済みのコミットフロー(上記ケース 2)は従来どおり動く。**deny には「そのターンでユーザーが明示指示した」という例外がないため、上記ケース 1 も AI 側では実行できない** — その場合はユーザー自身の端末で実行してもらう。**ユーザーが明示的にコミットを指示した場合も同じで**、承認済みのコミットは `pnpm josh git` を通す(`git commit` まで deny に入れた理由は `docs/maintainers/operating-rules-rationale.md` → "Why the index is the user's")
55
+ - **「拒否される操作」と「禁止された操作」は同じ集合ではない。** deny に載っているのは上記の直接実行だけだが、このセクションが同じく禁じている `git checkout -- <path>` / `git restore <path>` / 認可外の `git stash`(bare・メッセージ無し push・位置指定 pop など。メッセージ付き `git stash push -m` と `pnpm josh stash:pop` は認可済みなので通る)は、`pnpm josh rule:guard` の `worktree-mutation` 行が拒否する(joshuafolkken/kit#2120)。同じ配送ガードは、`index-mutation` 行(`git add` / `commit` / `reset` / `rm` / `mv` / `restore --staged`)、`worktree-mutation` 行の強制 `git clean -f`、`destructive-command` 行(`rm -rf`・`gh repo delete` / `archive`・`gh pr close`・`gh api -X DELETE`。Issue ラベルの削除だけは除く)、`protected-file` 行(`.env` の読み取りと kit 以外での `.claude/settings.json` の編集)も拒否する(joshuafolkken/kit#2983)。これらは事故防止のためであり、回避を防ぐ境界ではない。**ツールが通したことを許可と読み替えてはならない** — 何をしてよいかを決めるのは deny でも配送ガードでもなくこのルールである(フックは Claude Code にしか届かない)
56
56
 
57
57
  ### 意思決定の自律ポリシー(確認停止を減らす)
58
58
 
@@ -19,7 +19,7 @@
19
19
 
20
20
  `kickoff` / `fullrun` / `halfrun` / `backlogrun` の**操作手順**は、常時ロードされる `CLAUDE.md` からは外され、`.claude/skills/workflow-commands/` に置かれている(joshuafolkken/kit#854)。`CLAUDE.md` に残るのはキーワードとスキルへの導線、およびスキルが読み込まれていない状態でも効く必要のある規則だけである。依存更新後の overrides / `devEngines` 検証手順も同様に `.claude/skills/dependency-update/` へ移した。**どの規則が「残す」側かは →「常駐ドキュメントと skill の分担(何を常駐に残すか)」が判定基準と全 4 件を定義する。**
21
21
 
22
- このドキュメントは引き続き**正典の詳細版**であり、スキルは操作手順である。両者は一致していなければならないので、片方だけを更新してはならない。
22
+ 規則の本文は話題ファイルか skill のどちらか 1 か所にだけ置き(どちらに置くかは →「常駐ドキュメントと skill の分担」)、規則が使う数字はコードの定数と、それを述べる 1 文書にだけ置く。**他の文書はその置き場所を指すだけで言い直さない** — 同じ内容を 2 か所に書くと、片方を変えた瞬間にもう片方が古くなる(joshuafolkken/kit#2996)。
23
23
 
24
24
  ### 出力の言語(`JOSH_SESSION_LANG`)
25
25
 
@@ -33,3 +33,15 @@
33
33
  3. **スクリプトが出力する固定文字列**: Telegram のヘッダーラベル(`Planning` / `Completion` など)、`Issue:` / `PR:` の URL ラベル、`--notify-message` 省略時の既定メッセージ。AI が書く文面ではなく、翻訳の仕組みも持たない。
34
34
 
35
35
  `JOSH_SESSION_LANG` は **開発者個人の設定**であり、`.env`(gitignore 済み・非コミット)に置く。リポジトリ共有の設定ではないため、consumer ごと・開発者ごとに自由に変えてよい。`josh sync` で上書きされることもない。**解決値は毎ターン、`UserPromptSubmit` フック(`pnpm josh session:lang`)が 1 度だけコンテキストへ差し込む**ので、エージェントが `.env` を読まなくても言語を取り違えない(最初のターンで二重解決していたため `SessionStart` からは外した)。フック出力を表示しないハーネス(Codex / Gemini / Cursor)は従来どおり `.env` を読んで解決する。この変数がスクリプトの挙動を変えることはなく(`session:lang` が解決値を表示のために読むだけ)、制御するのは AI が書く文面の言語だけである。
36
+
37
+ ### 配布ドキュメントの層ごとの言語(joshuafolkken/kit#2997)
38
+
39
+ `JOSH_SESSION_LANG` が決めるのはセッションと成果物の散文であり、配布ドキュメントそのものの言語ではない。ドキュメントは**層ごとに 1 つの言語**で書き、1 つの層の中で言語を混ぜない。
40
+
41
+ | 層 | 言語 |
42
+ | --------------------------------------------------------------------------------------- | ------ |
43
+ | `CLAUDE.md`、`AGENTS.md` / `GEMINI.md`、スキル(`.claude/skills/`)、フックが差し込む文 | 英語 |
44
+ | `prompts/` のトピックファイル(次の行の 3 文書を除く) | 日本語 |
45
+ | `prompts/review.md`、`prompts/review-rubric.md`、`prompts/sonar-hotspot-handling.md` | 英語 |
46
+
47
+ 英語の層から日本語のトピックファイルの節を指すポインターは、その**見出しを原文のまま**引く(例: `principles.md` → 「クローン禁止」)。見出しは `pnpm josh doc:section` が節を引くキーであり、訳すと解決しなくなるため、これは言語の混在ではない。
@@ -72,3 +72,12 @@
72
72
  - **導線文書に規則を書き戻さない。** そこに書かれた規則は、次の改訂で更新し忘れる 4 つ目の置き場になる
73
73
  - `scripts/document/ai-document-pointers.test.ts` が機械的に守る。導線文書に規則本体が再出現した場合、導線の一文が消えた場合、`CLAUDE.md` が単一ソースであることの記述が消えた場合に落ちる
74
74
  - 経緯は `docs/maintainers/principles-rationale.md` → "Why AGENTS and GEMINI are pointers"、`@CLAUDE.md` 行と他ツールでの未検証は `docs/maintainers/principles-rationale.md` → "The include line, and what has not been verified"
75
+
76
+ ### Claude Code 以外のエージェントでの読み替え
77
+
78
+ `CLAUDE.md` は Claude Code 向けに書かれており、その機能を名指しする。Codex・Gemini CLI など別のエージェントは次のように読み替える。導線文書が持つのはツール固有の 1 行だけで、共通の読み替えはこの節にしか無い(joshuafolkken/kit#3079)。
79
+
80
+ - **フック**: フックが走らない、または出力が見えないツールでは、フックが届ける規則を自分で適用する。その一覧は手書きせず、[`rule-delivery.md`](./rule-delivery.md) →「配送されている規則」の表を正とする — 表の各行が、そのツールでは自分で守る規則である。表の外でフックが担う 3 つも同じく自分で行う — 最初の実行時コード編集の前に Step 0 の作業サマリを提示する、編集ごとの整形フックに頼らず編集後に `pnpm josh lint:related` と `pnpm josh cspell:dot` を走らせる、`JOSH_SESSION_LANG` は注入を待たずに `.env` から解決する。フックの全体は `.claude/settings.json` の `hooks` が正である
81
+ - **Skill・`/verify-ui`・`/code-review`**: `CLAUDE.md` が skill のロードやサブエージェントでの実行を指示する箇所では、その skill の `SKILL.md` を読み、自分のセッションで従う
82
+ - **`.claude/settings.json` の deny list** は効かない。それが裏付ける規則 — 指示なしのコミット・マージ・ステージングその他の共有状態変更をしない — はそのまま拘束する
83
+ - **`AskUserQuestion`** は、ユーザーに平文で尋ねることを指す