@joshuafolkken/kit 1.1094.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 (149) hide show
  1. package/.claude/skills/workflow-commands/SKILL.md +1 -1
  2. package/.claude/skills/workflow-commands/background-commands.md +36 -85
  3. package/.claude/skills/workflow-commands/backlogrun-progress.md +29 -32
  4. package/.claude/skills/workflow-commands/backlogrun-steps.md +2 -2
  5. package/.claude/skills/workflow-commands/fullrun.md +5 -4
  6. package/.claude/skills/workflow-commands/halfrun.md +5 -4
  7. package/.claude/skills/workflow-commands/latest-gate.md +7 -15
  8. package/.claude/skills/workflow-commands/pre-gate-cut.md +4 -8
  9. package/.claude/skills/workflow-commands/split-assessment.md +4 -18
  10. package/.github/actions/setup-node/action.yml +33 -0
  11. package/.github/actions/setup-pnpm/action.yml +4 -4
  12. package/.github/workflows/auto-tag.yml +2 -3
  13. package/.github/workflows/ci.yml +7 -8
  14. package/.github/workflows/dependabot-auto-merge.yml +1 -0
  15. package/.github/workflows/pr-classification.yml +1 -3
  16. package/.github/workflows/production.yml +1 -0
  17. package/.github/workflows/publish.yml +10 -9
  18. package/.github/workflows/sonar-qube.yml +17 -13
  19. package/.pnpmfile.mjs +29 -0
  20. package/AGENTS.md +4 -11
  21. package/CLAUDE.md +24 -17
  22. package/GEMINI.md +4 -13
  23. package/README.md +8 -3
  24. package/SECURITY.md +1 -0
  25. package/cspell/index.yaml +4 -0
  26. package/dist/CLAUDE.basic.md +6 -6
  27. package/dist/CLAUDE.md +24 -17
  28. package/dist/CLAUDE.static.md +6 -6
  29. package/dist/config-merge/index.js +33 -9
  30. package/dist/hooks/batch-guard.js +4 -4
  31. package/dist/hooks/{chunk-NKOG3XAV.js → chunk-4JZDP5X5.js} +2 -2
  32. package/dist/hooks/{chunk-3C4YCCEF.js → chunk-5SD2YM7Z.js} +4 -4
  33. package/dist/hooks/{chunk-OIZUHPJI.js → chunk-77J7IEQM.js} +1 -1
  34. package/dist/hooks/{chunk-KHWHKJOM.js → chunk-7HVB7SZG.js} +3 -3
  35. package/dist/hooks/{chunk-UD24EAIL.js → chunk-AIOIOMPX.js} +1875 -104
  36. package/dist/hooks/{chunk-M2XDCUKD.js → chunk-M7QKEKWO.js} +88 -1783
  37. package/dist/hooks/{chunk-E54KGFEQ.js → chunk-MKVGBQPA.js} +1 -1
  38. package/dist/hooks/{chunk-7ZPFAVR7.js → chunk-NXYMNPUQ.js} +3 -3
  39. package/dist/hooks/{chunk-O4LL4HTI.js → chunk-QVLT52OV.js} +2 -2
  40. package/dist/hooks/{chunk-IL27YTPH.js → chunk-XYUIQOW3.js} +2 -2
  41. package/dist/hooks/codex-hook-adapter.js +12 -47
  42. package/dist/hooks/duplicate-read-guard.js +5 -5
  43. package/dist/hooks/format-edited.js +2 -2
  44. package/dist/hooks/inputs.json +180 -179
  45. package/dist/hooks/investigation-guard.js +5 -5
  46. package/dist/hooks/pretool-guard.js +9 -9
  47. package/dist/hooks/stop-guard.js +17 -12
  48. package/dist/josh.js +79 -30
  49. package/dist/version/index.js +36 -20
  50. package/eslint/rules/unicorn.js +3 -2
  51. package/package.json +18 -2
  52. package/pnpm-workspace.yaml +5 -7
  53. package/prompts/collaboration-workflow/glossary.md +17 -0
  54. package/prompts/collaboration-workflow/issue-template.md +1 -1
  55. package/prompts/collaboration-workflow/operating-rules.md +1 -1
  56. package/prompts/collaboration-workflow/principles.md +9 -0
  57. package/prompts/collaboration-workflow.md +1 -0
  58. package/scripts/backlog/backlog-arrival.ts +30 -10
  59. package/scripts/backlog/backlog-budget-cli.ts +15 -16
  60. package/scripts/backlog/backlog-offer-cli.ts +6 -14
  61. package/scripts/backlog/backlog-plan.ts +29 -18
  62. package/scripts/backlog/backlog-ready.ts +20 -7
  63. package/scripts/config-merge/parse-jsonc.ts +33 -3
  64. package/scripts/config-merge/patch-json-key.ts +13 -6
  65. package/scripts/cost-runtime/cost-cli.ts +3 -7
  66. package/scripts/doctor/doctor-consumer.ts +3 -5
  67. package/scripts/doctor/doctor-io.ts +9 -13
  68. package/scripts/document/backlogrun-parent-read-set.ts +12 -1
  69. package/scripts/document/document-byte-budget.ts +1 -0
  70. package/scripts/document/entry-read-budget.ts +13 -7
  71. package/scripts/document/entry-read-set.ts +32 -8
  72. package/scripts/document/lane-child-read-set.ts +7 -0
  73. package/scripts/document/read-set-point-of-use.ts +8 -3
  74. package/scripts/document/read-set-trim.ts +3 -1
  75. package/scripts/epic/epic-audit.ts +3 -18
  76. package/scripts/gh/git-gh-issue-list.ts +12 -11
  77. package/scripts/gh/git-gh-issue-write.ts +4 -1
  78. package/scripts/gh/git-gh-pr-auto-merge.ts +4 -1
  79. package/scripts/git/git-command.ts +6 -1
  80. package/scripts/git/git-spawn-sync.ts +65 -0
  81. package/scripts/git/git-spawn.ts +5 -4
  82. package/scripts/git/stash/stash-pop-args.ts +1 -6
  83. package/scripts/init/init-file-action.ts +54 -0
  84. package/scripts/init/init-logic-migrate.ts +35 -17
  85. package/scripts/init/init-logic-secretlint.ts +1 -1
  86. package/scripts/init/init-logic.ts +6 -22
  87. package/scripts/init/init.ts +11 -68
  88. package/scripts/init/kit-written-paths.ts +2 -0
  89. package/scripts/init/project-profile.ts +3 -6
  90. package/scripts/init/start-steps.ts +2 -1
  91. package/scripts/issue/defect-rate-cli.ts +61 -20
  92. package/scripts/issue/issue-backlinks.ts +7 -14
  93. package/scripts/issue/issue-cite.ts +12 -6
  94. package/scripts/issue/issue-file.ts +5 -12
  95. package/scripts/issue/markdown-section.ts +21 -6
  96. package/scripts/issue/measure-rerun-cli.ts +73 -14
  97. package/scripts/josh/josh-commands-project.ts +1 -1
  98. package/scripts/josh/josh-commands-workflow.ts +1 -1
  99. package/scripts/josh/run-github-prerequisite.ts +3 -6
  100. package/scripts/lane/lane-await.ts +43 -13
  101. package/scripts/lane/lane-close.ts +4 -1
  102. package/scripts/lane/lane-launch-cli.ts +10 -16
  103. package/scripts/lane/openai-review-broker.ts +4 -1
  104. package/scripts/lib/cli-flags.ts +31 -2
  105. package/scripts/lib/error-message.ts +12 -1
  106. package/scripts/lines/line-targets.ts +0 -11
  107. package/scripts/lines/lines-command.ts +5 -3
  108. package/scripts/propagate/propagate-git.ts +3 -8
  109. package/scripts/refactor/refactor-scan.ts +2 -1
  110. package/scripts/registry-migration/migrate-logic.ts +28 -19
  111. package/scripts/registry-migration/migrate.ts +6 -5
  112. package/scripts/release/github-release-cli.ts +14 -3
  113. package/scripts/release/release-publish.ts +36 -2
  114. package/scripts/release/release-worktree.ts +97 -2
  115. package/scripts/review/review-checkout.ts +3 -2
  116. package/scripts/review/review-record-cli.ts +9 -16
  117. package/scripts/rules/early-heartbeat.ts +4 -3
  118. package/scripts/rules/lane-park.ts +9 -0
  119. package/scripts/rules/stop-rules.ts +7 -4
  120. package/scripts/run/run-carry-args.ts +8 -12
  121. package/scripts/run/run-cut-args.ts +1 -6
  122. package/scripts/run/run-ending-cli.ts +1 -5
  123. package/scripts/run/run-entry-cli.ts +40 -9
  124. package/scripts/run/run-entry-stop.ts +104 -0
  125. package/scripts/run/run-event-stream-emit.ts +7 -2
  126. package/scripts/run/run-hold.ts +4 -1
  127. package/scripts/run/run-liveness-cli.ts +1 -5
  128. package/scripts/run/run-merge-cli.ts +2 -10
  129. package/scripts/run/run-parent-cut-hook.ts +4 -1
  130. package/scripts/run/run-prep-cli.ts +4 -1
  131. package/scripts/run/run-progress-args.ts +20 -4
  132. package/scripts/run/run-progress-cli.ts +31 -29
  133. package/scripts/run/run-progress-clock.ts +4 -1
  134. package/scripts/run/run-ship-cli.ts +8 -16
  135. package/scripts/run/run-ship-probe.ts +4 -1
  136. package/scripts/run/run-status-cli.ts +2 -15
  137. package/scripts/run/run-tidy-lanes.ts +4 -1
  138. package/scripts/run/run-wake-cli.ts +2 -10
  139. package/scripts/run/run-watcher-guard.ts +9 -5
  140. package/scripts/safe-chain/pack-hook.ts +92 -0
  141. package/scripts/sync/sync-ai-files.ts +4 -0
  142. package/scripts/test/test-declared-changed.ts +13 -16
  143. package/scripts/test/test-declared.ts +3 -7
  144. package/scripts/version/version-commands.ts +11 -1
  145. package/templates/CLAUDE.basic.md +6 -6
  146. package/templates/workflows/ci.yml +16 -82
  147. package/templates/workflows/dependabot-auto-merge.yml +1 -0
  148. package/templates/workflows/github-release.yml +1 -3
  149. package/tsconfig.sonar.json +4 -22
