@jeiemgi/cckit 0.6.1 → 0.7.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 (114) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/AGENTS.md +34 -3
  3. package/README.md +86 -5
  4. package/bin/cckit +72 -3
  5. package/cckit.config.json +6 -1
  6. package/kit.config.schema.json +26 -1
  7. package/package.json +1 -1
  8. package/profiles/automation.json +2 -1
  9. package/profiles/content.json +2 -1
  10. package/profiles/minimal.json +2 -1
  11. package/profiles/research.json +2 -1
  12. package/profiles/software.json +2 -1
  13. package/scripts/init.sh +31 -1
  14. package/scripts/lib/board-view-test.sh +1 -0
  15. package/scripts/lib/board-view.sh +1 -0
  16. package/scripts/lib/captain-test.sh +62 -0
  17. package/scripts/lib/captain.sh +105 -17
  18. package/scripts/lib/cckit-output.sh +1 -0
  19. package/scripts/lib/commitlint.sh +1 -0
  20. package/scripts/lib/config-path-test.sh +1 -0
  21. package/scripts/lib/config-path.sh +1 -0
  22. package/scripts/lib/copilot-test.sh +1 -0
  23. package/scripts/lib/copilot.sh +1 -0
  24. package/scripts/lib/effort-dispatch-test.sh +10 -0
  25. package/scripts/lib/effort-flows-test.sh +1 -0
  26. package/scripts/lib/effort-metrics-test.sh +1 -0
  27. package/scripts/lib/effort-metrics.sh +1 -0
  28. package/scripts/lib/effort-ops-test.sh +360 -0
  29. package/scripts/lib/effort-ops.sh +372 -16
  30. package/scripts/lib/effort-parity-test.sh +1 -0
  31. package/scripts/lib/effort-plan.sh +1 -0
  32. package/scripts/lib/effort-slug-test.sh +32 -0
  33. package/scripts/lib/effort-slug.sh +72 -8
  34. package/scripts/lib/effort.sh +1 -0
  35. package/scripts/lib/engine-adapter.sh +1 -0
  36. package/scripts/lib/errors-header-test.sh +86 -0
  37. package/scripts/lib/gh-log.sh +1 -0
  38. package/scripts/lib/gh-project-test.sh +1 -0
  39. package/scripts/lib/gh-project.sh +1 -0
  40. package/scripts/lib/git-remote-test.sh +1 -0
  41. package/scripts/lib/git-remote.sh +1 -0
  42. package/scripts/lib/handoff.sh +23 -2
  43. package/scripts/lib/kit-brief-test.sh +292 -0
  44. package/scripts/lib/kit-brief.sh +376 -0
  45. package/scripts/lib/kit-cli-test.sh +1 -0
  46. package/scripts/lib/kit-cli.sh +1 -0
  47. package/scripts/lib/kit-config-resolve.sh +1 -0
  48. package/scripts/lib/kit-config-test.sh +14 -0
  49. package/scripts/lib/kit-config.sh +7 -0
  50. package/scripts/lib/kit-engine-test.sh +1 -0
  51. package/scripts/lib/kit-events.sh +1 -0
  52. package/scripts/lib/kit-gc-test.sh +125 -0
  53. package/scripts/lib/kit-gc.sh +193 -5
  54. package/scripts/lib/kit-interview-test.sh +1 -0
  55. package/scripts/lib/kit-interview.sh +1 -0
  56. package/scripts/lib/kit-lib-test.sh +226 -0
  57. package/scripts/lib/kit-lib.sh +308 -0
  58. package/scripts/lib/kit-local.sh +1 -0
  59. package/scripts/lib/kit-manifest.sh +1 -0
  60. package/scripts/lib/kit-mode-test.sh +1 -0
  61. package/scripts/lib/kit-mode.sh +1 -0
  62. package/scripts/lib/kit-msg-test.sh +1 -0
  63. package/scripts/lib/kit-msg.sh +1 -0
  64. package/scripts/lib/kit-operate.sh +1 -0
  65. package/scripts/lib/kit-profile-test.sh +1 -0
  66. package/scripts/lib/kit-profile.sh +1 -0
  67. package/scripts/lib/kit-state-test.sh +89 -0
  68. package/scripts/lib/kit-state.sh +61 -0
  69. package/scripts/lib/kit-status-test.sh +233 -0
  70. package/scripts/lib/kit-status.sh +415 -0
  71. package/scripts/lib/kit-task-ops-test.sh +1 -0
  72. package/scripts/lib/kit-task-ops.sh +1 -0
  73. package/scripts/lib/next.sh +1 -0
  74. package/scripts/lib/plan-machine-test.sh +54 -0
  75. package/scripts/lib/plan-machine.sh +86 -25
  76. package/scripts/lib/plan-next-test.sh +1 -0
  77. package/scripts/lib/plan-next.sh +1 -0
  78. package/scripts/lib/pr-evidence-test.sh +259 -0
  79. package/scripts/lib/pr-evidence.sh +220 -35
  80. package/scripts/lib/project-scan.sh +1 -0
  81. package/scripts/lib/react-detect.sh +1 -0
  82. package/scripts/lib/render-test.sh +1 -0
  83. package/scripts/lib/render.sh +1 -0
  84. package/scripts/lib/role-identity.sh +1 -0
  85. package/scripts/lib/secret-guard.sh +21 -1
  86. package/scripts/lib/toon.sh +1 -0
  87. package/scripts/lib/ui.sh +1 -0
  88. package/scripts/lib/version-bump-test.sh +1 -0
  89. package/scripts/lib/version-bump.sh +1 -0
  90. package/scripts/lib/worktree-bootstrap-test.sh +220 -0
  91. package/scripts/lib/worktree-issue-test.sh +15 -1
  92. package/scripts/lib/worktree-issue.sh +23 -8
  93. package/scripts/lib/worktree-start.sh +191 -7
  94. package/scripts/lib/zsh-safety-test.sh +10 -0
  95. package/scripts/portable-test.sh +13 -2
  96. package/scripts/self-install-test.sh +282 -0
  97. package/scripts/setup-labels.sh +1 -0
  98. package/scripts/status.sh +25 -10
  99. package/skills/kit-cleanup/SKILL.md +83 -0
  100. package/skills/kit-effort-close/SKILL.md +3 -0
  101. package/skills/kit-effort-new/SKILL.md +7 -0
  102. package/skills/kit-effort-start/SKILL.md +39 -4
  103. package/skills/kit-gc/SKILL.md +19 -0
  104. package/skills/kit-next/SKILL.md +5 -0
  105. package/skills/kit-status/SKILL.md +92 -0
  106. package/skills/kit-task-start/SKILL.md +7 -1
  107. package/templates/rules/branch-naming.md +20 -1
  108. package/templates/rules/communication-style.md +8 -0
  109. package/templates/rules/delegation-brief.md +38 -4
  110. package/templates/rules/effort-model.md +47 -4
  111. package/templates/rules/naming-and-ids.md +199 -0
  112. package/templates/rules/task-management.md +1 -1
  113. package/templates/skills/concrete/SKILL.md +117 -0
  114. package/templates/skills/karpathy-guidelines/SKILL.md +1 -0
