feat(snippets): a snippet has notes; when_to_use is the situation it is ranked on (#4378)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / integration (push) Successful in 50s
CI & Build / TypeScript typecheck (push) Successful in 53s
CI & Build / Python tests (push) Successful in 1m37s
CI & Build / Build & push image (push) Successful in 34s

A snippet had no field for prose, so what a session learned about one went
into when_to_use — the trigger joined onto every chunk it is embedded as. A
sweep found write-ups of up to 3 KB there, headings and all.

- notes: stored after the code under `## Notes`, parsed back from the body,
  carried by every path that rebuilds it (update, merge, un-merge). A
  snippet with no notes composes the body it always did.
- create/update_snippet (MCP) take notes and return trigger_advice when
  when_to_use is long, headed or multi-paragraph. Advice, not a refusal.
- Tool docs, the reusing-code skill and the editor hint describe the trigger
  as the situation and point the explanation at notes.
- Editor gains a Notes field; the detail view renders it as markdown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-23 17:27:22 -04:00
co-authored by Claude Opus 5.5
parent 66e21a6c60
commit 4ae18a9dd9
9 changed files with 313 additions and 21 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "scribe",
"description": "Scribe for Claude Code: connects the scribe MCP server, adds the hooks that deliver live project state and relevant records at the right moment, ships the shared client-neutral Scribe skills (using-scribe, writing-plans, reporting-back, systematic-debugging, verification, brainstorming, reusing-code, shape-accounting), and syncs your saved Scribe Processes as skills (/scribe:sync).",
"version": "2026.09.23.2008",
"version": "2026.09.23.2127",
"author": {
"name": "Bryan Van Deusen"
},
+6 -2
View File
@@ -72,8 +72,12 @@ through recall/auto-inject; this skill is the active reflex around that.
under-recording has no signal at all. The record is cheap — these fields:
- **name** — what it's called, e.g. `useDebouncedRef`.
- **code** — the implementation.
- **when_to_use** — one sharp line on when to reach for it. This becomes part
of the title, so it's what a later recall menu shows — make it earn the pull.
- **when_to_use** — the situation to reach for it in, in a sentence or two.
The snippet is ranked on this, so state the moment it applies and nothing
else — make it earn the pull.
- **notes** — everything that isn't the situation: why it's shaped this way,
what it replaced, caveats. When you learn something about a snippet later,
add it here rather than to `when_to_use`.
- **language**, **signature**, and **location** (`repo` / `path` / `symbol`)
so the recorded copy points back at the canonical source.
- **project_id** / **system_ids** to associate it with the work it belongs to.