@jeiemgi/cckit 0.2.0 → 0.4.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.
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +21 -8
- package/README.md +119 -20
- package/bin/cckit +42 -16
- package/cckit.config.json +1 -1
- package/commands/kit-doctor.md +3 -1
- package/commands/kit-update.md +9 -4
- package/kit.config.schema.json +25 -0
- package/package.json +1 -1
- package/scripts/annotate-setup.sh +7 -2
- package/scripts/capture-project-ids.sh +23 -10
- package/scripts/init-upgrade-test.sh +35 -1
- package/scripts/init.sh +43 -7
- package/scripts/kit-doctor.sh +185 -7
- package/scripts/kit-version-check-test.sh +36 -0
- package/scripts/kit-version-check.sh +19 -4
- package/scripts/kit-wire.sh +4 -1
- package/scripts/knowledge-lint.sh +4 -1
- package/scripts/lib/board-view-test.sh +54 -0
- package/scripts/lib/board-view.sh +80 -0
- package/scripts/lib/captain-test.sh +18 -0
- package/scripts/lib/captain.sh +92 -5
- package/scripts/lib/config-path-test.sh +47 -0
- package/scripts/lib/config-path.sh +29 -0
- package/scripts/lib/copilot.sh +9 -9
- package/scripts/lib/effort-dispatch-test.sh +25 -0
- package/scripts/lib/effort-flows-test.sh +55 -0
- package/scripts/lib/effort-metrics-test.sh +57 -0
- package/scripts/lib/effort-metrics.sh +19 -5
- package/scripts/lib/effort-ops-test.sh +110 -3
- package/scripts/lib/effort-ops.sh +480 -50
- package/scripts/lib/effort-parity-test.sh +128 -0
- package/scripts/lib/effort-slug-test.sh +87 -0
- package/scripts/lib/effort-slug.sh +104 -0
- package/scripts/lib/effort.sh +91 -1
- package/scripts/lib/gh-project-test.sh +95 -0
- package/scripts/lib/gh-project.sh +22 -7
- package/scripts/lib/git-remote-test.sh +57 -0
- package/scripts/lib/git-remote.sh +21 -0
- package/scripts/lib/kit-config-test.sh +37 -0
- package/scripts/lib/kit-config.sh +38 -13
- package/scripts/lib/kit-engine-test.sh +9 -0
- package/scripts/lib/kit-events.sh +5 -3
- package/scripts/lib/kit-gc-test.sh +88 -0
- package/scripts/lib/kit-gc.sh +136 -19
- package/scripts/lib/kit-local.sh +8 -1
- package/scripts/lib/kit-operate.sh +17 -2
- package/scripts/lib/next.sh +3 -3
- package/scripts/lib/plan-next-test.sh +87 -0
- package/scripts/lib/plan-next.sh +212 -0
- package/scripts/lib/project-scan.sh +7 -1
- package/scripts/lib/worktree-start.sh +12 -3
- package/scripts/lib/zsh-safety-test.sh +73 -0
- package/scripts/portable-test.sh +62 -20
- package/scripts/setup-labels.sh +13 -2
- package/scripts/showcase.sh +13 -4
- package/scripts/status-test.sh +63 -0
- package/scripts/status.sh +12 -4
- package/scripts/task-sync.sh +79 -10
- package/skills/kit-autopilot/SKILL.md +5 -0
- package/skills/{docs-writer → kit-docs-writer}/SKILL.md +2 -2
- package/skills/kit-effort-close/SKILL.md +52 -104
- package/skills/kit-effort-new/SKILL.md +40 -112
- package/skills/kit-effort-pr/SKILL.md +6 -2
- package/skills/kit-effort-start/SKILL.md +44 -46
- package/skills/kit-next/SKILL.md +4 -0
- package/skills/kit-plan-next/SKILL.md +82 -0
- package/skills/kit-task-start/SKILL.md +44 -55
- package/templates/CLAUDE.md.tmpl +1 -1
- package/templates/agents/auto-dev.md +1 -1
- package/templates/hooks/mempal_session_start.sh.tmpl +36 -2
- package/templates/rules/effort-model.md +43 -6
- package/templates/rules/mempalace.md +1 -0
- package/templates/rules/plan-next.md +58 -0
- package/templates/rules/task-management.md +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cckit",
|
|
3
|
-
"version": "0.
|
|
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
|
|
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
|
|
15
|
-
(
|
|
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` →
|
|
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
|
|
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
|
|
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
|
@@ -1,30 +1,42 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src=".github/banner.png" alt="cckit —
|
|
2
|
+
<img src=".github/banner.png" alt="cckit — you're the architect, cckit runs the mechanics" width="100%">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# cckit
|
|
6
6
|
|
|
7
|
-
>
|
|
7
|
+
> **You're the architect. cckit runs the mechanics.** The full GitHub work lifecycle — issues,
|
|
8
|
+
> worktrees, PRs, merges, multi-agent waves — as one CLI, drivable by Claude Code and any agent.
|
|
8
9
|
|
|
9
10
|
[](#license)
|
|
10
11
|
[](https://docs.claude.com/claude-code)
|
|
11
12
|
[](https://cckit.vercel.app)
|
|
12
13
|
[](#platforms--requirements)
|
|
13
14
|
|
|
14
|
-
**[📖 Documentation](https://cckit.vercel.app)** · [Quick start](#quick-start) · [Contributing](CONTRIBUTING.md) · [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
15
|
+
**[📖 Documentation](https://cckit.vercel.app)** · [The idea](https://cckit.vercel.app/philosophy/) · [Tutorials](https://cckit.vercel.app/tutorials/) · [Quick start](#quick-start) · [Contributing](CONTRIBUTING.md) · [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
The whole idea in one line:
|
|
18
|
+
|
|
19
|
+
> **Turn your Git into retrievable, efficient context** — using issues, GitHub Projects, and other
|
|
20
|
+
> people's tools, wired together with a few advanced mechanics.
|
|
21
|
+
|
|
22
|
+
You bring the ideas and the shape of the thing. The mechanics that make it stand up — branches,
|
|
23
|
+
isolated worktrees, PRs, the merge flow, and the trail of issues that says *why* — are what cckit
|
|
24
|
+
takes care of. It ships all of that as a single bash CLI plus a Claude Code plugin (skills, rules,
|
|
25
|
+
agents), and it is **agent-agnostic by design**: Claude Code is first-class, but any agent that can
|
|
26
|
+
run a shell can drive every operation.
|
|
21
27
|
|
|
22
28
|
## Why
|
|
23
29
|
|
|
24
30
|
- **One lifecycle, one source of truth.** Start an issue, get an isolated worktree and branch, open
|
|
25
|
-
a PR, merge, and clean up — each step is one command, correct by construction.
|
|
31
|
+
a PR, merge, and clean up — each step is one command, correct by construction. The board is both
|
|
32
|
+
the plan and the proof.
|
|
33
|
+
- **Sessions that pick up where you left off.** `cckit handoff "<note>"` saves a resume-here note;
|
|
34
|
+
bare `cckit` prints it at the start of the next session — context survives the context window.
|
|
26
35
|
- **Agent-operable.** Every verb has a machine-readable mode (`cckit <verb> --llm`) and an
|
|
27
36
|
[`AGENTS.md`](AGENTS.md) contract, so agents drive the kit without scraping human output.
|
|
37
|
+
- **Scales from one issue to a wave.** The same verbs that take one issue to a merged PR also plan
|
|
38
|
+
and run a whole wave of parallel agents — with a captain that gates and merges behind policy
|
|
39
|
+
floors.
|
|
28
40
|
- **Zero hard dependencies.** Pure bash with graceful fallbacks; it auto-detects optional tools
|
|
29
41
|
(`gh`, `jq`, `fzf`, `gum`) and degrades instead of failing.
|
|
30
42
|
- **Portable.** No company, framework, or repo is baked in — everything is driven from
|
|
@@ -70,28 +82,95 @@ Requirements: `bash` 4+, `git`, and `gh` (GitHub CLI) authenticated. `jq` recomm
|
|
|
70
82
|
## Quick start
|
|
71
83
|
|
|
72
84
|
```bash
|
|
73
|
-
cckit
|
|
74
|
-
cckit
|
|
75
|
-
|
|
76
|
-
cckit
|
|
77
|
-
cckit
|
|
85
|
+
cckit doctor # onboarding preflight: deps, gh auth
|
|
86
|
+
cckit init --profile software # scaffold cckit.config.json + .claude/ for this repo
|
|
87
|
+
# profiles: software · content · research · automation · minimal
|
|
88
|
+
cckit plan-next # propose what to build next, grounded in current capabilities
|
|
89
|
+
cckit next # the next unblocked issue + how to start it
|
|
90
|
+
cckit start 42 # isolated worktree + branch for issue #42
|
|
91
|
+
cckit pr 42 "what changed" # commit, push, open the PR
|
|
92
|
+
cckit sync # board state, what's unblocked
|
|
93
|
+
cckit handoff "resume note" # save a handoff — bare `cckit` prints it next session
|
|
94
|
+
cckit gc # prune merged branches + worktrees
|
|
78
95
|
```
|
|
79
96
|
|
|
80
|
-
|
|
97
|
+
Adopting cckit in a repo that already has history? `cckit scan` detects the stack, `cckit adopt`
|
|
98
|
+
records kit-shaped files the repo already has, and `cckit status` is the thin dashboard — board,
|
|
99
|
+
worktrees, and the resume handoff in one screen. Run `cckit help` for the full verb list, or
|
|
100
|
+
`cckit <verb> --help` for any one.
|
|
101
|
+
|
|
102
|
+
## Efforts and slug handles
|
|
103
|
+
|
|
104
|
+
A big piece of work is an **effort** — a parent issue with sub-issues. `cckit effort new "<name>" "sub :: desc" …`
|
|
105
|
+
creates the parent issue (the four-section plan body), applies the `ctx/kind/priority/role/flow` labels, and lints
|
|
106
|
+
every sub-issue title — the same effort `/kit-effort-new` produces, since both call one shared core. The `--flow`
|
|
107
|
+
vocabulary (the `[Flow]` title tags) reads from `effort.flows` in the project config, so `cckit effort new --flow X`
|
|
108
|
+
works out of the box in any configured repo (an explicit `EFFORT_FLOWS` env var still wins per invocation).
|
|
109
|
+
`cckit effort close` is likewise the **single close implementation** (the `/kit-effort-close` skill is a thin caller
|
|
110
|
+
of the same function): pre-squash work-record snapshot + metrics, squash-merge, close parent + subs, board
|
|
111
|
+
Status=Done, worktree/branch GC, an optional knowledge-ingest hook, and an advisory kit-sync drift check.
|
|
112
|
+
|
|
113
|
+
The GitHub issue **number** stays the canonical key, but every effort also has a memorable **slug** handle (the one
|
|
114
|
+
already in its `effort/<N>-<slug>` branch). Effort commands take the slug *or* the number interchangeably:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
cckit effort new "Slug handles for efforts" --slug slug-handles # optional explicit handle
|
|
118
|
+
cckit effort start slug-handles # same as: cckit effort start 93
|
|
119
|
+
cckit effort pr slug-handles
|
|
120
|
+
cckit effort close slug-handles
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
A pure-digits argument is always a number; anything else is resolved to the canonical number by
|
|
124
|
+
matching `effort/*` branches, the `slug:<slug>` label, then open effort titles. An unknown or
|
|
125
|
+
ambiguous slug fails with a clear error rather than guessing. Efforts render as `slug #N`.
|
|
126
|
+
|
|
127
|
+
## Waves — parallel agentic development
|
|
128
|
+
|
|
129
|
+
`cckit wave` reads your open efforts and proposes the incoming waves of work — parallel agent tasks
|
|
130
|
+
that gate and merge themselves. This is the part that turns one keyboard into a small team:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
cckit plan # the wave plan: deps-ordered, file-disjoint, session-fit
|
|
134
|
+
cckit wave # a Task-subagent fan-out brief Claude Code enacts (proposes the next wave)
|
|
135
|
+
cckit orchestrate 12 14 17 # run N flows in parallel worktrees (--dry-run / --cap / --agent)
|
|
136
|
+
cckit watch --merge # the captain: gate open PRs, squash-merge the CLEAN ones, advance
|
|
137
|
+
# (policy floors hold PRs touching CI, lockfiles, or secrets for review)
|
|
138
|
+
cckit watch --loop # self-pace gate/merge passes until steady state
|
|
139
|
+
cckit autopilot # unattended multi-flow: drive (or auto-pick) issues under a cap
|
|
140
|
+
```
|
|
81
141
|
|
|
82
142
|
## Driven by agents
|
|
83
143
|
|
|
84
144
|
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
|
|
145
|
+
the contract. Every verb accepts `--llm` for structured output — uniform payloads come back as
|
|
146
|
+
**TOON** (token-efficient), so the plan, board, and fan-out cost the model far fewer tokens:
|
|
86
147
|
|
|
87
148
|
```bash
|
|
88
|
-
cckit sync --llm #
|
|
89
|
-
cckit
|
|
149
|
+
cckit sync --llm # board state for an agent to reason over
|
|
150
|
+
cckit plan --llm # the wave plan as TOON rows
|
|
151
|
+
cckit wave --llm # the fan-out (one subagent prompt per issue) as TOON
|
|
90
152
|
```
|
|
91
153
|
|
|
154
|
+
Human output renders as markdown — rich via `glow` in a terminal, native in the Claude Code
|
|
155
|
+
transcript, pipe-safe everywhere (`cckit render` exposes the seam for any script).
|
|
156
|
+
|
|
157
|
+
## cckit builds cckit
|
|
158
|
+
|
|
159
|
+
None of this is theoretical. cckit is developed *with* cckit — every feature, fix, and tutorial went
|
|
160
|
+
through its own lifecycle: an issue, an isolated worktree, a pull request, a merge. The receipts are
|
|
161
|
+
public: [every issue closed in the repo →](https://github.com/jeiemgi/cckit/issues?q=is%3Aissue%20state%3Aclosed)
|
|
162
|
+
— including [the effort that produced this README](https://github.com/jeiemgi/cckit/issues/160).
|
|
163
|
+
The board is both the plan and the proof.
|
|
164
|
+
|
|
92
165
|
## Documentation
|
|
93
166
|
|
|
94
|
-
Full docs
|
|
167
|
+
Full docs live at **[cckit.vercel.app](https://cckit.vercel.app)** — start with
|
|
168
|
+
[the idea](https://cckit.vercel.app/philosophy/) if you want the why. The
|
|
169
|
+
[tutorials](https://cckit.vercel.app/tutorials/) are step-by-step "How to X with Claude Code"
|
|
170
|
+
guides, each labelled **Beginner / Intermediate / Advanced** and carrying a **"Copy as Markdown"
|
|
171
|
+
prompt** you can paste straight into Claude Code — start exactly where you are. The
|
|
172
|
+
[cookbook](https://cckit.vercel.app/cookbook/) holds lifecycle recipes, and the
|
|
173
|
+
[CLI reference](https://cckit.vercel.app/cli-reference/) covers every verb.
|
|
95
174
|
|
|
96
175
|
## Project layout
|
|
97
176
|
|
|
@@ -102,6 +181,7 @@ cckit/
|
|
|
102
181
|
.claude-plugin/ # the Claude Code plugin manifest
|
|
103
182
|
skills/ commands/ # Claude Code skills + slash commands
|
|
104
183
|
profiles/ templates/ # init profiles + scaffold templates
|
|
184
|
+
routines/ modules/ # scheduled routines + optional modules
|
|
105
185
|
docs-site/ # documentation source — Astro/Starlight (deployed to cckit.vercel.app)
|
|
106
186
|
cckit.config.json # project configuration (no hardcoded org/repo)
|
|
107
187
|
```
|
|
@@ -121,7 +201,8 @@ More variants (HTML, flat-square): [docs/badge.md](docs/badge.md).
|
|
|
121
201
|
## Contributing
|
|
122
202
|
|
|
123
203
|
Issues and PRs welcome — see [`CONTRIBUTING.md`](CONTRIBUTING.md). cckit develops itself with its
|
|
124
|
-
own lifecycle (`cckit start` / `cckit pr`)
|
|
204
|
+
own lifecycle (`cckit start` / `cckit pr`), and `cckit contribute "<summary>"` opens a contribution
|
|
205
|
+
PR gated on the repo checks. Be curious, and be kind — that's how the open-source community works.
|
|
125
206
|
|
|
126
207
|
## Support
|
|
127
208
|
|
|
@@ -139,3 +220,21 @@ Licensed under either of
|
|
|
139
220
|
at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for
|
|
140
221
|
inclusion in cckit by you, as defined in the Apache-2.0 license, shall be dual licensed as above,
|
|
141
222
|
without any additional terms or conditions.
|
|
223
|
+
|
|
224
|
+
## Disclaimer & trademarks
|
|
225
|
+
|
|
226
|
+
cckit is an **independent, community-built project for educational purposes**. It is **not an
|
|
227
|
+
official Anthropic product** and is **not affiliated with, endorsed, sponsored, or supported by
|
|
228
|
+
Anthropic PBC** in any way.
|
|
229
|
+
|
|
230
|
+
"Anthropic", "Claude", and "Claude Code", along with related names, logos, and marks, are
|
|
231
|
+
trademarks of **Anthropic PBC**. All rights to Anthropic's products, services, names, and
|
|
232
|
+
intellectual property belong to Anthropic. cckit uses these names only **nominatively** — to
|
|
233
|
+
describe interoperability with Claude Code — and claims no ownership of or rights to them.
|
|
234
|
+
|
|
235
|
+
cckit is provided **"as is", without warranty of any kind**, for learning and experimentation.
|
|
236
|
+
Nothing here is legal advice. You are responsible for your own use of cckit and for complying with
|
|
237
|
+
the terms of any third-party service it integrates with, including
|
|
238
|
+
[Anthropic's Usage Policies and Terms](https://www.anthropic.com/legal). The cckit source code
|
|
239
|
+
itself is licensed as stated above; this disclaimer does not extend cckit's license to any
|
|
240
|
+
third-party trademark or product.
|
package/bin/cckit
CHANGED
|
@@ -14,12 +14,16 @@
|
|
|
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
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
|
|
17
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
|
|
18
22
|
# cckit orchestrate <a> <b> … run N flows in parallel worktrees (--dry-run/--cap/--agent)
|
|
19
23
|
# cckit autopilot [<a> …] unattended multi-flow: drive (or auto-pick) issues under a cap
|
|
20
24
|
# cckit watch [--merge] [--loop] captain: gate open PRs, squash-merge CLEAN, advance the wave
|
|
21
25
|
# cckit next [--effort N] everyday helper: the unblocked set + how to start the top issue
|
|
22
|
-
# cckit
|
|
26
|
+
# cckit wave [--effort N] read open efforts, propose incoming waves: fan-out + captain drive
|
|
23
27
|
# cckit gc [--prune [--yes]] report (default) or prune merged branches + worktrees
|
|
24
28
|
# cckit status thin dashboard: board + worktrees + resume handoff
|
|
25
29
|
# cckit scan [--llm] detect this repo's stack + kit state (JSON)
|
|
@@ -54,18 +58,12 @@ LIB="$ROOT/scripts/lib"
|
|
|
54
58
|
# cckit.config.json, or .claude/kit.config.json), so board/lifecycle verbs act on the project you
|
|
55
59
|
# ran cckit in — NOT cckit's own install dir. Running inside the cckit repo resolves to its own
|
|
56
60
|
# cckit.config.json naturally (self-hosting); outside any project we fall back to cckit's config.
|
|
57
|
-
# An explicit KIT_CONFIG in the environment always wins.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
[ -f "$d/cckit.config.json" ] && { printf '%s\n' "$d/cckit.config.json"; return 0; }
|
|
62
|
-
[ -f "$d/.claude/kit.config.json" ] && { printf '%s\n' "$d/.claude/kit.config.json"; return 0; }
|
|
63
|
-
d="$(dirname "$d")"
|
|
64
|
-
done
|
|
65
|
-
return 1
|
|
66
|
-
}
|
|
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"
|
|
67
65
|
if [ -z "${KIT_CONFIG:-}" ]; then
|
|
68
|
-
KIT_CONFIG="$(
|
|
66
|
+
KIT_CONFIG="$(kit_config_find "$PWD" || true)"
|
|
69
67
|
[ -n "$KIT_CONFIG" ] || KIT_CONFIG="$ROOT/cckit.config.json"
|
|
70
68
|
fi
|
|
71
69
|
export KIT_CONFIG
|
|
@@ -104,13 +102,30 @@ case "$cmd" in
|
|
|
104
102
|
if cckit_is_json; then cckit_json version "$v"; else echo "cckit $(ui_paint '1;36' "$v")"; fi
|
|
105
103
|
;;
|
|
106
104
|
effort)
|
|
105
|
+
# Load the project config FIRST (like every sibling verb): KIT_REPO / KIT_BASE_BRANCH /
|
|
106
|
+
# KIT_PROJECTS_V2 drive repo resolution, the worktree base, and the board guard below —
|
|
107
|
+
# without this, effort start silently branches from origin/main on a non-main-based repo (#151).
|
|
108
|
+
# shellcheck source=/dev/null
|
|
109
|
+
source "$LIB/kit-config.sh" && load_kit_config
|
|
107
110
|
# shellcheck source=/dev/null
|
|
108
111
|
source "$LIB/effort.sh"
|
|
109
112
|
# shellcheck source=/dev/null
|
|
110
113
|
source "$LIB/effort-ops.sh" # the new|start|pr|close lifecycle ops (compose effort.sh helpers)
|
|
114
|
+
# shellcheck source=/dev/null
|
|
115
|
+
source "$LIB/effort-metrics.sh" # effort_ctx_bucket — sizes the ctx:* label on `effort new`
|
|
111
116
|
sub="${1:-}"; shift || true
|
|
112
117
|
case "$sub" in
|
|
113
|
-
new)
|
|
118
|
+
new)
|
|
119
|
+
# Full parity with /kit-effort-new: load the board + role helpers so an effort created via
|
|
120
|
+
# the verb lands on the board exactly as the skill does. Board ops are guarded inside
|
|
121
|
+
# effort_new, so this is a safe no-op when Projects v2 is off or the IDs aren't captured.
|
|
122
|
+
if [ "${KIT_PROJECTS_V2:-}" = "true" ]; then
|
|
123
|
+
# shellcheck source=/dev/null
|
|
124
|
+
source "$LIB/gh-project.sh"; load_project_ids >/dev/null 2>&1 || true
|
|
125
|
+
# shellcheck source=/dev/null
|
|
126
|
+
source "$LIB/role-identity.sh" 2>/dev/null || true
|
|
127
|
+
fi
|
|
128
|
+
effort_new "$@" ;;
|
|
114
129
|
start) effort_start "$@" ;;
|
|
115
130
|
pr) effort_pr "$@" ;;
|
|
116
131
|
close) effort_close "$@" ;;
|
|
@@ -162,6 +177,16 @@ case "$cmd" in
|
|
|
162
177
|
# shellcheck source=/dev/null
|
|
163
178
|
source "$LIB/plan-machine.sh"; plan_machine "$@"
|
|
164
179
|
;;
|
|
180
|
+
plan-next)
|
|
181
|
+
# Forward planner: introspect the CURRENT capability surface (skills/verbs/rules/docs) and
|
|
182
|
+
# propose what to build next, grounded in what the kit can already do. Filesystem-only — config
|
|
183
|
+
# is loaded for the project-root inference (KIT_CONFIG), then plan-next scans that root. Output
|
|
184
|
+
# is HUMAN / orchestrator-facing only — never wired into a monitored model's context (#86).
|
|
185
|
+
# shellcheck source=/dev/null
|
|
186
|
+
source "$LIB/kit-config.sh" && load_kit_config 2>/dev/null || true
|
|
187
|
+
# shellcheck source=/dev/null
|
|
188
|
+
source "$LIB/plan-next.sh"; plan_next "$@"
|
|
189
|
+
;;
|
|
165
190
|
gc)
|
|
166
191
|
# shellcheck source=/dev/null
|
|
167
192
|
source "$LIB/kit-config.sh" && load_kit_config
|
|
@@ -194,9 +219,10 @@ case "$cmd" in
|
|
|
194
219
|
# shellcheck source=/dev/null
|
|
195
220
|
source "$LIB/next.sh"; next_issue "$@"
|
|
196
221
|
;;
|
|
197
|
-
copilot)
|
|
198
|
-
#
|
|
199
|
-
#
|
|
222
|
+
wave|copilot)
|
|
223
|
+
# Read the open efforts and propose the incoming waves of work: emit the wave-0 Task-subagent
|
|
224
|
+
# fan-out + the between-waves captain drive. (`copilot` is a hidden back-compat alias for `wave`.)
|
|
225
|
+
# Runs in the invoking project; needs config so KIT_REPO is set before it reads it.
|
|
200
226
|
# shellcheck source=/dev/null
|
|
201
227
|
source "$LIB/kit-config.sh" && load_kit_config
|
|
202
228
|
# shellcheck source=/dev/null
|
package/cckit.config.json
CHANGED
package/commands/kit-doctor.md
CHANGED
|
@@ -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
|
-
-
|
|
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
|
|
package/commands/kit-update.md
CHANGED
|
@@ -105,8 +105,10 @@ _plug="$(jq -r '.version // "0.0.0"' "/Users/josegutierrezdelgado/.claude/plugin
|
|
|
105
105
|
"${CLAUDE_PLUGIN_ROOT}/scripts/init.sh" --upgrade --target "$PWD" --dry-run
|
|
106
106
|
```
|
|
107
107
|
Then run it for real to see the precise added/preserved report (step 4). Make clear: upgrade only
|
|
108
|
-
**adds** missing files and **merges** new config keys — your existing `.claude/` files
|
|
109
|
-
`kit.config.json` values are never
|
|
108
|
+
**adds** missing files and **merges** new required config keys — your existing `.claude/` files
|
|
109
|
+
(including a customized `.claude/statusline.sh` shim) and `kit.config.json` values are never
|
|
110
|
+
overwritten, and feature blocks your config deliberately lacks (`plans`, `specKit`, `prePush`,
|
|
111
|
+
`local`, `memory`) are never injected from profile defaults.
|
|
110
112
|
|
|
111
113
|
4. **Confirm, then apply.** Ask with `AskUserQuestion`: **Apply update** · **Preview only** · **Skip**.
|
|
112
114
|
Per the CLI-style preference, when the delta is purely additive (only new files, nothing preserved
|
|
@@ -122,8 +124,11 @@ _plug="$(jq -r '.version // "0.0.0"' "/Users/josegutierrezdelgado/.claude/plugin
|
|
|
122
124
|
|
|
123
125
|
## Rules
|
|
124
126
|
|
|
125
|
-
- **Never clobber.** Upgrade only ADDS missing files and MERGES new `kit.config.json` keys;
|
|
126
|
-
files and config values are preserved.
|
|
127
|
+
- **Never clobber.** Upgrade only ADDS missing files and MERGES new required `kit.config.json` keys;
|
|
128
|
+
existing files and config values are preserved. A file the kit cannot prove it owns intact — edited
|
|
129
|
+
by the project or absent from the manifest (e.g. a repointed `.claude/statusline.sh`) — is kept, and
|
|
130
|
+
feature blocks the config deliberately lacks are never injected from profile defaults. Always show
|
|
131
|
+
the `--dry-run` preview before applying.
|
|
127
132
|
- When reporting effective configuration, honor per-folder `.claudekit/config.json` overrides
|
|
128
133
|
(nearest-wins) — see `scripts/lib/kit-config.sh`.
|
|
129
134
|
- Don't fabricate changelog content — read `CHANGELOG.md`. If the project predates version tracking
|
package/kit.config.schema.json
CHANGED
|
@@ -55,12 +55,37 @@
|
|
|
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
|
+
"flows": { "type": "array", "items": { "type": "string" }, "description": "Controlled flow vocabulary for effort titles — the values accepted by the leading [Flow] title tag and `--flow` (also the flow:<flow> labels). Replaces the built-in default (Core UI API Docs Infra Auth Data Web App); an explicit EFFORT_FLOWS env var still wins per invocation." },
|
|
72
|
+
"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." }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"captain": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"additionalProperties": true,
|
|
78
|
+
"properties": {
|
|
79
|
+
"mergePolicy": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": true,
|
|
82
|
+
"properties": {
|
|
83
|
+
"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)." },
|
|
84
|
+
"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." }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
64
89
|
"plans": {
|
|
65
90
|
"type": "object",
|
|
66
91
|
"additionalProperties": true,
|
package/package.json
CHANGED
|
@@ -39,14 +39,19 @@ if [[ "$REACT_DETECTED" != "true" ]]; then
|
|
|
39
39
|
fi
|
|
40
40
|
|
|
41
41
|
CFG="$TARGET/.claude/kit.config.json"
|
|
42
|
-
|
|
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="$(
|
|
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
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
}
|
|
37
|
+
}" -f login="$KIT_OWNER" -F number="$KIT_PROJECT_NUMBER")
|
|
25
38
|
|
|
26
|
-
PROJECT_ID=$(echo "$DATA" | jq -r
|
|
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.
|
|
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.
|
|
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"
|
|
@@ -94,6 +94,40 @@ t "diff is only the kitVersion line" "$only_kitver" "yes"
|
|
|
94
94
|
t "kitVersion bumped to plugin version" "$(jq -r '.kitVersion' .claude/kit.config.json)" "$PLUGIN_VERSION"
|
|
95
95
|
t "upgrade block preserved through merge" "$(jq -r '.upgrade.removed | length' .claude/kit.config.json)" "2"
|
|
96
96
|
|
|
97
|
+
# --- #149: upgrade preserves existing project files -------------------------------------
|
|
98
|
+
# 4. feature keys deliberately absent from the config are NOT injected by the merge
|
|
99
|
+
# (the seed config never had plans/specKit/prePush/local/memory — profile defaults must
|
|
100
|
+
# not resurrect them), while REQUIRED structural keys still merge in.
|
|
101
|
+
for k in plans specKit prePush local memory; do
|
|
102
|
+
t "feature key '$k' not injected" "$(jq --arg k "$k" 'has($k)' .claude/kit.config.json)" "false"
|
|
103
|
+
done
|
|
104
|
+
t "required key 'knowledge' still added" "$(jq -r '.knowledge.dir // "absent"' .claude/kit.config.json)" "knowledge"
|
|
105
|
+
|
|
106
|
+
# 5. a CUSTOMIZED statusline shim survives the next upgrade (the v0.3.0 clobber: kit-wire
|
|
107
|
+
# replaced a repointed shim with the template on every upgrade).
|
|
108
|
+
git add -A && git commit -q -m "settle upgrade under test"
|
|
109
|
+
t "statusline shim exists after wire" "$([ -f .claude/statusline.sh ] && echo yes || echo no)" "yes"
|
|
110
|
+
SL_MARKER="# LOCAL-STATUSLINE-EDIT-#149 (must survive upgrade)"
|
|
111
|
+
printf '\n%s\n' "$SL_MARKER" >> .claude/statusline.sh
|
|
112
|
+
jq '.kitVersion = "0.0.2"' .claude/kit.config.json > .claude/kit.config.json.tmp \
|
|
113
|
+
&& mv .claude/kit.config.json.tmp .claude/kit.config.json
|
|
114
|
+
git add -A && git commit -q -m "customize statusline + reset version"
|
|
115
|
+
|
|
116
|
+
CLAUDE_PLUGIN_ROOT="$PLUGIN_DIR" bash "$INIT" --upgrade --target "$proj" >/dev/null 2>&1 \
|
|
117
|
+
|| { echo "FAIL: statusline upgrade run exited non-zero"; exit 1; }
|
|
118
|
+
t "customized statusline preserved (tracked: modified)" "$(grep -cF "$SL_MARKER" .claude/statusline.sh)" "1"
|
|
119
|
+
|
|
120
|
+
# ...and also when the manifest is absent (fresh clone: shim exists but is UNTRACKED).
|
|
121
|
+
git add -A && git commit -q -m "settle statusline upgrade"
|
|
122
|
+
rm -f .claude/kit.manifest.json
|
|
123
|
+
jq '.kitVersion = "0.0.3"' .claude/kit.config.json > .claude/kit.config.json.tmp \
|
|
124
|
+
&& mv .claude/kit.config.json.tmp .claude/kit.config.json
|
|
125
|
+
git add -A && git commit -q -m "reset version (manifest absent)"
|
|
126
|
+
CLAUDE_PLUGIN_ROOT="$PLUGIN_DIR" bash "$INIT" --upgrade --target "$proj" >/dev/null 2>&1 \
|
|
127
|
+
|| { echo "FAIL: manifest-absent upgrade run exited non-zero"; exit 1; }
|
|
128
|
+
t "customized statusline preserved (untracked)" "$(grep -cF "$SL_MARKER" .claude/statusline.sh)" "1"
|
|
129
|
+
t "feature keys still absent after repeat upgrades" "$(jq 'has("plans")' .claude/kit.config.json)" "false"
|
|
130
|
+
|
|
97
131
|
echo ""
|
|
98
|
-
[ "$fail" -eq 0 ] && echo "PASS: init.sh --upgrade honors the preserve/exclude contract (#334)" || echo "FAILED"
|
|
132
|
+
[ "$fail" -eq 0 ] && echo "PASS: init.sh --upgrade honors the preserve/exclude contract (#334, #149)" || echo "FAILED"
|
|
99
133
|
exit "$fail"
|