@@ -0,0 +1,282 @@
1
+ #!/usr/bin/env bash
2
+ # self-install-test.sh — cckit's own `.claude/` must match what cckit intends to install for itself
3
+ # (#283). cckit is the kit, so it was never `cckit init`'d against a profile: for its whole history
4
+ # `templates/skills/` and `templates/rules/` shipped to every consumer and applied to nothing here.
5
+ # `concrete` — the anti-slop catalogue `communication-style.md` mandates for every commit, PR and
6
+ # issue body — was the sharpest case: it shipped in PR 247 and no body in this repo records a pass.
7
+ #
8
+ # This is the guard against that rotting again. It is deliberately NOT "install the whole software
9
+ # profile": several templates do not apply to this repo, and each is listed below with the reason.
10
+ # The manifest is the point — a template that is neither installed nor skipped fails this test, so a
11
+ # new template forces a decision instead of drifting into the silent-partial-install state.
12
+ #
13
+ # Run: bash scripts/self-install-test.sh
14
+ # errors: strict — a test runner: rc 1 on any failed assertion
15
+ set -uo pipefail
16
+ cd "$(cd "$(dirname "$0")/.." && pwd)"
17
+
18
+ fail=0
19
+ t() { if [ "$2" = "$3" ]; then :; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
20
+ has() { case "$2" in *"$3"*) : ;; *) echo "FAIL: $1 -> output lacks '$3'"; fail=1 ;; esac; }
21
+ bad() { echo "FAIL: $*"; fail=1; }
22
+
23
+ # ── the manifest ───────────────────────────────────────────────────────────────────────────────
24
+ # INSTALLED_SKILLS / INSTALLED_RULES: "<name> <mode>", one per line.
25
+ # verbatim — the installed file is byte-identical to its template.
26
+ # rendered — byte-identical to the template with init.sh's {{VARS}} substituted from
27
+ # cckit.config.json (init templates those files; the installed copy is its output).
28
+ # sections — the template's KIT-OWNED sections are byte-identical; the rest is this project's own
29
+ # content, because the template instructs the project to fill it in.
30
+ INSTALLED_SKILLS='concrete verbatim
31
+ karpathy-guidelines verbatim'
32
+
33
+ INSTALLED_RULES='branch-naming verbatim
34
+ communication-style rendered
35
+ delegation-brief sections
36
+ effort-model rendered
37
+ naming-and-ids verbatim'
38
+
39
+ # The kit-owned sections of delegation-brief.md — the transferable instruction `cckit brief` lifts.
40
+ # Project-specific sections ("Project specifics", "Gate commands") are filled in for cckit and are
41
+ # NOT compared.
42
+ DELEGATION_BRIEF_KIT_SECTIONS='Standing gotchas
43
+ Durable prose
44
+ Effort flow'
45
+
46
+ # SKIPPED_*: "<name> :: <reason>". Every skip is a decision on the record, not an omission.
47
+ SKIPPED_SKILLS='copywriting :: not declared by any profile cckit uses (content profile only); cckit ships no marketing copy
48
+ feature-build-refine :: stack-gated on a @refinedev/* dependency; cckit has no package.json dependencies at all
49
+ morning-briefing :: reads .claude/kit.config.json, which this repo does not have, and cckit answers the same question with `cckit status` + skills/kit-status
50
+ speckit :: the software profile ships it with defaults.speckit = "off", so init would not install it either
51
+ supabase-patterns :: cckit has no Supabase; the only matches for "supabase" in the repo are the kit machinery that scaffolds this skill'
52
+
53
+ SKIPPED_RULES='design-routing :: routes every design question to .claude/agents/designer/AGENT.md; cckit installs no agents, so the rule would dereference a path that does not exist
54
+ knowledge-base :: governs a knowledge/ dir with status/owner/updated frontmatter and a knowledge/INDEX.md manifest; cckit knowledge.dir is docs-site/src/content/docs, Starlight title/description frontmatter, no INDEX.md
55
+ mempalace :: memory.enabled is false in cckit.config.json, so init.sh own rules loop skips this rule for this config
56
+ plan-next :: not in profiles/software.json; it describes the cckit plan-next verb rather than governing work, and its See-also links point at plan-output-format.md, which cckit does not install
57
+ plan-output-format :: mandates that a plan is a file in plans.dir; cckit plans.dir is "" and plans.format is "github" — the parent issue IS the plan (effort-model.md)
58
+ react-annotate :: no React app here; scripts/annotate-setup.sh installs this rule per-project when annotation is wired
59
+ risk-tiered-review :: not in profiles/software.json; it blesses pr-automerge / pr-labeler, and .github/workflows/ has no such workflow and the repo has no risk:* labels
60
+ skill-gaps :: records its anti-repeat state in .claude/kit.config.json under skillPrompts; that file does not exist in this repo
61
+ task-management :: duplicates the ground rules in AGENTS.md, and renders claims this repo contradicts — the software profile milestones (Foundation/MVP/Beta/GA) while the repo has zero milestones, and eight roles while only role:tech-lead and role:docs exist'
62
+
63
+ _names() { printf '%s\n' "$1" | grep . | awk '{print $1}' | sort; }
64
+ _skipped_names() { printf '%s\n' "$1" | grep . | sed 's/ :: .*//' | sort; }
65
+
66
+ # ── 1. every template is either installed or skipped, with a reason ────────────────────────────
67
+ # A new template under templates/skills or templates/rules fails here until someone decides.
68
+ tpl_skills="$(find templates/skills -mindepth 2 -maxdepth 2 -name SKILL.md -type f 2>/dev/null \
69
+ | while IFS= read -r f; do basename "$(dirname "$f")"; done | sort)"
70
+ tpl_rules="$(find templates/rules -maxdepth 1 -type f -name '*.md' 2>/dev/null \
71
+ | while IFS= read -r f; do b="$(basename "$f")"; echo "${b%.md}"; done | sort)"
72
+
73
+ decided_skills="$( { _names "$INSTALLED_SKILLS"; _skipped_names "$SKIPPED_SKILLS"; } | sort -u)"
74
+ decided_rules="$( { _names "$INSTALLED_RULES"; _skipped_names "$SKIPPED_RULES"; } | sort -u)"
75
+
76
+ # A name in BOTH lists is a contradiction the `sort -u` above would hide: coverage still passes, the
77
+ # installed-set check still passes, and the manifest reads as though the template were skipped while
78
+ # the file is on disk. Reject the overlap explicitly.
79
+ t "no skill template is both installed and skipped" \
80
+ "$(comm -12 <(_names "$INSTALLED_SKILLS") <(_skipped_names "$SKIPPED_SKILLS") | tr '\n' ' ' | sed 's/ *$//')" ""
81
+ t "no rule template is both installed and skipped" \
82
+ "$(comm -12 <(_names "$INSTALLED_RULES") <(_skipped_names "$SKIPPED_RULES") | tr '\n' ' ' | sed 's/ *$//')" ""
83
+
84
+ t "every skill template is decided (installed or skipped)" \
85
+ "$(comm -23 <(printf '%s\n' "$tpl_skills") <(printf '%s\n' "$decided_skills") | tr '\n' ' ' | sed 's/ *$//')" ""
86
+ t "every rule template is decided (installed or skipped)" \
87
+ "$(comm -23 <(printf '%s\n' "$tpl_rules") <(printf '%s\n' "$decided_rules") | tr '\n' ' ' | sed 's/ *$//')" ""
88
+ t "no manifest entry names a skill template that is gone" \
89
+ "$(comm -13 <(printf '%s\n' "$tpl_skills") <(printf '%s\n' "$decided_skills") | tr '\n' ' ' | sed 's/ *$//')" ""
90
+ t "no manifest entry names a rule template that is gone" \
91
+ "$(comm -13 <(printf '%s\n' "$tpl_rules") <(printf '%s\n' "$decided_rules") | tr '\n' ' ' | sed 's/ *$//')" ""
92
+
93
+ # Every skip carries a reason after the ` :: ` separator — an unexplained skip recreates the drift.
94
+ printf '%s\n' "$SKIPPED_SKILLS" "$SKIPPED_RULES" | grep . | while IFS= read -r line; do
95
+ case "$line" in
96
+ *" :: "?*) : ;;
97
+ *) echo "FAIL: skip without a reason -> '$line'" ;;
98
+ esac
99
+ done | grep . && fail=1
100
+
101
+ # ── 2. what the manifest says is installed is on disk, and nothing else is ─────────────────────
102
+ inst_skills="$(find .claude/skills -mindepth 2 -maxdepth 2 -name SKILL.md -type f 2>/dev/null \
103
+ | while IFS= read -r f; do basename "$(dirname "$f")"; done | sort)"
104
+ inst_rules="$(find .claude/rules -maxdepth 1 -type f -name '*.md' 2>/dev/null \
105
+ | while IFS= read -r f; do b="$(basename "$f")"; echo "${b%.md}"; done | sort)"
106
+
107
+ t "installed skills == the manifest" "$(printf '%s\n' "$inst_skills" | tr '\n' ' ')" \
108
+ "$(_names "$INSTALLED_SKILLS" | tr '\n' ' ')"
109
+ t "installed rules == the manifest" "$(printf '%s\n' "$inst_rules" | tr '\n' ' ')" \
110
+ "$(_names "$INSTALLED_RULES" | tr '\n' ' ')"
111
+
112
+ # ── 3. content: the installed copy has not drifted from its template ───────────────────────────
113
+ # `jq` is REQUIRED here, not optional. A drift guard that skips its content comparison when a tool
114
+ # is absent passes for the wrong reason — the one failure mode this test exists to prevent. `jq` is a
115
+ # Tier-1 dependency (`scripts/doctor.sh`: "git, gh, jq, perl — hard deps, auto-install via brew") and
116
+ # CI installs it, so requiring it costs nothing and removes a silent pass. Same for `perl`, which
117
+ # performs the substitution.
118
+ # A separate flag, not `$fail`: an earlier assertion failing must not be reported as a missing
119
+ # dependency, and must not cut the report short — a reviewer needs every finding in one run.
120
+ dep_missing=0
121
+ for _dep in jq perl; do
122
+ command -v "$_dep" >/dev/null 2>&1 || {
123
+ bad "$_dep is required to compare an installed rule against its template — refusing to pass without it (Tier-1 dep, see scripts/doctor.sh)"
124
+ dep_missing=1
125
+ }
126
+ done
127
+ if [ "$dep_missing" -ne 0 ]; then
128
+ echo "FAIL: cckit self-install guard cannot compare content without jq + perl — install them and re-run" >&2
129
+ exit 1
130
+ fi
131
+
132
+ # The values init.sh substitutes, read from the config so a config change is caught rather than
133
+ # hard-coded here. BASE_BRANCH uses the same precedence as kit-config.sh's KIT_BASE_BRANCH.
134
+ CFG_LANG="$(jq -r '.project.language' cckit.config.json)"
135
+ CFG_OWNER="$(jq -r '.project.owner' cckit.config.json)"
136
+ CFG_NAME="$(jq -r '.project.name' cckit.config.json)"
137
+ CFG_BASE="$(jq -r '.github.baseBranch // .github.integrationBranch // .github.flow // "main"' cckit.config.json)"
138
+ for _pair in "project.language:$CFG_LANG" "project.owner:$CFG_OWNER" "project.name:$CFG_NAME" "github.baseBranch:$CFG_BASE"; do
139
+ case "${_pair#*:}" in
140
+ ''|null) bad "cckit.config.json has no ${_pair%%:*} — the rendered comparison would compare against an empty string" ;;
141
+ esac
142
+ done
143
+
144
+ # _render <template> — init.sh's substitution step for the vars these templates actually use.
145
+ _render() {
146
+ COMMS_LANG="$CFG_LANG" OWNER_NAME="$CFG_OWNER" PROJECT_NAME="$CFG_NAME" BASE_BRANCH="$CFG_BASE" \
147
+ perl -0777 -pe 's/\{\{(\w+)\}\}/ exists $ENV{$1} ? $ENV{$1} : "{{$1}}" /ge' "$1"
148
+ }
149
+
150
+ # _section <file> <heading-regex> — the lines under a matching `## ` heading, next heading exclusive.
151
+ _section() {
152
+ awk -v want="$2" '/^##[[:space:]]/ { in_s = ($0 ~ want) ? 1 : 0; next } in_s' "$1"
153
+ }
154
+
155
+ _compare() { # <name> <template> <installed> <mode>
156
+ local name="$1" tpl="$2" got="$3" mode="$4" s
157
+ [ -f "$got" ] || { bad "$name: $got is missing"; return; }
158
+ [ -f "$tpl" ] || { bad "$name: template $tpl is missing"; return; }
159
+ case "$mode" in
160
+ verbatim)
161
+ cmp -s "$tpl" "$got" || bad "$name: $got differs from $tpl (mode verbatim)"
162
+ # A verbatim install of a templated file would ship a literal {{VAR}} to this repo.
163
+ grep -q '{{' "$got" && bad "$name: $got still contains a {{VAR}} placeholder"
164
+ ;;
165
+ rendered)
166
+ _render "$tpl" | cmp -s - "$got" \
167
+ || bad "$name: $got is not $tpl rendered with cckit.config.json values (mode rendered)"
168
+ grep -q '{{' "$got" && bad "$name: $got still contains a {{VAR}} placeholder"
169
+ ;;
170
+ sections)
171
+ printf '%s\n' "$DELEGATION_BRIEF_KIT_SECTIONS" | grep . | while IFS= read -r s; do
172
+ if [ "$(_section "$tpl" "$s")" != "$(_section "$got" "$s")" ]; then
173
+ echo "FAIL: $name: kit-owned section '$s' differs between $tpl and $got"
174
+ fi
175
+ done | grep . && fail=1
176
+ grep -q '{{' "$got" && bad "$name: $got still contains a {{VAR}} placeholder"
177
+ ;;
178
+ *) bad "$name: unknown manifest mode '$mode'" ;;
179
+ esac
180
+ return 0
181
+ }
182
+
183
+ while IFS=' ' read -r name mode; do
184
+ [ -n "$name" ] || continue
185
+ _compare "skills/$name" "templates/skills/$name/SKILL.md" ".claude/skills/$name/SKILL.md" "$mode"
186
+ done <<EOF
187
+ $(printf '%s\n' "$INSTALLED_SKILLS" | grep .)
188
+ EOF
189
+
190
+ while IFS=' ' read -r name mode; do
191
+ [ -n "$name" ] || continue
192
+ _compare "rules/$name" "templates/rules/$name.md" ".claude/rules/$name.md" "$mode"
193
+ done <<EOF
194
+ $(printf '%s\n' "$INSTALLED_RULES" | grep .)
195
+ EOF
196
+
197
+ # ── 4. the mandate chain the issue is about actually connects ──────────────────────────────────
198
+ # communication-style mandates the pass · the brief carries it into a delegated agent · the skill
199
+ # file is present so the agent can read the catalogue. Break any link and the pass stops firing.
200
+ has "communication-style mandates the concrete pass" \
201
+ "$(cat .claude/rules/communication-style.md 2>/dev/null)" 'the `concrete` skill'
202
+ has "communication-style points at the brief as the carrier" \
203
+ "$(cat .claude/rules/communication-style.md 2>/dev/null)" 'delegation-brief.md'
204
+ t "the concrete skill file an agent has to read is installed" \
205
+ "$([ -f .claude/skills/concrete/SKILL.md ] && echo yes || echo no)" "yes"
206
+
207
+ prose="$(_section .claude/rules/delegation-brief.md '[Dd]urable prose' 2>/dev/null)"
208
+ has "the brief tells a delegated agent to run the concrete pass" "$prose" '`concrete`'
209
+ has "the brief names the durable artifacts" "$prose" "commit message"
210
+ has "the brief forbids cutting by length" "$prose" "never by length"
211
+ has "the brief carries O13" "$prose" "O13"
212
+ has "the brief carries O14" "$prose" "O14"
213
+ has "the brief lists the untouchable evidence" "$prose" "Untouchable"
214
+
215
+ # ── 5. no installed rule names an integration branch this repo does not use ────────────────────
216
+ # The review finding on PR 284: `.claude/rules/effort-model.md` told agents to branch from and open
217
+ # their PR against `main` while `github.baseBranch` is `develop`. It was byte-identical to its
218
+ # template, which is precisely why it went unnoticed — for a template that hard-codes a value the
219
+ # project overrides, byte-identical IS the bug. The template is parameterized on {{BASE_BRANCH}}
220
+ # now; these assertions fail if either half regresses.
221
+ for _pat in '(from main)' '──► main' '→ main (rich body'; do
222
+ grep -qF -- "$_pat" templates/rules/effort-model.md \
223
+ && bad "templates/rules/effort-model.md hard-codes the integration branch ('$_pat') — use {{BASE_BRANCH}} so each project renders its own"
224
+ grep -qF -- "$_pat" .claude/rules/effort-model.md \
225
+ && bad ".claude/rules/effort-model.md names 'main' as the integration branch; this repo integrates on '$CFG_BASE'"
226
+ done
227
+ has "installed effort-model branches from this repo's base" "$(cat .claude/rules/effort-model.md)" "(from $CFG_BASE)"
228
+ has "installed effort-model targets this repo's base" "$(cat .claude/rules/effort-model.md)" "ONE PR ──► $CFG_BASE"
229
+ has "the task-management template parameterizes its base too" "$(cat templates/rules/task-management.md)" '{{BASE_BRANCH}}'
230
+
231
+ # ── 6. #218: every installed rule is a template basename ───────────────────────────────────────
232
+ # effort_close's kit-sync drift check (_EO_KIT_MANAGED_RE) matches the whole .claude/rules/ dir, so
233
+ # it flags project-OWNED rules as kit-managed. That false positive cannot arise here: every file in
234
+ # this repo's .claude/rules/ IS a kit template, so the warning is accurate for cckit even before
235
+ # #218 narrows the regex. This assertion is what keeps that true.
236
+ find .claude/rules -maxdepth 1 -type f -name '*.md' 2>/dev/null | while IFS= read -r f; do
237
+ b="$(basename "$f")"
238
+ [ -f "templates/rules/$b" ] || echo "FAIL: $f has no templates/rules/$b — a project-owned rule here would trip the #218 drift false positive"
239
+ done | grep . && fail=1
240
+
241
+ if [ "$fail" -eq 0 ]; then echo "PASS: cckit self-install matches its manifest"; fi
242
+
243
+ # Editing a template is a TWO-file change for any rule cckit installs for itself, and nothing else
244
+ # tells an author that (#285: PR 282 edited templates/rules/effort-model.md on a branch cut before
245
+ # the installed copy existed, so develop went red only once both PRs had landed). A guard that
246
+ # reports drift without saying how to clear it is a tripwire with no defusal — so print the exact
247
+ # re-render command, using the same substitution this file compares with.
248
+ if [ "$fail" -ne 0 ]; then
249
+ # Generated from the manifest, not hand-written: a static hint drifts from the manifest and from
250
+ # _render's own fallback chain, and a remediation command that does not match what this script
251
+ # compares against is the very defect the guard exists to catch. `rendered` and `verbatim` are
252
+ # both listed — re-rendering a template with no {{VAR}} is a no-op copy, which is exactly right.
253
+ _hint_rules="$(printf '%s\n' "$INSTALLED_RULES" | awk '$2!="sections"{printf "%s ", $1}' | sed 's/ *$//')"
254
+ {
255
+ echo
256
+ echo "To clear a 'mode rendered' or 'mode verbatim' drift, re-render the installed copy from its"
257
+ echo "template. Run from the repo root; needs jq + perl:"
258
+ echo
259
+ echo " CFG_LANG=\"\$(jq -r '.project.language' cckit.config.json)\""
260
+ echo " CFG_OWNER=\"\$(jq -r '.project.owner' cckit.config.json)\""
261
+ echo " CFG_NAME=\"\$(jq -r '.project.name' cckit.config.json)\""
262
+ echo " CFG_BASE=\"\$(jq -r '.github.baseBranch // .github.integrationBranch // .github.flow // \"main\"' cckit.config.json)\""
263
+ echo " for r in $_hint_rules; do"
264
+ echo " COMMS_LANG=\"\$CFG_LANG\" OWNER_NAME=\"\$CFG_OWNER\" PROJECT_NAME=\"\$CFG_NAME\" BASE_BRANCH=\"\$CFG_BASE\" \\"
265
+ echo " perl -0777 -pe 's/\\{\\{(\\w+)\\}\\}/ exists \$ENV{\$1} ? \$ENV{\$1} : \"{{\$1}}\" /ge' \\"
266
+ echo " \"templates/rules/\$r.md\" > \".claude/rules/\$r.md\""
267
+ echo " done"
268
+ echo
269
+ echo "For one rule, keep the same four assignments and drop the loop, e.g. effort-model:"
270
+ echo
271
+ echo " … BASE_BRANCH=\"\$CFG_BASE\" perl -0777 -pe 's/…/…/ge' \\"
272
+ echo " templates/rules/effort-model.md > .claude/rules/effort-model.md"
273
+ echo
274
+ echo "CFG_BASE must keep the full fallback chain — baseBranch, then integrationBranch, then flow,"
275
+ echo "then \"main\". Checking only .github.baseBranch renders a different value than this script"
276
+ echo "compares against, so the drift would survive the fix."
277
+ echo
278
+ echo "A 'mode sections' drift is NOT re-rendered wholesale: that file carries project-specific"
279
+ echo "fill-ins. Copy only the kit-owned section the failure names."
280
+ } >&2
281
+ fi
282
+ exit "$fail"
@@ -17,6 +17,7 @@ echo "→ Labels on $KIT_REPO"
17
17
  echo "kinds:"
