@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,92 @@
1
+ ---
2
+ name: kit-status
3
+ description: Answer "where are we?" in three buckets — local undone work (dirty worktrees, commits on no remote, effort subs not merged in), open PRs waiting on a human (no approval, no AI-reviewer pass, unresolved threads, red checks, conflicts), and cleanup available local + remote. Read-only, so it is always safe to run first.
4
+ when_to_use: |
5
+ Whenever the owner asks, in ANY wording, how things stand overall — this is the default answer to
6
+ an open status question, and it fires on the phrasing people actually use, not one canonical form:
7
+
8
+ - "where are we" · "where we at" · "where are we at" · "where do we stand" · "where did we leave off"
9
+ - "status" · "what's the status" · "give me a status" · "sitrep" · "state of play"
10
+ - "what's the current state" · "current state" · "what's the state of things"
11
+ - "how are we doing" · "how's it going" · "how are things" · "how're we looking" · "are we good"
12
+ - "what's left" · "what's outstanding" · "what's still open" · "anything pending"
13
+ - "what needs my attention" · "anything waiting on me" · "anything I need to look at"
14
+ - "anything to clean up" · "is the repo tidy"
15
+ - "catch me up" · "recap" · "bring me up to speed" · "what did we do" · "update me"
16
+ - at the start of a session, to pick up where the last one stopped
17
+ - the same question in whatever language the project speaks (`project.language` in the config) —
18
+ in Spanish: "cómo vamos" · "en qué estamos" · "qué falta" · "estado" · "dónde quedamos"
19
+
20
+ The list is illustrative, not exhaustive. Any open-ended question about overall progress belongs
21
+ here, including phrasings not written above.
22
+
23
+ SKIP it when the question has a specific subject — "how's the login bug doing", "what's the status
24
+ of PR 41", "where are we on the migration". Those are about one thing; answer them directly. This
25
+ skill is for the unqualified question, where the owner wants the whole picture.
26
+
27
+ For the board alone use `/kit-task-sync`; for what to pick up next use `/kit-next`; to act on the
28
+ cleanup this reports use `/kit-cleanup`.
29
+ ---
30
+
31
+ # kit-status — where are we?
32
+
33
+ Plugin-direct skill — a thin caller over `cckit status`. The bucket logic lives in
34
+ `${CLAUDE_PLUGIN_ROOT}/scripts/lib/kit-status.sh` (kit-engine-boundary: the verb logic has one
35
+ home, never inline in a skill).
36
+
37
+ **Run this before answering any "where are we" question with `git` output.** Plain `git status` and
38
+ `git branch -vv` answer a different question — they describe refs, not work — and they cannot see
39
+ which PRs are waiting on a person or which branches are safe to delete. That substitution is the
40
+ mistake this skill exists to prevent.
41
+
42
+ ## Execution
43
+
44
+ ```bash
45
+ cckit status # the three buckets as markdown
46
+ cckit status --llm # the same verdicts as JSON, for an agent
47
+ ```
48
+
49
+ Read-only. It writes nothing, deletes nothing, and pushes nothing.
50
+
51
+ ## The three buckets, in this order
52
+
53
+ | # | Bucket | What it answers |
54
+ | --- | --- | --- |
55
+ | 1 | **Local undone work** | What exists only on this machine: worktrees with uncommitted changes, branches holding commits reachable from **no** remote ref, and effort subs not yet merged into their effort branch. Plus the worktree inventory — a clean worktree on an issue branch is still work in progress. |
56
+ | 2 | **PRs waiting on a human** | Every open PR with the ONE thing it needs: `conflict`, `checks`, `draft`, `wait`, `threads`, `ai-review`, `review`, or `ready`. |
57
+ | 3 | **Cleanup available** | Branches and worktrees that can go — **local and remote** — plus what is deliberately kept (orphan work, open-issue branches). |
58
+
59
+ ## Reading bucket 2
60
+
61
+ The verdict is the single next action, most-blocking first, because the later signals cannot be
62
+ acted on until the earlier ones clear:
63
+
64
+ | Verdict | Means |
65
+ | --- | --- |
66
+ | `conflict` | Merge state is `CONFLICTING`. Rebase onto the base; nothing else about the PR can be judged until then. |
67
+ | `checks` | A required check is failing. A review would be premature. |
68
+ | `draft` | Still a draft — the author has not asked for anything yet. |
69
+ | `wait` | Checks are still running. Nothing to do but wait. |
70
+ | `threads` | Unresolved review threads. The reviewer already spoke, so this outranks a missing approval. |
71
+ | `ai-review` | No AI-reviewer pass yet. Only reported when the repo evidently uses one (a reviewer config, or an AI review on another open PR) — never in a repo that has none. |
72
+ | `review` | Green, no human approval yet. This is the one that needs the owner. |
73
+ | `ready` | Green and approved. Mergeable. |
74
+
75
+ **A superseded check run never counts.** Re-running a check — or retitling a PR, which re-fires a
76
+ title gate — leaves the old run in GitHub's rollup. Counting every context there reports a PR as
77
+ failing a check that has since passed, so the fetcher keeps only the latest run per check name.
78
+
79
+ ## Rules
80
+
81
+ - **Never answer a status question from `git` output alone.** Run this first; drop to raw `git` or
82
+ `gh` only for something the buckets genuinely do not cover, and say what that was.
83
+ - **Match on intent, not on wording.** "how are we doing", "catch me up", "cómo vamos" and "where
84
+ we at" are the same question. Do not wait for the phrase "where are we" — an unqualified question
85
+ about overall progress is this skill, whatever words or language it arrives in.
86
+ - **Present all three buckets, in order, even when one is empty.** Each bucket names its own
87
+ emptiness ("nothing local-only", "no open PRs"). A silently missing bucket is indistinguishable
88
+ from a clean one, and this report is read to decide what to do next.
89
+ - **Report, do not act.** This skill deletes nothing and merges nothing. Bucket 3 is a pointer to
90
+ `/kit-cleanup`; bucket 2 is a pointer to a review or a merge. Ask before acting on either.
91
+ - **Do not restate the raw table.** Lead with what needs the owner's attention — usually the PRs
92
+ with `review` or `threads` — then the rest.
@@ -16,7 +16,13 @@ here (kit-engine-boundary #1/#2 — same single-implementation principle as the
16
16
  - the isolated worktree at `.claude/worktrees/<kind>+<N>-<slug>` (reused if it already exists;
17
17
  the dir name encodes issue #N so `kit-gc` won't wipe it while the issue is open)
18
18
  - **bootstrap** (`wt_bootstrap`): copies gitignored `.env.local*` + project ids into the worktree,
19
- assigns a per-worktree dev PORT, installs deps (`KIT_WT_INSTALL=0` opts out)
19
+ assigns a per-worktree dev PORT, installs deps **at the selected targets**, in
20
+ this precedence: **`worktree.installPaths` if set** — those dirs only, installed whether or not
21
+ each declares dependencies, `[]` means nothing, and the
22
+ checks below are skipped; **else** the root *only when* its manifest declares dependencies or it is a
23
+ workspace root *with at least one member*; **else nothing**. A dependency-free root is skipped so
24
+ pnpm can't plant an empty `pnpm-lock.yaml` the captain then holds the PR on. `installPaths`
25
+ entries that point outside the worktree are refused. `KIT_WT_INSTALL=0` opts out entirely
20
26
  - the **claim precheck** (#124): warns when the issue is already In Progress on the board —
21
27
  another session may own it
22
28
  - the live-session **collision guard**: never disturbs a worktree a live session is sitting in
@@ -8,10 +8,29 @@ Canonical naming + merge-order rules so you're never confused about *what a bran
8
8
  <kind>/<issue-number>-<slug>
9
9
  ```
10
10
 
11
- - `<kind>` — one of the closed set below. No other prefixes.
11
+ - `<kind>` — one of the closed set below, or one of the two effort prefixes named next. No others.
12
12
  - `<issue-number>` — the issue this branch closes. **Always required** for human work.
13
13
  - `<slug>` — short kebab-case description (≤ 5 words).
14
14
 
15
+ ### Effort prefixes (the two exceptions to the closed set)
16
+
17
+ An effort's integration branch and its sub-branches are **not** in the kind table — they are named
18
+ after the effort, not after a kind of change:
19
+
20
+ | Pattern | What | `N` |
21
+ | --- | --- | --- |
22
+ | `effort/<N>-<slug>` | the effort's ONE integration branch, cut from the base; its ONE PR opens from here. `effort-model.md` writes it `effort/<N>` — same branch, slug elided | the **parent effort issue's** GitHub issue number |
23
+ | `sub/<N><letter>-<slug>` | one sub-issue of that effort, cut from `effort/<N>` and merged back into it | the same parent effort issue number, plus one lowercase letter |
24
+
25
+ `effort-start` creates the first and `orchestrate` the second; do not hand-roll either.
26
+
27
+ **Effort sub-branches** add one lowercase letter to the number — `sub/<N><letter>-<slug>`
28
+ (`sub/1604a-parser`), branched from `effort/<N>` and merged back into it (`rules/effort-model.md`).
29
+ Tooling derives the parent effort **#N** from that form, so `gc` protects a live sub the same way
30
+ it protects any branch whose issue is still open. One trailing letter only — `16a04` or `1604a4`
31
+ is not an issue number and gets no protection. (The parser honors the suffix for any kind, not
32
+ just `sub` — it errs toward protection rather than risk deleting a misnamed live branch.)
33
+
15
34
  ### Closed set of kinds
16
35
 
17
36
  | Kind | For | Typical risk |
@@ -20,3 +20,11 @@
20
20
  - Use tables for comparisons and status
21
21
  - Use bullets for lists and steps
22
22
  - If something needs explanation, keep it tight
23
+
24
+ ## Durable prose
25
+
26
+ - Commits, PR and issue bodies, rules, ADRs and knowledge docs go through the `concrete` skill
27
+ before they are written: it names each cut by offense and never deletes for length.
28
+ - **A delegated agent inherits this only through its brief.** Stating the mandate here does not make
29
+ it fire in a sub-agent — `delegation-brief.md` § *Durable prose — the concrete pass* is what
30
+ carries it into a delegated agent's context, and `cckit brief` emits that block.
@@ -6,7 +6,7 @@ when an agent rediscovers something it should have been handed, add it here.
6
6
 
7
7
  ## Project specifics (fill these in for {{PROJECT_NAME}})
8
8
 
9
- - Repo `<owner>/<repo>` · base branch **`main`** · owner **`<owner>`** · project board number **`<N>`**.
9
+ - Repo `<owner>/<repo>` · base branch **`<base>`** · owner **`<owner>`** · project board number **`<N>`**.
10
10
  - Build/dep tooling (e.g. pnpm + turbo monorepo, workspaces, package scope).
11
11
  - **Secrets by NAME, never value** — the GitHub API token env var (some apps use a custom name like
12
12
  `GH_PAT`, **not** `GITHUB_TOKEN` — state which), model/API env vars, auth keys. Say which file/code
@@ -16,18 +16,52 @@ when an agent rediscovers something it should have been handed, add it here.
16
16
 
17
17
  - **Refresh the base first.** An isolation worktree can seed from a **stale commit**. Start with
18
18
  `git fetch origin <base> && git reset --hard origin/<base>` on a fresh branch; confirm
19
- `git rev-parse --short HEAD` == `origin/<base>`.
19
+ `git rev-parse --short HEAD` == `git rev-parse --short origin/<base>` — resolve BOTH sides to a
20
+ commit id, or you are comparing a SHA to a ref name and the check always "fails".
20
21
  - **Commit so the guard sees the right branch.** A base-branch commit guard inspects the command's
21
22
  named directory — a `$VAR` path can resolve to the main checkout and false-block. Commit via
22
23
  `git -C <literal-worktree-path>` or `cd <literal-path>` (never a variable).
23
24
  - **zsh quirks:** `${VAR:+--flag "$VAR"}` word-splits — pass flags explicitly. `status` and `path`
24
25
  are read-only vars — don't use them as loop variables.
25
26
  - **Board finder paginates the full board.** `project_find_item_by_issue` (gh-project.sh) pages the
26
- whole board — use it; don't hand-roll a `first:100` query that misses recent issues. Owner/project
27
- number resolve from `.claude/kit.config.json` (`.github.owner`, `.github.projectNumber`).
27
+ whole board — use it; don't hand-roll a `first:100` query that misses recent issues.
28
+ - **Never hard-code the config path.** Two layouts exist and both are current, so
29
+ `.claude/kit.config.json` is a guess, not the answer. `kit_config_path` (`scripts/lib/config-path.sh`)
30
+ resolves it in this order, walking up from the start dir: `$KIT_CONFIG` if set → a root
31
+ `cckit.config.json` (self-host layout) → `.claude/kit.config.json` (scaffolded layout). Read
32
+ `.github.owner` / `.github.projectNumber` / `.github.baseBranch` out of whatever it prints, or let
33
+ `load_kit_config` (`scripts/lib/kit-config.sh`) export `KIT_REPO` / `KIT_OWNER` /
34
+ `KIT_BASE_BRANCH` / `KIT_PROJECT_NUMBER` for you.
28
35
  - **Project IDs are worktree-durable.** `source scripts/lib/gh-project.sh; load_project_ids` reads
29
36
  the captured IDs from the shared git-common-dir, so worktrees see them too.
30
37
 
38
+ ## Durable prose — the concrete pass
39
+
40
+ Any delegated agent that will write a **durable artifact** — a GitHub issue body, a PR body, a
41
+ commit message, a rule, an ADR, a knowledge doc — applies the `concrete` catalogue to that text
42
+ **before** writing it.
43
+
44
+ The brief has to say this, because a sub-agent applies a skill only when it is told to or can read
45
+ the skill file. **An installed skill that no brief mentions does not fire** — a mandate written only
46
+ in `communication-style.md` reaches the orchestrator and stops there, and the artifacts it governs
47
+ keep shipping without the pass. Nothing warns you: the rule is present, the skill is installed, and
48
+ the output looks fine.
49
+
50
+ The constraints, so this block is self-sufficient when the skill file is not in the agent's context:
51
+
52
+ - **Cut only by NAMED offense, never by length.** A text can be long and clean. Name the offense in
53
+ the diagnosis so the author can argue with it.
54
+ - **Untouchable:** evidence, command output, exit codes, reproductions, counts, dates, SHAs,
55
+ `file:line`, flag and label names, stated limits, and the reason a claim was rejected. If a cut
56
+ would remove one of these, the text is dense, not slop.
57
+ - **`O13` unverifiable claim** ("this improves quality", "this is more secure") and **`O14`
58
+ undecided decision** (options listed as though a conclusion) are the two that matter. When either
59
+ fires, the fix is the underlying gap — verify the claim, or make the decision. Rewording it into
60
+ fluent prose is the failure mode, not the fix.
61
+
62
+ `communication-style.md` states the mandate; this block is what carries it into a delegated agent's
63
+ context.
64
+
31
65
  ## Gate commands (fill in for {{PROJECT_NAME}})
32
66
 
33
67
  - Build / typecheck / lint commands; shell scripts: `bash -n`; any knowledge/plan lint. A green
@@ -15,11 +15,11 @@ is fine while building. 1 effort decomposes into **N native GitHub sub-issues**
15
15
  sequential, decided at scoping).
16
16
 
17
17
  ```
18
- parent issue #N ──► effort/<N> branch + worktree (from main)
18
+ parent issue #N ──► effort/<N> branch + worktree (from {{BASE_BRANCH}})
19
19
  ├─ sub #a ─► sub/<N>a worktree (from effort/<N>) ─┐
20
20
  ├─ sub #b ─► sub/<N>b worktree ├─ merge into effort/<N>
21
21
  └─ sub #c ─► sub/<N>c worktree ┘
22
- effort/<N> ──► ONE PR ──► main ──► effort-close
22
+ effort/<N> ──► ONE PR ──► {{BASE_BRANCH}} ──► effort-close
23
23
  ```
24
24
 
25
25
  Solo/sequential efforts may commit sub-issues directly on `effort/<N>` (one commit per sub-issue —
@@ -90,6 +90,15 @@ by `effort_set_blocked_by`) **and** a `## Relations` section in the parent body
90
90
  mirror): `Depends on #N` / `Blocks #N` / `Extends #N` / `Parallel-safe with #N`. This is the
91
91
  effort-level analogue of the PR-level `Depends on` in `branch-naming.md`.
92
92
 
93
+ Two ops write that pair, and both go through the one `- Depends on #N` formatter
94
+ (`_eff_relations_add`) so the line never drifts: **`cckit effort new --depends-on "#1,#2"`** for the
95
+ dependencies known at creation time, and **`cckit effort chain <a> <b> [<c> …]`** to declare a
96
+ running order over issues that already exist (each successor gets `blocked_by` its predecessor plus
97
+ the matching `Depends on` line). `chain` is idempotent and additive — a pre-existing blocker is kept
98
+ — and it validates the whole chain before writing anything: fewer than two numbers, a non-numeric
99
+ argument, an unknown issue, a repeated number, or an edge that would close a cycle refuses the whole
100
+ chain and writes nothing. A cycle is refused because the wave layering cannot order a cyclic graph.
101
+
93
102
  **Session-fit (`ctx:*` + `kit effort plan`).** Every effort carries a **`ctx:S|M|L|XL`** label —
94
103
  how much of one working session it consumes before the context window fills. Derived by
95
104
  `effort_ctx_bucket` (`scripts/lib/effort-metrics.sh`) from difficulty + sub count: S=1 · M=2 · L=4 ·
@@ -109,14 +118,48 @@ The parent carries the rich narrative; the **PR** carries the human-facing revie
109
118
  | Step | What |
110
119
  |------|------|
111
120
  | `effort-new` | parent issue (4-section body **filled** + `ctx/kind/priority/role/flow` labels) + native sub-issues, every title linted; optional `--slug` sets the handle |
112
- | `effort-start <slug\|N>` | `effort/<N>` branch + worktree; board → In Progress |
121
+ | `cckit effort chain <a> <b> …` | declare a running order over EXISTING issues: each successor `blocked_by` its predecessor + a `- Depends on #<predecessor>` line. Idempotent, additive, cycle-refusing (nothing is written on a refusal) |
122
+ | `effort-start [--force] <slug\|N>` | `effort/<N>` branch + worktree; board → In Progress. **WIP-limited** — see below |
113
123
  | orchestrate | sub-issues in own worktrees (file-disjoint) → merge into `effort/<N>`; each closes + board Done as it lands |
114
- | `effort-pr <slug\|N>` | ONE PR `effort/<N>` → main (rich body + `## For agents`) |
124
+ | `effort-pr <slug\|N>` | ONE PR `effort/<N>` → {{BASE_BRANCH}} (rich body + `## For agents`) |
115
125
  | `effort-close <slug\|N>` | **snapshot sub-diffs pre-squash** → merge → close parent + subs → board Done(all) → GC prune → kit-sync drift check |
116
126
 
117
127
  Board + record state are correct **by construction** — the close op owns them. Never rely on a
118
128
  separate, skippable "mark done" step.
119
129
 
130
+ **WIP limit — how many efforts may be open at once.** `effort_start` refuses to start a **new**
131
+ effort once `effort.wipLimit` (default **2**) are already in progress. **In progress** means an
132
+ `effort/<N>-<slug>` branch exists — a local head (`effort_branch_rows_local`) **or** a branch origin
133
+ has right now (`effort_branch_rows_origin`, a `git ls-remote` read), unioned by
134
+ `effort_wip_rows`. That is the kit's one definition of a started effort, not a second one:
135
+ `effort_start` creates the branch and `effort_close` deletes it, so the set is exactly "started and
136
+ not yet closed". The board Status is deliberately **not** the signal — it is written by the
137
+ `/kit-effort-start` skill's board step, never by the verb, and it is empty whenever Projects v2 is
138
+ off.
139
+
140
+ - **The cached `refs/remotes` is not the source.** It is wrong in both directions: a branch pushed
141
+ since the last fetch is absent (the gate would let the limit be exceeded), and a branch deleted on
142
+ origin lingers until a prune (the gate would block a start that should be allowed). `ls-remote`
143
+ answers both without writing or pruning a ref. `effort_slug_resolve` keeps reading the cached refs
144
+ because slug lookup is on the hot path of every effort verb — that cached-ref lookup is
145
+ network-free. Resolution as a whole is not: with no branch matching the slug it falls through to
146
+ `gh`, so a WIP refusal on a slug input can still make a GitHub read.
147
+ - **At** the limit refuses; only strictly under it starts. `0` refuses every ordinary start of a NEW
148
+ effort — `--force` / `KIT_FORCE=1` still start, and a re-start of an effort already in progress is
149
+ never gated.
150
+ - Re-running `effort start` on an effort already in progress is never gated — it adds no WIP, so the
151
+ op stays safe to re-run.
152
+ - The check runs **before** the fetch, branch, worktree and bootstrap — a refusal makes no branch,
153
+ no worktree and no board change, the same validate-then-write discipline `effort_new` and
154
+ `effort_chain` follow. It is not read-free: the gate queries origin, and a `<slug>` argument was
155
+ already resolved through `effort_slug_resolve`, which can run `gh issue list`.
156
+ - `--force` (or `KIT_FORCE=1`) starts anyway. `EFFORT_WIP_LIMIT` overrides the config per
157
+ invocation. A non-integer configured value is ignored with a warning; the default `2` is used.
158
+ - The gate is **effort-only**: `cckit start <issue>` (a plain task worktree) has no WIP limit.
159
+ - **Offline:** `EFFORT_WIP_REMOTE=0` skips the origin query and counts local heads + cached remotes.
160
+ An unreachable origin does the same and warns on stderr; the start proceeds. A gate that
161
+ hard-failed without network would be worse than one that miscounts.
162
+
120
163
  ## Wave close — the final sub of every effort
121
164
 
122
165
  When efforts are planned as an **arc** (a chain of `blocked_by` efforts toward one outcome), the
@@ -0,0 +1,199 @@
1
+ # Naming & IDs
2
+
3
+ Canonical tokens for efforts, sub-issues, chains, tasks and PRs, so a reference always says
4
+ **what kind of thing it points at**.
5
+
6
+ ## The problem this solves
7
+
8
+ GitHub issues and pull requests share **one number sequence**. `#241` is an effort, `#242` a
9
+ sub-issue, `#248` a PR — and nothing in `#N` distinguishes them. No convention can fix that
10
+ *inside* `#N`. The fix is to stop writing efforts and PRs as bare `#N`.
11
+
12
+ A second problem: a sub-issue's own number is invisible where you look for it.
13
+ `[Effort 257] 8 · Gate releases` tells you effort 257, step 8 — but acting on it needs `#265`,
14
+ which appears nowhere in that title. You should be able to act on what you can already see.
15
+
16
+ ## The tokens
17
+
18
+ | Thing | Token | Written as |
19
+ | --- | --- | --- |
20
+ | **Effort** | `E<n>` | `[E241] steady progress order and cadence` |
21
+ | **Sub-issue** (a step in an effort) | `E<n>.<step>` | `[E241.2] effort chain verb sets the order` |
22
+ | **Standalone task** (no parent effort) | `#<n>` | `#209 task pr-merge cleanup removes the wrong worktree` |
23
+ | **Pull request** | `PR <n>` | `PR 268 merged` |
24
+
25
+ `<n>` is the effort's **own GitHub issue number**. `<step>` is its 1-based position in the
26
+ effort, the same index the sub title already carries.
27
+
28
+ Two absolutes, and they govern **human-facing text** — issue and PR titles, prose, commit subjects,
29
+ docs, chat:
30
+
31
+ - An effort is **never** written bare as `#241`. Write `E241`.
32
+ - A PR is **never** written bare as `#268`. Write `PR 268`.
33
+
34
+ Everything else stays `#N`, which in human-facing text now unambiguously means *a standalone issue*.
35
+
36
+ ### Machine-parsed references stay bare `#N`
37
+
38
+ The tokens do **not** govern a reference that code writes and reads back. A token is for a reader
39
+ deciding what a reference points at; a bare `#N` is for a parser matching a literal. Where both
40
+ have to be true, the human-facing text carries the token and the machine-readable line stays `#N`.
41
+
42
+ Two concrete cases, both of which a token would break:
43
+
44
+ - **The `## Relations` mirror — `- Depends on #N`.** `_eff_relations_add`
45
+ (`scripts/lib/effort-ops.sh:66`) is the one formatter for that line, and it matches an existing
46
+ one with `want = "- Depends on #" dep` (line 68). `effort_chain` re-checks it with
47
+ `grep -qE "^[[:space:]]*- Depends on #${prev}[[:space:]]*$"` (line 400) before writing through the
48
+ same formatter. That literal match is what makes a re-run idempotent instead of appending a
49
+ duplicate line — a tested behavior (`effort-ops-test.sh:194`, "relations_add is idempotent (same
50
+ line twice)"). The blocker is often an effort, so a chained effort body legitimately contains a
51
+ bare `#N` pointing at one.
52
+ - **GitHub's own syntax — `Closes #N`, `blocked_by`.** GitHub parses these to link and auto-close;
53
+ so does the kit's fallback, `grep -ioE '(close[sd]?|fix(e[sd])?|resolve[sd]?) +#[0-9]+'`
54
+ (`scripts/lib/kit-task-ops.sh`). `Closes E241` closes nothing.
55
+
56
+ The same asymmetry runs the other way for pull requests, which is why the `PR <n>` absolute is
57
+ scoped to human-facing text too. A squash-merge commit subject ends in `(#268)` — **GitHub writes
58
+ that**, and this rule documents the format two sections down (`… [E241.2] (#275)`). The trailing
59
+ parenthetical is GitHub's, not a person's, and it stays as GitHub writes it.
60
+
61
+ ## Why `E241.2` and not the sub's own number
62
+
63
+ `E241.2` is derivable from what you are already looking at. The sub's title says effort 241,
64
+ step 2 — so you can act on it without first resolving `#243`. That is the whole point: the
65
+ identifier you read is the identifier you type.
66
+
67
+ ```shell
68
+ cckit start E241.2 # not: cckit start 243
69
+ ```
70
+
71
+ Both resolve to the same worktree. The number still works; `E241.2` is what you can remember.
72
+
73
+ ## PR titles
74
+
75
+ A PR title carries its token in trailing **square brackets**, after the conventional-commit
76
+ subject:
77
+
78
+ ```text
79
+ feat(effort): chain verb sets the order [E241.2]
80
+ fix(start): don't plant an empty root pnpm-lock.yaml [#255]
81
+ chore(security): update docs-site deps to clear Dependabot alerts [#249]
82
+ ```
83
+
84
+ - Effort and sub PRs carry `[E<n>]` or `[E<n>.<step>]`.
85
+ - Standalone task PRs carry `[#<n>]`.
86
+ - The conventional-commit prefix is unchanged and still governs release-please's version bump.
87
+ The token is additive; it never replaces `type(scope):`.
88
+
89
+ ### What is enforced today vs. what this rule targets
90
+
91
+ **Enforced now:** `effort_pr_title_check` (`scripts/lib/effort.sh`) requires a `[#<num>]` token —
92
+ the exact `[#num]` when given a number, otherwise any `[#digits]` — and `effort_pr` refuses to open
93
+ a PR without it. That check runs on **effort PRs only**; standalone task PRs are unchecked.
94
+
95
+ **This rule targets** `[E<n>]` / `[E<n>.<step>]` on effort and sub PRs, and the check extended to
96
+ every PR. Until that ships, `[#<num>]` is correct and `effort_pr` will keep generating it.
97
+
98
+ Do not hand-write `[E241.2]` into a PR title before the checker understands it — `effort_pr` would
99
+ reject the title for lacking `[#241]`. The migration is tracked in the implementation issue for
100
+ this rule, and it must move the generator (`effort_pr_title`), the validator
101
+ (`effort_pr_title_check`) and this section together.
102
+
103
+ **Brackets, never parentheses — this is load-bearing.** GitHub's squash-merge appends the PR
104
+ number in parentheses when it writes the commit subject, so the trailing-parens slot is already
105
+ taken:
106
+
107
+ ```text
108
+ feat(core): agents can see what cckit provides [#220] (#230)
109
+ ↑ the work ↑ the PR
110
+ ```
111
+
112
+ A token in parentheses would produce `… (E241.2) (#275)` — two parentheticals with no way to tell
113
+ which is which, recreating the ambiguity this rule exists to remove. Shape carries the meaning:
114
+ **square brackets are the work, parentheses are the PR.** The repo already writes titles this way;
115
+ this rule makes it binding rather than incidental.
116
+
117
+ **Every PR title carries a token.** A title with no token is a PR you cannot trace back to the
118
+ work that asked for it.
119
+
120
+ ## Branches keep their existing form — deliberately
121
+
122
+ Branches stay `<kind>/<issue-number>-<slug>` (see `rules/branch-naming.md`). The `E` token does
123
+ **not** go into a branch name.
124
+
125
+ This is a safety constraint, not a style preference. `wt_issue_number` derives a branch's issue
126
+ number by requiring a pure-lowercase `kind`, a `/`, and pure digits before the first `-`. Even with
127
+ a valid kind prefix, a branch named `feat/e241.2-chain-verb` parses to **no issue number** — the
128
+ segment before the first `-` is `e241.2`, not digits — and a branch with no issue number gets
129
+ **no `gc` issue-open protection** — `cckit gc` would classify a live branch as SAFE to delete.
130
+ That regression has happened before in this repo; see the comment block in
131
+ `scripts/lib/worktree-issue.sh` explaining why sub-branch parsing exists at all.
132
+
133
+ The token belongs where humans read. Branch names are where tooling parses safety.
134
+
135
+ ## Chains
136
+
137
+ A chain is a linear dependency between steps of one effort, written with `→`:
138
+
139
+ ```text
140
+ E241.1 → E241.2 → E241.3
141
+ ```
142
+
143
+ Chains are always within a single effort. A dependency **across** efforts is written with full
144
+ tokens (`E241.3 → E257.1`) and is a dependency, not a chain.
145
+
146
+ ## In prose
147
+
148
+ Write the token, then the name on first mention if the reader needs it:
149
+
150
+ > `E241.2` (the chain verb) is up next, and `PR 268` already landed the priority sort.
151
+
152
+ Do not decorate a token with a second identifier. `E241.2 (#243)` is noise — pick one, and in
153
+ human-facing text the token is the one that carries meaning.
154
+
155
+ ## Labels
156
+
157
+ Labels are the board's axes. A label earns its place only if it **varies** and something
158
+ **reads** it — a constant label is noise on every issue, and a write-only label is metadata
159
+ nobody consumes.
160
+
161
+ | Prefix | Values | Read by | Purpose |
162
+ | --- | --- | --- | --- |
163
+ | `priority:` | `p0` `p1` `p2` `p3` | `pm_prio_sort` (wave ordering) | urgency within a wave |
164
+ | `ctx:` | `S` `M` `L` `XL` | `_ep_weight` (session budget) | how much of a session it costs |
165
+ | `flow:` | `core` `docs` … | effort dispatch | which flow owns it |
166
+ | `role:` | `tech-lead` `docs` … | delegation brief | who it is written for |
167
+ | `kind:` | must discriminate | board grouping | what sort of work it is |
168
+ | `slug:` | one per effort | `effort_slug_resolve` | resolve a name to an effort |
169
+
170
+ ### Rules
171
+
172
+ - **A label must vary.** `kind:task` on every issue in the repo's history tells you nothing.
173
+ Either give `kind:` real values or drop it.
174
+ - **A label must be read.** If nothing consumes it, delete the label *and* the code that writes
175
+ it. `par:seq|wide|<n>` was written by `effort_new` and read by nothing.
176
+ - **Every value in a scale needs a label.** `_ep_weight` scores `XL=8` and falls back to `2` for
177
+ anything unknown, so an `XL` effort with no `ctx:XL` label silently weighs the same as an `M`.
178
+ A scale the code knows but the board cannot express is a scale that quietly misreports.
179
+ - **Do not create per-item labels beyond `slug:`.** They grow without bound and match one issue
180
+ each, which makes them useless as a board axis.
181
+ - **Leave `autorelease:*` alone** — release-please owns those.
182
+
183
+ ### Priority means urgency, not membership
184
+
185
+ `priority:` only orders work if its values are actually distributed. A default that lands on
186
+ almost everything turns the wave sort into a no-op, since sorting a column of identical values
187
+ changes nothing. Set the priority that is true, and re-triage when the distribution drifts.
188
+
189
+ ## Quick reference
190
+
191
+ | You see | It is |
192
+ | --- | --- |
193
+ | `E241` | an effort |
194
+ | `E241.2` | step 2 of effort 241 |
195
+ | `#209` | a standalone issue |
196
+ | `PR 268` | a pull request |
197
+ | `… [E241.2] (#275)` | a squashed commit: the work, then the PR that carried it — GitHub writes the parenthetical |
198
+ | `- Depends on #241` | a machine-parsed dependency line; bare `#N` even when 241 is an effort |
199
+ | `Closes #209` | GitHub's closing keyword; bare `#N` because GitHub parses it |
@@ -30,7 +30,7 @@ The role determines which agent owns the work. Spawn that agent for the actual e
30
30
  2. `/kit-task-start <N>` — isolated worktree + branch from the base, mark In Progress
31
31
  3. Do the work (spawn the owning agent)
32
32
  4. `/kit-task-pr <N>` — commit, push, open PR
33
- 5. `/kit-task-pr-merge` — squash-merge, back to main
33
+ 5. `/kit-task-pr-merge` — squash-merge, back to `{{BASE_BRANCH}}`
34
34
  6. `/kit-task-close <N>` — close issue<!-- IF:PLANS -->, archive plan if all deliverables merged<!-- /IF:PLANS -->
35
35
 
36
36
  ## Rules
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: concrete
3
+ description: Cut AI slop from prose — padding, hedges, unearned adjectives, unverifiable claims, closing summaries that repeat the body. Diagnoses first, asks only when the answer changes the result, then rewrites and says why each cut was made. Targets durable artifacts (commits, PR and issue bodies, rules, ADRs, knowledge docs) automatically; chat and product copy on request.
4
+ when_to_use: Automatically before writing any durable artifact — a commit message, a PR or issue body, a rule, an ADR, a knowledge doc. On request (`/concrete chat` or `/concrete copy`) for assistant replies and end-user product copy. Not for code (that is karpathy-guidelines) and not for design decisions about UI copy.
5
+ ---
6
+
7
+ # concrete
8
+
9
+ Prose that reads well and says nothing is worse than prose that reads badly, because nobody
10
+ notices it is empty. This skill finds the empty parts, discovers what should be there instead, and
11
+ cuts what is left over.
12
+
13
+ ## The contract
14
+
15
+ | Decision | |
16
+ | --- | --- |
17
+ | **Target** | `artifacts` (default) · `chat` · `copy` — one catalogue, three profiles |
18
+ | **Output** | diagnosis → rewrite → the reason for each cut |
19
+ | **Questions** | asked ONLY when the answer changes the result |
20
+ | **Activation** | automatic for durable artifacts; explicit for chat and copy |
21
+ | **Deletion** | only by NAMED offense, **never by length**, with an untouchable list |
22
+
23
+ Never delete to hit a word count. A text can be long and clean; length is a signal to look, not a
24
+ licence to cut. Cutting for length removes evidence first, because evidence is bulkier than prose.
25
+
26
+ ## The offense catalogue
27
+
28
+ Cut only what matches a named offense. Name the offense in the diagnosis so the author can argue.
29
+
30
+ | # | Offense | Cue | Action |
31
+ | --- | --- | --- | --- |
32
+ | O1 | **Preamble** | a sentence announcing what you are about to say, instead of saying it | delete; start at the first claim |
33
+ | O2 | **Self-narration** | "I will now…", "Let me…", "Before I explain…" | delete; do the thing |
34
+ | O3 | **Restatement** | repeats the question or the previous paragraph before adding anything | delete the repeat, keep the addition |
35
+ | O4 | **Closing summary** | a final paragraph restating the body | delete; the body already said it |
36
+ | O5 | **Empty transition** | "That said", "It's worth noting", "In essence", "Importantly" | delete; the sentence stands alone |
37
+ | O6 | **Hedge stack** | two or more of arguably / essentially / somewhat / it seems / perhaps / relatively | keep at most one hedge, and only if the uncertainty is real → often triggers Q1 |
38
+ | O7 | **Unearned adjective** | robust, significant, dramatic, seamless, powerful — with no number behind it | replace with the datum, or delete the adjective |
39
+ | O8 | **Triad padding** | three adjectives or nouns where one carries the meaning ("clean, maintainable and scalable") | keep the one that is load-bearing |
40
+ | O9 | **The escalation frame** | "not just X, but Y" · "more than X — it's Y" | state Y; drop the frame |
41
+ | O10 | **Jargon shield** | internal jargon standing in for the thing: wiring, seam, chrome, surface, leverage | name the thing (the same list `effort_title_lint` bans in effort titles) |
42
+ | O11 | **Decorative punctuation** | an em-dash used for rhythm rather than a real aside; a colon that introduces nothing | delete |
43
+ | O12 | **Enumerated nothing** | "there are several considerations" followed by none that matter | delete, or list the ones that do |
44
+ | O13 | **Unverifiable claim** | a statement nobody could check: "this improves quality", "this is more secure" | → **Q1**. Never rewrite it into fluency |
45
+ | O14 | **Undecided decision** | options described as if a conclusion; no choice made | → **Q2**. Never paper it over with confident phrasing |
46
+
47
+ O13 and O14 are the two that matter most. The rest is tidying; these two are where fluent prose
48
+ hides that nobody verified anything or decided anything.
49
+
50
+ ## Untouchable — never cut, in any target
51
+
52
+ - Command output, exit codes, counts, dates, SHAs, `file:line`, label and flag names.
53
+ - **The reason a claim was rejected** — a rebuttal without its evidence is just an opinion.
54
+ - The verification section of a commit or PR: what was run and what came back.
55
+ - Verbatim quotes of what a person said.
56
+ - Standard and clause citations (ISO/IEC clause numbers, ADR numbers, issue numbers).
57
+ - **Stated limits** — "this is bypassable with `--no-verify`", "this is not an attestation". A
58
+ limit deleted for brevity becomes an overclaim.
59
+
60
+ If a cut would remove one of these, the text is not slop; it is dense. Leave it.
61
+
62
+ ## The interview — two questions, asked only when they change the result
63
+
64
+ Mechanical offenses (O1–O12) are cut without asking. There is nothing to discover; the words are
65
+ simply surplus. Ask only for O13 and O14:
66
+
67
+ - **Q1 — did you verify this, or assume it?** For an unverifiable claim. The answer is either a
68
+ command and its output (which replaces the claim) or an admission (which changes it to "assumed,
69
+ not verified"). Both are better than the original sentence.
70
+ - **Q2 — which of these is the decision?** For prose that lists options as if it had concluded. The
71
+ answer becomes one sentence; the options move to a "considered and rejected" line or leave.
72
+
73
+ Two mechanical tests that replace a question:
74
+
75
+ - **Delete test** — remove the sentence. If nothing downstream changes and nobody would ask for it
76
+ back, it was slop.
77
+ - **Datum test** — for every adjective of degree, ask which number supports it. No number, no
78
+ adjective.
79
+
80
+ Ask at most those two, and only where they apply. If the author is absent (an unattended run), do
81
+ not invent an answer: mark the sentence `[unverified]` in the rewrite and say so in the diagnosis.
82
+
83
+ ## Targets
84
+
85
+ | Target | Activation | Offenses | Notes |
86
+ | --- | --- | --- | --- |
87
+ | `artifacts` | **automatic** | all O1–O14 | Commits, PR and issue bodies, rules, ADRs, knowledge docs. This is where slop is permanent |
88
+ | `chat` | `/concrete chat` | O1–O9, O12–O14 | Follows the project's communication-style rule. **Exempt:** inline term definitions and comprehension checks a teaching mode asks for — those look like padding and are not |
89
+ | `copy` | `/concrete copy` | O5, O7, O8, O9, O11 | End-user product copy. It may be in a language other than the marker lists above, so judge by the offense, not the phrase. Design decisions about copy stay with the project's design skill |
90
+
91
+ ## Output shape
92
+
93
+ 1. **Diagnosis** — one line per finding: `O<n> <offense> — <the quoted fragment>`.
94
+ 2. **Questions** — only Q1/Q2, only if they apply.
95
+ 3. **The rewrite.**
96
+ 4. **Cuts** — one line per deletion with its offense number. A reader must be able to audit what
97
+ left and why.
98
+
99
+ Keep the diagnosis shorter than the text it diagnoses. An anti-slop report that is longer than its
100
+ subject has become the thing it audits.
101
+
102
+ ## Boundaries
103
+
104
+ - **Not for code.** Overcomplication, non-surgical edits and unnecessary abstraction are
105
+ `karpathy-guidelines`.
106
+ - **Not a design skill.** What the UI should say belongs to the project's design routing.
107
+ - **Not a terminology authority.** Which word is correct (defect vs nonconformity, concession vs
108
+ waiver) belongs to the project's vocabulary rule, if it has one.
109
+ - **No emojis**, in this skill's output or anywhere in the kit.
110
+ - It has no opinion about being right. If the author defends a fragment, the fragment stays; the
111
+ diagnosis names offenses, it does not overrule people.
112
+
113
+ ## Applied to itself
114
+
115
+ This file was written under its own rules: no preamble, no closing summary, no adjective without a
116
+ datum. The catalogue's first client is the assistant — commit messages that open with a
117
+ self-narrating line (O2) and close by restating their own body (O4) are the most common case.
@@ -2,6 +2,7 @@
2
2
  name: karpathy-guidelines
3
3
  description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
4
4
  license: MIT
5
+ when_to_use: When writing, reviewing, or refactoring code — keep changes surgical, avoid overcomplication, surface assumptions, define verifiable success criteria. Auto-applies as discipline; not a workflow command.
5
6
  ---
6
7
 
7
8
  # Karpathy Guidelines