@@ -31,9 +31,7 @@ jobs:
31
31
  persist-credentials: false
32
32
 
33
33
  - name: Setup Node.js
34
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
35
- with:
36
- node-version: '24'
34
+ uses: ./.github/actions/setup-node
37
35
 
38
36
  - name: Configure GitHub Packages authentication for existing projects
39
37
  run: printf '//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}\n' >> "$HOME/.npmrc"
@@ -15,6 +15,7 @@ jobs:
15
15
  group: production-update
16
16
  queue: max
17
17
  runs-on: ubuntu-latest
18
+ timeout-minutes: 10
18
19
  permissions:
19
20
  contents: write
20
21
  steps:
@@ -25,9 +25,8 @@ jobs:
25
25
  steps:
26
26
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
27
27
 
28
- - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
28
+ - uses: ./.github/actions/setup-node
29
29
  with:
30
- node-version: 24
31
30
  registry-url: 'https://npm.pkg.github.com'
32
31
  scope: '@joshuafolkken'
33
32
 
@@ -54,9 +53,12 @@ jobs:
54
53
  env:
55
54
  LATEST: ${{ steps.registry-latest.outputs.latest }}
56
55
 
57
- - run: pnpm publish --no-git-checks --tag ${{ steps.publish-tag.outputs.tag }} --registry https://npm.pkg.github.com
56
+ # The tag reaches the command through the environment rather than expanded into it, so a step
57
+ # output is never parsed as shell (joshuafolkken/kit#3084).
58
+ - run: pnpm publish --no-git-checks --tag "$PUBLISH_TAG" --registry https://npm.pkg.github.com
58
59
  env:
59
60
  NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61
+ PUBLISH_TAG: ${{ steps.publish-tag.outputs.tag }}
60
62
 
61
63
  publish-npm:
62
64
  if: startsWith(github.ref, 'refs/tags/v')
@@ -71,9 +73,8 @@ jobs:
71
73
  steps:
72
74
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
73
75
 
74
- - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
76
+ - uses: ./.github/actions/setup-node
75
77
  with:
76
- node-version: 24
77
78
  registry-url: 'https://registry.npmjs.org'
78
79
 
79
80
  # Before setup-pnpm, for the same reason as publish-github's lookup (joshuafolkken/kit#3060).
@@ -99,7 +100,9 @@ jobs:
99
100
  LATEST: ${{ steps.registry-latest.outputs.latest }}
100
101
 
101
102
  - name: Publish to npm
102
- run: cd "$RUNNER_TEMP" && npm publish kit.tgz --access public --tag ${{ steps.publish-tag.outputs.tag }} --registry https://registry.npmjs.org --userconfig /dev/null
103
+ run: cd "$RUNNER_TEMP" && npm publish kit.tgz --access public --tag "$PUBLISH_TAG" --registry https://registry.npmjs.org --userconfig /dev/null
104
+ env:
105
+ PUBLISH_TAG: ${{ steps.publish-tag.outputs.tag }}
103
106
 
104
107
  update-production:
105
108
  needs: [publish-github, publish-npm]
@@ -121,9 +124,7 @@ jobs:
121
124
  with:
122
125
  fetch-depth: 0
123
126
 
124
- - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
125
- with:
126
- node-version: 24
127
+ - uses: ./.github/actions/setup-node
127
128
 
128
129
  - uses: ./.github/actions/setup-pnpm
129
130
  with:
@@ -20,6 +20,8 @@ jobs:
20
20
  contents: read
21
21
  packages: read
22
22
  runs-on: ubuntu-latest
23
+ # The scan waits for SonarCloud's Quality Gate, so the limit leaves room for that wait.
24
+ timeout-minutes: 20
23
25
  # A consumer that does not use SonarCloud has no SONAR_TOKEN, and the scan would fail on
24
26
  # authentication and turn a required check red (joshuafolkken/kit#2815). `secrets` cannot be read
25
27
  # in a step `if:`, so the secret is lifted into the job env and the steps branch on that instead.
@@ -35,6 +37,21 @@ jobs:
35
37
  if: env.SONAR_TOKEN != ''
36
38
  with:
37
39
  fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
40
+ # The dependencies are installed before the scan, on a push as well as on a pull request:
41
+ # `tsconfig.sonar.json` extends `@joshuafolkken/kit/tsconfig/base`, which a consumer resolves
42
+ # only from node_modules, so a scan ahead of the install read a config it could not load
43
+ # (joshuafolkken/kit#3082). The new-code check below runs `pnpm josh` from the same install.
44
+ - name: Setup Node.js
45
+ if: env.SONAR_TOKEN != ''
46
+ uses: ./.github/actions/setup-node
47
+ - name: Configure GitHub Packages authentication for existing projects
48
+ if: env.SONAR_TOKEN != ''
49
+ run: printf '//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}\n' >> "$HOME/.npmrc"
50
+ - name: Setup pnpm and install dependencies
51
+ if: env.SONAR_TOKEN != ''
52
+ uses: ./.github/actions/setup-pnpm
53
+ with:
54
+ node-auth-token: ${{ secrets.GITHUB_TOKEN }}
38
55
  # SonarCloud's New Code starts at the previous version, so an analysis without
39
56
  # `sonar.projectVersion` never moves that start and New Code grows without end, diluting every
40
57
  # ratio the Quality Gate judges (joshuafolkken/kit#3045). The version is `package.json`'s, so
@@ -57,19 +74,6 @@ jobs:
57
74
  # job (a required PR check) when the pull request adds any new issue, of any type or severity,