18
18
  for k in task plan adr scaffold spike; do ensure_label "kind:$k" "5319e7" "Kind: $k"; done
19
19
  echo "priorities:"
20
+ ensure_label "priority:p0" "8b0000" "Drop everything"
20
21
  ensure_label "priority:p1" "b60205" "Now / blocking"
21
22
  ensure_label "priority:p2" "fbca04" "Next"
22
23
  ensure_label "priority:p3" "0e8a16" "Later"
package/scripts/status.sh CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env bash
2
- # status.sh - a thin status viewer: the board, active worktrees/branches, and the resume handoff on
3
- # one screen. Output is MARKDOWN routed through the rendering seam (#82): rich via glow in a TTY,
2
+ # status.sh - the "where are we?" dashboard: the board, then the THREE buckets a session actually
3
+ # opens with (local undone work · PRs waiting on a human · cleanup available), then the resume
4
+ # handoff. The bucket logic lives in scripts/lib/kit-status.sh (kit-engine-boundary: verb logic in a
5
+ # sourceable lib, never inline in a script), so every verdict is unit-tested rather than eyeballed. Output is MARKDOWN routed through the rendering seam (#82): rich via glow in a TTY,
4
6
  # verbatim markdown otherwise (renders natively in Claude Code, always pipe-safe — no escape codes
