codebyplan 1.13.28 → 1.13.30
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/dist/cli.js +728 -18
- package/package.json +1 -1
- package/templates/README.md +16 -13
- package/templates/agents/cbp-cc-executor.md +6 -9
- package/templates/agents/cbp-improve-round.md +1 -1
- package/templates/agents/cbp-round-executor.md +1 -2
- package/templates/agents/cbp-task-check.md +12 -8
- package/templates/hooks/cbp-mcp-round-sync.sh +9 -0
- package/templates/rules/README.md +13 -8
- package/templates/rules/cbp-operating-gotchas.md +64 -0
- package/templates/settings.project.base.json +3 -3
- package/templates/skills/cbp-build-cc-agent/SKILL.md +3 -4
- package/templates/skills/cbp-build-cc-agent/examples/with-skills-preload.md +2 -3
- package/templates/skills/cbp-build-cc-agent/reference/frontmatter-fields.md +0 -1
- package/templates/skills/cbp-build-cc-agent/scripts/validate-agent.sh +0 -6
- package/templates/skills/cbp-build-cc-agent/templates/agent.md +1 -2
- package/templates/skills/cbp-build-cc-claude-file/SKILL.md +16 -2
- package/templates/skills/cbp-build-cc-claude-file/reference/what-belongs.md +1 -1
- package/templates/skills/cbp-build-cc-mode/SKILL.md +5 -4
- package/templates/skills/cbp-build-cc-rule/SKILL.md +2 -2
- package/templates/skills/cbp-build-cc-settings/reference/cbp-permission-policy.md +3 -2
- package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +1 -1
- package/templates/skills/cbp-merge-main/SKILL.md +1 -1
- package/templates/skills/cbp-round-complete/SKILL.md +164 -0
- package/templates/skills/cbp-round-end/SKILL.md +16 -14
- package/templates/skills/cbp-round-end/reference/findings-presentation.md +7 -17
- package/templates/skills/cbp-round-execute/SKILL.md +4 -0
- package/templates/skills/cbp-round-input/SKILL.md +6 -6
- package/templates/skills/cbp-round-start/SKILL.md +12 -15
- package/templates/skills/cbp-round-update/SKILL.md +31 -143
- package/templates/skills/cbp-standalone-task-check/SKILL.md +2 -2
- package/templates/skills/cbp-standalone-task-complete/SKILL.md +4 -3
- package/templates/skills/cbp-standalone-task-testing/SKILL.md +4 -4
- package/templates/skills/cbp-task-check/SKILL.md +3 -3
- package/templates/skills/cbp-task-complete/SKILL.md +7 -6
- package/templates/skills/cbp-task-testing/SKILL.md +3 -5
- package/templates/skills/cbp-todo/SKILL.md +1 -1
- package/templates/skills/cbp-build-cc-memory/SKILL.md +0 -201
- package/templates/skills/cbp-build-cc-memory/examples/feedback-memory.md +0 -11
- package/templates/skills/cbp-build-cc-memory/examples/project-memory.md +0 -11
- package/templates/skills/cbp-build-cc-memory/examples/reference-memory.md +0 -13
- package/templates/skills/cbp-build-cc-memory/examples/user-memory.md +0 -14
- package/templates/skills/cbp-build-cc-memory/reference/memory-types.md +0 -59
- package/templates/skills/cbp-build-cc-memory/reference/when-to-save.md +0 -62
- package/templates/skills/cbp-build-cc-memory/templates/MEMORY-index.md +0 -4
- package/templates/skills/cbp-build-cc-memory/templates/memory-entry.md +0 -15
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
scope: org-shared
|
|
3
3
|
name: cbp-round-update
|
|
4
|
-
description:
|
|
4
|
+
description: Triage a finished round (Claude-only) and route to round-complete or round-input
|
|
5
5
|
argument-hint: [chk-task-round | task-round]
|
|
6
|
-
triggers: [cbp-round-
|
|
6
|
+
triggers: [cbp-round-complete, cbp-round-input]
|
|
7
7
|
effort: low
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -17,28 +17,24 @@ Inspect the resolved identifier from argument parsing to determine the task kind
|
|
|
17
17
|
| `{chk}-{task}-{round}` (3-segment, e.g. `141-3-1`) | `checkpoint` |
|
|
18
18
|
| _(empty / free-text)_ | Check `get_current_standalone_task` first; if found → `standalone`. Else → `checkpoint` via `get_current_task`. |
|
|
19
19
|
|
|
20
|
-
Set `KIND` for the rest of this skill. MCP tool names vary by KIND:
|
|
20
|
+
Set `KIND` for the rest of this skill. round-update is **read + triage only** — it reads round state and routes; it never completes the round or writes file approvals. MCP read/audit tool names vary by KIND:
|
|
21
21
|
|
|
22
22
|
| Operation | `checkpoint` KIND | `standalone` KIND |
|
|
23
23
|
|-----------|------------------|-------------------|
|
|
24
24
|
| Get task | `get_current_task(repo_id)` | `get_current_standalone_task(repo_id)` |
|
|
25
25
|
| Get rounds | `get_rounds(task_id)` | `get_standalone_rounds(standalone_task_id)` |
|
|
26
|
-
|
|
|
27
|
-
| Update round | `update_round(round_id, ...)` | `update_standalone_round(standalone_round_id, ...)` |
|
|
28
|
-
| Complete round | `complete_round(round_id, duration_minutes?)` | `complete_standalone_round(standalone_round_id, duration_minutes?, caller_worktree_id)` ⚠️ `caller_worktree_id` is REQUIRED for standalone |
|
|
29
|
-
| Update task | `update_task(task_id, ...)` | `update_standalone_task(standalone_task_id, ...)` |
|
|
26
|
+
| Update round (audit only) | `update_round(round_id, ...)` | `update_standalone_round(standalone_round_id, ...)` |
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Checks file approval status, completes the round, and routes to next step. NEVER asks the user to git add or stage anything — it only reads current state.
|
|
28
|
+
The completion + file-approval reconcile (`sync-approvals`, `complete_round` / `complete_standalone_round`) now lives in `/cbp-round-complete`.
|
|
34
29
|
|
|
35
|
-
|
|
30
|
+
# Round Update Command
|
|
36
31
|
|
|
37
|
-
|
|
32
|
+
**Claude-only, autonomous triage.** round-update inspects a finished round's automated state — which files Claude approved (`claude_approved`), whether testing-QA hard-failed, and whether `improve-round` left outstanding findings — and routes to exactly one next step. It makes **no writes** beyond an audit breadcrumb and **never prompts the user**: it is auto-triggered by `/cbp-round-end` and runs without a confirmation gate. The user-facing confirmation has moved to `/cbp-round-complete` (an `ask`-tier permission prompt). round-update NEVER reads or touches git staging — user approval is reconciled later by `/cbp-round-complete`.
|
|
38
33
|
|
|
39
|
-
|
|
34
|
+
## Routing in one line
|
|
40
35
|
|
|
41
|
-
|
|
36
|
+
- **Round is clean** → trigger `/cbp-round-complete` (the permission-gated finalizer reconciles your `git add`s and completes the round).
|
|
37
|
+
- **Round needs more work** → trigger `/cbp-round-input` (more changes / planning).
|
|
42
38
|
|
|
43
39
|
## Instructions
|
|
44
40
|
|
|
@@ -82,147 +78,39 @@ Given the parse from Step 1:
|
|
|
82
78
|
|
|
83
79
|
If no task found: `No active task. Nothing to update.`
|
|
84
80
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Step 1 (parse) and Step 1.5 (resolve task + round) are read-only. Step 2 onward mutates state — the `sync-approvals` CLI write, `complete_round`, and the auto-trigger of the next step. Before any of that, confirm the user wants this skill to run.
|
|
88
|
-
|
|
89
|
-
This gate fires on **every** invocation — manual, auto-triggered by `/cbp-round-end`, and on every iteration of the Step 4 auto-loop. There is no bypass. It sits **before** and is independent of the top-of-file HARD GATE (which governs Step 2's exit code, not user consent), and it is distinct from the Branch A clean-exit route choice in Step 5 (that one picks where to go next; this one authorizes running at all).
|
|
90
|
-
|
|
91
|
-
Ask via AskUserQuestion, naming the resolved round and disclosing the actions:
|
|
92
|
-
|
|
93
|
-
> Update ROUND-{N} of TASK-{M}?
|
|
94
|
-
> This will sync the git diff + file approvals, complete the round, and route to the next step (which may auto-start a new round).
|
|
95
|
-
>
|
|
96
|
-
> - **Proceed** — run the skill
|
|
97
|
-
> - **Cancel** — do nothing
|
|
98
|
-
|
|
99
|
-
- **Proceed** → continue to Step 2.
|
|
100
|
-
- **Cancel** → abort cleanly: make NO writes (no `sync-approvals`, no `complete_round`, no auto-trigger) and exit with one line: `Cancelled by user — ROUND-{N} not updated.`
|
|
101
|
-
|
|
102
|
-
### Step 2: Sync git diff + approvals via CLI
|
|
103
|
-
|
|
104
|
-
Run:
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
npx codebyplan round sync-approvals --round-id <round_id> --task-id <task_id>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
The CLI auto-resolves the caller worktree id with the following precedence:
|
|
111
|
-
1. `--caller-worktree-id <uuid>` override (if passed — skips all resolution)
|
|
112
|
-
2. Per-device branch-keyed cache (`.codebyplan/worktree.local.json`)
|
|
113
|
-
3. In-process tuple API call: `POST /worktrees/resolve` using `(device_id, repo_path, branch)`
|
|
114
|
-
|
|
115
|
-
On the write path (non `--dry-run`), if the worktree id cannot be resolved the CLI **hard-fails with exit 1** and prints an actionable message. To pre-populate the cache:
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
npx codebyplan resolve-worktree --cache
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
If this worktree is not yet registered, run `npx codebyplan setup` first, then re-run `/cbp-round-update`.
|
|
122
|
-
|
|
123
|
-
The CLI parses `git status --short`, merges drift + staging + web-UI flag, and writes both round and task (forwarding `caller_worktree_id` on both writes so the server honors the feat-worktree lock).
|
|
124
|
-
|
|
125
|
-
Read the stdout JSON: `{ added, stale_marked, reactivated, total_files }`.
|
|
126
|
-
|
|
127
|
-
If the command exits non-zero, surface the stderr and STOP. Do NOT proceed to Step 3.
|
|
128
|
-
|
|
129
|
-
### Step 3: Complete Round
|
|
130
|
-
|
|
131
|
-
Calculate duration from `started_at` to now in minutes.
|
|
132
|
-
|
|
133
|
-
- **checkpoint KIND**: MCP `complete_round(round_id, duration_minutes)`.
|
|
134
|
-
- **standalone KIND**: MCP `complete_standalone_round(standalone_round_id, duration_minutes, caller_worktree_id)`. ⚠️ `caller_worktree_id` is REQUIRED — resolve via `CALLER_WT=$(npx codebyplan resolve-worktree 2>/dev/null)`. If `CALLER_WT` is empty, surface this warning and ask user to confirm before proceeding:
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
Warning: could not resolve caller_worktree_id (npx codebyplan resolve-worktree returned empty).
|
|
138
|
-
The complete_standalone_round call may be rejected by the pre-guard. Proceed anyway? (yes / no)
|
|
139
|
-
```
|
|
81
|
+
This step is **read-only**. There is no permission gate — round-update is autonomous (see the Key Rules below).
|
|
140
82
|
|
|
141
|
-
|
|
83
|
+
### Step 2: Triage the Round
|
|
142
84
|
|
|
143
|
-
|
|
85
|
+
Read the latest round's context: `round.context.testing_qa_output.totals.hard_fail`, `round.context.improve_round_findings[]`, `round.context.round_type`, and `round.files_changed[]` (each entry's `claude_approved`). Compute a single `clean` verdict:
|
|
144
86
|
|
|
145
|
-
|
|
87
|
+
- **Survey round** (`round.context.round_type === 'survey'`): no file diff exists, so QA/approval predicates do not apply. `clean = improve_round_findings[]` is empty.
|
|
88
|
+
- **Normal round**: `clean = (every file in files_changed[] has claude_approved === true) AND testing_qa_output.totals.hard_fail === false AND improve_round_findings[]` is empty.
|
|
146
89
|
|
|
147
|
-
|
|
90
|
+
Display a one-line triage summary, e.g. `"ROUND-N triage: clean"` or `"ROUND-N triage: N findings / hard_fail=true → needs another round"`. round-update reads `claude_approved` only — it does **not** read git staging or `user_approved`; those belong to `/cbp-round-complete`.
|
|
148
91
|
|
|
149
|
-
|
|
150
|
-
2. **If `next_index > (round.context.auto_loop_cap ?? 5)`**: surface the cap-exhausted prompt via AskUserQuestion (options: extend cap, stop loop / drop into round-input, close task as-is). Persist `round.context.auto_loop_cap_exhausted = { user_choice, decided_at }` and route per choice.
|
|
151
|
-
3. **Otherwise**: persist `round.context.auto_loop_decision = { spawned_next: true, next_index, decided_at }` on the CURRENT round via `update_round` / `update_standalone_round` per KIND (audit trail), then auto-trigger `/cbp-round-input` with NO AskUserQuestion. Pass `auto_loop_mode: true`, `auto_loop_index: next_index`, `auto_loop_cap: (prior cap ?? 5)` forward — round-start Step 4 persists them on the new round.
|
|
92
|
+
### Step 3: Route
|
|
152
93
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
If BOTH signals are clean, fall through to Step 5 (exit routing).
|
|
156
|
-
|
|
157
|
-
### Step 5: Exit Routing
|
|
158
|
-
|
|
159
|
-
**5a: Count files** — Display: `"Files: X total, Y approved, Z pending"`
|
|
160
|
-
|
|
161
|
-
**5b: Route with four branches** (Step 4 already handled the dirty-loop case; Step 5 is the clean-exit path).
|
|
162
|
-
|
|
163
|
-
**Branch D — IF `round.context.round_type === 'survey'` (checked FIRST):**
|
|
164
|
-
|
|
165
|
-
Survey rounds produce no file diff; A/B/C predicates assume `files_changed[]` non-empty. Survey routing is decided by `improve_round_findings[]` instead:
|
|
166
|
-
|
|
167
|
-
- `improve_round_findings[]` non-empty → auto-trigger `/cbp-round-input`
|
|
168
|
-
- `improve_round_findings[]` empty → checkpoint KIND: auto-trigger `/cbp-task-check`; standalone KIND: auto-trigger `/cbp-standalone-task-check`
|
|
169
|
-
|
|
170
|
-
Output: `"## Round [N] Complete — Survey Round"` with duration, files=0, findings count, routing message. Skip Branches A/B/C.
|
|
171
|
-
|
|
172
|
-
**Branch A — ELSE IF all files have `user_approved: true`:**
|
|
173
|
-
|
|
174
|
-
```
|
|
175
|
-
## Round [N] Complete - All Files Approved
|
|
176
|
-
|
|
177
|
-
**Duration**: [N] minutes
|
|
178
|
-
**Files**: [X] total, [X] approved, 0 pending
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
Surface AskUserQuestion (clean-exit user-gate):
|
|
182
|
-
|
|
183
|
-
- **(a) close & complete round** → checkpoint KIND: auto-trigger `/cbp-task-check`; standalone KIND: auto-trigger `/cbp-standalone-task-check`
|
|
184
|
-
- **(b) start new round** → auto-trigger `/cbp-round-input`
|
|
185
|
-
|
|
186
|
-
Persist `round.context.auto_loop_exit = { staged_count, unstaged_count, route, decided_at }`.
|
|
187
|
-
|
|
188
|
-
**Branch B — ELSE IF unapproved files exist AND every unapproved file has `claude_approved: true` AND `testing_qa_output.totals.hard_fail: false` AND no `improve_round_findings[]`:**
|
|
189
|
-
|
|
190
|
-
The clean-but-unstaged staging-gate case. Mode-dependent:
|
|
191
|
-
|
|
192
|
-
- **Auto-loop exit** (the completed round had `auto_loop_mode === true` on its context AND Step 4 fell through here with BOTH signals clean): surface the Branch A clean-exit user-gate — do NOT auto-trigger `/cbp-round-input`. Branch B's entry condition already requires `no improve_round_findings[]`, so the auto-loop's verbatim-from-findings procedure has no input to formulate requirements from; auto-triggering round-input would loop on an empty input. Persist `round.context.auto_loop_exit.degenerate_empty_findings: true` (degenerate sub-case: no findings to feed round-input, so surface the clean-exit user-gate above instead of auto-triggering).
|
|
193
|
-
- **Manual round**: emit staging-gate prompt and STOP. User stages files (never-git-add rule) and re-invokes; command then falls into Branch A.
|
|
194
|
-
|
|
195
|
-
Manual-mode prompt:
|
|
196
|
-
|
|
197
|
-
```
|
|
198
|
-
## Round [N] Complete — Files Pending Staging
|
|
199
|
-
|
|
200
|
-
**Files**: [X] total, [Y] approved, [Z] pending
|
|
201
|
-
|
|
202
|
-
### Pending (passed all checks; not yet staged):
|
|
203
|
-
- [path]
|
|
204
|
-
|
|
205
|
-
Stage them (`git add <path>`) and re-run `/cbp-round-update` to proceed.
|
|
206
|
-
Waiting for user to stage files.
|
|
207
|
-
```
|
|
94
|
+
**3a — Clean → `/cbp-round-complete`.** Auto-trigger `/cbp-round-complete`. round-complete is `ask`-tier: the harness shows a permission prompt (the user's confirmation to finalize the round). round-complete then reconciles the user's `git add`s, completes the round, and routes onward (all files staged → task-check; some withheld → round-input). round-update writes nothing here beyond the Step 2 summary. In `auto_loop_mode`, a clean triage is the loop's success exit — the loop continues only via the not-clean path in 3b; round-complete owns the degenerate clean-but-unstaged guard.
|
|
208
95
|
|
|
209
|
-
**
|
|
96
|
+
**3b — Not clean → `/cbp-round-input`.** More changes or planning are needed. Routing is **independent of git staging** — round-input is reachable whether or not the user has staged anything (it performs its own deep analysis of the unapproved files). Two sub-cases:
|
|
210
97
|
|
|
211
|
-
|
|
98
|
+
- **Auto-loop** (`round.context.auto_loop_mode === true`): compute `next_index = (round.context.auto_loop_index ?? 0) + 1`.
|
|
99
|
+
- If `next_index > (round.context.auto_loop_cap ?? 5)`: surface the cap-exhausted prompt via AskUserQuestion (a genuine multi-option user decision — keep it). Options: extend cap, stop loop / drop into round-input, close task as-is. Persist `round.context.auto_loop_cap_exhausted = { user_choice, decided_at }` and route per choice.
|
|
100
|
+
- Otherwise: persist `round.context.auto_loop_decision = { spawned_next: true, next_index, decided_at }` on the current round via `update_round` / `update_standalone_round` (audit trail), then auto-trigger `/cbp-round-input` with NO prompt. Pass `auto_loop_mode: true`, `auto_loop_index: next_index`, `auto_loop_cap: (prior cap ?? 5)` forward — round-start Step 4 persists them on the new round.
|
|
101
|
+
- **Manual round**: auto-trigger `/cbp-round-input` directly (no prompt).
|
|
212
102
|
|
|
213
103
|
## Key Rules
|
|
214
104
|
|
|
215
|
-
- **
|
|
216
|
-
- **
|
|
217
|
-
- **
|
|
218
|
-
- **
|
|
219
|
-
-
|
|
220
|
-
- **standalone KIND Step 3**: `caller_worktree_id` is REQUIRED for `complete_standalone_round` — always resolve and pass it.
|
|
105
|
+
- **Autonomous + Claude-only** — round-update never prompts before running. It is auto-triggered by `/cbp-round-end`. The confirmation step is `/cbp-round-complete`'s `ask`-tier permission prompt, not an AskUserQuestion here. (The auto-loop cap-exhausted AskUserQuestion in Step 3b is a genuine user decision, not a run gate.)
|
|
106
|
+
- **Triage, never finalize** — round-update does NOT call `sync-approvals`, `complete_round`, or `complete_standalone_round`, and does NOT write file approvals. All of that is `/cbp-round-complete`.
|
|
107
|
+
- **Never touches git** — round-update reads `claude_approved` from the DB only; it never reads staging, asks the user to `git add`, or stages files.
|
|
108
|
+
- **git-add independence** — the "needs more work" route to `/cbp-round-input` fires regardless of whether files are staged. There is no clean-but-unstaged dead-end.
|
|
109
|
+
- **standalone parity** — KIND detection governs which read/audit tools are used; the clean→`/cbp-round-complete` and not-clean→`/cbp-round-input` routing is identical for both KINDs (round-complete and round-input self-detect KIND).
|
|
221
110
|
|
|
222
111
|
## Integration
|
|
223
112
|
|
|
224
|
-
- **Gates**: Step 1.6 permission gate — asks the user to confirm before any side effect; **Cancel** aborts cleanly with no writes. Fires on every invocation incl. the Step 4 auto-loop; sits before and independent of the top-of-file Step 2 hard gate.
|
|
225
113
|
- **Triggered by**: `/cbp-round-end` (auto), or user manually
|
|
226
|
-
- **Reads**: MCP `get_current_task` / `get_current_standalone_task`, `get_rounds` / `get_standalone_rounds` (per KIND);
|
|
227
|
-
- **Writes**: MCP `update_round` / `update_standalone_round`
|
|
228
|
-
- **Triggers**: `/cbp-round-
|
|
114
|
+
- **Reads**: MCP `get_current_task` / `get_current_standalone_task`, `get_rounds` / `get_standalone_rounds` (per KIND); round context (`testing_qa_output`, `improve_round_findings`, `round_type`, `files_changed[].claude_approved`)
|
|
115
|
+
- **Writes**: MCP `update_round` / `update_standalone_round` — audit only (`auto_loop_decision` / `auto_loop_cap_exhausted`). No completion, no file-approval writes.
|
|
116
|
+
- **Triggers**: `/cbp-round-complete` (clean triage — `ask`-tier permission prompt is the user confirmation), `/cbp-round-input` (not-clean triage: outstanding findings, hard-fail, or unapproved Claude checks — fires independent of git staging; also the auto-loop dirty spawn), cap-exhausted prompt routes from Step 3b (any of the three options)
|
|
@@ -17,7 +17,7 @@ If the `cbp-task-check` agent spawn fails for any reason, follow the canonical i
|
|
|
17
17
|
|
|
18
18
|
## When Used
|
|
19
19
|
|
|
20
|
-
- After all rounds complete and all files approved (auto-triggered by `/cbp-round-
|
|
20
|
+
- After all rounds complete and all files approved (auto-triggered by `/cbp-round-complete`)
|
|
21
21
|
- Before `/cbp-standalone-task-testing`
|
|
22
22
|
- Never skippable
|
|
23
23
|
|
|
@@ -149,4 +149,4 @@ Suggest: Approve files, then re-run `/cbp-standalone-task-check {task}`. Stop
|
|
|
149
149
|
- **Reads**: MCP `get_current_standalone_task`, `get_standalone_tasks`, `get_standalone_rounds`, all changed files (via agent)
|
|
150
150
|
- **Writes**: MCP `update_standalone_task` (context.check_verdict)
|
|
151
151
|
- **Triggers**: emits directive `Next: /clear, then /cbp-standalone-task-testing {task}` on READY + satisfied
|
|
152
|
-
- **Triggered by**: `/cbp-round-
|
|
152
|
+
- **Triggered by**: `/cbp-round-complete` (auto, when all files approved)
|
|
@@ -10,6 +10,8 @@ effort: xhigh
|
|
|
10
10
|
|
|
11
11
|
Complete a standalone task. Auto-triggered by `/cbp-standalone-task-testing` when all tests pass. Can also be run manually.
|
|
12
12
|
|
|
13
|
+
This skill is gated by an `ask`-tier `Skill(cbp-standalone-task-complete)` permission rule in `settings.json` (shipped templates). **The permission prompt IS the user confirmation** — there is NO completion-confirmation AskUserQuestion inside this skill (the Step 7.5 `caller_worktree_id` guard is a separate environmental safety prompt, not a flow-control confirmation). A declined permission is a clean no-op (nothing committed, merged, pushed, or completed).
|
|
14
|
+
|
|
13
15
|
## Instructions
|
|
14
16
|
|
|
15
17
|
### Step 1: Parse `$ARGUMENTS`
|
|
@@ -84,9 +86,7 @@ Load `task.qa` and `task.files_changed`:
|
|
|
84
86
|
1. **QA**: count items by status (pass / fail / pending / skipped). If any item has status `fail` or `pending`, warn the user.
|
|
85
87
|
2. **Files**: list any file with `user_approved === false` and warn.
|
|
86
88
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
**If no issues**, AskUserQuestion to confirm: `Ready to complete standalone TASK-[N]: [title] — [N] rounds, [N] files. Proceed?`
|
|
89
|
+
If any QA item is `fail`/`pending` or any file is unapproved, **surface the warnings in the output and continue** — record them for the Step 9 summary. There is NO confirmation AskUserQuestion here: `Skill(cbp-standalone-task-complete)` is `ask`-tier, so the harness permission prompt that gated this skill IS the user's confirmation to complete. The hard gates in Steps 2–2.6 (all rounds completed, ≥1 round has `testing_qa_output`, `check_verdict` READY, `task_testing_output.all_passed`) already block completion when prerequisites are unmet; these QA / file-approval items are warnings, not blockers.
|
|
90
90
|
|
|
91
91
|
### Step 4: Aggregate Files Changed
|
|
92
92
|
|
|
@@ -169,6 +169,7 @@ Apply the `cleanup` skill inline to remove orphan references to deleted/modified
|
|
|
169
169
|
**Files**: [N] changed
|
|
170
170
|
**Commit**: [hash]
|
|
171
171
|
**Branch merged**: [feat-branch] → {PRODUCTION}
|
|
172
|
+
**Warnings**: [any QA / file-approval warnings from Step 3, or "none"]
|
|
172
173
|
```
|
|
173
174
|
|
|
174
175
|
#### Route (single directive — never a menu)
|
|
@@ -9,7 +9,7 @@ effort: xhigh
|
|
|
9
9
|
|
|
10
10
|
# Standalone Task Testing Command
|
|
11
11
|
|
|
12
|
-
Comprehensive task-level testing for standalone tasks —
|
|
12
|
+
Comprehensive task-level testing for standalone tasks — the **cross-round double-check** run once after all rounds complete. Per-round QA (per-app build/lint/types, the `console.log`/debug scan, the OWASP/secret grep, `pnpm audit`) is owned by each round's `testing-qa-agent`; this skill does NOT re-run it. It tests the entire delivered feature holistically across the full task diff — catching cross-package and cross-round problems no single round can see. Runs inline — no sub-agent.
|
|
13
13
|
|
|
14
14
|
## When Used
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ Comprehensive task-level testing for standalone tasks — runs all automated tes
|
|
|
19
19
|
|
|
20
20
|
## Scope vs Round-Level Validation
|
|
21
21
|
|
|
22
|
-
Per-wave `testing-qa-agent` runs inside `/cbp-round-execute` Step 5. This skill adds the cross-
|
|
22
|
+
Per-wave `testing-qa-agent` runs inside `/cbp-round-execute` Step 5 and **owns per-round QA**: per-app build/lint/types, the `console.log`/debug scan, the OWASP/secret full-diff grep, and `pnpm audit`. This skill does NOT repeat them. It adds only the cross-round layer invisible within a single round: workspace-wide lint, workspace tsc, and the full test suite (which catch cross-package breakage), plus the cross-round code review (Step 6.5) and the user manual walkthrough (Step 8).
|
|
23
23
|
|
|
24
24
|
## Instructions
|
|
25
25
|
|
|
@@ -93,9 +93,9 @@ Capture stdout and stderr for each check.
|
|
|
93
93
|
| Full-repo lint | `pnpm -w lint` | Always |
|
|
94
94
|
| Full-repo types | `pnpm exec tsc --noEmit` | Source files changed |
|
|
95
95
|
| Full-repo unit tests | `pnpm test --run` | Source files in aggregated_files |
|
|
96
|
-
| Full-repo audit | `pnpm audit` | Always |
|
|
97
96
|
| Per-package E2E | `pnpm --filter <pkg> e2e:test` | UI files in aggregated_files |
|
|
98
|
-
|
|
97
|
+
|
|
98
|
+
These are the workspace-wide / cross-package checks only — per-app build/lint/types, the `console.log`/debug scan, the OWASP/secret grep, and `pnpm audit` already ran per-round inside `testing-qa-agent` and are NOT repeated here.
|
|
99
99
|
|
|
100
100
|
**Soft tests** (report, don't block):
|
|
101
101
|
|
|
@@ -9,7 +9,7 @@ effort: high
|
|
|
9
9
|
|
|
10
10
|
# Task Check Command
|
|
11
11
|
|
|
12
|
-
AI-driven production readiness review. Spawns the `cbp-task-check` agent for thorough verification including user satisfaction discussion. This command is a thin orchestrator — the agent does the heavy lifting.
|
|
12
|
+
AI-driven production readiness review. Spawns the `cbp-task-check` agent for thorough verification including user satisfaction discussion. This command is a thin orchestrator — the agent does the heavy lifting. It is the **cross-round double-check**: rounds already own per-round QA (debug scan, security grep, audit, per-app build/lint/types), so this layer focuses on holistic concerns visible only across the full task diff — requirements traceability, checkpoint alignment, shippability, holistic code review, and scope drift — never re-running per-round checks.
|
|
13
13
|
|
|
14
14
|
## Inline-Fallback for Spawn Failure
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ Inline-fallback is NOT a quality downgrade trapdoor — every Phase from the age
|
|
|
27
27
|
|
|
28
28
|
## When Used
|
|
29
29
|
|
|
30
|
-
- After all rounds complete and all files approved (auto-triggered by `/cbp-round-
|
|
30
|
+
- After all rounds complete and all files approved (auto-triggered by `/cbp-round-complete`)
|
|
31
31
|
- Before `/cbp-task-testing`
|
|
32
32
|
- `/cbp-task-check` is NEVER skippable
|
|
33
33
|
|
|
@@ -163,4 +163,4 @@ Suggest: Approve files, then re-run `/cbp-task-check`. **STOP HERE** — wait fo
|
|
|
163
163
|
- **Reads**: MCP `get_current_task`, `get_rounds`, all changed files (via agent)
|
|
164
164
|
- **Writes**: MCP `update_task` (context.check_verdict)
|
|
165
165
|
- **Triggers**: emits directive `Next: /clear, then /cbp-task-testing {chk-task}` on READY + satisfied (cross-context — testing is heavyweight, fresh context helps)
|
|
166
|
-
- **Triggered by**: `/cbp-round-
|
|
166
|
+
- **Triggered by**: `/cbp-round-complete` (auto, when all files approved)
|
|
@@ -10,6 +10,8 @@ effort: xhigh
|
|
|
10
10
|
|
|
11
11
|
Complete the current task. Auto-triggered by `/cbp-task-testing` when all tests pass. Can also be run manually.
|
|
12
12
|
|
|
13
|
+
This skill is gated by an `ask`-tier `Skill(cbp-task-complete)` permission rule in `settings.json`. **The permission prompt IS the user confirmation** — there is NO AskUserQuestion inside this skill. A declined permission is a clean no-op (nothing committed, merged, pushed, or completed).
|
|
14
|
+
|
|
13
15
|
## Instructions
|
|
14
16
|
|
|
15
17
|
### Step 1: Parse `$ARGUMENTS`
|
|
@@ -90,12 +92,10 @@ Stop here.
|
|
|
90
92
|
|
|
91
93
|
Load `task.qa` and `task.files_changed`:
|
|
92
94
|
|
|
93
|
-
1. **QA**: count items by status (pass / fail / pending / skipped) across all types.
|
|
94
|
-
2. **Files**: list any file with `user_approved === false
|
|
95
|
-
|
|
96
|
-
**If issues exist**, AskUserQuestion: `Complete anyway` / `Run QA first` (suggest `/cbp-task-check`) / `Cancel`. On `Run QA first` or `Cancel`, stop. On `Complete anyway`, continue.
|
|
95
|
+
1. **QA**: count items by status (pass / fail / pending / skipped) across all types.
|
|
96
|
+
2. **Files**: list any file with `user_approved === false`.
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
If any QA item is `fail`/`pending` or any file is unapproved, **surface the warnings in the output and continue** — record them for the Step 9 summary. There is NO confirmation AskUserQuestion here: `Skill(cbp-task-complete)` is `ask`-tier, so the harness permission prompt that gated this skill IS the user's confirmation to complete. The hard gates in Steps 2–2.6 (all rounds completed, ≥1 round has `testing_qa_output`, `check_verdict` READY, `task_testing_output.all_passed`) already block completion when prerequisites are unmet; these QA / file-approval items are warnings, not blockers.
|
|
99
99
|
|
|
100
100
|
### Step 4: Aggregate Files Changed
|
|
101
101
|
|
|
@@ -142,7 +142,7 @@ Call `complete_task(task_id)`. The server resolves the caller's worktree identit
|
|
|
142
142
|
|
|
143
143
|
Apply the `cleanup` skill inline to remove orphan references to deleted/modified files. Then apply `migration` to propagate renames/moves to consumers. Both run without sub-agent spawns. Skip cleanup if no deletions/modifications; skip migration if cleanup handled everything.
|
|
144
144
|
|
|
145
|
-
### Step 9: Show Result and Route
|
|
145
|
+
### Step 9: Show Result and Route
|
|
146
146
|
|
|
147
147
|
Show the completion summary:
|
|
148
148
|
|
|
@@ -153,6 +153,7 @@ Show the completion summary:
|
|
|
153
153
|
**Rounds**: [N] completed
|
|
154
154
|
**Files**: [N] changed
|
|
155
155
|
**Commit**: [hash]
|
|
156
|
+
**Warnings**: [any QA / file-approval warnings from Step 3, or "none"]
|
|
156
157
|
```
|
|
157
158
|
|
|
158
159
|
Then route. Same-context transitions (next task in this checkpoint) auto-trigger via the Skill tool. Cross-context transitions (checkpoint done → /cbp-checkpoint-check, session end) surface as a single directive 'Next: /clear, then /cbp-X' for the user to invoke after refreshing context.
|
|
@@ -9,7 +9,7 @@ effort: xhigh
|
|
|
9
9
|
|
|
10
10
|
# Task Testing Command
|
|
11
11
|
|
|
12
|
-
Comprehensive task-level testing —
|
|
12
|
+
Comprehensive task-level testing — the **cross-round double-check** run once after all rounds complete. Per-round QA (per-app build/lint/types, the `console.log`/debug scan, the OWASP/secret grep, `pnpm audit`) is owned by each round's `testing-qa-agent`; this skill does NOT re-run it. Instead it tests the **entire delivered feature holistically** across the full task diff — catching cross-package and cross-round problems no single round can see. Runs inline — no sub-agent.
|
|
13
13
|
|
|
14
14
|
## When Used
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ Comprehensive task-level testing — runs all automated tests and walks the user
|
|
|
19
19
|
|
|
20
20
|
## Scope vs Round-Level Validation
|
|
21
21
|
|
|
22
|
-
Per-wave `testing-qa-agent` runs inside `/cbp-round-execute` Step 5. This skill adds the cross-
|
|
22
|
+
Per-wave `testing-qa-agent` runs inside `/cbp-round-execute` Step 5 and **owns per-round QA**: per-app build/lint/types, the `console.log`/debug scan, the OWASP/secret full-diff grep, and `pnpm audit`. This skill does NOT repeat them. It adds only the cross-round layer invisible within a single round: workspace-wide lint, workspace tsc, and the full test suite (which catch cross-package breakage), plus the cross-round code review (Step 6.5), the autonomous sim screenshot loop (Step 6.x), and the user manual walkthrough (Step 8).
|
|
23
23
|
|
|
24
24
|
## Instructions
|
|
25
25
|
|
|
@@ -109,11 +109,9 @@ Capture stdout and stderr for each check.
|
|
|
109
109
|
| Full-repo lint | `pnpm -w lint` | Always |
|
|
110
110
|
| Full-repo types | `pnpm exec tsc --noEmit` | Source files changed |
|
|
111
111
|
| Full-repo unit tests | `pnpm test --run` | Source files in aggregated_files |
|
|
112
|
-
| Full-repo audit | `pnpm audit` | Always |
|
|
113
112
|
| Per-package E2E | `pnpm --filter <pkg> e2e:test` | UI files in aggregated_files |
|
|
114
|
-
| Full-diff security scan | inline grep or `security-agent` | Always |
|
|
115
113
|
|
|
116
|
-
Per-file lint + format are enforced by `lint-format-on-edit.sh`
|
|
114
|
+
These are the workspace-wide / cross-package checks only — per-app build/lint/types, the `console.log`/debug scan, the OWASP/secret grep, and `pnpm audit` already ran per-round inside `testing-qa-agent` and are NOT repeated here. Per-file lint + format are enforced by `lint-format-on-edit.sh` per edit. This step catches cross-package issues invisible to per-wave checks.
|
|
117
115
|
|
|
118
116
|
**Soft tests** (report, don't block):
|
|
119
117
|
|
|
@@ -133,7 +133,7 @@ Once the gates pass, load the context the head command needs. This ensures `/cle
|
|
|
133
133
|
| `/cbp-checkpoint-start` | Load checkpoint via MCP `get_checkpoints` + `get_tasks(checkpoint_id)`. Display checkpoint title, status, claim state, first pending task |
|
|
134
134
|
| `/cbp-task-start [N]` | Load via MCP `get_current_task`. Display checkpoint title + task title/requirements summary |
|
|
135
135
|
| `/cbp-round-start` | Load via MCP `get_current_task` + `get_rounds(task_id)`. Display checkpoint + task + round count + last round summary |
|
|
136
|
-
| `/cbp-round-update` | Load via MCP `get_current_task` + `get_rounds(task_id)`. Display checkpoint + task + files_changed
|
|
136
|
+
| `/cbp-round-update` | Load via MCP `get_current_task` + `get_rounds(task_id)`. Display checkpoint + task + files_changed triage summary (claude_approved, findings, hard_fail) |
|
|
137
137
|
| `/cbp-round-input` | **Full context load** (see Step 2b) |
|
|
138
138
|
| `/cbp-task-check` | Load via MCP `get_current_task`. Display checkpoint + task + files summary |
|
|
139
139
|
| `/cbp-task-testing` | Load via MCP `get_current_task` + `get_rounds(task_id)`. Display checkpoint + task + testing status summary |
|
|
@@ -1,201 +0,0 @@
|
|
|
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
|