58
75
  # or any new duplicated block (joshuafolkken/kit#3045). An issue resolved in SonarCloud as
59
76
  # accepted or a false positive is not counted. A push to main has no pull request to read.
60
- - name: Setup Node.js
61
- if: env.SONAR_TOKEN != '' && github.event_name == 'pull_request'
62
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
63
- with:
64
- node-version: '24'
65
- - name: Configure GitHub Packages authentication for existing projects
66
- if: env.SONAR_TOKEN != '' && github.event_name == 'pull_request'
67
- run: printf '//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}\n' >> "$HOME/.npmrc"
68
- - name: Setup pnpm and install dependencies
69
- if: env.SONAR_TOKEN != '' && github.event_name == 'pull_request'
70
- uses: ./.github/actions/setup-pnpm
71
- with:
72
- node-auth-token: ${{ secrets.GITHUB_TOKEN }}
73
77
  - name: Fail on new Sonar issues or duplicated blocks
74
78
  if: env.SONAR_TOKEN != '' && github.event_name == 'pull_request'
75
79
  env:
package/.pnpmfile.mjs ADDED
@@ -0,0 +1,29 @@
1
+ // josh-managed-pnpmfile: @joshuafolkken/kit
2
+ // `josh init` / `josh sync` copy this file into every project that publishes (joshuafolkken/kit#3110)
3
+ // and overwrite it while this first line stays; edit it in kit, not here.
4
+ // Strips the Safe Chain `preinstall` from the packed manifest only (joshuafolkken/kit#2693).
5
+ // kit writes it to run Safe Chain for the repository's own development installs; shipped, it becomes
6
+ // a build script every consumer's pnpm refuses to run unapproved, and it could not protect them
7
+ // anyway — their install has already started by the time a dependency's `preinstall` runs. The
8
+ // repository's package.json keeps it; `pnpm pack` and `pnpm publish` call this hook on the copy they
9
+ // write. Any other lifecycle script — a native build, a binary download — is the package's own and
10
+ // ships untouched.
11
+ const SAFE_CHAIN_PACKAGE = '@aikidosec/safe-chain'
12
+
13
+ function is_safe_chain_preinstall(name, command) {
14
+ return name === 'preinstall' && command.includes(SAFE_CHAIN_PACKAGE)
15
+ }
16
+
17
+ function strip_safe_chain_preinstall(manifest) {
18
+ const scripts = Object.fromEntries(
19
+ Object.entries(manifest.scripts ?? {}).filter(
20
+ ([name, command]) => !is_safe_chain_preinstall(name, command),
21
+ ),
22
+ )
23
+
24
+ return { ...manifest, scripts }
25
+ }
26
+
27
+ const hooks = { beforePacking: strip_safe_chain_preinstall }
28
+
29
+ export { hooks, is_safe_chain_preinstall }
package/AGENTS.md CHANGED
@@ -1,18 +1,11 @@
1
1
  # Agent Instructions
2
2
 
3
3
  > **All rules for this repository live in [`CLAUDE.md`](./CLAUDE.md). Read it in full before doing
4
- > any work here, and follow every rule in it.** This file exists only to point at it. The rules apply
5
- > to whatever agent is doing the work, but `CLAUDE.md` is written for Claude Code and names its
6
- > features — read them as follows.
4
+ > any work here, and follow every rule in it.** This file exists only to point at it.
7
5
 
8
- - **Hooks.** Codex runs the same hooks from `.codex/hooks.json`, which is generated from
9
- `.claude/settings.json`. Where Codex does not show a hook's output, apply the rule yourself — resolve
10
- `JOSH_SESSION_LANG` from `.env` rather than waiting for it to be injected.
11
- - **Skills, `/verify-ui` and `/code-review`.** Where `CLAUDE.md` says to load a skill or run one in a
12
- subagent, read that skill's `SKILL.md` and follow it in your own session.
13
- - **The `.claude/settings.json` deny list** is not enforced here. The rules it backs — no commits,
14
- merges, staging or other shared-state changes without instruction — still bind you.
15
- - **`AskUserQuestion`** means asking the user in plain text.
6
+ **Codex runs the same hooks from `.codex/hooks.json`**, generated from `.claude/settings.json`; where
7
+ it does not show a hook's output, apply that rule yourself. How to read `CLAUDE.md`'s Claude Code
8
+ features here is `prompts/collaboration-workflow/principles.md` → "Claude Code 以外のエージェントでの読み替え".
16
9
 
17
10
  **Do not copy rules back into this file.** Every change to how agents work in this repository belongs
18
11
  in `CLAUDE.md`.
package/CLAUDE.md CHANGED
@@ -36,7 +36,7 @@ Classify each decision point into one tier and act; stop **only** when the choic
36
36
 
37
37
  ## Environment Variables
38
38
 
