@jeiemgi/cckit 0.1.8 → 0.3.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 (68) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/AGENTS.md +21 -8
  3. package/README.md +63 -5
  4. package/bin/cckit +77 -12
  5. package/cckit.config.json +1 -1
  6. package/commands/kit-doctor.md +3 -1
  7. package/kit.config.schema.json +24 -0
  8. package/package.json +1 -1
  9. package/scripts/annotate-setup.sh +7 -2
  10. package/scripts/capture-project-ids.sh +23 -10
  11. package/scripts/copilot-loop-test.sh +162 -0
  12. package/scripts/init.sh +22 -4
  13. package/scripts/kit-doctor.sh +185 -7
  14. package/scripts/kit-version-check-test.sh +36 -0
  15. package/scripts/kit-version-check.sh +19 -4
  16. package/scripts/knowledge-lint.sh +4 -1
  17. package/scripts/lib/board-view-test.sh +54 -0
  18. package/scripts/lib/board-view.sh +80 -0
  19. package/scripts/lib/captain-test.sh +76 -0
  20. package/scripts/lib/captain.sh +268 -0
  21. package/scripts/lib/config-path-test.sh +47 -0
  22. package/scripts/lib/config-path.sh +29 -0
  23. package/scripts/lib/copilot-test.sh +30 -0
  24. package/scripts/lib/copilot.sh +101 -0
  25. package/scripts/lib/effort-metrics-test.sh +57 -0
  26. package/scripts/lib/effort-metrics.sh +19 -5
  27. package/scripts/lib/effort-ops-test.sh +51 -2
  28. package/scripts/lib/effort-ops.sh +314 -49
  29. package/scripts/lib/effort-parity-test.sh +128 -0
  30. package/scripts/lib/effort-slug-test.sh +87 -0
  31. package/scripts/lib/effort-slug.sh +104 -0
  32. package/scripts/lib/effort.sh +34 -0
  33. package/scripts/lib/gh-project-test.sh +95 -0
  34. package/scripts/lib/gh-project.sh +22 -7
  35. package/scripts/lib/git-remote-test.sh +57 -0
  36. package/scripts/lib/git-remote.sh +21 -0
  37. package/scripts/lib/kit-config-test.sh +37 -0
  38. package/scripts/lib/kit-config.sh +33 -13
  39. package/scripts/lib/kit-events.sh +5 -3
  40. package/scripts/lib/kit-gc-test.sh +88 -0
  41. package/scripts/lib/kit-gc.sh +136 -19
  42. package/scripts/lib/kit-local.sh +8 -1
  43. package/scripts/lib/next.sh +75 -0
  44. package/scripts/lib/plan-machine-test.sh +72 -0
  45. package/scripts/lib/plan-machine.sh +260 -0
  46. package/scripts/lib/plan-next-test.sh +87 -0
  47. package/scripts/lib/plan-next.sh +212 -0
  48. package/scripts/lib/project-scan.sh +7 -1
  49. package/scripts/lib/render-test.sh +40 -0
  50. package/scripts/lib/render.sh +57 -0
  51. package/scripts/lib/worktree-start.sh +12 -3
  52. package/scripts/lib/zsh-safety-test.sh +73 -0
  53. package/scripts/portable-test.sh +62 -20
  54. package/scripts/setup-labels.sh +13 -2
  55. package/scripts/showcase.sh +13 -4
  56. package/scripts/status-test.sh +63 -0
  57. package/scripts/status.sh +12 -4
  58. package/scripts/task-sync.sh +79 -10
  59. package/skills/kit-autopilot/SKILL.md +5 -0
  60. package/skills/kit-docs-writer/SKILL.md +135 -0
  61. package/skills/kit-effort-new/SKILL.md +39 -111
  62. package/skills/kit-effort-pr/SKILL.md +6 -2
  63. package/skills/kit-next/SKILL.md +58 -0
  64. package/skills/kit-plan-next/SKILL.md +82 -0
  65. package/templates/hooks/mempal_session_start.sh.tmpl +36 -2
  66. package/templates/rules/effort-model.md +26 -6
  67. package/templates/rules/mempalace.md +1 -0
  68. package/templates/rules/plan-next.md +58 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cckit",
3
- "version": "0.1.8",
3
+ "version": "0.3.0",
4
4
  "installationPreference": "beta",
5
5
  "description": "cckit — a project operating system for coding agents. The full GitHub work lifecycle (start/pr/close/sync, efforts, worktrees, orchestrate, gc) as agents + skills + rules, drivable by Claude Code and any other agent. Driven from cckit.config.json; no org or repo hardcoded.",
