jackherd 1.7.0 → 1.8.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 (157) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/INSTALL.md +4 -2
  3. package/{NOTICE → NOTICE.txt} +1 -1
  4. package/README.md +94 -1033
  5. package/assets/icons/bark-dark.svg +1 -1
  6. package/assets/icons/bark.svg +1 -1
  7. package/assets/icons/bowl-dark.svg +1 -1
  8. package/assets/icons/bowl.svg +1 -1
  9. package/assets/icons/decide-dark.svg +1 -1
  10. package/assets/icons/decide.svg +1 -1
  11. package/assets/icons/ear-dark.svg +1 -1
  12. package/assets/icons/ear.svg +1 -1
  13. package/assets/icons/lanes-dark.svg +1 -1
  14. package/assets/icons/lanes.svg +1 -1
  15. package/assets/icons/plan-dark.svg +1 -1
  16. package/assets/icons/plan.svg +1 -1
  17. package/dist/{chunk-OBUWTQ6Z.js → chunk-M6DDZEW4.js} +24 -10
  18. package/dist/config.d.ts +11 -5
  19. package/dist/config.js +53 -21
  20. package/dist/plan-format.d.ts +73 -7
  21. package/dist/plan-format.js +180 -100
  22. package/docs/workflow-dark.svg +1 -1
  23. package/docs/workflow.svg +1 -1
  24. package/herdr-plugin/herdr-plugin.toml +1 -1
  25. package/install.sh +1 -1
  26. package/kit/hooks/hooks/approval-gate/herdr-panes.ts +2 -12
  27. package/kit/hooks/hooks/approval-gate/index.ts +10 -8
  28. package/kit/hooks/hooks/approval-gate/run.ts +21 -12
  29. package/kit/hooks/hooks/ask-hint/decision.ts +3 -3
  30. package/kit/hooks/hooks/git-guard/decision.ts +189 -15
  31. package/kit/hooks/hooks/git-guard/index.ts +13 -3
  32. package/kit/hooks/hooks/git-guard/push-target.ts +85 -0
  33. package/kit/hooks/hooks/git-guard/repository.ts +63 -0
  34. package/kit/hooks/hooks/merge-guard/check-free.ts +1 -13
  35. package/kit/hooks/hooks/merge-guard/decision.ts +342 -102
  36. package/kit/hooks/hooks/merge-guard/index.ts +6 -4
  37. package/kit/hooks/hooks/merge-guard/plain-path.ts +15 -0
  38. package/kit/hooks/hooks/merge-guard/plan-approval-record.ts +23 -0
  39. package/kit/hooks/hooks/merge-guard/plan-approval-settings.ts +142 -0
  40. package/kit/hooks/hooks/merge-guard/plan-approval-sources.ts +196 -0
  41. package/kit/hooks/hooks/merge-guard/plan-approval.ts +168 -0
  42. package/kit/hooks/hooks/merge-guard/plan-growth.ts +40 -0
  43. package/kit/hooks/hooks/merge-guard/plan-pointers.ts +194 -0
  44. package/kit/hooks/hooks/merge-guard/pull-request.ts +67 -21
  45. package/kit/hooks/hooks/merge-guard/run.ts +118 -29
  46. package/kit/hooks/hooks/merge-guard/settings.ts +8 -8
  47. package/kit/hooks/hooks/merge-guard/worker.ts +3 -3
  48. package/kit/hooks/hooks/shared/base-branch.ts +23 -0
  49. package/kit/hooks/hooks/shared/board-lanes.ts +93 -0
  50. package/kit/hooks/hooks/shared/command-text-runners.ts +71 -0
  51. package/kit/hooks/hooks/shared/command.ts +14 -2
  52. package/kit/hooks/hooks/shared/commit.ts +2 -0
  53. package/kit/hooks/hooks/shared/dialog-answers.ts +4 -1
  54. package/kit/hooks/hooks/shared/json.ts +10 -0
  55. package/kit/hooks/hooks/shared/lane.ts +57 -0
  56. package/kit/hooks/hooks/shared/once.ts +8 -0
  57. package/kit/hooks/hooks/shared/own-pane.ts +31 -0
  58. package/kit/hooks/hooks/shared/pane-agent.ts +24 -0
  59. package/kit/hooks/hooks/shared/plan-open-phases.ts +114 -0
  60. package/kit/hooks/hooks/shared/program-position.ts +148 -5
  61. package/kit/hooks/hooks/shared/shell-aliases.ts +258 -0
  62. package/kit/hooks/hooks/shared/shell-snapshots.ts +68 -0
  63. package/kit/hooks/hooks/shared/shell.ts +167 -20
  64. package/kit/hooks/hooks.json +11 -2
  65. package/kit/hooks/statusline.sh +29 -16
  66. package/kit/review/skills/diagnose/SKILL.md +1 -1
  67. package/kit/review/skills/review/SKILL.md +2 -0
  68. package/kit/rules/rules/kit/testing.md +2 -5
  69. package/kit/rules/rules/kit/writing-for-agents.md +3 -1
  70. package/kit/workflow/agents/spec-review.md +1 -1
  71. package/kit/workflow/skills/follow/SKILL.md +3 -3
  72. package/kit/workflow/skills/grill/SKILL.md +1 -1
  73. package/kit/workflow/skills/implement/SKILL.md +10 -11
  74. package/kit/workflow/skills/orchestrate/SKILL.md +155 -117
  75. package/kit/workflow/skills/orchestrate/references/coordinator-handover.md +17 -0
  76. package/kit/workflow/skills/orchestrate/references/herd.md +27 -0
  77. package/kit/workflow/skills/orchestrate/references/plan-commit.md +22 -0
  78. package/kit/workflow/skills/orchestrate/references/sensitive-input.md +23 -0
  79. package/kit/workflow/skills/plan/SKILL.md +5 -2
  80. package/kit/workflow/skills/plan/references/template-English.md +6 -0
  81. package/kit/workflow/skills/plan/references/template-German.md +6 -0
  82. package/package.json +3 -2
  83. package/recipes/README.md +21 -0
  84. package/recipes/github-issues.md +23 -0
  85. package/recipes/github-projects.md +22 -0
  86. package/recipes/jira-cli.md +26 -0
  87. package/recipes/jira-rest.md +24 -0
  88. package/recipes/linear.md +25 -0
  89. package/recipes/sentry.md +18 -0
  90. package/recipes/sources/jira.ts +51 -0
  91. package/recipes/sources/linear.ts +19 -0
  92. package/recipes/sources/sentry.ts +12 -0
  93. package/recipes/sources.md +80 -0
  94. package/recipes/status-page.md +19 -0
  95. package/schemas/jackherd.schema.json +42 -18
  96. package/src/check/command.ts +2 -2
  97. package/src/check/parallel-report.ts +19 -9
  98. package/src/cli.ts +1 -0
  99. package/src/config/context-shares.ts +130 -0
  100. package/src/config/legacy-names.ts +8 -0
  101. package/src/config/read-config.ts +12 -4
  102. package/src/config/schema.ts +75 -20
  103. package/src/context/auto-compact.ts +68 -0
  104. package/src/context/command.ts +68 -17
  105. package/src/context/coordinator-name.ts +27 -9
  106. package/src/context/index.ts +0 -1
  107. package/src/context/level.ts +18 -11
  108. package/src/context/report.ts +6 -3
  109. package/src/plan-format/dependencies.ts +144 -32
  110. package/src/plan-format/index.ts +6 -0
  111. package/src/plan-format/lanes.ts +6 -0
  112. package/src/plan-format/progress.ts +19 -8
  113. package/src/plans/command.ts +14 -5
  114. package/src/plans/current-phase.ts +63 -7
  115. package/src/plans/current-task.ts +51 -0
  116. package/src/plans/ensure-panes.ts +25 -8
  117. package/src/plans/frame.ts +99 -0
  118. package/src/plans/git.ts +8 -0
  119. package/src/plans/herd-memory.ts +107 -0
  120. package/src/plans/lane-plans.ts +5 -3
  121. package/src/plans/lane-summary.ts +222 -0
  122. package/src/plans/layout-phase.ts +148 -0
  123. package/src/plans/layout-summary.ts +140 -0
  124. package/src/plans/layout.ts +164 -420
  125. package/src/plans/live.ts +11 -6
  126. package/src/plans/plan-panes.ts +15 -0
  127. package/src/plans/planned.ts +9 -42
  128. package/src/plans/selection.ts +2 -6
  129. package/src/plans/settings.ts +2 -7
  130. package/src/plans/snapshot.ts +38 -39
  131. package/src/plans/symbols.ts +2 -2
  132. package/src/plans/texts.ts +32 -31
  133. package/src/plans/view.ts +0 -1
  134. package/src/plans/worked-phases.ts +2 -2
  135. package/src/settled/board-row.ts +133 -0
  136. package/src/settled/check.ts +129 -0
  137. package/src/settled/command.ts +65 -0
  138. package/src/settled/evidence-version.ts +14 -0
  139. package/src/settled/options.ts +69 -0
  140. package/src/settled/send.ts +27 -0
  141. package/src/settled/settle.ts +87 -0
  142. package/src/settled/topics.ts +56 -0
  143. package/src/sync/command.ts +16 -1
  144. package/src/sync/render.ts +13 -4
  145. package/src/sync/sync.ts +25 -5
  146. package/src/terminal/herdr.ts +46 -10
  147. package/src/terminal/none.ts +1 -0
  148. package/src/terminal/types.ts +15 -2
  149. package/src/update/command.ts +4 -2
  150. package/src/update/update.ts +33 -9
  151. package/src/vocabulary/index.ts +47 -11
  152. package/src/watch/appointments.ts +205 -0
  153. package/src/watch/command.ts +62 -19
  154. package/src/watch/lane-report.ts +11 -3
  155. package/src/watch/texts.ts +35 -59
  156. package/src/watch/watch-events.ts +21 -28
  157. package/kit/hooks/hooks/approval-gate/lane.ts +0 -14
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
  # Status line for Claude Code: model, context use and session cost. Shipped by jackherd.