39
- A `.env` at the project root: `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` are required for notifications; `JOSH_SESSION_LANG`, `PORT_SEED` and `JOSH_REPO_PATHS` are optional and personal. Setup and semantics: [docs/scripts-ai.md](https://github.com/joshuafolkken/kit/blob/main/docs/scripts-ai.md) and [docs/josh-commands.md](https://github.com/joshuafolkken/kit/blob/main/docs/josh-commands.md).
39
+ A `.env` at the project root: `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` are required for notifications; `JOSH_SESSION_LANG`, `PORT_SEED` and `JOSH_REPO_PATHS` are optional and personal. Details: [environment-variables.md](https://github.com/joshuafolkken/kit/blob/main/docs/environment-variables.md), [josh-commands.md](https://github.com/joshuafolkken/kit/blob/main/docs/josh-commands.md).
40
40
 
41
41
  **GitHub operations are `gh api` (REST) — instructing prose included — and need `gh` installed; some environments lack it.** Auth: `gh auth login`; `GH_TOKEN` in CI/cloud. `prompts/collaboration-workflow/gh-rest.md`.
42
42
 
@@ -100,12 +100,14 @@ A `.env` at the project root: `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` are re
100
100
 
101
101
  For every code modification, in order:
102
102
 
103
- 0. **Work summary + test declaration** _(before writing any implementation code)_: a two-layer summary — a plain-language overview a non-programmer can follow (three lines, **Now / Change / Check**, one sentence each, in the session language; name the concrete subject in each line — subject-less prose is not acceptable; no file paths, function or type names, or CLI option flags — only internal identifiers are banned, not names the reader sees on screen), **Details**, then **every change with its test** (`<what changes> — Test: <Unit|E2E> — <file path> — <what it verifies>`). Ordinary markdown, **never wrapped in a code fence**, once per Issue before implementation — required in fullrun/halfrun/backlogrun even when the Issue body was filled (`kickoff` is exempt); completion reports lead with **Cause / Fix / Result**. `prompts/collaboration-workflow/report-format.md`; `pnpm josh report:lint` checks the form, and a session's first runtime `Edit` / `Write` points here. Presentation only, never a confirmation stop.
103
+ 0. **Work summary + test declaration** _(before writing any implementation code)_: once per Issue, present a two-layer summary in ordinary markdown, **never wrapped in a code fence** — required in fullrun/halfrun/backlogrun even when the Issue body was filled (`kickoff` is exempt). Presentation only, never a confirmation stop. `prompts/collaboration-workflow/report-format.md`; `pnpm josh report:lint` checks the form.
104
104
 
105
+ - **Overview** — three lines, **Now / Change / Check**, one sentence each, in the session language, that a non-programmer can follow; name the concrete subject in each line — subject-less prose is not acceptable. Use no file paths, function or type names, or CLI option flags — only internal identifiers are banned, not names the reader sees on screen.
106
+ - **Details**, then **every change with its test**: `<what changes> — Test: <Unit|E2E> — <file path> — <what it verifies>`. Completion reports lead with **Cause / Fix / Result**.
105
107
  - **Tests are required for ALL changes** — zero tests without explicit approval is a violation (bug fixes, timing/animation fixes and refactors included): bug fix → regression test; UI/animation/timing → E2E for the observable change; logic/utility → unit; refactor → tests pinning existing behavior BEFORE the change (`prompts/refactoring.md`).
106
- - **Non-runtime updates (pre-approved manual-only exception)**: a change touching no executable runtime code path may proceed with manual verification — declare it in Step 0 and state why. It covers docs, non-executable config, editor/IDE files, and cosmetic asset swaps with no selector/path change; the mechanically exempt (`*.md`, `.editorconfig`, `.idea/**`, `.vscode/**`, `prompts/**`) are recognized by the command below, and the rest stay the exemption a person declares. A test infeasible for a runtime change needs its reason stated and user approval.
107
- - **Basic-profile manual-check exception:** when `package.json` records `josh.profile: basic` (or its former name `static`) and the change touches only files in languages kit cannot test (HTML/CSS, or sources such as Lua), verify by hand instead of with an automated test. For HTML/CSS, open the page in a browser and check layout, links and interactions in the HTML at the intended screen widths; for any other source, actually run the changed code. Report what you observed either way. JavaScript and TypeScript files still need automated tests, even when changed alongside. `pnpm josh test:declared` prints `exempt` with the reason in this case only.
108
- - **The commit stage answers this mechanically**: `pnpm josh test:declared` prints `required` / `exempt` / `satisfied` from the changed paths, and a runtime change with no test is refused at `pnpm josh git -y` on `required` — add the declared test or declare the non-runtime exception, then reissue (`prompts/collaboration-workflow/rule-delivery.md`).
108
+ - **Non-runtime updates (pre-approved manual-only exception)**: a change touching no executable runtime code path — docs, non-executable config, editor/IDE files, cosmetic asset swaps with no selector/path change — may be verified by hand; declare it in Step 0 with the reason. The mechanically exempt (`*.md`, `.editorconfig`, `.idea/**`, `.vscode/**`, `prompts/**`) need no declaration. A runtime change whose test is infeasible needs the reason and user approval.
109
+ - **Basic-profile manual-check exception:** under `josh.profile: basic` (or `static`), a change touching only languages kit cannot test (HTML/CSS, Lua …) is verified by hand — a browser check of layout, links and interactions in the HTML, or actually run the changed code — and reported; JavaScript and TypeScript still need tests. `prompts/testing-guide.md`.
110
+ - **`pnpm josh test:declared`** answers `required` / `exempt` / `satisfied` from the changed paths; a runtime change with no test is refused at `pnpm josh git -y` on `required`.
109
111
  - **Read a target's line headroom before editing: `pnpm josh lines <path>`** — near the limit, `Target` carries the splitting plan.
110
112
 
111
113
  1. **Refactor first** — before any refactoring, read and follow `prompts/refactoring.md`; apply high/medium refactoring to all new/modified code and do not proceed until none remain.
@@ -129,7 +131,11 @@ Run the full verification set **in order**; do not skip, reorder, or report comp
129
131
 
130
132
  ## Pre-commit Self-Review (mandatory)
131
133
 
132
- Before every `git commit` (follow-up commits included), self-review against `prompts/review.md` — a subagent runs `/code-review`, never a main-line `Skill` load: the staged diff, and `git diff main...HEAD` before opening or updating a PR. Level from `pnpm josh review:brief --level-only`; resolve all high/medium findings; iterate — **no further than the round cap**, the last round a verification pass over the fix delta. Then route each remaining non-High finding through the three-way disposition: fix in place, file it as a follow-up Issue only when it is a confirmed defect that reaches a runtime path (`pnpm josh disposition <path>` answers `runtime` / `non-runtime`) — or drop it with a one-line PR note (the default). **A filed finding is run through `pnpm josh epic:bundle <new>` before the current Issue closes.** A confirmed High blocks rather than buying a round past the cap. `prompts/review.md` → "Review round cap".
134
+ Before every `git commit` (follow-up commits included), self-review against `prompts/review.md` — a subagent runs `/code-review`, never a main-line `Skill` load. `prompts/review.md` → "Review round cap".
135
+
136
+ - **Scope** — the staged diff, and `git diff main...HEAD` before opening or updating a PR; level from `pnpm josh review:brief --level-only`.
137
+ - **Rounds** — resolve all high/medium findings, **no further than the round cap**, the last round a verification pass over the fix delta. A confirmed High blocks rather than buying a round past the cap.
138
+ - **Each remaining non-High finding** — fix in place, file it as a follow-up Issue only when it is a confirmed defect that reaches a runtime path (`pnpm josh disposition <path>`), or drop it with a one-line PR note (the default). **A filed finding is run through `pnpm josh epic:bundle <new>` before the current Issue closes.**
133
139
 
134
140
  ## Doc Sync Rules
135
141
 
@@ -137,14 +143,14 @@ Before every `git commit` (follow-up commits included), self-review against `pro
137
143
 
138
144
  ## Git Rules
139
145
 
140
- - **No commits** unless explicitly requested. **No PR merges, branch deletions, force pushes or other shared-state mutations** unless explicitly requested in the current turn — the default end state is PR still OPEN. **Exception**: invoking `fullrun` authorizes the merge, via `pnpm josh followup`. `.claude/settings.json` denies these, but the deny is narrower than the rule — never read "the tool let me" as permission. `prompts/collaboration-workflow/operating-rules.md` → "指示されていない行動は取らない".
146
+ - **No commits** unless explicitly requested. **No PR merges, branch deletions, force pushes or other shared-state mutations** unless explicitly requested in the current turn — the default end state is PR still OPEN. **Exception**: invoking `fullrun` or `backlogrun` authorizes the merge, via `pnpm josh followup` — `prrun` does not. `.claude/settings.json` denies these, but the deny is narrower than the rule — never read "the tool let me" as permission. `prompts/collaboration-workflow/operating-rules.md` → "指示されていない行動は取らない".
141
147
  - **Never stage or mutate the git index on your own.** `git add` / `git rm --cached` / `git restore --staged` / `git commit` overwrite the user's snapshot and are denied by settings; inspection is read-only. Staging is allowed only on an explicit current-turn instruction or an authorized commit flow (`pnpm josh git`). `prompts/collaboration-workflow/operating-rules.md` → "git index を勝手に変更しない".
142
148
  - **For git operations use `pnpm josh git`.** After a failed push, fix, push manually, then `pnpm josh pr` — **never** `gh pr create` directly, which bypasses `closes #N` generation so the Issue will not auto-close.
143
149
  - **Start-of-conversation git status is a stale snapshot.** Before acting on any working-tree / index / stash / branch assumption, run `git status` (and `git stash list`) live first.
144
150
 
145
151
  ## Collaboration Workflow
146
152
 
147
- - For the issue-driven proposal/plan/execution/notification flow, follow `prompts/collaboration-workflow/` (indexed by `prompts/collaboration-workflow.md`; each topic is its own file).
153
+ - The issue-driven flow is `prompts/collaboration-workflow/`, indexed by `prompts/collaboration-workflow.md`.
148
154
  - **Before writing a rule as prose, place it by `prompts/collaboration-workflow/residency.md`** — its single source. A computable answer goes to `pnpm josh oracle:list` and an ordering rule to `pnpm josh run:step`, never into `CLAUDE.md` or a prompt file.
149
155
  - **Count the target repository's open Issues before filing; above the WIP cap, close one first.** Nothing honestly closable means do not file. A filing the run is blocked by is exempt, and so is an **interrupt** — three tests decide that, never judgement: a verification answers wrongly, a documented workflow cannot complete, or data is lost or written outside the repository; both exemptions proceed, stating the overage. Meeting none of the three, a finding stays discretionary. `pnpm josh rule:guard` states it again at the call that files. The count command and both procedures: `prompts/collaboration-workflow/wip-cap.md`.
150
156
 
@@ -162,11 +168,13 @@ Before every `git commit` (follow-up commits included), self-review against `pro
162
168
  | `halfrun [#N \| new]` | Implement + gate, then **stop before commit** for manual verification | + `halfrun.md` + `split-assessment.md` |
163
169
  | `backlogrun [#N1 #N2 …]` | Run named Issues and epics in order (an epic runs its children first), then drain the opted-in backlog — dependency order, lanes. `--only` stops after the named list | + `backlogrun.md` + `split-assessment.md` + the `fullrun` set |
164
170
 
165
- **`queue` and `epicrun` were removed** — tell a user who types `queue` to run `backlogrun #N1 #N2 …`, and one who types `epicrun` to run `backlogrun #E --only` (drop `--only` to also drain the backlog).
171
+ **`queue` and `epicrun` were removed** — point `queue` to `backlogrun #N1 #N2 …` and `epicrun` to `backlogrun #E --only`.
166
172
 
167
- **Three rules decide what a run does when the work turns out not to be one Issue** — the split assessment every entry point applies identically (**its default is not to split**: separability **and** a scope clearly exceeding one verification gate — the size guide in `split-assessment.md`, measured by `pnpm josh split:assess` — must both hold), a prerequisite discovered mid-run (a dependency, not parked), and a named `backlogrun` item that is not an epic. All bind only after a command has started, so all are read from the `workflow-commands` skill: `split-assessment.md`, `SKILL.md` → §2d, `backlogrun-child.md` → "When `#N` is not an epic", and `fullrun.md` / `halfrun.md` / `backlogrun.md` for the branch each entry takes.
173
+ **The `josh epic:*` commands have their own skill** — `epic:audit`, `epic:next`, `epic:bundle`, and how an epic spans repositories. **Read the `epic-commands` skill before running any of them, before writing an epic that tracks a child in another repository, and right after filing an issue.** Three rules bind outside those commands:
168
174
 
169
- **The `josh epic:*` commands have their own skill** — `epic:audit`, `epic:next`, `epic:bundle`, and how an epic spans repositories. **Read the `epic-commands` skill before running any of them, before writing an epic that tracks a child in another repository, and right after filing an issue.** Three rules stay here because they bind outside those commands: **recording a decision removes that child's `needs-decision` label** (Tier A); **fixing what the audit finds is Tier A**, park only when the contradiction is a design choice nobody has made; and **an epic in another repository is referenced as `owner/repo#N`** (a bare `#N` resolves to this repository's issue). Canonical reference: `.claude/skills/epic-commands/SKILL.md`.
175
+ - Recording a decision removes that child's `needs-decision` label (Tier A).
176
+ - **Fixing what the audit finds is Tier A**; park only when the contradiction is a design choice nobody has made.
177
+ - **An epic in another repository is referenced as `owner/repo#N`** — a bare `#N` resolves to this repository's issue.
170
178
 
171
179
  #### Explicit invocation required (MANDATORY)
172
180
 
@@ -177,18 +185,17 @@ Never start a `kickoff` / `halfrun` / `prrun` / `fullrun` / `backlogrun` workflo
177
185
  - Instead, **prompt the user to type the command themselves**, with the exact phrasing: "Please run \`<command>\` to start this task." (e.g. "Please run \`halfrun new\` to start this task.").
178
186
  - This applies even when the user authorized a related workflow in an earlier turn — each invocation must be re-typed in the current turn.
179
187
 
180
- **A session cut inside a declared budget is not a new invocation** — a `backlogrun` cut and resumed is the one invocation a person typed, and it continues rather than waiting to be retyped; **`backlogrun` alone**, though — a `fullrun` cut still waits for the keyword. Single source: `backlogrun-steps.md` → "The session cut is inside the invocation".
188
+ **A session cut inside a declared budget is not a new invocation — for `backlogrun` alone**: a resumed `backlogrun` continues, while a `fullrun` cut still waits for the keyword. `backlogrun-steps.md` → "The session cut is inside the invocation".
181
189
 
182
- **A `backlogrun` parks a child instead of stopping the run**, and its procedure is read from `backlogrun-park.md` → "park and continue", which is that rule's single source.
190
+ **A `backlogrun` parks a child instead of stopping the run** — `backlogrun-park.md` → "park and continue".
183
191
 
184
192
  #### Mid-workflow stop notification (`confirmation`)
185
193
 
186
- Whenever you pause **any** run mid-execution to wait for the user — a `kickoff` / `halfrun` / `prrun` / `fullrun` stop, an upstream-Issue interrupt, a Tier C confirmation — you MUST send a Telegram notification **before** stopping, so the user is alerted off-screen. `halfrun`'s built-in stop before commit is a confirmation pause and follows this same rule.
194
+ Before pausing **any** run to wait for the user — a command's stop (`halfrun`'s stop before commit included), an upstream-Issue interrupt, a Tier C confirmation — you MUST send this Telegram, so the user is alerted off-screen:
187
195
 
188
196
  ```bash
189
197
  pnpm josh notify --task-type confirmation --issue-url "<issue-url>" --body=$'<one-line reason>\n<what is needed from the user>'
190
198
  ```
191
199
 
192
- - Use `--body=...` (single token) when the body starts with `-`, otherwise `parseArgs` rejects it
193
- - Send only once per stop — do not spam if you re-evaluate within the same pause
194
- - Skip the notification when the stop was explicitly requested by the user in the same turn (they already know)
200
+ - Send it once per stop; skip it when the user asked for the stop in this same turn.
201
+ - Pass `--body=...` as one token when the body starts with `-`, otherwise `parseArgs` rejects it.
package/GEMINI.md CHANGED
@@ -1,22 +1,13 @@
1
1
  # Agent Instructions
2
2
 
3
3
  > **All rules for this repository live in [`CLAUDE.md`](./CLAUDE.md). Read it in full before doing
4
- > any work here, and follow every rule in it.** This file exists only to point at it. The rules apply
5
- > to whatever agent is doing the work, but `CLAUDE.md` is written for Claude Code and names its
6
- > features — read them as follows.
4
+ > any work here, and follow every rule in it.** This file exists only to point at it.
7
5
 
8
6
  @CLAUDE.md
9
7
 
10
- - **No hooks run under Gemini.** Every rule `CLAUDE.md` says a hook enforces or delivers is silently
11
- unenforced here, so apply each one yourself: present the work summary before implementing, resolve
12
- `JOSH_SESSION_LANG` from `.env`, run `pnpm josh lint:related` and `pnpm josh cspell:dot` after
13
- editing instead of relying on the format-on-edit hook, and cite every Issue with a link and a short
14
- title instead of relying on the stop-time check.
15
- - **Skills, `/verify-ui` and `/code-review`.** Where `CLAUDE.md` says to load a skill or run one in a
16
- subagent, read that skill's `SKILL.md` and follow it in your own session.
17
- - **The `.claude/settings.json` deny list** is not enforced here. The rules it backs — no commits,
18
- merges, staging or other shared-state changes without instruction — still bind you.
19
- - **`AskUserQuestion`** means asking the user in plain text.
8
+ **No hooks run under Gemini**, so every rule a hook delivers is yours to apply unaided. How to read
9
+ `CLAUDE.md`'s Claude Code features here — that list of rules included — is
10
+ `prompts/collaboration-workflow/principles.md` → "Claude Code 以外のエージェントでの読み替え".
20
11
 
21
12
  **Do not copy rules back into this file.** Every change to how agents work in this repository belongs
22
13
  in `CLAUDE.md`.
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  [![CI](https://github.com/joshuafolkken/kit/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/joshuafolkken/kit/actions/workflows/ci.yml)
13
13
  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=joshuafolkken_kit&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=joshuafolkken_kit)
14
14
 
15
- **Write a GitHub Issue. Your AI agent takes it to a merged PR — the same way in every project.**
15
+ **Tell your AI agent the change. It files the GitHub Issue and takes it to a merged PR — the same way in every project.**
16
16
 
17
17
  kit gives Claude Code or Codex (or Gemini, Cursor) your project's rules, checks and an Issue-driven workflow.
18
18
 
@@ -54,6 +54,7 @@ Each kit includes the one to its left: app-kit builds on kit, game-kit builds on
54
54
  | ------------ | ------------------------------------------------ |
55
55
  | `kickoff` | Writes the plan on the Issue, then stops |
56
56
  | `halfrun` | Implements and self-reviews, stops before commit |
57
+ | `prrun` | Opens a green pull request, stops before merge |
57
58
  | `fullrun` | Plans if needed, implements through to merge |
58
59
  | `backlogrun` | Runs many Issues unattended |
59
60
 
@@ -66,13 +67,17 @@ Each keyword in full: [Run Issues with the workflow keywords](./docs/how-to/run-
66
67
 
67
68
  ## Quick start
68
69
 
69
- Requires Node.js, pnpm and the gh CLI — [how to install them](./docs/setup/prerequisites.md).
70
+ Requires Node.js, pnpm (kit is installed and run with pnpm only) and the gh CLI — [how to install them](./docs/setup/prerequisites.md). Sign in once with `gh auth login` before `josh start`.
70
71
 
71
72
  ```bash
72
73
  pnpm add -D --allow-build=esbuild --allow-build=unrs-resolver @joshuafolkken/kit
73
74
  pnpm exec josh start
74
75
  ```
75
76
 
77
+ `josh start` picks the project's profile, writes kit's rules and checks, and creates the GitHub repository and workflow labels when they are missing. On a repository that already has history it opens a setup pull request instead of committing to `main` — merge it before your first run ([what it does](./docs/init.md#josh-init-or-josh-start)).
78
+
79
+ Add the two Telegram credentials to `.env` so a run that needs you can reach you, or `JOSH_NOTIFY=off` to go without — [Set up notifications](./docs/how-to/set-up-notifications.md).
80
+
76
81
  Then open your agent and follow the [tutorial](./docs/tutorial.md).
77
82
 
78
83
  No Issue workflow? [Node projects](./docs/setup/full.md#2-install-and-initialize-with-josh-init) · [Other projects](./docs/setup/basic.md)
@@ -81,4 +86,4 @@ No Issue workflow? [Node projects](./docs/setup/full.md#2-install-and-initialize
81
86
 
82
87
  [Tutorial](./docs/tutorial.md) · [How-to](./docs/how-to.md) · [Commands](./docs/josh-commands.md) · [Troubleshooting](./docs/troubleshooting.md) · [All docs](./docs/overview.md)
83
88
 
84
- [Releases](https://github.com/joshuafolkken/kit/releases) · [Security](./SECURITY.md) · [Contributing](./CLAUDE.md) · [Maintaining kit](./docs/maintainers/README.md) · [MIT](./LICENSE)
89
+ [Releases](https://github.com/joshuafolkken/kit/releases) · [Security](./SECURITY.md) · [Contributing](./docs/maintainers/README.md) · [MIT](./LICENSE)
package/SECURITY.md CHANGED
@@ -30,6 +30,7 @@ The `files` field of `package.json` decides what the published `@joshuafolkken/k
30
30
  - `.github/` — GitHub Actions workflows (CI, tagging, pull request classification, Dependabot auto-merge, SonarQube and production), composite actions, `dependabot.yml`, the pull request template and the release-notes config. `josh sync` overwrites the distributed workflows; their action references are pinned to commit SHAs. kit's own `publish.yml` ships in the package but is never copied into a project.
31
31
  - `lefthook/` — Git hook presets: lint before commit, checks before push.
32
32
  - The `preinstall` script `josh init` adds to `package.json` runs `pnpm dlx @aikidosec/safe-chain setup-ci` on every install, then a `node -e` check that only prints a warning, and only outside CI. The `prepare` script it adds runs `lefthook install` when Lefthook is present, then, when tsx is present, kit's `fix-gh-packages` script: only when the project `.npmrc` routes a scope to GitHub Packages, it reads a GitHub token (`NODE_AUTH_TOKEN`, a token in the project `.npmrc`, or `gh auth token`), queries GitHub Packages and rewrites tarball URLs in `pnpm-lock.yaml`.
33
+ - `.pnpmfile.mjs` — a pnpm `beforePacking` hook that removes that safe-chain `preinstall` from the manifest `pnpm pack` and `pnpm publish` write, and changes nothing else. `josh init` and `josh sync` copy it only into a project whose `package.json` is not `private: true`, and never over a pnpmfile of the project's own.
33
34
 
34
35
  **Agent instructions and skills**
35
36
 
package/cspell/index.yaml CHANGED
@@ -41,6 +41,10 @@ ignorePaths:
41
41
  # - '**/*.min.js'
42
42
  # - '**/*.svg'
43
43
  words:
44
+ # pnpm's `.pnpmfile.mjs` hook file that strips the safe-chain preinstall at pack time
45
+ # (joshuafolkken/kit#2693). Distributed, because `josh init` / `josh sync` copy that file, which
46
+ # names itself, into a published consumer (joshuafolkken/kit#3110).
47
+ - pnpmfile
44
48
  # Git's `--show-toplevel` flag is added to every Codex hook command when `josh sync` copies the
45
49
  # hooks into a consumer. The consumer spell-checks that transformed file with this dictionary.
46
50
  - toplevel
@@ -1,8 +1,8 @@
1
1
  # Project instructions
2
2
 
3
- - 既存のファイルと利用者の設定を尊重し、変更する前に内容を確認する。
4
- - 変更には検証を付け、実行した結果を報告する。
5
- - HTML、CSS、JavaScript のファイルがある場合は Prettier で整形する。
6
- - 画面に見える変更をした場合はブラウザーで表示と操作を確認する。
7
- - JavaScript または TypeScript の動作を変更した場合は、その動作を確認する自動テストを追加する。
8
- - Git や GitHub を使う場合だけ、それぞれのワークフローを利用する。
3
+ - Respect existing files and the user's settings, and read a file's contents before changing it.
4
+ - Verify every change, and report the results you actually observed.
5
+ - Format HTML, CSS and JavaScript files with Prettier when the project has any.
6
+ - After a change that is visible on screen, check its display and interaction in a browser.
7
+ - After changing JavaScript or TypeScript behavior, add an automated test that checks that behavior.
8
+ - Use the Git or GitHub workflow only when you use Git or GitHub.
package/dist/CLAUDE.md CHANGED
@@ -36,7 +36,7 @@ Classify each decision point into one tier and act; stop **only** when the choic
36
36
 
37
37
  ## Environment Variables
38
38
 
39
- A `.env` at the project root: `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` are required for notifications; `JOSH_SESSION_LANG`, `PORT_SEED` and `JOSH_REPO_PATHS` are optional and personal. Setup and semantics: [docs/scripts-ai.md](https://github.com/joshuafolkken/kit/blob/main/docs/scripts-ai.md) and [docs/josh-commands.md](https://github.com/joshuafolkken/kit/blob/main/docs/josh-commands.md).
39
+ A `.env` at the project root: `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` are required for notifications; `JOSH_SESSION_LANG`, `PORT_SEED` and `JOSH_REPO_PATHS` are optional and personal. Details: [environment-variables.md](https://github.com/joshuafolkken/kit/blob/main/docs/environment-variables.md), [josh-commands.md](https://github.com/joshuafolkken/kit/blob/main/docs/josh-commands.md).
40
40
 
41
41
  **GitHub operations are `gh api` (REST) — instructing prose included — and need `gh` installed; some environments lack it.** Auth: `gh auth login`; `GH_TOKEN` in CI/cloud. `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/gh-rest.md`.
42
42
 
@@ -100,12 +100,14 @@ A `.env` at the project root: `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` are re
100
100
 
101
101
  For every code modification, in order:
102
102
 
103
- 0. **Work summary + test declaration** _(before writing any implementation code)_: a two-layer summary — a plain-language overview a non-programmer can follow (three lines, **Now / Change / Check**, one sentence each, in the session language; name the concrete subject in each line — subject-less prose is not acceptable; no file paths, function or type names, or CLI option flags — only internal identifiers are banned, not names the reader sees on screen), **Details**, then **every change with its test** (`<what changes> — Test: <Unit|E2E> — <file path> — <what it verifies>`). Ordinary markdown, **never wrapped in a code fence**, once per Issue before implementation — required in fullrun/halfrun/backlogrun even when the Issue body was filled (`kickoff` is exempt); completion reports lead with **Cause / Fix / Result**. `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/report-format.md`; `pnpm josh report:lint` checks the form, and a session's first runtime `Edit` / `Write` points here. Presentation only, never a confirmation stop.
103
+ 0. **Work summary + test declaration** _(before writing any implementation code)_: once per Issue, present a two-layer summary in ordinary markdown, **never wrapped in a code fence** — required in fullrun/halfrun/backlogrun even when the Issue body was filled (`kickoff` is exempt). Presentation only, never a confirmation stop. `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/report-format.md`; `pnpm josh report:lint` checks the form.
104
104
 
105
+ - **Overview** — three lines, **Now / Change / Check**, one sentence each, in the session language, that a non-programmer can follow; name the concrete subject in each line — subject-less prose is not acceptable. Use no file paths, function or type names, or CLI option flags — only internal identifiers are banned, not names the reader sees on screen.
106
+ - **Details**, then **every change with its test**: `<what changes> — Test: <Unit|E2E> — <file path> — <what it verifies>`. Completion reports lead with **Cause / Fix / Result**.
105
107
  - **Tests are required for ALL changes** — zero tests without explicit approval is a violation (bug fixes, timing/animation fixes and refactors included): bug fix → regression test; UI/animation/timing → E2E for the observable change; logic/utility → unit; refactor → tests pinning existing behavior BEFORE the change (`node_modules/@joshuafolkken/kit/prompts/refactoring.md`).
106
- - **Non-runtime updates (pre-approved manual-only exception)**: a change touching no executable runtime code path may proceed with manual verification — declare it in Step 0 and state why. It covers docs, non-executable config, editor/IDE files, and cosmetic asset swaps with no selector/path change; the mechanically exempt (`*.md`, `.editorconfig`, `.idea/**`, `.vscode/**`, `prompts/**`) are recognized by the command below, and the rest stay the exemption a person declares. A test infeasible for a runtime change needs its reason stated and user approval.
107
- - **Basic-profile manual-check exception:** when `package.json` records `josh.profile: basic` (or its former name `static`) and the change touches only files in languages kit cannot test (HTML/CSS, or sources such as Lua), verify by hand instead of with an automated test. For HTML/CSS, open the page in a browser and check layout, links and interactions in the HTML at the intended screen widths; for any other source, actually run the changed code. Report what you observed either way. JavaScript and TypeScript files still need automated tests, even when changed alongside. `pnpm josh test:declared` prints `exempt` with the reason in this case only.
108
- - **The commit stage answers this mechanically**: `pnpm josh test:declared` prints `required` / `exempt` / `satisfied` from the changed paths, and a runtime change with no test is refused at `pnpm josh git -y` on `required` — add the declared test or declare the non-runtime exception, then reissue (`node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/rule-delivery.md`).
108
+ - **Non-runtime updates (pre-approved manual-only exception)**: a change touching no executable runtime code path — docs, non-executable config, editor/IDE files, cosmetic asset swaps with no selector/path change — may be verified by hand; declare it in Step 0 with the reason. The mechanically exempt (`*.md`, `.editorconfig`, `.idea/**`, `.vscode/**`, `prompts/**`) need no declaration. A runtime change whose test is infeasible needs the reason and user approval.
109
+ - **Basic-profile manual-check exception:** under `josh.profile: basic` (or `static`), a change touching only languages kit cannot test (HTML/CSS, Lua …) is verified by hand — a browser check of layout, links and interactions in the HTML, or actually run the changed code — and reported; JavaScript and TypeScript still need tests. `node_modules/@joshuafolkken/kit/prompts/testing-guide.md`.
110
+ - **`pnpm josh test:declared`** answers `required` / `exempt` / `satisfied` from the changed paths; a runtime change with no test is refused at `pnpm josh git -y` on `required`.
109
111
  - **Read a target's line headroom before editing: `pnpm josh lines <path>`** — near the limit, `Target` carries the splitting plan.
110
112
 
111
113
  1. **Refactor first** — before any refactoring, read and follow `node_modules/@joshuafolkken/kit/prompts/refactoring.md`; apply high/medium refactoring to all new/modified code and do not proceed until none remain.
@@ -129,7 +131,11 @@ Run the full verification set **in order**; do not skip, reorder, or report comp
129
131
 
130
132
  ## Pre-commit Self-Review (mandatory)
131
133
 
132
- Before every `git commit` (follow-up commits included), self-review against `node_modules/@joshuafolkken/kit/prompts/review.md` — a subagent runs `/code-review`, never a main-line `Skill` load: the staged diff, and `git diff main...HEAD` before opening or updating a PR. Level from `pnpm josh review:brief --level-only`; resolve all high/medium findings; iterate — **no further than the round cap**, the last round a verification pass over the fix delta. Then route each remaining non-High finding through the three-way disposition: fix in place, file it as a follow-up Issue only when it is a confirmed defect that reaches a runtime path (`pnpm josh disposition <path>` answers `runtime` / `non-runtime`) — or drop it with a one-line PR note (the default). **A filed finding is run through `pnpm josh epic:bundle <new>` before the current Issue closes.** A confirmed High blocks rather than buying a round past the cap. `node_modules/@joshuafolkken/kit/prompts/review.md` → "Review round cap".
134
+ Before every `git commit` (follow-up commits included), self-review against `node_modules/@joshuafolkken/kit/prompts/review.md` — a subagent runs `/code-review`, never a main-line `Skill` load. `node_modules/@joshuafolkken/kit/prompts/review.md` → "Review round cap".
135
+
136
+ - **Scope** — the staged diff, and `git diff main...HEAD` before opening or updating a PR; level from `pnpm josh review:brief --level-only`.
137
+ - **Rounds** — resolve all high/medium findings, **no further than the round cap**, the last round a verification pass over the fix delta. A confirmed High blocks rather than buying a round past the cap.
138
+ - **Each remaining non-High finding** — fix in place, file it as a follow-up Issue only when it is a confirmed defect that reaches a runtime path (`pnpm josh disposition <path>`), or drop it with a one-line PR note (the default). **A filed finding is run through `pnpm josh epic:bundle <new>` before the current Issue closes.**
133
139
 
134
140
  ## Doc Sync Rules
135
141
 
@@ -137,14 +143,14 @@ Before every `git commit` (follow-up commits included), self-review against `nod
137
143
 
138
144
  ## Git Rules
139
145
 
140
- - **No commits** unless explicitly requested. **No PR merges, branch deletions, force pushes or other shared-state mutations** unless explicitly requested in the current turn — the default end state is PR still OPEN. **Exception**: invoking `fullrun` authorizes the merge, via `pnpm josh followup`. `.claude/settings.json` denies these, but the deny is narrower than the rule — never read "the tool let me" as permission. `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/operating-rules.md` → "指示されていない行動は取らない".
146
+ - **No commits** unless explicitly requested. **No PR merges, branch deletions, force pushes or other shared-state mutations** unless explicitly requested in the current turn — the default end state is PR still OPEN. **Exception**: invoking `fullrun` or `backlogrun` authorizes the merge, via `pnpm josh followup` — `prrun` does not. `.claude/settings.json` denies these, but the deny is narrower than the rule — never read "the tool let me" as permission. `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/operating-rules.md` → "指示されていない行動は取らない".
141
147
  - **Never stage or mutate the git index on your own.** `git add` / `git rm --cached` / `git restore --staged` / `git commit` overwrite the user's snapshot and are denied by settings; inspection is read-only. Staging is allowed only on an explicit current-turn instruction or an authorized commit flow (`pnpm josh git`). `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/operating-rules.md` → "git index を勝手に変更しない".
142
148
  - **For git operations use `pnpm josh git`.** After a failed push, fix, push manually, then `pnpm josh pr` — **never** `gh pr create` directly, which bypasses `closes #N` generation so the Issue will not auto-close.
143
149
  - **Start-of-conversation git status is a stale snapshot.** Before acting on any working-tree / index / stash / branch assumption, run `git status` (and `git stash list`) live first.
144
150
 
145
151
  ## Collaboration Workflow
146
152
 
147
- - For the issue-driven proposal/plan/execution/notification flow, follow `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/` (indexed by `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow.md`; each topic is its own file).
153
+ - The issue-driven flow is `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/`, indexed by `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow.md`.
148
154
  - **Before writing a rule as prose, place it by `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/residency.md`** — its single source. A computable answer goes to `pnpm josh oracle:list` and an ordering rule to `pnpm josh run:step`, never into `CLAUDE.md` or a prompt file.
149
155
  - **Count the target repository's open Issues before filing; above the WIP cap, close one first.** Nothing honestly closable means do not file. A filing the run is blocked by is exempt, and so is an **interrupt** — three tests decide that, never judgement: a verification answers wrongly, a documented workflow cannot complete, or data is lost or written outside the repository; both exemptions proceed, stating the overage. Meeting none of the three, a finding stays discretionary. `pnpm josh rule:guard` states it again at the call that files. The count command and both procedures: `node_modules/@joshuafolkken/kit/prompts/collaboration-workflow/wip-cap.md`.
150
156
 
@@ -162,11 +168,13 @@ Before every `git commit` (follow-up commits included), self-review against `nod
162
168
  | `halfrun [#N \| new]` | Implement + gate, then **stop before commit** for manual verification | + `halfrun.md` + `split-assessment.md` |
163
169
  | `backlogrun [#N1 #N2 …]` | Run named Issues and epics in order (an epic runs its children first), then drain the opted-in backlog — dependency order, lanes. `--only` stops after the named list | + `backlogrun.md` + `split-assessment.md` + the `fullrun` set |
164
170
 
165
- **`queue` and `epicrun` were removed** — tell a user who types `queue` to run `backlogrun #N1 #N2 …`, and one who types `epicrun` to run `backlogrun #E --only` (drop `--only` to also drain the backlog).
171
+ **`queue` and `epicrun` were removed** — point `queue` to `backlogrun #N1 #N2 …` and `epicrun` to `backlogrun #E --only`.
166
172
 
167
- **Three rules decide what a run does when the work turns out not to be one Issue** — the split assessment every entry point applies identically (**its default is not to split**: separability **and** a scope clearly exceeding one verification gate — the size guide in `split-assessment.md`, measured by `pnpm josh split:assess` — must both hold), a prerequisite discovered mid-run (a dependency, not parked), and a named `backlogrun` item that is not an epic. All bind only after a command has started, so all are read from the `workflow-commands` skill: `split-assessment.md`, `SKILL.md` → §2d, `backlogrun-child.md` → "When `#N` is not an epic", and `fullrun.md` / `halfrun.md` / `backlogrun.md` for the branch each entry takes.
173
+ **The `josh epic:*` commands have their own skill** — `epic:audit`, `epic:next`, `epic:bundle`, and how an epic spans repositories. **Read the `epic-commands` skill before running any of them, before writing an epic that tracks a child in another repository, and right after filing an issue.** Three rules bind outside those commands:
168
174
 
169
- **The `josh epic:*` commands have their own skill** — `epic:audit`, `epic:next`, `epic:bundle`, and how an epic spans repositories. **Read the `epic-commands` skill before running any of them, before writing an epic that tracks a child in another repository, and right after filing an issue.** Three rules stay here because they bind outside those commands: **recording a decision removes that child's `needs-decision` label** (Tier A); **fixing what the audit finds is Tier A**, park only when the contradiction is a design choice nobody has made; and **an epic in another repository is referenced as `owner/repo#N`** (a bare `#N` resolves to this repository's issue). Canonical reference: `.claude/skills/epic-commands/SKILL.md`.
175
+ - Recording a decision removes that child's `needs-decision` label (Tier A).
176
+ - **Fixing what the audit finds is Tier A**; park only when the contradiction is a design choice nobody has made.
177
+ - **An epic in another repository is referenced as `owner/repo#N`** — a bare `#N` resolves to this repository's issue.
170
178
 
171
179
  #### Explicit invocation required (MANDATORY)
172
180
 
@@ -177,18 +185,17 @@ Never start a `kickoff` / `halfrun` / `prrun` / `fullrun` / `backlogrun` workflo
177
185
  - Instead, **prompt the user to type the command themselves**, with the exact phrasing: "Please run \`<command>\` to start this task." (e.g. "Please run \`halfrun new\` to start this task.").
178
186
  - This applies even when the user authorized a related workflow in an earlier turn — each invocation must be re-typed in the current turn.
179
187
 
180
- **A session cut inside a declared budget is not a new invocation** — a `backlogrun` cut and resumed is the one invocation a person typed, and it continues rather than waiting to be retyped; **`backlogrun` alone**, though — a `fullrun` cut still waits for the keyword. Single source: `backlogrun-steps.md` → "The session cut is inside the invocation".
188
+ **A session cut inside a declared budget is not a new invocation — for `backlogrun` alone**: a resumed `backlogrun` continues, while a `fullrun` cut still waits for the keyword. `backlogrun-steps.md` → "The session cut is inside the invocation".
181
189
 
182
- **A `backlogrun` parks a child instead of stopping the run**, and its procedure is read from `backlogrun-park.md` → "park and continue", which is that rule's single source.
190
+ **A `backlogrun` parks a child instead of stopping the run** — `backlogrun-park.md` → "park and continue".
183
191
 
184
192
  #### Mid-workflow stop notification (`confirmation`)
185
193
 
186
- Whenever you pause **any** run mid-execution to wait for the user — a `kickoff` / `halfrun` / `prrun` / `fullrun` stop, an upstream-Issue interrupt, a Tier C confirmation — you MUST send a Telegram notification **before** stopping, so the user is alerted off-screen. `halfrun`'s built-in stop before commit is a confirmation pause and follows this same rule.
194
+ Before pausing **any** run to wait for the user — a command's stop (`halfrun`'s stop before commit included), an upstream-Issue interrupt, a Tier C confirmation — you MUST send this Telegram, so the user is alerted off-screen:
187
195
 
188
196
  ```bash
189
197
  pnpm josh notify --task-type confirmation --issue-url "<issue-url>" --body=$'<one-line reason>\n<what is needed from the user>'
190
198
  ```
191
199
 
192
- - Use `--body=...` (single token) when the body starts with `-`, otherwise `parseArgs` rejects it
193
- - Send only once per stop — do not spam if you re-evaluate within the same pause
194
- - Skip the notification when the stop was explicitly requested by the user in the same turn (they already know)
200
+ - Send it once per stop; skip it when the user asked for the stop in this same turn.
201
+ - Pass `--body=...` as one token when the body starts with `-`, otherwise `parseArgs` rejects it.
@@ -1,8 +1,8 @@
1
1
  # Project instructions
2
2
 
3
- - 既存のファイルと利用者の設定を尊重し、変更する前に内容を確認する。
4
- - 変更には検証を付け、実行した結果を報告する。
5
- - HTML、CSS、JavaScript のファイルがある場合は Prettier で整形する。
6
- - 画面に見える変更をした場合はブラウザーで表示と操作を確認する。
7
- - JavaScript または TypeScript の動作を変更した場合は、その動作を確認する自動テストを追加する。
8
- - Git や GitHub を使う場合だけ、それぞれのワークフローを利用する。
3
+ - Respect existing files and the user's settings, and read a file's contents before changing it.
4
+ - Verify every change, and report the results you actually observed.
5
+ - Format HTML, CSS and JavaScript files with Prettier when the project has any.
6
+ - After a change that is visible on screen, check its display and interaction in a browser.
7
+ - After changing JavaScript or TypeScript behavior, add an automated test that checks that behavior.
8
+ - Use the Git or GitHub workflow only when you use Git or GitHub.