@joshuafolkken/kit 1.1005.0 → 1.1035.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 (272) hide show
  1. package/.claude/settings.json +1 -5
  2. package/.claude/skills/dependency-update/SKILL.md +6 -3
  3. package/.claude/skills/epic-commands/SKILL.md +46 -17
  4. package/.claude/skills/workflow-commands/SKILL.md +8 -23
  5. package/.claude/skills/workflow-commands/backlogrun-child.md +4 -2
  6. package/.claude/skills/workflow-commands/backlogrun.md +3 -12
  7. package/.claude/skills/workflow-commands/fullrun-steps.md +4 -3
  8. package/.claude/skills/workflow-commands/fullrun.md +1 -1
  9. package/.claude/skills/workflow-commands/halfrun.md +2 -1
  10. package/.claude/skills/workflow-commands/into-target.md +1 -1
  11. package/.claude/skills/workflow-commands/observation-filing.md +42 -43
  12. package/.claude/skills/workflow-commands/prerequisite.md +1 -1
  13. package/.codex/hooks.json +1 -5
  14. package/.github/workflows/sonar-qube.yml +1 -1
  15. package/AGENTS.md +4 -25
  16. package/CLAUDE.md +24 -38
  17. package/GEMINI.md +4 -24
  18. package/README.md +22 -58
  19. package/dist/CLAUDE.md +24 -38
  20. package/dist/hooks/batch-guard.js +4 -4
  21. package/dist/hooks/{chunk-WMIR5SNX.js → chunk-D67KVGGY.js} +3 -3
  22. package/dist/hooks/{chunk-EZLHXKJ6.js → chunk-EIFCAJRB.js} +70 -27
  23. package/dist/hooks/{chunk-KPZN42RT.js → chunk-GJT4BNVE.js} +3 -3
  24. package/dist/hooks/{chunk-PAXMLGSS.js → chunk-GLBDBJOK.js} +44 -24
  25. package/dist/hooks/{chunk-GBJUERYK.js → chunk-HOYJU5RM.js} +1 -1
  26. package/dist/hooks/{chunk-6PSTVOLH.js → chunk-HU66PWWL.js} +33 -57
  27. package/dist/hooks/{chunk-A2H5I2VD.js → chunk-KG6PZD72.js} +2 -2
  28. package/dist/hooks/{chunk-AWTFKKFW.js → chunk-XPLP27WA.js} +3 -8
  29. package/dist/hooks/{chunk-4GDR2YTV.js → chunk-Y27M6A7X.js} +4 -4
  30. package/dist/hooks/{chunk-56LGMJJV.js → chunk-ZXNE6NY3.js} +2 -2
  31. package/dist/hooks/codex-hook-adapter.js +10 -10
  32. package/dist/hooks/duplicate-read-guard.js +5 -5
  33. package/dist/hooks/format-edited.js +2 -2
  34. package/dist/hooks/investigation-guard.js +5 -5
  35. package/dist/hooks/pretool-guard.js +9 -9
  36. package/dist/hooks/stop-guard.js +11 -15
  37. package/dist/josh.js +38 -19
  38. package/dist/version/index.js +93 -41
  39. package/eslint/base.js +2 -11
  40. package/package.json +32 -6
  41. package/prompts/coding-standards.md +15 -290
  42. package/prompts/collaboration-workflow/cross-repo-epic.md +2 -51
  43. package/prompts/collaboration-workflow/epic-audit.md +2 -53
  44. package/prompts/collaboration-workflow/epic-bundle.md +2 -106
  45. package/prompts/collaboration-workflow/issue-template.md +4 -4
  46. package/prompts/collaboration-workflow/operating-rules.md +18 -75
  47. package/prompts/collaboration-workflow/principles.md +74 -0
  48. package/prompts/collaboration-workflow/residency.md +54 -14
  49. package/prompts/collaboration-workflow/rule-delivery.md +1 -11
  50. package/prompts/collaboration-workflow/upstream-interrupt.md +1 -1
  51. package/prompts/collaboration-workflow.md +22 -28
  52. package/scripts/adopt/adopt-logic.ts +2 -2
  53. package/scripts/adopt/adopt-toolkits.ts +1 -1
  54. package/scripts/adopt/adopt.ts +2 -2
  55. package/scripts/agent/agent-event.ts +2 -9
  56. package/scripts/agent/agent-exit-record.ts +2 -9
  57. package/scripts/backlog/backlog-budget-cli.ts +2 -6
  58. package/scripts/backlog/backlog-drive-cli.ts +20 -10
  59. package/scripts/backlog/backlog-drive.ts +50 -16
  60. package/scripts/backlog/backlog-offer-cli.ts +6 -5
  61. package/scripts/backlog/backlog-plan.ts +1 -1
  62. package/scripts/build/build-bin.ts +2 -1
  63. package/scripts/build/build-config-merge.ts +2 -1
  64. package/scripts/build/build-hooks.ts +24 -4
  65. package/scripts/build/build-managed-marker.ts +2 -1
  66. package/scripts/build/build-self-sync-guard.ts +2 -1
  67. package/scripts/build/build-version.ts +2 -1
  68. package/scripts/cases/cases-logic.ts +2 -6
  69. package/scripts/ci/pr-classification.ts +13 -11
  70. package/scripts/cost-runtime/cost-transcript.ts +4 -11
  71. package/scripts/doctor/doctor-consumer.ts +5 -12
  72. package/scripts/doctor/doctor-ports.ts +2 -2
  73. package/scripts/document/document-byte-budget.ts +8 -16
  74. package/scripts/document/document-section.ts +2 -6
  75. package/scripts/document/entry-read-budget.ts +1 -1
  76. package/scripts/{git/git-epic-add-body.ts → epic/epic-add-body.ts} +23 -23
  77. package/scripts/{git/git-epic-add-plan.ts → epic/epic-add-plan.ts} +23 -26
  78. package/scripts/{git/git-epic-add.ts → epic/epic-add.ts} +17 -17
  79. package/scripts/epic/epic-audit-cli.ts +4 -4
  80. package/scripts/epic/epic-audit-orphans.ts +2 -2
  81. package/scripts/epic/epic-audit-rationale.ts +1 -1
  82. package/scripts/epic/epic-audit.ts +1 -1
  83. package/scripts/{git/git-epic-body.ts → epic/epic-body.ts} +6 -6
  84. package/scripts/epic/epic-bundle-cli.ts +1 -1
  85. package/scripts/epic/epic-bundle.ts +2 -2
  86. package/scripts/epic/epic-candidate-confirm.ts +2 -1
  87. package/scripts/{git/git-epic-chains.ts → epic/epic-chains.ts} +4 -4
  88. package/{scripts-ai → scripts/epic}/epic-check.ts +5 -4
  89. package/{scripts-ai → scripts/epic}/epic-cli.ts +4 -4
  90. package/scripts/{git/git-epic-close-comment.ts → epic/epic-close-comment.ts} +9 -9
  91. package/scripts/{git/git-epic-close.ts → epic/epic-close.ts} +23 -19
  92. package/scripts/epic/epic-cross-repo.ts +21 -38
  93. package/scripts/{git/git-epic-decision.ts → epic/epic-decision.ts} +12 -14
  94. package/scripts/epic/epic-fetch.ts +3 -3
  95. package/scripts/epic/epic-graph.ts +3 -3
  96. package/scripts/epic/epic-index.ts +2 -2
  97. package/scripts/epic/epic-issue.ts +1 -1
  98. package/scripts/epic/epic-next.ts +3 -3
  99. package/scripts/{git/git-epic-parse.ts → epic/epic-parse.ts} +3 -3
  100. package/scripts/{git/git-epic-promote.ts → epic/epic-promote.ts} +10 -10
  101. package/scripts/{git/git-epic-read.ts → epic/epic-read.ts} +9 -9
  102. package/scripts/{git/git-epic-reconcile.ts → epic/epic-reconcile.ts} +18 -20
  103. package/scripts/{git/git-epic-reference.ts → epic/epic-reference.ts} +4 -23
  104. package/scripts/epic/epic-relation-recheck.ts +4 -3
  105. package/scripts/{git/git-epic-relations.ts → epic/epic-relations.ts} +5 -5
  106. package/scripts/{git/git-epic-remove-plan.ts → epic/epic-remove-plan.ts} +17 -19
  107. package/scripts/{git/git-epic-remove.ts → epic/epic-remove.ts} +13 -13
  108. package/scripts/{git/git-epic-run.ts → epic/epic-run.ts} +27 -27
  109. package/scripts/{git/git-epic-sections.ts → epic/epic-sections.ts} +6 -6
  110. package/scripts/{git/git-epic-shape.ts → epic/epic-shape.ts} +7 -7
  111. package/scripts/{git/git-epic-validate.ts → epic/epic-validate.ts} +13 -13
  112. package/{scripts-ai → scripts/epic}/epic.ts +17 -16
  113. package/scripts/gh/fix-gh-packages.ts +2 -1
  114. package/scripts/gh/gh-spawn.ts +12 -10
  115. package/scripts/git/constants.ts +1 -1
  116. package/scripts/git/git-branch.ts +10 -1
  117. package/scripts/git/git-command.ts +1 -1
  118. package/scripts/git/git-error.ts +2 -5
  119. package/{scripts-ai → scripts/git}/git-followup-finish.ts +7 -7
  120. package/scripts/git/git-followup-flush.ts +74 -48
  121. package/scripts/git/git-followup-issue-close.ts +2 -2
  122. package/scripts/git/git-followup-label.ts +1 -1
  123. package/scripts/git/git-followup-pending.ts +1 -1
  124. package/{scripts-ai → scripts/git}/git-followup-workflow.ts +23 -11
  125. package/scripts/git/git-gh-exec.ts +85 -26
  126. package/scripts/git/git-gh-issue-read.ts +2 -2
  127. package/scripts/git/git-gh-issue-rest.ts +2 -2
  128. package/scripts/git/git-gh-issue-write.ts +6 -6
  129. package/scripts/git/git-gh-pr-read.ts +0 -21
  130. package/scripts/git/git-gh-pr.ts +2 -23
  131. package/scripts/git/git-pr-followup-wrapup.ts +2 -6
  132. package/scripts/git/git-preflight.ts +3 -6
  133. package/scripts/git/git-staging.ts +21 -9
  134. package/{scripts-ai → scripts/git}/git-workflow.ts +11 -11
  135. package/scripts/git/github-issue-url.ts +1 -1
  136. package/scripts/git/issue-labels.ts +1 -1
  137. package/scripts/git/issue-reference.ts +19 -0
  138. package/scripts/git/main-merge.ts +2 -1
  139. package/scripts/git/main-sync.ts +3 -2
  140. package/scripts/git/schemas.ts +1 -1
  141. package/scripts/git/stash-pop-args.ts +7 -13
  142. package/scripts/git/stash-pop-cli.ts +2 -1
  143. package/{scripts-ai → scripts/git}/telegram-test-logic.ts +2 -2
  144. package/{scripts-ai → scripts/git}/telegram-test.ts +7 -7
  145. package/scripts/hooks/format-rewrite-notice.ts +2 -8
  146. package/scripts/init/init-ai-copy.ts +23 -14
  147. package/scripts/init/init.ts +8 -4
  148. package/scripts/init/start-steps.ts +2 -1
  149. package/scripts/init/start.ts +2 -1
  150. package/scripts/issue/issue-comment-cli.ts +2 -1
  151. package/scripts/issue/issue-file-cli.ts +2 -1
  152. package/scripts/issue/issue-fold-cli.ts +9 -16
  153. package/scripts/issue/issue-scout-cli.ts +8 -13
  154. package/scripts/issue/measure-rerun-cli.ts +7 -6
  155. package/scripts/josh/josh-commands-ai.ts +2 -2
  156. package/scripts/josh/josh-commands-backlog.ts +1 -1
  157. package/scripts/josh/josh-commands-development.ts +1 -1
  158. package/scripts/josh/josh-commands-workflow.ts +4 -4
  159. package/scripts/lane/lane-cli.ts +2 -1
  160. package/scripts/lane/lane-open.ts +3 -2
  161. package/scripts/lane/lane-registry.ts +3 -6
  162. package/scripts/lib/cli-flags.ts +20 -2
  163. package/scripts/lib/error-message.ts +9 -0
  164. package/scripts/lib/read-file.ts +26 -2
  165. package/scripts/observations/observation-ledger-home.ts +98 -26
  166. package/scripts/observations/observation-ledger-migrate.ts +26 -21
  167. package/scripts/observations/observation-ledger-prepare.ts +10 -20
  168. package/scripts/observations/observation-ledger.ts +58 -25
  169. package/scripts/observations/observations-flush-cli.ts +6 -23
  170. package/scripts/observations/observations-flush-landing.ts +2 -1
  171. package/scripts/observations/observations-flush.ts +29 -20
  172. package/scripts/package/package-scout-cli.ts +8 -16
  173. package/scripts/ports/port-command.ts +2 -1
  174. package/scripts/propagate/propagate-publish.ts +6 -7
  175. package/scripts/propagate/propagate-steps.ts +2 -1
  176. package/scripts/propagate/propagate.ts +3 -2
  177. package/scripts/refactor/import-graph.ts +2 -6
  178. package/scripts/registry-migration/migrate.ts +3 -2
  179. package/scripts/registry-migration/user-npmrc.ts +2 -2
  180. package/scripts/release/release-cli.ts +2 -1
  181. package/scripts/repo/repo-setting.ts +10 -8
  182. package/scripts/review/review-finding-ledger.ts +3 -3
  183. package/scripts/review/review-findings-cli.ts +4 -11
  184. package/scripts/review/review-record-cli.ts +14 -11
  185. package/scripts/review/review-record.ts +6 -16
  186. package/scripts/rules/decision-oracle.ts +2 -2
  187. package/scripts/rules/rule-body-guard.ts +2 -2
  188. package/scripts/rules/rule-value-cache.ts +99 -0
  189. package/scripts/rules/rule-value-cli.ts +10 -9
  190. package/scripts/rules/rule-value.ts +1 -1
  191. package/scripts/run/run-carry-args.ts +2 -6
  192. package/scripts/run/run-carry-cli.ts +5 -7
  193. package/scripts/run/run-cut-args.ts +7 -13
  194. package/scripts/run/run-ending-cli.ts +4 -7
  195. package/scripts/run/run-event-stream.ts +2 -5
  196. package/scripts/run/run-liveness-cli.ts +4 -7
  197. package/scripts/run/run-progress-args.ts +2 -6
  198. package/scripts/run/run-progress-cli.ts +2 -1
  199. package/scripts/run/run-tail-cli.ts +3 -3
  200. package/scripts/run/run-tidy-stashes.ts +7 -14
  201. package/scripts/run/run-wake-cli.ts +2 -6
  202. package/scripts/run/run-wake-driver.ts +15 -2
  203. package/scripts/run/run-wake-session.ts +14 -4
  204. package/scripts/safe-chain/project-config.ts +3 -6
  205. package/scripts/security/security-audit-provision.ts +6 -7
  206. package/scripts/sonar/sonar-hotspots-cli.ts +2 -1
  207. package/scripts/sync/directory-copy-guard.ts +2 -1
  208. package/scripts/sync/sync-ai-files.ts +3 -3
  209. package/scripts/sync/template-source-logic.ts +3 -4
  210. package/scripts/test/e2e-retry-check.ts +3 -6
  211. package/scripts/ui/ui-routes-cli.ts +3 -6
  212. package/scripts/version/bump-version.ts +2 -1
  213. package/scripts/version/version-remote.ts +18 -27
  214. package/scripts/version/version-targets.ts +3 -3
  215. package/.claude/skills/workflow-commands/rule-residency.md +0 -267
  216. package/evals/scenarios/consult-not-execute.json +0 -20
  217. package/evals/scenarios/no-implicit-workflow.json +0 -26
  218. package/evals/scenarios/overrides-both-locations.json +0 -29
  219. package/evals/scenarios/upstream-interrupt.json +0 -23
  220. package/evals/scenarios/workflow-skill-loaded.json +0 -16
  221. package/prompts/agent-lint-protocol.json +0 -79
  222. package/prompts/agent-rules.md +0 -63
  223. package/prompts/collaboration-workflow/consultation-vs-execution.md +0 -8
  224. package/prompts/collaboration-workflow/distributed-docs.md +0 -7
  225. package/prompts/collaboration-workflow/durable-rules.md +0 -24
  226. package/prompts/collaboration-workflow/latest-first.md +0 -14
  227. package/prompts/collaboration-workflow/no-clones.md +0 -11
  228. package/prompts/collaboration-workflow/simplicity-first.md +0 -9
  229. package/prompts/collaboration-workflow/single-source-rules.md +0 -13
  230. package/scripts/build/shim-shell.ts +0 -25
  231. package/scripts/claude/skill-meta.ts +0 -37
  232. package/scripts/document/document-scan.ts +0 -108
  233. package/scripts/document/generate-catalog.ts +0 -69
  234. package/scripts/document/retired-phrases.ts +0 -143
  235. package/scripts/document/review-agent-type.ts +0 -46
  236. package/scripts/document/single-source.ts +0 -73
  237. package/scripts/git/git-fixture-workspace.ts +0 -88
  238. package/scripts/hooks/format-edited-file-fixtures.ts +0 -109
  239. package/scripts/hooks/prompt-hooks.ts +0 -38
  240. package/scripts/init/hook-command-bootstrap.ts +0 -83
  241. package/scripts/issue/issue-logic.ts +0 -50
  242. package/scripts/josh/__snapshots__/josh-command-map.test.ts.snap +0 -1227
  243. package/scripts/josh/josh-script-reader.ts +0 -11
  244. package/scripts/package/production-dependency-graph.ts +0 -68
  245. package/scripts/retrospective/retrospective-cli.ts +0 -97
  246. package/scripts/retrospective/retrospective.ts +0 -127
  247. package/scripts/rules/delivered-rules-harness.ts +0 -72
  248. package/scripts/rules/top-level-scripts-guard.ts +0 -47
  249. package/scripts/run/run-carry-flush.ts +0 -58
  250. package/scripts/run/run-transcript.golden.txt +0 -57
  251. package/scripts/run/run-wake-work.ts +0 -108
  252. package/scripts/sync/dependabot-pin-logic.ts +0 -135
  253. package/scripts/test/classify-isolation.ts +0 -149
  254. package/scripts/test/http-fault-injection.ts +0 -79
  255. package/scripts/test/josh-harness-environment.ts +0 -260
  256. package/scripts/test/josh-harness.ts +0 -96
  257. package/scripts/test/pilot-files.ts +0 -452
  258. package/scripts/test/pilot-measure.ts +0 -78
  259. package/scripts/test/test-network-guard.ts +0 -453
  260. package/scripts/test/test-repository-guard.ts +0 -317
  261. package/scripts/test/test-state-guard.ts +0 -85
  262. package/scripts/test/test-stdout-guard.ts +0 -54
  263. package/scripts/test/test-telegram-guard.ts +0 -90
  264. package/scripts/test/unit-guard-environment.ts +0 -12
  265. package/scripts/test/unit-projects.ts +0 -139
  266. package/scripts/test/vitest-include-globs.ts +0 -12
  267. package/scripts/time-runtime/time-batch-guard-fixtures.ts +0 -66
  268. package/scripts-ai/completion-gate.ts +0 -13
  269. package/scripts-ai/environment-loader.ts +0 -9
  270. /package/{scripts-ai → scripts/epic}/epic-cli-argv.ts +0 -0
  271. /package/{scripts-ai → scripts/epic}/epic-cli-remove.ts +0 -0
  272. /package/{scripts-ai → scripts/git}/followup-issue-number.ts +0 -0