3
3
  # Enable it in .claude/settings.json: "statusLine": { "type": "command", "command": ".claude/statusline.sh" }
4
- # Colours follow plans.context of the jackherd config: the lane thresholds inside a worktree, the
5
- # coordinator's elsewhere; without a config, yellow from 60 % and red from 85 %.
4
+ # Colours follow plans.context of the jackherd config, in tokens in the context: the lane thresholds inside a
5
+ # worktree, the coordinator's elsewhere; without thresholds in the config, jackherd's default thresholds in tokens.
6
+ # Either stops at 60 % and 85 % of the window.
6
7
  input=$(cat)
7
8
 
8
9
  model=$(jq -r '.model.display_name // .model.id // "?"' <<<"$input")
@@ -11,6 +12,9 @@ cost=$(jq -r '.cost.total_cost_usd // 0' <<<"$input")
11
12
  cwd=$(jq -r '.workspace.current_dir // .cwd // empty' <<<"$input")
12
13
  pct_int=${pct%.*}
13
14
  [ -z "$pct_int" ] && pct_int=0
15
+ # Tokens in the context: the count Claude Code reports, else share times window.
16
+ tokens=$(jq -r '(.context_window.total_input_tokens // ((.context_window.used_percentage // 0) * (.context_window.context_window_size // 0) / 100)) | floor' <<<"$input" 2>/dev/null)
17
+ [[ "$tokens" =~ ^[0-9]+$ ]] || tokens=0
14
18
 
