codebyplan 1.5.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/dist/cli.js +4462 -748
  2. package/package.json +5 -1
  3. package/templates/.gitkeep +0 -0
  4. package/templates/README.md +20 -0
  5. package/templates/agents/cbp-cc-executor.md +213 -0
  6. package/templates/agents/cbp-database-agent.md +229 -0
  7. package/templates/agents/cbp-improve-claude.md +245 -0
  8. package/templates/agents/cbp-improve-round.md +284 -0
  9. package/templates/agents/cbp-mechanical-edits.md +111 -0
  10. package/templates/agents/cbp-research.md +282 -0
  11. package/templates/agents/cbp-round-executor.md +604 -0
  12. package/templates/agents/cbp-security-agent.md +134 -0
  13. package/templates/agents/cbp-task-check.md +213 -0
  14. package/templates/agents/cbp-task-planner.md +582 -0
  15. package/templates/agents/cbp-test-e2e-agent.md +363 -0
  16. package/templates/agents/cbp-testing-qa-agent.md +400 -0
  17. package/templates/context/mcp-docs.md +139 -0
  18. package/templates/hooks/README.md +236 -0
  19. package/templates/hooks/cbp-auto-test-hooks.sh +44 -0
  20. package/templates/hooks/cbp-lint-format-on-edit.sh +159 -0
  21. package/templates/hooks/cbp-maestro-yaml-validate.sh +100 -0
  22. package/templates/hooks/cbp-mcp-migration-guard.sh +32 -0
  23. package/templates/hooks/cbp-mcp-round-sync.sh +79 -0
  24. package/templates/hooks/cbp-mcp-worktree-inject.sh +76 -0
  25. package/templates/hooks/cbp-notify.sh +68 -0
  26. package/templates/hooks/cbp-plugin-dispatch.sh +29 -0
  27. package/templates/hooks/cbp-pre-commit-quality-gate.sh +204 -0
  28. package/templates/hooks/cbp-statusline.sh +347 -0
  29. package/templates/hooks/cbp-subagent-statusline.sh +182 -0
  30. package/templates/hooks/cbp-test-coverage-gate.sh +144 -0
  31. package/templates/hooks/cbp-test-hooks.sh +320 -0
  32. package/templates/hooks/hooks.json +85 -0
  33. package/templates/hooks/validate-context-usage.sh +59 -0
  34. package/templates/hooks/validate-git-commit.sh +78 -0
  35. package/templates/hooks/validate-git-stash-deny.sh +32 -0
  36. package/templates/hooks/validate-structure-lengths.sh +57 -0
  37. package/templates/hooks/validate-structure-lib.sh +104 -0
  38. package/templates/hooks/validate-structure-patterns.sh +54 -0
  39. package/templates/hooks/validate-structure-scope.sh +33 -0
  40. package/templates/hooks/validate-structure-smoke.sh +95 -0
  41. package/templates/hooks/validate-structure-templates.sh +34 -0
  42. package/templates/hooks/validate-structure.sh +69 -0
  43. package/templates/rules/.gitkeep +0 -0
  44. package/templates/rules/README.md +47 -0
  45. package/templates/rules/context-file-loading.md +52 -0
  46. package/templates/rules/scope-vocabulary.md +64 -0
  47. package/templates/rules/todo-backend.md +109 -0
  48. package/templates/settings.project.base.json +55 -0
  49. package/templates/settings.user.base.json +25 -0
  50. package/templates/skills/cbp-build-cc-agent/SKILL.md +139 -0
  51. package/templates/skills/cbp-build-cc-agent/examples/read-only-reviewer.md +32 -0
  52. package/templates/skills/cbp-build-cc-agent/examples/with-hooks.md +41 -0
  53. package/templates/skills/cbp-build-cc-agent/examples/with-skills-preload.md +25 -0
  54. package/templates/skills/cbp-build-cc-agent/reference/cbp-quality.md +153 -0
  55. package/templates/skills/cbp-build-cc-agent/reference/frontmatter-fields.md +37 -0
  56. package/templates/skills/cbp-build-cc-agent/reference/permission-modes.md +18 -0
  57. package/templates/skills/cbp-build-cc-agent/scripts/validate-agent.sh +67 -0
  58. package/templates/skills/cbp-build-cc-agent/templates/agent.md +66 -0
  59. package/templates/skills/cbp-build-cc-claude-file/SKILL.md +178 -0
  60. package/templates/skills/cbp-build-cc-claude-file/examples/minimal-project.md +33 -0
  61. package/templates/skills/cbp-build-cc-claude-file/examples/monorepo-with-imports.md +39 -0
  62. package/templates/skills/cbp-build-cc-claude-file/reference/imports.md +72 -0
  63. package/templates/skills/cbp-build-cc-claude-file/reference/what-belongs.md +39 -0
  64. package/templates/skills/cbp-build-cc-claude-file/templates/project-claude-md.md +48 -0
  65. package/templates/skills/cbp-build-cc-claude-file/templates/user-claude-md.md +22 -0
  66. package/templates/skills/cbp-build-cc-memory/SKILL.md +201 -0
  67. package/templates/skills/cbp-build-cc-memory/examples/feedback-memory.md +11 -0
  68. package/templates/skills/cbp-build-cc-memory/examples/project-memory.md +11 -0
  69. package/templates/skills/cbp-build-cc-memory/examples/reference-memory.md +13 -0
  70. package/templates/skills/cbp-build-cc-memory/examples/user-memory.md +14 -0
  71. package/templates/skills/cbp-build-cc-memory/reference/memory-types.md +59 -0
  72. package/templates/skills/cbp-build-cc-memory/reference/when-to-save.md +62 -0
  73. package/templates/skills/cbp-build-cc-memory/templates/MEMORY-index.md +4 -0
  74. package/templates/skills/cbp-build-cc-memory/templates/memory-entry.md +15 -0
  75. package/templates/skills/cbp-build-cc-mode/SKILL.md +99 -0
  76. package/templates/skills/cbp-build-cc-rule/SKILL.md +176 -0
  77. package/templates/skills/cbp-build-cc-rule/examples/global-rule.md +19 -0
  78. package/templates/skills/cbp-build-cc-rule/examples/scoped-rule.md +41 -0
  79. package/templates/skills/cbp-build-cc-rule/reference/paths-patterns.md +48 -0
  80. package/templates/skills/cbp-build-cc-rule/templates/rule.md +32 -0
  81. package/templates/skills/cbp-build-cc-settings/SKILL.md +220 -0
  82. package/templates/skills/cbp-build-cc-settings/examples/hooks-config.json +64 -0
  83. package/templates/skills/cbp-build-cc-settings/examples/permissions-config.json +34 -0
  84. package/templates/skills/cbp-build-cc-settings/examples/sandbox-config.json +42 -0
  85. package/templates/skills/cbp-build-cc-settings/reference/cbp-conventions.md +104 -0
  86. package/templates/skills/cbp-build-cc-settings/reference/permission-rules.md +61 -0
  87. package/templates/skills/cbp-build-cc-settings/reference/scope-precedence.md +73 -0
  88. package/templates/skills/cbp-build-cc-settings/reference/settings-fields.md +166 -0
  89. package/templates/skills/cbp-build-cc-settings/templates/settings.json +23 -0
  90. package/templates/skills/cbp-build-cc-settings/templates/settings.local.json +10 -0
  91. package/templates/skills/cbp-build-cc-skill/SKILL.md +154 -0
  92. package/templates/skills/cbp-build-cc-skill/examples/dynamic-context.md +31 -0
  93. package/templates/skills/cbp-build-cc-skill/examples/fork-skill.md +22 -0
  94. package/templates/skills/cbp-build-cc-skill/examples/knowledge-skill.md +25 -0
  95. package/templates/skills/cbp-build-cc-skill/examples/task-skill.md +29 -0
  96. package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +157 -0
  97. package/templates/skills/cbp-build-cc-skill/reference/frontmatter-fields.md +35 -0
  98. package/templates/skills/cbp-build-cc-skill/reference/string-substitutions.md +60 -0
  99. package/templates/skills/cbp-build-cc-skill/scripts/validate-skill.sh +90 -0
  100. package/templates/skills/cbp-build-cc-skill/templates/skill.md +51 -0
  101. package/templates/skills/cbp-checkpoint-check/SKILL.md +156 -0
  102. package/templates/skills/cbp-checkpoint-complete/SKILL.md +109 -0
  103. package/templates/skills/cbp-checkpoint-create/SKILL.md +287 -0
  104. package/templates/skills/cbp-checkpoint-end/SKILL.md +241 -0
  105. package/templates/skills/cbp-checkpoint-update/SKILL.md +115 -0
  106. package/templates/skills/cbp-frontend-a11y/SKILL.md +109 -0
  107. package/templates/skills/cbp-frontend-a11y/reference/aria-roles-states.md +130 -0
  108. package/templates/skills/cbp-frontend-a11y/reference/contrast-visual.md +122 -0
  109. package/templates/skills/cbp-frontend-a11y/reference/keyboard-patterns.md +154 -0
  110. package/templates/skills/cbp-frontend-a11y/reference/semantic-html.md +111 -0
  111. package/templates/skills/cbp-frontend-design/SKILL.md +145 -0
  112. package/templates/skills/cbp-frontend-design/reference/nextjs-scss.md +118 -0
  113. package/templates/skills/cbp-frontend-design/reference/rn-expo.md +101 -0
  114. package/templates/skills/cbp-frontend-design/reference/tauri-react.md +82 -0
  115. package/templates/skills/cbp-frontend-ui/SKILL.md +262 -0
  116. package/templates/skills/cbp-frontend-ui/reference/ui-label-maps.md +42 -0
  117. package/templates/skills/cbp-frontend-ui/reference/ui-layout-patterns.md +105 -0
  118. package/templates/skills/cbp-frontend-ui/reference/variant-defaults.md +149 -0
  119. package/templates/skills/cbp-frontend-ux/SKILL.md +181 -0
  120. package/templates/skills/cbp-git-branch-feat-create/SKILL.md +115 -0
  121. package/templates/skills/cbp-git-commit/SKILL.md +278 -0
  122. package/templates/skills/cbp-git-worktree-create/SKILL.md +226 -0
  123. package/templates/skills/cbp-git-worktree-remove/SKILL.md +145 -0
  124. package/templates/skills/cbp-merge-main/SKILL.md +228 -0
  125. package/templates/skills/cbp-round-check/SKILL.md +104 -0
  126. package/templates/skills/cbp-round-end/SKILL.md +183 -0
  127. package/templates/skills/cbp-round-end/reference/findings-presentation.md +44 -0
  128. package/templates/skills/cbp-round-end/reference/inline-fallback.md +35 -0
  129. package/templates/skills/cbp-round-execute/SKILL.md +211 -0
  130. package/templates/skills/cbp-round-execute/reference/inline-fallback.md +59 -0
  131. package/templates/skills/cbp-round-input/SKILL.md +165 -0
  132. package/templates/skills/cbp-round-start/SKILL.md +222 -0
  133. package/templates/skills/cbp-round-update/SKILL.md +163 -0
  134. package/templates/skills/cbp-session-end/SKILL.md +187 -0
  135. package/templates/skills/cbp-session-start/SKILL.md +155 -0
  136. package/templates/skills/cbp-ship/SKILL.md +332 -0
  137. package/templates/skills/cbp-ship/reference/changesets-overview.md +120 -0
  138. package/templates/skills/cbp-ship/reference/eas-cli-overview.md +60 -0
  139. package/templates/skills/cbp-ship/reference/gh-cli-overview.md +135 -0
  140. package/templates/skills/cbp-ship/reference/gh-cli-shipment-commands.md +283 -0
  141. package/templates/skills/cbp-ship/reference/npm-publish-monorepo.md +252 -0
  142. package/templates/skills/cbp-ship/reference/npm-publish-oidc-trusted.md +157 -0
  143. package/templates/skills/cbp-ship/reference/npm-publish-overview.md +171 -0
  144. package/templates/skills/cbp-ship/reference/preflight-checklist.md +88 -0
  145. package/templates/skills/cbp-ship/reference/railway-nestjs-deployment.md +169 -0
  146. package/templates/skills/cbp-ship/reference/railway-overview.md +120 -0
  147. package/templates/skills/cbp-ship/reference/railway-troubleshooting.md +168 -0
  148. package/templates/skills/cbp-ship/reference/release-please-overview.md +99 -0
  149. package/templates/skills/cbp-ship/reference/surface-expo-eas.md +155 -0
  150. package/templates/skills/cbp-ship/reference/surface-npm.md +180 -0
  151. package/templates/skills/cbp-ship/reference/surface-railway.md +152 -0
  152. package/templates/skills/cbp-ship/reference/surface-supabase.md +178 -0
  153. package/templates/skills/cbp-ship/reference/surface-tauri.md +138 -0
  154. package/templates/skills/cbp-ship/reference/surface-vercel.md +124 -0
  155. package/templates/skills/cbp-ship/reference/surface-vscode-ext.md +144 -0
  156. package/templates/skills/cbp-ship/reference/surfaces.md +60 -0
  157. package/templates/skills/cbp-ship/reference/testflight-automation.md +215 -0
  158. package/templates/skills/cbp-ship/reference/testflight-internal-vs-external.md +69 -0
  159. package/templates/skills/cbp-ship/reference/testflight-overview.md +98 -0
  160. package/templates/skills/cbp-ship/reference/versioning.md +116 -0
  161. package/templates/skills/cbp-ship/scripts/detect-surfaces.sh +217 -0
  162. package/templates/skills/cbp-ship/scripts/verify-expo-eas.sh +35 -0
  163. package/templates/skills/cbp-ship/scripts/verify-npm.sh +21 -0
  164. package/templates/skills/cbp-ship/scripts/verify-railway.sh +41 -0
  165. package/templates/skills/cbp-ship/scripts/verify-supabase.sh +19 -0
  166. package/templates/skills/cbp-ship/scripts/verify-tauri.sh +24 -0
  167. package/templates/skills/cbp-ship/scripts/verify-vercel.sh +32 -0
  168. package/templates/skills/cbp-ship/scripts/verify-vscode-ext.sh +25 -0
  169. package/templates/skills/cbp-ship/templates/eas.json +66 -0
  170. package/templates/skills/cbp-ship/templates/railway.toml +15 -0
  171. package/templates/skills/cbp-ship/templates/release-please-config.json +17 -0
  172. package/templates/skills/cbp-ship/templates/vercel.json +19 -0
  173. package/templates/skills/cbp-ship/templates/vscodeignore +21 -0
  174. package/templates/skills/cbp-ship/templates/workflow-changesets.yml +41 -0
  175. package/templates/skills/cbp-ship/templates/workflow-eas-submit.yml +53 -0
  176. package/templates/skills/cbp-ship/templates/workflow-npm-publish.yml +36 -0
  177. package/templates/skills/cbp-ship/templates/workflow-release-please.yml +21 -0
  178. package/templates/skills/cbp-ship/templates/workflow-tauri-release.yml +69 -0
  179. package/templates/skills/cbp-ship/templates/workflow-vsce-publish.yml +31 -0
  180. package/templates/skills/cbp-ship-configure/SKILL.md +296 -0
  181. package/templates/skills/cbp-ship-configure/reference/expo-mobile.md +204 -0
  182. package/templates/skills/cbp-ship-configure/reference/npm-package.md +165 -0
  183. package/templates/skills/cbp-ship-configure/reference/railway-backend.md +199 -0
  184. package/templates/skills/cbp-ship-configure/reference/supabase.md +200 -0
  185. package/templates/skills/cbp-ship-configure/reference/tauri-desktop.md +181 -0
  186. package/templates/skills/cbp-ship-configure/reference/vercel.md +117 -0
  187. package/templates/skills/cbp-ship-configure/reference/vscode-ext.md +155 -0
  188. package/templates/skills/cbp-ship-main/SKILL.md +65 -0
  189. package/templates/skills/cbp-supabase-branch-check/SKILL.md +337 -0
  190. package/templates/skills/cbp-supabase-branch-check/reference/dag-steps.md +29 -0
  191. package/templates/skills/cbp-supabase-migrate/SKILL.md +314 -0
  192. package/templates/skills/cbp-supabase-migrate/reference/advisor-triage.md +70 -0
  193. package/templates/skills/cbp-supabase-migrate/reference/cli-fallback.md +87 -0
  194. package/templates/skills/cbp-supabase-migrate/reference/preflight-dry-run.md +58 -0
  195. package/templates/skills/cbp-supabase-setup/SKILL.md +239 -0
  196. package/templates/skills/cbp-supabase-setup/reference/branching-setup.md +121 -0
  197. package/templates/skills/cbp-supabase-setup/reference/cli-fallback.md +109 -0
  198. package/templates/skills/cbp-task-check/SKILL.md +166 -0
  199. package/templates/skills/cbp-task-complete/SKILL.md +206 -0
  200. package/templates/skills/cbp-task-complete/reference/checkpoint-done-branching.md +48 -0
  201. package/templates/skills/cbp-task-complete/reference/next-step-heuristic.md +56 -0
  202. package/templates/skills/cbp-task-create/SKILL.md +167 -0
  203. package/templates/skills/cbp-task-start/SKILL.md +239 -0
  204. package/templates/skills/cbp-task-testing/SKILL.md +277 -0
  205. package/templates/skills/cbp-todo/SKILL.md +97 -0
