@joshuafolkken/kit 1.1435.0 → 1.1453.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 (88) hide show
  1. package/.claude/skills/workflow-commands/backlogrun-park.md +2 -0
  2. package/.claude/skills/workflow-commands/backlogrun-steps.md +9 -7
  3. package/.claude/skills/workflow-commands/backlogrun.md +2 -2
  4. package/.claude/skills/workflow-commands/fullrun-steps.md +1 -1
  5. package/.claude/skills/workflow-commands/halfrun.md +1 -1
  6. package/.claude/skills/workflow-commands/kickoff.md +12 -13
  7. package/.claude/skills/workflow-commands/observation-filing.md +1 -1
  8. package/.claude/skills/workflow-commands/prerequisite.md +6 -0
  9. package/.claude/skills/workflow-commands/retrospective.md +5 -5
  10. package/.claude/skills/workflow-commands/split-assessment.md +2 -2
  11. package/README.md +15 -17
  12. package/dist/hooks/batch-guard.js +6 -6
  13. package/dist/hooks/{chunk-3LE6VLSR.js → chunk-3C4XRYG6.js} +18 -5
  14. package/dist/hooks/{chunk-JXQBK323.js → chunk-5C7L6FRC.js} +131 -104
  15. package/dist/hooks/{chunk-EMB55BDF.js → chunk-D3NJXN5M.js} +2 -2
  16. package/dist/hooks/{chunk-7KMN5QB5.js → chunk-EF5GQ6WS.js} +3 -3
  17. package/dist/hooks/{chunk-2G5F2YCD.js → chunk-LBFYEOXJ.js} +3 -3
  18. package/dist/hooks/{chunk-XER6SSIB.js → chunk-MBJYQPEK.js} +16 -6
  19. package/dist/hooks/{chunk-QL6QTPWN.js → chunk-NO4AALP5.js} +3 -3
  20. package/dist/hooks/{chunk-4BHUPFKF.js → chunk-OLMO72ON.js} +1 -1
  21. package/dist/hooks/{chunk-MSYSUSY6.js → chunk-SHYUQOIS.js} +5 -5
  22. package/dist/hooks/{chunk-5SJSSCJG.js → chunk-UT7YC3N2.js} +1 -1
  23. package/dist/hooks/{chunk-MU4LJFIV.js → chunk-W5ZKGTSY.js} +3 -3
  24. package/dist/hooks/{chunk-YZXYOAZ3.js → chunk-Y3GKIKGW.js} +11 -5
  25. package/dist/hooks/{chunk-YW452ZAX.js → chunk-Z4XI7CZS.js} +2 -2
  26. package/dist/hooks/codex-hook-adapter.js +13 -13
  27. package/dist/hooks/duplicate-read-guard.js +7 -7
  28. package/dist/hooks/format-edited.js +3 -3
  29. package/dist/hooks/inputs.json +241 -240
  30. package/dist/hooks/investigation-guard.js +7 -7
  31. package/dist/hooks/pretool-guard.js +12 -12
  32. package/dist/hooks/session-lang.js +3 -3
  33. package/dist/hooks/stop-guard.js +6 -6
  34. package/dist/josh.js +33 -10
  35. package/package.json +1 -1
  36. package/prompts/collaboration-workflow/issue-template.md +10 -8
  37. package/prompts/review.md +8 -4
  38. package/scripts/auto-ok/auto-ok-judge-cli.ts +125 -0
  39. package/scripts/auto-ok/auto-ok-judge-read.ts +95 -0
  40. package/scripts/auto-ok/auto-ok-judge-write.ts +109 -0
  41. package/scripts/auto-ok/auto-ok-judge.ts +67 -0
  42. package/scripts/backlog/backlog-drive-cli.ts +14 -0
  43. package/scripts/backlog/backlog-drive.ts +22 -3
  44. package/scripts/document/document-byte-budget.ts +1 -1
  45. package/scripts/fresh-machine/fresh-machine-patterns.ts +60 -15
  46. package/scripts/gate/project-checks.ts +5 -2
  47. package/scripts/gh/git-gh-issue-rest.ts +1 -0
  48. package/scripts/gh/git-gh-issue.ts +9 -0
  49. package/scripts/init/init-actions.ts +3 -3
  50. package/scripts/init/init-ai-copy.ts +1 -1
  51. package/scripts/init/init-basic.ts +1 -1
  52. package/scripts/init/init-bootstrap.ts +6 -2
  53. package/scripts/init/init-dry-run-report.ts +150 -0
  54. package/scripts/init/init-dry-run.ts +189 -0
  55. package/scripts/init/init-install.ts +8 -1
  56. package/scripts/init/init.ts +57 -19
  57. package/scripts/init/kit-setup-state.ts +11 -17
  58. package/scripts/init/own-formatter.ts +21 -0
  59. package/scripts/init/project-profile.ts +25 -6
  60. package/scripts/init/start-dry-run.ts +70 -0
  61. package/scripts/init/start-plan.ts +8 -3
  62. package/scripts/init/start-setup-pr.ts +13 -24
  63. package/scripts/init/start-steps.ts +16 -1
  64. package/scripts/init/start.ts +38 -18
  65. package/scripts/init/working-tree.ts +116 -0
  66. package/scripts/issue/issue-auto-ok.ts +68 -99
  67. package/scripts/issue/issue-file-cli.ts +17 -17
  68. package/scripts/issue/issue-file.ts +1 -6
  69. package/scripts/issue/issue-labels.ts +6 -2
  70. package/scripts/issue/issue-release-cli.ts +69 -23
  71. package/scripts/issue/issue-release.ts +3 -1
  72. package/scripts/josh/josh-commands-ai.ts +11 -0
  73. package/scripts/josh/josh-commands-issue.ts +3 -3
  74. package/scripts/josh/josh-commands-project.ts +2 -2
  75. package/scripts/josh/process-identity.ts +32 -6
  76. package/scripts/lane/lane-broker-server.ts +69 -0
  77. package/scripts/lane/lane-session-broker.ts +37 -14
  78. package/scripts/observations/observation-ledger-migrate.ts +3 -15
  79. package/scripts/release/release-issue-close.ts +133 -0
  80. package/scripts/release/release-publish.ts +12 -1
  81. package/scripts/repo/repository-labels.ts +11 -1
  82. package/scripts/review/comment-ranges.ts +199 -0
  83. package/scripts/review/review-brief-cli.ts +22 -5
  84. package/scripts/review/review-code-tree.ts +119 -0
  85. package/scripts/review/review-round2-cli.ts +16 -5
  86. package/scripts/review/review-round2.ts +30 -10
  87. package/scripts/review/review-stamps.ts +22 -1
  88. package/scripts/uninstall/distributed-files.ts +1 -1
