@jeiemgi/cckit 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/.claude-plugin/plugin.json +22 -0
  2. package/AGENTS.md +101 -0
  3. package/LICENSE-APACHE +202 -0
  4. package/LICENSE-MIT +21 -0
  5. package/README.md +143 -0
  6. package/SECURITY.md +22 -0
  7. package/bin/cckit +215 -0
  8. package/cckit.config.json +34 -0
  9. package/commands/kit-add.md +42 -0
  10. package/commands/kit-docs.md +45 -0
  11. package/commands/kit-doctor.md +52 -0
  12. package/commands/kit-export-project.md +58 -0
  13. package/commands/kit-export-training.md +49 -0
  14. package/commands/kit-init.md +126 -0
  15. package/commands/kit-routines.md +59 -0
  16. package/commands/kit-update.md +132 -0
  17. package/docs/kit-annotate/01-explainer.html +225 -0
  18. package/docs/kit-annotate/02-implementation-plan.html +196 -0
  19. package/docs/media/.onboarding-capture.cast +5 -0
  20. package/docs/media/README.md +43 -0
  21. package/docs/media/build-demo.sh +63 -0
  22. package/docs/media/build-kit-init.sh +51 -0
  23. package/docs/media/build-onboarding.sh +51 -0
  24. package/docs/media/kit-dry-run.cast +107 -0
  25. package/docs/media/kit-dry-run.gif +0 -0
  26. package/docs/media/kit-init.cast +56 -0
  27. package/docs/media/kit-init.gif +0 -0
  28. package/docs/media/kit-onboarding.cast +148 -0
  29. package/docs/media/kit-onboarding.gif +0 -0
  30. package/githooks/pre-commit +18 -0
  31. package/kit.config.schema.json +105 -0
  32. package/package.json +54 -0
  33. package/privacy-denylist.example +8 -0
  34. package/profiles/automation.json +36 -0
  35. package/profiles/content.json +41 -0
  36. package/profiles/minimal.json +31 -0
  37. package/profiles/research.json +37 -0
  38. package/profiles/software.json +32 -0
  39. package/scripts/annotate-setup.sh +149 -0
  40. package/scripts/autopilot.sh +50 -0
  41. package/scripts/capture-project-ids.sh +53 -0
  42. package/scripts/check.sh +66 -0
  43. package/scripts/contribute.sh +48 -0
  44. package/scripts/debug.sh +54 -0
  45. package/scripts/init-upgrade-test.sh +99 -0
  46. package/scripts/init.sh +827 -0
  47. package/scripts/install.sh +24 -0
  48. package/scripts/kit-add-test.sh +62 -0
  49. package/scripts/kit-add.sh +115 -0
  50. package/scripts/kit-adopt-test.sh +61 -0
  51. package/scripts/kit-adopt.sh +122 -0
  52. package/scripts/kit-bump-version.sh +79 -0
  53. package/scripts/kit-digest.sh +126 -0
  54. package/scripts/kit-doctor.sh +663 -0
  55. package/scripts/kit-export-project-test.sh +82 -0
  56. package/scripts/kit-export-project.sh +245 -0
  57. package/scripts/kit-export-training-test.sh +51 -0
  58. package/scripts/kit-export-training.sh +175 -0
  59. package/scripts/kit-migrate-test.sh +80 -0
  60. package/scripts/kit-migrate.sh +190 -0
  61. package/scripts/kit-onboard-test.sh +63 -0
  62. package/scripts/kit-onboard.sh +69 -0
  63. package/scripts/kit-promote-test.sh +54 -0
  64. package/scripts/kit-promote.sh +102 -0
  65. package/scripts/kit-remove-test.sh +61 -0
  66. package/scripts/kit-remove.sh +84 -0
  67. package/scripts/kit-routines.sh +322 -0
  68. package/scripts/kit-version-check.sh +91 -0
  69. package/scripts/kit-wire-test.sh +54 -0
  70. package/scripts/kit-wire.sh +132 -0
  71. package/scripts/knowledge-lint.sh +96 -0
  72. package/scripts/lib/cckit-output.sh +36 -0
  73. package/scripts/lib/effort-metrics.sh +452 -0
  74. package/scripts/lib/effort-ops-test.sh +83 -0
  75. package/scripts/lib/effort-ops.sh +132 -0
  76. package/scripts/lib/effort-plan.sh +104 -0
  77. package/scripts/lib/effort.sh +191 -0
  78. package/scripts/lib/engine-adapter.sh +92 -0
  79. package/scripts/lib/gh-log.sh +58 -0
  80. package/scripts/lib/gh-project.sh +212 -0
  81. package/scripts/lib/handoff.sh +35 -0
  82. package/scripts/lib/kit-cli-test.sh +42 -0
  83. package/scripts/lib/kit-cli.sh +32 -0
  84. package/scripts/lib/kit-config-resolve.sh +145 -0
  85. package/scripts/lib/kit-config.sh +88 -0
  86. package/scripts/lib/kit-engine-test.sh +107 -0
  87. package/scripts/lib/kit-events.sh +62 -0
  88. package/scripts/lib/kit-gc.sh +117 -0
  89. package/scripts/lib/kit-interview-test.sh +77 -0
  90. package/scripts/lib/kit-interview.sh +203 -0
  91. package/scripts/lib/kit-local.sh +79 -0
  92. package/scripts/lib/kit-manifest.sh +127 -0
  93. package/scripts/lib/kit-mode-test.sh +49 -0
  94. package/scripts/lib/kit-mode.sh +67 -0
  95. package/scripts/lib/kit-operate.sh +105 -0
  96. package/scripts/lib/kit-profile-test.sh +62 -0
  97. package/scripts/lib/kit-profile.sh +115 -0
  98. package/scripts/lib/kit-task-ops-test.sh +63 -0
  99. package/scripts/lib/kit-task-ops.sh +341 -0
  100. package/scripts/lib/pr-evidence.sh +173 -0
  101. package/scripts/lib/project-scan.sh +16 -0
  102. package/scripts/lib/react-detect.sh +78 -0
  103. package/scripts/lib/role-identity.sh +47 -0
  104. package/scripts/lib/secret-guard.sh +96 -0
  105. package/scripts/lib/toon.sh +35 -0
  106. package/scripts/lib/ui.sh +42 -0
  107. package/scripts/lib/version-bump.sh +59 -0
  108. package/scripts/lib/worktree-issue-test.sh +45 -0
  109. package/scripts/lib/worktree-issue.sh +73 -0
  110. package/scripts/lib/worktree-start.sh +280 -0
  111. package/scripts/orchestrate.sh +160 -0
  112. package/scripts/portable-test.sh +53 -0
  113. package/scripts/publish.sh +94 -0
  114. package/scripts/setup-labels.sh +25 -0
  115. package/scripts/setup-milestones.sh +17 -0
  116. package/scripts/showcase.sh +64 -0
  117. package/scripts/status.sh +44 -0
  118. package/scripts/task-sync.sh +59 -0
  119. package/scripts/test.sh +48 -0
  120. package/scripts/web-install.sh +22 -0
  121. package/skills/kit-annotate/SKILL.md +107 -0
  122. package/skills/kit-autopilot/SKILL.md +108 -0
  123. package/skills/kit-contribute/SKILL.md +134 -0
  124. package/skills/kit-customize/SKILL.md +134 -0
  125. package/skills/kit-dev/SKILL.md +67 -0
  126. package/skills/kit-digest/SKILL.md +41 -0
  127. package/skills/kit-effort-close/SKILL.md +156 -0
  128. package/skills/kit-effort-new/SKILL.md +173 -0
  129. package/skills/kit-effort-pr/SKILL.md +139 -0
  130. package/skills/kit-effort-start/SKILL.md +85 -0
  131. package/skills/kit-gc/SKILL.md +80 -0
  132. package/skills/kit-onboard/SKILL.md +50 -0
  133. package/skills/kit-security-sweep/SKILL.md +57 -0
  134. package/skills/kit-ship/SKILL.md +43 -0
  135. package/skills/kit-task-close/SKILL.md +66 -0
  136. package/skills/kit-task-new/SKILL.md +51 -0
  137. package/skills/kit-task-pr/SKILL.md +43 -0
  138. package/skills/kit-task-pr-auto/SKILL.md +27 -0
  139. package/skills/kit-task-pr-merge/SKILL.md +53 -0
  140. package/skills/kit-task-start/SKILL.md +76 -0
  141. package/skills/kit-task-sync/SKILL.md +37 -0
  142. package/templates/CLAUDE.md.tmpl +106 -0
  143. package/templates/agents/analyst.md +55 -0
  144. package/templates/agents/auto-dev.md +93 -0
  145. package/templates/agents/backend.md +59 -0
  146. package/templates/agents/designer.md +73 -0
  147. package/templates/agents/devops.md +57 -0
  148. package/templates/agents/editor.md +48 -0
  149. package/templates/agents/frontend.md +81 -0
  150. package/templates/agents/generalist.md +46 -0
  151. package/templates/agents/local-delegate.md +70 -0
  152. package/templates/agents/n8n.md +65 -0
  153. package/templates/agents/pm.md +69 -0
  154. package/templates/agents/qa.md +66 -0
  155. package/templates/agents/researcher.md +57 -0
  156. package/templates/agents/security.md +65 -0
  157. package/templates/agents/tech-lead.md +75 -0
  158. package/templates/hooks/guard-base-branch-commit.sh.tmpl +45 -0
  159. package/templates/hooks/kit-local-status.sh.tmpl +34 -0
  160. package/templates/hooks/kit_version_check.sh.tmpl +6 -0
  161. package/templates/hooks/mempal_followup.sh.tmpl +97 -0
  162. package/templates/hooks/mempal_precompact.sh.tmpl +4 -0
  163. package/templates/hooks/mempal_save.sh.tmpl +4 -0
  164. package/templates/hooks/mempal_session_start.sh.tmpl +8 -0
  165. package/templates/hooks/prepush_gate.sh.tmpl +36 -0
  166. package/templates/hooks/repo-hygiene.sh.tmpl +72 -0
  167. package/templates/kit.config.json.tmpl +32 -0
  168. package/templates/knowledge-INDEX.md.tmpl +12 -0
  169. package/templates/lib/kit-sigil.sh.tmpl +124 -0
  170. package/templates/rules/branch-naming.md +104 -0
  171. package/templates/rules/communication-style.md +22 -0
  172. package/templates/rules/delegation-brief.md +40 -0
  173. package/templates/rules/design-routing.md +35 -0
  174. package/templates/rules/effort-model.md +122 -0
  175. package/templates/rules/knowledge-base.md +41 -0
  176. package/templates/rules/mempalace.md +110 -0
  177. package/templates/rules/plan-output-format.md +58 -0
  178. package/templates/rules/react-annotate.md +69 -0
  179. package/templates/rules/risk-tiered-review.md +62 -0
  180. package/templates/rules/skill-gaps.md +48 -0
  181. package/templates/rules/task-management.md +42 -0
  182. package/templates/settings/settings.local.json.tmpl +27 -0
  183. package/templates/skills/NAMESPACED +13 -0
  184. package/templates/skills/copywriting/SKILL.md +252 -0
  185. package/templates/skills/copywriting/references/copy-frameworks.md +344 -0
  186. package/templates/skills/copywriting/references/natural-transitions.md +272 -0
  187. package/templates/skills/feature-build-refine/SKILL.md +367 -0
  188. package/templates/skills/karpathy-guidelines/SKILL.md +69 -0
  189. package/templates/skills/morning-briefing/SKILL.md +46 -0
  190. package/templates/skills/speckit/SKILL.md +239 -0
  191. package/templates/skills/supabase-patterns/SKILL.md +88 -0
