@jeiemgi/cckit 0.3.0 → 0.4.1

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.
@@ -1,85 +1,83 @@
1
1
  ---
2
2
  name: kit-effort-start
3
- description: Start an effort — create the `effort/<N>-<slug>` integration branch + isolated worktree from the base branch and mark 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. 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
 
7
7
  # kit-effort-start
8
8
 
9
- Plugin-direct skill — runs straight from `${CLAUDE_PLUGIN_ROOT}` (no per-project `scripts/` checkout
10
- needed). Helpers are sourced from the plugin; repo state (`gh`, `git`, the board) is the project
11
- you're standing in. Respects `KIT_BASE_BRANCH` (default `main`) so the same code serves any project.
12
- Reads `.claude/kit.config.json` from the working directory.
9
+ Thin caller over the ONE canonical effort-start mechanic: the `cckit effort start` verb →
10
+ `effort_start` (`${CLAUDE_PLUGIN_ROOT}/scripts/lib/effort-ops.sh`). The verb logic lives there,
11
+ never inline here (kit-engine-boundary #1/#2 — same single-implementation principle as the PR
12
+ title composer, #121). The dispatcher loads the project config first (#151), so `KIT_REPO` /
13
+ `KIT_BASE_BRANCH` come from `.claude/kit.config.json` of the project you're standing in. The verb
14
+ owns ALL of the mechanics:
15
+
16
+ - resolving `<N|slug>` to the parent effort issue (slug handles work too)
17
+ - fresh fetch of the base branch + branch `effort/<N>-<slug>` — always `effort/`, regardless of
18
+ the parent's `kind:` label (branch-naming.md)
19
+ - the isolated worktree at `.claude/worktrees/effort+<N>-<slug>` (reused if the branch already
20
+ exists; the dir name encodes #N so `kit-gc` won't wipe it while the issue is open)
21
+ - **bootstrap** (`wt_bootstrap`): copies gitignored `.env.local*` + project ids, assigns a
22
+ per-worktree dev PORT, installs deps (`KIT_WT_INSTALL=0` opts out)
23
+ - the live-session **collision guard**: refuses to disturb a worktree a live session is sitting in
13
24
 
14
25
  ## Inputs
15
26
 
16
27
  | Field | Required | Notes |
17
28
  | ------------ | -------- | -------------------------------------------------------------- |
18
- | Issue number | ✓ | The **parent** effort issue `N` |
29
+ | Issue number | ✓ | The **parent** effort issue `N` (or its slug handle) |
19
30
  | Slug | optional | Short kebab-case suffix; defaults to a slug of the issue title |
20
31
 
21
- > **One effort = one branch = one worktree** (effort-model.md). The branch is `effort/<N>-<slug>`
22
- > and the worktree is `.claude/worktrees/effort+<N>-<slug>`. Sub-issues either commit directly on
23
- > this branch (sequential — one commit per sub-issue, that commit's diff IS the sub's work record)
24
- > or use their own file-disjoint `sub/<N><letter>-<slug>` worktrees off this branch and merge in.
25
- > Exactly ONE PR opens from `effort/<N>` (`/kit-effort-pr`).
32
+ > **One effort = one branch = one worktree** (effort-model.md). Sub-issues either commit directly
33
+ > on this branch (sequential — one commit per sub-issue, that commit's diff IS the sub's work
34
+ > record) or use their own file-disjoint `sub/<N><letter>-<slug>` worktrees off this branch and
35
+ > merge in. Exactly ONE PR opens from `effort/<N>` (`/kit-effort-pr`).
26
36
 
27
37
  ## Execution
28
38
 
29
39
  ```bash
30
- source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/kit-config.sh" && load_kit_config
31
- [[ "$KIT_PROJECTS_V2" == "true" ]] && { source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/gh-project.sh"; load_project_ids; }
32
- BASE="${KIT_BASE_BRANCH:-main}" # branch off the integration branch (override per project)
33
-
34
- NUM=""; SLUG_OVERRIDE=""
35
- for a in "$@"; do
36
- [[ -z "$NUM" ]] && NUM="$a" || SLUG_OVERRIDE="$a"
37
- done
38
- [[ -n "$NUM" ]] || { echo "✗ kit-effort-start: parent issue number required"; exit 1; }
40
+ cckit effort start <N> # or: cckit effort start <N> <slug-override>
41
+ # cckit not on PATH? "${CLAUDE_PLUGIN_ROOT}/bin/cckit" effort start <N>
42
+ ```
39
43
 
40
- META=$(gh issue view "$NUM" --repo "$KIT_REPO" --json title,labels,projectItems)
41
- TITLE=$(echo "$META" | jq -r .title)
44
+ The last stdout line is machine-readable — `<worktree-path>|<branch>|<parent-issue>` — then ALL
45
+ effort work continues **inside the worktree**:
42
46
 
43
- if [[ -n "$SLUG_OVERRIDE" ]]; then SLUG="$SLUG_OVERRIDE"; else
44
- SLUG=$(echo "$TITLE" | sed -E 's/^\[[^]]+\][[:space:]]*//' \
45
- | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g; s/^-|-$//g' | cut -c1-40)
46
- fi
47
+ ```bash
48
+ cd <worktree-path> # sub-issues merge into effort/<N>-<slug>
49
+ ```
47
50
 
48
- # The integration branch is ALWAYS effort/<N>-<slug> (branch-naming.md), regardless of the
49
- # parent's kind:* label. The worktree dir still encodes #N so kit-gc protects it while #N is open.
50
- BRANCH="effort/$NUM-$SLUG"
51
- WT_DIR=".claude/worktrees/effort+${NUM}-${SLUG}"
51
+ ### Board step (additive — the verb does not touch the board)
52
52
 
53
- git fetch origin "$BASE" --quiet
54
- if git worktree list --porcelain | grep -q "/effort+${NUM}-${SLUG}$"; then
55
- echo "✓ Worktree already exists: $WT_DIR (branch $BRANCH)"
56
- else
57
- git worktree add -B "$BRANCH" "$WT_DIR" "origin/$BASE"
58
- fi
53
+ Mark the parent effort In Progress when Projects v2 is enabled:
59
54
 
55
+ ```bash
56
+ NUM=<parent-issue> # third field of the verb's machine-readable line
57
+ source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/kit-config.sh" && load_kit_config
60
58
  if [[ "$KIT_PROJECTS_V2" == "true" ]]; then
61
- ITEM_ID=$(echo "$META" | jq -r --arg t "$KIT_PROJECT_TITLE" '.projectItems[]? | select(.title==$t) | .id')
59
+ source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/gh-project.sh"; load_project_ids
60
+ ITEM_ID=$(project_find_item_by_issue "$NUM")
62
61
  [[ -n "$ITEM_ID" ]] && project_set_single_select "$ITEM_ID" "$STATUS_FIELD_ID" "$STATUS_OPT_IN_PROGRESS"
63
62
  fi
64
-
65
- echo "→ cd $WT_DIR # ALL effort work happens here; sub-issues merge into $BRANCH"
66
- echo "✓ Worktree $WT_DIR on branch $BRANCH (from $BASE) — effort #$NUM In Progress"
67
- echo " Next: build the sub-issues, then /kit-effort-pr $NUM"
68
63
  ```
69
64
 
70
65
  ## Output
71
66
 
72
- - Worktree path + `effort/<N>-<slug>` branch — **work continues inside the worktree** (`cd $WT_DIR`)
67
+ - Worktree path + `effort/<N>-<slug>` branch — **work continues inside the worktree**
73
68
  - Parent issue #N now In Progress on the board (if Projects v2 is on)
74
69
  - Reminder that exactly one PR opens from this branch (`/kit-effort-pr <N>`)
75
70
 
76
71
  ## Rules
77
72
 
73
+ - **Engine boundary** — the start mechanic lives in `effort_start`; this skill only runs the verb
74
+ and does the board step. Never re-implement `git worktree add` / bootstrap / guards here.
78
75
  - The integration branch is **always** `effort/<N>-<slug>` (branch-naming.md, effort-model.md) —
79
76
  never `task/` or `feat/` for the parent.
80
- - Branch from the base branch (`KIT_BASE_BRANCH`) only — never from a feature branch.
81
- - **Worktree always** — one branch per worktree, never share a checkout. The `effort+<N>-<slug>`
82
- worktree-dir name encodes #N so `kit-gc` won't wipe it while the issue is open.
77
+ - Branch from the base branch (`KIT_BASE_BRANCH`) only — never from a feature branch; the verb
78
+ enforces this.
79
+ - **Worktree always** — one branch per worktree, never share a checkout.
83
80
  - Sub-issue branches are `sub/<N><letter>-<slug>` off THIS branch and **never open their own PR to
84
81
  the base branch** — they merge into `effort/<N>`.
85
- - Don't re-run for the parent if its worktree already exists — the skill reuses it.
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.
@@ -1,76 +1,65 @@
1
1
  ---
2
2
  name: kit-task-start
3
- description: Start work on a GitHub issue — branch from the base branch (optionally an isolated worktree associated with the issue), mark the issue In Progress on the board (if enabled), switch to the branch.
4
- when_to_use: When beginning work on a tracked issue. Always run before editing files. Replaces ad-hoc `git checkout -b`.
3
+ description: Start work on a GitHub issue — thin caller of `cckit start <N>`. Creates an isolated, bootstrapped worktree + `<kind>/<N>-<slug>` branch from the base branch and marks the issue In Progress on the board (if enabled). Worktree-first — there is no in-place mode.
4
+ when_to_use: When beginning work on a tracked issue. Always run before editing files. Replaces ad-hoc `git checkout -b` and hand-rolled `git worktree add`.
5
5
  ---
6
6
 
7
7
  # kit-task-start
8
8
 
9
- Plugin-direct skill — runs straight from `${CLAUDE_PLUGIN_ROOT}` (no per-project `scripts/`
10
- checkout needed). Helpers are sourced from the plugin; repo state (`gh`, `git`, the board) is
11
- the project you're standing in. Reads `.claude/kit.config.json` from the working directory.
9
+ Thin caller over the ONE canonical start mechanic: the `cckit start` verb → `wt_start`
10
+ (`${CLAUDE_PLUGIN_ROOT}/scripts/lib/worktree-start.sh`). The verb logic lives there, never inline
11
+ here (kit-engine-boundary #1/#2 — same single-implementation principle as the PR title composer,
12
+ #121). The verb owns ALL of the mechanics:
13
+
14
+ - fresh fetch of the base branch (`KIT_BASE_BRANCH`, default `main`) + branch `<kind>/<N>-<slug>`
15
+ (kind derived from the issue's `kind:` label)
16
+ - the isolated worktree at `.claude/worktrees/<kind>+<N>-<slug>` (reused if it already exists;
17
+ the dir name encodes issue #N so `kit-gc` won't wipe it while the issue is open)
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)
20
+ - the **claim precheck** (#124): warns when the issue is already In Progress on the board —
21
+ another session may own it
22
+ - the live-session **collision guard**: never disturbs a worktree a live session is sitting in
23
+ - the board update: issue → In Progress (when Projects v2 is enabled)
12
24
 
13
25
  ## Inputs
14
26
 
15
- | Field | Required | Notes |
16
- | ------------ | -------- | ----------------------------------------------------------- |
17
- | Issue number | ✓ | `123` |
18
- | Slug | optional | Short kebab suffix; defaults to a slug of the issue title |
19
- | `--worktree` | optional | Isolated worktree instead of switching the main tree. **Required for parallel / sub-agent work.** Dir `<kind>+<N>-<slug>` encodes issue **#N**, so `kit-gc` won't wipe it while the issue is open. |
27
+ | Field | Required | Notes |
28
+ | ------------ | -------- | --------------------------------------------------------- |
29
+ | Issue number | ✓ | `123` |
30
+ | Slug | optional | Short kebab suffix; defaults to a slug of the issue title |
20
31
 
21
- Read the issue to derive the **kind** label — the branch prefix matches it.
32
+ **Worktree-first, always.** Every start gets its own isolated worktree — one branch per worktree,
33
+ never a shared checkout. This is what makes parallel / sub-agent work safe and keeps a read-only
34
+ base checkout untouched.
22
35
 
23
36
  ## Execution
24
37
 
25
38
  ```bash
26
- source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/kit-config.sh" && load_kit_config
27
- [[ "$KIT_PROJECTS_V2" == "true" ]] && { source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/gh-project.sh"; load_project_ids; }
28
- BASE="${KIT_BASE_BRANCH:-main}" # branch off the integration branch (override per project)
29
-
30
- NUM=""; SLUG_OVERRIDE=""; WORKTREE=0
31
- for a in "$@"; do
32
- case "$a" in
33
- --worktree) WORKTREE=1 ;;
34
- *) [[ -z "$NUM" ]] && NUM="$a" || SLUG_OVERRIDE="$a" ;;
35
- esac
36
- done
37
- META=$(gh issue view "$NUM" --repo "$KIT_REPO" --json title,labels,projectItems)
38
- TITLE=$(echo "$META" | jq -r .title)
39
- KIND=$(echo "$META" | jq -r '.labels[].name' | grep '^kind:' | head -1 | cut -d: -f2)
40
- [[ -z "$KIND" ]] && KIND="task"
39
+ cckit start <N> # or: cckit start <N> <slug-override>
40
+ # cckit not on PATH? "${CLAUDE_PLUGIN_ROOT}/bin/cckit" start <N>
41
+ ```
41
42
 
42
- if [[ -n "$SLUG_OVERRIDE" ]]; then SLUG="$SLUG_OVERRIDE"; else
43
- SLUG=$(echo "$TITLE" | sed -E 's/^\[[^]]+\][[:space:]]*//' \
44
- | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g; s/^-|-$//g' | cut -c1-40)
45
- fi
46
- BRANCH="$KIND/$NUM-$SLUG"
43
+ The last stdout line is machine-readable — `<worktree-path>|<branch>|<issue-number>` — then work
44
+ continues **inside the worktree**:
47
45
 
48
- git fetch origin "$BASE" --quiet
49
- if [[ "$WORKTREE" -eq 1 ]]; then
50
- # Worktree dir encodes the issue: <kind>+<N>-<slug> -> kit-gc protects it while #N is open.
51
- WT_DIR=".claude/worktrees/${KIND}+${NUM}-${SLUG}"
52
- if git worktree list --porcelain | grep -q "/${KIND}+${NUM}-${SLUG}$"; then
53
- echo "✓ Worktree already exists: $WT_DIR (branch $BRANCH)"
54
- else
55
- git worktree add -B "$BRANCH" "$WT_DIR" "origin/$BASE"
56
- fi
57
- echo "→ cd $WT_DIR # work happens here; one branch per worktree"
58
- else
59
- [[ -n "$(git status --porcelain)" ]] && { echo "✗ Working tree not clean — or use --worktree."; exit 1; }
60
- git checkout -B "$BRANCH" "origin/$BASE"
61
- fi
46
+ ```bash
47
+ cd <worktree-path> # one branch per worktree; never edit the main checkout
48
+ ```
62
49
 
63
- if [[ "$KIT_PROJECTS_V2" == "true" ]]; then
64
- ITEM_ID=$(echo "$META" | jq -r --arg t "$KIT_PROJECT_TITLE" '.projectItems[]? | select(.title==$t) | .id')
65
- [[ -n "$ITEM_ID" ]] && project_set_single_select "$ITEM_ID" "$STATUS_FIELD_ID" "$STATUS_OPT_IN_PROGRESS"
66
- fi
50
+ ## Output
67
51
 
68
- echo "✓ Branch $BRANCH (from $BASE) — issue #$NUM In Progress"
69
- ```
52
+ - Worktree path + `<kind>/<N>-<slug>` branch (from the base branch) — work happens in the worktree
53
+ - Issue #N In Progress on the board (when Projects v2 is on)
70
54
 
71
55
  ## Rules
72
56
 
73
- - Never start from a non-base branch (trunk-based) · never start with a dirty tree (in-place mode) — or use `--worktree`
74
- - **Parallel / sub-agent work MUST use `--worktree`** — one branch per worktree, never share a checkout. The worktree↔issue association keeps `kit-gc` from wiping in-progress work.
75
- - If the issue has no `role:` label, fail loudly and ask for triage
76
- - Never skip the board status update when Projects v2 is enabled
57
+ - **Engine boundary** — the start mechanic lives in `wt_start`; this skill only runs the verb.
58
+ Never re-implement `git worktree add` / `git checkout -B` / bootstrap / board steps here.
59
+ - Worktree-first: parallel / sub-agent work MUST each get their own worktree via the verb —
60
+ never share a checkout, never fall back to an in-place branch switch.
61
+ - Never start from a non-base branch (trunk-based) — the verb always branches from a fresh
62
+ `origin/<base>`.
63
+ - If the issue has no `role:` label, fail loudly and ask for triage before starting.
64
+ - Heed the claim-precheck warning: if the verb reports the issue is already In Progress, confirm
65
+ no other session owns it before continuing.
@@ -71,7 +71,7 @@ Every issue lands on `main` through a Pull Request. No direct commits to `main`.
71
71
  | Step | Skill | What it does |
72
72
  | ----------------- | ------------------ | ------------------------------------------------------- |
73
73
  | 1. Pick an issue | `/kit-task-sync` | See the open board, choose what's unblocked |
74
- | 2. Start work | `/kit-task-start <N>` | Branch `<kind>/<N>-<slug>` from main + mark In Progress |
74
+ | 2. Start work | `/kit-task-start <N>` | Isolated worktree + branch `<kind>/<N>-<slug>` from the base + mark In Progress |
75
75
  | 3. Do the work | — | Code, write plans, etc. |
76
76
  | 4. Open PR | `/kit-task-pr <N>` | Commit + push + open PR with template/labels/milestone |
77
77
  | 5. Review + merge | `/kit-task-pr-merge` | Squash-merge PR, switch to main, pull |
@@ -5,7 +5,7 @@ description: Autonomous GitHub coding agent. Triggered in CI when a maintainer l
5
5
  when_to_use: Not summoned interactively — runs in CI (a GitHub Actions workflow) on `issues: labeled` with `agent:auto`. Documented here so the workflow prompt and humans share one source of truth for its charter.
6
6
  tools: [Bash, Read, Edit, Write, Glob, Grep]
7
7
  skills:
8
- - kit-task-start # Branch <kind>/<N>-<slug> from the integration branch
8
+ - kit-task-start # Isolated worktree + branch <kind>/<N>-<slug> from the integration branch (via `cckit start`)
9
9
  - kit-task-pr # Commit + push + open PR with labels/milestone
10
10
  - agent-skills:github-navigator # gh CLI operations
11
11
  ---
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bash
2
+ # kit-mail-check.sh — session-mail delivery hook (#175). Scaffolded by claude-kit.
3
+ # One event-aware script wired to FOUR hook events; it reads the event from the hook's stdin JSON:
4
+ # PostToolUse → unread mail injected between a working session's tool calls (the steer)
5
+ # UserPromptSubmit → delivery on the next human prompt
6
+ # SessionStart → cold-start delivery
7
+ # Stop → blocks the stop ONLY for unread `--steer` mail (redirects a finishing
8
+ # session); mail is consumed on delivery so it can never block twice
9
+ # Silent (no output) when there is no mail — zero noise on the hot path.
10
+ # Send with: cckit msg send <branch|project:branch|all> [--steer] "<text>"
11
+ set -u
12
+ input="$(cat 2>/dev/null || true)"
13
+ event="$(printf '%s' "$input" | jq -r '.hook_event_name // empty' 2>/dev/null || true)"
14
+ [ -n "$event" ] || event="${1:-UserPromptSubmit}"
15
+ # Run from the project the hook fired in (hooks provide cwd; fall back to where we are).
16
+ cwd="$(printf '%s' "$input" | jq -r '.cwd // empty' 2>/dev/null || true)"
17
+ [ -n "$cwd" ] && cd "$cwd" 2>/dev/null
18
+ # Prefer the project's own bin/cckit (version-matched to this checkout — the dogfood case) over
19
+ # the PATH install: a stale PATH cckit without the msg verb would silently no-op delivery (#179).
20
+ kit="cckit"
21
+ [ -x "./bin/cckit" ] && kit="./bin/cckit"
22
+ command -v "$kit" >/dev/null 2>&1 || exit 0
23
+ "$kit" msg hook-check "$event" 2>/dev/null || true
24
+ exit 0
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # claude-kit terminal identity — the seed-head sigil, brand palette, glyph vocabulary.
3
- # Canonical brief: claude-kit terminal identity (kit docs; see cckit.vercel.app:
3
+ # Canonical brief: claude-kit terminal identity (kit docs; see cckit.dev:
4
4
  # apps/admin/src/plans/terminal-identity brief) #
5
5
  # The line-leader is the LOCKED seed-head: ⡶ (U+2876) in Azafrán — the n=13 Vogel
6
6
  # seed-head reduced to one Braille cell. One Azafrán per line: the seed only;
@@ -117,6 +117,23 @@ The parent carries the rich narrative; the **PR** carries the human-facing revie
117
117
  Board + record state are correct **by construction** — the close op owns them. Never rely on a
118
118
  separate, skippable "mark done" step.
119
119
 
120
+ ## Wave close — the final sub of every effort
121
+
122
+ When efforts are planned as an **arc** (a chain of `blocked_by` efforts toward one outcome), the
123
+ downstream efforts start as **thin placeholders** — a parent with a Goal + a one-line scope, *not*
124
+ yet decomposed. Every effort's **last sub-issue is a wave-close task** that keeps the arc moving:
125
+
126
+ 1. **Fill the next effort's sub-issues** — decompose the next placeholder into its real deliverables
127
+ on the now-clean base, so each plan is scoped **just-in-time** with an accurate `## For agents`
128
+ retrieval context, never guessed up front. (Speculative sub-issues rot; stale sub-issues hide
129
+ unfinished work.)
130
+ 2. **Compact the wave** — write a compact summary of what shipped (to the knowledge base + a memory
131
+ drawer) and run `/compact`, so the next wave starts on clean context.
132
+
133
+ This makes the arc **self-propelling**: finishing wave N produces wave N+1's issues. The final effort
134
+ in an arc has nothing to fill next — its wave-close task is compact-and-close only. A single,
135
+ standalone effort needs no wave-close sub.
136
+
120
137
  ## Slug handles (number stays canonical)
121
138
 
122
139
  The issue **number** is the single source of truth — sub-issue links, PRs, labels, and `blocked_by`
@@ -27,7 +27,7 @@ The role determines which agent owns the work. Spawn that agent for the actual e
27
27
  ## The loop
28
28
 
29
29
  1. `/kit-task-sync` — see the board, pick an unblocked issue
30
- 2. `/kit-task-start <N>` — branch from main, mark In Progress
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
33
  5. `/kit-task-pr-merge` — squash-merge, back to main