6
6
  "author": {
package/AGENTS.md CHANGED
@@ -8,11 +8,12 @@ adapter one) — is described in [the Adapters page](docs-site/src/content/docs/
8
8
 
9
9
  ## Ground rules
10
10
 
11
- - **Read state before acting.** `cckit sync --llm` returns the board as JSON. Decide from data.
11
+ - **Read state before acting.** `cckit sync --llm` returns the board as TOON. Decide from data.
12
12
  - **One issue = one branch = one worktree = one PR.** `cckit start <issue>` creates the isolated
13
13
  worktree; do all work there; `cckit pr <issue>` opens the PR. Never commit to the base branch.
14
- - **Structured output.** Append `--llm` to any verb for machine-readable (JSON) output. Human
15
- (pretty) output is the default; agents should prefer `--llm`.
14
+ - **Structured output, TOON-first.** Append `--llm` to any verb for machine-readable output. List
15
+ reads (sync, next, plan, wave) come back as **TOON** (token-cheap); single-result action verbs
16
+ (start, pr, close) return one JSON object. Human (pretty) output is the default; agents prefer `--llm`.
16
17
  - **Idempotent + safe.** Re-running a verb on an already-done step is a no-op, not an error.
17
18
  - **Never invent paths or config.** Everything resolves from `cckit.config.json`.
18
19
  - **Hand off when you stop with unfinished work.** `cckit handoff "<what's pending, next step, refs>"`
@@ -24,20 +25,32 @@ adapter one) — is described in [the Adapters page](docs-site/src/content/docs/
24
25
  | Verb | Purpose | LLM mode |
25
26
  | --- | --- | --- |
26
27
  | `cckit init` | scaffold config + `.claude/` | — |
27
- | `cckit sync` | board state / what's unblocked | `--llm` → JSON |
28
+ | `cckit sync` | board state / what's unblocked | `--llm` → TOON |
29
+ | `cckit next` | the next unblocked issue + how to start it | `--llm` → TOON |
30
+ | `cckit plan` | wave plan: deps-ordered, file-disjoint, session-fit | `--llm` → TOON |
31
+ | `cckit plan-next` | forward plan: inventory current skills/verbs/rules/docs → propose what to build next | `--llm` → TOON |
32
+ | `cckit wave` | read open efforts, propose incoming waves: fan-out brief + captain drive | `--llm` → TOON |
33
+ | `cckit watch [--merge] [--loop]` | captain: gate open PRs, squash-merge CLEAN, advance the wave | — |
28
34
  | `cckit start <issue> [slug]` | isolated worktree + branch | `--llm` |
29
35
  | `cckit pr <issue> <summary>` | commit + push + open PR | `--llm` |
30
36
  | `cckit close <issue> <summary>` | close issue + mark done | `--llm` |
31
- | `cckit effort plan` | session-fit work plan | `--llm` → JSON |
37
+ | `cckit effort new "<name>" ["sub :: desc" …]` | parent (4-section body + ctx/kind/priority/role/flow labels) + linted native sub-issues — identical to `/kit-effort-new` (one shared core); `start`/`pr`/`close` take `<slug\|N>` | flags: `--flow/--role/--priority/--goal/--scope/--for-agents/--verification/--depends-on/--milestone`, `--slug` |
38
+ | `cckit effort plan` | session-fit effort plan | `--llm` → JSON |
32
39
  | `cckit orchestrate <a> <b> …` | run N flows in parallel worktrees | — (use `--dry-run`) |
33
40
  | `cckit autopilot [<a> …]` | unattended multi-flow: drive (or auto-pick) issues under a cap | — (use `--dry-run`) |
34
41
  | `cckit gc` | report prunable branches + worktrees | `--llm` → JSON counts |
42
+ | `cckit render` | stdin markdown → rich (glow on a TTY; verbatim when piped) | — |
35
43
  | `cckit version` | the installed cckit version | `--llm` |
36
44
 
37
45
  Every verb accepts a global `--llm` (alias `--output=json`); verbs that produce a result emit a
38
46
  single JSON object/array on stdout, with human text on stderr. Interactive/launch verbs
39
47
  (`init`, `orchestrate`, `autopilot`) have no JSON result — use `--dry-run` to inspect their plan.
40
48
 
49
+ > **`cckit plan-next` is the one exception to "feed verb output back to the model."** Its forward
50
+ > plan is for the human/orchestrator's decision only — never inject it into a monitored model's
51
+ > prompt or context (context-anxiety rule). Run it, decide, and hand only the chosen, scoped effort
52
+ > to an agent. `cckit plan` / `cckit next` (ordering existing work) remain safe to reason over.
53
+
41
54
  ### Lifecycle ops (so autopilot runs unattended)
42
55
 
43
56
  Every operation an unattended run needs is reachable through the one CLI:
@@ -45,7 +58,7 @@ Every operation an unattended run needs is reachable through the one CLI:
45
58
  | Verb | Purpose |
46
59
  | --- | --- |
47
60
  | `cckit scan` | detect the repo's stack + kit state (emits JSON) |
48
- | `cckit doctor` | onboarding preflight (deps, gh auth) |
61
+ | `cckit doctor [--fix]` | onboarding preflight (deps, gh auth); asks before installing on a TTY, `--fix` skips the prompt |
49
62
  | `cckit update` | report whether the project is behind the installed cckit |
50
63
  | `cckit migrate` | reshuffle an old kit layout to the current one |
51
64
  | `cckit digest` | summarize recent activity |
@@ -84,8 +97,8 @@ operate the repo through cckit. It is self-contained.
84
97
  You operate this repository through cckit, a CLI that runs the full GitHub work lifecycle.
85
98
 
86
99
  Operating rules:
87
- 1. Read state before acting. Run `cckit sync --llm` and decide from the JSON it returns. Never
88
- guess the board.
100
+ 1. Read state before acting. Run `cckit sync --llm` and decide from the TOON board it returns
101
+ (TOON is a compact table format — parse it, don't guess the board).
89
102
  2. One issue = one branch = one worktree = one PR. Begin every task with `cckit start <issue>`,
90
103
  then cd into the worktree path it prints. Never commit on main or develop.
91
104
  3. Append `--llm` to any verb for machine-readable JSON output.
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![Docs](https://img.shields.io/badge/docs-cckit.vercel.app-0A7E8C.svg)](https://cckit.vercel.app)
12
12
  [![Platforms: macOS · Linux · WSL](https://img.shields.io/badge/platforms-macOS%20%C2%B7%20Linux%20%C2%B7%20WSL-555.svg)](#platforms--requirements)
13
13
 
14
- **[📖 Documentation](https://cckit.vercel.app)** · [Quick start](#quick-start) · [Contributing](CONTRIBUTING.md) · [Code of Conduct](CODE_OF_CONDUCT.md)
14
+ **[📖 Documentation](https://cckit.vercel.app)** · [Tutorials](https://cckit.vercel.app/tutorials/) · [Quick start](#quick-start) · [Contributing](CONTRIBUTING.md) · [Code of Conduct](CODE_OF_CONDUCT.md)
15
15
 
16
16
  cckit turns a Git repository into a structured, agent-operable workspace. It ships the entire
17
17
  GitHub lifecycle — issues, branches, isolated worktrees, PRs, the merge flow, garbage collection,
@@ -71,6 +71,8 @@ Requirements: `bash` 4+, `git`, and `gh` (GitHub CLI) authenticated. `jq` recomm
71
71
 
72
72
  ```bash
73
73
  cckit init # scaffold cckit.config.json + .claude/ for this repo
74
+ cckit plan-next # propose what to build next, grounded in current capabilities
75
+ cckit next # the next unblocked issue + how to start it
74
76
  cckit start 42 # isolated worktree + branch for issue #42
75
77
  cckit pr 42 "what changed" # commit, push, open the PR
76
78
  cckit sync # board state, what's unblocked
@@ -79,19 +81,57 @@ cckit gc # prune merged branches + worktrees
79
81
 
80
82
  Run `cckit help` for the full verb list, or `cckit <verb> --help` for any one.
81
83
 
84
+ ## Efforts and slug handles
85
+
86
+ A big piece of work is an **effort** — a parent issue with sub-issues. `cckit effort new "<name>" "sub :: desc" …`
87
+ creates the parent issue (the four-section plan body), applies the `ctx/kind/priority/role/flow` labels, and lints
88
+ every sub-issue title — the same effort `/kit-effort-new` produces, since both call one shared core.
89
+
90
+ The GitHub issue **number** stays the canonical key, but every effort also has a memorable **slug** handle (the one
91
+ already in its `effort/<N>-<slug>` branch). Effort commands take the slug *or* the number interchangeably:
92
+
93
+ ```bash
94
+ cckit effort new "Slug handles for efforts" --slug slug-handles # optional explicit handle
95
+ cckit effort start slug-handles # same as: cckit effort start 93
96
+ cckit effort pr slug-handles
97
+ cckit effort close slug-handles
98
+ ```
99
+
100
+ A pure-digits argument is always a number; anything else is resolved to the canonical number by
101
+ matching `effort/*` branches, the `slug:<slug>` label, then open effort titles. An unknown or
102
+ ambiguous slug fails with a clear error rather than guessing. Efforts render as `slug #N`.
103
+
104
+ ## Wave
105
+
106
+ `cckit wave` reads your open efforts and proposes the incoming waves of work — parallel agent tasks
107
+ that gate and merge themselves:
108
+
109
+ ```bash
110
+ cckit plan # the wave plan: deps-ordered, file-disjoint, session-fit
111
+ cckit wave # a Task-subagent fan-out brief Claude Code enacts (proposes the next wave)
112
+ cckit watch --merge # the captain: gate open PRs, squash-merge the CLEAN ones, advance
113
+ # (policy floors hold PRs touching CI, lockfiles, or secrets for review)
114
+ cckit watch --loop # self-pace gate/merge passes until steady state
115
+ ```
116
+
82
117
  ## Driven by agents
83
118
 
84
119
  cckit is meant to be operated by an agent loop, not only a human. See [`AGENTS.md`](AGENTS.md) for
85
- the contract. Every verb accepts `--llm` for structured, parseable output:
120
+ the contract. Every verb accepts `--llm` for structured output — uniform payloads come back as
121
+ **TOON** (token-efficient), so the plan, board, and fan-out cost the model far fewer tokens:
86
122
 
87
123
  ```bash
88
- cckit sync --llm # JSON board state for an agent to reason over
89
- cckit effort plan --llm # the session-fit work plan as data
124
+ cckit sync --llm # board state for an agent to reason over
125
+ cckit plan --llm # the wave plan as TOON rows
126
+ cckit wave --llm # the fan-out (one subagent prompt per issue) as TOON
90
127
  ```
91
128
 
129
+ Human output renders as markdown — rich via `glow` in a terminal, native in the Claude Code
130
+ transcript, pipe-safe everywhere (`cckit render` exposes the seam for any script).
131
+
92
132
  ## Documentation
93
133
 
94
- Full docs, the [cookbook](https://cckit.vercel.app/cookbook/) of lifecycle recipes, and the [CLI reference](https://cckit.vercel.app/cli-reference/) live at **[cckit.vercel.app](https://cckit.vercel.app)**.
134
+ Full docs, the [tutorials](https://cckit.vercel.app/tutorials/) (step-by-step "How to X with Claude Code" guides), the [cookbook](https://cckit.vercel.app/cookbook/) of lifecycle recipes, and the [CLI reference](https://cckit.vercel.app/cli-reference/) live at **[cckit.vercel.app](https://cckit.vercel.app)**.
95
135
 
96
136
  ## Project layout
97
137
 
@@ -139,3 +179,21 @@ Licensed under either of
139
179
  at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for
140
180
  inclusion in cckit by you, as defined in the Apache-2.0 license, shall be dual licensed as above,
141
181
  without any additional terms or conditions.
182
+
183
+ ## Disclaimer & trademarks
184
+
185
+ cckit is an **independent, community-built project for educational purposes**. It is **not an
186
+ official Anthropic product** and is **not affiliated with, endorsed, sponsored, or supported by
187
+ Anthropic PBC** in any way.
188
+
189
+ "Anthropic", "Claude", and "Claude Code", along with related names, logos, and marks, are
190
+ trademarks of **Anthropic PBC**. All rights to Anthropic's products, services, names, and
191
+ intellectual property belong to Anthropic. cckit uses these names only **nominatively** — to
192
+ describe interoperability with Claude Code — and claims no ownership of or rights to them.
193
+
194
+ cckit is provided **"as is", without warranty of any kind**, for learning and experimentation.
195
+ Nothing here is legal advice. You are responsible for your own use of cckit and for complying with
196
+ the terms of any third-party service it integrates with, including
197
+ [Anthropic's Usage Policies and Terms](https://www.anthropic.com/legal). The cckit source code
198
+ itself is licensed as stated above; this disclaimer does not extend cckit's license to any
199
+ third-party trademark or product.
package/bin/cckit CHANGED
@@ -13,14 +13,23 @@
13
13
  # cckit close <issue> <summary> close issue + mark done
14
14
  # cckit contribute "<summary>" open a contribution PR to cckit, gated on scripts/check.sh
15
15
  # cckit sync [--llm] board state / what's unblocked
16
+ # cckit plan [--llm] [--effort N] wave plan: deps-ordered, file-disjoint, session-fit (TOON --llm)
17
+ # cckit plan-next [--llm] forward plan: current skills/verbs/rules/docs -> what to build next
16
18
  # cckit effort <new|start|pr|close|plan> the effort lifecycle
19
+ # effort new [--flow F --role R --priority p1 --goal G --scope S --for-agents A
20
+ # --verification V --depends-on "#1,#2" --milestone M] "<name>" ["sub :: desc" …]
21
+ # parent (4-section body + ctx/kind/priority/role/flow labels) + linted native sub-issues
17
22
  # cckit orchestrate <a> <b> … run N flows in parallel worktrees (--dry-run/--cap/--agent)
18
23
  # cckit autopilot [<a> …] unattended multi-flow: drive (or auto-pick) issues under a cap
24
+ # cckit watch [--merge] [--loop] captain: gate open PRs, squash-merge CLEAN, advance the wave
25
+ # cckit next [--effort N] everyday helper: the unblocked set + how to start the top issue
26
+ # cckit wave [--effort N] read open efforts, propose incoming waves: fan-out + captain drive
19
27
  # cckit gc [--prune [--yes]] report (default) or prune merged branches + worktrees
20
28
  # cckit status thin dashboard: board + worktrees + resume handoff
21
29
  # cckit scan [--llm] detect this repo's stack + kit state (JSON)
22
30
  # cckit debug [--check] <args> optional browser-debug via chrome-devtools-axi (auto-detected)
23
31
  # cckit encode-context stdin JSON -> compact TOON (uniform arrays; JSON fallback)
32
+ # cckit render stdin markdown -> rich (glow on a TTY; verbatim when piped)
24
33
  # cckit doctor onboarding preflight (deps, gh auth)
25
34
  # cckit update check whether this project is behind the installed cckit
26
35
  # cckit migrate reshuffle an old kit layout to the current one
@@ -49,18 +58,12 @@ LIB="$ROOT/scripts/lib"
49
58
  # cckit.config.json, or .claude/kit.config.json), so board/lifecycle verbs act on the project you
50
59
  # ran cckit in — NOT cckit's own install dir. Running inside the cckit repo resolves to its own
51
60
  # cckit.config.json naturally (self-hosting); outside any project we fall back to cckit's config.
52
- # An explicit KIT_CONFIG in the environment always wins.
53
- _cckit_find_config() {
54
- local d="$1"
55
- while [ -n "$d" ] && [ "$d" != "/" ]; do
56
- [ -f "$d/cckit.config.json" ] && { printf '%s\n' "$d/cckit.config.json"; return 0; }
57
- [ -f "$d/.claude/kit.config.json" ] && { printf '%s\n' "$d/.claude/kit.config.json"; return 0; }
58
- d="$(dirname "$d")"
59
- done
60
- return 1
61
- }
61
+ # An explicit KIT_CONFIG in the environment always wins. The walk lives in the ONE shared resolver
62
+ # (config-path.sh, #69) that every kit entrypoint uses.
63
+ # shellcheck source=/dev/null
64
+ source "$LIB/config-path.sh"
62
65
  if [ -z "${KIT_CONFIG:-}" ]; then
63
- KIT_CONFIG="$(_cckit_find_config "$PWD" || true)"
66
+ KIT_CONFIG="$(kit_config_find "$PWD" || true)"
64
67
  [ -n "$KIT_CONFIG" ] || KIT_CONFIG="$ROOT/cckit.config.json"
65
68
  fi
66
69
  export KIT_CONFIG
@@ -103,9 +106,21 @@ case "$cmd" in
103
106
  source "$LIB/effort.sh"
104
107
  # shellcheck source=/dev/null
105
108
  source "$LIB/effort-ops.sh" # the new|start|pr|close lifecycle ops (compose effort.sh helpers)
109
+ # shellcheck source=/dev/null
110
+ source "$LIB/effort-metrics.sh" # effort_ctx_bucket — sizes the ctx:* label on `effort new`
106
111
  sub="${1:-}"; shift || true
107
112
  case "$sub" in
108
- new) effort_new "$@" ;;
113
+ new)
114
+ # Full parity with /kit-effort-new: load the board + role helpers so an effort created via
115
+ # the verb lands on the board exactly as the skill does. Board ops are guarded inside
116
+ # effort_new, so this is a safe no-op when Projects v2 is off or the IDs aren't captured.
117
+ if [ "${KIT_PROJECTS_V2:-}" = "true" ]; then
118
+ # shellcheck source=/dev/null
119
+ source "$LIB/gh-project.sh"; load_project_ids >/dev/null 2>&1 || true
120
+ # shellcheck source=/dev/null
121
+ source "$LIB/role-identity.sh" 2>/dev/null || true
122
+ fi
123
+ effort_new "$@" ;;
109
124
  start) effort_start "$@" ;;
110
125
  pr) effort_pr "$@" ;;
111
126
  close) effort_close "$@" ;;
@@ -149,6 +164,24 @@ case "$cmd" in
149
164
  esac
150
165
  ;;
151
166
  sync) exec "$ROOT/scripts/task-sync.sh" "$@" ;;
167
+ plan)
168
+ # Wave plan over the board (deps-ordered, file-disjoint, session-fit). Runs in the invoking
169
+ # project; needs config so KIT_REPO is set before plan-machine reads it.
170
+ # shellcheck source=/dev/null
171
+ source "$LIB/kit-config.sh" && load_kit_config
172
+ # shellcheck source=/dev/null
173
+ source "$LIB/plan-machine.sh"; plan_machine "$@"
174
+ ;;
175
+ plan-next)
176
+ # Forward planner: introspect the CURRENT capability surface (skills/verbs/rules/docs) and
177
+ # propose what to build next, grounded in what the kit can already do. Filesystem-only — config
178
+ # is loaded for the project-root inference (KIT_CONFIG), then plan-next scans that root. Output
179
+ # is HUMAN / orchestrator-facing only — never wired into a monitored model's context (#86).
180
+ # shellcheck source=/dev/null
181
+ source "$LIB/kit-config.sh" && load_kit_config 2>/dev/null || true
182
+ # shellcheck source=/dev/null
183
+ source "$LIB/plan-next.sh"; plan_next "$@"
184
+ ;;
152
185
  gc)
153
186
  # shellcheck source=/dev/null
154
187
  source "$LIB/kit-config.sh" && load_kit_config
@@ -174,6 +207,37 @@ case "$cmd" in
174
207
  ;;
175
208
  orchestrate) exec "$ROOT/scripts/orchestrate.sh" "$@" ;;
176
209
  autopilot) exec "$ROOT/scripts/autopilot.sh" "$@" ;;
210
+ next)
211
+ # Everyday-dev helper: surface the unblocked set + the one command to start the top issue.
212
+ # shellcheck source=/dev/null
213
+ source "$LIB/kit-config.sh" && load_kit_config
214
+ # shellcheck source=/dev/null
215
+ source "$LIB/next.sh"; next_issue "$@"
216
+ ;;
217
+ wave|copilot)
218
+ # Read the open efforts and propose the incoming waves of work: emit the wave-0 Task-subagent
219
+ # fan-out + the between-waves captain drive. (`copilot` is a hidden back-compat alias for `wave`.)
220
+ # Runs in the invoking project; needs config so KIT_REPO is set before it reads it.
221
+ # shellcheck source=/dev/null
222
+ source "$LIB/kit-config.sh" && load_kit_config
223
+ # shellcheck source=/dev/null
224
+ source "$LIB/copilot.sh"; copilot_brief "$@"
225
+ ;;
226
+ watch)
227
+ # Captain: gate open PRs, squash-merge the CLEAN ones, advance to the next wave. Runs in the
228
+ # invoking project; needs config so KIT_REPO is set before captain reads it.
229
+ # shellcheck source=/dev/null
230
+ source "$LIB/kit-config.sh" && load_kit_config
231
+ # shellcheck source=/dev/null
232
+ source "$LIB/captain.sh"
233
+ watch_loop=0; watch_args=()
234
+ for a in "$@"; do case "$a" in --loop) watch_loop=1 ;; *) watch_args+=("$a") ;; esac; done
235
+ if [ "$watch_loop" = "1" ]; then
236
+ captain_loop "${watch_args[@]+"${watch_args[@]}"}"
237
+ else
238
+ captain_pass "${watch_args[@]+"${watch_args[@]}"}"
239
+ fi
240
+ ;;
177
241
  # Ops exposed so an agent/autopilot can run the whole lifecycle through the one CLI (#16).
178
242
  release)
179
243
  # Acts on cckit's own repo, so run from the install root regardless of where it was invoked.
@@ -191,6 +255,7 @@ case "$cmd" in
191
255
  digest) exec "$ROOT/scripts/kit-digest.sh" "$@" ;;
192
256
  scan) source "$LIB/project-scan.sh"; project_scan "$@" ;;
193
257
  encode-context) source "$LIB/toon.sh"; toon_encode ;;
258
+ render) source "$LIB/render.sh"; cckit_render ;;
194
259
  debug) exec "$ROOT/scripts/debug.sh" "$@" ;;
195
260
  contribute) cd "$ROOT"; exec "$ROOT/scripts/contribute.sh" "$@" ;;
196
261
  status|ui) exec "$ROOT/scripts/status.sh" "$@" ;;
package/cckit.config.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "./kit.config.schema.json",
3
- "kitVersion": "0.1.8",
3
+ "kitVersion": "0.3.0",
4
4
  "project": {
5
5
  "name": "cckit",
6
6
  "slug": "cckit",
@@ -16,7 +16,9 @@ Run the kit-doctor script to check all dependencies and authentication required
16
16
  | Tier 1 | `git`, `gh` (≥2.29 for Projects v2), `jq`, `perl` — auto-installs via brew |
17
17
  | Tier 2 | `node`, `pnpm`, `vercel` (if .vercel/ exists), `turbo`/`playwright` (dev deps only) |
18
18
  | Local | Only when `.local.enabled` — installs `mlx-lm` via `uv tool install` (fallback `pipx`, never plain `pip`) + starts `mlx_lm.server` in background with a port health check (first run downloads ~4.5 GB) |
19
+ | Memory | Only when `.memory.enabled` — installs the [MemPalace](https://github.com/MemPalace/mempalace) CLI if missing (pipx, fallback uv), seeds the per-wing wake-up header (`.claude/mempal-identity.<wing>.txt`), and refreshes a stale session-start hook. Install + seed + refresh obey the consent guard: `--fix` applies them, `--dry-run`/`--no-install` only report |
19
20
  | Auth | `gh auth status`, scope `project`, `git config user.name/email` |
21
+ | Repo | `github.baseBranch` vs the repo's GitHub default branch — a mismatch means `Closes #N` won't auto-close issues on GitHub-UI merges (report-only; `cckit pr-merge` already closes them explicitly) |
20
22
  | SSH | Optional: detect existing key; `KIT_DOCTOR_SSH=1` triggers guided ed25519 setup |
21
23
 
22
24
  ## Flags
@@ -42,7 +44,7 @@ Run the kit-doctor script to check all dependencies and authentication required
42
44
 
43
45
  4. If all Tier 1 checks pass:
44
46
  - Report success
45
- - Remind the user the onboarding guide is at `http://localhost:3001/onboarding` (or `$CCKIT_ADMIN_URL/onboarding`)
47
+ - Point the user at the pointer the doctor prints on its last line: the local onboarding app at `$CCKIT_ADMIN_URL/onboarding` **only when it is actually reachable**, otherwise the public docs at `https://cckit.vercel.app`. Do not hardcode `localhost:3001` — nothing serves it by default.
46
48
 
47
49
  ## Rules
48
50
 
@@ -55,12 +55,36 @@
55
55
  "repo": { "type": "string" },
56
56
  "owner": { "type": "string" },
57
57
  "baseBranch": { "type": "string", "description": "Integration branch the lifecycle skills branch from and merge into (default: main; e.g. develop)." },
58
+ "integrationBranch": { "type": "string", "description": "Alias for baseBranch, honored when baseBranch is unset (adoption fallback)." },
59
+ "flow": { "type": "string", "description": "Last-resort alias for the integration branch, honored when baseBranch and integrationBranch are unset." },
58
60
  "projectsV2": { "type": "boolean" },
61
+ "projectOwnerType": { "type": "string", "enum": ["user", "organization"], "description": "Whether the Projects v2 board is owned by a user or an organization login (default: user). Selects the GraphQL root for board queries." },
59
62
  "projectNumber": { "type": ["integer", "null"] },
60
63
  "projectTitle": { "type": ["string", "null"] }
61
64
  }
62
65
  },
63
66
  "milestones": { "type": "array", "items": { "type": "string" } },
67
+ "effort": {
68
+ "type": "object",
69
+ "additionalProperties": true,
70
+ "properties": {
71
+ "knowledgeIngestHook": { "type": "string", "description": "Optional path to an executable run after `cckit effort close`, invoked as `<hook> <effort-number> <trace-dir>` to fold the closed effort's work record into a knowledge base. No-op when unset or not executable; the kit ships no default." }
72
+ }
73
+ },
74
+ "captain": {
75
+ "type": "object",
76
+ "additionalProperties": true,
77
+ "properties": {
78
+ "mergePolicy": {
79
+ "type": "object",
80
+ "additionalProperties": true,
81
+ "properties": {
82
+ "floors": { "type": "boolean", "description": "Auto-merge policy floors (default true). When on, `cckit watch --merge` never auto-merges a PR touching .github/workflows/**, lockfile/graph files, or security-sensitive paths, and always honors a `hold` label + draft state. Set false to disable (or KIT_CAPTAIN_FLOORS=0)." },
83
+ "protectedGlobs": { "type": "array", "items": { "type": "string" }, "description": "Extra path globs the captain must not auto-merge (added to the built-in floors). Also settable via KIT_CAPTAIN_EXTRA_GLOBS." }
84
+ }
85
+ }
86
+ }
87
+ },
64
88
  "plans": {
65
89
  "type": "object",
66
90
  "additionalProperties": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeiemgi/cckit",
3
- "version": "0.1.8",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "description": "cckit — a project operating system for coding agents (CLI + Claude Code plugin).",
@@ -39,14 +39,19 @@ if [[ "$REACT_DETECTED" != "true" ]]; then
39
39
  fi
40
40
 
41
41
  CFG="$TARGET/.claude/kit.config.json"
42
- WING=""; MEMORY_BOOL="false"; PROJECT_NAME="$(basename "$TARGET")"; HTTP_PORT=4747
42
+ # Repo name from the git remote is the identity fallback; the directory basename is the last resort (#73).
43
+ # shellcheck source=/dev/null
44
+ . "$KIT_ROOT/scripts/lib/git-remote.sh"
45
+ REMOTE_NAME="$(git_remote_repo_name "$TARGET" 2>/dev/null || true)"; REMOTE_NAME="${REMOTE_NAME:-$(basename "$TARGET")}"
46
+ WING=""; MEMORY_BOOL="false"; PROJECT_NAME="$REMOTE_NAME"; HTTP_PORT=4747
43
47
  if [[ -f "$CFG" ]]; then
44
48
  WING="$(jq -r '.memory.wing // .project.slug // ""' "$CFG" 2>/dev/null || echo "")"
45
49
  MEMORY_BOOL="$(jq -r '.memory.enabled // false' "$CFG" 2>/dev/null || echo false)"
46
50
  PROJECT_NAME="$(jq -r '.project.name // ""' "$CFG" 2>/dev/null || echo "$PROJECT_NAME")"
51
+ [[ -z "$PROJECT_NAME" || "$PROJECT_NAME" == "null" ]] && PROJECT_NAME="$REMOTE_NAME"
47
52
  HTTP_PORT="$(jq -r '.annotate.mcp.httpPort // 4747' "$CFG" 2>/dev/null || echo 4747)"
48
53
  fi
49
- [[ -z "$WING" || "$WING" == "null" ]] && WING="$(basename "$TARGET" | tr '[:upper:]' '[:lower:]')"
54
+ [[ -z "$WING" || "$WING" == "null" ]] && WING="$(printf '%s' "$REMOTE_NAME" | tr '[:upper:]' '[:lower:]')"
50
55
  [[ -z "$HTTP_PORT" || "$HTTP_PORT" == "null" ]] && HTTP_PORT=4747
51
56
 
52
57
  case "$REACT_PKG_MANAGER" in
@@ -1,7 +1,12 @@
1
1
  #!/usr/bin/env bash
2
2
  # Capture Projects v2 field + option IDs into scripts/.project-ids.env.
3
- # Reads owner + project number from .claude/kit.config.json. Run from project root.
3
+ # Reads owner + project number + owner type from the kit config. Run from project root.
4
4
  # Handles "Status", "Role", and "Plan Link" fields by name (case-insensitive).
5
+ #
6
+ # The board can live under a USER login or an ORGANIZATION login. GraphQL selects a different root
7
+ # for each (user(login:) vs organization(login:)), so this branches on github.projectOwnerType
8
+ # ("user" | "organization", default "user") — a user-only query silently returned null for an
9
+ # org-owned board (#118).
5
10
  set -euo pipefail
6
11
  source "$(dirname "$0")/lib/kit-config.sh" && load_kit_config
7
12
 
@@ -9,10 +14,18 @@ source "$(dirname "$0")/lib/kit-config.sh" && load_kit_config
9
14
 
10
15
  OUT="$(dirname "$0")/.project-ids.env"
11
16
 
12
- DATA=$(gh api graphql -f query='
13
- query($login:String!, $number:Int!){
14
- user(login:$login){
15
- projectV2(number:$number){
17
+ # Resolve the GraphQL root selector from the owner type (kit-config exports KIT_PROJECT_OWNER_TYPE).
18
+ case "${KIT_PROJECT_OWNER_TYPE:-user}" in
19
+ org|organization) OWNER_ROOT="organization" ;;
20
+ *) OWNER_ROOT="user" ;;
21
+ esac
22
+
23
+ # Build the query with the resolved root; the response is read under the SAME root below so the
24
+ # selector and the jq path stay in lockstep regardless of user- vs org-owned board.
25
+ DATA=$(gh api graphql -f query="
26
+ query(\$login:String!, \$number:Int!){
27
+ $OWNER_ROOT(login:\$login){
28
+ projectV2(number:\$number){
16
29
  id
17
30
  fields(first:50){ nodes{
18
31
  __typename
@@ -21,10 +34,10 @@ DATA=$(gh api graphql -f query='
21
34
  }}
22
35
  }
23
36
  }
24
- }' -f login="$KIT_OWNER" -F number="$KIT_PROJECT_NUMBER")
37
+ }" -f login="$KIT_OWNER" -F number="$KIT_PROJECT_NUMBER")
25
38
 
26
- PROJECT_ID=$(echo "$DATA" | jq -r '.data.user.projectV2.id')
27
- [[ -z "$PROJECT_ID" || "$PROJECT_ID" == "null" ]] && { echo "✗ Could not resolve project #$KIT_PROJECT_NUMBER for $KIT_OWNER"; exit 1; }
39
+ PROJECT_ID=$(echo "$DATA" | jq -r ".data.${OWNER_ROOT}.projectV2.id")
40
+ [[ -z "$PROJECT_ID" || "$PROJECT_ID" == "null" ]] && { echo "✗ Could not resolve project #$KIT_PROJECT_NUMBER for $OWNER_ROOT '$KIT_OWNER' (check github.projectOwnerType)"; exit 1; }
28
41
 
29
42
  # jq filter: normalize an option/field label -> UPPER_SNAKE
30
43
  norm='def n: ascii_upcase | gsub("[ -]";"_");'
@@ -35,7 +48,7 @@ norm='def n: ascii_upcase | gsub("[ -]";"_");'
35
48
 
36
49
  # Single-select fields -> <FIELD>_FIELD_ID + <FIELD>_OPT_<OPTION>
37
50
  echo "$DATA" | jq -r "$norm"'
38
- .data.user.projectV2.fields.nodes[]
51
+ .data.'"$OWNER_ROOT"'.projectV2.fields.nodes[]
39
52
  | select(.options != null)
40
53
  | (.name | n) as $f
41
54
  | ([ "\($f)_FIELD_ID=\(.id)" ]
@@ -43,7 +56,7 @@ norm='def n: ascii_upcase | gsub("[ -]";"_");'
43
56
 
44
57
  # Text/other fields -> <FIELD>_FIELD_ID
45
58
  echo "$DATA" | jq -r "$norm"'
46
- .data.user.projectV2.fields.nodes[]
59
+ .data.'"$OWNER_ROOT"'.projectV2.fields.nodes[]
47
60
  | select(.options == null) | select(.name != null)
48
61
  | "\(.name | n)_FIELD_ID=\(.id)"'
49
62
  } > "$OUT"