@@ -0,0 +1,201 @@
1
+ ---
2
+ scope: org-shared
3
+ name: cbp-build-cc-memory
4
+ description: Create or update an auto-memory entry under the Claude Code auto-memory directory per the official spec. Handles path-slug encoding, per-repo redirection via autoMemoryDirectory, MEMORY.md index, and per-entry typing (user/feedback/project/reference).
5
+ argument-hint: "[entry-name] [--type=user|feedback|project|reference] [--repo-local]"
6
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash(mkdir *), Bash(cat *), Bash(ls *), Bash(jq *)
7
+ effort: xhigh
8
+ ---
9
+
10
+ # Build Claude Code Auto-Memory Entry
11
+
12
+ Create or update an entry in Claude Code's auto-memory directory per the official Claude Code memory spec (section _Auto memory_).
13
+
14
+ Auto memory is machine-local knowledge Claude accumulates across sessions. Only the first 200 lines or 25KB of `MEMORY.md` load at session start.
15
+
16
+ ## Arguments
17
+
18
+ `$ARGUMENTS` — entry name (kebab-case, used as filename). Flags: `--type=user|feedback|project|reference` (see [reference/memory-types.md](reference/memory-types.md)), `--repo-local` (store at `.claude/memory/` via user-scope `autoMemoryDirectory` override; see Step 1).
19
+
20
+ ## When to Use
21
+
22
+ | Situation | Action |
23
+ | ------------------------------------------------------------ | -------------------------------------- |
24
+ | User tells you something about themselves | Save as `user` memory |
25
+ | User corrects you, or confirms a non-obvious approach worked | Save as `feedback` memory |
26
+ | User shares project info (deadline, stakeholder, WHY) | Save as `project` memory |
27
+ | User points to external system (Linear, Slack, dashboard) | Save as `reference` memory |
28
+ | User says "remember this" / "save this" | Save immediately, pick type by content |
29
+ | User says "forget X" | Find and delete the entry |
30
+
31
+ Do **NOT** save:
32
+
33
+ - Things derivable from `git log`, `git blame`, or reading the current code
34
+ - Debugging fixes (they're already in the commit)
35
+ - CLAUDE.md content (different mechanism)
36
+ - Ephemeral task/conversation state
37
+
38
+ ## Instructions
39
+
40
+ ### Step 1 — Locate the memory directory
41
+
42
+ **Default (global auto-memory):** `~/.claude/projects/<project-slug>/memory/`.
43
+
44
+ The `<project-slug>` is the **absolute git repo path with `/` replaced by `-`**, e.g. repo at `/Users/alice/my-app` → slug `-Users-alice-my-app`. The `<project>` placeholder in the docs is not a friendly name — it's this slug.
45
+
46
+ Resolve it deterministically:
47
+
48
+ ```bash
49
+ REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
50
+ SLUG="$(echo "$REPO_ROOT" | sed 's|/|-|g')"
51
+ DEFAULT_DIR="$HOME/.claude/projects/$SLUG/memory"
52
+ ```
53
+
54
+ Worktrees get a separate slug (the spec says all worktrees share one dir, but the runtime slugs by path — verify with `ls ~/.claude/projects/ | grep "$SLUG"`).
55
+
56
+ **Override (`autoMemoryDirectory`):** the runtime reads this key only from **user, local, or managed-policy** settings — never from project settings. Resolve in that priority order, then fall back to the default path.
57
+
58
+ ```bash
59
+ # Check overrides in priority order
60
+ for f in "$HOME/.claude/settings.json" ".claude/settings.local.json"; do
61
+ override=$(jq -r '.autoMemoryDirectory // empty' "$f" 2>/dev/null)
62
+ [ -n "$override" ] && MEMORY_DIR="${override/#\~/$HOME}" && break
63
+ done
64
+ MEMORY_DIR="${MEMORY_DIR:-$DEFAULT_DIR}"
65
+ mkdir -p "$MEMORY_DIR"
66
+ ```
67
+
68
+ ### Step 2 — Pick scope: global vs repo-local vs user-global
69
+
70
+ Three valid configurations (decide before writing):
71
+
72
+ | Scope | Where it lives | How to enable | When to use |
73
+ | ---------------------------- | ----------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------- |
74
+ | Global auto-memory (default) | `~/.claude/projects/<slug>/memory/` | No config — works by default | Personal learnings specific to this repo |
75
+ | Repo-local | `<repo>/.claude/memory/` | Set `autoMemoryDirectory` in `.claude/settings.local.json` (NOT `settings.json`) | Team-shared repo memory; also gitignore if sensitive |
76
+ | User-global | `~/my-notes/` or similar | Set `autoMemoryDirectory` in `~/.claude/settings.json` | One memory pool across all your projects |
77
+
78
+ **CBP default: global.** Switch to repo-local only when (a) the memory would help a teammate on the same repo, (b) isn't already in CLAUDE.md, and (c) you're comfortable committing it (or gitignoring deliberately). Prefer global for automatic feedback-type memories.
79
+
80
+ **Never save credentials, secrets, or PII** to any memory scope. Memory is loaded into every session.
81
+
82
+ **Memory vs CLAUDE.md vs rules:**
83
+
84
+ | Destination | What belongs |
85
+ | ------------------------ | -------------------------------------------------------------------------------------- |
86
+ | CLAUDE.md | Stable, team-shared facts needed every session (tech stack, branch strategy, repo IDs) |
87
+ | `.claude/rules/` | Behavioural constraints enforced on specific files (paths-scoped) |
88
+ | Auto-memory (global) | Personal learnings, user's working style, past corrections |
89
+ | Auto-memory (repo-local) | Team facts not yet stable enough for CLAUDE.md |
90
+
91
+ Don't duplicate across destinations.
92
+
93
+ **Repo-local setup** (if `--repo-local` or user asks):
94
+
95
+ 1. Invoke `/cbp-build-cc-settings` to add `"autoMemoryDirectory": "./.claude/memory"` to `.claude/settings.local.json` (user-scope is also accepted). Project-scope `settings.json` is **rejected** by the runtime.
96
+ 2. Create the directory: `mkdir -p .claude/memory`
97
+ 3. Decide: commit to git (team-shared) or add to `.gitignore` (personal in-repo).
98
+
99
+ ### Step 3 — Read the existing MEMORY.md
100
+
101
+ ```bash
102
+ cat "$MEMORY_DIR/MEMORY.md" 2>/dev/null || echo "(no MEMORY.md yet)"
103
+ ```
104
+
105
+ MEMORY.md is the **index**, not a store. One-line pointer per entry, under ~150 chars. It's loaded every session (first 200 lines / 25KB). Keep it tight.
106
+
107
+ ### Step 4 — Check for an existing entry
108
+
109
+ ```bash
110
+ ls "$MEMORY_DIR" | grep -i "{topic-keyword}"
111
+ ```
112
+
113
+ If a related entry exists:
114
+
115
+ - Updating an existing fact → edit that file
116
+ - Same topic, different angle → edit or merge
117
+ - New but adjacent → create new file, cross-link from MEMORY.md
118
+
119
+ Never duplicate.
120
+
121
+ ### Step 5 — Classify the entry
122
+
123
+ Pick the right type. Details: [reference/memory-types.md](reference/memory-types.md).
124
+
125
+ | Type | Saves | Example trigger |
126
+ | ----------- | ----------------------------- | ----------------------------------------- |
127
+ | `user` | Who they are, how they work | "I've been writing Go for 10 years" |
128
+ | `feedback` | Corrections AND confirmations | "stop summarizing", "yeah that was right" |
129
+ | `project` | Work context, deadlines, WHY | "we're freezing after Thursday" |
130
+ | `reference` | Pointers to external systems | "bugs live in Linear project INGEST" |
131
+
132
+ ### Step 6 — Write the entry file
133
+
134
+ Read `${CLAUDE_SKILL_DIR}/templates/memory-entry.md` for the canonical format.
135
+
136
+ Filename convention: `{type}_{topic}.md` (e.g. `feedback_testing.md`, `user_role.md`, `project_q1_freeze.md`).
137
+
138
+ Frontmatter:
139
+
140
+ ```yaml
141
+ ---
142
+ name: Human-readable entry name
143
+ description: One-line relevance hint — used to judge if this memory matters in a new conversation
144
+ type: user | feedback | project | reference
145
+ ---
146
+ ```
147
+
148
+ For `feedback` and `project` types, structure the body as:
149
+
150
+ 1. Lead line — the rule or fact itself
151
+ 2. **Why:** — reason the user gave (incident, preference, deadline)
152
+ 3. **How to apply:** — when this guidance kicks in
153
+
154
+ See [examples/feedback-memory.md](examples/feedback-memory.md) and [examples/project-memory.md](examples/project-memory.md).
155
+
156
+ ### Step 7 — Update MEMORY.md
157
+
158
+ MEMORY.md is an index, not a memory. No frontmatter. One line per entry:
159
+
160
+ ```markdown
161
+ # Memory
162
+
163
+ - [Title](file.md) — one-line hook
164
+ - [Another title](another.md) — one-line hook
165
+ ```
166
+
167
+ Keep each line under ~150 characters. Organize by topic, not chronology.
168
+
169
+ ### Step 8 — Handle absolute dates
170
+
171
+ Convert relative dates to absolute when saving:
172
+
173
+ | User said | Save as |
174
+ | -------------- | --------------------------- |
175
+ | "by Thursday" | `2026-04-23` (today + days) |
176
+ | "next week" | `2026-04-29 to 2026-05-05` |
177
+ | "last quarter" | `2026-Q1` |
178
+
179
+ Memories persist — relative dates rot.
180
+
181
+ ### Step 9 — Verify with `/memory`
182
+
183
+ Run `/memory` in Claude Code to browse the directory. New entries appear immediately in the index load (on next session).
184
+
185
+ ## Integration
186
+
187
+ - **Triggered by**: user asking to remember, feedback during work
188
+ - **Reads**: `${CLAUDE_SKILL_DIR}/templates/*.md`, `${CLAUDE_SKILL_DIR}/reference/*.md`
189
+ - **Writes**: resolved `$MEMORY_DIR` (default `~/.claude/projects/<slug>/memory/`, or `autoMemoryDirectory` override)
190
+ - **Related skills**: `/cbp-build-cc-settings` (configure `autoMemoryDirectory`), `/cbp-build-cc-claude-file` (team-shared facts → CLAUDE.md, not memory), `/cbp-build-cc-rule` (behavioural constraints → rules)
191
+
192
+ ## Key Rules
193
+
194
+ - `<project>` in the docs is a **slug** (`/` → `-`), not a friendly name
195
+ - `autoMemoryDirectory` is **rejected** from project `settings.json` — only user / local / managed-policy accept it
196
+ - MEMORY.md is an **index** — pointer lines only, no frontmatter, no long content
197
+ - Lines after 200 (or 25KB) are not loaded at session start — keep MEMORY.md concise
198
+ - Global auto memory is machine-local; for team-shared use repo-local and commit to git
199
+ - Verify facts before recommending — memory can go stale; re-read the code when acting
200
+ - When the user says "don't use memory," do not cite or act on it for this session
201
+ - For a memory that names a file/function/flag — grep before relying on it
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: Integration tests hit a real database
3
+ description: Never mock the DB in integration tests — prior incident taught the team this
4
+ type: feedback
5
+ ---
6
+
7
+ Integration tests must hit a real database, not mocks.
8
+
9
+ **Why:** Prior incident (2025-Q4) — mocked tests passed but a prod migration failed because the mock diverged from the real schema. Team agreed to never mock the DB in integration tests afterwards.
10
+
11
+ **How to apply:** Whenever writing or reviewing tests under `tests/integration/`, `apps/*/tests/integration/`, or anything tagged `@integration`. Unit tests may still mock. If you see a mock in an integration test, flag it.
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: Auth middleware rewrite is compliance-driven
3
+ description: Compliance context for the auth rewrite — affects scope decisions
4
+ type: project
5
+ ---
6
+
7
+ Auth middleware rewrite is driven by legal/compliance requirements around session token storage, not tech-debt cleanup.
8
+
9
+ **Why:** Legal flagged the current middleware in 2026-Q1 because session tokens are stored in a way that doesn't meet the new compliance requirements. Deadline: 2026-05-15.
10
+
11
+ **How to apply:** When making scope decisions on this rewrite, favour compliance over ergonomics. Don't add unrelated refactors. Don't defer compliance work for "cleaner" architecture. If asked to trade off — compliance wins.
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: Pipeline bugs tracked in Linear INGEST
3
+ description: External system pointer for pipeline-related tickets and dashboards
4
+ type: reference
5
+ ---
6
+
7
+ Pipeline bugs are tracked in Linear project **INGEST** (https://linear.app/acme/team/INGEST).
8
+
9
+ Related dashboards:
10
+ - `grafana.internal/d/api-latency` — oncall latency dashboard; check when editing request-path code
11
+ - `https://status.acme.com/pipeline` — customer-facing pipeline status
12
+
13
+ When the user mentions a pipeline bug by ID (e.g. INGEST-4123), look there first.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: User role and frontend experience
3
+ description: User's technical background — use to calibrate explanation depth
4
+ type: user
5
+ ---
6
+
7
+ User has deep Go backend experience (10+ years) and is newly touching the React side of this repo.
8
+
9
+ Frame frontend explanations in terms of backend analogues:
10
+ - Components ≈ structs + methods
11
+ - Hooks ≈ middleware-like composition
12
+ - React state ≈ mutex-guarded field on a struct
13
+
14
+ Skip JS fundamentals (closures, async). Go deeper on React-specific patterns (render cycles, effect semantics, ref semantics).
@@ -0,0 +1,59 @@
1
+ # Memory Types Reference
2
+
3
+ Four discrete types of auto-memory entries. Pick by content, not by user phrasing.
4
+
5
+ ## `user`
6
+
7
+ **Contains:** role, goals, responsibilities, existing knowledge.
8
+
9
+ **Save when:** you learn details about who the user is or how they collaborate. Tailors future behaviour.
10
+
11
+ **Skip when:** the info would be a negative judgement, or it's not relevant to work.
12
+
13
+ **Example trigger:** "I'm a data scientist investigating logging."
14
+
15
+ ## `feedback`
16
+
17
+ **Contains:** guidance the user has given about how to approach work — corrections AND confirmations.
18
+
19
+ **Save when:**
20
+ - User corrects you ("no not that", "don't", "stop")
21
+ - User confirms a non-obvious approach worked ("yes exactly", "that was the right call")
22
+
23
+ **Structure:** rule → **Why:** (reason) → **How to apply:** (when).
24
+
25
+ **Example trigger:** "stop summarizing at the end of every response."
26
+
27
+ Record successes too — otherwise you drift toward cautious defaults and away from validated approaches.
28
+
29
+ ## `project`
30
+
31
+ **Contains:** ongoing work context — goals, deadlines, incidents, stakeholders, WHY behind initiatives.
32
+
33
+ **Save when:** you learn who is doing what, why, or by when — things not derivable from code or git history.
34
+
35
+ **Convert dates to absolute** when saving (never "Thursday" — always `2026-04-23`).
36
+
37
+ **Structure:** fact → **Why:** → **How to apply:**.
38
+
39
+ **Example trigger:** "we're freezing after Thursday for the mobile cut."
40
+
41
+ Project memories decay fast. The **Why** helps future-you judge whether the memory is still load-bearing.
42
+
43
+ ## `reference`
44
+
45
+ **Contains:** pointers to external systems (Linear, Slack, Grafana, Notion, Confluence).
46
+
47
+ **Save when:** user mentions a resource by name. Memory just says *where to look*.
48
+
49
+ **Example trigger:** "the Grafana dashboard at grafana.internal/d/api-latency is what oncall watches."
50
+
51
+ ## What NOT to save (any type)
52
+
53
+ - Code patterns, file paths, project structure (re-derivable from code)
54
+ - Git history, who-changed-what (`git log`, `git blame` are authoritative)
55
+ - Debugging fixes (already in the commit; PR body has the why)
56
+ - CLAUDE.md content (that's a different mechanism)
57
+ - Ephemeral task state (in-progress work, current conversation)
58
+
59
+ Applies **even when the user asks you to save**. If they ask to save a PR list, ask what was *surprising* — that's the part worth keeping.
@@ -0,0 +1,62 @@
1
+ # When to Save vs Skip
2
+
3
+ Decision tree for auto-memory entries.
4
+
5
+ ## Save immediately
6
+
7
+ | Signal | Type |
8
+ |--------|------|
9
+ | User corrects you ("no", "don't", "stop") | feedback |
10
+ | User confirms a non-obvious choice worked | feedback |
11
+ | User shares their role, experience, preferences | user |
12
+ | User explains **why** something is the way it is | project |
13
+ | User names an external system (ticket tracker, dashboard, channel) | reference |
14
+ | User says "remember this" / "save this" | pick by content |
15
+
16
+ ## Skip
17
+
18
+ - "What's the status of X?" — derivable from code/DB, don't save
19
+ - "Here's the PR list" — derivable from `gh pr list`, don't save unless something was surprising
20
+ - Fix you just made — the commit has the why, don't duplicate
21
+ - Architecture you just read — re-read when needed
22
+
23
+ ## Update an existing entry instead of creating
24
+
25
+ Before writing a new file:
26
+
27
+ ```bash
28
+ ls ~/.claude/projects/<project>/memory/ | grep -i {topic}
29
+ ```
30
+
31
+ If anything matches:
32
+ - Fact has changed → edit the existing file, update description if needed
33
+ - New angle on same topic → merge into existing, keep one file per topic
34
+
35
+ ## Remove stale entries
36
+
37
+ When a memory turns out wrong:
38
+
39
+ 1. Delete the file
40
+ 2. Remove the index line from MEMORY.md
41
+
42
+ When a memory references something that no longer exists (file renamed/removed):
43
+
44
+ 1. Grep the codebase for the referenced symbol/path
45
+ 2. If truly gone, delete the memory
46
+ 3. If renamed, update the memory
47
+
48
+ ## Verify before acting
49
+
50
+ A memory naming a specific function, file, or flag is a claim that it existed *when written*. Before recommending it:
51
+
52
+ - Memory names a file path → check the file exists
53
+ - Memory names a function or flag → grep for it
54
+ - User is about to act on your recommendation → always verify first
55
+
56
+ "Memory says X exists" is not the same as "X exists now."
57
+
58
+ ## Session gates
59
+
60
+ - `/clear` wipes conversation context but NOT memory — memory reloads on next session
61
+ - When the user says "ignore memory" or "don't use memory" — do not cite or act on memory content for this session; do not say "memory says X"
62
+ - When memory conflicts with current code — trust the code, update or remove the stale memory
@@ -0,0 +1,4 @@
1
+ # Memory
2
+
3
+ - [Entry title](filename.md) — one-line hook under ~150 chars
4
+ - [Another entry](another.md) — one-line hook
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: Entry title
3
+ description: One-line relevance hint — future sessions read this to decide if the memory matters
4
+ type: user | feedback | project | reference
5
+ ---
6
+
7
+ [Memory content]
8
+
9
+ # For feedback and project types, structure as:
10
+
11
+ The rule or fact itself in one sentence.
12
+
13
+ **Why:** The reason the user gave — often a past incident or strong preference.
14
+
15
+ **How to apply:** When/where this guidance kicks in, so future-you can judge edge cases.
@@ -0,0 +1,99 @@
1
+ ---
2
+ scope: org-shared
3
+ name: cbp-build-cc-mode
4
+ description: Audit + apply the CHK-109 model/effort matrix across every authoring skill and agent under `packages/codebyplan-package/templates/`. Bare invocation walks all SKILL.md and AGENT.md files and reports frontmatter gaps; with a path argument, edits the target file's frontmatter to the matrix-decided values.
5
+ argument-hint: "[path-to-agent-or-skill]"
6
+ allowed-tools: Read, Write, Edit, Glob, Grep
7
+ effort: xhigh
8
+ ---
9
+
10
+ # Build CC Mode
11
+
12
+ Audit or apply the canonical `model:` + `effort:` frontmatter convention across every authoring-source skill (`packages/codebyplan-package/templates/skills/*/SKILL.md`) and agent (`packages/codebyplan-package/templates/agents/*.md`). Bare invocation = audit; path argument = apply.
13
+
14
+ ## When to Use
15
+
16
+ - Authoring a new agent or skill — look up the matrix below to pick the right `model` + `effort` before writing the frontmatter.
17
+ - Sweeping `packages/codebyplan-package/templates/` for conformance after a refactor or version bump.
18
+ - Onboarding a new exception (e.g., a fresh haiku-low skill) — record the rationale in the matrix here first, then apply.
19
+
20
+ ## Decision Matrix
21
+
22
+ ### Default (applies to all agents and most skills)
23
+
24
+ `model: sonnet` + `effort: xhigh`
25
+
26
+ Eleven of the 12 authoring agents take the default (`cbp-cc-executor`, `cbp-database-agent`, `cbp-improve-claude`, `cbp-improve-round`, `cbp-research`, `cbp-round-executor`, `cbp-security-agent`, `cbp-task-check`, `cbp-task-planner`, `cbp-test-e2e-agent`, `cbp-testing-qa-agent`). The 12th — `cbp-mechanical-edits` — is an explicit haiku-low exception (see below). 27 skills take the default: cbp-round-start, cbp-round-input, cbp-round-execute, cbp-task-create, cbp-task-start, cbp-task-complete, cbp-task-testing, cbp-checkpoint-create, cbp-checkpoint-check, cbp-checkpoint-end, cbp-build-cc-mode, cbp-build-cc-agent, cbp-build-cc-skill, cbp-build-cc-rule, cbp-build-cc-claude-file, cbp-build-cc-memory, cbp-build-cc-settings, cbp-frontend-a11y, cbp-frontend-design, cbp-frontend-ui, cbp-frontend-ux, cbp-session-end, cbp-ship, cbp-ship-configure, cbp-supabase-setup, cbp-supabase-migrate, cbp-supabase-branch-check.
27
+
28
+ ### Effort-lowered skills (5)
29
+
30
+ `model: sonnet` + `effort: high`. Opus reasoning retained; effort dropped from `xhigh` because the skill body is summary/dispatch rather than deep authoring.
31
+
32
+ | skill | model | effort | reason |
33
+ | ----------------- | ------ | ------ | ----------------------------------------------------------------------------------------------------------------- |
34
+ | cbp-round-end | sonnet | high | Spawns cbp-improve-round agent; skill body summarises + presents user findings-decision — lighter than xhigh suffices |
35
+ | cbp-task-check | sonnet | high | Thin orchestrator over spawned cbp-task-check agent; inline-fallback path keeps Opus for safety |
36
+ | cbp-checkpoint-update | sonnet | high | Status updates + context patches mostly; lighter than xhigh |
37
+ | cbp-ship-main | sonnet | high | Production-impacting PR creation; keep Opus reasoning but drop effort |
38
+ | cbp-merge-main | sonnet | high | Long-lived-branch integration merge — surgical conflict resolution, no authoring |
39
+
40
+ ### Haiku-low skills (9)
41
+
42
+ `model: haiku` + `effort: low`. Pure mechanical / dispatch / templated work.
43
+
44
+ | skill | model | effort | reason |
45
+ | ---------------------- | ----- | ------ | ---------------------------------------------------------------------------------------- |
46
+ | cbp-round-update | haiku | low | Pure mechanical: read git status, check approvals, route per rules |
47
+ | cbp-round-check | haiku | low | Run build/lint/types commands, parse output, update QA |
48
+ | cbp-todo | haiku | low | Dispatch: single MCP call + route to next command |
49
+ | cbp-checkpoint-complete | haiku | low | Pure finalization — mark completed, write summary; judgment happened in checkpoint-check |
50
+ | cbp-git-commit | haiku | low | Conventional-commit message authoring is templated; never-git-add rule codified |
51
+ | cbp-git-branch-feat-create | haiku | low | Mechanical: read config, checkout production branch (main), create branch, push |
52
+ | cbp-git-worktree-create | haiku | low | Mechanical: git worktree add + .claude/ copy + MCP register |
53
+ | cbp-git-worktree-remove | haiku | low | Mechanical: git worktree remove + cleanup + MCP deregister |
54
+ | cbp-session-start | haiku | low | Dispatch: MCP health check, activate session, fetch logs, auto-trigger /cbp-todo |
55
+
56
+ ### Haiku-low agents (1)
57
+
58
+ `model: haiku` + `effort: low`. The 12th authoring agent — pure I/O mechanical work, never authors logic.
59
+
60
+ | agent | model | effort | reason |
61
+ | -------------------- | ----- | ------ | ----------------------------------------------------------------------------------- |
62
+ | cbp-mechanical-edits | haiku | low | Mechanical rename/substitution/frontmatter-edit subagent; no judgment, pure dispatch |
63
+
64
+ ## Precedence Rule
65
+
66
+ A skill's `model:` / `effort:` apply to the inline-running turn (the orchestrator turn that invokes the skill). An agent's `model:` / `effort:` apply to the spawned/forked subagent context. For `context: fork` skills, the agent specified in `agent:` governs the forked subagent (per the official Claude Code spec). The two surfaces scope to different execution contexts and do not conflict.
67
+
68
+ ## Model Alias vs Pinned
69
+
70
+ Pinned (`sonnet`) is the default convention for explicit version-pinning of work that depends on a specific frontier model's reasoning quality. Alias (`haiku`) is acceptable only for explicit lowering exceptions where the alias-tracked latest of that family is desired (the 10 haiku-low entries above). `model: inherit` is NOT permitted in authoring — every file under `packages/codebyplan-package/templates/` states its model explicitly so the matrix is auditable.
71
+
72
+ ## Audit Mode
73
+
74
+ Invoked with no arguments. Procedure:
75
+
76
+ 1. Glob `packages/codebyplan-package/templates/agents/*.md` and `packages/codebyplan-package/templates/skills/*/SKILL.md`.
77
+ 2. For each file, read the frontmatter and parse `model:` + `effort:`.
78
+ 3. Look up the expected values from the matrix above (file basename or `name:` frontmatter field is the lookup key).
79
+ 4. Emit a pipe-delimited table line per file: `path | current_model/current_effort | expected_model/expected_effort | status`.
80
+ 5. Status values:
81
+ - `ok` — current matches expected
82
+ - `gap` — missing field, or current value differs from expected
83
+ - `deprecated` — uses `model: sonnet` (legacy alias; migrate to `sonnet`)
84
+ 6. Print a summary line at the end: total files audited, count `ok`, count `gap`, count `deprecated`.
85
+
86
+ The audit is read-only — no edits performed.
87
+
88
+ ## Apply Mode
89
+
90
+ Invoked with a path argument (the target `SKILL.md` or `AGENT.md`). Procedure:
91
+
92
+ 1. Read the file. Identify the skill or agent name from the `name:` frontmatter field (or from the path basename if `name:` is absent).
93
+ 2. Look up target `model` + `effort` from the matrix above.
94
+ 3. Use Edit to set the frontmatter `model:` and `effort:` lines to the target values. Preserve every other frontmatter field and the entire file body. Files whose current status is `deprecated` (legacy `model: sonnet`) follow the same path — the deprecated label is informational; the remediation action is identical to `gap`.
95
+ 4. If the name is NOT in the matrix, surface to the user via AskUserQuestion: current state, propose the default (`sonnet` / `xhigh`), ask whether to (a) add an exception entry to this skill's matrix first, or (b) apply the default.
96
+
97
+ ## Self-Conformance
98
+
99
+ This skill's own frontmatter sits at the default (`sonnet` / `xhigh`). The first audit run after this skill is authored MUST emit `ok` for `packages/codebyplan-package/templates/skills/cbp-build-cc-mode/SKILL.md` — if it doesn't, the matrix is out of sync with reality and must be reconciled before any further apply.