@@ -103,6 +103,8 @@ It never carries:
103
103
 
104
104
  - a choice with a clearly better default — that is Tier A: decide it and record it as an Issue comment;
105
105
  - whether to run something already planned and opted in with `auto-ok` — the opt-in is that decision;
106
+ - a wait for the next published release — a dependency, `pnpm josh issue:release <N> --wait`
107
+ (`prerequisite.md`);
106
108
  - a defect in the running repository's own run tooling — the run fixes it and resumes
107
109
  (`prompts/collaboration-workflow/upstream-interrupt.md` → "実行中のリポジトリ自身のラン機構の不具合").
108
110
 
@@ -12,12 +12,12 @@ runs is stated by the keyword and its arguments, never inferred from a request's
12
12
  that would bound this the other way are prohibited** — dropping a run's own filings, and requiring a
13
13
  person's `auto-ok` on a child; the brake below bounds it. A Tier C action inside a child still stops that child.
14
14
 
15
- **`pnpm josh issue:file` decides the `auto-ok` default and prints it** — `auto-ok: applied` or
16
- `auto-ok: not applied` with the reason; `scripts/issue/issue-auto-ok.ts` is the single source. **Pass
17
- `--no-auto-ok` only when the new issue needs a person's judgement** — a Tier B toss-up or a Tier C
18
- action inside it. The retrospective's filings take the same default and count against the same brake.
19
- **A filing a person asked for declares `--requested` and takes no default** — `auto-ok` only when they
20
- named it (`kickoff.md` → "Words typed after `new`").
15
+ **`pnpm josh issue:file` judges `auto-ok` and prints it** — `auto-ok: applied` or
16
+ `auto-ok: not applied` with the reason; `scripts/issue/issue-auto-ok.ts` is the single source. Every
17
+ filing is judged the same way, whoever asked for it: the excluded labels, then the body's
18
+ `- 人の判断:` declaration (`issue-template.md`). **Declare `- 人の判断: 要` when the new issue needs a
19
+ person's judgement** — a Tier B toss-up or a Tier C action inside it; `--no-auto-ok` withholds it too.
20
+ The retrospective's filings are judged the same way and count against the same brake.
21
21
 