package/dist/josh.js CHANGED
@@ -1,9 +1,35 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // scripts/doctor/doctor-consumer.ts
4
- import { existsSync, readFileSync } from "node:fs";
4
+ import { existsSync } from "node:fs";
5
5
  import path from "node:path";
6
6
 
7
+ // scripts/lib/read-file.ts
8
+ import { readFileSync } from "node:fs";
9
+ var ABSENT_CODE = "ENOENT";
10
+ function is_absent(error) {
11
+ return error instanceof Error && "code" in error && error.code === ABSENT_CODE;
12
+ }
13
+ function read_optional(path5) {
14
+ try {
15
+ return readFileSync(path5, "utf8");
16
+ } catch (error) {
17
+ if (is_absent(error)) return void 0;
18
+ throw error;
19
+ }
20
+ }
21
+ function read_file_or_empty(path5) {
22
+ return read_optional(path5) ?? "";
23
+ }
24
+ function read_if_readable(path5) {
25
+ try {
26
+ return readFileSync(path5, "utf8");
27
+ } catch {
28
+ return void 0;
29
+ }
30
+ }
31
+ var file_reader = { read_optional, read_file_or_empty, read_if_readable };
32
+
7
33
  // scripts/lib/spawn-exit.ts
8
34
  var SPAWN_ERROR_EXIT_CODE = 2;
