@jeiemgi/cckit 0.2.0 → 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.
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +21 -8
- package/README.md +63 -5
- package/bin/cckit +37 -16
- package/cckit.config.json +1 -1
- package/commands/kit-doctor.md +3 -1
- package/kit.config.schema.json +24 -0
- package/package.json +1 -1
- package/scripts/annotate-setup.sh +7 -2
- package/scripts/capture-project-ids.sh +23 -10
- package/scripts/init.sh +22 -4
- 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/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-metrics-test.sh +57 -0
- package/scripts/lib/effort-metrics.sh +19 -5
- package/scripts/lib/effort-ops-test.sh +51 -2
- package/scripts/lib/effort-ops.sh +314 -49
- 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 +34 -0
- 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 +33 -13
- 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/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-new/SKILL.md +39 -111
- package/skills/kit-effort-pr/SKILL.md +6 -2
- package/skills/kit-next/SKILL.md +4 -0
- package/skills/kit-plan-next/SKILL.md +82 -0
- package/templates/hooks/mempal_session_start.sh.tmpl +36 -2
- package/templates/rules/effort-model.md +26 -6
- package/templates/rules/mempalace.md +1 -0
- package/templates/rules/plan-next.md +58 -0
|
@@ -7,10 +7,11 @@ when_to_use: When starting a new unit of work (a "plan"/effort) that decomposes
|
|
|
7
7
|
# kit-effort-new
|
|
8
8
|
|
|
9
9
|
Plugin-direct skill — runs straight from `${CLAUDE_PLUGIN_ROOT}` (no per-project `scripts/` checkout
|
|
10
|
-
needed).
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
needed). It is a **thin caller** of the shared creation core `effort_new` (`scripts/lib/effort-ops.sh`)
|
|
11
|
+
— the exact function `cckit effort new` runs — so the skill and the verb produce structurally
|
|
12
|
+
identical efforts (effort #98). No creation logic is re-authored inline (kit-engine-boundary #1/#2).
|
|
13
|
+
Repo + board config come from `load_kit_config` (`$KIT_REPO`, `KIT_PROJECTS_V2`). Reads
|
|
14
|
+
`.claude/kit.config.json` from the working directory.
|
|
14
15
|
|
|
15
16
|
Creates the **parent issue** (the plan) + **N native sub-issues** for one effort. See
|
|
16
17
|
`rules/effort-model.md` for the model and the parent-issue template. GitHub is the single source of
|
|
@@ -34,120 +35,47 @@ truth — the parent issue IS the plan (no separate plan file).
|
|
|
34
35
|
|
|
35
36
|
## Execution
|
|
36
37
|
|
|
38
|
+
This skill is a **thin caller** of the shared creation core `effort_new`
|
|
39
|
+
(`scripts/lib/effort-ops.sh`) — the SAME function `cckit effort new` runs (effort #98). The core owns
|
|
40
|
+
body composition, the `ctx/kind/priority/role/flow` label set, per-sub title lint, native sub-issue
|
|
41
|
+
links, `blocked_by` edges, and the board add. There is no second implementation here.
|
|
42
|
+
|
|
37
43
|
```bash
|
|
38
44
|
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/kit-config.sh" && load_kit_config
|
|
39
|
-
|
|
40
|
-
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/role-identity.sh" 2>/dev/null || true
|
|
41
|
-
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/effort.sh"
|
|
42
|
-
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/effort-metrics.sh" # effort_ctx_bucket
|
|
43
|
-
|
|
44
|
-
# TITLE = the human NAME only; the board title is composed as "[Effort] <N> · [<FLOW>] <TITLE>"
|
|
45
|
-
# (N is injected after creation — it's the issue's own number). FLOW is an optional controlled-vocab tag.
|
|
46
|
-
FLOW_TAG=""; [[ -n "${FLOW:-}" ]] && FLOW_TAG="[$FLOW] "
|
|
47
|
-
|
|
48
|
-
# 0. Guard the title content BEFORE creating anything: concise, no jargon, valid flow tag.
|
|
49
|
-
# Lint with a placeholder number — the rule is about the NAME, not the (not-yet-assigned) N.
|
|
50
|
-
effort_title_lint "[Effort] 0 · ${FLOW_TAG}${TITLE}" \
|
|
51
|
-
|| { echo "✗ fix the effort title (above) before creating — concise / no-jargon / valid flow" >&2; return 1; }
|
|
52
|
-
|
|
53
|
-
# 1. Compose the parent body (the 4 sections) + an optional ## Relations chain.
|
|
54
|
-
RELATIONS=""
|
|
55
|
-
if [[ -n "${DEPENDS_ON:-}" ]]; then
|
|
56
|
-
RELATIONS=$'\n\n## Relations\n'
|
|
57
|
-
for d in ${DEPENDS_ON//,/ }; do d="${d#\#}"; RELATIONS+="- Depends on #$d"$'\n'; done
|
|
58
|
-
fi
|
|
59
|
-
PARENT_BODY=$(cat <<EOF
|
|
60
|
-
## Goal
|
|
61
|
-
|
|
62
|
-
$GOAL
|
|
63
|
-
|
|
64
|
-
## Scope
|
|
65
|
-
|
|
66
|
-
$SCOPE
|
|
67
|
-
|
|
68
|
-
## For agents
|
|
69
|
-
|
|
70
|
-
$FOR_AGENTS
|
|
71
|
-
|
|
72
|
-
## Verification
|
|
73
|
-
|
|
74
|
-
$VERIFICATION$RELATIONS
|
|
75
|
-
EOF
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
# 2. Create the parent issue (the plan). kind:task is the effort default unless overridden. Labels
|
|
79
|
-
# add `ctx:*` (session weight, first-pass from the sub count; refined at kit-effort-start) + an
|
|
80
|
-
# optional `flow:<flow>` tag.
|
|
81
|
-
SUBCOUNT=$(printf '%s\n' "$SUBS" | grep -c . 2>/dev/null || echo 1); [[ "$SUBCOUNT" -ge 1 ]] || SUBCOUNT=1
|
|
82
|
-
CTX="$(effort_ctx_bucket 1 "$SUBCOUNT")"
|
|
83
|
-
FLOW_LABEL=""; [[ -n "${FLOW:-}" ]] && FLOW_LABEL=",flow:$(printf '%s' "$FLOW" | tr '[:upper:]' '[:lower:]')"
|
|
84
|
-
PARENT_URL=$(gh issue create --repo "$KIT_REPO" \
|
|
85
|
-
--title "[Effort] PLACEHOLDER · ${FLOW_TAG}${TITLE}" \
|
|
86
|
-
--body "$PARENT_BODY" \
|
|
87
|
-
--label "$CTX,kind:task,priority:${PRIORITY:-p1},role:$ROLE$FLOW_LABEL" \
|
|
88
|
-
${MILESTONE:+--milestone "$MILESTONE"})
|
|
89
|
-
PARENT_NUM=$(basename "$PARENT_URL")
|
|
90
|
-
# Inject the real effort id (== the issue number) into the title now that we have it.
|
|
91
|
-
gh issue edit "$PARENT_NUM" --repo "$KIT_REPO" --title "[Effort] $PARENT_NUM · ${FLOW_TAG}${TITLE}" >/dev/null
|
|
92
|
-
echo "✓ parent #$PARENT_NUM — $PARENT_URL"
|
|
93
|
-
|
|
94
|
-
# 2b. Native dependency edges from DEPENDS_ON — the visible board chain.
|
|
95
|
-
if [[ -n "${DEPENDS_ON:-}" ]]; then
|
|
96
|
-
for d in ${DEPENDS_ON//,/ }; do d="${d#\#}"; effort_set_blocked_by "$PARENT_NUM" "$d"; done
|
|
97
|
-
fi
|
|
98
|
-
|
|
99
|
-
# 3. Add the parent to the board, set Status=Todo + Role (if Projects v2 is enabled).
|
|
45
|
+
# Board + role helpers must be loaded BEFORE effort_new so its (guarded) board add can run.
|
|
100
46
|
if [[ "$KIT_PROJECTS_V2" == "true" ]]; then
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if [[ -n "$PARENT_ITEM" ]]; then
|
|
104
|
-
project_set_single_select "$PARENT_ITEM" "$STATUS_FIELD_ID" "$STATUS_OPT_TODO"
|
|
105
|
-
ROLE_OPT=$(role_option_id "$ROLE" 2>/dev/null || echo "")
|
|
106
|
-
[[ -n "$ROLE_OPT" ]] && project_set_single_select "$PARENT_ITEM" "$ROLE_FIELD_ID" "$ROLE_OPT"
|
|
107
|
-
fi
|
|
47
|
+
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/gh-project.sh"; load_project_ids
|
|
48
|
+
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/role-identity.sh" 2>/dev/null || true
|
|
108
49
|
fi
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
#
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
echo " ✓ sub #$SUB_NUM — $SUB_TITLE"
|
|
132
|
-
|
|
133
|
-
# Native parent/child link via the sub-issues REST API (child DB id, not number).
|
|
134
|
-
effort_link_sub "$PARENT_NUM" "$SUB_NUM"
|
|
135
|
-
|
|
136
|
-
# Board: add sub, Status=Todo + Role.
|
|
137
|
-
if [[ "$KIT_PROJECTS_V2" == "true" ]]; then
|
|
138
|
-
SUB_NODE=$(gh api "repos/$KIT_REPO/issues/$SUB_NUM" --jq .node_id)
|
|
139
|
-
SUB_ITEM=$(project_add_item "$SUB_NODE" 2>/dev/null || echo "")
|
|
140
|
-
if [[ -n "$SUB_ITEM" ]]; then
|
|
141
|
-
project_set_single_select "$SUB_ITEM" "$STATUS_FIELD_ID" "$STATUS_OPT_TODO"
|
|
142
|
-
ROLE_OPT=$(role_option_id "$ROLE" 2>/dev/null || echo "")
|
|
143
|
-
[[ -n "$ROLE_OPT" ]] && project_set_single_select "$SUB_ITEM" "$ROLE_FIELD_ID" "$ROLE_OPT"
|
|
144
|
-
fi
|
|
145
|
-
fi
|
|
146
|
-
done
|
|
147
|
-
|
|
50
|
+
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/effort.sh"
|
|
51
|
+
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/effort-metrics.sh" # effort_ctx_bucket
|
|
52
|
+
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/effort-ops.sh" # effort_new — the shared creation core
|
|
53
|
+
|
|
54
|
+
# TITLE = the human NAME only (no "[Effort]"/number prefix). The core composes the board title
|
|
55
|
+
# "[Effort] <N> · [<FLOW>] <TITLE>", fills the four sections, applies labels, and lints the parent +
|
|
56
|
+
# every sub title up front (a bad name aborts before anything is created — no half-effort).
|
|
57
|
+
|
|
58
|
+
# SUBS is a newline-delimited list of "name :: one-line description"; pass each line as a positional
|
|
59
|
+
# sub spec. The core numbers them 1..k and composes the "[Effort <parent>] <M> · <name>" title.
|
|
60
|
+
SUB_ARGS=()
|
|
61
|
+
while IFS= read -r line; do [[ -n "$line" ]] && SUB_ARGS+=("$line"); done <<< "$SUBS"
|
|
62
|
+
|
|
63
|
+
# effort_new echoes the parent number on stdout (progress goes to stderr) — capture it for the hint.
|
|
64
|
+
PARENT_NUM=$(effort_new \
|
|
65
|
+
${FLOW:+--flow "$FLOW"} \
|
|
66
|
+
--role "$ROLE" \
|
|
67
|
+
--priority "${PRIORITY:-p1}" \
|
|
68
|
+
--goal "$GOAL" --scope "$SCOPE" --for-agents "$FOR_AGENTS" --verification "$VERIFICATION" \
|
|
69
|
+
${DEPENDS_ON:+--depends-on "$DEPENDS_ON"} \
|
|
70
|
+
${MILESTONE:+--milestone "$MILESTONE"} \
|
|
71
|
+
"$TITLE" "${SUB_ARGS[@]}")
|
|
148
72
|
echo "✓ effort #$PARENT_NUM created — next: /kit-effort-start $PARENT_NUM"
|
|
149
73
|
```
|
|
150
74
|
|
|
75
|
+
> The block above is intentionally short: all creation logic lives in `effort_new`. If you need to
|
|
76
|
+
> change what an effort looks like (body, labels, lint, board), change the core — both the skill and
|
|
77
|
+
> the verb move together.
|
|
78
|
+
|
|
151
79
|
## Output
|
|
152
80
|
|
|
153
81
|
- Parent issue URL + number (the plan)
|
|
@@ -30,6 +30,7 @@ this PR is where humans review the result. The title carries `[#N]` (the effort
|
|
|
30
30
|
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/kit-config.sh" && load_kit_config
|
|
31
31
|
[[ "$KIT_PROJECTS_V2" == "true" ]] && { source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/gh-project.sh"; load_project_ids; }
|
|
32
32
|
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/role-identity.sh" 2>/dev/null || true
|
|
33
|
+
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/effort.sh" # effort_pr_title + effort_pr_title_check (the shared composer)
|
|
33
34
|
BASE="${KIT_BASE_BRANCH:-main}"
|
|
34
35
|
|
|
35
36
|
# 1. Parse the parent effort number from the branch (effort/<N>-<slug>).
|
|
@@ -89,11 +90,14 @@ $(role_signature "$ROLE" 2>/dev/null || true)
|
|
|
89
90
|
EOF
|
|
90
91
|
)
|
|
91
92
|
|
|
92
|
-
# 6. Create the PR. Title
|
|
93
|
+
# 6. Create the PR. Title composed by the ONE shared composer (same as `cckit effort pr`), then the
|
|
94
|
+
# mandatory-[#N] check — refuse rather than open an id-less PR.
|
|
95
|
+
PR_TITLE=$(effort_pr_title "$NUM" "$TITLE" "$ROLE_DISPLAY")
|
|
96
|
+
effort_pr_title_check "$PR_TITLE" "$NUM" || { echo "✗ PR title lacks the [#$NUM] effort id — aborting"; exit 1; }
|
|
93
97
|
URL=$(gh pr create --repo "$KIT_REPO" \
|
|
94
98
|
--base "$BASE" \
|
|
95
99
|
--head "$BRANCH" \
|
|
96
|
-
--title "
|
|
100
|
+
--title "$PR_TITLE" \
|
|
97
101
|
--body "$PR_BODY" \
|
|
98
102
|
${LABELS:+--label "$LABELS"} \
|
|
99
103
|
${MILESTONE:+--milestone "$MILESTONE"} \
|
package/skills/kit-next/SKILL.md
CHANGED
|
@@ -16,6 +16,10 @@ metadata:
|
|
|
16
16
|
|
|
17
17
|
Answer one question fast: **what should I work on right now, and how do I start it?**
|
|
18
18
|
|
|
19
|
+
> Planning the work that doesn't exist yet is a different question. For "given where we are, what
|
|
20
|
+
> should we build next?" use `/kit-plan-next` (`cckit plan-next`) — it inventories the kit's current
|
|
21
|
+
> capabilities and proposes next efforts. `kit-next` orders the issues that already exist.
|
|
22
|
+
|
|
19
23
|
## Pick up the next issue
|
|
20
24
|
|
|
21
25
|
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kit-plan-next
|
|
3
|
+
description: >
|
|
4
|
+
Forward planning from the current state: run `cckit plan-next` to inventory what the kit can
|
|
5
|
+
already do (skills, verbs, rules, docs) and propose what to build next — grounded in that
|
|
6
|
+
inventory — then hand a chosen item off into `/kit-effort-new`. The proposed plan always carries a
|
|
7
|
+
mandatory docs + README step.
|
|
8
|
+
when_to_use: >
|
|
9
|
+
When you ask "given where we are, what should we build next?" — at the start of a chapter of work,
|
|
10
|
+
after closing an effort, or when triaging a backlog against the kit's current capabilities. Not
|
|
11
|
+
for ordering issues that already exist (that is `/kit-next` / `cckit plan`), and not for scoping an
|
|
12
|
+
effort you have already chosen (go straight to `/kit-effort-new`).
|
|
13
|
+
metadata:
|
|
14
|
+
version: 1.0.0
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# kit-plan-next — what to build next, grounded in current state
|
|
18
|
+
|
|
19
|
+
Answer one question: **given everything the kit can already do, what is the highest-value next
|
|
20
|
+
effort?** This wraps the `cckit plan-next` verb (the engine — never re-author its logic here;
|
|
21
|
+
kit-engine-boundary) and turns its proposals into a scoped effort via `/kit-effort-new`.
|
|
22
|
+
|
|
23
|
+
The verb introspects the CURRENT capability surface at runtime, so the plan is always consistent
|
|
24
|
+
with what ships today — planning pre-grounded in current docs/skills/rules means the executing agent
|
|
25
|
+
burns fewer tokens rediscovering context.
|
|
26
|
+
|
|
27
|
+
## CRITICAL — context-anxiety rule
|
|
28
|
+
|
|
29
|
+
The plan `cckit plan-next` emits is **human / orchestrator-facing only**. NEVER paste it (or the
|
|
30
|
+
inventory) into a monitored model's prompt or context, and never wire it into an agent's context
|
|
31
|
+
automatically. Read it yourself, decide with the human, and hand only the CHOSEN item to
|
|
32
|
+
`/kit-effort-new`. See `rules/plan-next.md`.
|
|
33
|
+
|
|
34
|
+
## 1. Get the forward plan
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
cckit plan-next
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Prints the current capabilities (skills / commands / rules / docs counts + samples) and a ranked,
|
|
41
|
+
grounded set of proposals. Rank 1 is **always** the mandatory docs + README step (docs-always rule —
|
|
42
|
+
it is never dropped, even for a tiny change). Append `--llm` for TOON rows `{rank,area,proposal,next}`
|
|
43
|
+
if you need to reason over the proposals structurally — but keep that output out of any monitored
|
|
44
|
+
context.
|
|
45
|
+
|
|
46
|
+
Run it from the cckit repo for a full inventory, or from a host project where the kit is installed —
|
|
47
|
+
there it degrades gracefully to whatever capability dirs exist (host docs only) and never crashes.
|
|
48
|
+
|
|
49
|
+
## 2. Choose with the human
|
|
50
|
+
|
|
51
|
+
Surface the proposals as a short, visual summary — lead with the human-meaningful outcome of each
|
|
52
|
+
item (its `proposal`), not the verb noise. Confirm which one to pursue. Do not invent scope beyond
|
|
53
|
+
what the inventory supports.
|
|
54
|
+
|
|
55
|
+
## 3. Hand off to /kit-effort-new
|
|
56
|
+
|
|
57
|
+
Once an item is chosen, scope it into an effort:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
/kit-effort-new
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Carry the chosen proposal into the effort's **Goal**, decompose it into sub-issues in **Scope**, and
|
|
64
|
+
**always include the mandatory docs + README sub-issue** — the planner surfaces it on every plan and
|
|
65
|
+
`/kit-effort-new` must preserve it (docs are part of "done," never a follow-up).
|
|
66
|
+
|
|
67
|
+
## Output
|
|
68
|
+
|
|
69
|
+
- The current-capability inventory (counts + samples per area).
|
|
70
|
+
- A ranked, grounded proposal table — rank 1 is always docs + README.
|
|
71
|
+
- A chosen item handed to `/kit-effort-new` as a new effort (Goal / Scope / For agents / Verification).
|
|
72
|
+
|
|
73
|
+
## Rules
|
|
74
|
+
|
|
75
|
+
- **Engine boundary** — the planning logic lives in `scripts/lib/plan-next.sh` (`plan_next`); this
|
|
76
|
+
skill only runs the verb and routes the result. Never re-implement the inventory or proposals here.
|
|
77
|
+
- **Docs are mandatory** — every plan carries a docs + README step; the effort you scope must keep it.
|
|
78
|
+
- **Context-anxiety** — planner output never enters a monitored model's context; it informs the
|
|
79
|
+
human/orchestrator's decision only.
|
|
80
|
+
- **Don't plan what exists** — for ordering already-created issues use `/kit-next` or `cckit plan`;
|
|
81
|
+
for scoping an item you've already chosen go straight to `/kit-effort-new`.
|
|
82
|
+
- Scrub secrets from anything pasted into the resulting effort body (trace hygiene).
|
|
@@ -1,8 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# SessionStart hook — load MemPalace wake-up context for this project (wing={{WING}}).
|
|
3
|
-
# Scaffolded by
|
|
3
|
+
# Scaffolded by cckit. stdout is injected into the session context by Claude Code.
|
|
4
4
|
# Safe no-op if the `mempalace` CLI is not installed.
|
|
5
|
+
#
|
|
5
6
|
# NOTE: uses `wake-up --wing` on purpose, NOT `mempalace hook run --hook session-start` —
|
|
6
7
|
# `hook run` derives the wing implicitly and can file into the wrong wing; `--wing` is explicit.
|
|
8
|
+
#
|
|
9
|
+
# HEADER SCOPING: `mempalace wake-up` scopes the L1 *body* to --wing, but its L0 identity
|
|
10
|
+
# *header* is read from the single global ~/.mempalace/identity.txt and ignores the wing
|
|
11
|
+
# (see mempalace layers.py Layer0). To give this wing its own header, drop a per-wing
|
|
12
|
+
# identity file next to this hook:
|
|
13
|
+
# .claude/mempal-identity.{{WING}}.txt (preferred) or .claude/mempal-identity.txt
|
|
14
|
+
# When present it replaces the global L0 block; absent → mempalace output is passed through
|
|
15
|
+
# unchanged (no regression).
|
|
7
16
|
command -v mempalace >/dev/null 2>&1 || exit 0
|
|
8
|
-
|
|
17
|
+
|
|
18
|
+
_wake="$(mempalace wake-up --wing {{WING}} 2>/dev/null)" || exit 0
|
|
19
|
+
|
|
20
|
+
# Locate an optional per-wing identity header (relative to this hook's own dir).
|
|
21
|
+
_dir="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
22
|
+
_id=""
|
|
23
|
+
for _cand in "$_dir/../mempal-identity.{{WING}}.txt" "$_dir/../mempal-identity.txt"; do
|
|
24
|
+
[ -s "$_cand" ] && { _id="$_cand"; break; }
|
|
25
|
+
done
|
|
26
|
+
|
|
27
|
+
# No per-wing identity, or output not in the expected L0/L1 shape → pass through verbatim.
|
|
28
|
+
if [ -z "$_id" ] || ! printf '%s\n' "$_wake" | grep -q '^## L1'; then
|
|
29
|
+
printf '%s\n' "$_wake"
|
|
30
|
+
exit 0
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Replace the global L0 block (between the "====" rule and the first "## L1") with our header.
|
|
34
|
+
awk -v idfile="$_id" '
|
|
35
|
+
BEGIN { while ((getline line < idfile) > 0) id = id line "\n" }
|
|
36
|
+
!sep && /^=+$/ { print; sep=1; printf "%s\n", id; inl0=1; next }
|
|
37
|
+
inl0 && /^## L1/ { inl0=0 }
|
|
38
|
+
inl0 { next }
|
|
39
|
+
{ print }
|
|
40
|
+
' <<EOF
|
|
41
|
+
$_wake
|
|
42
|
+
EOF
|
|
@@ -56,6 +56,14 @@ The parent ref is mandatory; `N` is a plain number so subs sort and read predict
|
|
|
56
56
|
applies both formats when it creates the parent + native sub-issues, so a sub is identifiable by
|
|
57
57
|
name alone in any flat list.
|
|
58
58
|
|
|
59
|
+
**One creation core (no drift).** Both ways to create an effort — the `cckit effort new` verb and
|
|
60
|
+
the `/kit-effort-new` skill — call the **same** shared function `effort_new` (`scripts/lib/effort-ops.sh`).
|
|
61
|
+
That single core fills the four body sections, applies the `ctx/kind/priority/role/flow` label set
|
|
62
|
+
(`ctx:*` via `effort_ctx_bucket`), lints the parent **and every sub** title up front, links the
|
|
63
|
+
native sub-issues, and adds everything to the board. Change the core and both move together; there
|
|
64
|
+
is no second implementation. `scripts/setup-labels.sh` provisions every label family the core
|
|
65
|
+
applies (`ctx:* flow:* kind:* priority:* role:*`) so creation never fails on a missing label.
|
|
66
|
+
|
|
59
67
|
### Title rule, flow tags, relations, session-fit
|
|
60
68
|
|
|
61
69
|
The board should be **legible at a glance** — a title says *what* an effort delivers and *which
|
|
@@ -68,8 +76,9 @@ plain-language **outcome** with an optional leading `[Flow]` tag:
|
|
|
68
76
|
- **Banned in the name:** glyphs (`— ▾ ▸ → ✓ ✗ … •`), parentheses, ` — ` / ` · ` / ` / ` sub-clauses,
|
|
69
77
|
code identifiers (file names, paths, `snake_case`), internal jargon (`chrome`, `seam`, `contract`,
|
|
70
78
|
`rescue stash`, `refactor`, `wiring`, …), and **> 6 words**. Detail goes in the body.
|
|
71
|
-
- **`effort_title_lint`** (`scripts/lib/effort.sh`) is the check; `effort-new`
|
|
72
|
-
|
|
79
|
+
- **`effort_title_lint`** (`scripts/lib/effort.sh`) is the check; `effort-new` lints the parent **and
|
|
80
|
+
every sub** title up front and refuses to create anything if one fails. Bad→good:
|
|
81
|
+
`operator chrome — Settings ▾ dropdown + fixes` → **`[UI] operator navigation`**.
|
|
73
82
|
|
|
74
83
|
**Flow tag (`[Flow]` + `flow:<flow>` label).** A **flow** is a named thread of efforts toward one
|
|
75
84
|
outcome. Controlled vocabulary (`EFFORT_FLOWS` in `effort.sh`; a project overrides it). The title
|
|
@@ -99,15 +108,26 @@ The parent carries the rich narrative; the **PR** carries the human-facing revie
|
|
|
99
108
|
|
|
100
109
|
| Step | What |
|
|
101
110
|
|------|------|
|
|
102
|
-
| `effort-new` | parent issue (
|
|
103
|
-
| `effort-start <N>` | `effort/<N>` branch + worktree; board → In Progress |
|
|
111
|
+
| `effort-new` | parent issue (4-section body **filled** + `ctx/kind/priority/role/flow` labels) + native sub-issues, every title linted; optional `--slug` sets the handle |
|
|
112
|
+
| `effort-start <slug\|N>` | `effort/<N>` branch + worktree; board → In Progress |
|
|
104
113
|
| orchestrate | sub-issues in own worktrees (file-disjoint) → merge into `effort/<N>`; each closes + board Done as it lands |
|
|
105
|
-
| `effort-pr <N>` | ONE PR `effort/<N>` → main (rich body + `## For agents`) |
|
|
106
|
-
| `effort-close <N>` | **snapshot sub-diffs pre-squash** → merge → close parent + subs → board Done(all) → GC prune → kit-sync drift check |
|
|
114
|
+
| `effort-pr <slug\|N>` | ONE PR `effort/<N>` → main (rich body + `## For agents`) |
|
|
115
|
+
| `effort-close <slug\|N>` | **snapshot sub-diffs pre-squash** → merge → close parent + subs → board Done(all) → GC prune → kit-sync drift check |
|
|
107
116
|
|
|
108
117
|
Board + record state are correct **by construction** — the close op owns them. Never rely on a
|
|
109
118
|
separate, skippable "mark done" step.
|
|
110
119
|
|
|
120
|
+
## Slug handles (number stays canonical)
|
|
121
|
+
|
|
122
|
+
The issue **number** is the single source of truth — sub-issue links, PRs, labels, and `blocked_by`
|
|
123
|
+
all reference it. The **slug** is a *derived* human handle (the one in `effort/<N>-<slug>`), never a
|
|
124
|
+
parallel ID space. `effort-start`/`pr`/`close` accept `<slug|N>`: a pure-digits arg is the number,
|
|
125
|
+
anything else is resolved to the canonical number by matching `effort/*` branches (local + remote),
|
|
126
|
+
then the `slug:<slug>` label, then open effort titles. Unknown/ambiguous → structured error, no
|
|
127
|
+
guess. `effort-new --slug <s>` stores the handle as a `slug:<slug>` label; without it the slug is
|
|
128
|
+
derived from the title (with the `[Effort] N ·` prefix and `[Flow]` tag peeled, so the number is not
|
|
129
|
+
doubled into the slug). Efforts render as `slug #N`.
|
|
130
|
+
|
|
111
131
|
## Plans are issues, not files
|
|
112
132
|
|
|
113
133
|
The parent issue **is** the plan. Strategy / roadmap narrative lives in your knowledge base; the
|
|
@@ -100,6 +100,7 @@ Correct-option notes:
|
|
|
100
100
|
## Hooks (scaffolded into `.claude/settings.local.json`)
|
|
101
101
|
|
|
102
102
|
- **SessionStart** → `mempalace wake-up --wing {{WING}}` — injects palace context at session start. Uses `wake-up --wing` (explicit) rather than `mempalace hook run --hook session-start`, which derives the wing implicitly and could file into the wrong wing.
|
|
103
|
+
- **Per-wing header:** `wake-up` scopes the L1 *body* to `{{WING}}`, but its L0 identity *header* comes from the single global `~/.mempalace/identity.txt` and ignores the wing. So this project has its own, `cckit init` seeded **`.claude/mempal-identity.{{WING}}.txt`** (and `cckit doctor` re-seeds it if it goes missing); the hook swaps it in for the global L0 block. **Edit its `Stack:` line** to describe this project — it shows on every session wake-up. Delete the file to fall back to the global identity unchanged.
|
|
103
104
|
- **Stop** → files the finished session into `wing={{WING}}` (`mempalace mine … --mode convos`).
|
|
104
105
|
- **PreCompact** → safety-net sweep before context compression.
|
|
105
106
|
- **SessionEnd** → `mempal_followup.sh`: if the current branch has **unsynced work** (dirty tree or
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Plan-next — forward planning from the current state
|
|
2
|
+
|
|
3
|
+
cckit plans **forward from what already ships**. `cckit plan-next` (and the `/kit-plan-next` skill)
|
|
4
|
+
introspect the kit's CURRENT capability surface at runtime — skills, verbs/commands, rules, docs —
|
|
5
|
+
and propose what to build next, grounded in that inventory. This is the productized form of the
|
|
6
|
+
manual "given where we are, here is what to build next" triage.
|
|
7
|
+
|
|
8
|
+
> Two planners coexist, and they answer different questions. `cckit plan` / `/kit-next` order the
|
|
9
|
+
> issues that **already exist** (deps-ordered, file-disjoint waves). `cckit plan-next` proposes the
|
|
10
|
+
> issues that **don't exist yet**, derived from gaps in the current capability surface. Use plan-next
|
|
11
|
+
> to decide *what* to create; use plan / next to decide *in what order* to do the created work.
|
|
12
|
+
|
|
13
|
+
## Where it sits in the workflow
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
cckit plan-next → propose next efforts (grounded in current skills/verbs/rules/docs)
|
|
17
|
+
└─ /kit-plan-next → choose one with the human, hand off to:
|
|
18
|
+
└─ /kit-effort-new → scope it into a parent issue + sub-issues (effort-model.md)
|
|
19
|
+
└─ cckit plan / cckit next → order + drive the now-existing work
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
It is the front of the funnel: it feeds [`/kit-effort-new`](effort-model.md), which produces the
|
|
23
|
+
unit of work the rest of the lifecycle drives.
|
|
24
|
+
|
|
25
|
+
## The mandatory docs + README step (docs-always)
|
|
26
|
+
|
|
27
|
+
**Every plan plan-next emits carries a docs + README update step as rank 1 — non-negotiable, never
|
|
28
|
+
dropped, even for a tiny change.** Docs are part of "done," not a follow-up. When you scope a chosen
|
|
29
|
+
proposal into an effort, that effort MUST keep a docs + README sub-issue. The planner surfaces this
|
|
30
|
+
on every plan precisely so it cannot be forgotten; `/kit-effort-new` must preserve it.
|
|
31
|
+
|
|
32
|
+
## Grounded, not generative
|
|
33
|
+
|
|
34
|
+
The proposals are deterministic and derived from the inventory, not invented:
|
|
35
|
+
|
|
36
|
+
- **Coverage gaps** — skills or verbs that ship but are not referenced in any doc page become
|
|
37
|
+
"document X" proposals.
|
|
38
|
+
- **Thinnest area** — the capability area with the fewest entries becomes a "deepen X" proposal, so
|
|
39
|
+
there is always at least one concrete next effort beyond docs.
|
|
40
|
+
|
|
41
|
+
Run it from the cckit repo for a full inventory, or from a host project where the kit is installed —
|
|
42
|
+
there it degrades gracefully to whatever capability dirs exist (host docs only) and never crashes.
|
|
43
|
+
|
|
44
|
+
## Critical — context-anxiety rule
|
|
45
|
+
|
|
46
|
+
**The plan-next output is HUMAN / orchestrator-facing ONLY.** It must NEVER be injected into a
|
|
47
|
+
monitored model's prompt or context, and it is never wired into any agent's context automatically.
|
|
48
|
+
|
|
49
|
+
The thesis is the opposite of context-stuffing: planning that is *pre-grounded* in the current
|
|
50
|
+
docs/skills/rules means the EXECUTING agent burns fewer tokens rediscovering what the kit can do —
|
|
51
|
+
the plan informs the human/orchestrator's decision, then only the CHOSEN, scoped effort reaches an
|
|
52
|
+
agent. The plan itself is not agent-context fuel. The verb states this in its output footer; the
|
|
53
|
+
skill states it up front; both honor it.
|
|
54
|
+
|
|
55
|
+
## See also
|
|
56
|
+
|
|
57
|
+
- [effort-model.md](effort-model.md) — the unit of work a chosen proposal becomes.
|
|
58
|
+
- [plan-output-format.md](plan-output-format.md) — the format for any written "plan" deliverable.
|