22
22
  Rationale: `docs/maintainers/backlogrun-steps-rationale.md` → "Why the authorization boundary is shaped this way";
23
23
  provenance of each rule: `docs/maintainers/backlogrun-steps-rationale.md` → "Where each rule came from"
@@ -115,7 +115,8 @@ person, Out of scope) to the person in the session language, with any truncated-
115
115
  the loop, leaving whatever is still labelled parked.
116
116
 
117
117
  **`needs-decision`, `run:solo`, `run:lane` and `priority:high` are the only workflow labels a run
118
- applies by hand** — never `auto-ok` or `needs-human-review` (`needs-human-review.md`).
118
+ applies by hand** — never `needs-human-review` (`needs-human-review.md`), and `auto-ok` only through
119
+ `pnpm josh issue:file` or `pnpm josh auto-ok:judge`, which check the exclusions first.
119
120
 
120
121
  Rationale: `docs/maintainers/backlogrun-steps-rationale.md` → "Why the plan and the decision pass come first"
121
122
 
@@ -130,6 +131,7 @@ section the row names:
130
131
  | Handed back | What the session does | Read |
131
132
  | --- | --- | --- |
132
133
  | `triage` | Label each issue stderr names `run:solo` or `run:lane` (`blocked-by` where one must land first) | "Resolve what the plan can resolve, before starting" above |
134
+ | `judge` | For each number `pnpm josh auto-ok:judge` prints, read the issue (`pnpm josh issue:read <N>`) and answer `--apply <N> --lane\|--solo` or `--decline <N> --reason "<why>"` | `docs/josh-commands-backlog.md` → "`josh auto-ok:judge`" |
133
135
  | `offer` | Report what stderr printed — a failed offer, or a named issue whose state stayed unreadable; **never pick an issue by hand** | — |
134
136
  | `launch #N` | Read the lane's log and park `#N` | `backlogrun-park.md` → "park and continue" |
135
137
  | `merge [<token>] #N` | `environment` ends the run; the others re-read the child | `backlogrun-progress.md` → "Running a named epic's children" |