9
35
  var SIGNAL_KILL_EXIT_CODE = 1;
@@ -50,15 +76,8 @@ var settings_schema = z.object({
50
76
  var STATE_OK = "ok";
51
77
  var STATE_TARGET_MISSING = "target-missing";
52
78
  var STATE_MISSING = "missing";
53
- function read_optional(file_path) {
54
- try {
55
- return existsSync(file_path) ? readFileSync(file_path, "utf8") : void 0;
56
- } catch {
57
- return void 0;
58
- }
59
- }
60
79
  function parse_manifest(root) {
61
- const content = read_optional(path.join(root, "package.json"));
80
+ const content = file_reader.read_if_readable(path.join(root, "package.json"));
62
81
  if (content === void 0) return void 0;
63
82
  const parsed = manifest_schema.safeParse(safe_json_parse(content));
64
83
  return parsed.success ? parsed.data : void 0;
@@ -73,7 +92,7 @@ function is_kit_consumer(root) {
73
92
  return lists_kit_dependency(manifest) || existsSync(path.join(root, NODE_MODULES, KIT_PACKAGE_NAME));
74
93
  }
75
94
  function is_plugin_declared(root) {
76
- const content = read_optional(path.join(root, SETTINGS_PATH));
95
+ const content = file_reader.read_if_readable(path.join(root, SETTINGS_PATH));
77
96
  if (content === void 0) return false;
78
97
  const parsed = settings_schema.safeParse(safe_json_parse(content));
79
98
  return parsed.success && parsed.data.enabledPlugins?.[PLUGIN_ID] === true;
@@ -87,7 +106,7 @@ function configured_hooks_path(root) {
87
106
  return value === "" ? void 0 : value;
88
107
  }
89
108
  function claude_md_state(root) {
90
- const content = read_optional(path.join(root, CLAUDE_MD));
109
+ const content = file_reader.read_if_readable(path.join(root, CLAUDE_MD));
91
110
  if (content === void 0) return STATE_MISSING;
92
111
  if (!content.includes(CLAUDE_MD_POINTER)) return STATE_OK;
93
112
  return existsSync(path.join(root, NODE_MODULES, KIT_PACKAGE_NAME, "dist", CLAUDE_MD)) ? STATE_OK : STATE_TARGET_MISSING;
@@ -313,7 +332,7 @@ var BACKLOG_COMMANDS = {
313
332
  script: "scripts/backlog/backlog-offer-cli.ts",
314
333
  description: "Collapse a backlogrun loop-head event into one call: read backlog:next, ask backlog:budget, return the verdict and any issues to start",
315
334
  category: "AI tools",
316
- reference: ["[options]", "automation", ["network"]]
335
+ reference: ["[options]", "automation", ["files", "network", "processes"]]
317
336
  },
318
337
  "backlog:drive": {
319
338
  script: "scripts/backlog/backlog-drive-cli.ts",
@@ -550,7 +569,7 @@ var AI_COMMANDS = {
550
569
  reference: ["<message>", "automation", ["git"]]
551
570
  },
552
571
  epic: {
553
- script: "scripts-ai/epic.ts",
572
+ script: "scripts/epic/epic.ts",
554
573
  description: "Create an epic issue from its child issue numbers",
555
574
  category: "AI tools",
556
575
  reference: ["<title> <issue...> [--ordered]", "automation", ["network"]]
@@ -574,7 +593,7 @@ var AI_COMMANDS = {
574
593
  reference: ["<epic>", "automation", ["network"]]
575
594
  },
576
595
  "epic:check": {
577
- script: "scripts-ai/epic-check.ts",
596
+ script: "scripts/epic/epic-check.ts",
578
597
  description: "Check an epic issue against the tracking requirements",
579
598
  category: "AI tools",
580
599
  reference: ["<epic>", "automation", ["network"]]
@@ -901,7 +920,7 @@ var DEV_COMMANDS = {
901
920
  script: "scripts/rules/rule-value-cli.ts",
902
921
  description: "Print each delivered rule's unaided compliance \u2014 runs reached, kept rate, refusals",
903
922
  category: "AI tools",
904
- reference: ["", "developer", ["none"]]
923
+ reference: ["[--refresh]", "developer", ["files"]]
905
924
  },
906
925
  format: {
907
926
  script: "scripts/lint/format.ts",
@@ -1294,7 +1313,7 @@ var VERSIONING_COMMANDS = {
1294
1313
  };
1295
1314
 
1296
1315
  // scripts/josh/josh-commands-workflow.ts
1297
- var GIT_WORKFLOW_SCRIPT = "scripts-ai/git-workflow.ts";
1316
+ var GIT_WORKFLOW_SCRIPT = "scripts/git/git-workflow.ts";
1298
1317
  var GIT_MESSAGE_ARGUMENTS = "[-y] <message>";
1299
1318
  var WORKFLOW_COMMANDS = {
1300
1319
  git: {
@@ -1319,7 +1338,7 @@ var WORKFLOW_COMMANDS = {
1319
1338
  // session, and `followup` with them the merge step of every `fullrun` there. `doctor` was moved to
1320
1339
  // this form for the same reason in joshuafolkken/kit#869.
1321
1340
  //
1322
- // Nothing is lost by relaxing it: both scripts already call `load_optional_environment()`
1341
+ // Nothing is lost by relaxing it: both scripts already load `.env` through `josh_environment_file`
1323
1342
  // themselves, so the file is read either way and node's precedence — an existing environment
1324
1343
  // variable wins over the file — is node's own in both spellings.
1325
1344
  //
@@ -1327,7 +1346,7 @@ var WORKFLOW_COMMANDS = {
1327
1346
  // than dropped: `telegram_notify.send` now throws on missing credentials and on a failed send, so
1328
1347
  // `josh notify` exits non-zero instead of warning and answering 0.
1329
1348
  followup: {
1330
- script: "scripts-ai/git-followup-workflow.ts",
1349
+ script: "scripts/git/git-followup-workflow.ts",
1331
1350
  description: "Follow-up git workflow",
1332
1351
  category: "Workflow",
1333
1352
  reference: [
@@ -1338,7 +1357,7 @@ var WORKFLOW_COMMANDS = {
1338
1357
  tsx_arguments: OPTIONAL_ENV_FILE_FLAGS
1339
1358
  },
1340
1359
  notify: {
1341
- script: "scripts-ai/telegram-test.ts",
1360
+ script: "scripts/git/telegram-test.ts",
1342
1361
  description: "Send Telegram notification",
1343
1362
  category: "Workflow",
1344
1363
  reference: ["--task-type <type> --body <text>", "automation", ["notifications"]],
@@ -151,7 +151,7 @@ function resolve_effective_upstream_version(base_url, package_name, options = {}
151
151
  }
152
152
 
153
153
  // scripts/version/version-commands.ts
154
- import { execaSync as execaSync4 } from "execa";
154
+ import { execaSync as execaSync3 } from "execa";
155
155
 
156
156
  // scripts/version/release-age.ts
157
157
  import { readFileSync as readFileSync2 } from "node:fs";
@@ -557,6 +557,12 @@ var agent_session_environment = {
557
557
  removed_proxy_environment
558
558
  };
559
559
 
560
+ // scripts/lib/error-message.ts
561
+ function message_of(error) {
562
+ return error instanceof Error ? error.message : String(error);
563
+ }
564
+ var error_text = { message_of };
565
+
560
566
  // scripts/git/git-gh-exec.ts
561
567
  import { execa as execa2, execaSync } from "execa";
562
568
 
@@ -664,8 +670,12 @@ function direct_environment() {
664
670
  const removed = agent_session_environment.removed_proxy_environment();
665
671
  return Object.keys(removed).length > 0 ? { env: removed } : {};
666
672
  }
667
- function to_spawn_options(timeout_ms) {
668
- return { ...to_timeout_option(timeout_ms), ...direct_environment() };
673
+ function to_spawn_options(timeout_ms, cwd) {
674
+ return {
675
+ ...to_timeout_option(timeout_ms),
676
+ ...direct_environment(),
677
+ ...cwd !== void 0 && { cwd }
678
+ };
669
679
  }
670
680
  var GH_REQUEST_TIMEOUT_MESSAGE = "gh request timed out";
671
681
  function has_stderr_field(error) {
@@ -677,13 +687,10 @@ function has_stdout_field(error) {
677
687
  function to_timeout_prefix(error) {
678
688
  return has_timed_out(error) ? `${GH_REQUEST_TIMEOUT_MESSAGE}: ` : "";
679
689
  }
680
- function to_error_message(error) {
681
- return error instanceof Error ? error.message : String(error);
682
- }
683
690
  function to_gh_error(error) {
684
691
  const stderr = has_stderr_field(error) ? error.stderr.trim() : "";
685
692
  const stdout = has_stdout_field(error) ? error.stdout.trim() : "";
686
- const summary = stderr.length > 0 ? stderr : to_error_message(error);
693
+ const summary = stderr.length > 0 ? stderr : error_text.message_of(error);
687
694
  const detail = stdout.length > 0 ? `${summary}
688
695
  ${stdout}` : summary;
689
696
  return gh_failure.attach(
@@ -691,10 +698,11 @@ ${stdout}` : summary;
691
698
  gh_failure.classify_stdout(stdout)
692
699
  );
693
700
  }
694
- async function exec_gh_command(arguments_, timeout_ms) {
701
+ async function exec_gh_command(arguments_, timeout_ms, cwd) {
695
702
  await check_gh_installed();
703
+ const options = to_spawn_options(timeout_ms, cwd);
696
704
  try {
697
- const { stdout } = await execa2("gh", arguments_, to_spawn_options(timeout_ms));
705
+ const { stdout } = await execa2("gh", arguments_, options);
698
706
  return stdout.trimEnd();
699
707
  } catch (error) {
700
708
  throw to_gh_error(error);
@@ -702,7 +710,7 @@ async function exec_gh_command(arguments_, timeout_ms) {
702
710
  }
703
711
  async function exec_gh_command_with_stdin(input) {
704
712
  await check_gh_installed();
705
- const options = { input: input.stdin_body, ...to_spawn_options(input.timeout_ms) };
713
+ const options = { input: input.stdin_body, ...to_spawn_options(input.timeout_ms, input.cwd) };
706
714
  try {
707
715
  const { stdout } = await execa2("gh", input.args, options);
708
716
  return stdout.trimEnd();
@@ -715,6 +723,9 @@ function parse_status_line(output) {
715
723
  const { status } = STATUS_LINE_PATTERN.exec(output)?.groups ?? {};
716
724
  return status === void 0 ? void 0 : Number(status);
717
725
  }
726
+ function status_of_failure(error) {
727
+ return has_stdout_field(error) ? parse_status_line(error.stdout) : void 0;
728
+ }
718
729
  async function exec_gh_api_status(path5, timeout_ms) {
719
730
  const options = to_spawn_options(timeout_ms);
720
731
  try {
@@ -722,7 +733,16 @@ async function exec_gh_api_status(path5, timeout_ms) {
722
733
  const { stdout } = await execa2("gh", ["api", "--include", "--silent", path5], options);
723
734
  return parse_status_line(stdout);
724
735
  } catch (error) {
725
- return has_stdout_field(error) ? parse_status_line(error.stdout) : void 0;
736
+ return status_of_failure(error);
737
+ }
738
+ }
739
+ function exec_gh_api_status_sync(path5, timeout_ms) {
740
+ const options = to_spawn_options(timeout_ms);
741
+ try {
742
+ const { stdout } = execaSync("gh", ["api", "--include", "--silent", path5], options);
743
+ return parse_status_line(stdout);
744
+ } catch (error) {
745
+ return status_of_failure(error);
726
746
  }
727
747
  }
728
748
  var METHOD_FLAG = "--method";
@@ -749,16 +769,19 @@ function to_gh_api_args(request) {
749
769
  }
750
770
  async function exec_gh_api(request) {
751
771
  const args = to_gh_api_args(request);
752
- if (request.body === void 0) return await exec_gh_command(args, request.timeout_ms);
772
+ if (request.body === void 0) {
773
+ return await exec_gh_command(args, request.timeout_ms, request.cwd);
774
+ }
753
775
  return await exec_gh_command_with_stdin({
754
776
  args,
755
777
  stdin_body: request.body,
756
- timeout_ms: request.timeout_ms
778
+ timeout_ms: request.timeout_ms,
779
+ cwd: request.cwd
757
780
  });
758
781
  }
759
782
  function exec_gh_api_sync(request) {
760
783
  const body_option = request.body === void 0 ? {} : { input: request.body };
761
- const options = { ...body_option, ...to_spawn_options(request.timeout_ms) };
784
+ const options = { ...body_option, ...to_spawn_options(request.timeout_ms, request.cwd) };
762
785
  try {
763
786
  const { stdout } = execaSync("gh", to_gh_api_args(request), options);
764
787
  return stdout.trimEnd();
@@ -766,19 +789,26 @@ function exec_gh_api_sync(request) {
766
789
  throw to_gh_error(error);
767
790
  }
768
791
  }
792
+ function read_gh_api_sync(request) {
793
+ try {
794
+ return exec_gh_api_sync(request);
795
+ } catch {
796
+ return void 0;
797
+ }
798
+ }
769
799
  var git_gh_exec = {
770
800
  direct_environment,
771
801
  exec_gh_command,
772
802
  exec_gh_command_with_stdin,
773
803
  exec_gh_api,
774
804
  exec_gh_api_sync,
805
+ read_gh_api_sync,
775
806
  exec_gh_api_status,
807
+ exec_gh_api_status_sync,
776
808
  parse_status_line
777
809
  };
778
810
 
779
811
  // scripts/version/version-remote.ts
780
- import { execaSync as execaSync2 } from "execa";
781
- var GH_FAILURE_FALLBACK = "gh api failed";
782
812
  var TIMES_PAGE_SIZE = 100;
783
813
  var TIMES_JQ = "[.[] | {(.name): .created_at}] | add";
784
814
  function require_endpoint(versions_endpoint, package_name) {
@@ -787,21 +817,19 @@ function require_endpoint(versions_endpoint, package_name) {
787
817
  `Could not derive a versions endpoint for ${package_name}; check its version-command config.`
788
818
  );
789
819
  }
790
- function describe_failure(result) {
791
- const stderr = result.stderr.trim();
792
- if (stderr !== "") return stderr;
793
- return result.shortMessage ?? GH_FAILURE_FALLBACK;
794
- }
795
820
  function fetch_latest_version(versions_endpoint, package_name) {
796
821
  const endpoint = require_endpoint(versions_endpoint, package_name);
797
- const result = execaSync2("gh", ["api", endpoint, "--jq", ".[0].name"], {
798
- ...git_gh_exec.direct_environment(),
799
- reject: false
800
- });
801
- if (result.exitCode === 0) return result.stdout.trim();
802
- throw new Error(
803
- `Failed to fetch latest version for ${package_name} via ${endpoint}: ${describe_failure(result)}`
804
- );
822
+ try {
823
+ return git_gh_exec.exec_gh_api_sync({ path: endpoint, jq_filter: ".[0].name" }).trim();
824
+ } catch (error) {
825
+ const detail = error_text.message_of(error);
826
+ throw new Error(
827
+ `Failed to fetch latest version for ${package_name} via ${endpoint}: ${detail}`,
828
+ {
829
+ cause: error
830
+ }
831
+ );
832
+ }
805
833
  }
806
834
  function with_page_size(endpoint, page_size) {
807
835
  const separator = endpoint.indexOf("?");
@@ -813,19 +841,43 @@ function with_page_size(endpoint, page_size) {
813
841
  function fetch_release_times(versions_endpoint) {
814
842
  if (versions_endpoint === void 0 || versions_endpoint.trim() === "") return void 0;
815
843
  const endpoint = with_page_size(versions_endpoint, TIMES_PAGE_SIZE);
816
- const result = execaSync2("gh", ["api", endpoint, "--jq", TIMES_JQ], {
817
- ...git_gh_exec.direct_environment(),
818
- reject: false
819
- });
820
- if (result.exitCode !== 0) return void 0;
821
- const parsed = release_age.release_times_schema.safeParse(safe_json_parse(result.stdout));
844
+ const stdout = git_gh_exec.read_gh_api_sync({ path: endpoint, jq_filter: TIMES_JQ });
845
+ if (stdout === void 0) return void 0;
846
+ const parsed = release_age.release_times_schema.safeParse(safe_json_parse(stdout));
822
847
  return parsed.success ? parsed.data : void 0;
823
848
  }
824
849
 
825
850
  // scripts/version/version-targets.ts
826
- import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
827
851
  import path4 from "node:path";
828
- import { execaSync as execaSync3 } from "execa";
852
+
853
+ // scripts/lib/read-file.ts
854
+ import { readFileSync as readFileSync4 } from "node:fs";
855
+ var ABSENT_CODE = "ENOENT";
856
+ function is_absent(error) {
857
+ return error instanceof Error && "code" in error && error.code === ABSENT_CODE;
858
+ }
859
+ function read_optional(path5) {
860
+ try {
861
+ return readFileSync4(path5, "utf8");
862
+ } catch (error) {
863
+ if (is_absent(error)) return void 0;
864
+ throw error;
865
+ }
866
+ }
867
+ function read_file_or_empty(path5) {
868
+ return read_optional(path5) ?? "";
869
+ }
870
+ function read_if_readable(path5) {
871
+ try {
872
+ return readFileSync4(path5, "utf8");
873
+ } catch {
874
+ return void 0;
875
+ }
876
+ }
877
+ var file_reader = { read_optional, read_file_or_empty, read_if_readable };
878
+
879
+ // scripts/version/version-targets.ts
880
+ import { execaSync as execaSync2 } from "execa";
829
881
  var NODE_MODULES2 = "node_modules";
830
882
  var PACKAGE_JSON3 = "package.json";
831
883
  function build_pnpm_ls_arguments(package_name) {
@@ -842,7 +894,7 @@ function parse_project_version(raw) {
842
894
  return parsed.success ? parsed.data.version : void 0;
843
895
  }
844
896
  function read_global_version(package_name) {
845
- const result = execaSync3("pnpm", build_pnpm_ls_arguments(package_name), { reject: false });
897
+ const result = execaSync2("pnpm", build_pnpm_ls_arguments(package_name), { reject: false });
846
898
  return parse_global_version(result.stdout, package_name);
847
899
  }
848
900
  function project_package_path(cwd, package_name) {
@@ -850,12 +902,12 @@ function project_package_path(cwd, package_name) {
850
902
  }
851
903
  function read_project_version(cwd, package_name) {
852
904
  const package_path = project_package_path(cwd, package_name);
853
- const raw = existsSync3(package_path) ? readFileSync4(package_path, "utf8") : void 0;
905
+ const raw = file_reader.read_optional(package_path);
854
906
  return parse_project_version(raw);
855
907
  }
856
908
  function read_workspace_version(cwd) {
857
909
  const package_path = path4.join(cwd, PACKAGE_JSON3);
858
- const raw = existsSync3(package_path) ? readFileSync4(package_path, "utf8") : void 0;
910
+ const raw = file_reader.read_optional(package_path);
859
911
  return parse_project_version(raw);
860
912
  }
861
913
  var version_targets = {
@@ -960,7 +1012,7 @@ function run_check(config) {
960
1012
  );
961
1013
  }
962
1014
  function run_upgrade_command(command) {
963
- const result = execaSync4("sh", ["-c", command], { stdio: "inherit", reject: false });
1015
+ const result = execaSync3("sh", ["-c", command], { stdio: "inherit", reject: false });
964
1016
  return result.exitCode ?? FAILURE_EXIT_CODE;
965
1017
  }
966
1018
  function run_all_upgrade_commands(commands) {
package/eslint/base.js CHANGED
@@ -29,13 +29,10 @@ import {
29
29
  import { typescript_rules } from './rules/typescript.js'
30
30
  import { unicorn_rules } from './rules/unicorn.js'
31
31
 
32
- const SCRIPTS_AI_PATTERNS = ['scripts-ai/**/*.ts', 'scripts-ai/**/*.js']
33
-
34
32
  const FILE_PATTERNS = {
35
33
  d_ts: ['**/*.d.ts'],
36
34
  typescript: ['**/*.ts', '**/*.tsx'],
37
- scripts_ai: SCRIPTS_AI_PATTERNS,
38
- scripts: ['scripts/**/*.ts', 'scripts/**/*.js', ...SCRIPTS_AI_PATTERNS],
35
+ scripts: ['scripts/**/*.ts', 'scripts/**/*.js'],
39
36
  // joshuafolkken/kit#1414: `**/*.spec.ts` is deliberately absent. The same config bans that name
40
37
  // outright, so handing it the test relaxation (`max-lines-per-function` 35 and the rest) is the
41
38
  // config contradicting itself, and it is what makes `*.spec.ts` read as supported. A banned file
@@ -160,7 +157,7 @@ export function create_base_config({ gitignore_path, tsconfig_root_dir }) {
160
157
  files: FILE_PATTERNS.scripts,
161
158
  rules: {
162
159
  'unicorn/no-process-exit': 'off',
163
- // scripts under scripts/ and scripts-ai/ are dual-purpose: shebang-executable
160
+ // scripts under scripts/ are dual-purpose: shebang-executable
164
161
  // (run via tsx) AND importable namespace modules (consumed via #scripts/* and
165
162
  // in tests). unicorn/no-exports-in-scripts flags exports in any shebang file,
166
163
  // which conflicts with the kit export { module } convention, so disable it here.
@@ -173,12 +170,6 @@ export function create_base_config({ gitignore_path, tsconfig_root_dir }) {
173
170
  '@typescript-eslint/unbound-method': 'off',
174
171
  },
175
172
  },
176
- {
177
- files: FILE_PATTERNS.scripts_ai,
178
- rules: {
179
- '@typescript-eslint/no-restricted-imports': 'off',
180
- },
181
- },
182
173
  {
183
174
  files: FILE_PATTERNS.tests,
184
175
  rules: {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1005.0",
2
+ "version": "1.1035.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": [
@@ -30,9 +30,7 @@
30
30
  "files": [
31
31
  "dist",
32
32
  "scripts",
33
- "scripts-ai",
34
33
  "prompts",
35
- "evals",
36
34
  "templates",
37
35
  "env",
38
36
  "eslint",
@@ -65,10 +63,38 @@
65
63
  "!**/*.test.ts",
66
64
  "!scripts/gh/gh-subcommand-guard.ts",
67
65
  "!**/*.spec.ts",
68
- "!**/*-fixture.ts",
66
+ "!**/*-fixture*.ts",
67
+ "!**/__snapshots__",
68
+ "!**/*.golden.txt",
69
69
  "!scripts/eval",
70
70
  "!scripts/time",
71
- "!scripts/cost"
71
+ "!scripts/cost",
72
+ "!scripts/retrospective",
73
+ "!scripts/test/classify-isolation.ts",
74
+ "!scripts/test/http-fault-injection.ts",
75
+ "!scripts/test/josh-harness*.ts",
76
+ "!scripts/test/pure-files.ts",
77
+ "!scripts/test/test-network-guard.ts",
78
+ "!scripts/test/test-repository-guard.ts",
79
+ "!scripts/test/test-state-guard.ts",
80
+ "!scripts/test/test-stdout-guard.ts",
81
+ "!scripts/test/test-telegram-guard.ts",
82
+ "!scripts/test/unit-guard-environment.ts",
83
+ "!scripts/test/unit-projects.ts",
84
+ "!scripts/test/vitest-include-globs.ts",
85
+ "!scripts/build/shim-shell.ts",
86
+ "!scripts/claude/skill-meta.ts",
87
+ "!scripts/document/document-scan.ts",
88
+ "!scripts/document/generate-catalog.ts",
89
+ "!scripts/document/retired-phrases.ts",
90
+ "!scripts/document/review-agent-type.ts",
91
+ "!scripts/document/single-source.ts",
92
+ "!scripts/hooks/prompt-hooks.ts",
93
+ "!scripts/init/hook-command-bootstrap.ts",
94
+ "!scripts/josh/josh-script-reader.ts",
95
+ "!scripts/package/production-dependency-graph.ts",
96
+ "!scripts/rules/delivered-rules-harness.ts",
97
+ "!scripts/rules/top-level-scripts-guard.ts"
72
98
  ],
73
99
  "imports": {
74
100
  "#eslint/*": "./eslint/*",
@@ -208,7 +234,7 @@
208
234
  "eslint-plugin-unicorn": "^76.0.0",
209
235
  "eslint_d": "^15.0.3",
210
236
  "globals": "^17.12.0",
211
- "lefthook": "^2.1.14",
237
+ "lefthook": "^2.1.15",
212
238
  "prettier": "^3.9.9",
213
239
  "prettier-plugin-svelte": "^4.1.1",
214
240
  "prettier-plugin-tailwindcss": "^0.8.1",