You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(plugins): make setup focus load-bearing, seed schemas via metadata, add smoke test
- Focus question is now load-bearing: it drives an adaptive light folder-structure
suggestion and is stored. The placement step branches learn (existing project
with notes) vs suggest (new/empty project) instead of only learning.
- Seed schema notes via the write_note `metadata` param instead of content
frontmatter. The cloud write path silently coerces nested YAML to the string
'[object Object]', corrupting schema/settings (basic-memory-cloud#1000); the
metadata param round-trips correctly on both local and cloud.
- Surface placementConventions + captureFolder in the SessionStart brief so the
output style's "follow stored placement conventions" reflex has something to
follow — previously written by setup but never shown to Claude (dead config).
- Add a post-settings smoke test (run the hook's recall query, confirm routing)
and a restart prompt gated on outputStyle in the close.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
Copy file name to clipboardExpand all lines: plugins/claude-code/skills/setup/SKILL.md
+71-22Lines changed: 71 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: setup
3
-
description: Set up the Basic Memory plugin for this project — a short guided interview that configures the project mapping, seeds note schemas, optionally learns the project's conventions, and enables capture reflexes. Use when the user runs /basic-memory:setup, says "set up basic memory", or asks to configure/bootstrap the plugin.
3
+
description: Set up the Basic Memory plugin for this project — a short guided interview that configures the project mapping, seeds note schemas, learns or suggests placement conventions, and enables capture reflexes. Use when the user runs /basic-memory:setup, says "set up basic memory", or asks to configure/bootstrap the plugin.
4
4
argument-hint: (no arguments — runs an interactive interview)
5
5
---
6
6
@@ -32,8 +32,13 @@ it succeeds.
32
32
33
33
Ask only what you can't infer. Cover:
34
34
35
-
1.**Focus.** "What's this project mostly about — code, writing, research, planning,
36
-
or a mix?" (Shapes folder suggestions later; one quick question.)
35
+
1.**Focus / how you'll use it.** "What will this project mostly be — code/dev,
36
+
research, writing, knowledge capture, planning, or a mix?" This answer is
37
+
**load-bearing**, not small talk: it drives the folder structure you suggest
38
+
(step 4) and is stored so the SessionStart brief can surface it, keeping capture
39
+
matched to the use-case. Don't let it evaporate — if you infer it from context
40
+
instead of asking, still say the use-case you assumed and the structure it
41
+
implies, and let the user correct it in one word.
37
42
38
43
2.**Project mapping.** "Do you already have a Basic Memory project for this, or
39
44
should I create one?"
@@ -60,14 +65,23 @@ Ask only what you can't infer. Cover:
60
65
Keep `primaryProject` a project the user owns for their *own* capture; team
61
66
projects are for reading and deliberate sharing only.
62
67
63
-
4.**Learn conventions** (optional). "Want me to look at your existing notes and
64
-
note your conventions so I place new notes consistently?" If yes, inspect the
65
-
project: `list_directory` for the folder layout, sample a few notes per folder
66
-
(and, where a folder holds recurring typed notes, you may run `schema_infer` to
67
-
see their shape). Summarize what you find — folder-by-topic conventions, naming
68
-
style, the observation categories they favor — into 3-6 short lines and store
69
-
that string as `placementConventions`. Infer from their *real* notes; don't
70
-
impose a structure.
68
+
4.**Placement — learn or suggest** (depends on the project's state). The goal is a
69
+
short `placementConventions` string (3-6 lines) telling you where new notes go.
70
+
How you get it depends on whether the project already has notes:
71
+
-**Existing project with notes** → *learn*. Inspect it: `list_directory` for the
72
+
folder layout, sample a few notes per folder (and, where a folder holds
73
+
recurring typed notes, you may run `schema_infer` to see their shape).
74
+
Summarize the *real* conventions — folder-by-topic layout, naming style, the
75
+
observation categories they favor. Infer from their actual notes; don't impose.
76
+
-**New or empty project** → *suggest* (there's nothing to learn yet). Propose a
77
+
**light** structure that fits the focus from step 1 — 3-5 optional top-level
78
+
folders, no deep taxonomy — and be explicit that it's a starting point, not a
79
+
scaffold: notes work fine without it and structure can stay emergent. Don't
80
+
create empty folders; folders appear as notes land in them. Let the user edit
81
+
or decline in one word.
82
+
Either way, keep it short and store the result as `placementConventions`. The
83
+
SessionStart brief surfaces it (alongside `captureFolder`), so this is what makes
84
+
your captures land where the user expects — without it, placement is guesswork.
71
85
72
86
5.**Schemas.** "I'll add schemas for session checkpoints, decisions, and tasks so
73
87
I can find them precisely later — okay?" (See "Seed the schemas" below.)
@@ -99,12 +113,21 @@ For each one:
99
113
(`search_notes` with `metadata_filters={"type": "schema"}`, or try
100
114
`read_note("schemas/<name>")`). **If it exists, skip it** — never overwrite a
101
115
schema the user may have customized.
102
-
- Otherwise write it with `write_note`: `directory="schemas"`,
103
-
`title` = the schema's title (Session / Decision / Task), `content` = the file's
104
-
full contents (including its `---` frontmatter — Basic Memory merges that into the
105
-
note's frontmatter, so the `type: schema` + `entity` + `schema` definition land
106
-
intact and become resolvable by `schema_validate`), routed to `primaryProject`
107
-
(pass it as `project`, or as `project_id` if it's an `external_id` UUID).
116
+
- Otherwise write it with `write_note`, routed to `primaryProject` (pass it as
117
+
`project`, or as `project_id` if it's an `external_id` UUID):
118
+
-`directory="schemas"`, `note_type="schema"`, `title` = the schema's title
119
+
(Session / Decision / Task).
120
+
-`content` = the markdown **body only** — everything *after* the `---`
121
+
frontmatter block (the `# Session` heading and the prose).
122
+
-`metadata` = the schema's structured frontmatter as a **nested dict**: `entity`,
123
+
`version`, the full `schema` map, and `settings` (keep its nested `frontmatter`,
124
+
and pass enum values as JSON arrays, e.g. `["open","resumed","closed"]`).
125
+
-**Do not** put the schema's `---` frontmatter inside `content`. On the cloud
126
+
write path that nested YAML is silently coerced to the string `'[object Object]'`
127
+
(basic-memory-cloud#1000), corrupting `schema`/`settings`. The `metadata` param
128
+
round-trips correctly on both local and cloud. After seeding, verify one note
129
+
with `read_note(..., output_format="json", include_frontmatter=true)` —
130
+
`schema`/`settings` must come back as nested objects, not strings.
108
131
109
132
### 2. Install the shared skills (if the user opted in)
110
133
Run, from the project root:
@@ -130,7 +153,7 @@ Build the `basicMemory` block from the interview:
130
153
"rememberFolder": "bm-remember",
131
154
"recallTimeframe": "3d",
132
155
"preCompactCapture": "extractive",
133
-
"placementConventions": "<inferred summary, or null>",
156
+
"placementConventions": "<learned or suggested summary, or null>",
134
157
"teamProjects": {}
135
158
},
136
159
"outputStyle": "basic-memory"
@@ -145,10 +168,36 @@ valid JSON.
145
168
Writing the `basicMemory` block is also what stops the SessionStart hook's first-run
146
169
nudge — the config's presence is the signal that setup has run.
147
170
171
+
### 4. Smoke-test the wiring
172
+
Before you close, prove recall actually resolves — this catches a misnamed project,
173
+
missing cloud credentials, or a ref that doesn't route, while the user is still here
174
+
to fix it. Run the same structured query the SessionStart hook runs, via the CLI it
0 commit comments