5
7
  # leak into a redirect). This is the lightweight cockpit; the rich opentui TUI is an OPTIONAL
6
8
  # separate adapter — the core stays pure bash and dependency-light, so `cckit status` works anywhere.
@@ -12,6 +14,10 @@ source "$ROOT/scripts/lib/ui.sh" 2>/dev/null || true
12
14
  source "$ROOT/scripts/lib/render.sh" 2>/dev/null || true
13
15
  # shellcheck source=/dev/null
14
16
  source "$ROOT/scripts/lib/kit-config.sh" && load_kit_config
17
+ # shellcheck source=/dev/null
18
+ source "$ROOT/scripts/lib/kit-gc.sh" 2>/dev/null || true
19
+ # shellcheck source=/dev/null
20
+ source "$ROOT/scripts/lib/kit-status.sh"
15
21
 
16
22
  # _status_md — compose the whole dashboard as one markdown document on stdout.
17
23
  _status_md() {
@@ -43,14 +49,9 @@ _status_md() {
43
49
  fi
44
50
  echo ""
45
51
 
46
- # Worktrees + branches: SAFE-to-prune vs active (reuse the gc analysis). Kept in a fenced block so
47
- # glow renders the aligned gc columns monospaced and the markdown stays faithful.
48
- echo "## Worktrees and branches"
49
- echo '```'
50
- # shellcheck source=/dev/null
51
- source "$ROOT/scripts/lib/kit-gc.sh"
52
- kit_gc_analyze 2>/dev/null | grep -E 'SAFE|ACTIVE|PROTECTED|ORPHAN' | head -12 || echo "(clean)"
53
- echo '```'
52
+ # The three buckets. Each one names its own emptiness, so a clean bucket and a broken one never
53
+ # look alike — this report is read to decide what to do next.
54
+ status_buckets_md "$ROOT"
54
55
  echo ""
55
56
 
56
57
  # Resume handoff, if one is saved.
@@ -62,4 +63,18 @@ _status_md() {
62
63
  echo '```'
63
64
  }
64
65
 
66
+ # `--llm` (or CCKIT_OUTPUT=json, set by the dispatcher) emits the buckets as JSON for an agent —
67
+ # same classifiers as the markdown path, so the two cannot disagree about a verdict.
68
+ for a in "$@"; do
69
+ case "$a" in
70
+ --llm|--output=json) CCKIT_OUTPUT=json ;;
71
+ esac
72
+ done
73
+ if [ "${CCKIT_OUTPUT:-}" = "json" ]; then
74
+ # Propagate the rc: a report that could not read a bucket must not exit 0, or a caller that only
75
+ # checks the status code acts on a half-known state as if it were clean.
76
+ status_buckets_json "$ROOT"
77
+ exit $?
78
+ fi
79
+
65
80
  if command -v cckit_render >/dev/null 2>&1; then _status_md | cckit_render; else _status_md; fi
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: kit-cleanup
3
+ description: Run the ONE guided destructive sweep over the repo — present the gc plan (SAFE / ZOMBIE / ORPHAN / PROTECTED / stashes), then delete only the SAFE rows and prune the listed ZOMBIE metadata after the user confirms. Orphan branches, open-issue branches, and stashes are surfaced and left alone.
4
+ when_to_use: When `cckit gc` (or the SessionStart hygiene hook) reports merged branches and worktrees piling up and you want them gone in one pass. Use this instead of hand-rolling `git branch -D` + `git push origin --delete` loops. For the read-only report alone, use `/kit-gc`.
5
+ ---
6
+
7
+ # kit-cleanup — the guided destructive sweep
8
+
9
+ Plugin-direct skill — helpers resolve from `${CLAUDE_PLUGIN_ROOT}`.
10
+
11
+ `/kit-gc` classifies; **this skill acts on that classification.** It is the only place in the kit
12
+ that deletes a branch the user did not name, so the whole design is plan-first.
13
+
14
+ **Safety contract:** the plan names **everything** `--yes` can touch — branches, worktrees *and*
15
+ ZOMBIE admin metadata, so no deletion escapes the user's veto. A zombie's staged work is committed
16
+ to its branch **before** its metadata is pruned (recover-before-prune), and the plan says so per
17
+ row. `--yes` is the only thing that deletes a **cleanup target** (a
18
+ branch, a worktree, a remote ref, a listed zombie's metadata), and three buckets are not deletable
19
+ at all. A plan-only run still
20
+ prunes stale *remote-tracking metadata*, because it refreshes them to classify — see step 3. Table
21
+ below. It reuses
22
+ `kit_gc_analyze` as the single classifier rather than re-deriving verdicts, so `gc` and `cleanup`
23
+ can never disagree about what is safe to delete.
24
+
25
+ ## Execution
26
+
27
+ ### 1. Show the plan (read-only)
28
+
29
+ ```bash
30
+ source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/kit-config.sh" && load_kit_config
31
+ KIT_GC_REPO="$KIT_REPO" source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/kit-gc.sh"
32
+ kit_gc_cleanup # plan only — deletes no branch, worktree, remote ref or stash
33
+ ```
34
+
35
+ Or through the CLI: `cckit cleanup` (add `--llm` for JSON counts).
36
+
37
+ ### 2. Present it and ask
38
+
39
+ Show the user the bucket table and **ask for confirmation before running with `--yes`**. Let them
40
+ veto per-bucket — if they want the orphans looked at first, do that before deleting anything.
41
+
42
+ | Bucket | Rule | `--yes` does |
43
+ | --- | --- | --- |
44
+ | **SAFE** | PR `MERGED`, issue closed/absent, unprotected | **deletes** the worktree, the local branch, and the remote ref *if* the branch was level with it |
45
+ | **PROTECTED** | associated issue **still OPEN** | **keeps** — close the issue first |
46
+ | **ORPHAN** | local commits not on the base branch's remote, no merged PR | **keeps** — offer to recover into a PR (step 4) |
47
+ | **ZOMBIE** | worktree dir gone, admin metadata lingers | **recovers** any staged delta to a commit on its branch, **then prunes** the metadata |
48
+ | **stashes** | any stash entry | **keeps** — irreversible; drop only after showing each diff |
49
+
50
+ ### 3. Execute
51
+
52
+ ```bash
53
+ kit_gc_cleanup --yes # or: cckit cleanup --yes
54
+ ```
55
+
56
+ Level-ness is recorded **before** the local prune — once the local ref is gone there is nothing left
57
+ to compare. It requires **exact equality in both directions**: `origin/<b>..<b>` alone only proves
58
+ local ⊆ remote, so a remote-ahead branch would otherwise lose remote-only history. A local delete is
59
+ likewise skipped when the branch is ahead of its remote (`git branch -D` is a force delete). A remote
60
+ delete that fails (protected ref, already gone) is reported, counted on the `remote deletes failed`
61
+ line (`remote_failed` in `--llm`), and makes the verb exit non-zero — a partial sweep is never
62
+ reported as a complete one. It is never retried blindly.
63
+
64
+ The plan-only path does perform one write: `kit_gc_analyze` refreshes remote-tracking refs
65
+ (`git fetch --prune`) so the classification is not made against a stale remote. It touches no branch,
66
+ worktree, stash, or commit.
67
+
68
+ ### 4. Orphan handling
69
+
70
+ For each orphan with unique unpushed work: **do not delete.** Recover it into a clean PR off the base
71
+ branch (branch from `$BASE`, `git checkout <orphan> -- <paths>`, commit, push, open a PR) so the user
72
+ decides merge vs close. Same contract as `/kit-gc` step 4.
73
+
74
+ ## Rules
75
+
76
+ - **Plan first, always.** Never run `--yes` before the user has seen the plan and said go.
77
+ - **Never** delete an ORPHAN branch, a PROTECTED branch, or a stash — those are irreversible or hold
78
+ the only copy of work. `cleanup` cannot do it; do not work around it with raw git.
79
+ - **Never** delete the base branch (`main`/`develop`) or an open-PR branch — the classifier keeps
80
+ both, and that is load-bearing, not incidental.
81
+ - A **dirty worktree is skipped with a warning**, not destroyed (recover-before-prune).
82
+ - If the protection helper cannot load, the sweep **aborts** rather than classify anything — a wrong
83
+ "safe" is far worse than a refusal. Same contract as `/kit-gc`.
@@ -102,3 +102,6 @@ effort_close "$NUM"
102
102
  - Never force-push to trunk; never delete the default branch.
103
103
  - **Heed the kit-sync warning:** a kit-managed change that isn't contributed upstream is a latent
104
104
  regression the next `/kit-update` can revert. Treat the warning as a to-do.
105
+ - Closing frees a **WIP slot**: the core's GC deletes the `effort/<N>-<slug>` branch, which is what
106
+ `cckit effort start`'s WIP limit counts (`effort.wipLimit`, default 2). If a start was just
107
+ refused, this is the op that unblocks it — not `--force`.
@@ -92,6 +92,13 @@ echo "✓ effort #$PARENT_NUM created — next: /kit-effort-start $PARENT_NUM"
92
92
  - **Carry the flow + the chain** — set `Flow` so the title shows `[Flow]` and the `flow:<flow>` label
93
93
  is applied; pass `Depends on #N` so the native GitHub `blocked_by` edge + a `## Relations` line make
94
94
  the chain visible on the board. `ctx:*` (session weight) is applied automatically.
95
+ - **Order EXISTING issues with `cckit effort chain <a> <b> …`**, not by hand — it sets each
96
+ successor's `blocked_by` edge and writes the same `- Depends on #<predecessor>` line through the
97
+ same formatter `--depends-on` uses. It is idempotent and additive (a pre-existing blocker is
98
+ kept), and it refuses the whole chain — writing nothing — on fewer than two numbers, a
99
+ non-numeric argument, an issue that does not exist, a repeated number, or an edge that would
100
+ close a cycle. Use it when the sub-issues already exist and only their ORDER is missing;
101
+ `--depends-on` covers the dependencies known at creation time.
95
102
  - The parent body MUST carry all four template sections (Goal / Scope / For agents / Verification) —
96
103
  a missing section is a review blocker.
97
104
  - Sub-issues are **native** GitHub sub-issues (`POST …/issues/{parent}/sub_issues` with the child's
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: kit-effort-start
3
- description: Start an effort — thin caller of `cckit effort start <N>`. Creates the `effort/<N>-<slug>` integration branch + isolated bootstrapped worktree from the base branch, then marks the parent issue In Progress on the board. Sub-issues later branch from this effort branch or commit directly on it.
3
+ description: Start an effort — thin caller of `cckit effort start <N>`. Creates the `effort/<N>-<slug>` integration branch + isolated bootstrapped worktree from the base branch, then marks the parent issue In Progress on the board. Enforces the effort WIP limit (`effort.wipLimit`, default 2) — a new effort is refused, before anything is written, while that many are already in progress; `--force` starts anyway. Sub-issues later branch from this effort branch or commit directly on it.
4
4
  when_to_use: After `/kit-effort-new`, to begin building an effort. The effort branch is the single integration branch for the whole effort — its sub-issues merge into it, and exactly one PR opens from it (`/kit-effort-pr`). See rules/effort-model.md.
5
5
  ---
6
6
 
@@ -14,12 +14,19 @@ title composer, #121). The dispatcher loads the project config first (#151), so
14
14
  owns ALL of the mechanics:
15
15
 
16
16
  - resolving `<N|slug>` to the parent effort issue (slug handles work too)
17
+ - the **WIP limit**: refusing a NEW effort once `effort.wipLimit` (default 2) are already in
18
+ progress — see below
17
19
  - fresh fetch of the base branch + branch `effort/<N>-<slug>` — always `effort/`, regardless of
18
20
  the parent's `kind:` label (branch-naming.md)
19
21
  - the isolated worktree at `.claude/worktrees/effort+<N>-<slug>` (reused if the branch already
20
22
  exists; the dir name encodes #N so `kit-gc` won't wipe it while the issue is open)
21
23
  - **bootstrap** (`wt_bootstrap`): copies gitignored `.env.local*` + project ids, assigns a
22
- per-worktree dev PORT, installs deps (`KIT_WT_INSTALL=0` opts out)
24
+ per-worktree dev PORT, installs deps **at the selected targets**, in this
25
+ precedence: `worktree.installPaths` if set (those dirs only, installed whether or not each one
26
+ declares dependencies; `[]` = nothing), else the root *only when* its manifest declares
27
+ dependencies or it is a workspace root *with at least one member*, else
28
+ nothing — a dependency-free root never gets a stray empty `pnpm-lock.yaml`, and an `installPaths`
29
+ entry that escapes the worktree is refused. `KIT_WT_INSTALL=0` opts out entirely
23
30
  - the live-session **collision guard**: refuses to disturb a worktree a live session is sitting in
24
31
 
25
32
  ## Inputs
@@ -28,6 +35,28 @@ owns ALL of the mechanics:
28
35
  | ------------ | -------- | -------------------------------------------------------------- |
29
36
  | Issue number | ✓ | The **parent** effort issue `N` (or its slug handle) |
30
37
  | Slug | optional | Short kebab-case suffix; defaults to a slug of the issue title |
38
+ | `--force` | optional | Start past the WIP limit (`KIT_FORCE=1` does the same) |
39
+
40
+ ## The WIP limit
41
+
42
+ The verb refuses to start a **new** effort once `effort.wipLimit` (default **2**) are already in
43
+ progress. **In progress** = an `effort/<N>-<slug>` branch exists, as a local head **or** on origin —
44
+ read with `git ls-remote`, not the cached `refs/remotes`, so a branch pushed since your last fetch
45
+ counts and one deleted on origin does not. `EFFORT_WIP_REMOTE=0` skips that query and counts the
46
+ cached refs instead; an unreachable origin falls back to them with a warning, never a failure. The
47
+ verb creates that branch and `effort close` deletes it. The board Status is NOT the signal
48
+ (the board step below is additive and skipped when Projects v2 is off).
49
+
50
+ - **At** the limit refuses; only strictly under it starts. `0` freezes new efforts **unless forced**.
51
+ - Re-running the verb on an effort already in progress is never gated — it adds no WIP.
52
+ - The check runs before the fetch/branch/worktree/bootstrap, so a refusal makes **no branch, no
53
+ worktree and no board change**. It is not read-free: the gate queries origin, and a `<slug>`
54
+ argument is resolved first, which can run `gh issue list`.
55
+ - Do not paper over a refusal. Report it and let the human decide: close an effort
56
+ (`/kit-effort-close`), or re-run with `--force`. Only pass `--force` when the human asked for it.
57
+ - `EFFORT_WIP_LIMIT` overrides the configured limit for one invocation; a configured value that is
58
+ not a non-negative integer is ignored with a warning and the default `2` is used.
59
+ - `cckit start <issue>` (a plain task worktree, `/kit-task-start`) has **no** WIP limit.
31
60
 
32
61
  > **One effort = one branch = one worktree** (effort-model.md). Sub-issues either commit directly
33
62
  > on this branch (sequential — one commit per sub-issue, that commit's diff IS the sub's work
@@ -38,9 +67,13 @@ owns ALL of the mechanics:
38
67
 
39
68
  ```bash
40
69
  cckit effort start <N> # or: cckit effort start <N> <slug-override>
70
+ cckit effort start --force <N> # only when the human asked to start past the WIP limit
41
71
  # cckit not on PATH? "${CLAUDE_PLUGIN_ROOT}/bin/cckit" effort start <N>
42
72
  ```
43
73
 
74
+ A WIP-limit refusal exits **1** and prints what is in progress. Nothing was created — surface the
75
+ message, do not retry with `--force` on your own.
76
+
44
77
  The last stdout line is machine-readable — `<worktree-path>|<branch>|<parent-issue>` — then ALL
45
78
  effort work continues **inside the worktree**:
46
79
 
@@ -79,5 +112,7 @@ fi
79
112
  - **Worktree always** — one branch per worktree, never share a checkout.
80
113
  - Sub-issue branches are `sub/<N><letter>-<slug>` off THIS branch and **never open their own PR to
81
114
  the base branch** — they merge into `effort/<N>`.
82
- - Safe to re-run for the parent: the verb reuses an existing branch/worktree and refuses to
83
- disturb one a live session owns.
115
+ - Safe to re-run for the parent: the verb reuses an existing branch/worktree, refuses to
116
+ disturb one a live session owns, and never applies the WIP limit to an effort already in progress.
117
+ - **One effort at a time (within the limit)** — the WIP limit exists so efforts finish. When it
118
+ fires, close something rather than forcing past it.
@@ -11,6 +11,10 @@ Plugin-direct skill — helpers resolve from `${CLAUDE_PLUGIN_ROOT}`.
11
11
  Cleans what accumulates: merged-but-undeleted branches (local + remote), orphan
12
12
  worktrees, stale stashes, orphan unpushed commits, and stale-open issues.
13
13
 
14
+ > This skill is the **read-only classifier**. To act on its verdicts in one guided pass, use
15
+ > **`/kit-cleanup`** (`cckit cleanup`) — it consumes this same `kit_gc_analyze` output, so the two
16
+ > can never disagree about what is safe to delete.
17
+
14
18
  **Safety contract:** read-only **analysis first** → present a plan → only delete
15
19
  after the user confirms. Never touch: the base branch (`main`/`develop`), branches
16
20
  with an **open PR**, worktrees of an open-PR branch, **a branch/worktree whose
@@ -19,9 +23,24 @@ branch's remote** (orphan work is surfaced, never auto-deleted).
19
23
 
20
24
  > **Worktree↔issue association.** A branch `<kind>/<N>-<slug>` (or worktree dir
21
25
  > `<kind>+<N>-<slug>`) belongs to issue **#N** — derived from the name, not registered.
26
+ > The effort **sub** form counts too: `sub/<N><letter>-<slug>` / `sub+<N><letter>-<slug>`
27
+ > (`rules/effort-model.md`) resolves to the parent effort **#N**, so live subs of an open
28
+ > effort are protected. Exactly ONE trailing lowercase letter is a suffix — anything else
29
+ > (`16a04`, `1604a4`, `1604A`) is not an issue number and yields no association at all.
30
+ > The suffix is honored for **any** lowercase kind, not only `sub` (`feat/1604a-x` → #1604).
31
+ > That is deliberate: a spurious association can only ever *add* protection — an unrelated
32
+ > #N is either open (keep) or closed/absent (no claim asserted) — while narrowing it to `sub`
33
+ > would let gc delete a misnamed live branch.
22
34
  > `gc` resolves #N and **refuses to remove anything whose issue is still open, even
23
35
  > with no PR yet** — this protects in-progress worktrees that haven't opened a PR.
24
36
  > Helper: `${CLAUDE_PLUGIN_ROOT}/scripts/lib/worktree-issue.sh` (`wt_issue_number`, `wt_protected_reason`).
37
+ >
38
+ > **The protection helper is mandatory.** `kit_gc_analyze` / `kit_gc_prune` load it via
39
+ > `_kit_gc_require_deps` and **abort with a FATAL (rc=1) if it cannot be sourced** — without it
40
+ > every issue-open check returns empty and the whole repo classifies as SAFE. A refusal is the
41
+ > correct outcome; never present a degraded analysis as a deletion plan. The dir resolution
42
+ > works under bash **and zsh** (`BASH_SOURCE` is bash-only, so zsh silently switched the
43
+ > protection off before #219).
25
44
 
26
45
  ## Execution
27
46
 
@@ -29,6 +29,11 @@ cckit next
29
29
  Prints the unblocked set (wave 0 of the plan) and the single recommended next issue with its start
30
30
  command. `--effort <N>` scopes it to one effort's sub-issues.
31
31
 
32
+ The unblocked set is ordered by the `priority:pN` label — **p0 → p1 → p2 → p3**, unlabeled last —
33
+ so the recommended issue is the most urgent thing that is actually startable. Ties keep their
34
+ existing order. Priority never jumps a dependency: an issue only reaches wave 0 once every blocker
35
+ is closed, so a low-priority blocker is always offered before the high-priority issue it gates.
36
+
32
37
  Then start the top one in its own worktree + branch:
33
38
 
34
39
  ```