@@ -35,7 +35,7 @@ is still that one invocation (`backlogrun-steps.md` → "The session cut is insi
35
35
  2. **Begin the carry record before the plan** — `pnpm josh run:carry --begin "<invocation>" --owner
36
36
  "$PPID"` and `pnpm josh run:wake --start`, in the same turn as the first `pnpm josh ms`.
37
37
  3. **What this invocation approves** — the opted-in pool, a run's own filings once bundled, and the
38
- brake that bounds the amount; the route table's row points at the single source of the `auto-ok` default.
38
+ brake that bounds the amount; the route table's row points at the single source of the `auto-ok` rule.
39
39
  4. **Report the plan before the first child** — `pnpm josh backlog:plan`, then resolve every
40
40
  `needs-decision` issue decidable from its body in one pass, recording `blocked-by`, `run:solo` and
41
41
  `run:lane` in the same pass.
@@ -56,7 +56,7 @@ never a whole document (`SKILL.md` → "A section reference is read as a section
56
56
  | The moment | Read |
57
57
  | --- | --- |
58
58
  | The entry: the carry record and its answers | `backlogrun-steps.md` → "The session cut is inside the invocation" |
59
- | What the invocation may merge, and the `auto-ok` default | `backlogrun-steps.md` → "What one invocation approves" |
59
+ | What the invocation may merge, and the `auto-ok` rule | `backlogrun-steps.md` → "What one invocation approves" |
60
60
  | Before the first child: the plan and the decision pass | `backlogrun-steps.md` → "The plan, before the first child starts" |
61
61
  | The driver hands a branch back | `backlogrun-steps.md` → "The loop" |
62
62
  | Once per session | `backlogrun-steps.md` → "What runs once per session, not once per issue" |
@@ -45,7 +45,7 @@ primary checkout; a Claude run keeps it.
45
45
  ## The `fullrun new` step list
46
46
 
47
47
  `kickoff new` + `fullrun #N` in one run. Steps: (1) Derive an English title, or use the provided one.
48
- (2) Create Issue: `pnpm josh issue:file "<title>" --body-file <body-file> --depth <n> --requested`,
48
+ (2) Create Issue: `pnpm josh issue:file "<title>" --body-file <body-file> --depth <n>`,
49
49
  with the labels `kickoff.md` → "Words typed after `new`" maps (per
50
50
  `prompts/collaboration-workflow/issue-template.md`) — its duplicate scan runs first, and a candidate
51
51
  that covers the same work stops the run rather than filing a second Issue (`issue-scout.md`). Capture
@@ -42,7 +42,7 @@ back with fixes, treat each as a new round: implement, re-run `pnpm josh gate`,
42
42
 
43
43
  `halfrun new` or `halfrun new "<title>"`: `kickoff new` + `halfrun #<N>` (no Issue exists yet). Steps
44
44
  mirror `fullrun new` (1)–(8): derive an English title (or use the provided one) → create the Issue
45
- (`pnpm josh issue:file "<title>" --body-file <body-file> --depth <n> --requested`, with the labels
45
+ (`pnpm josh issue:file "<title>" --body-file <body-file> --depth <n>`, with the labels
46
46
  `kickoff.md` → "Words typed after `new`" maps, body per
47
47
  `prompts/collaboration-workflow/issue-template.md`; its duplicate scan is read per `issue-scout.md`) → add `in-progress` (as `fullrun new` (3)) → post the agreed plan → stash
48
48
  any pre-existing changes with `git stash push -m "halfrun new: pre-existing changes" -- ':!.josh/observations'`
@@ -43,8 +43,7 @@ is read on demand when a split is found.
43
43
  - `kickoff new` or `kickoff new "<title>"`: No Issue exists yet. Steps: (0) **Scope assessment** per
44
44
  `split-assessment.md`. If multiple → the **multi-issue split path**; if single → the **single-issue
45
45
  path**. **Single-issue path**: (1) Derive an English title from the conversation, or use the provided
46
- title. (2) Create Issue: `pnpm josh issue:file "<title>" --body-file <body-file> --depth <n>
47
- --requested` plus the labels the words typed after `new` name ("Words typed after `new`", below) (body
46
+ title. (2) Create Issue: `pnpm josh issue:file "<title>" --body-file <body-file> --depth <n>` plus the labels the words typed after `new` name ("Words typed after `new`", below) (body
48
47
  per `prompts/collaboration-workflow/issue-template.md`) — its duplicate scan runs first, and a
49
48
  candidate that covers the same work stops the run rather than filing a second Issue (`SKILL.md` →
50
49
  `issue-scout.md`). Capture `<N>`. (3)
@@ -52,7 +51,7 @@ is read on demand when a split is found.
52
51
  Telegram notification. (5) **Stop** — do not implement. **Multi-issue split path**: (1) For each
53
52
  independent deliverable, derive a focused English title and create a separate Issue with the
54
53
  `route:split` label (its duplicate scan is read per `issue-scout.md`): `pnpm josh issue:file
55
- "<sub-title>" --body-file <body-file> --depth <n> --route split --requested` plus the labels the words typed after `new` name. Capture each Issue number. **When the split is filed into a repository other than
54
+ "<sub-title>" --body-file <body-file> --depth <n> --route split` plus the labels the words typed after `new` name. Capture each Issue number. **When the split is filed into a repository other than
56
55
  the one this session is running in**, every child body gets the `## Origin` backlink described in the
57
56
  cross-package rule the AI documents keep resident, the epic body carries the same link as prose or a
58
57
  plain bullet (never as a checkbox row, which would disable its auto-close), and the originating Issue
@@ -85,15 +84,15 @@ An Issue a consumer can use only once it is published is filed with `--release`
85
84
 
86
85
  ## Words typed after `new`
87
86
 
88
- **An Issue a person asked for is filed with `--requested`** — every `new` entry (each child of its
89
- multi-issue split included), and a request in conversation. A live carry record or an `auto-ok` branch Issue then does not opt it in, so no lane takes
90
- it before the person picks the run; `auto-ok` comes only from the words below (`issue-auto-ok.ts`). A
91
- filing the run decides on its own — observation, retrospective, a split the run finds itself, routed — never declares it.
87
+ **`auto-ok` is judged by `pnpm josh issue:file`, never typed** — by the same criteria as every
88
+ filing: the excluded labels and the body's `- 人の判断:` declaration, and a `不要` declaration also needs a run label
89
+ (`issue-template.md`).
90
+ `auto ok` typed after `new` adds nothing.
92
91
 
93
- **Words after `new`** (`kickoff new auto ok high`) are read like `into <target>`, never inferred. Each
94
- adds its labels to the `--requested` filing; a word not in the table is asked about:
92
+ **Words after `new`** (`kickoff new high`) are read like `into <target>`, never inferred. Each adds its
93
+ labels to the filing; a word not in the table is asked about:
95
94
 
96
- | Typed | Added to `pnpm josh issue:file` |
97
- | --------- | ---------------------------------- |
98
- | `auto ok` | `--label auto-ok --label run:lane` |
99
- | `high` | `--label priority:high` |
95
+ | Typed | Added to `pnpm josh issue:file` |
96
+ | --------- | ------------------------------- |
97
+ | `auto ok` | nothing — `issue:file` judges it |
98
+ | `high` | `--label priority:high` |
@@ -70,7 +70,7 @@ defines, before the create call.
70
70
 
71
71
  - **It is read off the subject, exactly as the table is** — so applying it is not a judgement and not
72
72
  a person's to make, which is what separates it from `auto-ok` and `needs-human-review`. Those two
73
- decide what a run may do (`auto-ok` by `issue:file`'s default for a filing found by opted-in work —
73
+ decide what a run may do (`auto-ok` by `issue:file`'s judgement against the criteria —
74
74
  `backlogrun-steps.md` → "What one invocation approves"); this one records what an Issue is about
75
75
  and withholds nothing.
76
76
  - **Applied at filing, not at completion.**
@@ -28,6 +28,12 @@ action. `pnpm josh run:merge` enforces the computable half: an unfinished child
28
28
  blocked-by is released to **wait** — no `needs-decision` label, no failure counted — and the backlog
29
29
  offer hands it back once its blockers merge.
30
30
 
31
+ **A wait for the next published release is a dependency too** — never `needs-decision`. Record it
32
+ with `pnpm josh issue:release <M> --wait` (`<M>` blocked by the release Issue, filed when none is
33
+ open), then stash, comment and `pnpm josh run:release <M>` as for a prerequisite below; `fullrun` /
34
+ `halfrun` stop, `backlogrun` continues. Closing the release Issue once a person has published it hands
35
+ `<M>` back to `backlog:next` (`docs/josh-commands-backlog.md` → `josh issue:release`).
36
+
31
37
  **File the prerequisite with the `route:tier-a` label**, so a Tier A filing made during implementation
32
38
  stays countable by filing route afterwards. **This paragraph belongs to the prerequisite row, not to
33
39
  the table** — the label means a filing the run is *blocked by*, so the observation row carries no
@@ -4,7 +4,7 @@
4
4
  not at the entry.** `SKILL.md` → §2's table keeps the rule itself: run what `run:step` prints once,
5
5
  file the improvements worth carrying into the next run, stack the rest, and mark the step done.
6
6
  Everything that decides *how* — what the four sections mean, how the top two are chosen, the
7
- exclusions, and the `auto-ok` default — is here. Read it in full, in the same turn, before filing.
7
+ exclusions, and the `auto-ok` judgement — is here. Read it in full, in the same turn, before filing.
8
8
 
9
9
  **When it fires is not this file's, and not a judgement.** The run driver prints the step the moment the
10
10
  backlog drains — `backlog:offer` marks that drain on the event stream and `run:step` fires the
@@ -56,10 +56,10 @@ Issue, as after any filing.
56
56
 
57
57
  ## `auto-ok`, and closing the step
58
58
 
59
- **What a retrospective files carries `auto-ok`** — it files while the carry record is live, so
60
- `issue:file`'s default applies the label and the next run picks the improvements up without waiting
61
- for a person. **`backlogrun-steps.md` → "What one invocation approves" is that default's single
62
- source**; it is written there, beside the brakes that bound it, rather than restated here. Every brake still counts a retrospective's filings: the
59
+ **What a retrospective files is judged for `auto-ok`** — an improvement that needs no person's
60
+ judgement declares `- 人の判断: 不要`, so `issue:file` applies the label (with the run label `prompts/collaboration-workflow/issue-template.md` requires) and the next run picks it up
61
+ without waiting for a person. **`backlogrun-steps.md` → "What one invocation approves" is that
62
+ judgement's single source**; it is written there, beside the brakes that bound it, rather than restated here. Every brake still counts a retrospective's filings: the
63
63
  ten-per-invocation ceiling, the WIP cap, `--max` and the 150,000-token session budget.
64
64
 
65
65
  **Close with `pnpm josh run:carry --retrospective --summary "<result>" --owner "$PPID"`.** It marks the
@@ -77,8 +77,8 @@ moment that child merges and closes.
77
77
 
78
78
  **Each split child is filed with the `route:split` label** —
79
79
  `pnpm josh issue:file "<sub-title>" --body-file <body-file> --depth <n> --route split` — so the
80
- backlog's composition stays countable by filing route rather than by grepping issue bodies. A split of
81
- a person's `kickoff new` also takes `--requested` (`kickoff.md` → "Words typed after `new`").
80
+ backlog's composition stays countable by filing route rather than by grepping issue bodies. Each child
81
+ is judged for `auto-ok` like any filing (`kickoff.md` → "Words typed after `new`").
82
82
 
83
83
  ## Promote, or create a new epic
84
84
 
package/README.md CHANGED
@@ -6,9 +6,9 @@ kit gives Claude Code or Codex your project's rules and checks.
6
6
 
7
7
  ## The workflow
8
8
 
9
- Type `backlogrun` and the agent takes the Issues you name from plan to merged PR — in parallel, unattended. A live board shows where each one stands:
9
+ `backlogrun` takes your Issues to merged PRs — in parallel, unattended:
10
10
 
11
- ![The backlogrun board: ten Issues running side by side, seven already merged, each with its stage and elapsed time](./docs/images/backlogrun-board.png)
11
+ ![The backlogrun board: ten Issues in one run, three already merged and the rest moving through their stages or waiting for a free lane, with recent findings and decisions below](./docs/images/backlogrun-board.png)
12
12
 
13
13
  [Every keyword, including the ones that stop for you earlier](./docs/how-to/run-issues.md)
14
14
 
@@ -23,7 +23,9 @@ Type `backlogrun` and the agent takes the Issues you name from plan to merged PR
23
23
 
24
24
  ## Quick start
25
25
 
26
- ### With the GitHub workflow
26
+ Pick one setup ([A or B: what differs](./docs/setup/choose.md)):
27
+
28
+ ### A. With GitHub — Issues, PRs and unattended runs
27
29
 
28
30
  Requires [Node.js, pnpm and the gh CLI](./docs/setup/prerequisites.md).
29
31
 
@@ -35,9 +37,9 @@ pnpm exec josh start
35
37
 
36
38
  Next: [tutorial](./docs/tutorial.md)
37
39
 
38
- ### Your first backlogrun
40
+ #### Your first backlogrun
39
41
 
40
- Tell the agent the change you want, then type `kickoff new auto ok` to it (or add the `auto-ok` label to an existing Issue).
42
+ Tell the agent the change you want, then type `kickoff new` to it. The Issue gets the `auto-ok` label when it needs no judgement from you (or add the label to an existing Issue).
41
43
 
42
44
  ```bash
43
45
  pnpm josh backlogrun
@@ -45,7 +47,7 @@ pnpm josh backlogrun
45
47
 
46
48
  Details: [Run the backlog unattended](./docs/how-to/run-backlog.md)
47
49
 
48
- ### AI assistant only — no GitHub account needed
50
+ ### B. Without GitHub — AI assistant only
49
51
 
50
52
  Requires [Node.js and pnpm](./docs/setup/prerequisites.md).
51
53
 
@@ -55,20 +57,16 @@ pnpm --allow-build=esbuild dlx @joshuafolkken/kit init
55
57
 
56
58
  Next: [tutorial](./docs/tutorial.md#without-github-one-change-checked-locally)
57
59
 
58
- ## Claude Code in a fresh-machine run
59
-
60
- A [`josh fresh:run`](./docs/maintainers/fresh-machine.md) scenario that runs Claude Code needs a sign-in, saved once:
60
+ ### Adding kit to an existing project
61
61
 
62
- 1. In a terminal at the kit repository, run:
62
+ - **Files written:** settings per profile, including Prettier — always on `full`, and on `basic` only when the project has web files and no formatter of its own ([per profile](./docs/init.md#project-profiles)); `--dry-run` previews them.
63
+ - **Overwritten by `josh sync`:** the managed files, such as `.github/workflows/ci.yml` and `AGENTS.md` ([the list](./docs/sync.md#ai-files-overwritten)).
64
+ - **Permissions:** the Claude Code settings kit writes (with `josh start`, or on `full`) set `bypassPermissions` with `Bash(*)`, guarded by a deny list and a hook ([how to opt out](./docs/init.md#claude-code-permission-mode)).
65
+ - **On GitHub:** `josh start` adds labels, and on an existing `main` an Issue and a setup PR that you merge yourself ([the steps](./docs/init.md#josh-init-or-josh-start)).
63
66
 
64
- ```bash
65
- pnpm josh auth:setup
66
- ```
67
+ ## Claude Code in a fresh-machine run
67
68
 
68
- 2. A browser opens: sign in with your Claude account and press "Authorize".
69
- 3. Done when the terminal prints `saved: CLAUDE_CODE_OAUTH_TOKEN (macOS keychain)`. There is no token to copy or write into a file.
70
- 4. To check, run `pnpm josh auth:setup --check`: it prints `ok` and the day it was saved.
71
- 5. When the token expires, Claude Code in the container fails to sign in — start again from step 1.
69
+ A `josh fresh:run` scenario that runs Claude Code needs a sign-in saved once with `pnpm josh auth:setup` ([steps](./docs/maintainers/fresh-machine.md#claude-code)).
72
70
 
73
71
  ## Docs
74
72
 
@@ -9,12 +9,12 @@ import {
9
9
  load_environment_file,
10
10
  notice_refusal_path,
11
11
  refusal_path
12
- } from "./chunk-7KMN5QB5.js";
13
- import "./chunk-5SJSSCJG.js";
14
- import "./chunk-MU4LJFIV.js";
15
- import "./chunk-XER6SSIB.js";
16
- import "./chunk-4BHUPFKF.js";
17
- import "./chunk-3LE6VLSR.js";
12
+ } from "./chunk-EF5GQ6WS.js";
13
+ import "./chunk-UT7YC3N2.js";
14
+ import "./chunk-W5ZKGTSY.js";
15
+ import "./chunk-MBJYQPEK.js";
16
+ import "./chunk-OLMO72ON.js";
17
+ import "./chunk-3C4XRYG6.js";
18
18
  import "./chunk-DGT54IH5.js";
19
19
  export {
20
20
  DISABLED_VALUES,
@@ -668,6 +668,7 @@ var START_TIME_FORMAT = "lstart=";
668
668
  var PID_FLAG = "-p";
669
669
  var PROBE_ENVIRONMENT = { TZ: "UTC", LC_ALL: "C" };
670
670
  var LIVENESS_SIGNAL = 0;
671
+ var NO_SUCH_PROCESS = "ESRCH";
671
672
  var LOWEST_REAL_PID = 1;
672
673
  var PROC_START_FIELD_INDEX = 19;
673
674
  var BEACON_SCHEME = "socket:";
@@ -682,15 +683,20 @@ var BEACON_GONE_STATUS = 2;
682
683
  var SOCKET_PROBE_SOURCE = `const net=require('node:net');const socket=net.createConnection(process.argv[1]);socket.once('connect',()=>process.exit(${String(BEACON_LIVE_STATUS)}));socket.once('error',(error)=>process.exit(['ECONNREFUSED','ENOENT'].includes(error.code)?${String(BEACON_GONE_STATUS)}:${String(BEACON_UNKNOWN_STATUS)}));socket.setTimeout(1000,()=>process.exit(${String(BEACON_UNKNOWN_STATUS)}));`;
683
684
  var beacons = /* @__PURE__ */ new Map();
684
685
  var exit_cleanup = { is_registered: false };
685
- function is_live_pid(pid) {
686
- if (pid < LOWEST_REAL_PID) return false;
686
+ function signal_refusal(pid) {
687
687
  try {
688
688
  process.kill(pid, LIVENESS_SIGNAL);
689
- return true;
690
- } catch {
691
- return false;
689
+ return void 0;
690
+ } catch (error) {
691
+ return error.code ?? NO_SUCH_PROCESS;
692
692
  }
693
693
  }
694
+ function is_live_pid(pid) {
695
+ return pid >= LOWEST_REAL_PID && signal_refusal(pid) === void 0;
696
+ }
697
+ function is_present_pid(pid) {
698
+ return pid >= LOWEST_REAL_PID && signal_refusal(pid) !== NO_SUCH_PROCESS;
699
+ }
694
700
  function read_proc_start(pid) {
695
701
  try {
696
702
  const stat = readFileSync(`/proc/${String(pid)}/stat`, "utf8");
@@ -816,6 +822,11 @@ function is_same_process(pid, recorded_start, read3 = read_start) {
816
822
  if (recorded_start === void 0) return void 0;
817
823
  return matches_recorded_start(pid, recorded_start, read3);
818
824
  }
825
+ function is_present_process(pid, recorded_start, read3 = read_start) {
826
+ if (!is_present_pid(pid)) return false;
827
+ if (recorded_start === void 0) return void 0;
828
+ return matches_recorded_start(pid, recorded_start, read3);
829
+ }
819
830
  function is_own_process(pid, recorded_start) {
820
831
  return pid === process.pid && recorded_start === own_start();
821
832
  }
@@ -824,6 +835,8 @@ var process_identity = {
824
835
  is_live_beacon,
825
836
  is_live_pid,
826
837
  is_own_process,
838
+ is_present_pid,
839
+ is_present_process,
827
840
  is_same_process,
828
841
  open_beacon,
829
842
  own_fields,