@@ -0,0 +1,59 @@
1
+ ---
2
+ description: Manage suggested scheduled routines for this project — browse the catalogue, accept one or more, or remove them. The kit SUGGESTS; you decide; nothing is wired without your opt-in.
3
+ argument-hint: '[list | accept <id> | remove <id> | verify]'
4
+ allowed-tools: Bash, Read, AskUserQuestion
5
+ ---
6
+
7
+ # /kit-routines — suggested routine catalogue
8
+
9
+ Plugin-direct command. Engine at `${CLAUDE_PLUGIN_ROOT}/scripts/kit-routines.sh`.
10
+
11
+ The kit ships a set of **suggested routines** (briefing, board sweep, GC, knowledge-lint,
12
+ kit-wire-check, security-sweep). Each is an OS cron job scoped to this project. Nothing is
13
+ created without your explicit opt-in — the kit suggests, you accept.
14
+
15
+ ## Steps
16
+
17
+ ### No argument (or `list`)
18
+
19
+ 1. Run `scripts/kit-routines.sh list` and display the catalogue table.
20
+ 2. For each routine mark it `accepted` (already in crontab) or `available`.
21
+ 3. Offer to accept any available ones via `AskUserQuestion` — one batched ask.
22
+ 4. For each accepted id run `scripts/kit-routines.sh accept <id>`.
23
+ 5. Report what changed.
24
+
25
+ ### `accept <id>`
26
+
27
+ Run `scripts/kit-routines.sh accept <id>` (interactive confirm unless `KIT_ASSUME_YES`).
28
+ Reports the cron expression and command that will be added before doing anything.
29
+
30
+ ### `remove <id>`
31
+
32
+ Run `scripts/kit-routines.sh remove <id>`.
33
+ Removes the crontab entry and clears the id from `kit.config.json`.
34
+
35
+ ### `verify`
36
+
37
+ Run `scripts/kit-routines.sh verify`. Reports which accepted routines have their cron entry
38
+ installed and flags any that are missing (drift from a manual crontab edit or machine change).
39
+
40
+ ## Catalogue
41
+
42
+ | ID | Cadence | Cost | Description |
43
+ | ---------------- | ------------ | ------ | --------------------------------------------------- |
44
+ | `briefing` | Mon–Fri 8am | low | Morning briefing — open issues, board state |
45
+ | `board-sweep` | Mon–Fri 8:30 | low | Orphan issues, stale In-Progress, merged-not-closed |
46
+ | `gc` | Mon 9am | low | Repo GC dry-run — merged branches/worktrees report |
47
+ | `knowledge-lint` | Tue 9am | low | knowledge/ frontmatter + INDEX + live refs |
48
+ | `kit-wire-check` | Mon 10am | low | Kit wiring drift (statusline shim, hooks, crons) |
49
+ | `security-sweep` | Wed 9am | medium | Dep CVE scan (npm audit / pip-audit / cargo audit) |
50
+
51
+ ## Rules
52
+
53
+ - The kit NEVER auto-accepts a routine — every opt-in requires an explicit user confirm.
54
+ - `kit-remove` (uninstall) calls `remove-all` automatically — leaving no orphan crons.
55
+ - `kit-wire --check` (SessionStart self-heal) calls `verify` — reports drift if a cron
56
+ entry disappears from the crontab without a `kit-routines remove`.
57
+ - Accepted routine ids are stored in `kit.config.json` `.routines[]` (manifest-tracked).
58
+ - Routines requiring the `software` module (`board-sweep`, `gc`, `security-sweep`) show a
59
+ note when that module is not active for this project.
@@ -0,0 +1,132 @@
1
+ ---
2
+ description: Bring a kit-scaffolded project up to the latest claude-kit — shows the changelog delta and merge-upgrades the project's .claude/ without clobbering your customizations.
3
+ argument-hint: "[--check] [--dry-run]"
4
+ allowed-tools: Bash, Read, AskUserQuestion, Edit
5
+ ---
6
+
7
+ # /kit-update — update this project to the latest claude-kit
8
+
9
+ The kit lives at `${CLAUDE_PLUGIN_ROOT}`. This surfaces what changed since this project was last
10
+ scaffolded and **merges** new features in — preserving your edits. Re-running is safe.
11
+
12
+ ## Steps
13
+
14
+ ### 0. Pre-flight safety checks (run these before everything else — abort on failure)
15
+
16
+ **a) Dirty working tree guard.**
17
+
18
+ Run:
19
+ ```bash
20
+ git -C "$PWD" status --porcelain 2>/dev/null
21
+ ```
22
+
23
+ If there is any output (staged, unstaged, or untracked changes), **stop immediately** and
24
+ tell the user:
25
+
26
+ > "working tree is dirty -- commit, stash, or discard before running /kit-update"
27
+
28
+ Write nothing. Do not show the changelog. Do not proceed. The underlying `init.sh --upgrade`
29
+ enforces the same check, but surfacing it here avoids wasted steps. The check is a safe no-op
30
+ when `$PWD` is not a git repo (no git binary, detached context, etc.) — skip silently in that case.
31
+
32
+ **b) Plugin source staleness check.**
33
+
34
+ Detect whether the plugin source directory (`${CLAUDE_PLUGIN_ROOT}`) is behind its own
35
+ `origin` remote. This is best-effort — skip silently if git is unavailable, there is no remote,
36
+ or the network is unreachable.
37
+
38
+ ```bash
39
+ # 1. Verify the source is inside a git repo.
40
+ git -C "${CLAUDE_PLUGIN_ROOT}" rev-parse --git-dir >/dev/null 2>&1 || echo "no-git"
41
+
42
+ # 2. Resolve the integration branch (prefer the remote HEAD, fall back to develop).
43
+ _branch="$(git -C "${CLAUDE_PLUGIN_ROOT}" symbolic-ref refs/remotes/origin/HEAD 2>/dev/null \
44
+ | sed 's|refs/remotes/origin/||')"
45
+ [ -z "$_branch" ] && _branch="develop"
46
+
47
+ # 3. Fetch quietly (failures are non-fatal — the check is best-effort).
48
+ git -C "${CLAUDE_PLUGIN_ROOT}" fetch origin "$_branch" --quiet 2>/dev/null || true
49
+
50
+ # 4. Count commits the source is behind.
51
+ _behind="$(git -C "${CLAUDE_PLUGIN_ROOT}" rev-list --count HEAD.."origin/$_branch" 2>/dev/null || echo 0)"
52
+ ```
53
+
54
+ If `_behind` > 0:
55
+
56
+ - Print a prominent warning (ASCII only, no emoji):
57
+ > "[warn] plugin source is $_behind commit(s) behind origin/$_branch -- you may be installing an older version of claude-kit"
58
+ > "Update the source first: git -C ${CLAUDE_PLUGIN_ROOT} pull then re-run /kit-update."
59
+ - Use `AskUserQuestion` to ask:
60
+ - **Abort** (recommended) — stop here so the user can update the plugin source
61
+ - **Continue with stale source** — proceed anyway (risk: may downgrade the project)
62
+ - In non-interactive or CI contexts where `AskUserQuestion` is unavailable, **abort** and print
63
+ the warning above.
64
+ - If the user chooses Abort or the context is non-interactive: stop, write nothing.
65
+ - If the user explicitly chooses to continue: proceed with a final reminder that files may
66
+ be older than what is on origin.
67
+
68
+ If `_behind` is 0, or the git check cannot be completed for any reason, continue silently.
69
+
70
+ **c) Home-repo + downgrade guard.** `/kit-update` is for **consumer** projects (pull the kit into
71
+ my `.claude/`). It must never run in claude-kit's **own home repo** (where the kit is developed
72
+ in-tree) nor **downgrade**:
73
+
74
+ ```bash
75
+ # Home repo? (the kit's source lives here — editing it via /kit-update is a category error)
76
+ [ -f "$PWD/packages/claude-kit-plugin/.claude-plugin/plugin.json" ] && echo "home-repo"
77
+ # Same version? (nothing to add)
78
+ _have="$(jq -r '.kitVersion // "0.0.0"' "$PWD/.claude/kit.config.json" 2>/dev/null)"
79
+ _plug="$(jq -r '.version // "0.0.0"' "/Users/josegutierrezdelgado/.claude/plugins/cache/claude-kit-marketplace/claude-kit/0.7.0-beta.6/.claude-plugin/plugin.json" 2>/dev/null)"
80
+ [ "$_have" = "$_plug" ] && echo "same-version"
81
+ ```
82
+
83
+ - If `home-repo`: **stop.** Tell the user: *"this IS claude-kit's home repo — edit
84
+ `packages/claude-kit-plugin/` directly and open a normal PR; `/kit-update` is for consumer
85
+ projects."* Write nothing.
86
+ - If `same-version` (and not behind): **stop** — "already at $_plug, nothing to upgrade." To pull a
87
+ newer release, refresh the plugin cache (`claude plugin update`), not `/kit-update`.
88
+ - `init.sh --upgrade` enforces both as a backstop, but surfacing them here avoids wasted steps.
89
+
90
+ 1. **Check versions.** Run:
91
+ ```bash
92
+ "${CLAUDE_PLUGIN_ROOT}/scripts/kit-version-check.sh" --target "$PWD" --plugin-root "${CLAUDE_PLUGIN_ROOT}"
93
+ ```
94
+ Compare the project's `.claude/kit.config.json` `.kitVersion` with the installed
95
+ `${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json` `.version`. If equal, say "you're up to date" and
96
+ stop — unless `--check`/`--dry-run` was passed, then continue to preview.
97
+
98
+ 2. **Show the changelog delta — make it feel good, not behind.** Read
99
+ `${CLAUDE_PLUGIN_ROOT}/CHANGELOG.md` and summarize, in plain language, the entries between the
100
+ project's version and the installed version: the new commands/skills/rules/config, what each
101
+ unlocks, and the exact command to try it (e.g. `/kit-annotate`). Lead with the value.
102
+
103
+ 3. **Preview the upgrade (always).** Run:
104
+ ```bash
105
+ "${CLAUDE_PLUGIN_ROOT}/scripts/init.sh" --upgrade --target "$PWD" --dry-run
106
+ ```
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 and
109
+ `kit.config.json` values are never overwritten.
110
+
111
+ 4. **Confirm, then apply.** Ask with `AskUserQuestion`: **Apply update** · **Preview only** · **Skip**.
112
+ Per the CLI-style preference, when the delta is purely additive (only new files, nothing preserved
113
+ would conflict) you may offer to **apply automatically**. On apply:
114
+ ```bash
115
+ "${CLAUDE_PLUGIN_ROOT}/scripts/init.sh" --upgrade --target "$PWD"
116
+ ```
117
+
118
+ 5. **Report + onboard.** Echo what was **added** vs **preserved** and the new `.kitVersion`. Then warmly
119
+ walk the user through the headline new features and offer to run any that fit this project (e.g.
120
+ "this release adds `/kit-annotate` — want me to set it up?"). The goal is comfort with the new
121
+ surface, not a changelog dump.
122
+
123
+ ## Rules
124
+
125
+ - **Never clobber.** Upgrade only ADDS missing files and MERGES new `kit.config.json` keys; existing
126
+ files and config values are preserved. Always show the `--dry-run` preview before applying.
127
+ - When reporting effective configuration, honor per-folder `.claudekit/config.json` overrides
128
+ (nearest-wins) — see `scripts/lib/kit-config.sh`.
129
+ - Don't fabricate changelog content — read `CHANGELOG.md`. If the project predates version tracking
130
+ (`kitVersion` missing or `0.1.0`), treat everything in the changelog as new.
131
+ - **Messages use ASCII/sigil glyphs only** — no emoji characters. Use `x ` for errors, `[warn]` for
132
+ warnings, `->` for actions.
@@ -0,0 +1,225 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>kit-annotate — what it is &amp; how to use it</title>
7
+ <style>
8
+ :root{
9
+ --bg:#fbfbfd;--ink:#1d1d22;--muted:#6b6b78;--line:#e6e6ee;--accent:#5b6cff;--accent-soft:#eef0ff;
10
+ --concept:#2563eb;--concept-bg:#eff6ff;--why:#0f9d6b;--why-bg:#eafaf3;
11
+ --gotcha:#c2410c;--gotcha-bg:#fff4ec;--analogy:#7c3aed;--analogy-bg:#f5efff;--decision:#0e7490;--decision-bg:#ecfbfe;
12
+ --code-bg:#0f1222;--code-ink:#e6e7f0;--max:880px;
13
+ }
14
+ *{box-sizing:border-box}html{scroll-behavior:smooth}
15
+ body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}
16
+ a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}
17
+ .wrap{display:grid;grid-template-columns:240px 1fr;max-width:1240px;margin:0 auto}
18
+ nav{position:sticky;top:0;align-self:start;height:100vh;overflow:auto;padding:28px 18px 60px;border-right:1px solid var(--line);font-size:13.5px}
19
+ nav .brand{font-weight:700;font-size:15px;letter-spacing:-.2px}nav .brand small{display:block;font-weight:500;color:var(--muted);font-size:12px;margin-top:3px}
20
+ nav ol{list-style:none;margin:18px 0 0;padding:0;counter-reset:s}nav li{margin:2px 0}
21
+ nav a{display:block;color:var(--muted);padding:5px 9px;border-radius:7px;counter-increment:s}
22
+ nav a::before{content:counter(s)". ";color:#b7b7c6}
23
+ nav a:hover{background:var(--accent-soft);color:var(--ink);text-decoration:none}
24
+ nav a.active{background:var(--accent);color:#fff}nav a.active::before{color:#cdd3ff}
25
+ main{padding:46px 54px 140px;max-width:calc(var(--max) + 108px)}
26
+ .kicker{color:var(--accent);font-weight:700;font-size:13px;letter-spacing:.12em;text-transform:uppercase}
27
+ h1{font-size:38px;line-height:1.1;letter-spacing:-.8px;margin:.25em 0 .3em}
28
+ .lede{font-size:18.5px;color:#3c3c46;max-width:62ch}
29
+ h2{font-size:25px;letter-spacing:-.4px;margin:60px 0 6px;padding-top:12px}
30
+ h2 .num{color:#c3c3d2;margin-right:10px;font-weight:700}
31
+ h3{font-size:18px;margin:28px 0 6px}
32
+ p{max-width:68ch}section{scroll-margin-top:24px}
33
+ hr{border:0;border-top:1px solid var(--line);margin:50px 0}
34
+ code{font-family:"SF Mono",ui-monospace,Menlo,Consolas,monospace;font-size:.88em;background:#f0f0f6;padding:.1em .42em;border-radius:5px;color:#3a3a52}
35
+ pre{background:var(--code-bg);color:var(--code-ink);padding:16px 18px;border-radius:12px;overflow:auto;font-size:13.5px;line-height:1.55;margin:16px 0}
36
+ pre code{background:none;color:inherit;padding:0}
37
+ .cmd{color:#82aaff}.c{color:#7e84a3}.out{color:#c3e88d}
38
+ .box{border-radius:12px;padding:16px 18px 16px 46px;margin:18px 0;position:relative;border:1px solid;font-size:15px}
39
+ .box .tag{position:absolute;left:16px;top:16px;font-weight:800}
40
+ .box p{margin:.4em 0;max-width:64ch}.box p:first-child{margin-top:0}.box p:last-child{margin-bottom:0}
41
+ .concept{background:var(--concept-bg);border-color:#cfe0ff;color:#15315e}.concept .tag{color:var(--concept)}
42
+ .why{background:var(--why-bg);border-color:#bfe9d6;color:#0a4a36}.why .tag{color:var(--why)}
43
+ .gotcha{background:var(--gotcha-bg);border-color:#fcd9c2;color:#7a2e0e}.gotcha .tag{color:var(--gotcha)}
44
+ .analogy{background:var(--analogy-bg);border-color:#e0d2fb;color:#43227e}.analogy .tag{color:var(--analogy)}
45
+ .decision{background:var(--decision-bg);border-color:#bfe9f3;color:#0a4a5c}.decision .tag{color:var(--decision);font-size:13px;top:18px}
46
+ table{border-collapse:collapse;width:100%;margin:18px 0;font-size:14.5px}
47
+ th,td{text-align:left;padding:11px 14px;border-bottom:1px solid var(--line);vertical-align:top}
48
+ th{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);border-bottom:2px solid var(--line)}
49
+ td:first-child{font-weight:600;white-space:nowrap}td code{font-size:.85em}
50
+ .chips{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
51
+ .chip{background:#fff;border:1px solid var(--line);border-radius:11px;padding:12px 14px;flex:1 1 200px}
52
+ .chip b{display:block;font-size:14px}.chip span{color:var(--muted);font-size:13px}
53
+ .flow{margin:20px 0;display:flex;flex-direction:column}
54
+ .step{display:grid;grid-template-columns:34px 1fr;gap:16px;position:relative;padding:0 0 20px}
55
+ .step:not(:last-child)::before{content:"";position:absolute;left:16px;top:30px;bottom:-4px;width:2px;background:var(--line)}
56
+ .step .dot{width:34px;height:34px;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:700;font-size:14px;z-index:1}
57
+ .step .body{padding-top:4px}.step .body b{display:block;margin-bottom:2px}.step .body span{color:var(--muted);font-size:14.5px}
58
+ .uc{border:1px solid var(--line);border-radius:14px;background:#fff;margin:18px 0;overflow:hidden}
59
+ .uc .h{padding:13px 18px;background:#f7f8ff;border-bottom:1px solid var(--line);font-weight:700}
60
+ .uc .b{padding:14px 18px}.uc .b p{margin:.3em 0}
61
+ .foot{margin-top:60px;color:var(--muted);font-size:13.5px;border-top:1px solid var(--line);padding-top:20px}
62
+ .toplink{position:fixed;right:24px;bottom:24px;background:var(--ink);color:#fff;border-radius:999px;padding:10px 16px;font-size:13px;font-weight:600;box-shadow:0 6px 20px rgba(0,0,0,.18);opacity:0;transition:opacity .2s;pointer-events:none}
63
+ .toplink.show{opacity:.92;pointer-events:auto}
64
+ @media(max-width:920px){.wrap{grid-template-columns:1fr}nav{display:none}main{padding:30px 22px 120px}}
65
+ </style>
66
+ </head>
67
+ <body>
68
+ <div class="wrap">
69
+ <nav>
70
+ <div class="brand">kit-annotate<small>What it is &amp; how to use it</small></div>
71
+ <ol>
72
+ <li><a href="#what">What it does</a></li>
73
+ <li><a href="#shift">How the plan evolved</a></li>
74
+ <li><a href="#pieces">The four pieces</a></li>
75
+ <li><a href="#flow">How it works</a></li>
76
+ <li><a href="#use">Real use cases + commands</a></li>
77
+ <li><a href="#limits">Honest limits</a></li>
78
+ <li><a href="#why">Why adopt, not build</a></li>
79
+ <li><a href="#glossary">Glossary</a></li>
80
+ </ol>
81
+ </nav>
82
+
83
+ <main>
84
+ <div class="kicker">Plain-language explainer · updated for the Agentation direction</div>
85
+ <h1>Point at a component, tell Claude what to fix</h1>
86
+ <p class="lede">kit-annotate lets you click any component in your running dev app, leave a note, and have Claude read a precise, structured record and fix the code. It's <b>wired into claude-kit for Claude Code</b>, and it runs on a maintained open package called <b>Agentation</b> rather than something we hand-build. Here's the whole thing in your language.</p>
87
+
88
+ <!-- 1 -->
89
+ <section id="what">
90
+ <h2><span class="num">1</span>What it does</h2>
91
+ <p>Today you tell Claude <em>"the spacing on the admin card is too tight"</em> and it guesses which file. With kit-annotate you instead <b>click the actual component</b>, type the note right there, and Claude receives: <em>the component (e.g. <code>&lt;AdminCard&gt;</code>), its place in the tree, a source-file pointer, and your comment.</em> Then it opens the code and fixes it.</p>
92
+ <div class="analogy"><span class="tag">≈</span><p><b>Figma comments, but pinned to React components instead of pixels</b> — and the teammate who resolves them is Claude, working in your repo.</p></div>
93
+ </section>
94
+
95
+ <!-- 2 -->
96
+ <section id="shift">
97
+ <h2><span class="num">2</span>How the plan evolved (so the docs make sense)</h2>
98
+ <p>We considered three approaches before landing here. Knowing the path explains why the final design is shaped the way it is:</p>
99
+ <table>
100
+ <tr><th>Idea</th><th>Verdict</th></tr>
101
+ <tr><td>Extend <b>onUI</b> (a DOM-annotation extension you'd installed)</td><td>❌ Closed, version-pinned, DOM-only — couldn't model components.</td></tr>
102
+ <tr><td>Build our own <b>Chrome extension</b></td><td>❌ The "two worlds" problem, an install, a daemon, React-19 source headaches.</td></tr>
103
+ <tr><td>An <b>in-app wrapper</b> — and adopt <b>Agentation</b></td><td>✅ A maintained, open package already does this well. We wire it to Claude.</td></tr>
104
+ </table>
105
+ <div class="why"><span class="tag">✦</span><p>An <b>in-app wrapper</b> (a React component you render) has full, direct access to React — no extension sandbox, no install, and source location comes from your dev build, not a browser hack. Agentation is exactly that wrapper, already shipping, so we adopt it and focus claude-kit on the <b>wiring</b>.</p></div>
106
+ </section>
107
+
108
+ <!-- 3 -->
109
+ <section id="pieces">
110
+ <h2><span class="num">3</span>The four pieces</h2>
111
+ <div class="chips">
112
+ <div class="chip"><b>① <code>&lt;Agentation /&gt;</code></b><span>A dev-only React component you render once in your app. Draws the bottom-right toolbar; captures what you click.</span></div>
113
+ <div class="chip"><b>② <code>agentation-mcp</code></b><span>A small local server. Receives annotations from the toolbar (HTTP :4747) and exposes them to Claude over MCP.</span></div>
114
+ <div class="chip"><b>③ <code>/kit-annotate</code></b><span>The claude-kit skill that installs ①, registers ② for Claude, and runs the fix loop. Your entry point.</span></div>
115
+ <div class="chip"><b>④ the rule</b><span><code>.claude/rules/react-annotate.md</code> — teaches Claude the annotate → locate → fix → resolve loop and the honest limits.</span></div>
116
+ </div>
117
+ <div class="concept"><span class="tag">ℹ</span><p><b>You already know most of this.</b> ① is just a React component. ② is a <code>localhost</code> server like your Vite dev server. <b>MCP</b> is "a REST API whose client is Claude" — the same mechanism that already lets Claude read tool results. ③ a slash command. ④ a markdown instruction file.</p></div>
118
+ </section>
119
+
120
+ <!-- 4 -->
121
+ <section id="flow">
122
+ <h2><span class="num">4</span>How it works, end to end</h2>
123
+ <pre><code> Your dev app (localhost) ──&lt;Agentation/&gt; toolbar──▶ you click + note
124
+ │ HTTP POST :4747
125
+
126
+ agentation-mcp (local server + SQLite)
127
+ │ MCP (stdio)
128
+
129
+ Claude Code ──reads annotations, greps to the file, fixes, marks resolved</code></pre>
130
+ <div class="flow">
131
+ <div class="step"><div class="dot">1</div><div class="body"><b>Set up once</b><span>Run <code>/kit-annotate</code>. It detects your framework, installs <code>agentation</code>, registers its MCP for Claude, adds the rule, and helps you drop <code>&lt;Agentation /&gt;</code> into your app entry.</span></div></div>
132
+ <div class="step"><div class="dot">2</div><div class="body"><b>Run your dev server &amp; annotate</b><span>Start the app, click the bottom-right toolbar, click a component, type your note (with intent + severity).</span></div></div>
133
+ <div class="step"><div class="dot">3</div><div class="body"><b>Claude reads the queue</b><span>It calls the Agentation MCP — either on demand (<code>agentation_get_all_pending</code>) or hands-free (<code>agentation_watch_annotations</code>, which waits for new notes).</span></div></div>
134
+ <div class="step"><div class="dot">4</div><div class="body"><b>Locate → fix → resolve</b><span>For each note: it acknowledges, finds the code (source pointer or grep by component/selector), makes the change, and marks it resolved with a one-line summary.</span></div></div>
135
+ </div>
136
+ <div class="concept"><span class="tag">ℹ</span><p><b>Who drives what:</b> <em>you</em> click and annotate (a real click in your browser); <em>Claude</em> reads and fixes. In hands-free "watch mode" you just keep annotating while Claude resolves them in the background.</p></div>
137
+ </section>
138
+
139
+ <!-- 5 -->
140
+ <section id="use">
141
+ <h2><span class="num">5</span>Real use cases + the exact commands</h2>
142
+
143
+ <div class="uc"><div class="h">A. First-time setup on a React app</div><div class="b">
144
+ <pre><code><span class="c"># preview what it will do — no changes</span>
145
+ <span class="cmd">/kit-annotate --dry-run</span>
146
+ <span class="c"># → React: yes (v19.2) Framework: next Entry: app/layout.tsx
147
+ # would: npm i -D agentation · register MCP · write rule · wire &lt;Agentation/&gt;</span>
148
+
149
+ <span class="c"># do it (asks consent, shows the layout diff before saving)</span>
150
+ <span class="cmd">/kit-annotate setup</span></code></pre>
151
+ <p>Then: restart Claude Code (loads the MCP), run your dev server, and <code>npx agentation-mcp doctor</code> to verify.</p>
152
+ </div></div>
153
+
154
+ <div class="uc"><div class="h">B. Fix a spacing bug you can see</div><div class="b">
155
+ <p>App is running. You click the cramped admin card in the toolbar and type <em>"spacing too tight — apply the 24px section rhythm."</em> Then in Claude:</p>
156
+ <pre><code><span class="cmd">/kit-annotate review</span>
157
+ <span class="c"># Claude: pulls the note → it's &lt;AdminCard&gt; (app/admin/AdminCard.tsx)
158
+ # → opens the file, adjusts the spacing tokens → marks it resolved.</span></code></pre>
159
+ <p>Or just say it in plain language: <em>"review my UI annotations and fix them."</em></p>
160
+ </div></div>
161
+
162
+ <div class="uc"><div class="h">C. Hands-free "watch mode" — annotate while Claude fixes</div><div class="b">
163
+ <pre><code><span class="cmd">/kit-annotate watch</span>
164
+ <span class="c"># Claude calls agentation_watch_annotations in a loop.
165
+ # You keep clicking + noting across the page; each note is picked up,
166
+ # fixed, and resolved with a summary — until you say stop.</span></code></pre>
167
+ <p>Great for a focused design-polish pass across a whole screen.</p>
168
+ </div></div>
169
+
170
+ <div class="uc"><div class="h">D. Check status / triage later</div><div class="b">
171
+ <pre><code><span class="cmd">/kit-annotate status</span>
172
+ <span class="c"># shows the .annotate config, runs `agentation-mcp doctor`,
173
+ # and lists active annotation sessions.</span></code></pre>
174
+ </div></div>
175
+
176
+ <div class="concept"><span class="tag">ℹ</span><p><code>/kit-annotate</code> with no argument is smart: if the project isn't set up yet it runs <b>setup</b>; if it is, it starts a <b>session</b>. It also auto-activates on natural language like <em>"set up visual annotation"</em> or <em>"watch mode for UI feedback."</em></p></div>
177
+ </section>
178
+
179
+ <!-- 6 -->
180
+ <section id="limits">
181
+ <h2><span class="num">6</span>Honest limits (so nothing surprises you)</h2>
182
+ <div class="gotcha"><span class="tag">⚠</span><p><b>Dev-only.</b> The toolbar is gated behind a dev check and stripped from production. You always annotate against the dev server.</p></div>
183
+ <div class="gotcha"><span class="tag">⚠</span><p><b>Identity, not live values.</b> Agentation gives Claude the component name + tree + a source pointer + your selector — <em>not</em> the live prop/state <em>values</em>. Claude greps to the file using those. (Capturing sanitized props/state was our original "build-your-own" idea; it's parked unless you find you truly need it day-to-day.)</p></div>
184
+ <div class="gotcha"><span class="tag">⚠</span><p><b>React Server Components</b> render on the server and have no client component to point at — a clicked server-rendered node falls back to a CSS selector. Client components annotate fully.</p></div>
185
+ <div class="gotcha"><span class="tag">⚠</span><p><b>It's a third-party package.</b> Agentation is open and source-available (PolyForm Shield license), installed as <em>your</em> dev dependency. The kit never copies its code — it only wires it up.</p></div>
186
+ </section>
187
+
188
+ <!-- 7 -->
189
+ <section id="why">
190
+ <h2><span class="num">7</span>Why we adopt Agentation instead of building our own</h2>
191
+ <p>The earlier lesson — <em>don't depend on a closed tool you can't inspect</em> (that's why we dropped onUI) — still holds, but Agentation passes the test where onUI failed: it's <b>source-available</b> (you can read, pin, or fork it) and speaks <b>standard MCP</b> (inspectable). So the risk shrinks to ordinary "someone else maintains it," which we contain by keeping claude-kit's own layer — the command, the rule, your config — as the stable contract.</p>
192
+ <div class="why"><span class="tag">✦</span><p><b>Net:</b> you get a working loop in days instead of weeks, hand the hard browser/React-internals work to a maintained package, and keep the door open to a kit-owned backend later <em>only if</em> you discover you need richer capture (like live prop/state values). Build-vs-adopt details are in the implementation plan.</p></div>
193
+ <div class="decision"><span class="tag">NEXT</span><p>See <a href="02-implementation-plan.html">02-implementation-plan.html</a> for exactly what was built in claude-kit, the phased plan, and the open decisions.</p></div>
194
+ </section>
195
+
196
+ <hr>
197
+ <section id="glossary">
198
+ <h2><span class="num">8</span>Glossary</h2>
199
+ <table>
200
+ <tr><th>Term</th><th>In one line</th></tr>
201
+ <tr><td>Agentation</td><td>The open npm package that provides the in-app annotation toolbar + MCP.</td></tr>
202
+ <tr><td><code>&lt;Agentation /&gt;</code></td><td>The dev-only React component you render once in your app.</td></tr>
203
+ <tr><td><code>agentation-mcp</code></td><td>The local server: HTTP :4747 (from the toolbar) + MCP stdio (to Claude).</td></tr>
204
+ <tr><td>MCP</td><td>Model Context Protocol — a standard for giving Claude tools &amp; data (a REST API for Claude).</td></tr>
205
+ <tr><td>Fiber / component tree</td><td>React's internal component tree — what DevTools shows; how the toolbar names what you clicked.</td></tr>
206
+ <tr><td>RSC</td><td>React Server Components — render on the server, so they degrade to a selector when clicked.</td></tr>
207
+ <tr><td>Watch mode</td><td>Hands-free loop: Claude waits for new notes and resolves them as you annotate.</td></tr>
208
+ <tr><td>PolyForm Shield</td><td>Agentation's license: free to use; only forbids building a competitor with it.</td></tr>
209
+ </table>
210
+ <div class="foot">kit-annotate · explainer · companion: <a href="02-implementation-plan.html">02-implementation-plan.html</a></div>
211
+ </section>
212
+ </main>
213
+ </div>
214
+ <a href="#" class="toplink" id="toplink">↑ Top</a>
215
+ <script>
216
+ const links=[...document.querySelectorAll('nav a')];
217
+ const map=new Map(links.map(a=>[a.getAttribute('href').slice(1),a]));
218
+ const obs=new IntersectionObserver(es=>{es.forEach(e=>{if(e.isIntersecting){links.forEach(l=>l.classList.remove('active'));const a=map.get(e.target.id);if(a)a.classList.add('active');}});},{rootMargin:'-10% 0px -80% 0px'});
219
+ document.querySelectorAll('section[id]').forEach(s=>obs.observe(s));
220
+ const t=document.getElementById('toplink');
221
+ addEventListener('scroll',()=>{t.classList.toggle('show',scrollY>700)});
222
+ t.addEventListener('click',e=>{e.preventDefault();scrollTo({top:0,behavior:'smooth'})});
223
+ </script>
224
+ </body>
225
+ </html>