15
19
  case '{{kit.responseLanguage}}' in
16
20
  German) label='Kontext'; compact_hint='/compact oder /clear' ;;
@@ -41,27 +45,36 @@ config_file() {
41
45
  config_in "$HOME"
42
46
  }
43
47
 
44
- warn_pct=60
45
- alert_pct=85
48
+ # The tokens decide, at the thresholds of the config or, where it leaves one out, at jackherd's defaults
49
+ # (the schema's, as `jh context` reads them).
46
50
  config=$(config_file "${cwd:-$PWD}")
51
+ worktrees='.claude/worktrees'
52
+ [ -n "$config" ] && worktrees=$(jq -r '.worktreeDirectory // ".claude/worktrees"' "$config" 2>/dev/null)
53
+ case "${cwd:-$PWD}/" in
54
+ */"$worktrees"/*) block='.plans.context'; warn_at=250000; alert_at=350000 ;;
55
+ *) block='.plans.context.coordinator'; warn_at=200000; alert_at=300000 ;;
56
+ esac
47
57
  if [ -n "$config" ]; then
48
- worktrees=$(jq -r '.worktreeDirectory // ".claude/worktrees"' "$config" 2>/dev/null)
49
- case "${cwd:-$PWD}/" in
50
- */"$worktrees"/*) block='.plans.context' ;;
51
- *) block='.plans.context.coordinator' ;;
52
- esac
53
- # A share of the window (0.6) as a whole percent; empty when the config does not set it.
54
- warn=$(jq -r "($block.warnAt // empty) * 100 | floor" "$config" 2>/dev/null)
55
- alert=$(jq -r "($block.alertAt // empty) * 100 | floor" "$config" 2>/dev/null)
56
- [[ "$warn" =~ ^[0-9]+$ ]] && warn_pct=$warn
57
- [[ "$alert" =~ ^[0-9]+$ ]] && alert_pct=$alert
58
+ warn=$(jq -r "$block.warnTokens // empty | floor" "$config" 2>/dev/null)
59
+ alert=$(jq -r "$block.alertTokens // empty | floor" "$config" 2>/dev/null)
60
+ [[ "$warn" =~ ^[0-9]+$ ]] && warn_at=$warn
61
+ [[ "$alert" =~ ^[0-9]+$ ]] && alert_at=$alert
62
+ fi
63
+ # A threshold stops at a share of the window, so a small window still hands over before it is full.
64
+ warn_cap=60
65
+ alert_cap=85
66
+ window=$(jq -r '.context_window.context_window_size // 0 | floor' <<<"$input" 2>/dev/null)
67
+ if [[ "$window" =~ ^[0-9]+$ ]] && [ "$window" -gt 0 ]; then
68
+ [ "$warn_at" -gt $((window * warn_cap / 100)) ] && warn_at=$((window * warn_cap / 100))
69
+ [ "$alert_at" -gt $((window * alert_cap / 100)) ] && alert_at=$((window * alert_cap / 100))
58
70
  fi
71
+ level=$tokens
59
72
 
60
73
  reset='\033[0m'
61
- if [ "$pct_int" -ge "$alert_pct" ]; then
74
+ if [ "$level" -ge "$alert_at" ]; then
62
75
  color='\033[31m'
63
76
  hint=" ⚠ ${compact_hint}"
64
- elif [ "$pct_int" -ge "$warn_pct" ]; then
77
+ elif [ "$level" -ge "$warn_at" ]; then
65
78
  color='\033[33m'
66
79
  hint=''
67
80
  else
@@ -5,7 +5,7 @@ description: 'Diagnosis loop for hard bugs, flaky failures and performance regre
5
5
 
6
6
  <!--
7
7
  Adapted from https://github.com/mattpocock/skills (skills/engineering/diagnosing-bugs),
8
- commit 8b78b53, MIT License, Copyright (c) 2026 Matt Pocock. See NOTICE in jackherd.
8
+ commit 8b78b53, MIT License, Copyright (c) 2026 Matt Pocock. See NOTICE.txt in jackherd.
9
9
  Phase structure and the feedback-loop discipline are his; the loop recipes, redaction rules
10
10
  and hand-off targets are the kit's.
11
11
  -->
@@ -22,6 +22,7 @@ Types, lint, unused imports, staged build artifacts and failing tests are decida
22
22
  3. **Function size**: anything past ~20 lines, or a description that needs an "and"
23
23
  4. **Duplication**: more than three lines of identical logic in two places
24
24
  5. **Design review**: the checklist in `.claude/rules/kit/code-style.md` → Design Review
25
+ 6. **Recurring context**: text and output that reach an agent's context again and again (skill and rule bodies, hook reasons, tool reports, event lines) justify their cost; count what the change adds there and weigh it against what it buys
25
26
 
26
27
  ## Output Format
27
28
 
@@ -38,6 +39,7 @@ Measured (jh check): PASS / FAIL
38
39
  3. Function size: ✅ / ❌
39
40
  4. Duplication: ✅ / ❌
40
41
  5. Design review: ✅ / ❌
42
+ 6. Recurring context: ✅ / ❌
41
43
 
42
44
  Verdict: PASS / FIX FIRST
43
45
  ```
@@ -84,8 +84,5 @@ mock.module('../adapters', () => ({
84
84
 
85
85
  `/pre-commit` runs `bunx jackherd check`, which measures types, lint, tests, staged build artifacts and the project's own checks. Beyond that, the judgement points:
86
86
 
87
- 1. No unused imports left over from refactoring
88
- 2. Version bumped if the change affects a published package (minor = feature, patch = fix)
89
- 3. Code follows the order types → pure functions → higher-order functions, without section-label comments
90
- 4. The design review in `code-style.md` passed
91
- 5. No dead code: unused exports, unreachable branches, commented-out code removed from every changed file
87
+ 1. Version bumped if the change affects a published package (minor = feature, patch = fix)
88
+ 2. `code-style.md` holds in every changed file: its code order, and its design review passed, dead code (unused exports, unreachable branches, commented-out code) included
@@ -9,7 +9,7 @@ paths:
9
9
 
10
10
  <!--
11
11
  Adapted from https://github.com/mattpocock/skills (skills/productivity/writing-for-agents),
12
- commit 8b78b53, MIT License, Copyright (c) 2026 Matt Pocock. See NOTICE in jackherd.
12
+ commit 8b78b53, MIT License, Copyright (c) 2026 Matt Pocock. See NOTICE.txt in jackherd.
13
13
  The levers are his; the kit mechanics and the worked examples are the kit's.
14
14
  -->
15
15
 
@@ -67,6 +67,8 @@ Every document spends one of two budgets:
67
67
 
68
68
  Material behind a pointer escapes context load at the price of the pointer's own line. Material with no pointer rides entirely on cognitive load.
69
69
 
70
+ Context load also arrives later than the start of a session. Text and output that reach an agent's context again and again (a skill body, a hook's reason, a tool's report, an event line) justify their cost: each is paid on every arrival and read again on every turn after it. Count what a change adds there and weigh it against what it buys.
71
+
70
72
  ## Information hierarchy
71
73
 
72
74
  Documents are built from **steps** (ordered actions) and **reference** (facts consulted on demand), and they mix freely. The decision is where each piece sits:
@@ -9,7 +9,7 @@ user-invocable: false
9
9
  <!--
10
10
  The two-axis idea (Standards vs. Spec) is adapted from
11
11
  https://github.com/mattpocock/skills (skills/engineering/code-review), commit 8b78b53,
12
- MIT License, Copyright (c) 2026 Matt Pocock. See NOTICE in jackherd. Only the Spec
12
+ MIT License, Copyright (c) 2026 Matt Pocock. See NOTICE.txt in jackherd. Only the Spec
13
13
  axis is used here — the Standards axis is covered by /review and /uncle-bob.
14
14
  -->
15
15
 
@@ -6,13 +6,13 @@ argument-hint: 'What to follow, e.g. a ticket key, an issue or a query'
6
6
 
7
7
  If `.claude/project/follow.md` exists, read it first. It extends this skill for this project and wins where the two disagree.
8
8
 
9
- You add one entry to `watch.sources`, so that `jh watch` reports a new or changed entry of an external service as `=== source <name> …`. You run only reading commands; the one file you write is the project's `.jackherd/config.json` in the main checkout, and only after the user approved the entry. How sources work, their fields and limits: the jackherd README, section **Source reports** and **Recipes**, in the installed package (`"$(dirname "$(readlink -f "$(command -v jh)")")/../README.md"`). Read those two sections; do not copy a recipe from memory.
9
+ You add one entry to `watch.sources`, so that `jh watch` reports a new or changed entry of an external service as `=== source <name> …`. You run only reading commands; the one file you write is the project's `.jackherd/config.json` in the main checkout, and only after the user approved the entry. Read the recipe index `recipes/README.md` of the installed package first (`"$(dirname "$(readlink -f "$(command -v jh)")")/../recipes/README.md"`), then only the recipe file it names for the chosen service; do not copy a recipe from memory. Where the recipe leaves a field open, the index's section **Rules every recipe follows** decides, and `recipes/sources.md` beside it describes every field and limit of a source.
10
10
 
11
11
  ## 1. Ask
12
12
 
13
13
  `AskUserQuestion` in {{kit.responseLanguage}}, only for what the argument and the conversation leave open, each with the recommended option first; at most four questions per call, so more open points go into a second call:
14
14
 
15
- - **Service:** the recipes the README lists (Jira, Linear, GitHub issues, GitHub Projects, Sentry, a status page), and "another command that prints JSON".
15
+ - **Service:** the services the recipe index lists, and "another command that prints JSON".
16
16
  - **What to follow:** the item the argument names (its comments, recommended) or a query over several items.
17
17
  - **Lane:** the lane the reports name, from the board's lanes table, or none.
18
18
  - **Ticket:** whether the entries are tickets (`ticket: true`, recommended for an issue tracker or a project board), which the herd shows as a badge beside the plan of their lane: the lane above, or the lane whose name, board row or plan names the ticket's id. A source of comments or messages is no ticket. The path of the status you find yourself in step 3.
@@ -30,7 +30,7 @@ Anything missing goes to the user as the command to run themselves (`! <command>
30
30
 
31
31
  Before filling, read the help of the installed CLI version for every command the recipe calls (`acli jira workitem search --help` and `workitem view --help`, `gh issue list --help`) and confirm that the fields and options the entry needs exist there. Read the provider's web documentation only when the help leaves it open or no recipe fits. A recipe is a starting point; the installed version decides.
32
32
 
33
- Fill the recipe with the item or query and the answers from step 1: a `name` of letters, digits, `.`, `_` and `-` that says what is followed, `lane`, `ignoreAuthors` and `ticket` where chosen. For a ticket source, find the path of the status in the output (from the CLI's help, or the dry run with `--raw`) and set it as `map.status`; the entry you show for approval in step 4 carries it, and without a status in the output the entry has none and the badge shows only the key. A recipe that needs a script (a token from the environment, or one call per item) gets TypeScript run by Bun: write it to the scratchpad first as `<name>.ts`, never into the repository before step 4, and let the entry's `command` be `["bun", "scripts/sources/<name>.ts"]`. The script:
33
+ Fill the recipe with the item or query and the answers from step 1: a `name` of letters, digits, `.`, `_` and `-` that says what is followed, `lane`, `ignoreAuthors` and `ticket` where chosen. For a ticket source, find the path of the status in the output (from the CLI's help, or the dry run with `--raw`) and set it as `map.status`; the entry you show for approval in step 4 carries it, and without a status in the output the entry has none and the badge shows only the key. A recipe that needs a script (a token from the environment, or one call per item) gets TypeScript run by Bun: write it, from the recipe's script under `recipes/sources/`, to the scratchpad first as `<name>.ts`, never into the repository before step 4, and let the entry's `command` be `["bun", "scripts/sources/<name>.ts"]`. The script:
34
34
 
35
35
  - bounds every request and every call of a tool with `AbortSignal.timeout(20_000)`, where a shell recipe would use `--max-time`;
36
36
  - reads a token only from `process.env`, and never prints it, passes it as an argument or writes it into an output;
@@ -7,7 +7,7 @@ argument-hint: 'Describe the idea, feature or change you want stress-tested'
7
7
 
8
8
  <!--
9
9
  Adapted from https://github.com/mattpocock/skills (skills/productivity/grilling),
10
- commit 8b78b53, MIT License, Copyright (c) 2026 Matt Pocock. See NOTICE in jackherd.
10
+ commit 8b78b53, MIT License, Copyright (c) 2026 Matt Pocock. See NOTICE.txt in jackherd.
11
11
  The design-tree/frontier model is his; the question mechanics and the handover format to /plan
12
12
  are the kit's.
13
13
  -->
@@ -26,11 +26,11 @@ You are the **Implementer**. Your job is to carry tasks through completely: expl
26
26
 
27
27
  When the user asks for more than one phase:
28
28
 
29
- 1. **Read the computed groups:** run `jh check --parallel <plan>`. It reads the plan's `{{kit.heading.dependencies}}` table and the plan's ticks and prints one line per group of phases that can run side by side, `group 1: P19 ∥ P20`; group 1 can start now, a later group waits for the phases before it. A phase is ready when every `{{kit.heading.dependsOn}}` entry is done (ticked off with its review gate); a phase with an external gate (`User: …`) is never ready, since the plan cannot say the gate holds. Two phases share a group only with no shared path under `{{kit.heading.writes}}` and no shared `{{kit.heading.serialMarker}}` (compared without case). Only backticked paths count, written from the repository root; a directory overlaps every file below it, a glob counts as the directory before its first wildcard, and a wildcard at the root (`*.md`) overlaps everything. A `like N` entry (`wie N`, the plan's own word) in the cell, with several phases (`like 15 and 16`) as their union, adds the sets of those phases. `no dependency table` means the plan has none: the phases run one after the other. `no phase is ready` means every open phase waits, is done, or is in no group.
30
- 2. **Batch:** the requested phases in group 1. A requested phase in a later group waits, naming the phase it collides with. One in no group is not ready for one of these reasons: it is done, it has an external gate (ask whether the gate holds), its `like N` entry names an unknown phase or runs in a cycle, or its `{{kit.heading.writes}}` cell has no backticked path; say which. The command checks paths and markers only: two phases that collide in content, or both edit a shared release file (changelog, version bump), stay your judgement, so serialise them yourself.
31
- 3. **Dispatch the batch in one message**, one `Agent(subagent_type: 'implement', model: <from the model table>, prompt: …)` per phase, in the same checkout: the disjoint `{{kit.heading.writes}}` sets are the isolation. Each prompt names its phase (`Phase P<n>` and the plan's path, as in Step 0) and its `{{kit.heading.writes}}` set as the **only** paths it may edit, besides ticking its own phase's task lines in the plan, and states that it ticks the task checkboxes of its own phase as it finishes each one (Plan Hygiene), and leaves the review gate, commits and `/pre-commit` to you — it reports changed files, test results and the gate items it ran.
32
- 4. **When the batch returns:** check each report against its set (`git diff --stat`; an edit outside the set is a finding; a ticked line outside its own phase is one too), tick what it left open, walk each review gate. Gate items that write outside a phase's set (documentation, plan synchronisation) are yours. Then recompute the ready set and dispatch the next batch.
33
- 5. **Commits stay serial and with you:** one `/pre-commit` per finished phase, in phase order.
29
+ 1. **Read the computed waves:** run `jh check --parallel <plan>`. It reads the plan's `{{kit.heading.dependencies}}` table and the plan's ticks and prints one line per wave of phases that can run side by side, in order (`wave 1: P19 ∥ P20`), then `critical path: …` and `in no wave: …`; wave 1 can start now, each later wave once the waves before it are done. A phase is ready when every `{{kit.heading.dependsOn}}` entry is done (ticked off with its review gate); a phase with an external gate (`User: …`) is never ready, since the plan cannot say the gate holds. Two phases share a wave only with no shared path under `{{kit.heading.writes}}`, no shared `{{kit.heading.serialMarker}}` (compared without case), and no release of the same package: a marker `Release <package> <version>`, or the package's `CHANGELOG.md` or `package.json` under `{{kit.heading.writes}}`. Only backticked paths count, written from the repository root; a directory overlaps every file below it, a glob counts as the directory before its first wildcard, and a wildcard at the root (`*.md`) overlaps everything. A `like N` entry (`wie N`, the plan's own word) in the cell, with several phases (`like 15 and 16`) as their union, adds the sets of those phases. `no dependency table` means the plan has none: the phases run one after the other. `no phase is ready` means every open phase waits, is done, or is in no wave.
30
+ 2. **Batch:** the requested phases in wave 1. A requested phase in a later wave waits, naming the phase it collides with. One in no wave is not ready for one of these reasons: it has an external gate (ask whether the gate holds), its `like N` entry names an unknown phase or runs in a cycle, its `{{kit.heading.writes}}` cell has no backticked path, or it depends on such a phase; say which. The command checks paths, markers and releases only: two phases that collide in content stay your judgement, so serialise them yourself.
31
+ 3. **Dispatch the batch in one message**, one `Agent(subagent_type: 'implement', model: <from the model table>, prompt: …)` per phase, in the same checkout: the disjoint `{{kit.heading.writes}}` sets are the isolation. They may run in the background; a hand-over (Step 7) waits until all are back. Each prompt names its phase (`Phase P<n>` and the plan's path, as in Step 0) and its `{{kit.heading.writes}}` set as the **only** paths it may edit, besides ticking its own phase's task lines in the plan, and states that it ticks the task checkboxes of its own phase as it finishes each one (Plan Hygiene), and leaves the review gate, commits and `/pre-commit` to you — it reports changed files, test results and the gate items it ran.
32
+ 4. **When the batch returns:** check each report against its set (`git diff --stat`; an edit outside the set is a finding; a ticked line outside its own phase is one too), tick what it left open, walk each review gate. Gate items that write outside a phase's set (documentation, a changelog entry, plan synchronisation) are yours, at the wave's end. Then recompute the ready set and dispatch the next batch.
33
+ 5. **Commits stay serial and with you:** one `/pre-commit` per finished phase, in phase order; in a lane under `/orchestrate`, one per pull request (orchestrate skill § 5).
34
34
 
35
35
  ## Plan Hygiene (when implementing from a plan in `{{kit.planDirectory}}/`)
36
36
 
@@ -83,7 +83,7 @@ Once all tests are green, types are clean, the change has been looked at (Step 4
83
83
 
84
84
  Ask every question with a fixed set of answers through the `AskUserQuestion` tool, in {{kit.responseLanguage}}.
85
85
 
86
- The report at the end is short: one line of diff stat, one line per check with its numbers, open points, questions; everything else is in the plan, by reference.
86
+ The report at the end is short: one line of diff stat, one line per check with its numbers, open points, questions; everything else is in the plan, by reference. Each question carries the situation, the problem and what each option leads to, in everyday words, not only the options and `file:line`. Mark each question `blocking` or `not blocking`. A blocking one stops the step it decides; a not blocking one leaves a `TODO` at its spot and the work goes on, with neither your recommendation nor another option built as decided.
87
87
 
88
88
  ### Git commands run one at a time
89
89
 
@@ -93,7 +93,7 @@ Why: Claude Code checks permissions per subcommand and splits a command at `&&`,
93
93
 
94
94
  ## Step 7: Phase Boundary
95
95
 
96
- Runs once a phase is committed or its pull request is merged, and only then — never in the middle of a task, and never before the phase's review gate is ticked.
96
+ Runs once the phase's review gate is ticked off, committed or not (a lane under `/orchestrate` commits only when its pull request is ready), and only then — never in the middle of a task.
97
97
 
98
98
  1. Read the fill of your own context, from the log and not from memory:
99
99
 
@@ -101,7 +101,6 @@ Runs once a phase is committed or its pull request is merged, and only then —
101
101
  bunx jackherd context
102
102
  ```
103
103
 
104
- It prints one line of JSON with `share` and `level` (`ok`, `warn` or `alert`), or `null` when there is no value (no terminal adapter, no log). `null` or `ok` → continue with the next phase in this chat, and say nothing about it.
105
- 2. `warn` or `alert`, and a next phase exists → ask through `AskUserQuestion` whether the next phase runs in a new chat. Name the fill (`62 %`) in the question. The recommended option is the new chat. When the coordinator already asked this lane for its hand-over, do not ask: that request is the answer, go on with step 3.
106
- 3. On yes, write the hand-over to `.claude/handover/<lane>.md` (`<lane>` is the name of the worktree directory; the directory is ignored by git and stays out of every commit) and end your turn with its path. The file holds, in this order: the state (branch, commits, what is merged), the open points, the next step, the traps you ran into, and links to the plan and the files that matter. The coordinator ends this agent and starts a fresh one in the same worktree with the hand-over as its first task.
107
- 4. On no, continue.
104
+ It prints one line of JSON with `tokens`, `share` and `level` (`ok`, `warn` or `alert`, from the token thresholds `plans.context.warnTokens` and `alertTokens`), or `null` when there is no value (no terminal adapter, no log). `null` or `ok` → continue with the next phase in this chat, and say nothing about it. A line on stderr that the auto-compact window is not above `alertTokens` means Claude Code compacts before this hand-over: name it in one line of your report.
105
+ 2. `warn` or `alert`, and a next phase exists → the next phase runs in a new chat, without a question: go on with step 3, once every subagent you started is back, no dialog of yours is open and no question of yours waits for an answer. The same holds when Jack, the coordinator, asked this lane for its hand-over.
106
+ 3. Write the hand-over to `.claude/handover/<lane>.md` (`<lane>` is the name of the worktree directory; the directory is ignored by git and stays out of every commit) and end your turn with its path. The file holds, in this order: the line `{{kit.word.openSubagents}}: 0`, which the coordinator requires, the state (branch, commits or uncommitted changes, what is merged), the open points, the next step (after a wave, the state of each of its phases), the traps you ran into, and links to the plan and the files that matter. Jack ends this agent and starts a fresh one in the same worktree with the hand-over as its first task; without a coordinator, the last line names the fill and tells the user to start a new chat with that file.