@jeiemgi/cckit 0.1.7 → 0.2.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/bin/cckit +44 -0
- package/cckit.config.json +1 -1
- package/package.json +1 -1
- package/scripts/config-path-test.sh +32 -0
- package/scripts/copilot-loop-test.sh +162 -0
- package/scripts/init.sh +3 -0
- package/scripts/kit-version-check.sh +1 -1
- package/scripts/knowledge-lint.sh +1 -1
- package/scripts/lib/captain-test.sh +58 -0
- package/scripts/lib/captain.sh +181 -0
- package/scripts/lib/copilot-test.sh +30 -0
- package/scripts/lib/copilot.sh +101 -0
- package/scripts/lib/effort-metrics.sh +5 -5
- package/scripts/lib/kit-config.sh +6 -1
- package/scripts/lib/kit-gc.sh +3 -3
- package/scripts/lib/kit-task-ops-test.sh +2 -2
- package/scripts/lib/kit-task-ops.sh +2 -2
- package/scripts/lib/next.sh +75 -0
- package/scripts/lib/plan-machine-test.sh +72 -0
- package/scripts/lib/plan-machine.sh +260 -0
- package/scripts/lib/project-scan.sh +1 -1
- package/scripts/lib/render-test.sh +40 -0
- package/scripts/lib/render.sh +57 -0
- package/scripts/lib/worktree-start.sh +1 -1
- package/scripts/orchestrate.sh +4 -2
- package/skills/docs-writer/SKILL.md +135 -0
- package/skills/kit-next/SKILL.md +54 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# render-test.sh — self-test for render.sh under bash AND zsh.
|
|
3
|
+
# Network-free, TTY-free: covers width clamping, the markdown table composers, and the pipe-safety
|
|
4
|
+
# guarantee (non-TTY in == verbatim out). Run: bash scripts/lib/render-test.sh
|
|
5
|
+
|
|
6
|
+
dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
|
|
7
|
+
|
|
8
|
+
if [ -n "${RND_TEST_INNER:-}" ]; then
|
|
9
|
+
. "$dir/ui.sh"
|
|
10
|
+
. "$dir/render.sh"
|
|
11
|
+
fail=0
|
|
12
|
+
eq() { if [ "$2" != "$3" ]; then echo "FAIL($RND_TEST_INNER): $1 -> '[$2]', want '[$3]'"; fail=1; fi; }
|
|
13
|
+
|
|
14
|
+
# render_width — clamp to [40,120].
|
|
15
|
+
eq "width clamps high" "$(COLUMNS=999 render_width)" "120"
|
|
16
|
+
eq "width clamps low" "$(COLUMNS=5 render_width)" "40"
|
|
17
|
+
eq "width passes mid" "$(COLUMNS=90 render_width)" "90"
|
|
18
|
+
eq "width junk -> safe" "$( (COLUMNS=abc; unset TERM; render_width) | grep -qE '^[0-9]+$' && echo ok)" "ok"
|
|
19
|
+
|
|
20
|
+
# table composers.
|
|
21
|
+
eq "table row" "$(render_table_row '#76' 'M' 'plan')" "| #76 | M | plan |"
|
|
22
|
+
eq "table sep" "$(render_table_sep 3)" "| --- | --- | --- |"
|
|
23
|
+
eq "h1" "$(render_h1 'Title')" "# Title"
|
|
24
|
+
|
|
25
|
+
# pipe-safety: not a TTY here, so cckit_render must pass markdown through byte-for-byte.
|
|
26
|
+
md="$(printf '# H\n\n| a | b |\n')"
|
|
27
|
+
eq "render verbatim when piped" "$(printf '%s' "$md" | cckit_render)" "$md"
|
|
28
|
+
# explicit CCKIT_NO_GLOW also forces verbatim.
|
|
29
|
+
eq "render verbatim NO_GLOW" "$(printf '%s' "$md" | CCKIT_NO_GLOW=1 cckit_render)" "$md"
|
|
30
|
+
|
|
31
|
+
if [ "$fail" -eq 0 ]; then echo "PASS($RND_TEST_INNER): render seam"; fi
|
|
32
|
+
exit "$fail"
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
rc=0
|
|
36
|
+
for sh in bash zsh; do
|
|
37
|
+
command -v "$sh" >/dev/null 2>&1 || continue
|
|
38
|
+
RND_TEST_INNER="$sh" "$sh" "$0" || rc=1
|
|
39
|
+
done
|
|
40
|
+
exit "$rc"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# render.sh — the rendering seam: cckit's value-add for output (Effort 75 · #82, completes #9).
|
|
3
|
+
#
|
|
4
|
+
# cckit emits MARKDOWN. Two readers consume it:
|
|
5
|
+
# - Claude Code (and any agent transcript): markdown renders natively — tables, headings, code —
|
|
6
|
+
# so structured markdown IS the value-add. We just make sure verbs emit clean markdown.
|
|
7
|
+
# - A human terminal: `glow` renders that same markdown richly when stdout is a TTY; without glow,
|
|
8
|
+
# or when piped, the markdown passes through verbatim (still perfectly readable, still pipe-safe).
|
|
9
|
+
#
|
|
10
|
+
# One seam, every verb opts in: compose markdown with the helpers, pipe through `cckit_render`.
|
|
11
|
+
#
|
|
12
|
+
# cckit_render stdin markdown -> glow (TTY + glow) else verbatim (pipe-safe, always plain
|
|
13
|
+
# when not a terminal so machine consumers never see escape codes).
|
|
14
|
+
# render_h1 <text> a top sigil heading line.
|
|
15
|
+
# render_table_row … one markdown table row from N cells.
|
|
16
|
+
# render_rule a markdown horizontal rule.
|
|
17
|
+
#
|
|
18
|
+
# Depends on ui.sh (ui_tty). glow is optional; never required.
|
|
19
|
+
|
|
20
|
+
# render_width — target wrap width: COLUMNS if sane, else `tput cols`, else 100; clamped to [40,120]
|
|
21
|
+
# so rendered output fits a docs column / normal terminal and never sprawls.
|
|
22
|
+
render_width() {
|
|
23
|
+
local w="${COLUMNS:-}"
|
|
24
|
+
case "$w" in ''|*[!0-9]*) w="$(tput cols 2>/dev/null || echo 100)" ;; esac
|
|
25
|
+
case "$w" in ''|*[!0-9]*) w=100 ;; esac
|
|
26
|
+
[ "$w" -lt 40 ] && w=40
|
|
27
|
+
[ "$w" -gt 120 ] && w=120
|
|
28
|
+
printf '%s' "$w"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
# cckit_render — render markdown from stdin. Rich via glow only when interactive; otherwise verbatim.
|
|
32
|
+
# CCKIT_NO_GLOW=1 forces verbatim (tests, demos, when the caller wants raw markdown).
|
|
33
|
+
cckit_render() {
|
|
34
|
+
if [ -z "${CCKIT_NO_GLOW:-}" ] && command -v ui_tty >/dev/null 2>&1 && ui_tty \
|
|
35
|
+
&& command -v glow >/dev/null 2>&1; then
|
|
36
|
+
glow -w "$(render_width)" - 2>/dev/null || cat
|
|
37
|
+
else
|
|
38
|
+
cat
|
|
39
|
+
fi
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
render_h1() { printf '# %s\n' "$1"; }
|
|
43
|
+
render_rule() { printf '\n---\n'; }
|
|
44
|
+
|
|
45
|
+
# render_table_row <cell> [cell …] — a single markdown table row: | a | b | c |
|
|
46
|
+
render_table_row() {
|
|
47
|
+
local out="|"
|
|
48
|
+
for cell in "$@"; do out="$out $cell |"; done
|
|
49
|
+
printf '%s\n' "$out"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# render_table_sep <n> — the header separator row for an n-column markdown table.
|
|
53
|
+
render_table_sep() {
|
|
54
|
+
local n="$1" out="|" i=1
|
|
55
|
+
while [ "$i" -le "$n" ]; do out="$out --- |"; i=$((i + 1)); done
|
|
56
|
+
printf '%s\n' "$out"
|
|
57
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#
|
|
12
12
|
# Requires: gh, jq, git, scripts/lib/gh-project.sh (board update). bash 3.2 compatible.
|
|
13
13
|
|
|
14
|
-
WT_START_REPO="${WT_START_REPO:-
|
|
14
|
+
WT_START_REPO="${WT_START_REPO:-${KIT_REPO:-}}"
|
|
15
15
|
|
|
16
16
|
# _wt_set_port <app-env-file> <port> <issue-num> — append a per-worktree dev PORT to an app's
|
|
17
17
|
# .env.local, but only where one exists (i.e. the app is locally runnable). Idempotent: an existing
|
package/scripts/orchestrate.sh
CHANGED
|
@@ -60,8 +60,10 @@ case "$CAP" in ''|*[!0-9]*) echo "orchestrate: --cap needs a number (got '$CAP')
|
|
|
60
60
|
|
|
61
61
|
# Resolve the main worktree root + load config (repo + base branch drive everything).
|
|
62
62
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
63
|
-
ROOT="$(
|
|
64
|
-
|
|
63
|
+
ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" # cckit INSTALL root — for sourcing libs (works on brew/npm installs)
|
|
64
|
+
# The git-repo guard validates the INVOKING project ($PWD), not cckit's install dir; wt_start and
|
|
65
|
+
# load_kit_config below resolve the project + its config from the invoking directory.
|
|
66
|
+
git -C "$PWD" rev-parse --show-toplevel >/dev/null 2>&1 || { echo "orchestrate: not in a git repo" >&2; exit 1; }
|
|
65
67
|
# shellcheck source=/dev/null
|
|
66
68
|
source "$ROOT/scripts/lib/kit-config.sh" && load_kit_config
|
|
67
69
|
REPO="$KIT_REPO"
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-writer
|
|
3
|
+
description: >
|
|
4
|
+
Write and edit end-user documentation in the house voice: kind but robust, ADHD-oriented and
|
|
5
|
+
scannable, ZERO analogies, beginner-inclusive but expert-skippable. Encodes the page template
|
|
6
|
+
(title → one-line description → self-explanatory left-to-right diagram → body → next-section
|
|
7
|
+
buttons) and the diagram discipline (interactive, left-to-right, self-explanatory, never
|
|
8
|
+
repetitive). Use it to keep every docs page readable by people with low software knowledge
|
|
9
|
+
without watering down the substance.
|
|
10
|
+
when_to_use: >
|
|
11
|
+
When writing or editing any documentation page meant for humans — guides, getting-started,
|
|
12
|
+
concept pages, how-to pages, reference intros. Use it before drafting (to lay out the page) and
|
|
13
|
+
after drafting (to run the checklist). Not for code comments, commit messages, or PR bodies.
|
|
14
|
+
metadata:
|
|
15
|
+
version: 1.0.0
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# docs-writer — the house voice for human documentation
|
|
19
|
+
|
|
20
|
+
Documentation here is read by people with low software knowledge. It must still be correct and
|
|
21
|
+
complete for experts. The whole skill is one promise: **a beginner can follow the flow, and an
|
|
22
|
+
expert can skip to the part they need — on the same page.**
|
|
23
|
+
|
|
24
|
+
You write the page so both happen at once.
|
|
25
|
+
|
|
26
|
+
## The reader
|
|
27
|
+
|
|
28
|
+
- The lowest-baseline reader has barely used a terminal. Write so they are never lost.
|
|
29
|
+
- The expert reader knows git, PRs, and agents. Write so they can skip past the basics in seconds.
|
|
30
|
+
- Both read the same page. You do not fork the docs by skill level — you **structure** the page so
|
|
31
|
+
the basic material is clearly marked and easy to scroll past.
|
|
32
|
+
|
|
33
|
+
## Voice rules (non-negotiable)
|
|
34
|
+
|
|
35
|
+
1. **No analogies. Ever.** Do not say "think of it like…", "it's basically a…", "imagine a…".
|
|
36
|
+
Explain the actual thing in plain words. If a sentence starts to compare the topic to something
|
|
37
|
+
else, delete it and describe the topic directly.
|
|
38
|
+
2. **Kind but robust.** Warm, plain, encouraging — and still precise. Kindness is short sentences
|
|
39
|
+
and no jargon-dumping, not vagueness. Never sacrifice a correct detail to sound friendly.
|
|
40
|
+
3. **Not "so technical."** Use the plain word over the insider word. When a technical term is
|
|
41
|
+
unavoidable, define it in one short clause the first time it appears, then use it freely.
|
|
42
|
+
4. **ADHD-oriented.** One idea per paragraph. Short paragraphs (1–3 sentences). Front-load the
|
|
43
|
+
point — the first words of every paragraph, bullet, and heading carry the meaning. Generous
|
|
44
|
+
headings so the page is skimmable. No walls of text.
|
|
45
|
+
5. **Lead with the verb / the outcome.** "Open a pull request to…" beats "In order to be able to
|
|
46
|
+
open a pull request, you will…". Cut "in order to", "simply", "just", "basically", "of course".
|
|
47
|
+
6. **Show, don't promise.** Prefer a real command, a real screenshot, a real diagram over a
|
|
48
|
+
paragraph describing one.
|
|
49
|
+
|
|
50
|
+
## The page template
|
|
51
|
+
|
|
52
|
+
Every page follows this order, top to bottom:
|
|
53
|
+
|
|
54
|
+
1. **Title** — the name of the thing or the task. Plain. No cleverness.
|
|
55
|
+
2. **One-line description** — a single sentence under the title saying what this page lets the
|
|
56
|
+
reader do or understand. This is the whole page in one breath.
|
|
57
|
+
3. **Self-explanatory diagram** — a left-to-right diagram of the flow, placed high on the page,
|
|
58
|
+
that a reader could understand with the title alone. See *Diagram discipline* below. If the
|
|
59
|
+
page has no flow worth drawing, skip this — do not force a diagram.
|
|
60
|
+
4. **The body** — the rest of the docs: concepts, steps, the how and the why, and inline
|
|
61
|
+
**links to learn** more (definitions, deeper pages, external references). This is where the
|
|
62
|
+
beginner-only material lives, clearly headed so experts scroll past it.
|
|
63
|
+
5. **Next-section buttons** — at the bottom, one or two clear buttons to the next step(s) in the
|
|
64
|
+
journey. Never leave the reader at a dead end.
|
|
65
|
+
|
|
66
|
+
Hold the order. Title, then the one-liner, then the picture, then the words, then the way out.
|
|
67
|
+
|
|
68
|
+
### Skeleton
|
|
69
|
+
|
|
70
|
+
```mdx
|
|
71
|
+
# <Plain title>
|
|
72
|
+
|
|
73
|
+
<One sentence: what you can do or understand after this page.>
|
|
74
|
+
|
|
75
|
+
<FlowDiagram .../> {/* left-to-right, self-explanatory, only if there's a flow */}
|
|
76
|
+
|
|
77
|
+
## <First concept — front-loaded heading>
|
|
78
|
+
<Short paragraph. One idea. Plain words. A [link to learn](…) where useful.>
|
|
79
|
+
|
|
80
|
+
## <Steps, if this is a how-to>
|
|
81
|
+
<Steps component: 1, 2, 3 — one action each.>
|
|
82
|
+
|
|
83
|
+
> [!NOTE]
|
|
84
|
+
> <Beginner aside: a basic point experts can skip, clearly marked.>
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
<Next-section buttons: → Next step · → Related concept>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Diagram discipline
|
|
91
|
+
|
|
92
|
+
- **Interactive, left-to-right.** Diagrams are interactive (React Flow / SVG) and flow left to
|
|
93
|
+
right, following how the reader reads.
|
|
94
|
+
- **Self-explanatory.** A diagram must make sense from the page title alone — labels are plain
|
|
95
|
+
words, the arrows tell the story, no legend required to grasp the shape.
|
|
96
|
+
- **Diagram the flow, not the prose.** Draw a flow when seeing it is faster than reading it:
|
|
97
|
+
sequences, branches, parallel work, lifecycles. Do not draw a diagram that just restates a
|
|
98
|
+
sentence.
|
|
99
|
+
- **Never repetitive.** If two pages share a flow, draw it once on the most relevant page and link
|
|
100
|
+
to it from the other. The same diagram should not appear twice.
|
|
101
|
+
- **Pair with steps, don't duplicate them.** The diagram shows the shape; a Steps list gives the
|
|
102
|
+
exact actions. They complement each other — they do not repeat each other word for word.
|
|
103
|
+
|
|
104
|
+
## Scannability mechanics
|
|
105
|
+
|
|
106
|
+
- Headings every few paragraphs. A reader scanning only the headings should still get the gist.
|
|
107
|
+
- Bold the **lead word** of a bullet when the bullets are a list of distinct things.
|
|
108
|
+
- Lists over prose for anything enumerable (steps, options, requirements).
|
|
109
|
+
- Callouts for the things that interrupt: a NOTE for "good to know", a CAUTION for "this can bite
|
|
110
|
+
you", a TIP for a shortcut. Use them sparingly so they keep their weight.
|
|
111
|
+
- Code and commands in code blocks, never inline-buried in a paragraph.
|
|
112
|
+
- One screen, one idea: if a section runs long, it is probably two sections.
|
|
113
|
+
|
|
114
|
+
## Beginner-inclusive, expert-skippable
|
|
115
|
+
|
|
116
|
+
- Put the absolute-basics content (what a terminal is, how to run a command, what a branch is) in
|
|
117
|
+
its own clearly-headed section or aside, so an expert sees the heading and scrolls past in one
|
|
118
|
+
motion.
|
|
119
|
+
- Never make the expert read the basics to reach the substance. Never make the beginner hunt for
|
|
120
|
+
the basics because they were assumed away.
|
|
121
|
+
- Mark the entry point. If a section is "start here for total beginners", say so in the heading.
|
|
122
|
+
|
|
123
|
+
## Before you finish — checklist
|
|
124
|
+
|
|
125
|
+
- [ ] Title is plain; the one-line description says what the page delivers.
|
|
126
|
+
- [ ] If there's a flow, a left-to-right self-explanatory diagram sits near the top — and it is
|
|
127
|
+
not a redrawn paragraph.
|
|
128
|
+
- [ ] **Zero analogies.** Re-read every sentence that compares the topic to anything else; rewrite
|
|
129
|
+
it to describe the topic directly.
|
|
130
|
+
- [ ] Every technical term is defined the first time, in one clause.
|
|
131
|
+
- [ ] Paragraphs are short and front-loaded; the page is skimmable by headings alone.
|
|
132
|
+
- [ ] Beginner-only material is clearly headed so experts can skip it.
|
|
133
|
+
- [ ] No "simply", "just", "basically", "in order to", "of course".
|
|
134
|
+
- [ ] Next-section buttons at the bottom — no dead end.
|
|
135
|
+
- [ ] A reader with low software knowledge could follow the flow start to finish.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kit-next
|
|
3
|
+
description: >
|
|
4
|
+
The everyday cckit loop: find the next unblocked issue and pick it up, or fan the whole unblocked
|
|
5
|
+
wave out to subagents. Wraps `cckit next` (what can I work on now?), `cckit start <N>` (isolated
|
|
6
|
+
worktree + branch), `cckit copilot` (parallel fan-out), and `cckit watch` (gate + merge PRs).
|
|
7
|
+
when_to_use: >
|
|
8
|
+
When you sit down to work and want the next thing to do, when you finish an issue and need the
|
|
9
|
+
next one, or when you want to parallelize the unblocked wave. Not for planning an effort
|
|
10
|
+
(/kit-effort-new) or for a one-off task you already have in hand.
|
|
11
|
+
metadata:
|
|
12
|
+
version: 1.0.0
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# kit-next — the everyday loop
|
|
16
|
+
|
|
17
|
+
Answer one question fast: **what should I work on right now, and how do I start it?**
|
|
18
|
+
|
|
19
|
+
## Pick up the next issue
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
cckit next
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Prints the unblocked set (wave 0 of the plan) and the single recommended next issue with its start
|
|
26
|
+
command. `--effort <N>` scopes it to one effort's sub-issues.
|
|
27
|
+
|
|
28
|
+
Then start the top one in its own worktree + branch:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
cckit start <N>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Implement it, run `bash scripts/check.sh` until green, open the PR with `cckit pr <N> "<summary>"`
|
|
35
|
+
(or close a no-op with `cckit close <N> "<reason>"`), then run `cckit next` again.
|
|
36
|
+
|
|
37
|
+
## Or fan the whole wave out
|
|
38
|
+
|
|
39
|
+
When the unblocked issues are file-disjoint and independent, drive them in parallel instead of one
|
|
40
|
+
at a time:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
cckit copilot # emits a Task-subagent fan-out brief for wave 0
|
|
44
|
+
cckit watch --merge # gate every open PR; squash-merge the CLEAN ones; advance the next wave
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`cckit watch --loop` lets the captain self-pace the gate/merge passes until steady state.
|
|
48
|
+
|
|
49
|
+
## Surface it automatically (optional)
|
|
50
|
+
|
|
51
|
+
To see the next issue every time a session starts, add a `SessionStart` hook that runs
|
|
52
|
+
`cckit next` (or `cckit next --effort <N>`). Keep it opt-in — it prints on every new session, so
|
|
53
|
+
only wire it on repos where you want that nudge. See the Claude Code hooks docs for the
|
|
54
|
+
`SessionStart` event shape.
|