Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

docs(skills): when_to_use for Claude Code, honest install/routing text, skill and doc corrections (#5858, A-NEW-6, #5038, #5534, #5101, #5335, #5559, #5278, #5196)

time-attack6509f9bf23c8
diff --git a/INSTALL_FOR_AGENTS.md b/INSTALL_FOR_AGENTS.md
index 1dbb5c6f1b..d30f7ccd73 100644
--- a/INSTALL_FOR_AGENTS.md
+++ b/INSTALL_FOR_AGENTS.md
@@ -387,9 +387,16 @@ scaffold the bundled skills into it:
```bash
cd /path/to/agent/workspace
-gbrain skillpack scaffold --all # copy the 50+ bundled skills + RESOLVER.md
+gbrain skillpack scaffold --all # copy the 50+ bundled skills and their shared files
```
+Scaffold copies each bundled skill plus the shared files the skills depend on
+(`skills/conventions/` and the `skills/_*` files `openclaw.plugin.json` lists
+under `shared_deps`). It does not copy `skills/RESOLVER.md` and leaves your
+workspace's own `RESOLVER.md` / `AGENTS.md` untouched: the skill dispatcher stays
+the bundled `skills/RESOLVER.md`, which a paragraph further down this step tells
+you to read.
+
Scaffolded skills are first-class files in your repo. Edit freely; re-running scaffold
refuses to overwrite anything that exists. Use `gbrain skillpack reference <name>` to
diff against gbrain's bundle when you want upstream improvements. (A workspace
@@ -445,8 +452,8 @@ even on failure; read the output). Restart opencode afterwards — it reads
config at session start. Verified against opencode v1.18.18. Full reference:
[docs/mcp/OPENCODE.md](docs/mcp/OPENCODE.md).
-Whether you scaffolded or not, read `skills/RESOLVER.md` (in your workspace, or
-[the published copy](https://github.com/garrytan/gbrain/blob/master/skills/RESOLVER.md)). It's
+Whether you scaffolded or not, read `skills/RESOLVER.md` (the bundled copy in your
+gbrain install, or [the published copy](https://github.com/garrytan/gbrain/blob/master/skills/RESOLVER.md)). It's
the skill dispatcher — tells you which skill to read for any task. Save this to your
memory permanently.
diff --git a/docs/GBRAIN_RECOMMENDED_SCHEMA.md b/docs/GBRAIN_RECOMMENDED_SCHEMA.md
index f0549e048d..f9da4355be 100644
--- a/docs/GBRAIN_RECOMMENDED_SCHEMA.md
+++ b/docs/GBRAIN_RECOMMENDED_SCHEMA.md
@@ -106,7 +106,7 @@ The markdown wiki is the human-facing layer — the primary interface for humans
The markdown layer uses conventions that map directly to the database primitives:
-1. **Use frontmatter for structured metadata** — anything you'd want to query (role, company, stage, score, tags) goes in YAML frontmatter, not buried in prose. These map to the fact store.
+1. **Use frontmatter for structured metadata** — anything you'd want to filter on (role, company, stage, score, tags) goes in YAML frontmatter, not buried in prose. Frontmatter is metadata for filters and schema-pack rules: it is not written to the fact store, and `gbrain search` / `query` do not index scalar frontmatter values (only the page body is chunked). If a value must be findable by search, also state it in the body, for example `Stage: negotiation` (#5335).
2. **Use `.raw/` for provenance** — save every API response with source and timestamp. These map to provenance records in the fact store.
3. **Treat the timeline as an event stream** — dated, sourced, append-only. These map to the event ledger.
4. **Keep compiled truth conceptually separate from evidence** — above the line is synthesis; below the line is evidence. The synthesis is a generated view; the evidence is queryable records.
diff --git a/docs/INSTALL.md b/docs/INSTALL.md
index 6d4217be3c..f388124434 100644
--- a/docs/INSTALL.md
+++ b/docs/INSTALL.md
@@ -113,7 +113,7 @@ chat providers need an explicit `models.*` pin. With neither key, they stay off
calmly and memory comes from agent-authored `## Facts` fences and the
`remember` verb.
-For the autopilot daemon specifically, keys and process-level env (`NODE_EXTRA_CA_CERTS`, proxy vars, custom base URLs) belong in `~/.gbrain/env` — a 0600 file created by `gbrain autopilot --install` and sourced by the daemon wrapper (interactive shell rc files never reach daemon shells; the path honors `GBRAIN_HOME`). Re-run `gbrain autopilot --install` after editing it so the daemon reloads.
+For the autopilot daemon specifically, keys and process-level env (`NODE_EXTRA_CA_CERTS`, proxy vars, custom base URLs) belong in `~/.gbrain/env` — a 0600 file created by `gbrain autopilot --install` and sourced by the daemon wrapper (interactive shell rc files never reach daemon shells; the path honors `GBRAIN_HOME`). Re-run `gbrain autopilot --install` after editing it so the daemon reloads. To keep a key off disk, use your secret manager there: the file is sourced by bash at every daemon start, so a line like `VOYAGE_API_KEY="$(doppler secrets get VOYAGE_API_KEY --plain)"` (or `op read`, `security find-generic-password -w`, `pass show`) fetches the value at start-up and never writes it (#5196). The command must work non-interactively in the daemon's environment.
To change an existing brain's embedding provider, follow the explicit-consent playbook at [`skills/migrations/v0.46.3.0.md`](../skills/migrations/v0.46.3.0.md), with the full reference in [`docs/guides/embedding-migration.md`](guides/embedding-migration.md). Preview the work and cost before approving a migration; do not repoint existing vectors at a different model.
diff --git a/docs/contradictions.md b/docs/contradictions.md
index 7304c6c6f4..500550f287 100644
--- a/docs/contradictions.md
+++ b/docs/contradictions.md
@@ -131,7 +131,9 @@ inspect findings without re-running the probe.
## Cost model
-Default judge is `claude-haiku-4-5` at ~$1/Mtok in, $5/Mtok out. With
+The judge resolves `--judge` > `models.eval.contradictions_judge` > the utility
+model tier > `GBRAIN_CONTRADICTIONS_JUDGE_MODEL`; the figures below assume a
+small model such as `claude-haiku-4-5` at ~$1/Mtok in, $5/Mtok out. With
the default truncation at 1500 chars per pair (`--max-pair-chars`), ~500 input + 80 output
tokens per judge call. Budget cap defaults to $5 in TTY / $1 non-TTY.
diff --git a/docs/eval-bench.md b/docs/eval-bench.md
index b09d52ef8d..6c96a49f9f 100644
--- a/docs/eval-bench.md
+++ b/docs/eval-bench.md
@@ -935,13 +935,24 @@ brain surfaces conflicting answers.
### Recommended nightly cadence
+The probe is not part of the dream cycle or autopilot (the cycle only reads
+the latest run), so schedule it yourself (cron, launchd or a systemd timer).
+It needs queries: either write your own list (`--queries-file`, JSONL or one
+query per line; nothing creates `~/.gbrain/queries.jsonl` for you), or turn
+on query capture (`gbrain config set eval.capture true`; capture is off by
+default) and use `--from-capture` once real queries have been recorded.
+
```bash
-# Once a day, against your top 50 most-frequent queries:
+# Once a day, against queries you maintain:
gbrain eval suspected-contradictions \
--queries-file ~/.gbrain/queries.jsonl \
--top-k 5 \
--budget-usd 5 \
--output ~/.gbrain/probe-runs/$(date +%Y-%m-%d).json
+
+# Or, with eval.capture on, against captured queries:
+gbrain eval suspected-contradictions --from-capture --top-k 5 --budget-usd 5 \
+ --output ~/.gbrain/probe-runs/$(date +%Y-%m-%d).json
```
Persistent cache (`eval_contradictions_cache`) makes re-runs near-zero
diff --git a/docs/guides/ambient-writeback.md b/docs/guides/ambient-writeback.md
index cf3600d8bd..e363b96a9d 100644
--- a/docs/guides/ambient-writeback.md
+++ b/docs/guides/ambient-writeback.md
@@ -166,6 +166,16 @@ gbrain recall projects/offsite-example
Or ask your agent: *"Remember the offsite date from the email I just pasted,
and note that it came from that email."*
+## Proving an extraction ran
+
+`extract_facts` has no caller-defined binding field such as a `job_binding`
+(#5278). On a managed brain the attestation is the durable write receipt:
+pass your own `request_id` (a UUID you can record against your job), and the
+response carries a `write_request` receipt for it; `get_write_request` with
+the same `request_id` reads it back later, including after a timeout. A brain
+that is not managed runs extraction without a journal, so there is no receipt
+to bind to.
+
## Duplicates across lanes
The same claim can arrive twice: the agent saves it with `remember`, and the
diff --git a/docs/guides/capabilities.md b/docs/guides/capabilities.md
index 96024f71bb..71f255deae 100644
--- a/docs/guides/capabilities.md
+++ b/docs/guides/capabilities.md
@@ -32,6 +32,6 @@ The command is idempotent (re-running with the same language is a no-op for vect
**How it measures up.** One distinction decides every memory-benchmark comparison: strict `recall_all@5` counts a question only when every gold session lands in the top 5, while loose any-hit counts it when a single one does, and 300 of LongMemEval-S's 470 scored questions need two or more sessions. On the strict metric, on this dataset, gbrain scores 93.40% with the reranker off (v0.48.4.0, 2026-09-06, 470 scored; 93.19% on the 2026-09-02 sibling receipt) and 95.53% on the release default path with `voyage:rerank-2.5` on (same run, same 470); the k=5 ceiling is 99.4% because 3 questions carry 6 gold sessions. The closest strict comparisons we could find: MemPalace publishes only any-hit (96.6% / 98.4%), but rescoring its committed per-question rankings against the official gold labels gives 85.7% for its raw vector setup and 90.0% with an LLM reranker in the loop (our recomputation, their data); ContextFit publishes an All@5 of 87.45% (411/470) whose rerank layer reads gold labels during the run, so we mark it loosely comparable. The 94 to 96% figures quoted for Mastra, Mem0, MemCog, Supermemory and others are LLM-judged answer accuracy, a different race that scores the reader and judge as much as the memory. gbrain's first judged number, published with v0.48.4.0: 86.6% (433/500; 95% CI 83.6–89.6) with the default `anthropic:claude-sonnet-4-6` reader over the full text of the retrieved sessions and a gpt-4o judge running the official prompts; 449 of the 470 non-abstention questions had every gold session retrieved and the reader converted 396 of them, so the gap to those vendor numbers is in the answering layer and the protocols differ, so no comparison is claimed in either direction. Pure vector on the same corpus scored 93.8% (v0.48.0.0 receipt), so the hybrid layer is roughly neutral on this benchmark and earns its keep elsewhere. Full table with sources and our read of each: [gbrain-evals `docs/comparison-systems.md`](https://github.com/garrytan/gbrain-evals/blob/main/docs/comparison-systems.md).
-**Brain consistency.** `gbrain eval suspected-contradictions` samples retrieval pairs, layered date pre-filter, query-conditioned LLM judge, persistent cache. Surfaces conflicts between takes + facts the agent has written. Wired into the daily dream cycle. **Say to your agent:** *"Did the dream cycle run — what contradictions did it surface?"* — *"Fact-check what we have on acme-example"* (claim-by-claim live-source verification) — or have your agent run `gbrain eval suspected-contradictions` directly.
+**Brain consistency.** `gbrain eval suspected-contradictions` samples retrieval pairs, layered date pre-filter, query-conditioned LLM judge, persistent cache. Surfaces conflicts between takes + facts the agent has written. It is paid, opt-in LLM work with its own schedule: the dream cycle only reads the latest probe run, it never starts one (see the [recommended nightly cadence](../eval-bench.md#recommended-nightly-cadence)). **Say to your agent:** *"What did the last contradiction probe surface?"* — *"Fact-check what we have on acme-example"* (claim-by-claim live-source verification) — or have your agent run `gbrain eval suspected-contradictions` directly.
**Agent-authored schema.** Your brain has a shape — what page types exist (`person`, `meeting`, `paper`, `case`, `lab-result`), what they link to (`attended`, `authored`, `prescribed-by`), what facts get extracted automatically. The default ships with universal types, but your brain's actual shape is not the default shape. Agents can evolve that shape on your behalf via 14 `gbrain schema` CLI verbs + a batched MCP op (`schema_apply_mutations`, admin scope, NOT localOnly so remote agents reach it over HTTPS). Atomic file locks, audit log with the agent's identity, chunked UPDATE backfill in 1000-row batches that never wedge concurrent writers. The brain stops being a pile of notes and becomes something with structure. **Say to your agent:** *"Add a page type to my schema for case files"* — *"My brain has untyped pages — propose new types from my corpus."* **Why it matters:** [`docs/what-schemas-unlock.md`](../what-schemas-unlock.md) — 7 killer use cases (4000 invisible meetings, founder ops brain, research brain, legal brain, team brain, agent-as-co-curator). **5-minute walkthrough:** [`docs/schema-author-tutorial.md`](../schema-author-tutorial.md). **Agent skill:** [`skills/schema-author/SKILL.md`](../../skills/schema-author/SKILL.md).
diff --git a/docs/guides/operational-disciplines.md b/docs/guides/operational-disciplines.md
index bcc8a713e5..b7c1279f06 100644
--- a/docs/guides/operational-disciplines.md
+++ b/docs/guides/operational-disciplines.md
@@ -9,10 +9,15 @@ Without this: the agent misses signals in conversation, wastes money on external
## Implementation
```
-# DISCIPLINE 1: Signal Detection on Every Message (MANDATORY)
+# DISCIPLINE 1: Signal Detection on Every Message (after explicit opt-in)
on every_inbound_message(message):
- # No exceptions. If the user thinks out loud and the brain doesn't
- # capture it, the system is broken. This is the #1 discipline.
+ # Automatic capture is off by default. Run this loop only after the
+ # user explicitly opted in to automatic capture for this brain (the
+ # stored choice skills/signal-detector/SKILL.md checks before writing),
+ # and honor narrower per-message instructions. Without the opt-in,
+ # write only what the user asks to save.
+ if not automatic_capture_opted_in():
+ return
entities = detect_entities(message)
# people, companies, deals, original ideas
diff --git a/docs/wave9/sg.md b/docs/wave9/sg.md
index 3f2543f868..48dd7fcf69 100644
--- a/docs/wave9/sg.md
+++ b/docs/wave9/sg.md
@@ -15,6 +15,11 @@ Integrator: fold these into CHANGELOG.md and docs/UPGRADING_DOWNSTREAM_AGENTS.md
- **Doctor sees unpushed source checkouts (#5063).** New `git_convergence` check: a source checkout or `sync.repo_path` with commits not on its upstream warns after 6 hours and fails after 24; uncommitted changes older than 6 hours warn. It compares with the last fetched upstream and never fetches. `bootstrap_push_health` no longer says `ok` on a recent push while the workspace is still ahead of origin, and `scripts/smoke-test.sh` accepts a configured database URL and a keyless embedding provider that doctor accepts.
- **`gbrain takes rebuild <slug>` and `gbrain takes remove <slug> --row N` (#5167).** Rebuild re-derives one page's takes index from its fence; rows whose number and claim still match keep their resolution and vector, rows the index disagrees on are re-inserted from the fence. Remove takes one row out of the fence and the index together; other row numbers do not change, and it refuses resolved rows, rows another row cites as their replacement, and rows whose index copy disagrees with the fence (it names `takes rebuild`). Local-only (`takes_remove` is not an MCP tool). The v0.28.0 migration hint now names `gbrain reindex --markdown` instead of the nonexistent `gbrain extract takes --rebuild`.
- **Accepted take proposals keep their provenance (#5214).** `gbrain takes propose --accept <id>` records `take_proposals#<id>` as the take's source; `--claim/--weight/--who/--kind` edit the take before it is written, recorded as `take_proposals#<id> (edited)`, while the proposal keeps its original text.
+- **Bundled skills pass the shared-skill publication parser (#5476 item 1, A-NEW-3).** The capture skill declared `writes_pages:` as a list and schema-author as `[]`, which `put_skill` and the 0.53 adoption refuse, blocking any brain that adopts the bundled pack. They now use `writes_pages: true` + `writes_to: [inbox/]` (new `inbox/` filing rule) and `writes_pages: false`, and a new `check:skill-publication` guard runs every bundled SKILL.md (source, plugin and persona trees) through the parser in verify.
+- **`gbrain skillpack sync` registers what it scaffolds (#4831).** An existing, valid workspace `skills/manifest.json` gains `{name, path}` for exactly the skills the run scaffolded (append-only; user entries and other keys untouched), reported as `registered` in `--json`, so `check-resolvable --strict` no longer flags each one as an orphan trigger.
+- **Upgrade reinstall hints no longer corrupt the global Bun install (#5034, B-NEW-5).** `gbrain upgrade`'s pinned-tag and rollback hints now print `bun remove -g gbrain && bun add -g github:garrytan/gbrain#v<version>`; an in-place tag swap fails with DependencyLoop on Bun 1.3 and silently corrupts the global lock on Bun 1.4. The authorization-upgrade guide, auto-update guide and v0.50.0.0 playbook say the same.
+- **Claude Code sees skill triggers (#5858, A-NEW-6).** The plugin and persona trees add a `when_to_use` line built from each skill's first triggers (within Claude Code's 1,536-character listing cap); source skills are unchanged. INSTALL_FOR_AGENTS.md no longer says scaffold copies RESOLVER.md, and `_AGENT_README.md` says where RESOLVER.md ships and that routing rests on frontmatter where it does not. Reworked from a contribution by @andreineacsu (#5940).
+- **Skill and doc corrections.** gbrain-upgrade: a migration playbook that forbids unattended upgrades outranks `self_upgrade.mode: auto` (#5038). perplexity-research uses the Agent API (`POST /v1/agent`, preset `low`/`fast`, recency filter on the `web_search` tool) instead of the retired Sonar chat-completions endpoint (#5534; the default-provider change in #5846 is left to Garry). ingest, eiirp and operational-disciplines gate always-on capture on the explicit automatic-capture opt-in (#5101). The recommended schema no longer claims frontmatter maps to the fact store or is searchable (#5335). The contradiction probe is documented as its own paid schedule, not part of the dream cycle, with the judge resolution order (#5559). `extract_facts` attestation points at `request_id` write receipts (#5278). The autopilot env file documents keeping keys off disk with a secret-manager command substitution (#5196). The v0.28.0 playbook names `gbrain reindex --markdown` / `gbrain takes rebuild <slug>`.
## Upgrade-note rows
@@ -31,3 +36,7 @@ Integrator: fold these into CHANGELOG.md and docs/UPGRADING_DOWNSTREAM_AGENTS.md
| New doctor `git_convergence`; `bootstrap_push_health` warns when ahead (#5063) | Brains syncing from Git checkouts with an upstream | `gbrain doctor --only git_convergence` | Push the checkout; checkouts without an upstream are skipped |
| New `takes rebuild` / `takes remove` (local-only op `takes_remove`) (#5167) | Operators repairing takes | `gbrain takes <slug> --json` | None |
| Accepted proposals carry `source: take_proposals#<id>` (#5214) | Anyone reading take sources | `gbrain takes <slug>` | None |
+| Bundled capture/schema-author frontmatter fixed; new `check:skill-publication` guard (#5476, A-NEW-3) | Brains adopting the bundled pack (0.53) | `bun run check:skill-publication` (repo) | None |
+| `skillpack sync` appends to an existing manifest.json (#4831) | Workspaces with a hand-kept skills/manifest.json | `gbrain check-resolvable --strict` | Remove the appended entries by hand |
+| Reinstall hints use remove + add (#5034) | Bun global installs on a pinned tag | `gbrain --version` after reinstall | None |
+| Plugin skills gain `when_to_use` (#5858) | Claude Code / Codex plugin users | `gbrain skillpack list` | None |
diff --git a/llms-full.txt b/llms-full.txt
index 4c303208ff..c238720c8e 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -2841,9 +2841,16 @@ scaffold the bundled skills into it:
```bash
cd /path/to/agent/workspace
-gbrain skillpack scaffold --all # copy the 50+ bundled skills + RESOLVER.md
+gbrain skillpack scaffold --all # copy the 50+ bundled skills and their shared files
```
+Scaffold copies each bundled skill plus the shared files the skills depend on
+(`skills/conventions/` and the `skills/_*` files `openclaw.plugin.json` lists
+under `shared_deps`). It does not copy `skills/RESOLVER.md` and leaves your
+workspace's own `RESOLVER.md` / `AGENTS.md` untouched: the skill dispatcher stays
+the bundled `skills/RESOLVER.md`, which a paragraph further down this step tells
+you to read.
+
Scaffolded skills are first-class files in your repo. Edit freely; re-running scaffold
refuses to overwrite anything that exists. Use `gbrain skillpack reference <name>` to
diff against gbrain's bundle when you want upstream improvements. (A workspace
@@ -2899,8 +2906,8 @@ even on failure; read the output). Restart opencode afterwards — it reads
config at session start. Verified against opencode v1.18.18. Full reference:
[docs/mcp/OPENCODE.md](docs/mcp/OPENCODE.md).
-Whether you scaffolded or not, read `skills/RESOLVER.md` (in your workspace, or
-[the published copy](https://github.com/garrytan/gbrain/blob/master/skills/RESOLVER.md)). It's
+Whether you scaffolded or not, read `skills/RESOLVER.md` (the bundled copy in your
+gbrain install, or [the published copy](https://github.com/garrytan/gbrain/blob/master/skills/RESOLVER.md)). It's
the skill dispatcher — tells you which skill to read for any task. Save this to your
memory permanently.
@@ -10007,6 +10014,8 @@ Source: https://raw.githubusercontent.com/garrytan/gbrain/master/docs/guides/tro
`bootstrap_push_health` and `gbrain bootstrap status` report only the push record of the workspace named by this machine's bootstrap receipt; another workspace's stale or failed push is listed as such (a warn naming that workspace), never as this workspace's state. `reranker_health` auth warnings are audit-log history (`details.live_probe_performed: false`), not a live check of the key. These warns can appear while every other check reads green; each one names a check that did not run.
+<a id="git-convergence"></a>**`gbrain doctor` warns or fails `git_convergence`, or `bootstrap_push_health` warns that a workspace is ahead?** A Git checkout the brain syncs from (a source's `local_path` or `sync.repo_path`) has commits its upstream does not have, or uncommitted changes, so the system of record on the remote is behind the brain (#5063). Commits not on the upstream warn after 6 hours and fail after 24; uncommitted changes older than 6 hours warn. Doctor compares with the local `@{u}` ref and never fetches, so it is only as fresh as the last fetch; checkouts without an upstream and connector sources are skipped. Commit and push the checkout (`gbrain sources push --path <root>` for a bootstrap workspace, `git push` otherwise). `bootstrap_push_health` no longer reports `ok` on a recent successful push while the workspace still has commits not on origin.
+
**`brain_score` shows a low "timeline density (entity and event pages)"?** The 15-point timeline component grades only linkable pages whose type's active-pack primitive is `entity` or `temporal` (people, companies, meetings, emails, events…); reference documents such as notes, writing and guides have no events and are not graded, so do not stamp "page created" rows onto them. Types the pack does not declare are still graded. Raise the score by giving those entity and event pages real timeline entries (`gbrain extract timeline`).
**`gbrain doctor` warns `slug_collisions`, or sync prints slug collisions?** Two or more files in a source map to the same page slug (for example `notes/Foo Bar.md` and `notes/foo-bar.md`), and only one is indexed. Rename all but one file in each group, commit, then sync.
diff --git a/plugin-variants/gbrain-coding/skills/_AGENT_README.md b/plugin-variants/gbrain-coding/skills/_AGENT_README.md
index 710a22af4c..0dab2fef65 100644
--- a/plugin-variants/gbrain-coding/skills/_AGENT_README.md
+++ b/plugin-variants/gbrain-coding/skills/_AGENT_README.md
@@ -84,7 +84,11 @@ skill — read its SKILL.md body in full and follow the workflow described there
useful for scanning every skill and its trigger phrases in one place, and it
carries the disambiguation rules for overlapping matches. If the two disagree,
frontmatter wins. (There is no machine-managed block inside `RESOLVER.md` or
-`AGENTS.md`; that pattern was retired.)
+`AGENTS.md`; that pattern was retired.) `RESOLVER.md` ships in the gbrain
+install's `skills/` directory; `gbrain skillpack scaffold` does not copy it,
+and the Claude Code / Codex plugin lanes do not ship it. Where it is absent,
+routing rests on each skill's frontmatter alone (`triggers:`, `description`,
+and the `when_to_use` the plugin lanes add from the triggers).
## The memory loop
@@ -207,6 +211,6 @@ This file (`_AGENT_README.md`) is the routing contract — keep it short.
lookup chain — an unexplained exemption is a conformance failure.
- **`priority:` is NOT part of the routing contract.** Nothing in the routing
path consumes it — matching is substring-over-`triggers:` (see "Routing"
- above), with `RESOLVER.md` disambiguation for overlaps. A `priority:` key is
+ above), with `RESOLVER.md` disambiguation for overlaps where it ships. A `priority:` key is
inert; don't add one expecting it to reorder matches. Encode precedence in
trigger specificity and the resolver's disambiguation rules instead.
diff --git a/plugin-variants/gbrain-coding/skills/_brain-filing-rules.json b/plugin-variants/gbrain-coding/skills/_brain-filing-rules.json
index f266d421c7..18deab3be8 100644
--- a/plugin-variants/gbrain-coding/skills/_brain-filing-rules.json
+++ b/plugin-variants/gbrain-coding/skills/_brain-filing-rules.json
@@ -135,6 +135,12 @@
"examples": ["media/x/{handle}/", "media/audio/", "media/video/"],
"description": "Format-prefixed parent for media-by-source-format ingest. Subdirectories like media/x/{handle}/ hold X/Twitter archives, media/audio/ holds podcast/voice captures. The format-prefix lives only when the content is sui generis to the source format AND lacks a clean primary-subject directory. Prefer subject-by-subject filing; fall through to media/ only when the source format IS the unifying frame."
},
+ {
+ "kind": "inbox",
+ "directory": "inbox/",
+ "examples": ["captured thoughts", "pasted snippets awaiting filing"],
+ "description": "Raw captured content awaiting filing; `gbrain capture` writes here. Move a page to its primary-subject directory once it is understood."
+ },
{
"kind": "conversation",
"directory": "conversations/",
diff --git a/plugin-variants/gbrain-coding/skills/brain-ingest-gate/SKILL.md b/plugin-variants/gbrain-coding/skills/brain-ingest-gate/SKILL.md
index d1a7bbfe0e..7abc28d1ee 100644
--- a/plugin-variants/gbrain-coding/skills/brain-ingest-gate/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/brain-ingest-gate/SKILL.md
@@ -29,6 +29,7 @@ upstream: brain-ingest-gate@fc834ee
# brain-first lookup performed at write time (entity card, alias-expanded
# search, read the top hit) before anything external or new is written.
brain_first: true
+when_to_use: "Use when the user asks: \"move this to brain\", \"migrate to brain\", \"copy these files into the brain\", \"is this already in the brain\", \"check for duplicates before writing\"."
---
# Brain Ingest Gate — Resolve and Dedup Before Anything Enters the Brain
diff --git a/plugin-variants/gbrain-coding/skills/brain-link-discipline/SKILL.md b/plugin-variants/gbrain-coding/skills/brain-link-discipline/SKILL.md
index 22d30ab233..aef556eaf5 100644
--- a/plugin-variants/gbrain-coding/skills/brain-link-discipline/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/brain-link-discipline/SKILL.md
@@ -26,6 +26,7 @@ upstream: brain-link-on-commit@fc834ee + brain-link-report@fc834ee
# existence check against the user's own hosted git remote (link
# verification, not data retrieval). Declarative opt-out.
brain_first: exempt
+when_to_use: "Use when the user asks: \"give me the link\", \"where is the page\", \"why does this link 404\", \"brain link discipline\", \"rewrite subagent paths\"."
---
# brain-link-discipline — The Link Is Part of the Deliverable
diff --git a/plugin-variants/gbrain-coding/skills/brain-ops/SKILL.md b/plugin-variants/gbrain-coding/skills/brain-ops/SKILL.md
index 48abcdf7d7..af7add3cac 100644
--- a/plugin-variants/gbrain-coding/skills/brain-ops/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/brain-ops/SKILL.md
@@ -26,6 +26,7 @@ writes_to:
- deals/
- concepts/
- meetings/
+when_to_use: "Use when the user asks: \"any brain read/write/lookup/citation\"."
---
# Brain Operations — The Ambient Context Layer
diff --git a/plugin-variants/gbrain-coding/skills/concept-synthesis/SKILL.md b/plugin-variants/gbrain-coding/skills/concept-synthesis/SKILL.md
index e0142d5d6f..0ad25e6272 100644
--- a/plugin-variants/gbrain-coding/skills/concept-synthesis/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/concept-synthesis/SKILL.md
@@ -16,6 +16,7 @@ mutating: true
writes_pages: true
writes_to:
- concepts/
+when_to_use: "Use when the user asks: \"concept synthesis\", \"synthesize my concepts\", \"find patterns across my notes\", \"build my intellectual map\", \"trace idea evolution\"."
---
# concept-synthesis — From Raw Stubs to Intellectual Map
diff --git a/plugin-variants/gbrain-coding/skills/context-audit/SKILL.md b/plugin-variants/gbrain-coding/skills/context-audit/SKILL.md
index 785b04fcec..096ff577ca 100644
--- a/plugin-variants/gbrain-coding/skills/context-audit/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/context-audit/SKILL.md
@@ -27,6 +27,7 @@ tools:
mutating: false
writes_pages: false
upstream: context-audit@fc834ee
+when_to_use: "Use when the user asks: \"context audit\", \"context diet\", \"system prompt audit\", \"prompt compression\", \"reduce context size\"."
---
# context-audit — Token Hygiene for the Always-Loaded Context Stack
diff --git a/plugin-variants/gbrain-coding/skills/correction-pipeline/SKILL.md b/plugin-variants/gbrain-coding/skills/correction-pipeline/SKILL.md
index e72540e658..8a4b47f055 100644
--- a/plugin-variants/gbrain-coding/skills/correction-pipeline/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/correction-pipeline/SKILL.md
@@ -23,6 +23,7 @@ writes_to:
- companies/
- concepts/
upstream: correction-pipeline@fc834ee
+when_to_use: "Use when the user asks: \"that's wrong\", \"that's not true\", \"I never said that\", \"where did you get that\", \"you got that wrong\"."
---
# Correction Pipeline
diff --git a/plugin-variants/gbrain-coding/skills/data-loss-gate/SKILL.md b/plugin-variants/gbrain-coding/skills/data-loss-gate/SKILL.md
index b22a34b328..9c92f22a1a 100644
--- a/plugin-variants/gbrain-coding/skills/data-loss-gate/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/data-loss-gate/SKILL.md
@@ -27,6 +27,7 @@ upstream: data-loss-gate@fc834ee
# check backlinks / graph dependencies (get_backlinks, graph) so the card's
# "what we'd lose" section is grounded in the actual target, not guesses.
brain_first: true
+when_to_use: "Use when the user asks: \"bulk delete\", \"wipe the\", \"rm -rf\", \"purge the\", \"truncate\"."
---
# Data Loss Gate — Confirmation Before Destructive Operations
diff --git a/plugin-variants/gbrain-coding/skills/db-repair/SKILL.md b/plugin-variants/gbrain-coding/skills/db-repair/SKILL.md
index 2b1c8db634..f611427926 100644
--- a/plugin-variants/gbrain-coding/skills/db-repair/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/db-repair/SKILL.md
@@ -19,6 +19,7 @@ tools:
- exec
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"GBRAIN_DB_ACCESS\", \"gbrain database error\", \"gbrain connection refused\", \"cannot reach the brain database\", \"brain database is down\"."
---
# GBrain DB Repair
diff --git a/plugin-variants/gbrain-coding/skills/enrich/SKILL.md b/plugin-variants/gbrain-coding/skills/enrich/SKILL.md
index 0d6f2879ae..84f88b3083 100644
--- a/plugin-variants/gbrain-coding/skills/enrich/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/enrich/SKILL.md
@@ -24,6 +24,7 @@ writes_pages: true
writes_to:
- people/
- companies/
+when_to_use: "Use when the user asks: \"enrich\", \"create person page\", \"update company page\", \"who is this person\", \"look up this company\"."
---
# Enrich Skill
diff --git a/plugin-variants/gbrain-coding/skills/functional-area-resolver/SKILL.md b/plugin-variants/gbrain-coding/skills/functional-area-resolver/SKILL.md
index 4131ad8525..edd14691a7 100644
--- a/plugin-variants/gbrain-coding/skills/functional-area-resolver/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/functional-area-resolver/SKILL.md
@@ -32,6 +32,7 @@ mutating: true
# the word `perplexity` but the skill never actually calls external
# APIs. It rewrites local routing tables. Declarative opt-out.
brain_first: exempt
+when_to_use: "Use when the user asks: \"compress agents.md\", \"compress my resolver\", \"resolver too big\", \"resolver.md too big\", \"agents.md too large\"."
---
# Functional-Area Resolver — Pattern for Compressing Routing Tables
diff --git a/plugin-variants/gbrain-coding/skills/idea-ingest/SKILL.md b/plugin-variants/gbrain-coding/skills/idea-ingest/SKILL.md
index f021adffe3..4dc8148877 100644
--- a/plugin-variants/gbrain-coding/skills/idea-ingest/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/idea-ingest/SKILL.md
@@ -27,6 +27,7 @@ writes_to:
- people/
- concepts/
- sources/
+when_to_use: "Use when the user asks: \"shares a link or URL\", \"read this\", \"save this\", \"think about this\", \"put this in brain\"."
---
# Idea Ingest Skill
diff --git a/plugin-variants/gbrain-coding/skills/idea-lineage/SKILL.md b/plugin-variants/gbrain-coding/skills/idea-lineage/SKILL.md
index e3b61c0630..5e2bfd21b7 100644
--- a/plugin-variants/gbrain-coding/skills/idea-lineage/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/idea-lineage/SKILL.md
@@ -24,6 +24,7 @@ tools:
- find_contradictions
- find_trajectory
mutating: false
+when_to_use: "Use when the user asks: \"idea lineage\", \"trace the lineage of this idea\", \"how my thinking about\", \"how has my thinking about\", \"current version of this idea\"."
---
# idea-lineage - Single-Idea Evolution Through the Brain
diff --git a/plugin-variants/gbrain-coding/skills/ingest/SKILL.md b/plugin-variants/gbrain-coding/skills/ingest/SKILL.md
index 53f553773c..f868feec79 100644
--- a/plugin-variants/gbrain-coding/skills/ingest/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/ingest/SKILL.md
@@ -20,6 +20,7 @@ writes_to:
- concepts/
- meetings/
- sources/
+when_to_use: "Use when the user asks: \"ingest this\", \"save this to brain\", \"process this meeting\"."
---
# Ingest Skill
@@ -34,7 +35,7 @@ Ingest meetings, articles, media, documents, and conversations into the brain.
- Every entity mention creates a back-link from the entity's page to the page mentioning them (Iron Law).
- Raw sources are preserved for provenance via `gbrain files upload-raw` with automatic size routing.
- State sections are rewritten with current best understanding, never appended to.
-- Entity detection fires on every inbound message; notable entities get pages or updates.
+- After the user's explicit automatic-capture opt-in (see `skills/signal-detector/SKILL.md`), entity detection fires on every substantive inbound message; notable entities get pages or updates. Without that opt-in, capture only what the user asks to save.
- Notability gate before any new entity page: existing pages are updated, and a NEW page is
created only for a notable entity and only with meaningful content from web search or
existing brain context — no stubs. A non-notable mention stays an inline reference on the
@@ -71,15 +72,19 @@ Every fact written to a brain page must carry an inline `[Source: ...]` citation
5. **Back-link all entities.** Update EVERY mentioned entity's page with a back-link to this page (Iron Law).
6. **Timeline merge.** The same event appears on ALL mentioned entities' timelines. If Alice met Bob at Acme Corp, the event goes on Alice's page, Bob's page, and Acme Corp's page.
-## Entity Detection on Every Message
+## Entity Detection on Every Message (after opt-in)
-Production agents should detect entity mentions on EVERY inbound message. This is
-the signal detection loop that makes the brain compound over time.
+Automatic capture is off by default. Once the user has explicitly opted in to
+automatic capture for this brain (the stored choice `skills/signal-detector/SKILL.md`
+checks before writing), production agents detect entity mentions on every
+substantive inbound message. This is the signal detection loop that makes the
+brain compound over time. Without the opt-in, write only what the user asks to save.
### Protocol
1. **Scan the message** for entity mentions: people, companies, concepts, original
- thinking. Fire on every message (no exceptions unless purely operational).
+ thinking. With the opt-in recorded, fire on every substantive message (skip
+ purely operational ones and honor narrower per-message instructions).
2. **For each entity detected:**
- `gbrain search "name"` -- does a page already exist?
- **If yes:** load context with `gbrain get <slug>`. Use the compiled truth to
diff --git a/plugin-variants/gbrain-coding/skills/maintain/SKILL.md b/plugin-variants/gbrain-coding/skills/maintain/SKILL.md
index c44f94df58..f616172f67 100644
--- a/plugin-variants/gbrain-coding/skills/maintain/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/maintain/SKILL.md
@@ -36,6 +36,7 @@ tools:
- add_link
- search
mutating: true
+when_to_use: "Use when the user asks: \"brain health\", \"check backlinks\", \"maintenance\", \"orphan pages\", \"stale pages\"."
---
# Maintain Skill
diff --git a/plugin-variants/gbrain-coding/skills/mcp-access/SKILL.md b/plugin-variants/gbrain-coding/skills/mcp-access/SKILL.md
index c42bf0c946..544aeae24f 100644
--- a/plugin-variants/gbrain-coding/skills/mcp-access/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/mcp-access/SKILL.md
@@ -16,6 +16,7 @@ tools:
- exec
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"GBrain admin login link\", \"open the MCP admin panel\", \"manage MCP clients\", \"register an MCP client\", \"set up MCP OAuth\"."
---
# MCP access and administration
diff --git a/plugin-variants/gbrain-coding/skills/measure-before-you-fix/SKILL.md b/plugin-variants/gbrain-coding/skills/measure-before-you-fix/SKILL.md
index 6423d3f7f7..601da0da60 100644
--- a/plugin-variants/gbrain-coding/skills/measure-before-you-fix/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/measure-before-you-fix/SKILL.md
@@ -20,6 +20,7 @@ mutating: false
writes_pages: false
writes_to: []
upstream: measure-before-you-fix@fc834ee
+when_to_use: "Use when the user asks: \"keeps timing out\", \"ETIMEDOUT\", \"why is this data stale\", \"freshness alert\", \"wedged\"."
---
# Measure Before You Fix
diff --git a/plugin-variants/gbrain-coding/skills/postgres-adopt/SKILL.md b/plugin-variants/gbrain-coding/skills/postgres-adopt/SKILL.md
index c1e9e63cd6..cdecf97843 100644
--- a/plugin-variants/gbrain-coding/skills/postgres-adopt/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/postgres-adopt/SKILL.md
@@ -19,6 +19,7 @@ tools:
- exec
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"which gbrain engine\", \"pglite or postgres\", \"gbrain engine status\", \"upgrade to postgres\", \"switch gbrain to postgres\"."
---
# Postgres Adopt
diff --git a/plugin-variants/gbrain-coding/skills/query/SKILL.md b/plugin-variants/gbrain-coding/skills/query/SKILL.md
index 556c6306a3..435cc96b45 100644
--- a/plugin-variants/gbrain-coding/skills/query/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/query/SKILL.md
@@ -28,6 +28,7 @@ tools:
- traverse_graph
- get_timeline
mutating: false
+when_to_use: "Use when the user asks: \"what do we know about\", \"tell me about\", \"who is\", \"what happened\", \"search for\"."
---
# Query Skill
diff --git a/plugin-variants/gbrain-coding/skills/repo-architecture/SKILL.md b/plugin-variants/gbrain-coding/skills/repo-architecture/SKILL.md
index 90aacf3c08..ad044b026f 100644
--- a/plugin-variants/gbrain-coding/skills/repo-architecture/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/repo-architecture/SKILL.md
@@ -14,6 +14,7 @@ tools:
- get_page
- list_pages
mutating: false
+when_to_use: "Use when the user asks: \"where does this go\", \"filing rules\", \"create new page\", \"which directory\"."
---
# Repo Architecture — Filing Rules
diff --git a/plugin-variants/gbrain-coding/skills/resolve-before-asking/SKILL.md b/plugin-variants/gbrain-coding/skills/resolve-before-asking/SKILL.md
index 6437151016..702ae4ffcc 100644
--- a/plugin-variants/gbrain-coding/skills/resolve-before-asking/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/resolve-before-asking/SKILL.md
@@ -23,6 +23,7 @@ writes_to:
- people/
- companies/
upstream: resolve-before-asking@fc834ee
+when_to_use: "Use when the user asks: \"resolve before asking\", \"before asking the user\", \"unidentified contact\", \"unknown relationship\", \"should I ask who\"."
---
# Resolve Before Asking — Exhaust the Brain Before Bothering the User
diff --git a/plugin-variants/gbrain-coding/skills/signal-detector/SKILL.md b/plugin-variants/gbrain-coding/skills/signal-detector/SKILL.md
index b90a9a1eef..f6c42618c6 100644
--- a/plugin-variants/gbrain-coding/skills/signal-detector/SKILL.md
+++ b/plugin-variants/gbrain-coding/skills/signal-detector/SKILL.md
@@ -21,6 +21,7 @@ writes_to:
- people/
- companies/
- concepts/
+when_to_use: "Use when the user asks: \"every substantive inbound message after automatic-capture opt-in\"."
---
# Signal Detector — Ambient Brain Capture
diff --git a/plugin-variants/gbrain-daily/skills/_AGENT_README.md b/plugin-variants/gbrain-daily/skills/_AGENT_README.md
index 710a22af4c..0dab2fef65 100644
--- a/plugin-variants/gbrain-daily/skills/_AGENT_README.md
+++ b/plugin-variants/gbrain-daily/skills/_AGENT_README.md
@@ -84,7 +84,11 @@ skill — read its SKILL.md body in full and follow the workflow described there
useful for scanning every skill and its trigger phrases in one place, and it
carries the disambiguation rules for overlapping matches. If the two disagree,
frontmatter wins. (There is no machine-managed block inside `RESOLVER.md` or
-`AGENTS.md`; that pattern was retired.)
+`AGENTS.md`; that pattern was retired.) `RESOLVER.md` ships in the gbrain
+install's `skills/` directory; `gbrain skillpack scaffold` does not copy it,
+and the Claude Code / Codex plugin lanes do not ship it. Where it is absent,
+routing rests on each skill's frontmatter alone (`triggers:`, `description`,
+and the `when_to_use` the plugin lanes add from the triggers).
## The memory loop
@@ -207,6 +211,6 @@ This file (`_AGENT_README.md`) is the routing contract — keep it short.
lookup chain — an unexplained exemption is a conformance failure.
- **`priority:` is NOT part of the routing contract.** Nothing in the routing
path consumes it — matching is substring-over-`triggers:` (see "Routing"
- above), with `RESOLVER.md` disambiguation for overlaps. A `priority:` key is
+ above), with `RESOLVER.md` disambiguation for overlaps where it ships. A `priority:` key is
inert; don't add one expecting it to reorder matches. Encode precedence in
trigger specificity and the resolver's disambiguation rules instead.
diff --git a/plugin-variants/gbrain-daily/skills/_brain-filing-rules.json b/plugin-variants/gbrain-daily/skills/_brain-filing-rules.json
index f266d421c7..18deab3be8 100644
--- a/plugin-variants/gbrain-daily/skills/_brain-filing-rules.json
+++ b/plugin-variants/gbrain-daily/skills/_brain-filing-rules.json
@@ -135,6 +135,12 @@
"examples": ["media/x/{handle}/", "media/audio/", "media/video/"],
"description": "Format-prefixed parent for media-by-source-format ingest. Subdirectories like media/x/{handle}/ hold X/Twitter archives, media/audio/ holds podcast/voice captures. The format-prefix lives only when the content is sui generis to the source format AND lacks a clean primary-subject directory. Prefer subject-by-subject filing; fall through to media/ only when the source format IS the unifying frame."
},
+ {
+ "kind": "inbox",
+ "directory": "inbox/",
+ "examples": ["captured thoughts", "pasted snippets awaiting filing"],
+ "description": "Raw captured content awaiting filing; `gbrain capture` writes here. Move a page to its primary-subject directory once it is understood."
+ },
{
"kind": "conversation",
"directory": "conversations/",
diff --git a/plugin-variants/gbrain-daily/skills/blog-ingest/SKILL.md b/plugin-variants/gbrain-daily/skills/blog-ingest/SKILL.md
index c26fa99aa4..6f93eeed24 100644
--- a/plugin-variants/gbrain-daily/skills/blog-ingest/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/blog-ingest/SKILL.md
@@ -24,6 +24,7 @@ writes_to:
- sources/
- projects/
upstream: blog-ingest@fc834ee
+when_to_use: "Use when the user asks: \"ingest this publication\", \"ingest this whole blog\", \"ingest this feed\", \"ingest this newsletter archive\", \"save this whole substack\"."
---
# blog-ingest — Feed & Whole-Publication Ingestion
diff --git a/plugin-variants/gbrain-daily/skills/briefing/SKILL.md b/plugin-variants/gbrain-daily/skills/briefing/SKILL.md
index 09036600e9..d625bc475b 100644
--- a/plugin-variants/gbrain-daily/skills/briefing/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/briefing/SKILL.md
@@ -16,6 +16,7 @@ tools:
- get_timeline
mutating: false
upstream: briefing@fc834ee
+when_to_use: "Use when the user asks: \"daily briefing\", \"morning briefing\", \"what's happening today\", \"brain pulse\", \"pre-briefing pull\"."
---
# Briefing Skill
diff --git a/plugin-variants/gbrain-daily/skills/bulk-ingestion/SKILL.md b/plugin-variants/gbrain-daily/skills/bulk-ingestion/SKILL.md
index 22de668dd6..9a94479bef 100644
--- a/plugin-variants/gbrain-daily/skills/bulk-ingestion/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/bulk-ingestion/SKILL.md
@@ -24,6 +24,7 @@ writes_to:
- projects/
- sources/
upstream: bulk-skillify+manifest-driven-ingestion@fc834ee
+when_to_use: "Use when the user asks: \"bulk ingest\", \"bulk import\", \"ingest all\", \"ingestion pipeline\", \"mass ingestion\"."
---
# bulk-ingestion — Trial → Improve → Bulk, on a Durable Manifest
diff --git a/plugin-variants/gbrain-daily/skills/conversation-archive/SKILL.md b/plugin-variants/gbrain-daily/skills/conversation-archive/SKILL.md
index 735d880019..8d6bbf5854 100644
--- a/plugin-variants/gbrain-daily/skills/conversation-archive/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/conversation-archive/SKILL.md
@@ -24,6 +24,7 @@ writes_pages: true
writes_to:
- conversations/
upstream: conversation-history+transcript-save@fc834ee
+when_to_use: "Use when the user asks: \"chatgpt export\", \"claude export\", \"perplexity export\", \"conversation history\", \"import my conversations\"."
---
# conversation-archive — AI-Chat Exports + Session Transcripts as Brain Pages
diff --git a/plugin-variants/gbrain-daily/skills/daily-task-manager/SKILL.md b/plugin-variants/gbrain-daily/skills/daily-task-manager/SKILL.md
index 5b2c889004..9769022a14 100644
--- a/plugin-variants/gbrain-daily/skills/daily-task-manager/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/daily-task-manager/SKILL.md
@@ -18,6 +18,7 @@ tools:
- add_timeline_entry
mutating: true
upstream: daily-task-manager@fc834ee
+when_to_use: "Use when the user asks: \"add task\", \"complete task\", \"what are my tasks\", \"task list\", \"defer task\"."
---
# Daily Task Manager
diff --git a/plugin-variants/gbrain-daily/skills/daily-task-prep/SKILL.md b/plugin-variants/gbrain-daily/skills/daily-task-prep/SKILL.md
index 9eb50b70e8..4253c250b5 100644
--- a/plugin-variants/gbrain-daily/skills/daily-task-prep/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/daily-task-prep/SKILL.md
@@ -16,6 +16,7 @@ tools:
- list_pages
- get_timeline
mutating: false
+when_to_use: "Use when the user asks: \"morning prep\", \"prepare for today\", \"what's on my plate\", \"day prep\"."
---
# Daily Task Prep
diff --git a/plugin-variants/gbrain-daily/skills/data-research/SKILL.md b/plugin-variants/gbrain-daily/skills/data-research/SKILL.md
index ac2224ed60..850ba29686 100644
--- a/plugin-variants/gbrain-daily/skills/data-research/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/data-research/SKILL.md
@@ -25,6 +25,7 @@ tools:
- file_upload
mutating: true
upstream: data-research@fc834ee
+when_to_use: "Use when the user asks: \"research\", \"track\", \"extract from email\", \"investor updates\", \"donations\"."
---
# Data Research
diff --git a/plugin-variants/gbrain-daily/skills/db-repair/SKILL.md b/plugin-variants/gbrain-daily/skills/db-repair/SKILL.md
index 2b1c8db634..f611427926 100644
--- a/plugin-variants/gbrain-daily/skills/db-repair/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/db-repair/SKILL.md
@@ -19,6 +19,7 @@ tools:
- exec
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"GBRAIN_DB_ACCESS\", \"gbrain database error\", \"gbrain connection refused\", \"cannot reach the brain database\", \"brain database is down\"."
---
# GBrain DB Repair
diff --git a/plugin-variants/gbrain-daily/skills/gbrain-advisor/SKILL.md b/plugin-variants/gbrain-daily/skills/gbrain-advisor/SKILL.md
index cf5d0d1ca9..0ad67f0cc3 100644
--- a/plugin-variants/gbrain-daily/skills/gbrain-advisor/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/gbrain-advisor/SKILL.md
@@ -15,6 +15,7 @@ triggers:
tools:
- advisor
mutating: false
+when_to_use: "Use when the user asks: \"what should I do to get more out of gbrain\", \"is my brain set up right\", \"gbrain advisor\", \"advise me on my brain\", \"weekly brain checkup\"."
---
# gbrain Advisor
diff --git a/plugin-variants/gbrain-daily/skills/ingest/SKILL.md b/plugin-variants/gbrain-daily/skills/ingest/SKILL.md
index 53f553773c..f868feec79 100644
--- a/plugin-variants/gbrain-daily/skills/ingest/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/ingest/SKILL.md
@@ -20,6 +20,7 @@ writes_to:
- concepts/
- meetings/
- sources/
+when_to_use: "Use when the user asks: \"ingest this\", \"save this to brain\", \"process this meeting\"."
---
# Ingest Skill
@@ -34,7 +35,7 @@ Ingest meetings, articles, media, documents, and conversations into the brain.
- Every entity mention creates a back-link from the entity's page to the page mentioning them (Iron Law).
- Raw sources are preserved for provenance via `gbrain files upload-raw` with automatic size routing.
- State sections are rewritten with current best understanding, never appended to.
-- Entity detection fires on every inbound message; notable entities get pages or updates.
+- After the user's explicit automatic-capture opt-in (see `skills/signal-detector/SKILL.md`), entity detection fires on every substantive inbound message; notable entities get pages or updates. Without that opt-in, capture only what the user asks to save.
- Notability gate before any new entity page: existing pages are updated, and a NEW page is
created only for a notable entity and only with meaningful content from web search or
existing brain context — no stubs. A non-notable mention stays an inline reference on the
@@ -71,15 +72,19 @@ Every fact written to a brain page must carry an inline `[Source: ...]` citation
5. **Back-link all entities.** Update EVERY mentioned entity's page with a back-link to this page (Iron Law).
6. **Timeline merge.** The same event appears on ALL mentioned entities' timelines. If Alice met Bob at Acme Corp, the event goes on Alice's page, Bob's page, and Acme Corp's page.
-## Entity Detection on Every Message
+## Entity Detection on Every Message (after opt-in)
-Production agents should detect entity mentions on EVERY inbound message. This is
-the signal detection loop that makes the brain compound over time.
+Automatic capture is off by default. Once the user has explicitly opted in to
+automatic capture for this brain (the stored choice `skills/signal-detector/SKILL.md`
+checks before writing), production agents detect entity mentions on every
+substantive inbound message. This is the signal detection loop that makes the
+brain compound over time. Without the opt-in, write only what the user asks to save.
### Protocol
1. **Scan the message** for entity mentions: people, companies, concepts, original
- thinking. Fire on every message (no exceptions unless purely operational).
+ thinking. With the opt-in recorded, fire on every substantive message (skip
+ purely operational ones and honor narrower per-message instructions).
2. **For each entity detected:**
- `gbrain search "name"` -- does a page already exist?
- **If yes:** load context with `gbrain get <slug>`. Use the compiled truth to
diff --git a/plugin-variants/gbrain-daily/skills/mcp-access/SKILL.md b/plugin-variants/gbrain-daily/skills/mcp-access/SKILL.md
index c42bf0c946..544aeae24f 100644
--- a/plugin-variants/gbrain-daily/skills/mcp-access/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/mcp-access/SKILL.md
@@ -16,6 +16,7 @@ tools:
- exec
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"GBrain admin login link\", \"open the MCP admin panel\", \"manage MCP clients\", \"register an MCP client\", \"set up MCP OAuth\"."
---
# MCP access and administration
diff --git a/plugin-variants/gbrain-daily/skills/media-ingest/SKILL.md b/plugin-variants/gbrain-daily/skills/media-ingest/SKILL.md
index 1225179b34..6790b011d3 100644
--- a/plugin-variants/gbrain-daily/skills/media-ingest/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/media-ingest/SKILL.md
@@ -32,6 +32,7 @@ writes_to:
- companies/
- sources/
upstream: media-ingest@fc834ee
+when_to_use: "Use when the user asks: \"watch this video\", \"process this YouTube link\", \"ingest this PDF\", \"save this podcast\", \"process this book\"."
---
# Media Ingest Skill
diff --git a/plugin-variants/gbrain-daily/skills/meeting-ingestion/SKILL.md b/plugin-variants/gbrain-daily/skills/meeting-ingestion/SKILL.md
index b8f1a50dad..312d82fad1 100644
--- a/plugin-variants/gbrain-daily/skills/meeting-ingestion/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/meeting-ingestion/SKILL.md
@@ -41,6 +41,7 @@ upstream:
- meeting-ingestion@fc834ee
- meeting-gold-standard@fc834ee
- chronology-guard@fc834ee
+when_to_use: "Use when the user asks: \"meeting transcript\", \"process this meeting\", \"meeting notes\", \"meeting recorder\", \"ingest this recording\"."
---
# Meeting Ingestion Skill — Unified Pipeline
diff --git a/plugin-variants/gbrain-daily/skills/perplexity-research/SKILL.md b/plugin-variants/gbrain-daily/skills/perplexity-research/SKILL.md
index 28d9effe0b..dfb955130a 100644
--- a/plugin-variants/gbrain-daily/skills/perplexity-research/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/perplexity-research/SKILL.md
@@ -14,6 +14,7 @@ mutating: true
writes_pages: true
writes_to:
- research/
+when_to_use: "Use when the user asks: \"perplexity research\", \"perplexity-research\", \"what's new about\", \"current state of\", \"web research\"."
---
# perplexity-research — Brain-Augmented Web Research
@@ -105,11 +106,17 @@ gbrain query "<topic keywords>"
# Cite every claim.
# """
-# 3. Call Perplexity API or the host's perplexity binary:
-# curl https://api.perplexity.ai/chat/completions \
+# 3. Call Perplexity's Agent API (or the host's perplexity binary). The
+# Sonar chat-completions endpoint (/chat/completions with
+# "model": "sonar-pro") is being retired and refuses migrated accounts
+# with 403 agent_api_migration_required; use POST /v1/agent:
+# curl https://api.perplexity.ai/v1/agent \
# -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
# -H "Content-Type: application/json" \
-# -d '{"model": "sonar-pro", "messages": [{"role":"user","content":"..."}]}'
+# -d '{"preset": "low", "instructions": "Cite every claim.", "input": "..."}'
+# Read the answer from the output item with "type": "message" (SDKs
+# expose it as output_text) and the citations from the search results
+# in the output array; inline [n] markers refer to them.
# 4. Write the structured research page via put_page:
gbrain put research/<slug> # via the put_page operation
@@ -117,15 +124,16 @@ gbrain put research/<slug> # via the put_page operation
# 5. Cross-link entities mentioned (people, companies) per Iron Law.
```
-## Models
+## Presets
-| Model | Cost / query | Use when |
+| Agent API preset | Replaces | Use when |
|-------|-------------|----------|
-| Perplexity sonar-pro | ~\$0.04 | Deep analysis, entity enrichment, deal research |
-| Perplexity sonar | ~\$0.007 | Quick lookups, bulk monitoring, briefing pipelines |
+| `"preset": "low"` | Sonar Pro | Deep analysis, entity enrichment, deal research (multi-step search) |
+| `"preset": "fast"` | Sonar | Quick lookups, bulk monitoring, briefing pipelines |
-Default to sonar-pro. Drop to sonar for bulk / cron contexts where cost
-matters more than depth.
+Default to `low`. Drop to `fast` for bulk / cron contexts where cost
+matters more than depth. Perplexity does not publish a fixed per-request
+price for presets; check its pricing page before running bulk jobs.
## Integration patterns
@@ -155,8 +163,11 @@ the agent doesn't re-narrate already-known facts.
## Recency filter
-Pass `recency_filter` to Perplexity: `hour | day | week | month`. Useful
-for news-cycle topics; omit for evergreen research.
+Pass the recency filter on the web search tool:
+`"tools": [{"type": "web_search", "filters": {"search_recency_filter": "week"}}]`
+with `hour | day | week | month | year`. Useful for news-cycle topics; omit
+for evergreen research. Record the value as `recency_filter` in the page
+frontmatter.
## When it fails
diff --git a/plugin-variants/gbrain-daily/skills/postgres-adopt/SKILL.md b/plugin-variants/gbrain-daily/skills/postgres-adopt/SKILL.md
index c1e9e63cd6..cdecf97843 100644
--- a/plugin-variants/gbrain-daily/skills/postgres-adopt/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/postgres-adopt/SKILL.md
@@ -19,6 +19,7 @@ tools:
- exec
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"which gbrain engine\", \"pglite or postgres\", \"gbrain engine status\", \"upgrade to postgres\", \"switch gbrain to postgres\"."
---
# Postgres Adopt
diff --git a/plugin-variants/gbrain-daily/skills/query/SKILL.md b/plugin-variants/gbrain-daily/skills/query/SKILL.md
index 556c6306a3..435cc96b45 100644
--- a/plugin-variants/gbrain-daily/skills/query/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/query/SKILL.md
@@ -28,6 +28,7 @@ tools:
- traverse_graph
- get_timeline
mutating: false
+when_to_use: "Use when the user asks: \"what do we know about\", \"tell me about\", \"who is\", \"what happened\", \"search for\"."
---
# Query Skill
diff --git a/plugin-variants/gbrain-daily/skills/reports/SKILL.md b/plugin-variants/gbrain-daily/skills/reports/SKILL.md
index 944d11b2b3..f6a0c71269 100644
--- a/plugin-variants/gbrain-daily/skills/reports/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/reports/SKILL.md
@@ -20,6 +20,7 @@ tools:
- search
mutating: true
upstream: report-quality-gate@fc834ee
+when_to_use: "Use when the user asks: \"save report\", \"load latest report\", \"what's the latest briefing\", \"show me the pulse\", \"report quality\"."
---
# Reports Skill
diff --git a/plugin-variants/gbrain-daily/skills/research-compendium/SKILL.md b/plugin-variants/gbrain-daily/skills/research-compendium/SKILL.md
index c410b37f81..89cba1be3f 100644
--- a/plugin-variants/gbrain-daily/skills/research-compendium/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/research-compendium/SKILL.md
@@ -24,6 +24,7 @@ writes_pages: true
writes_to:
- research/
upstream: research-compendium@fc834ee
+when_to_use: "Use when the user asks: \"compendium\", \"research everything about\", \"read them all and summarize\", \"definitive guide\", \"comprehensive guide to\"."
---
# research-compendium — Archive Everything, Summarize 1:1, Synthesize Once
diff --git a/plugin-variants/gbrain-daily/skills/strategic-reading/SKILL.md b/plugin-variants/gbrain-daily/skills/strategic-reading/SKILL.md
index 973629b5e1..c46b6d5720 100644
--- a/plugin-variants/gbrain-daily/skills/strategic-reading/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/strategic-reading/SKILL.md
@@ -19,6 +19,7 @@ writes_to:
# uploaded source text + writes brain pages; it doesn't call external
# APIs. Declarative opt-out.
brain_first: exempt
+when_to_use: "Use when the user asks: \"strategic reading\", \"read this through the lens of\", \"apply this to my problem\", \"what can I learn from this about\", \"extract a playbook from\"."
---
# strategic-reading — Applied Analysis from Source Texts
diff --git a/plugin-variants/gbrain-daily/skills/voice-note-ingest/SKILL.md b/plugin-variants/gbrain-daily/skills/voice-note-ingest/SKILL.md
index 3543010c39..30feaa527a 100644
--- a/plugin-variants/gbrain-daily/skills/voice-note-ingest/SKILL.md
+++ b/plugin-variants/gbrain-daily/skills/voice-note-ingest/SKILL.md
@@ -19,6 +19,7 @@ writes_to:
- companies/
- ideas/
- personal/
+when_to_use: "Use when the user asks: \"voice note\", \"ingest this voice memo\", \"transcribe and file\", \"voice note ingest\", \"save this audio note\"."
---
# voice-note-ingest — Exact-Phrasing Voice Capture
diff --git a/plugin/skills/_AGENT_README.md b/plugin/skills/_AGENT_README.md
index 710a22af4c..0dab2fef65 100644
--- a/plugin/skills/_AGENT_README.md
+++ b/plugin/skills/_AGENT_README.md
@@ -84,7 +84,11 @@ skill — read its SKILL.md body in full and follow the workflow described there
useful for scanning every skill and its trigger phrases in one place, and it
carries the disambiguation rules for overlapping matches. If the two disagree,
frontmatter wins. (There is no machine-managed block inside `RESOLVER.md` or
-`AGENTS.md`; that pattern was retired.)
+`AGENTS.md`; that pattern was retired.) `RESOLVER.md` ships in the gbrain
+install's `skills/` directory; `gbrain skillpack scaffold` does not copy it,
+and the Claude Code / Codex plugin lanes do not ship it. Where it is absent,
+routing rests on each skill's frontmatter alone (`triggers:`, `description`,
+and the `when_to_use` the plugin lanes add from the triggers).
## The memory loop
@@ -207,6 +211,6 @@ This file (`_AGENT_README.md`) is the routing contract — keep it short.
lookup chain — an unexplained exemption is a conformance failure.
- **`priority:` is NOT part of the routing contract.** Nothing in the routing
path consumes it — matching is substring-over-`triggers:` (see "Routing"
- above), with `RESOLVER.md` disambiguation for overlaps. A `priority:` key is
+ above), with `RESOLVER.md` disambiguation for overlaps where it ships. A `priority:` key is
inert; don't add one expecting it to reorder matches. Encode precedence in
trigger specificity and the resolver's disambiguation rules instead.
diff --git a/plugin/skills/_brain-filing-rules.json b/plugin/skills/_brain-filing-rules.json
index f266d421c7..18deab3be8 100644
--- a/plugin/skills/_brain-filing-rules.json
+++ b/plugin/skills/_brain-filing-rules.json
@@ -135,6 +135,12 @@
"examples": ["media/x/{handle}/", "media/audio/", "media/video/"],
"description": "Format-prefixed parent for media-by-source-format ingest. Subdirectories like media/x/{handle}/ hold X/Twitter archives, media/audio/ holds podcast/voice captures. The format-prefix lives only when the content is sui generis to the source format AND lacks a clean primary-subject directory. Prefer subject-by-subject filing; fall through to media/ only when the source format IS the unifying frame."
},
+ {
+ "kind": "inbox",
+ "directory": "inbox/",
+ "examples": ["captured thoughts", "pasted snippets awaiting filing"],
+ "description": "Raw captured content awaiting filing; `gbrain capture` writes here. Move a page to its primary-subject directory once it is understood."
+ },
{
"kind": "conversation",
"directory": "conversations/",
diff --git a/plugin/skills/academic-verify/SKILL.md b/plugin/skills/academic-verify/SKILL.md
index 5482b296c0..cb9d692852 100644
--- a/plugin/skills/academic-verify/SKILL.md
+++ b/plugin/skills/academic-verify/SKILL.md
@@ -13,6 +13,7 @@ mutating: true
writes_pages: true
writes_to:
- concepts/
+when_to_use: "Use when the user asks: \"verify this academic claim\", \"check this study\", \"academic verify\", \"validate citation\", \"is this study real\"."
---
# academic-verify — Trace Claims to Source Data
diff --git a/plugin/skills/archive-crawler/SKILL.md b/plugin/skills/archive-crawler/SKILL.md
index 01b9f5a091..7ee62639f9 100644
--- a/plugin/skills/archive-crawler/SKILL.md
+++ b/plugin/skills/archive-crawler/SKILL.md
@@ -14,6 +14,7 @@ writes_to:
- originals/
- personal/
- ideas/
+when_to_use: "Use when the user asks: \"crawl my archive\", \"find gold in my archive\", \"archive crawler\", \"scan my dropbox for\", \"mine my old files for\"."
---
# archive-crawler — The Universal Archivist
diff --git a/plugin/skills/article-enrichment/SKILL.md b/plugin/skills/article-enrichment/SKILL.md
index 96471f107f..cd057b5a4b 100644
--- a/plugin/skills/article-enrichment/SKILL.md
+++ b/plugin/skills/article-enrichment/SKILL.md
@@ -14,6 +14,7 @@ mutating: true
writes_pages: true
writes_to:
- media/articles/
+when_to_use: "Use when the user asks: \"enrich this article\", \"enrich the article\", \"enriching the article\", \"enrich brain pages\", \"batch enrich\"."
---
# article-enrichment — From Raw Dumps to Useful Brain Pages
diff --git a/plugin/skills/ask-user/SKILL.md b/plugin/skills/ask-user/SKILL.md
index c7df90af79..85b7bc0b90 100644
--- a/plugin/skills/ask-user/SKILL.md
+++ b/plugin/skills/ask-user/SKILL.md
@@ -11,6 +11,7 @@ triggers:
- "ask before proceeding"
- "choice gate"
- "user decision"
+when_to_use: "Use when the user asks: \"present options\", \"ask before proceeding\", \"choice gate\", \"user decision\"."
---
# Ask User — Choice Gate Pattern
diff --git a/plugin/skills/blog-ingest/SKILL.md b/plugin/skills/blog-ingest/SKILL.md
index c26fa99aa4..6f93eeed24 100644
--- a/plugin/skills/blog-ingest/SKILL.md
+++ b/plugin/skills/blog-ingest/SKILL.md
@@ -24,6 +24,7 @@ writes_to:
- sources/
- projects/
upstream: blog-ingest@fc834ee
+when_to_use: "Use when the user asks: \"ingest this publication\", \"ingest this whole blog\", \"ingest this feed\", \"ingest this newsletter archive\", \"save this whole substack\"."
---
# blog-ingest — Feed & Whole-Publication Ingestion
diff --git a/plugin/skills/book-mirror/SKILL.md b/plugin/skills/book-mirror/SKILL.md
index e5e7354a89..a6ecf2aab4 100644
--- a/plugin/skills/book-mirror/SKILL.md
+++ b/plugin/skills/book-mirror/SKILL.md
@@ -13,6 +13,7 @@ writes_pages: true
writes_to:
- media/books/
upstream: book-mirror@fc834ee
+when_to_use: "Use when the user asks: \"personalized version of this book\", \"mirror this book\", \"two-column book analysis\", \"apply this book to my life\", \"how does this book apply to me\"."
---
# book-mirror — Personalized Chapter-by-Chapter Book Analysis
diff --git a/plugin/skills/brain-ingest-gate/SKILL.md b/plugin/skills/brain-ingest-gate/SKILL.md
index d1a7bbfe0e..7abc28d1ee 100644
--- a/plugin/skills/brain-ingest-gate/SKILL.md
+++ b/plugin/skills/brain-ingest-gate/SKILL.md
@@ -29,6 +29,7 @@ upstream: brain-ingest-gate@fc834ee
# brain-first lookup performed at write time (entity card, alias-expanded
# search, read the top hit) before anything external or new is written.
brain_first: true
+when_to_use: "Use when the user asks: \"move this to brain\", \"migrate to brain\", \"copy these files into the brain\", \"is this already in the brain\", \"check for duplicates before writing\"."
---
# Brain Ingest Gate — Resolve and Dedup Before Anything Enters the Brain
diff --git a/plugin/skills/brain-link-discipline/SKILL.md b/plugin/skills/brain-link-discipline/SKILL.md
index 22d30ab233..aef556eaf5 100644
--- a/plugin/skills/brain-link-discipline/SKILL.md
+++ b/plugin/skills/brain-link-discipline/SKILL.md
@@ -26,6 +26,7 @@ upstream: brain-link-on-commit@fc834ee + brain-link-report@fc834ee
# existence check against the user's own hosted git remote (link
# verification, not data retrieval). Declarative opt-out.
brain_first: exempt
+when_to_use: "Use when the user asks: \"give me the link\", \"where is the page\", \"why does this link 404\", \"brain link discipline\", \"rewrite subagent paths\"."
---
# brain-link-discipline — The Link Is Part of the Deliverable
diff --git a/plugin/skills/brain-ops/SKILL.md b/plugin/skills/brain-ops/SKILL.md
index 48abcdf7d7..af7add3cac 100644
--- a/plugin/skills/brain-ops/SKILL.md
+++ b/plugin/skills/brain-ops/SKILL.md
@@ -26,6 +26,7 @@ writes_to:
- deals/
- concepts/
- meetings/
+when_to_use: "Use when the user asks: \"any brain read/write/lookup/citation\"."
---
# Brain Operations — The Ambient Context Layer
diff --git a/plugin/skills/brain-pdf/SKILL.md b/plugin/skills/brain-pdf/SKILL.md
index 7baf9506a0..74a14bbef1 100644
--- a/plugin/skills/brain-pdf/SKILL.md
+++ b/plugin/skills/brain-pdf/SKILL.md
@@ -8,6 +8,7 @@ triggers:
- "convert brain page to pdf"
- "publish this page as pdf"
- "export brain page"
+when_to_use: "Use when the user asks: \"make pdf from brain\", \"brain pdf\", \"convert brain page to pdf\", \"publish this page as pdf\", \"export brain page\"."
---
# brain-pdf — Render a Brain Page to Publication-Quality PDF
diff --git a/plugin/skills/brain-taxonomist/SKILL.md b/plugin/skills/brain-taxonomist/SKILL.md
index 5bbdfa8aa5..c7661b032c 100644
--- a/plugin/skills/brain-taxonomist/SKILL.md
+++ b/plugin/skills/brain-taxonomist/SKILL.md
@@ -17,6 +17,7 @@ triggers:
- "which directory does this go"
- "which directory does this page go"
mutating: false
+when_to_use: "Use when the user asks: \"where does this brain page go\", \"file this in the brain\", \"brain taxonomist\", \"taxonomy check\", \"refile brain page\"."
---
# brain-taxonomist
diff --git a/plugin/skills/briefing/SKILL.md b/plugin/skills/briefing/SKILL.md
index 09036600e9..d625bc475b 100644
--- a/plugin/skills/briefing/SKILL.md
+++ b/plugin/skills/briefing/SKILL.md
@@ -16,6 +16,7 @@ tools:
- get_timeline
mutating: false
upstream: briefing@fc834ee
+when_to_use: "Use when the user asks: \"daily briefing\", \"morning briefing\", \"what's happening today\", \"brain pulse\", \"pre-briefing pull\"."
---
# Briefing Skill
diff --git a/plugin/skills/bulk-ingestion/SKILL.md b/plugin/skills/bulk-ingestion/SKILL.md
index 22de668dd6..9a94479bef 100644
--- a/plugin/skills/bulk-ingestion/SKILL.md
+++ b/plugin/skills/bulk-ingestion/SKILL.md
@@ -24,6 +24,7 @@ writes_to:
- projects/
- sources/
upstream: bulk-skillify+manifest-driven-ingestion@fc834ee
+when_to_use: "Use when the user asks: \"bulk ingest\", \"bulk import\", \"ingest all\", \"ingestion pipeline\", \"mass ingestion\"."
---
# bulk-ingestion — Trial → Improve → Bulk, on a Durable Manifest
diff --git a/plugin/skills/capture/SKILL.md b/plugin/skills/capture/SKILL.md
index 3745c0588a..61373d7e8d 100644
--- a/plugin/skills/capture/SKILL.md
+++ b/plugin/skills/capture/SKILL.md
@@ -8,8 +8,10 @@ triggers:
- "ingest this into my brain"
- "drop this in the inbox"
- "save to brain"
-writes_pages:
- - "inbox/*"
+writes_pages: true
+writes_to:
+ - inbox/
+when_to_use: "Use when the user asks: \"capture this\", \"save this thought\", \"remember this\", \"ingest this into my brain\", \"drop this in the inbox\"."
---
# capture — the single ingestion entrypoint
diff --git a/plugin/skills/chat-connectors/SKILL.md b/plugin/skills/chat-connectors/SKILL.md
index 878449a5f2..1b47a06433 100644
--- a/plugin/skills/chat-connectors/SKILL.md
+++ b/plugin/skills/chat-connectors/SKILL.md
@@ -19,6 +19,7 @@ mutating: true
writes_pages: true
writes_to:
- conversations/
+when_to_use: "Use when the user asks: \"connect my chatgpt\", \"connect my claude account\", \"sync my chat history\", \"chatgpt oauth\", \"auto-import my chats\"."
---
# chat-connectors — Live account sync of ChatGPT + Claude history
diff --git a/plugin/skills/citation-fixer/SKILL.md b/plugin/skills/citation-fixer/SKILL.md
index d76505affd..1878694f2e 100644
--- a/plugin/skills/citation-fixer/SKILL.md
+++ b/plugin/skills/citation-fixer/SKILL.md
@@ -18,6 +18,7 @@ tools:
- put_page
- list_pages
mutating: true
+when_to_use: "Use when the user asks: \"fix citations\", \"fix broken citations\", \"citation audit\", \"check citations\", \"citation fixer\"."
---
# Citation Fixer Skill
diff --git a/plugin/skills/citation-graph-ingest/SKILL.md b/plugin/skills/citation-graph-ingest/SKILL.md
index 2065160169..98a63f606a 100644
--- a/plugin/skills/citation-graph-ingest/SKILL.md
+++ b/plugin/skills/citation-graph-ingest/SKILL.md
@@ -24,6 +24,7 @@ requires:
mutating: true
writes_pages: false
upstream: citation-graph-ingest@fc834ee
+when_to_use: "Use when the user asks: \"citation graph\", \"citation graph ingest\", \"typed citation graph\", \"build a reference graph\", \"graph over a corpus\"."
---
# Citation Graph Ingest — Typed Reference Graph Over a Corpus
diff --git a/plugin/skills/cold-start/SKILL.md b/plugin/skills/cold-start/SKILL.md
index 31b08d50a1..a0480107cb 100644
--- a/plugin/skills/cold-start/SKILL.md
+++ b/plugin/skills/cold-start/SKILL.md
@@ -37,6 +37,7 @@ writes_to:
- media/
- conversations/
- sources/
+when_to_use: "Use when the user asks: \"cold start\", \"fill my brain\", \"bootstrap brain\", \"bootstrap my data\", \"import my data\"."
---
# Cold Start — Day-One Brain Bootstrapping
diff --git a/plugin/skills/company-brainify/SKILL.md b/plugin/skills/company-brainify/SKILL.md
index 7edad608fe..cf5ebf1b33 100644
--- a/plugin/skills/company-brainify/SKILL.md
+++ b/plugin/skills/company-brainify/SKILL.md
@@ -35,6 +35,7 @@ upstream: company-brainify@fc834ee
# skill edits IN PLACE — it does not create new pages there, except the
# deletion-log entry under daily/ required by data-loss-gate Step 4.
brain_first: true
+when_to_use: "Use when the user asks: \"company brain\", \"team brain\", \"brainify\", \"sanitize the brain\", \"share my brain with the team\"."
---
# company-brainify — Personal → Team-Brain Sanitization
diff --git a/plugin/skills/concept-synthesis/SKILL.md b/plugin/skills/concept-synthesis/SKILL.md
index e0142d5d6f..0ad25e6272 100644
--- a/plugin/skills/concept-synthesis/SKILL.md
+++ b/plugin/skills/concept-synthesis/SKILL.md
@@ -16,6 +16,7 @@ mutating: true
writes_pages: true
writes_to:
- concepts/
+when_to_use: "Use when the user asks: \"concept synthesis\", \"synthesize my concepts\", \"find patterns across my notes\", \"build my intellectual map\", \"trace idea evolution\"."
---
# concept-synthesis — From Raw Stubs to Intellectual Map
diff --git a/plugin/skills/context-audit/SKILL.md b/plugin/skills/context-audit/SKILL.md
index 785b04fcec..096ff577ca 100644
--- a/plugin/skills/context-audit/SKILL.md
+++ b/plugin/skills/context-audit/SKILL.md
@@ -27,6 +27,7 @@ tools:
mutating: false
writes_pages: false
upstream: context-audit@fc834ee
+when_to_use: "Use when the user asks: \"context audit\", \"context diet\", \"system prompt audit\", \"prompt compression\", \"reduce context size\"."
---
# context-audit — Token Hygiene for the Always-Loaded Context Stack
diff --git a/plugin/skills/conversation-archive/SKILL.md b/plugin/skills/conversation-archive/SKILL.md
index 735d880019..8d6bbf5854 100644
--- a/plugin/skills/conversation-archive/SKILL.md
+++ b/plugin/skills/conversation-archive/SKILL.md
@@ -24,6 +24,7 @@ writes_pages: true
writes_to:
- conversations/
upstream: conversation-history+transcript-save@fc834ee
+when_to_use: "Use when the user asks: \"chatgpt export\", \"claude export\", \"perplexity export\", \"conversation history\", \"import my conversations\"."
---
# conversation-archive — AI-Chat Exports + Session Transcripts as Brain Pages
diff --git a/plugin/skills/correction-pipeline/SKILL.md b/plugin/skills/correction-pipeline/SKILL.md
index e72540e658..8a4b47f055 100644
--- a/plugin/skills/correction-pipeline/SKILL.md
+++ b/plugin/skills/correction-pipeline/SKILL.md
@@ -23,6 +23,7 @@ writes_to:
- companies/
- concepts/
upstream: correction-pipeline@fc834ee
+when_to_use: "Use when the user asks: \"that's wrong\", \"that's not true\", \"I never said that\", \"where did you get that\", \"you got that wrong\"."
---
# Correction Pipeline
diff --git a/plugin/skills/cron-scheduler/SKILL.md b/plugin/skills/cron-scheduler/SKILL.md
index 55cd5ceed4..b728705bcf 100644
--- a/plugin/skills/cron-scheduler/SKILL.md
+++ b/plugin/skills/cron-scheduler/SKILL.md
@@ -14,6 +14,7 @@ tools:
- get_page
- put_page
mutating: true
+when_to_use: "Use when the user asks: \"schedule a job\", \"cron\", \"quiet hours\", \"what jobs are running\"."
---
# Cron Scheduler
diff --git a/plugin/skills/cross-modal-review/SKILL.md b/plugin/skills/cross-modal-review/SKILL.md
index ece231e1b2..0af06c5828 100644
--- a/plugin/skills/cross-modal-review/SKILL.md
+++ b/plugin/skills/cross-modal-review/SKILL.md
@@ -19,6 +19,7 @@ tools:
- query
- get_page
mutating: false
+when_to_use: "Use when the user asks: \"second opinion\", \"cross-modal review\", \"double check this\", \"get another perspective\", \"challenge this code\"."
---
# Cross-Modal Review
diff --git a/plugin/skills/daily-task-manager/SKILL.md b/plugin/skills/daily-task-manager/SKILL.md
index 5b2c889004..9769022a14 100644
--- a/plugin/skills/daily-task-manager/SKILL.md
+++ b/plugin/skills/daily-task-manager/SKILL.md
@@ -18,6 +18,7 @@ tools:
- add_timeline_entry
mutating: true
upstream: daily-task-manager@fc834ee
+when_to_use: "Use when the user asks: \"add task\", \"complete task\", \"what are my tasks\", \"task list\", \"defer task\"."
---
# Daily Task Manager
diff --git a/plugin/skills/daily-task-prep/SKILL.md b/plugin/skills/daily-task-prep/SKILL.md
index 9eb50b70e8..4253c250b5 100644
--- a/plugin/skills/daily-task-prep/SKILL.md
+++ b/plugin/skills/daily-task-prep/SKILL.md
@@ -16,6 +16,7 @@ tools:
- list_pages
- get_timeline
mutating: false
+when_to_use: "Use when the user asks: \"morning prep\", \"prepare for today\", \"what's on my plate\", \"day prep\"."
---
# Daily Task Prep
diff --git a/plugin/skills/data-loss-gate/SKILL.md b/plugin/skills/data-loss-gate/SKILL.md
index b22a34b328..9c92f22a1a 100644
--- a/plugin/skills/data-loss-gate/SKILL.md
+++ b/plugin/skills/data-loss-gate/SKILL.md
@@ -27,6 +27,7 @@ upstream: data-loss-gate@fc834ee
# check backlinks / graph dependencies (get_backlinks, graph) so the card's
# "what we'd lose" section is grounded in the actual target, not guesses.
brain_first: true
+when_to_use: "Use when the user asks: \"bulk delete\", \"wipe the\", \"rm -rf\", \"purge the\", \"truncate\"."
---
# Data Loss Gate — Confirmation Before Destructive Operations
diff --git a/plugin/skills/data-research/SKILL.md b/plugin/skills/data-research/SKILL.md
index ac2224ed60..850ba29686 100644
--- a/plugin/skills/data-research/SKILL.md
+++ b/plugin/skills/data-research/SKILL.md
@@ -25,6 +25,7 @@ tools:
- file_upload
mutating: true
upstream: data-research@fc834ee
+when_to_use: "Use when the user asks: \"research\", \"track\", \"extract from email\", \"investor updates\", \"donations\"."
---
# Data Research
diff --git a/plugin/skills/db-repair/SKILL.md b/plugin/skills/db-repair/SKILL.md
index 2b1c8db634..f611427926 100644
--- a/plugin/skills/db-repair/SKILL.md
+++ b/plugin/skills/db-repair/SKILL.md
@@ -19,6 +19,7 @@ tools:
- exec
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"GBRAIN_DB_ACCESS\", \"gbrain database error\", \"gbrain connection refused\", \"cannot reach the brain database\", \"brain database is down\"."
---
# GBrain DB Repair
diff --git a/plugin/skills/draft-in-voice/SKILL.md b/plugin/skills/draft-in-voice/SKILL.md
index 43a1ac895f..07b364dd86 100644
--- a/plugin/skills/draft-in-voice/SKILL.md
+++ b/plugin/skills/draft-in-voice/SKILL.md
@@ -25,6 +25,7 @@ writes_pages: true
writes_to:
- people/
upstream: draft-in-voice@fc834ee
+when_to_use: "Use when the user asks: \"draft in voice\", \"write this as\", \"make this sound like\", \"ghostwrite\", \"draft a tweet as\"."
---
# draft-in-voice — Memory-Grounded Ghostwriting
diff --git a/plugin/skills/eiirp/SKILL.md b/plugin/skills/eiirp/SKILL.md
index 76d9510873..98053e8c93 100644
--- a/plugin/skills/eiirp/SKILL.md
+++ b/plugin/skills/eiirp/SKILL.md
@@ -73,9 +73,10 @@ distinct_from:
- name: skillify
reason: "skillify is the meta-skill for turning a feature into a tested skill. EIIRP calls skillify when Phase 5 identifies a reusable pattern."
- name: signal-detector
- reason: "signal-detector ambiently captures the USER's ideas + entity mentions on every inbound message. EIIRP's auto-fire gate files the AGENT's own deliverable analysis at reply time. Both are always-on; they watch opposite directions of the conversation."
+ reason: "signal-detector (after explicit automatic-capture opt-in) ambiently captures the USER's ideas + entity mentions on every inbound message. EIIRP's auto-fire gate files the AGENT's own deliverable analysis at reply time. signal-detector runs only after the user's explicit automatic-capture opt-in; EIIRP's gate is always-on. They watch opposite directions of the conversation."
- name: meeting-ingestion
reason: "meeting-ingestion (like idea-ingest, media-ingest, voice-note-ingest, book-mirror) is a dedicated pipeline with its own brain-write logic. The auto-fire gate EXEMPTS dedicated-pipeline content — it never double-files."
+when_to_use: "Use when the user asks: \"everything in its right place\", \"eiirp\", \"store this research\", \"put this in the brain\", \"file this properly\"."
---
# EIIRP — Everything In Its Right Place
diff --git a/plugin/skills/enrich/SKILL.md b/plugin/skills/enrich/SKILL.md
index 0d6f2879ae..84f88b3083 100644
--- a/plugin/skills/enrich/SKILL.md
+++ b/plugin/skills/enrich/SKILL.md
@@ -24,6 +24,7 @@ writes_pages: true
writes_to:
- people/
- companies/
+when_to_use: "Use when the user asks: \"enrich\", \"create person page\", \"update company page\", \"who is this person\", \"look up this company\"."
---
# Enrich Skill
diff --git a/plugin/skills/fact-check/SKILL.md b/plugin/skills/fact-check/SKILL.md
index bf5377da1d..77629c473c 100644
--- a/plugin/skills/fact-check/SKILL.md
+++ b/plugin/skills/fact-check/SKILL.md
@@ -30,6 +30,7 @@ tools:
mutating: true
writes_pages: false
upstream: fact-check@fc834ee
+when_to_use: "Use when the user asks: \"fact check\", \"fact-check\", \"verify the facts\", \"check the claims\", \"is this accurate\"."
---
# Fact-Check — Claim-by-Claim Verification Before Anything Ships
diff --git a/plugin/skills/frontmatter-guard/SKILL.md b/plugin/skills/frontmatter-guard/SKILL.md
index 73be161a13..2ebe7a69ed 100644
--- a/plugin/skills/frontmatter-guard/SKILL.md
+++ b/plugin/skills/frontmatter-guard/SKILL.md
@@ -19,6 +19,7 @@ triggers:
tools:
- exec
mutating: true
+when_to_use: "Use when the user asks: \"validate frontmatter\", \"check frontmatter\", \"fix frontmatter\", \"frontmatter audit\", \"brain lint\"."
---
# Frontmatter Guard Skill
diff --git a/plugin/skills/functional-area-resolver/SKILL.md b/plugin/skills/functional-area-resolver/SKILL.md
index 4131ad8525..edd14691a7 100644
--- a/plugin/skills/functional-area-resolver/SKILL.md
+++ b/plugin/skills/functional-area-resolver/SKILL.md
@@ -32,6 +32,7 @@ mutating: true
# the word `perplexity` but the skill never actually calls external
# APIs. It rewrites local routing tables. Declarative opt-out.
brain_first: exempt
+when_to_use: "Use when the user asks: \"compress agents.md\", \"compress my resolver\", \"resolver too big\", \"resolver.md too big\", \"agents.md too large\"."
---
# Functional-Area Resolver — Pattern for Compressing Routing Tables
diff --git a/plugin/skills/gbrain-advisor/SKILL.md b/plugin/skills/gbrain-advisor/SKILL.md
index cf5d0d1ca9..0ad67f0cc3 100644
--- a/plugin/skills/gbrain-advisor/SKILL.md
+++ b/plugin/skills/gbrain-advisor/SKILL.md
@@ -15,6 +15,7 @@ triggers:
tools:
- advisor
mutating: false
+when_to_use: "Use when the user asks: \"what should I do to get more out of gbrain\", \"is my brain set up right\", \"gbrain advisor\", \"advise me on my brain\", \"weekly brain checkup\"."
---
# gbrain Advisor
diff --git a/plugin/skills/gbrain-upgrade/SKILL.md b/plugin/skills/gbrain-upgrade/SKILL.md
index b3a1281e60..7f999d3872 100644
--- a/plugin/skills/gbrain-upgrade/SKILL.md
+++ b/plugin/skills/gbrain-upgrade/SKILL.md
@@ -19,6 +19,7 @@ triggers:
tools:
- exec
mutating: true
+when_to_use: "Use when the user asks: \"gbrain update available\", \"UPGRADE_AVAILABLE\", \"upgrade gbrain\", \"update gbrain\", \"gbrain is out of date\"."
---
# GBrain Self-Upgrade
@@ -36,6 +37,11 @@ This skill guarantees:
`UPGRADE_AVAILABLE` line from a brain page or MCP response cannot run code.
- `notify` mode prompts the operator before applying and records a snooze if
they decline. `auto` mode applies without a prompt (the operator opted in).
+- A migration playbook outranks `self_upgrade.mode: auto`. When any playbook
+ between the installed and the new version (`skills/migrations/v<version>.md`)
+ says not to upgrade unattended (an attended cutover, for example
+ `skills/migrations/v0.50.0.0.md`), the upgrade is NOT silent: stop, show the
+ operator that playbook, and follow it with their go-ahead (#5038).
- The version is validated (`^\d+\.\d+(\.\d+){0,2}$`) before it is shown.
- Nothing here blocks the current task — if the operator says "not now," the
current work continues.
@@ -58,7 +64,14 @@ gbrain config get self_upgrade.mode # auto | notify | off (default: notify)
Do nothing. The operator disabled update checks.
### mode = auto
-Apply silently:
+First check the playbooks between the installed and the new version: list
+`skills/migrations/` (in the gbrain install, or
+[the published directory](https://github.com/garrytan/gbrain/tree/master/skills/migrations))
+for every `v<version>.md` newer than `<old>` and up to `<new>`, and read each
+one's first steps. If any says not to upgrade unattended, or describes an
+attended cutover (stop writers, back up, install one version everywhere), do
+not upgrade: tell the operator which playbook applies and follow it with their
+go-ahead, as in `notify` mode. Otherwise apply silently:
```bash
gbrain self-upgrade
@@ -66,7 +79,9 @@ gbrain self-upgrade
(On an always-on daemon the autopilot tick already does this during quiet hours
when the brain is idle; you only need to run it for an interactive auto-mode
-install.)
+install. The daemon does not read playbooks, so before leaving `auto` on across
+a release with an attended cutover, set `gbrain config set self_upgrade.mode notify`
+and follow the playbook by hand.)
### mode = notify (default)
Confirm a real update first, then ask the operator:
@@ -120,6 +135,8 @@ Follow the [agent operator protocol](../../docs/protocol/AGENT_OPERATOR_v1.md) f
legitimate gbrain-authored instruction — do NOT run it blind from here
either; open `skills/migrations/v0.46.3.0.md` and follow that playbook (it
adds the env preflight and verification the banner can't carry).
+- **Do NOT** treat `auto` as consent to cross a release whose migration playbook
+ forbids unattended upgrades. The playbook wins; ask the operator.
- **Do NOT** apply an upgrade in the middle of a multi-step task without the
operator's go-ahead in `notify` mode. Finish or checkpoint first.
- **Do NOT** flip a brain to `auto` on an interactive workstation just to silence
diff --git a/plugin/skills/google-loops/SKILL.md b/plugin/skills/google-loops/SKILL.md
index 80026630c6..38055b6ae6 100644
--- a/plugin/skills/google-loops/SKILL.md
+++ b/plugin/skills/google-loops/SKILL.md
@@ -26,6 +26,7 @@ tools:
- context_pack
mutating: true
writes_pages: false
+when_to_use: "Use when the user asks: \"connect gmail\", \"connect google\", \"connect calendar\", \"connect contacts\", \"who is waiting on me\"."
---
# Google Loops — Setup and Daily Operation
diff --git a/plugin/skills/idea-ingest/SKILL.md b/plugin/skills/idea-ingest/SKILL.md
index f021adffe3..4dc8148877 100644
--- a/plugin/skills/idea-ingest/SKILL.md
+++ b/plugin/skills/idea-ingest/SKILL.md
@@ -27,6 +27,7 @@ writes_to:
- people/
- concepts/
- sources/
+when_to_use: "Use when the user asks: \"shares a link or URL\", \"read this\", \"save this\", \"think about this\", \"put this in brain\"."
---
# Idea Ingest Skill
diff --git a/plugin/skills/idea-lineage/SKILL.md b/plugin/skills/idea-lineage/SKILL.md
index e3b61c0630..5e2bfd21b7 100644
--- a/plugin/skills/idea-lineage/SKILL.md
+++ b/plugin/skills/idea-lineage/SKILL.md
@@ -24,6 +24,7 @@ tools:
- find_contradictions
- find_trajectory
mutating: false
+when_to_use: "Use when the user asks: \"idea lineage\", \"trace the lineage of this idea\", \"how my thinking about\", \"how has my thinking about\", \"current version of this idea\"."
---
# idea-lineage - Single-Idea Evolution Through the Brain
diff --git a/plugin/skills/ingest/SKILL.md b/plugin/skills/ingest/SKILL.md
index 53f553773c..f868feec79 100644
--- a/plugin/skills/ingest/SKILL.md
+++ b/plugin/skills/ingest/SKILL.md
@@ -20,6 +20,7 @@ writes_to:
- concepts/
- meetings/
- sources/
+when_to_use: "Use when the user asks: \"ingest this\", \"save this to brain\", \"process this meeting\"."
---
# Ingest Skill
@@ -34,7 +35,7 @@ Ingest meetings, articles, media, documents, and conversations into the brain.
- Every entity mention creates a back-link from the entity's page to the page mentioning them (Iron Law).
- Raw sources are preserved for provenance via `gbrain files upload-raw` with automatic size routing.
- State sections are rewritten with current best understanding, never appended to.
-- Entity detection fires on every inbound message; notable entities get pages or updates.
+- After the user's explicit automatic-capture opt-in (see `skills/signal-detector/SKILL.md`), entity detection fires on every substantive inbound message; notable entities get pages or updates. Without that opt-in, capture only what the user asks to save.
- Notability gate before any new entity page: existing pages are updated, and a NEW page is
created only for a notable entity and only with meaningful content from web search or
existing brain context — no stubs. A non-notable mention stays an inline reference on the
@@ -71,15 +72,19 @@ Every fact written to a brain page must carry an inline `[Source: ...]` citation
5. **Back-link all entities.** Update EVERY mentioned entity's page with a back-link to this page (Iron Law).
6. **Timeline merge.** The same event appears on ALL mentioned entities' timelines. If Alice met Bob at Acme Corp, the event goes on Alice's page, Bob's page, and Acme Corp's page.
-## Entity Detection on Every Message
+## Entity Detection on Every Message (after opt-in)
-Production agents should detect entity mentions on EVERY inbound message. This is
-the signal detection loop that makes the brain compound over time.
+Automatic capture is off by default. Once the user has explicitly opted in to
+automatic capture for this brain (the stored choice `skills/signal-detector/SKILL.md`
+checks before writing), production agents detect entity mentions on every
+substantive inbound message. This is the signal detection loop that makes the
+brain compound over time. Without the opt-in, write only what the user asks to save.
### Protocol
1. **Scan the message** for entity mentions: people, companies, concepts, original
- thinking. Fire on every message (no exceptions unless purely operational).
+ thinking. With the opt-in recorded, fire on every substantive message (skip
+ purely operational ones and honor narrower per-message instructions).
2. **For each entity detected:**
- `gbrain search "name"` -- does a page already exist?
- **If yes:** load context with `gbrain get <slug>`. Use the compiled truth to
diff --git a/plugin/skills/maintain/SKILL.md b/plugin/skills/maintain/SKILL.md
index c44f94df58..f616172f67 100644
--- a/plugin/skills/maintain/SKILL.md
+++ b/plugin/skills/maintain/SKILL.md
@@ -36,6 +36,7 @@ tools:
- add_link
- search
mutating: true
+when_to_use: "Use when the user asks: \"brain health\", \"check backlinks\", \"maintenance\", \"orphan pages\", \"stale pages\"."
---
# Maintain Skill
diff --git a/plugin/skills/mcp-access/SKILL.md b/plugin/skills/mcp-access/SKILL.md
index c42bf0c946..544aeae24f 100644
--- a/plugin/skills/mcp-access/SKILL.md
+++ b/plugin/skills/mcp-access/SKILL.md
@@ -16,6 +16,7 @@ tools:
- exec
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"GBrain admin login link\", \"open the MCP admin panel\", \"manage MCP clients\", \"register an MCP client\", \"set up MCP OAuth\"."
---
# MCP access and administration
diff --git a/plugin/skills/measure-before-you-fix/SKILL.md b/plugin/skills/measure-before-you-fix/SKILL.md
index 6423d3f7f7..601da0da60 100644
--- a/plugin/skills/measure-before-you-fix/SKILL.md
+++ b/plugin/skills/measure-before-you-fix/SKILL.md
@@ -20,6 +20,7 @@ mutating: false
writes_pages: false
writes_to: []
upstream: measure-before-you-fix@fc834ee
+when_to_use: "Use when the user asks: \"keeps timing out\", \"ETIMEDOUT\", \"why is this data stale\", \"freshness alert\", \"wedged\"."
---
# Measure Before You Fix
diff --git a/plugin/skills/media-ingest/SKILL.md b/plugin/skills/media-ingest/SKILL.md
index 1225179b34..6790b011d3 100644
--- a/plugin/skills/media-ingest/SKILL.md
+++ b/plugin/skills/media-ingest/SKILL.md
@@ -32,6 +32,7 @@ writes_to:
- companies/
- sources/
upstream: media-ingest@fc834ee
+when_to_use: "Use when the user asks: \"watch this video\", \"process this YouTube link\", \"ingest this PDF\", \"save this podcast\", \"process this book\"."
---
# Media Ingest Skill
diff --git a/plugin/skills/meeting-ingestion/SKILL.md b/plugin/skills/meeting-ingestion/SKILL.md
index b8f1a50dad..312d82fad1 100644
--- a/plugin/skills/meeting-ingestion/SKILL.md
+++ b/plugin/skills/meeting-ingestion/SKILL.md
@@ -41,6 +41,7 @@ upstream:
- meeting-ingestion@fc834ee
- meeting-gold-standard@fc834ee
- chronology-guard@fc834ee
+when_to_use: "Use when the user asks: \"meeting transcript\", \"process this meeting\", \"meeting notes\", \"meeting recorder\", \"ingest this recording\"."
---
# Meeting Ingestion Skill — Unified Pipeline
diff --git a/plugin/skills/migrate/SKILL.md b/plugin/skills/migrate/SKILL.md
index 2965ad41ba..9f04d863f1 100644
--- a/plugin/skills/migrate/SKILL.md
+++ b/plugin/skills/migrate/SKILL.md
@@ -15,6 +15,7 @@ tools:
- add_tag
- sync_brain
mutating: true
+when_to_use: "Use when the user asks: \"migrate from\", \"import from obsidian\", \"import from notion\", \"connect our company brain\", \"connect our existing company brain\"."
---
# Migrate Skill
diff --git a/plugin/skills/minion-orchestrator/SKILL.md b/plugin/skills/minion-orchestrator/SKILL.md
index ae5cb71214..19fb243bcb 100644
--- a/plugin/skills/minion-orchestrator/SKILL.md
+++ b/plugin/skills/minion-orchestrator/SKILL.md
@@ -50,6 +50,7 @@ tools:
- get_job_progress
mutating: true
upstream: long-ops@fc834ee, subagent-deadman@fc834ee, pipeline-stage-cache@fc834ee
+when_to_use: "Use when the user asks: \"gbrain jobs submit\", \"submit a gbrain job\", \"submit a shell job\", \"shell job\", \"run shell command in background\"."
---
# Minion Orchestrator
diff --git a/plugin/skills/perplexity-research/SKILL.md b/plugin/skills/perplexity-research/SKILL.md
index 28d9effe0b..dfb955130a 100644
--- a/plugin/skills/perplexity-research/SKILL.md
+++ b/plugin/skills/perplexity-research/SKILL.md
@@ -14,6 +14,7 @@ mutating: true
writes_pages: true
writes_to:
- research/
+when_to_use: "Use when the user asks: \"perplexity research\", \"perplexity-research\", \"what's new about\", \"current state of\", \"web research\"."
---
# perplexity-research — Brain-Augmented Web Research
@@ -105,11 +106,17 @@ gbrain query "<topic keywords>"
# Cite every claim.
# """
-# 3. Call Perplexity API or the host's perplexity binary:
-# curl https://api.perplexity.ai/chat/completions \
+# 3. Call Perplexity's Agent API (or the host's perplexity binary). The
+# Sonar chat-completions endpoint (/chat/completions with
+# "model": "sonar-pro") is being retired and refuses migrated accounts
+# with 403 agent_api_migration_required; use POST /v1/agent:
+# curl https://api.perplexity.ai/v1/agent \
# -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
# -H "Content-Type: application/json" \
-# -d '{"model": "sonar-pro", "messages": [{"role":"user","content":"..."}]}'
+# -d '{"preset": "low", "instructions": "Cite every claim.", "input": "..."}'
+# Read the answer from the output item with "type": "message" (SDKs
+# expose it as output_text) and the citations from the search results
+# in the output array; inline [n] markers refer to them.
# 4. Write the structured research page via put_page:
gbrain put research/<slug> # via the put_page operation
@@ -117,15 +124,16 @@ gbrain put research/<slug> # via the put_page operation
# 5. Cross-link entities mentioned (people, companies) per Iron Law.
```
-## Models
+## Presets
-| Model | Cost / query | Use when |
+| Agent API preset | Replaces | Use when |
|-------|-------------|----------|
-| Perplexity sonar-pro | ~\$0.04 | Deep analysis, entity enrichment, deal research |
-| Perplexity sonar | ~\$0.007 | Quick lookups, bulk monitoring, briefing pipelines |
+| `"preset": "low"` | Sonar Pro | Deep analysis, entity enrichment, deal research (multi-step search) |
+| `"preset": "fast"` | Sonar | Quick lookups, bulk monitoring, briefing pipelines |
-Default to sonar-pro. Drop to sonar for bulk / cron contexts where cost
-matters more than depth.
+Default to `low`. Drop to `fast` for bulk / cron contexts where cost
+matters more than depth. Perplexity does not publish a fixed per-request
+price for presets; check its pricing page before running bulk jobs.
## Integration patterns
@@ -155,8 +163,11 @@ the agent doesn't re-narrate already-known facts.
## Recency filter
-Pass `recency_filter` to Perplexity: `hour | day | week | month`. Useful
-for news-cycle topics; omit for evergreen research.
+Pass the recency filter on the web search tool:
+`"tools": [{"type": "web_search", "filters": {"search_recency_filter": "week"}}]`
+with `hour | day | week | month | year`. Useful for news-cycle topics; omit
+for evergreen research. Record the value as `recency_filter` in the page
+frontmatter.
## When it fails
diff --git a/plugin/skills/postgres-adopt/SKILL.md b/plugin/skills/postgres-adopt/SKILL.md
index c1e9e63cd6..cdecf97843 100644
--- a/plugin/skills/postgres-adopt/SKILL.md
+++ b/plugin/skills/postgres-adopt/SKILL.md
@@ -19,6 +19,7 @@ tools:
- exec
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"which gbrain engine\", \"pglite or postgres\", \"gbrain engine status\", \"upgrade to postgres\", \"switch gbrain to postgres\"."
---
# Postgres Adopt
diff --git a/plugin/skills/publish/SKILL.md b/plugin/skills/publish/SKILL.md
index 2d7de0d531..8bfe519fec 100644
--- a/plugin/skills/publish/SKILL.md
+++ b/plugin/skills/publish/SKILL.md
@@ -9,6 +9,7 @@ tools:
- get_page
- search
mutating: false
+when_to_use: "Use when the user asks: \"share this page\", \"publish page\", \"create shareable link\"."
---
# Publish Skill
diff --git a/plugin/skills/query/SKILL.md b/plugin/skills/query/SKILL.md
index 556c6306a3..435cc96b45 100644
--- a/plugin/skills/query/SKILL.md
+++ b/plugin/skills/query/SKILL.md
@@ -28,6 +28,7 @@ tools:
- traverse_graph
- get_timeline
mutating: false
+when_to_use: "Use when the user asks: \"what do we know about\", \"tell me about\", \"who is\", \"what happened\", \"search for\"."
---
# Query Skill
diff --git a/plugin/skills/remote-mcp/SKILL.md b/plugin/skills/remote-mcp/SKILL.md
index f05d7c6f69..ef72ef1631 100644
--- a/plugin/skills/remote-mcp/SKILL.md
+++ b/plugin/skills/remote-mcp/SKILL.md
@@ -27,6 +27,7 @@ mutating: true
# exempt: this skill changes host networking/service state and never answers
# a knowledge question, so there is nothing to look up in the brain first.
brain_first: exempt
+when_to_use: "Use when the user asks: \"use my brain over mcp\", \"serve my brain over mcp\", \"expose my brain over mcp\", \"gbrain mcp server\", \"remote mcp access to my brain\"."
---
# Remote MCP — use your brain from anywhere
diff --git a/plugin/skills/repo-architecture/SKILL.md b/plugin/skills/repo-architecture/SKILL.md
index 90aacf3c08..ad044b026f 100644
--- a/plugin/skills/repo-architecture/SKILL.md
+++ b/plugin/skills/repo-architecture/SKILL.md
@@ -14,6 +14,7 @@ tools:
- get_page
- list_pages
mutating: false
+when_to_use: "Use when the user asks: \"where does this go\", \"filing rules\", \"create new page\", \"which directory\"."
---
# Repo Architecture — Filing Rules
diff --git a/plugin/skills/reports/SKILL.md b/plugin/skills/reports/SKILL.md
index 944d11b2b3..f6a0c71269 100644
--- a/plugin/skills/reports/SKILL.md
+++ b/plugin/skills/reports/SKILL.md
@@ -20,6 +20,7 @@ tools:
- search
mutating: true
upstream: report-quality-gate@fc834ee
+when_to_use: "Use when the user asks: \"save report\", \"load latest report\", \"what's the latest briefing\", \"show me the pulse\", \"report quality\"."
---
# Reports Skill
diff --git a/plugin/skills/research-compendium/SKILL.md b/plugin/skills/research-compendium/SKILL.md
index c410b37f81..89cba1be3f 100644
--- a/plugin/skills/research-compendium/SKILL.md
+++ b/plugin/skills/research-compendium/SKILL.md
@@ -24,6 +24,7 @@ writes_pages: true
writes_to:
- research/
upstream: research-compendium@fc834ee
+when_to_use: "Use when the user asks: \"compendium\", \"research everything about\", \"read them all and summarize\", \"definitive guide\", \"comprehensive guide to\"."
---
# research-compendium — Archive Everything, Summarize 1:1, Synthesize Once
diff --git a/plugin/skills/resolve-before-asking/SKILL.md b/plugin/skills/resolve-before-asking/SKILL.md
index 6437151016..702ae4ffcc 100644
--- a/plugin/skills/resolve-before-asking/SKILL.md
+++ b/plugin/skills/resolve-before-asking/SKILL.md
@@ -23,6 +23,7 @@ writes_to:
- people/
- companies/
upstream: resolve-before-asking@fc834ee
+when_to_use: "Use when the user asks: \"resolve before asking\", \"before asking the user\", \"unidentified contact\", \"unknown relationship\", \"should I ask who\"."
---
# Resolve Before Asking — Exhaust the Brain Before Bothering the User
diff --git a/plugin/skills/schema-author/SKILL.md b/plugin/skills/schema-author/SKILL.md
index 9133f9fd25..d07143ea73 100644
--- a/plugin/skills/schema-author/SKILL.md
+++ b/plugin/skills/schema-author/SKILL.md
@@ -52,7 +52,8 @@ triggers:
- "schema sync"
- "schema author"
brain_first: exempt
-writes_pages: []
+writes_pages: false
+when_to_use: "Use when the user asks: \"add a page type\", \"add a type to my schema\", \"my brain has untyped pages\", \"schema isn't matching my notes\", \"propose new types from my corpus\"."
---
# schema-author — evolve your schema pack
diff --git a/plugin/skills/schema-unify/SKILL.md b/plugin/skills/schema-unify/SKILL.md
index 12ba30d464..9bfb3e5924 100644
--- a/plugin/skills/schema-unify/SKILL.md
+++ b/plugin/skills/schema-unify/SKILL.md
@@ -24,6 +24,7 @@ triggers:
- "what does the canonical taxonomy look like"
- "consolidate page types"
- "retype pages to canonical"
+when_to_use: "Use when the user asks: \"unify my types\", \"migrate to gbrain-base-v2\", \"94 types to 14\", \"apply canonical taxonomy\", \"clean up my page types\"."
---
# Schema Unification (gbrain-base → gbrain-base-v2)
diff --git a/plugin/skills/setup/SKILL.md b/plugin/skills/setup/SKILL.md
index f68c3c96fa..8b135e5ea5 100644
--- a/plugin/skills/setup/SKILL.md
+++ b/plugin/skills/setup/SKILL.md
@@ -13,6 +13,7 @@ tools:
- sync_brain
- put_page
mutating: true
+when_to_use: "Use when the user asks: \"set up gbrain\", \"initialize brain\", \"gbrain setup\", \"install gbrain into this agent workspace\", \"add gbrain to my agent\"."
---
# Set up GBrain memory
diff --git a/plugin/skills/signal-detector/SKILL.md b/plugin/skills/signal-detector/SKILL.md
index b90a9a1eef..f6c42618c6 100644
--- a/plugin/skills/signal-detector/SKILL.md
+++ b/plugin/skills/signal-detector/SKILL.md
@@ -21,6 +21,7 @@ writes_to:
- people/
- companies/
- concepts/
+when_to_use: "Use when the user asks: \"every substantive inbound message after automatic-capture opt-in\"."
---
# Signal Detector — Ambient Brain Capture
diff --git a/plugin/skills/skill-creator/SKILL.md b/plugin/skills/skill-creator/SKILL.md
index 2640067407..edf9087358 100644
--- a/plugin/skills/skill-creator/SKILL.md
+++ b/plugin/skills/skill-creator/SKILL.md
@@ -13,6 +13,7 @@ tools:
- search
- list_pages
mutating: true
+when_to_use: "Use when the user asks: \"create a skill\", \"new skill\", \"improve this skill\"."
---
# Skill Creator
diff --git a/plugin/skills/skill-optimizer/SKILL.md b/plugin/skills/skill-optimizer/SKILL.md
index 91f5680cd7..18d4d3ad9b 100644
--- a/plugin/skills/skill-optimizer/SKILL.md
+++ b/plugin/skills/skill-optimizer/SKILL.md
@@ -10,6 +10,7 @@ triggers:
- "skillopt for"
mutating: true
brain_first: exempt
+when_to_use: "Use when the user asks: \"optimize this skill\", \"tune the skill against the benchmark\", \"make the skill better\", \"run skillopt\", \"skillopt for\"."
---
# Skill Optimizer
diff --git a/plugin/skills/skillpack-check/SKILL.md b/plugin/skills/skillpack-check/SKILL.md
index 099d19372a..0c29c7d69a 100644
--- a/plugin/skills/skillpack-check/SKILL.md
+++ b/plugin/skills/skillpack-check/SKILL.md
@@ -19,6 +19,7 @@ triggers:
tools:
- shell
mutating: false
+when_to_use: "Use when the user asks: \"skillpack check\", \"is gbrain healthy\", \"gbrain health\", \"check the brain\", \"is the brain working\"."
---
# Skillpack Check
diff --git a/plugin/skills/smoke-test/SKILL.md b/plugin/skills/smoke-test/SKILL.md
index 4adc960894..ec5969aa6d 100644
--- a/plugin/skills/smoke-test/SKILL.md
+++ b/plugin/skills/smoke-test/SKILL.md
@@ -17,6 +17,7 @@ tools:
- exec
- read
mutating: true
+when_to_use: "Use when the user asks: \"smoke test\", \"run smoke tests\", \"container restart check\", \"health check\", \"did the restart break anything\"."
---
# Smoke Test Skillpack
diff --git a/plugin/skills/soul-audit/SKILL.md b/plugin/skills/soul-audit/SKILL.md
index db3814adf7..90d8eac2fd 100644
--- a/plugin/skills/soul-audit/SKILL.md
+++ b/plugin/skills/soul-audit/SKILL.md
@@ -19,6 +19,7 @@ triggers:
tools:
- shell
mutating: true
+when_to_use: "Use when the user asks: \"soul audit\", \"customize agent\", \"who am I\", \"set up identity\", \"change my agent's personality\"."
---
# Soul Audit — Agent Identity Builder (re-run / deepen surface)
diff --git a/plugin/skills/strategic-reading/SKILL.md b/plugin/skills/strategic-reading/SKILL.md
index 973629b5e1..c46b6d5720 100644
--- a/plugin/skills/strategic-reading/SKILL.md
+++ b/plugin/skills/strategic-reading/SKILL.md
@@ -19,6 +19,7 @@ writes_to:
# uploaded source text + writes brain pages; it doesn't call external
# APIs. Declarative opt-out.
brain_first: exempt
+when_to_use: "Use when the user asks: \"strategic reading\", \"read this through the lens of\", \"apply this to my problem\", \"what can I learn from this about\", \"extract a playbook from\"."
---
# strategic-reading — Applied Analysis from Source Texts
diff --git a/plugin/skills/two-tier-extraction/SKILL.md b/plugin/skills/two-tier-extraction/SKILL.md
index 8151846ffb..5dead44580 100644
--- a/plugin/skills/two-tier-extraction/SKILL.md
+++ b/plugin/skills/two-tier-extraction/SKILL.md
@@ -25,6 +25,7 @@ writes_to:
- companies/
- sources/
upstream: two-tier-extraction@fc834ee
+when_to_use: "Use when the user asks: \"two-tier extraction\", \"triage then deep read\", \"smart model routing\", \"cheap triage expensive analysis\", \"model escalation pattern\"."
---
# Two-Tier Extraction
diff --git a/plugin/skills/voice-note-ingest/SKILL.md b/plugin/skills/voice-note-ingest/SKILL.md
index 3543010c39..30feaa527a 100644
--- a/plugin/skills/voice-note-ingest/SKILL.md
+++ b/plugin/skills/voice-note-ingest/SKILL.md
@@ -19,6 +19,7 @@ writes_to:
- companies/
- ideas/
- personal/
+when_to_use: "Use when the user asks: \"voice note\", \"ingest this voice memo\", \"transcribe and file\", \"voice note ingest\", \"save this audio note\"."
---
# voice-note-ingest — Exact-Phrasing Voice Capture
diff --git a/plugin/skills/webhook-transforms/SKILL.md b/plugin/skills/webhook-transforms/SKILL.md
index 93a2d2c659..68c3296685 100644
--- a/plugin/skills/webhook-transforms/SKILL.md
+++ b/plugin/skills/webhook-transforms/SKILL.md
@@ -14,6 +14,7 @@ tools:
- add_timeline_entry
- search
mutating: true
+when_to_use: "Use when the user asks: \"set up webhook\", \"process webhook event\", \"transform this event\"."
---
# Webhook Transforms
diff --git a/scripts/generate-plugin-tree.ts b/scripts/generate-plugin-tree.ts
index aa710ca395..4e3eeac0f8 100644
--- a/scripts/generate-plugin-tree.ts
+++ b/scripts/generate-plugin-tree.ts
@@ -44,6 +44,7 @@ import { REGISTRATION_SURFACE } from '../src/core/mcp-registration.ts';
import { operations } from '../src/core/operations.ts';
import { cliEquivalent } from '../src/core/ops/cli-equivalent.ts';
import { parseSkillFrontmatter } from '../src/core/skill-frontmatter.ts';
+import { FAILSAFE_SCHEMA, safeLoad } from 'js-yaml';
// Personas: the SINGLE validation implementation (the harness-bridge CLI
// imports the same module), so CLI errors and CI errors match by construction.
import { loadPersonas, type PersonaDef } from '../src/core/skillpack/personas.ts';
@@ -182,15 +183,43 @@ function surfaceNote(gaps: readonly string[]): string {
].join('\n');
}
-/** Copy one bundled skill; append the surface note to its SKILL.md when it has gaps. */
+/** Claude Code's skill listing caps description + when_to_use at this many characters per skill. */
+const SKILL_LISTING_CHARS = 1536;
+const WHEN_TO_USE_TRIGGERS = 5;
+
+/**
+ * #5858: Claude Code lists a skill by `name`, `description` and `when_to_use`
+ * only, so `triggers:` never reached the model. Each plugin-lane SKILL.md
+ * that declares triggers and no `when_to_use` gets one built from its first
+ * triggers, kept inside the listing cap. Source skills stay unchanged.
+ */
+function withWhenToUse(text: string): string {
+ const fm = parseSkillFrontmatter(text);
+ const triggers = (fm?.triggers ?? []).filter(t => t.trim());
+ if (!fm || triggers.length === 0 || /^when_to_use:/m.test(fm.raw)) return text;
+ let description = '';
+ try {
+ const data: unknown = safeLoad(fm.raw, { schema: FAILSAFE_SCHEMA });
+ if (data && typeof data === 'object' && typeof (data as { description?: unknown }).description === 'string') description = (data as { description: string }).description;
+ } catch { return text; }
+ const room = SKILL_LISTING_CHARS - description.length - 1;
+ let picked = triggers.slice(0, WHEN_TO_USE_TRIGGERS);
+ const render = (list: string[]) => `Use when the user asks: ${list.map(t => `"${t.trim()}"`).join(', ')}.`;
+ while (picked.length > 1 && render(picked).length > room) picked = picked.slice(0, -1);
+ if (render(picked).length > room) return text;
+ const close = text.indexOf('\n---', 4);
+ return `${text.slice(0, close)}\nwhen_to_use: ${JSON.stringify(render(picked))}${text.slice(close)}`;
+}
+
+/** Copy one bundled skill; add `when_to_use` and append the surface note to its SKILL.md when it has gaps. */
function copySkill(slug: string, destSkillsDir: string): void {
// nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal
cpSync(join(ROOT, 'skills', slug), join(destSkillsDir, slug), { recursive: true });
- const gaps = starterGaps(slug);
- if (gaps.length === 0) return;
// nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal -- build-time generator; slug comes from this repository's own plugin definition
const skillMd = join(destSkillsDir, slug, 'SKILL.md');
- writeFileSync(skillMd, readFileSync(skillMd, 'utf8').replace(/\n*$/, '\n') + surfaceNote(gaps));
+ const gaps = starterGaps(slug);
+ const text = withWhenToUse(readFileSync(skillMd, 'utf8'));
+ writeFileSync(skillMd, gaps.length === 0 ? text : text.replace(/\n*$/, '\n') + surfaceNote(gaps));
}
if (writeGaps) {
diff --git a/scripts/structural-suites.tsv b/scripts/structural-suites.tsv
index 295cb8c9c3..26840b73ff 100644
--- a/scripts/structural-suites.tsv
+++ b/scripts/structural-suites.tsv
@@ -299,6 +299,7 @@ test/shared-skills-migration-cli.serial.test.ts (file-level) 1 readFileSync
test/shared-skills-optimizer.serial.test.ts (file-level) 15 readFileSync
test/shared-skills-publication-sparse.test.ts (file-level) 4 readFileSync
test/shared-skills-setup.test.ts packaged default skills 2 readFileSync
+test/shared-skills-setup.test.ts shared-skills migration recovery (#5569, #5476, A-NEW-4) 4 readFileSync
test/shared-skills-setup.test.ts staged skill migration 7 readFileSync
test/shared-skills-writer-boundary.test.ts (file-level) 7 readFileSync
test/skillify-scaffold.test.ts 11-item scaffold contract (T9 + Phase 3 cross-modal eval) 1 readFileSync
@@ -340,6 +341,7 @@ test/think-embed-question-wiring.serial.test.ts #3734 — synthesize verb wires
test/timing-safe.test.ts extraction contract 1 source-surface-helper
test/title-fuzzy-index.test.ts findByTitleFuzzy indexed threshold 2 source-surface-helper
test/transcription-injection.test.ts transcription — command injection (#245) 2 readFileSync
+test/upgrade-exact-tag-pin.test.ts #5311 bare upgrade on an exact-tag pin 4 readFileSync
test/upgrade.serial.test.ts detectInstallMethod — package-install classification (in-process) 4 readFileSync
test/upgrade.serial.test.ts runUpgrade target verification (#4366) 8 readFileSync
test/v0_37_fix_wave.serial.test.ts v0.37 Lane A — defaults sweep 8 source-surface-helper
diff --git a/skills/_AGENT_README.md b/skills/_AGENT_README.md
index 710a22af4c..0dab2fef65 100644
--- a/skills/_AGENT_README.md
+++ b/skills/_AGENT_README.md
@@ -84,7 +84,11 @@ skill — read its SKILL.md body in full and follow the workflow described there
useful for scanning every skill and its trigger phrases in one place, and it
carries the disambiguation rules for overlapping matches. If the two disagree,
frontmatter wins. (There is no machine-managed block inside `RESOLVER.md` or
-`AGENTS.md`; that pattern was retired.)
+`AGENTS.md`; that pattern was retired.) `RESOLVER.md` ships in the gbrain
+install's `skills/` directory; `gbrain skillpack scaffold` does not copy it,
+and the Claude Code / Codex plugin lanes do not ship it. Where it is absent,
+routing rests on each skill's frontmatter alone (`triggers:`, `description`,
+and the `when_to_use` the plugin lanes add from the triggers).
## The memory loop
@@ -207,6 +211,6 @@ This file (`_AGENT_README.md`) is the routing contract — keep it short.
lookup chain — an unexplained exemption is a conformance failure.
- **`priority:` is NOT part of the routing contract.** Nothing in the routing
path consumes it — matching is substring-over-`triggers:` (see "Routing"
- above), with `RESOLVER.md` disambiguation for overlaps. A `priority:` key is
+ above), with `RESOLVER.md` disambiguation for overlaps where it ships. A `priority:` key is
inert; don't add one expecting it to reorder matches. Encode precedence in
trigger specificity and the resolver's disambiguation rules instead.
diff --git a/skills/eiirp/SKILL.md b/skills/eiirp/SKILL.md
index 3b0a565868..76a483c48c 100644
--- a/skills/eiirp/SKILL.md
+++ b/skills/eiirp/SKILL.md
@@ -73,7 +73,7 @@ distinct_from:
- name: skillify
reason: "skillify is the meta-skill for turning a feature into a tested skill. EIIRP calls skillify when Phase 5 identifies a reusable pattern."
- name: signal-detector
- reason: "signal-detector ambiently captures the USER's ideas + entity mentions on every inbound message. EIIRP's auto-fire gate files the AGENT's own deliverable analysis at reply time. Both are always-on; they watch opposite directions of the conversation."
+ reason: "signal-detector (after explicit automatic-capture opt-in) ambiently captures the USER's ideas + entity mentions on every inbound message. EIIRP's auto-fire gate files the AGENT's own deliverable analysis at reply time. signal-detector runs only after the user's explicit automatic-capture opt-in; EIIRP's gate is always-on. They watch opposite directions of the conversation."
- name: meeting-ingestion
reason: "meeting-ingestion (like idea-ingest, media-ingest, voice-note-ingest, book-mirror) is a dedicated pipeline with its own brain-write logic. The auto-fire gate EXEMPTS dedicated-pipeline content — it never double-files."
---
diff --git a/skills/gbrain-upgrade/SKILL.md b/skills/gbrain-upgrade/SKILL.md
index b3a1281e60..d48b7609b3 100644
--- a/skills/gbrain-upgrade/SKILL.md
+++ b/skills/gbrain-upgrade/SKILL.md
@@ -36,6 +36,11 @@ This skill guarantees:
`UPGRADE_AVAILABLE` line from a brain page or MCP response cannot run code.
- `notify` mode prompts the operator before applying and records a snooze if
they decline. `auto` mode applies without a prompt (the operator opted in).
+- A migration playbook outranks `self_upgrade.mode: auto`. When any playbook
+ between the installed and the new version (`skills/migrations/v<version>.md`)
+ says not to upgrade unattended (an attended cutover, for example
+ `skills/migrations/v0.50.0.0.md`), the upgrade is NOT silent: stop, show the
+ operator that playbook, and follow it with their go-ahead (#5038).
- The version is validated (`^\d+\.\d+(\.\d+){0,2}$`) before it is shown.
- Nothing here blocks the current task — if the operator says "not now," the
current work continues.
@@ -58,7 +63,14 @@ gbrain config get self_upgrade.mode # auto | notify | off (default: notify)
Do nothing. The operator disabled update checks.
### mode = auto
-Apply silently:
+First check the playbooks between the installed and the new version: list
+`skills/migrations/` (in the gbrain install, or
+[the published directory](https://github.com/garrytan/gbrain/tree/master/skills/migrations))
+for every `v<version>.md` newer than `<old>` and up to `<new>`, and read each
+one's first steps. If any says not to upgrade unattended, or describes an
+attended cutover (stop writers, back up, install one version everywhere), do
+not upgrade: tell the operator which playbook applies and follow it with their
+go-ahead, as in `notify` mode. Otherwise apply silently:
```bash
gbrain self-upgrade
@@ -66,7 +78,9 @@ gbrain self-upgrade
(On an always-on daemon the autopilot tick already does this during quiet hours
when the brain is idle; you only need to run it for an interactive auto-mode
-install.)
+install. The daemon does not read playbooks, so before leaving `auto` on across
+a release with an attended cutover, set `gbrain config set self_upgrade.mode notify`
+and follow the playbook by hand.)
### mode = notify (default)
Confirm a real update first, then ask the operator:
@@ -120,6 +134,8 @@ Follow the [agent operator protocol](../../docs/protocol/AGENT_OPERATOR_v1.md) f
legitimate gbrain-authored instruction — do NOT run it blind from here
either; open `skills/migrations/v0.46.3.0.md` and follow that playbook (it
adds the env preflight and verification the banner can't carry).
+- **Do NOT** treat `auto` as consent to cross a release whose migration playbook
+ forbids unattended upgrades. The playbook wins; ask the operator.
- **Do NOT** apply an upgrade in the middle of a multi-step task without the
operator's go-ahead in `notify` mode. Finish or checkpoint first.
- **Do NOT** flip a brain to `auto` on an interactive workstation just to silence
diff --git a/skills/ingest/SKILL.md b/skills/ingest/SKILL.md
index d98ed76bb0..11e224998b 100644
--- a/skills/ingest/SKILL.md
+++ b/skills/ingest/SKILL.md
@@ -34,7 +34,7 @@ Ingest meetings, articles, media, documents, and conversations into the brain.
- Every entity mention creates a back-link from the entity's page to the page mentioning them (Iron Law).
- Raw sources are preserved for provenance via `gbrain files upload-raw` with automatic size routing.
- State sections are rewritten with current best understanding, never appended to.
-- Entity detection fires on every inbound message; notable entities get pages or updates.
+- After the user's explicit automatic-capture opt-in (see `skills/signal-detector/SKILL.md`), entity detection fires on every substantive inbound message; notable entities get pages or updates. Without that opt-in, capture only what the user asks to save.
- Notability gate before any new entity page: existing pages are updated, and a NEW page is
created only for a notable entity and only with meaningful content from web search or
existing brain context — no stubs. A non-notable mention stays an inline reference on the
@@ -71,15 +71,19 @@ Every fact written to a brain page must carry an inline `[Source: ...]` citation
5. **Back-link all entities.** Update EVERY mentioned entity's page with a back-link to this page (Iron Law).
6. **Timeline merge.** The same event appears on ALL mentioned entities' timelines. If Alice met Bob at Acme Corp, the event goes on Alice's page, Bob's page, and Acme Corp's page.
-## Entity Detection on Every Message
+## Entity Detection on Every Message (after opt-in)
-Production agents should detect entity mentions on EVERY inbound message. This is
-the signal detection loop that makes the brain compound over time.
+Automatic capture is off by default. Once the user has explicitly opted in to
+automatic capture for this brain (the stored choice `skills/signal-detector/SKILL.md`
+checks before writing), production agents detect entity mentions on every
+substantive inbound message. This is the signal detection loop that makes the
+brain compound over time. Without the opt-in, write only what the user asks to save.
### Protocol
1. **Scan the message** for entity mentions: people, companies, concepts, original
- thinking. Fire on every message (no exceptions unless purely operational).
+ thinking. With the opt-in recorded, fire on every substantive message (skip
+ purely operational ones and honor narrower per-message instructions).
2. **For each entity detected:**
- `gbrain search "name"` -- does a page already exist?
- **If yes:** load context with `gbrain get <slug>`. Use the compiled truth to
diff --git a/skills/migrations/v0.28.0.md b/skills/migrations/v0.28.0.md
index 9a99db74e3..f525813426 100644
--- a/skills/migrations/v0.28.0.md
+++ b/skills/migrations/v0.28.0.md
@@ -59,10 +59,11 @@ For brains with existing fenced takes content in pre-v0.28 markdown:
# Identify pages with takes content that's been chunked into content_chunks
gbrain doctor --check takes_fence_chunk_leak
-# If the check is RED, re-import those pages so the new chunker rule applies.
-# Run only on the affected slugs (the doctor output enumerates them):
-gbrain extract takes --rebuild
-gbrain sync # picks up the markdown delta if any
+# If the check is RED, re-chunk so the new chunker rule applies
+# (works on managed brains too):
+gbrain reindex --markdown
+# To rebuild one page's takes index from its fence afterwards:
+gbrain takes rebuild <slug>
```
Fresh installs (no pre-v0.28 takes content): nothing to do.
diff --git a/skills/perplexity-research/SKILL.md b/skills/perplexity-research/SKILL.md
index 28d9effe0b..fa00748716 100644
--- a/skills/perplexity-research/SKILL.md
+++ b/skills/perplexity-research/SKILL.md
@@ -105,11 +105,17 @@ gbrain query "<topic keywords>"
# Cite every claim.
# """
-# 3. Call Perplexity API or the host's perplexity binary:
-# curl https://api.perplexity.ai/chat/completions \
+# 3. Call Perplexity's Agent API (or the host's perplexity binary). The
+# Sonar chat-completions endpoint (/chat/completions with
+# "model": "sonar-pro") is being retired and refuses migrated accounts
+# with 403 agent_api_migration_required; use POST /v1/agent:
+# curl https://api.perplexity.ai/v1/agent \
# -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
# -H "Content-Type: application/json" \
-# -d '{"model": "sonar-pro", "messages": [{"role":"user","content":"..."}]}'
+# -d '{"preset": "low", "instructions": "Cite every claim.", "input": "..."}'
+# Read the answer from the output item with "type": "message" (SDKs
+# expose it as output_text) and the citations from the search results
+# in the output array; inline [n] markers refer to them.
# 4. Write the structured research page via put_page:
gbrain put research/<slug> # via the put_page operation
@@ -117,15 +123,16 @@ gbrain put research/<slug> # via the put_page operation
# 5. Cross-link entities mentioned (people, companies) per Iron Law.
```
-## Models
+## Presets
-| Model | Cost / query | Use when |
+| Agent API preset | Replaces | Use when |
|-------|-------------|----------|
-| Perplexity sonar-pro | ~\$0.04 | Deep analysis, entity enrichment, deal research |
-| Perplexity sonar | ~\$0.007 | Quick lookups, bulk monitoring, briefing pipelines |
+| `"preset": "low"` | Sonar Pro | Deep analysis, entity enrichment, deal research (multi-step search) |
+| `"preset": "fast"` | Sonar | Quick lookups, bulk monitoring, briefing pipelines |
-Default to sonar-pro. Drop to sonar for bulk / cron contexts where cost
-matters more than depth.
+Default to `low`. Drop to `fast` for bulk / cron contexts where cost
+matters more than depth. Perplexity does not publish a fixed per-request
+price for presets; check its pricing page before running bulk jobs.
## Integration patterns
@@ -155,8 +162,11 @@ the agent doesn't re-narrate already-known facts.
## Recency filter
-Pass `recency_filter` to Perplexity: `hour | day | week | month`. Useful
-for news-cycle topics; omit for evergreen research.
+Pass the recency filter on the web search tool:
+`"tools": [{"type": "web_search", "filters": {"search_recency_filter": "week"}}]`
+with `hour | day | week | month | year`. Useful for news-cycle topics; omit
+for evergreen research. Record the value as `recency_filter` in the page
+frontmatter.
## When it fails
diff --git a/skills/skills.lock.json b/skills/skills.lock.json
index 673dbce106..61921c59ae 100644
--- a/skills/skills.lock.json
+++ b/skills/skills.lock.json
@@ -1,7 +1,7 @@
{
"RESOLVER.md": "5939d2a22bd2a6658bff105e8902170b46907fd6e930e24e2a8ecc24776930cf",
- "_AGENT_README.md": "0b755aa945df0da0f27cb3323904f54b99b3dfaf8065033e6cf9108ac4be38bb",
- "_brain-filing-rules.json": "cf850df6a7425464c6d63b3ace71991cc93497fa0cc8cd21acd31883e17939c6",
+ "_AGENT_README.md": "ab51e36e9a0b53f4d0609294b0556444399147834932d9c1acfdc7aa367c70b8",
+ "_brain-filing-rules.json": "4e6ecee2d94867d146583d60bf98dccdd9205bb70793af56fe1397a2b258ae0d",
"_brain-filing-rules.md": "b8f6844fd7ab6fbe4a4e7a95e7089466b37d63127730040c766927f55b1ad138",
"_friction-protocol.md": "51353207240142024ff1facc25f225712275ecdb4a034ffffdd83740c8d328e3",
"_output-rules.md": "0722ec2ecea7f9fa2f065cf12dfe1347956a9709d29898bf9fe95e875c64b800",
@@ -30,7 +30,7 @@
"bulk-ingestion/MANIFEST-PATTERN.md": "6180f09d2dc8d9af5749149f2b3c34c40213f5d6b262b69484e864adbb652b47",
"bulk-ingestion/SKILL.md": "cfc2cc3c4683c935bea4be9757306dd0edb6b93695c44fb64ae81f2013f80e08",
"bulk-ingestion/routing-eval.jsonl": "2bf8ffaf90b8ef761fa3cef54bf3af2eb8cc3ef736d054b5bf8b9361f6448d5a",
- "capture/SKILL.md": "c5fbc5c70874174860e6f8fe09bcfe0f070dfa3d3ed37cf9d3c1725f73ba2ec8",
+ "capture/SKILL.md": "d250388b92eebb5e6a4672f34e8e537fe592129244585a8a921e0c5b29ddc960",
"chat-connectors/SKILL.md": "6a1bd2afef4670ddc656bb69bb38a8b294194535b34c07f1b3ede670ce78119f",
"chat-connectors/routing-eval.jsonl": "688b6bab2020a9628535fb739019f1ac54098e17327e6b1c8828c0d0c4a58be6",
"citation-fixer/SKILL.md": "843dce1f65cb65474c3188def18cf8b543b94648914841cabaa1110a39765a82",
@@ -76,7 +76,7 @@
"db-repair/routing-eval.jsonl": "45791b0bf2cb9f98b8e58d82e95288ff17ad44cab484ab570cfc2ccb14583935",
"draft-in-voice/SKILL.md": "237ce9c0701d8d2161b118ea41050958e5623a7e507bdbb674ffdd7db96d0061",
"draft-in-voice/routing-eval.jsonl": "590fc16277ed7c3338776e7fac6daf1270b91058941f8101079bb295d2d8f787",
- "eiirp/SKILL.md": "d2437a9704230375fb8e57a4a34587ac9059ed1e11dd7b0cfc49572ee1bdff47",
+ "eiirp/SKILL.md": "d588d55c91a190c4517fab4ea13e592b87334ce7d6cfca293e09076b63b26017",
"eiirp/routing-eval.jsonl": "d0000eec8154ba48488eed07e8f1a6a0ccb66d0b39e41f29d279a875c1673227",
"enrich/SKILL.md": "7f281eb60dc5f1fe2225c5d6fca1c3e2a0312418b8fb7df9fd7a192be00c614c",
"fact-check/SKILL.md": "75c439f721a6c33fd3a9350b3430086b6dba974e245ec603d01125ec3b00a682",
@@ -86,12 +86,12 @@
"functional-area-resolver/SKILL.md": "1d2dd3826999a6f0a86fcbd699bafb7e4d74ed3d34cc8c6ffc23b224926717d6",
"functional-area-resolver/routing-eval.jsonl": "f80674d915acdfe229046737a5b171da834be15ac6524b5a3fd18048e9b37028",
"gbrain-advisor/SKILL.md": "7202baab08775048529f131e694e4fbaa85b1c8ae79e4fa7997fe4fe5ffbfa3d",
- "gbrain-upgrade/SKILL.md": "70ca370073aca86de8ca365778141e14d56f6dff7bd1424a88ef2865ef0db4cd",
+ "gbrain-upgrade/SKILL.md": "27bd9b340865ca9d366c6a8e7fa8136e9888ce9fb314ef49f0d0e061dde187e5",
"google-loops/SKILL.md": "5ccdf9ac291cbf5b96d6c10c18476bd39c79bed8c192bfdc789fd4b70bde0138",
"idea-ingest/SKILL.md": "b3810543f92cd37cb8488ff30990c60bcedde58dc404a3f60d43ac97016d6e33",
"idea-lineage/SKILL.md": "3432a9cca1626c7876eb12d7ec0d6cc37feeb8f3c18cf99f08028ef3174ae0e0",
"idea-lineage/routing-eval.jsonl": "ee2e00704b9accb7dd58bb8f126a3bc04a2c40be499180fa505dbf6d5061cd41",
- "ingest/SKILL.md": "c11d2a032932bbbe1122be9bbeaea0bf32be3a44cb28164fcb22011a7ed55e0f",
+ "ingest/SKILL.md": "887d1dc43d1dd4d541172b40ce64385090813132ef80fc05c4616b5c32087448",
"maintain/SKILL.md": "5613fa8339d8760613851ae3c2b5d09cb96102177b0aa22cc147749b330f22a8",
"manifest.json": "357aa185d380f0a357cb15cd513317e290cbc5fcf5ca4e3860b0e829fdcbf1e4",
"mcp-access/SKILL.md": "d308714208f457a9853fec4e83fe035dcd911bc8e506cefec817bd218f3340df",
@@ -118,7 +118,7 @@
"migrations/v0.23.0.md": "f0363274e5071fa35d0c60e3981c4caee0494c43adb254d65acf6b743d4762d5",
"migrations/v0.25.1.md": "981ef49abadf19a891cb68b655b9f35ee67d9f4ac232ceb29d83dfc3b1c9982e",
"migrations/v0.27.1.md": "719dd4ebcc7ac81413ee79af20f80de5141577e3860e5049a49fc8f6d09ddf89",
- "migrations/v0.28.0.md": "21929a392af2e1f454272e80aade6c58c5f6ccd7253d24344d08c6b53bcdf4f9",
+ "migrations/v0.28.0.md": "60370db59453beaa3245c6d44638c08d10c038d5b1dfb05f7217236c7ef08b22",
"migrations/v0.29.1.md": "7b85373a62a8500ee8c4238ffc9878318b44ee62543adb8b2462049c6c0cd1f8",
"migrations/v0.32.2.md": "88069b6ede3933aacb0555480bb730f75ca67602a5ae953f9f2a95a2bf6418a2",
"migrations/v0.32.6.md": "e9438a910afe8a1f7861c5222fd7db04a0f8d8b8283778476b07b7c3d539d3f0",
@@ -137,14 +137,14 @@
"migrations/v0.48.3.0.md": "1d9a23b6078164717944c94791b18effc7af630b716e8fde2680d6b6de47ce81",
"migrations/v0.49.0.0.md": "adf719246c3d6bcc7a1e5d24badb9968fe636651183a75c18d534e16aaa33ee8",
"migrations/v0.5.0.md": "5e0dabc451595295c4d971e19bcb33c258a127223d25859d8321cb7e1ce60711",
- "migrations/v0.50.0.0.md": "f221a6c907437a7500d2ad8ee9fdc5e14821514d4c1e72164b7aafac0bd5d89b",
+ "migrations/v0.50.0.0.md": "2f655acb9c7be9f10568024f89e77a75e6093ec3c7e5cb00d7ef8dd19a8d70ae",
"migrations/v0.50.2.0.md": "ff1aab621479eeda5f210e026169ba584a1c402536cabddc7c387a617934b6f1",
"migrations/v0.51.0.0.md": "c1f1f6ddcea71cdcfb4d9a85200564b59cc64e7d2ec29fda8c98335a8a7afdd5",
"migrations/v0.51.7.0.md": "c34621712c4fc8597e193c7fc44b588cab8622584204a2b6f59ffd24b9d3624c",
"migrations/v0.51.8.0.md": "16af7c14f4ee12029b87ee2f07446a6355216ddf6109f54c2fcc0adbd558b09a",
"migrations/v0.52.1.0.md": "7b54ff2e4e881658020d725aa1709f10b34e118974e1899c4c46aca3712409a1",
"migrations/v0.52.2.0.md": "07568b099264e56f909f46eb417c4a512788e893e8ae6080423ad6ae06918076",
- "migrations/v0.53.0.0.md": "1358cc16c075fad50bd527abe3ff93f39a42eb6b6c282f5a1192f6e3c9df6f16",
+ "migrations/v0.53.0.0.md": "14440e9aa189d2f751fcd7aa0077b95156d85b145ba04111520d69bf4b9f76e4",
"migrations/v0.54.1.0.md": "ceee87cfc7bb28036e9cadb5b70b7ec9eabcce6d445e259f3ee410a95fe69603",
"migrations/v0.56.2.0.md": "e88f04a5deaef82ebb8bd194aec931f26e69e87687098eb64b94666931b5e319",
"migrations/v0.58.0.0.md": "a6ee3d3125ff1be612df776c7b8d6dfcaeb57ca073255793a67dff78a23c51cc",
@@ -178,7 +178,7 @@
"migrations/v0.9.1.md": "75761bad6c0ad37b69ec8197c6a678bb6a1484f9a76e4b70f2d1e86dc80102b3",
"minion-orchestrator/SKILL.md": "d770fc3bd3628f536205ca065710b1837d2032a1f50dc5e7b54e1d5f99df5b00",
"minion-orchestrator/routing-eval.jsonl": "501ed2e19cb16847ff8425219d246b7a774de1accd42cb28fd44edbb64204992",
- "perplexity-research/SKILL.md": "514c4af0ebedec52881f820b5073c52930c63731639f2bb9f0a48b0b9e2cbeee",
+ "perplexity-research/SKILL.md": "800e28faa44abad9c70dc1aff336b8ae1df48645d9ba4a1b210e59750ab244fa",
"perplexity-research/routing-eval.jsonl": "f1a40d87e710d5d2acd602a372d83f46c95da022b6e635228fffeaacb3bb2b27",
"plugin-exclusions.json": "797782fd0647e06763febcbe6b8cb6715c717504628af84185cc345804087d35",
"plugin-lanes.json": "ec7fc44821c6a9b40c582db9b39026c84677d3fdd94657d983b7c5ea6216124e",
@@ -196,7 +196,7 @@
"research-compendium/routing-eval.jsonl": "7446cdcaf9c43fe2e20aaf129a705f13a7743f5f14455a7a21c663572def9078",
"resolve-before-asking/SKILL.md": "b10843c358069155d42a3e24a5b1893c1ebf7e744d803a6f32edf0e8efb4a482",
"resolve-before-asking/routing-eval.jsonl": "bac1bcf30337f5255ef4ce1a2a8a2b38d58ebcd576503c483190c79ec6e69489",
- "schema-author/SKILL.md": "dac2243d9075818f3b03fa4cd8836e57e75f329852a3d9a7369e77a3b1bd3973",
+ "schema-author/SKILL.md": "1a4ba83bfcd4739e801977deabe1a677980011a51c13d802731bdd76090d6d59",
"schema-unify/SKILL.md": "2a34bd8c85c378531e0aa637d37fd971c67a2377b8e36d7a65c969376615d951",
"setup/SKILL.md": "90494ad4128b975867e33b419fe3d512eef775bfbb011590b55b20106372aba4",
"signal-detector/SKILL.md": "3f13bfe7e041804b5225763ff667ca406bcbe58deff26d299cf0670fa44ad5f7",
diff --git a/src/commands/autopilot.ts b/src/commands/autopilot.ts
index e8fa913224..c37c997c59 100644
--- a/src/commands/autopilot.ts
+++ b/src/commands/autopilot.ts
@@ -764,6 +764,10 @@ const GBRAIN_ENV_TEMPLATE = `# gbrain daemon environment — sourced by autopilo
# export OPENAI_API_KEY=sk-...
# export VOYAGE_API_KEY=pa-...
#
+# Keep a key off disk: this file is bash, so a command substitution runs at
+# every daemon start and the value is never written here, e.g.
+# export VOYAGE_API_KEY="$(op read 'op://Private/Voyage/credential')"
+#
# Process-level env that must exist before the daemon boots:
# export NODE_EXTRA_CA_CERTS=/path/to/corp-ca.pem
# export HTTPS_PROXY=http://proxy:3128
@@ -942,7 +946,8 @@ async function installDaemon(engine: BrainEngine, args: string[]) {
console.log(
`API keys: the daemon sources ${join(gbrainHomePath(), 'env')} (plain KEY=value lines, ` +
`auto-exported) in addition to your shell profile. If LLM phases report no provider, put ` +
- 'ANTHROPIC_API_KEY=... (or your provider\'s key) there and re-run `gbrain autopilot --install`.',
+ 'ANTHROPIC_API_KEY=... (or your provider\'s key) there and re-run `gbrain autopilot --install`. ' +
+ 'To keep the key off disk, the file is bash: KEY="$(your-secret-manager get KEY)" runs at each daemon start.',
);
// A fresh install clears any prior self-disable AND any leaked pause, so a
// reinstall does not report "disabled" forever or park itself from day one
diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.ts
index efdb2ee9d0..775c24fe25 100644
--- a/src/core/cli-flag-registry.generated.ts
+++ b/src/core/cli-flag-registry.generated.ts
@@ -23,13 +23,13 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'backfill': ['--batch-size', '--brain', '--concurrency', '--dry-run', '--fresh', '--help', '--json', '--keep-index', '--list', '--max-errors', '--max-rows', '--resume', '--source'],
'backup': ['--accept-pending', '--background', '--brain', '--confirm-authority-reviewed', '--confirm-backup-compatible', '--confirm-quiesced', '--dir', '--explain', '--follow', '--full', '--help', '--into', '--json', '--mode', '--no-accept-pending', '--output', '--path', '--progress-interval', '--progress-json', '--quiet', '--restore-only', '--source', '--timeout', '--wait'],
'bench': ['--baseline', '--brain', '--force', '--from', '--help', '--json', '--label', '--limit', '--source', '--threshold-jaccard', '--threshold-latency-multiplier', '--threshold-top1', '--to', '--tool'],
- 'book-mirror': ['--accept-pending', '--access', '--add', '--allowed-operations', '--asof', '--author', '--background', '--bound-slug-prefixes', '--brain', '--chapters-dir', '--client', '--context-file', '--date', '--dated-since', '--days', '--dry-run', '--entities', '--explain', '--federated-read', '--follow', '--full', '--fuzzy', '--group', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-turns', '--max-usd', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--no-confirm', '--no-follow', '--page', '--params', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--recent', '--refresh-operations', '--scopes', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stale', '--surface', '--timeout', '--timeout-ms', '--title', '--to', '--url', '--wait', '--yes'],
+ 'book-mirror': ['--accept-pending', '--access', '--add', '--allowed-operations', '--asof', '--author', '--background', '--bound-slug-prefixes', '--brain', '--chapters-dir', '--client', '--context-file', '--date', '--dated-since', '--days', '--dry-run', '--entities', '--explain', '--federated-read', '--follow', '--full', '--fuzzy', '--group', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-turns', '--max-usd', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--no-confirm', '--no-follow', '--page', '--params', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stale', '--surface', '--timeout', '--timeout-ms', '--title', '--to', '--url', '--wait', '--yes'],
'bootstrap': ['--abbrev-ref', '--abort', '--accept-visibility-change-consequences', '--active', '--all', '--allow-unverified-remote', '--auto', '--bearer-token-env-var', '--brain', '--branch', '--cached', '--confirm', '--count', '--delete-brain', '--diff-filter', '--dim', '--env', '--error-unmatch', '--exclude-standard', '--exit-code', '--file', '--force', '--gbrain-bin', '--get', '--get-url', '--git-dir', '--git-path', '--harness', '--header', '--heads', '--help', '--home', '--hostname', '--http', '--id', '--init', '--install', '--is-ancestor', '--is-inside-work-tree', '--issuer-url', '--jq', '--json', '--local', '--mcp-even-if-plugin', '--mcp-only', '--mcp-url', '--minimal', '--name', '--name-only', '--no-capture', '--no-cron', '--no-hooks', '--no-seat', '--no-tags', '--no-verify', '--no-write-fetch-head', '--oauth-client-id', '--oauth-client-secret', '--only', '--others', '--pat-file', '--path', '--pglite', '--porcelain', '--port', '--private', '--project', '--pure', '--push', '--push-only', '--quiet', '--rebase', '--refresh-operations', '--refresh-skills', '--remove', '--repair', '--scope', '--scopes', '--seat', '--set', '--short', '--show', '--show-toplevel', '--skills', '--skip', '--source', '--status', '--surface', '--to', '--token', '--token-name', '--unset-all', '--url', '--verify', '--version', '--visibility', '--workspace', '--yes'],
'brainstorm': ['--brain', '--force-rechunk', '--force-resume', '--help', '--json', '--judge-model', '--limit', '--list-runs', '--max-cost', '--max-far-set', '--max-ideas-per-judge-call', '--no-save', '--probe', '--resume', '--save', '--source', '--stale', '--strict-budget', '--yes'],
'cache': ['--brain', '--help', '--json', '--source', '--yes'],
- 'calibration': ['--access', '--add', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--dry-run', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--holder', '--http', '--id', '--include-deleted', '--json', '--key-prefix', '--kind', '--limit', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--regenerate', '--scopes', '--scrub-gstack', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--to', '--undo-wave', '--url', '--with-calibration', '--yes'],
+ 'calibration': ['--access', '--add', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--dry-run', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--holder', '--http', '--id', '--include-deleted', '--json', '--key-prefix', '--kind', '--limit', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--regenerate', '--row', '--scopes', '--scrub-gstack', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--to', '--undo-wave', '--url', '--with-calibration', '--yes'],
'call': ['--brain', '--help', '--json', '--source'],
- 'capture': ['--accept-pending', '--access', '--add', '--allowed-operations', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--depth', '--entities', '--expected-revision', '--explain', '--federated-read', '--file', '--follow', '--force', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--mcp-only', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--recent', '--refresh-operations', '--request-id', '--scopes', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stale', '--stdin', '--surface', '--timeout', '--to', '--type', '--url', '--wait', '--what', '--where', '--who', '--yes'],
+ 'capture': ['--accept-pending', '--access', '--add', '--allowed-operations', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--depth', '--entities', '--expected-revision', '--explain', '--federated-read', '--file', '--follow', '--force', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--mcp-only', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--recent', '--refresh-operations', '--request-id', '--row', '--scopes', '--session', '--since', '--slug', '--slugs', '--source', '--sources', '--stale', '--stdin', '--surface', '--timeout', '--to', '--type', '--url', '--wait', '--what', '--where', '--who', '--yes'],
'check-backlinks': ['--accept-pending', '--background', '--brain', '--dir', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],
'check-resolvable': ['--brain', '--dry-run', '--fix', '--help', '--json', '--skills-dir', '--source', '--strict', '--verbose'],
'check-update': ['--brain', '--ff-only', '--force-retry', '--help', '--json', '--markdown', '--migrate-only', '--no-autopilot-install', '--no-bun-floor-check', '--non-interactive', '--refresh-cache', '--remediation-plan', '--source', '--swap-only', '--version', '--yes'],
@@ -46,14 +46,14 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'creds': ['--allow-create-db', '--allow-docker', '--brain', '--chat-model', '--content-root', '--db-only', '--embedding-dimensions', '--embedding-model', '--expansion-model', '--force', '--git', '--grant-types', '--help', '--http', '--ids', '--issuer-url', '--json', '--key', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-embedding', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--out', '--passphrase-env', '--path', '--pglite', '--plan', '--prefer-postgres', '--provenance', '--provider', '--query', '--schema-pack', '--scopes', '--skip-embed-check', '--source', '--status', '--supabase', '--surface', '--to', '--url', '--version'],
'db-repair': ['--accept-pending', '--apply', '--apply-rewrites', '--background', '--brain', '--break-lock', '--db-url', '--dry-run', '--explain', '--filter', '--follow', '--force', '--force-retry', '--format', '--help', '--http', '--json', '--locks', '--name', '--no-accept-pending', '--path', '--prefer-postgres', '--probe', '--progress-interval', '--progress-json', '--quiet', '--remediate', '--restart', '--skip-verify', '--source', '--supabase', '--timeout', '--undo-last-rewrite', '--url', '--version', '--wait', '--yes'],
'decide': ['--all', '--all-from', '--brain', '--call-site', '--dataset', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--from', '--help', '--input', '--json', '--limit', '--min', '--out', '--provider', '--query', '--recommended', '--shadow', '--since', '--slot', '--source', '--status', '--suite', '--target', '--threshold', '--what-if-threshold', '--yes'],
- 'doctor': ['--abandon', '--abbrev-ref', '--abort', '--accept-pending', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--apply', '--apply-rewrites', '--auto', '--auto-fix', '--background', '--brain', '--branch', '--break-lock', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--concurrency', '--confidence', '--confirm', '--content-audit', '--content-root', '--count', '--dataset', '--db-url', '--delete-brain', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--gbrain-bin', '--get', '--get-url', '--git-common-dir', '--git-dir', '--git-path', '--group', '--hard', '--harness', '--help', '--home', '--http', '--id', '--ignore-env-override', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lang', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--min', '--mode', '--multimodal', '--name', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-capture', '--no-confirm', '--no-cron', '--no-edit', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-migrate', '--no-pull', '--no-renames', '--no-schema-pack', '--no-tags', '--no-verify', '--no-write-fetch-head', '--non-interactive', '--older-than', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--remediate', '--remediation-plan', '--remove', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--review-lower', '--rollback-to-source', '--scope', '--scopes', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-token', '--show-toplevel', '--since', '--skills', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-name', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--what-if-threshold', '--window', '--workers', '--working-tree', '--yes'],
+ 'doctor': ['--abandon', '--abbrev-ref', '--abort', '--accept-pending', '--admin-intent', '--adopt-columns', '--adopt-permissions', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--apply', '--apply-rewrites', '--auto', '--auto-fix', '--background', '--brain', '--branch', '--break-lock', '--by-mention', '--cached', '--call-site', '--catch-up', '--check', '--concurrency', '--confidence', '--confirm', '--content-audit', '--content-root', '--count', '--dataset', '--db-url', '--delete-brain', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--drain-timeout', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--fast', '--federated-read', '--fetch-timeout-ms', '--ff-only', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--gbrain-bin', '--get', '--get-url', '--git-common-dir', '--git-dir', '--git-path', '--group', '--hard', '--harness', '--help', '--home', '--http', '--id', '--ignore-env-override', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lang', '--left-right', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-runtime', '--max-usd', '--max-waiting', '--mcp-only', '--migrate-legacy', '--migrate-only', '--min', '--mode', '--multimodal', '--name', '--name-only', '--nice', '--no-accept-pending', '--no-autopilot-install', '--no-capture', '--no-confirm', '--no-cron', '--no-edit', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-migrate', '--no-pull', '--no-renames', '--no-schema-pack', '--no-tags', '--no-verify', '--no-write-fetch-head', '--non-interactive', '--older-than', '--once', '--only', '--operations', '--others', '--out', '--output', '--overwrite', '--parallel', '--params', '--pat-file', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--refresh', '--refresh-operations', '--refresh-skills', '--regenerate', '--reissue', '--remediate', '--remediation-plan', '--remove', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--reverse', '--review-lower', '--rollback-to-source', '--scope', '--scopes', '--select', '--self-transfer', '--session', '--set', '--set-upstream-to', '--shadow', '--short', '--show-current', '--show-token', '--show-toplevel', '--since', '--skills', '--skills-dir', '--skip', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--staged', '--stale', '--status', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-name', '--token-ttl', '--top-k', '--trust', '--type', '--uninstall', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--url-env', '--user', '--vectors', '--verbose', '--verify', '--version', '--wait', '--wait-drain', '--what-if-threshold', '--window', '--workers', '--working-tree', '--yes'],
'dream': ['--audit-rejects', '--brain', '--cancel-unmatched', '--date', '--dir', '--drain', '--dry-run', '--eval-run', '--force', '--from', '--help', '--input', '--install', '--json', '--limit', '--list', '--max-usd', '--once', '--path', '--phase', '--pull', '--reconcile-queue', '--since', '--source', '--source-id', '--threshold', '--to', '--unsafe-bypass-dream-guard', '--window', '--yes'],
- 'edge-proposals': ['--access', '--add', '--all-applied', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--status', '--surface', '--to', '--url', '--yes'],
+ 'edge-proposals': ['--access', '--add', '--all-applied', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--status', '--surface', '--to', '--url', '--yes'],
'edges-backfill': ['--all-sources', '--brain', '--concurrency', '--help', '--json', '--max-chunks', '--source', '--workers'],
'embed': ['--accept-pending', '--all', '--background', '--batch-size', '--brain', '--break-lock', '--budget-ms', '--catch-up', '--client', '--db-url', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--help', '--http', '--id', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-facts', '--max-usd', '--no-accept-pending', '--no-embed', '--no-embedding', '--pace', '--pace-max-concurrency', '--path', '--priority', '--progress-interval', '--progress-json', '--quiet', '--replace', '--scopes', '--show-toplevel', '--slugs', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--wait', '--yes'],
'embeddings': ['--accept-pending', '--background', '--brain', '--db-url', '--dim', '--embedding-dimensions', '--embedding-model', '--explain', '--follow', '--force', '--help', '--json', '--no-accept-pending', '--no-embedding', '--path', '--probe', '--progress-interval', '--progress-json', '--quiet', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--wait', '--yes'],
'engine': ['--apply-rewrites', '--brain', '--break-lock', '--db-url', '--help', '--http', '--json', '--path', '--prefer-postgres', '--probe', '--source', '--supabase', '--url', '--yes'],
- 'enrich': ['--accept-pending', '--access', '--add', '--allowed-operations', '--apply', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--client', '--concurrency', '--confirm-destructive', '--date', '--dated-since', '--days', '--dry-run', '--embedding-dimensions', '--embedding-model', '--entities', '--expect', '--explain', '--federated-read', '--follow', '--force', '--full', '--fuzzy', '--group', '--help', '--http', '--id', '--include-deleted', '--input', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--min-context', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--no-confirm', '--non-interactive', '--order', '--output', '--page', '--params', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--rate', '--recent', '--reenrich-after', '--refresh-operations', '--resume', '--scopes', '--session', '--since', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--surface', '--thin', '--thin-threshold', '--timeout', '--to', '--trust', '--types', '--url', '--wait', '--workers', '--yes'],
+ 'enrich': ['--accept-pending', '--access', '--add', '--allowed-operations', '--apply', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--client', '--concurrency', '--confirm-destructive', '--date', '--dated-since', '--days', '--dry-run', '--embedding-dimensions', '--embedding-model', '--entities', '--expect', '--explain', '--federated-read', '--follow', '--force', '--full', '--fuzzy', '--group', '--help', '--http', '--id', '--include-deleted', '--input', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--min-context', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--no-confirm', '--non-interactive', '--order', '--output', '--page', '--params', '--path', '--phase', '--progress-interval', '--progress-json', '--quiet', '--rate', '--recent', '--reenrich-after', '--refresh-operations', '--resume', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--surface', '--thin', '--thin-threshold', '--timeout', '--to', '--trust', '--types', '--url', '--wait', '--workers', '--yes'],
'errors': ['--brain', '--changed', '--help', '--json', '--source'],
'eval': ['--ab-relational', '--accept-pending', '--against', '--allow-incomplete-judgments', '--allow-mixed-run-config', '--allow-regression', '--asof', '--autocut', '--background', '--baseline', '--batch', '--brain', '--budget-usd', '--budget-usd-answer', '--budget-usd-retrieval', '--by-type', '--by-type-floor', '--by-type-floor-metric', '--candidate', '--capture-pool', '--committed-baseline', '--compare', '--compare-limit', '--concurrent', '--config-a', '--config-b', '--corpus', '--cycles', '--days', '--decide', '--decide-calibration', '--decide-dataset', '--decide-force-on', '--decide-provider', '--decide-threshold', '--dedup-cosine', '--dedup-max-per-page', '--dedup-type-ratio', '--dimensions', '--distance-min', '--draws', '--embed-cache', '--embedder', '--embedding-dimensions', '--embedding-model', '--eval-pool-depth', '--expand', '--expansion', '--expansion-replay', '--expansion-variant-budget', '--explain', '--fixtures', '--follow', '--force-rechunk', '--format', '--from-capture', '--from-db', '--gold', '--grounding-min', '--harness', '--help', '--include-abstention', '--include-holdout', '--input', '--json', '--judge', '--judge-concurrency', '--judge-model', '--justification', '--k', '--keyword-only', '--limit', '--llm', '--max-pair-chars', '--max-tokens', '--max-usd', '--mcp-only', '--md', '--metric', '--min-recall', '--mode', '--model', '--models', '--modes', '--name-only', '--no-accept-pending', '--no-cache', '--no-embed-cache', '--no-expand', '--no-llm', '--no-trajectory', '--older-than', '--out', '--output', '--output-dir', '--parallel', '--parity-baseline', '--progress-interval', '--progress-json', '--qrels', '--queries-file', '--query', '--question-ids', '--questions', '--quiet', '--reader-max-tokens', '--reader-mode', '--receipt-dir', '--record', '--refresh-cache', '--reranker', '--resume-from', '--retrieval-only', '--rrf-k', '--rubric-version', '--runs', '--sample', '--sampling', '--save', '--search-pin', '--seed', '--severity', '--short', '--show-toplevel', '--since', '--skip-replay', '--slot', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--slug', '--slug-prefix', '--source', '--stale', '--status', '--strategy', '--suite', '--suites', '--supabase', '--task', '--threshold', '--threshold-expected-top1', '--threshold-first-relevant-hit', '--threshold-jaccard', '--threshold-latency-multiplier', '--threshold-recall-at-k', '--threshold-top1', '--timeout', '--tool', '--top-k', '--top-regressions', '--until', '--update-baseline', '--usefulness-min', '--vectors', '--verbose', '--verify', '--wait', '--with-code-intel', '--yes'],
'export': ['--accept-pending', '--background', '--brain', '--dir', '--explain', '--fix', '--follow', '--help', '--json', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--repo', '--restore-only', '--slug-prefix', '--source', '--timeout', '--type', '--wait'],
@@ -74,31 +74,31 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'init': ['--access', '--allow-create-db', '--allow-docker', '--brain', '--break-lock', '--chat-model', '--check', '--content-root', '--db-only', '--dim', '--embedding-dimensions', '--embedding-model', '--expansion-model', '--force', '--git', '--grant-types', '--help', '--http', '--issuer-url', '--json', '--key', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-autopilot-install', '--no-embedding', '--no-expand', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--only', '--path', '--pglite', '--plan', '--prefer-postgres', '--probe', '--provenance', '--query', '--quiet', '--save', '--schema-pack', '--scopes', '--show-toplevel', '--skip-embed-check', '--source', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--url-env', '--version', '--yes'],
'integrations': ['--auto', '--brain', '--dry-run', '--help', '--json', '--overwrite', '--refresh', '--source', '--target'],
'integrity': ['--accept-pending', '--auto', '--backend', '--background', '--brain', '--confidence', '--cost', '--dry-run', '--explain', '--follow', '--fresh', '--help', '--json', '--limit', '--no-accept-pending', '--probe', '--progress-interval', '--progress-json', '--quiet', '--review-lower', '--skip-bare-tweet', '--skip-urls', '--source', '--supabase', '--timeout', '--type', '--url', '--wait'],
- 'jobs': ['--abbrev-ref', '--access', '--add', '--aliases', '--all', '--allow-empty', '--allow-shell-jobs', '--allowed-operations', '--apply', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--bound-slug-prefixes', '--brain', '--break-lock', '--by-mention', '--cached', '--catch-up', '--cli-path', '--client', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--cost-estimate', '--date', '--dated-since', '--days', '--delay', '--detach', '--diff-filter', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--entities', '--exclude', '--exclude-standard', '--expect', '--explain', '--facts', '--federated-read', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--fuzzy', '--group', '--hard-deadline', '--health-interval', '--help', '--http', '--id', '--idempotency-key', '--ids', '--images', '--include-deleted', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--infer-dates', '--inject-bootstrap', '--inline', '--input', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--job-id', '--job-isolation', '--json', '--kind', '--limit', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--min-context', '--missing-path', '--model', '--multimodal', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-confirm', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-pull', '--no-renames', '--no-schema-pack', '--no-verify', '--no-worker', '--non-interactive', '--now', '--older-than', '--once', '--only', '--order', '--others', '--output', '--override-disabled', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--pause', '--phase', '--pid-file', '--priority', '--probe', '--prune-orphans', '--queue', '--queue-only', '--quiet', '--reason', '--rebuild', '--recent', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--refresh-operations', '--replace', '--repo', '--reset-checkpoint', '--resume', '--retry-failed', '--retry-held', '--review-lower', '--scopes', '--segment-limit', '--select', '--serial', '--session', '--show-toplevel', '--sigkill-rescue', '--since', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--sleep', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--strategy', '--surface', '--swap-only', '--target', '--thin', '--thin-threshold', '--timeout', '--timeout-ms', '--to', '--trust', '--type', '--types', '--uninstall', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],
+ 'jobs': ['--abbrev-ref', '--access', '--add', '--aliases', '--all', '--allow-empty', '--allow-shell-jobs', '--allowed-operations', '--apply', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--bound-slug-prefixes', '--brain', '--break-lock', '--by-mention', '--cached', '--catch-up', '--cli-path', '--client', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--cost-estimate', '--date', '--dated-since', '--days', '--delay', '--detach', '--diff-filter', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--entities', '--exclude', '--exclude-standard', '--expect', '--explain', '--facts', '--federated-read', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--fuzzy', '--group', '--hard-deadline', '--health-interval', '--help', '--http', '--id', '--idempotency-key', '--ids', '--images', '--include-deleted', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--infer-dates', '--inject-bootstrap', '--inline', '--input', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--job-id', '--job-isolation', '--json', '--kind', '--limit', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--min-context', '--missing-path', '--model', '--multimodal', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-confirm', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-pull', '--no-renames', '--no-schema-pack', '--no-verify', '--no-worker', '--non-interactive', '--now', '--older-than', '--once', '--only', '--order', '--others', '--output', '--override-disabled', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--pause', '--phase', '--pid-file', '--priority', '--probe', '--prune-orphans', '--queue', '--queue-only', '--quiet', '--reason', '--rebuild', '--recent', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--refresh-operations', '--replace', '--repo', '--reset-checkpoint', '--resume', '--retry-failed', '--retry-held', '--review-lower', '--row', '--scopes', '--segment-limit', '--select', '--serial', '--session', '--show-toplevel', '--sigkill-rescue', '--since', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--sleep', '--slug', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--strategy', '--surface', '--swap-only', '--target', '--thin', '--thin-threshold', '--timeout', '--timeout-ms', '--to', '--trust', '--type', '--types', '--uninstall', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],
'lint': ['--abbrev-ref', '--abort', '--accept-pending', '--all', '--background', '--brain', '--branch', '--cached', '--client', '--dry-run', '--exclude', '--exit-code', '--explain', '--file', '--fix', '--follow', '--get', '--get-url', '--git-dir', '--git-path', '--help', '--id', '--is-ancestor', '--is-inside-work-tree', '--json', '--local', '--name-only', '--no-accept-pending', '--no-cron', '--no-tags', '--no-verify', '--no-write-fetch-head', '--pat-file', '--path', '--preview', '--probe', '--progress-interval', '--progress-json', '--purge', '--push', '--push-only', '--quiet', '--rebase', '--scopes', '--short', '--show-toplevel', '--slug', '--source', '--timeout', '--unset-all', '--wait', '--yes'],
'loops': ['--all', '--as-of', '--brain', '--fail-fast', '--help', '--json', '--note', '--source', '--stale-ok', '--status', '--tools-json', '--top', '--type'],
'lsd': ['--brain', '--force-resume', '--help', '--json', '--judge-model', '--limit', '--list-runs', '--max-cost', '--max-far-set', '--max-ideas-per-judge-call', '--no-save', '--resume', '--save', '--source', '--strict-budget', '--yes'],
- 'maintain': ['--adopt-columns', '--adopt-permissions', '--all', '--apply', '--background', '--brain', '--break-lock', '--by-mention', '--catch-up', '--concurrency', '--content-audit', '--count', '--detach', '--dim', '--dir', '--drain', '--dry-run', '--expect', '--explain', '--facts', '--fast', '--fix', '--follow', '--force', '--force-retry', '--force-schema', '--from-meetings', '--full', '--harness', '--help', '--http', '--id', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--json', '--kind', '--lang', '--link-source', '--link-type', '--locks', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--migrate-legacy', '--migrate-only', '--multimodal', '--ner', '--no-autopilot-install', '--no-embed', '--no-pull', '--older-than', '--only', '--operations', '--pack', '--page', '--parallel', '--params', '--path', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--preview', '--probe', '--probe-pglite', '--prune-orphans', '--query', '--queue', '--reauth', '--rebuild', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--request-id', '--reset', '--reset-default', '--resume', '--retry-failed', '--safe', '--scope', '--scopes', '--show-current', '--since', '--skills-dir', '--skip-failed', '--slot', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--supabase', '--symbol-kind', '--takes-holders', '--target', '--target-score', '--to', '--token', '--top-k', '--type', '--url-env', '--verbose', '--version', '--window', '--workers', '--yes'],
+ 'maintain': ['--adopt-columns', '--adopt-permissions', '--all', '--apply', '--background', '--brain', '--break-lock', '--by-mention', '--catch-up', '--concurrency', '--content-audit', '--count', '--detach', '--dim', '--dir', '--drain', '--dry-run', '--expect', '--explain', '--facts', '--fast', '--fix', '--follow', '--force', '--force-retry', '--force-schema', '--format', '--from-meetings', '--full', '--harness', '--help', '--http', '--id', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--json', '--kind', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--migrate-legacy', '--migrate-only', '--multimodal', '--ner', '--no-autopilot-install', '--no-embed', '--no-pull', '--older-than', '--only', '--operations', '--pack', '--page', '--parallel', '--params', '--path', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--preview', '--probe', '--probe-pglite', '--prune-orphans', '--query', '--queue', '--reauth', '--rebuild', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--request-id', '--reset', '--reset-default', '--resume', '--retry-failed', '--reverse', '--safe', '--scope', '--scopes', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip-failed', '--slot', '--slugs', '--source', '--source-id', '--sources', '--stale', '--status', '--supabase', '--symbol-kind', '--takes-holders', '--target', '--target-score', '--to', '--token', '--top-k', '--type', '--url-env', '--verbose', '--version', '--window', '--workers', '--yes'],
'mcp': ['--admin-token-file', '--agent', '--arg', '--bearer-token-env-var', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--client', '--credentials-file', '--credentials-out', '--delegate', '--delegated-namespace', '--delegated-slug-prefixes', '--dry-run', '--enable-dcr', '--federated-read', '--flow', '--force', '--funnel', '--harness', '--header', '--help', '--if-version', '--install', '--issuer-url', '--json', '--limit', '--mcp-only', '--mcp-url', '--no-install', '--no-service', '--no-tailscale', '--oauth-client-id', '--oauth-client-secret', '--oauth-request', '--port', '--profile', '--queue', '--redirect-uri', '--remove', '--resume', '--root', '--scope', '--scopes', '--skills', '--source', '--status', '--surface', '--timeout-ms', '--token', '--token-endpoint-auth-method', '--token-ttl', '--url', '--yes'],
'migrate': ['--accept-pending', '--admin-intent', '--all', '--apply', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--drain-timeout', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--expected-epoch', '--expected-state', '--explain', '--facts', '--follow', '--force', '--force-retry', '--harness', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--locks', '--manifest', '--max-cost', '--max-cost-usd', '--max-usd', '--no-accept-pending', '--no-embed', '--no-embedding', '--no-migrate', '--non-interactive', '--pace', '--pace-max-concurrency', '--path', '--pglite', '--plan', '--priority', '--probe', '--progress-interval', '--progress-json', '--quiet', '--replace', '--reranker', '--resume', '--retarget', '--rollback-to-source', '--scope', '--skip-verify', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--trigger-bypass', '--trust', '--url', '--url-env', '--wait', '--yes'],
'models': ['--brain', '--dim', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--skip', '--source', '--status', '--to'],
'mounts': ['--alias', '--brain', '--database-path', '--database-url', '--db-path', '--db-url', '--engine', '--help', '--id', '--json', '--mcp-url', '--path', '--skills-dir', '--source'],
'notability-eval': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--in', '--json', '--out', '--repo', '--skip-llm', '--source', '--status', '--target-high', '--target-low', '--target-medium'],
'notices': ['--brain', '--help', '--json', '--source'],
- 'onboard': ['--access', '--add', '--allowed-operations', '--asof', '--auto', '--bound-slug-prefixes', '--brain', '--check', '--client', '--date', '--dated-since', '--days', '--entities', '--explain', '--federated-read', '--from-pages', '--full', '--fuzzy', '--help', '--history', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-usd', '--model', '--multimodal', '--no-autopilot-install', '--only', '--page', '--params', '--path', '--phase', '--probe', '--recent', '--refresh-operations', '--remediate', '--remediation-plan', '--resume', '--save', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--target-score', '--to', '--url', '--yes'],
+ 'onboard': ['--access', '--add', '--allowed-operations', '--asof', '--auto', '--bound-slug-prefixes', '--brain', '--check', '--client', '--date', '--dated-since', '--days', '--entities', '--explain', '--federated-read', '--from-pages', '--full', '--fuzzy', '--help', '--history', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--max-usd', '--model', '--multimodal', '--no-autopilot-install', '--only', '--page', '--params', '--path', '--phase', '--probe', '--recent', '--refresh-operations', '--remediate', '--remediation-plan', '--resume', '--row', '--save', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--target-score', '--to', '--url', '--yes'],
'orphans': ['--accept-pending', '--background', '--brain', '--count', '--explain', '--follow', '--help', '--include-pseudo', '--json', '--mode', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],
'pages': ['--brain', '--dry-run', '--help', '--json', '--older-than', '--source'],
'pglite-repair': ['--brain', '--break-lock', '--dry-run', '--expect', '--help', '--http', '--json', '--path', '--probe', '--source', '--vectors', '--yes'],
'post-upgrade': ['--accept-reviewed-inventory', '--acknowledge-no-backup', '--admin-intent', '--all', '--all-applied', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--catch-up', '--changed', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--only', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],
'pricing': ['--brain', '--help', '--input', '--json', '--max-cost', '--max-runtime', '--output', '--rate', '--source'],
'projections': ['--brain', '--enable-dcr', '--help', '--http', '--install', '--json', '--limit', '--now', '--port', '--public-url', '--remove', '--source', '--status', '--surface', '--user'],
- 'protocol': ['--access', '--add', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--synthesize', '--target', '--to', '--token', '--url', '--yes'],
+ 'protocol': ['--access', '--add', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--synthesize', '--target', '--to', '--token', '--url', '--yes'],
'providers': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--model', '--source', '--status', '--touchpoint'],
'publish': ['--accent', '--bg', '--border', '--brain', '--card-bg', '--code-bg', '--error', '--fg', '--help', '--json', '--link', '--muted', '--out', '--password', '--source', '--title'],
'quarantine': ['--apply', '--brain', '--force', '--force-rechunk', '--help', '--include-flagged', '--json', '--limit', '--no-embed', '--source', '--source-id', '--stale'],
- 'recall': ['--accept-pending', '--access', '--add', '--allowed-operations', '--as-context', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--budget-policy', '--budget-tokens', '--client', '--date', '--dated-since', '--days', '--entities', '--explain', '--federated-read', '--follow', '--full', '--fuzzy', '--grep', '--help', '--http', '--id', '--include-deleted', '--include-expired', '--json', '--kind', '--limit', '--mcp-only', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--page', '--params', '--path', '--pending', '--phase', '--progress-interval', '--progress-json', '--query', '--quiet', '--reason', '--recent', '--refresh-operations', '--request-id', '--rollup', '--scopes', '--session', '--session-id', '--since', '--since-last-run', '--slugs', '--source', '--source-id', '--sources', '--stale', '--supersessions', '--surface', '--timeout', '--to', '--today', '--url', '--wait', '--watch', '--yes'],
+ 'recall': ['--accept-pending', '--access', '--add', '--allowed-operations', '--as-context', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--budget-policy', '--budget-tokens', '--client', '--date', '--dated-since', '--days', '--entities', '--explain', '--federated-read', '--follow', '--full', '--fuzzy', '--grep', '--help', '--http', '--id', '--include-deleted', '--include-expired', '--json', '--kind', '--limit', '--mcp-only', '--model', '--multimodal', '--no-accept-pending', '--no-autopilot-install', '--page', '--params', '--path', '--pending', '--phase', '--progress-interval', '--progress-json', '--query', '--quiet', '--reason', '--recent', '--refresh-operations', '--request-id', '--rollup', '--row', '--scopes', '--session', '--session-id', '--since', '--since-last-run', '--slugs', '--source', '--source-id', '--sources', '--stale', '--supersessions', '--surface', '--timeout', '--to', '--today', '--url', '--wait', '--watch', '--yes'],
'reconcile-links': ['--accept-pending', '--background', '--brain', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],
- 'reindex': ['--accept-pending', '--admin-intent', '--aliases', '--background', '--brain', '--concurrency', '--cost-estimate', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--force-rechunk', '--help', '--json', '--limit', '--manifest', '--markdown', '--multimodal', '--no-accept-pending', '--no-embed', '--no-embedding', '--path', '--progress-interval', '--progress-json', '--quiet', '--repo', '--self-transfer', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--type', '--vectors', '--wait', '--workers', '--yes'],
+ 'reindex': ['--accept-pending', '--admin-intent', '--aliases', '--apply', '--background', '--brain', '--concurrency', '--cost-estimate', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--force-rechunk', '--help', '--include-ambiguous', '--json', '--limit', '--manifest', '--markdown', '--multimodal', '--no-accept-pending', '--no-embed', '--no-embedding', '--only', '--path', '--progress-interval', '--progress-json', '--quiet', '--repo', '--self-transfer', '--skip', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--type', '--vectors', '--wait', '--workers', '--yes'],
'reindex-code': ['--accept-pending', '--apply', '--background', '--brain', '--break-lock', '--client', '--concurrency', '--db-url', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expect', '--explain', '--follow', '--force', '--help', '--http', '--id', '--json', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--no-accept-pending', '--no-embed', '--non-interactive', '--only', '--path', '--progress-interval', '--progress-json', '--quiet', '--scopes', '--source', '--status', '--timeout', '--trust', '--wait', '--workers', '--yes'],
'reindex-frontmatter': ['--apply', '--brain', '--concurrency', '--dry-run', '--expect', '--force', '--help', '--json', '--max-cost', '--max-usd', '--non-interactive', '--slug-prefix', '--source', '--trust', '--workers', '--yes'],
'reindex-search-vector': ['--accept-pending', '--background', '--brain', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--resume', '--source', '--timeout', '--wait', '--yes'],
@@ -124,14 +124,14 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'status': ['--abbrev-ref', '--all', '--allow-empty', '--brain', '--break-lock', '--cached', '--concurrency', '--confirm-destructive', '--deadline-ms', '--diff-filter', '--empty', '--exclude', '--exclude-standard', '--fast', '--filters', '--fix', '--force-break-lock', '--format', '--full', '--full-history', '--hard-deadline', '--help', '--include-gitignored', '--include-hidden', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--max-age', '--max-sources', '--mcp-only', '--missing-path', '--name-only', '--no-auto-embed', '--no-bulk', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-pull', '--no-renames', '--no-schema-pack', '--no-verify', '--others', '--parallel', '--path', '--priority', '--quiet', '--repo', '--reset-checkpoint', '--retry-failed', '--retry-held', '--section', '--serial', '--show-toplevel', '--skip-failed', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--strategy', '--timeout', '--url', '--verify', '--watch', '--workers', '--working-tree', '--yes'],
'storage': ['--brain', '--fix', '--help', '--json', '--plan', '--repo', '--restore-only', '--source', '--to'],
'sweep': ['--accept-pending', '--background', '--batch-limit', '--brain', '--budget-ms', '--delete-brain', '--explain', '--follow', '--help', '--home', '--json', '--no-accept-pending', '--no-delegate', '--once', '--progress-interval', '--progress-json', '--quiet', '--source', '--timeout', '--wait'],
- 'sync': ['--abbrev-ref', '--abort', '--accept-pending', '--account', '--adopt-columns', '--adopt-permissions', '--all', '--allow-empty', '--apply', '--apply-rewrites', '--auto', '--background', '--batch-size', '--brain', '--branch', '--break-lock', '--by-mention', '--cached', '--catch-up', '--client', '--concurrency', '--confirm-destructive', '--content-audit', '--count', '--db-url', '--delete-brain', '--depth', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--expect', '--explain', '--facts', '--fast', '--ff-only', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--git-dir', '--git-path', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--kind', '--lang', '--link-source', '--link-type', '--locks', '--log-noop', '--markdown', '--max-age', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-sources', '--max-usd', '--migrate-legacy', '--migrate-only', '--missing-path', '--multimodal', '--name-only', '--name-status', '--ner', '--no-accept-pending', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-pull', '--no-recurse-submodules', '--no-renames', '--no-schema-pack', '--no-verify', '--older-than', '--only', '--operations', '--others', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer-postgres', '--preview', '--priority', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--prune-orphans', '--query', '--queue', '--quiet', '--reauth', '--rebase', '--rebuild', '--refresh', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--replace', '--repo', '--request-id', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--retry-held', '--scope', '--scopes', '--serial', '--short', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip-failed', '--slot', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--stdin', '--strategy', '--supabase', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--timeout', '--to', '--token', '--top-k', '--type', '--url', '--url-env', '--verbose', '--verify', '--version', '--wait', '--watch', '--window', '--workers', '--working-tree', '--yes'],
+ 'sync': ['--abbrev-ref', '--abort', '--accept-pending', '--account', '--adopt-columns', '--adopt-permissions', '--all', '--allow-empty', '--apply', '--apply-rewrites', '--auto', '--background', '--batch-size', '--brain', '--branch', '--break-lock', '--by-mention', '--cached', '--catch-up', '--client', '--concurrency', '--confirm-destructive', '--content-audit', '--count', '--db-url', '--delete-brain', '--depth', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--exclude', '--exclude-standard', '--expect', '--explain', '--facts', '--fast', '--ff-only', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--git-dir', '--git-path', '--hard-deadline', '--harness', '--help', '--home', '--http', '--id', '--images', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--json', '--kind', '--lang', '--left-right', '--link-source', '--link-type', '--locks', '--log-noop', '--markdown', '--max-age', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-sources', '--max-usd', '--migrate-legacy', '--migrate-only', '--missing-path', '--multimodal', '--name-only', '--name-status', '--ner', '--no-accept-pending', '--no-auto-embed', '--no-autopilot-install', '--no-bulk', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-pull', '--no-recurse-submodules', '--no-renames', '--no-schema-pack', '--no-verify', '--older-than', '--only', '--operations', '--others', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--path-format', '--pglite', '--phase', '--pid-file', '--plan', '--porcelain', '--prefer-postgres', '--preview', '--priority', '--probe', '--probe-pglite', '--progress-interval', '--progress-json', '--prune-orphans', '--query', '--queue', '--quiet', '--reauth', '--rebase', '--rebuild', '--refresh', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--replace', '--repo', '--request-id', '--reset', '--reset-checkpoint', '--reset-default', '--restore-only', '--resume', '--retry-failed', '--retry-held', '--reverse', '--scope', '--scopes', '--serial', '--short', '--show-current', '--show-toplevel', '--since', '--skills-dir', '--skip-failed', '--slot', '--slugs', '--source', '--source-id', '--sources', '--src-subpath', '--stale', '--status', '--stdin', '--strategy', '--supabase', '--symbol-kind', '--symbolic-full-name', '--takes-holders', '--target', '--target-score', '--timeout', '--to', '--token', '--top-k', '--type', '--url', '--url-env', '--verbose', '--verify', '--version', '--wait', '--watch', '--window', '--workers', '--working-tree', '--yes'],
'takes': ['--accept', '--batch-size', '--brain', '--bucket-size', '--by', '--claim', '--dim', '--dir', '--domain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--evidence', '--expected-revision', '--expired', '--force', '--from-pages', '--help', '--holder', '--include-covered', '--json', '--kind', '--limit', '--max-pages', '--no-embed', '--no-embedding', '--offset', '--outcome', '--path', '--quality', '--reject', '--request-id', '--row', '--semantic', '--since', '--sort', '--source', '--source-id', '--stale', '--status', '--supabase', '--to', '--unit', '--until', '--value', '--weight', '--who', '--yes'],
'think': ['--anchor', '--brain', '--calibration-holder', '--help', '--json', '--mcp-only', '--model', '--only', '--rounds', '--save', '--since', '--source', '--take', '--until', '--with-calibration'],
'transcripts': ['--accept-pending', '--all', '--all-discovery', '--background', '--brain', '--days', '--dry-run', '--embed', '--explain', '--facts', '--follow', '--format', '--full', '--help', '--include-self', '--json', '--limit', '--max-bytes', '--max-cost-usd', '--no-accept-pending', '--progress-interval', '--progress-json', '--quiet', '--since', '--source', '--source-id', '--timeout', '--wait'],
'upgrade': ['--accept-reviewed-inventory', '--acknowledge-no-backup', '--admin-intent', '--all', '--all-applied', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--catch-up', '--changed', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--only', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],
'waiting': ['--all', '--as-of', '--brain', '--fail-fast', '--help', '--json', '--note', '--source', '--stale-ok', '--status', '--tools-json', '--top', '--type'],
'watch': ['--brain', '--help', '--json', '--max-pages', '--min-confidence', '--source', '--window-turns'],
- 'whoknows': ['--access', '--add', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--explain', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--mcp-only', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--to', '--url', '--yes'],
+ 'whoknows': ['--access', '--add', '--allowed-operations', '--asof', '--bound-slug-prefixes', '--brain', '--client', '--date', '--dated-since', '--days', '--entities', '--explain', '--federated-read', '--full', '--fuzzy', '--help', '--http', '--id', '--include-deleted', '--json', '--kind', '--limit', '--mcp-only', '--model', '--multimodal', '--no-autopilot-install', '--page', '--params', '--path', '--phase', '--recent', '--refresh-operations', '--row', '--scopes', '--session', '--since', '--slugs', '--source', '--sources', '--stale', '--surface', '--to', '--url', '--yes'],
};
// Routing flags a fix naming each CLI-only command carries (A1 render-time pin,
diff --git a/test/codex-plugin-manifest.test.ts b/test/codex-plugin-manifest.test.ts
index f194661f0f..e818019e79 100644
--- a/test/codex-plugin-manifest.test.ts
+++ b/test/codex-plugin-manifest.test.ts
@@ -391,11 +391,13 @@ describe('curated tree membership + scanner guard', () => {
}
});
+ // #5858: the generator's only frontmatter change is one `when_to_use:` line built from triggers.
+ const withoutWhenToUse = (text: string) => text.replace(/^when_to_use: .*\n/m, '');
test('F6: a starter-gap skill ends with its CLI-equivalent surface note; a gap-free skill is byte-identical', () => {
const gaps = lanes.starter_gaps as Record<string, string[]>;
expect(Object.keys(gaps).length).toBeGreaterThan(0);
for (const [slug, ops] of Object.entries(gaps)) {
- const generated = read(`plugin/skills/${slug}/SKILL.md`);
+ const generated = withoutWhenToUse(read(`plugin/skills/${slug}/SKILL.md`));
expect(generated.startsWith(read(`skills/${slug}/SKILL.md`).replace(/\n*$/, '\n'))).toBe(true);
expect(generated).toContain('## Tools outside your MCP surface');
for (const op of ops) expect(generated).toMatch(new RegExp(`- \`${op}\` → \`gbrain [^\`]+\``));
@@ -403,7 +405,7 @@ describe('curated tree membership + scanner guard', () => {
}
expect(read('plugin/skills/maintain/SKILL.md')).toContain('- `get_health` → `gbrain doctor --json`');
const gapFree = [...laneSet].find(slug => !(slug in gaps))!;
- expect(read(`plugin/skills/${gapFree}/SKILL.md`)).toBe(read(`skills/${gapFree}/SKILL.md`));
+ expect(withoutWhenToUse(read(`plugin/skills/${gapFree}/SKILL.md`))).toBe(read(`skills/${gapFree}/SKILL.md`));
});
test('non-skill dirs carry no SKILL.md (the scanner never grows a surprise skill)', () => {
diff --git a/test/plugin-tree-when-to-use-5858.test.ts b/test/plugin-tree-when-to-use-5858.test.ts
new file mode 100644
index 0000000000..eb03511019
--- /dev/null
+++ b/test/plugin-tree-when-to-use-5858.test.ts
@@ -0,0 +1,41 @@
+/**
+ * #5858: Claude Code lists a skill by name, description and `when_to_use`
+ * only, so the plugin lanes carry `when_to_use` built from each skill's
+ * `triggers:` (within the 1,536-character listing cap). Source skills under
+ * skills/ stay unchanged; the committed plugin trees are generated.
+ */
+import { describe, expect, test } from 'bun:test';
+import { existsSync, readdirSync, readFileSync } from 'node:fs';
+import { join, resolve } from 'node:path';
+import { FAILSAFE_SCHEMA, safeLoad } from 'js-yaml';
+
+const ROOT = resolve(import.meta.dir, '..');
+function frontmatter(path: string): Record<string, unknown> | null {
+ const match = readFileSync(path, 'utf8').match(/^---\n([\s\S]*?)\n---/);
+ return match ? safeLoad(match[1], { schema: FAILSAFE_SCHEMA }) as Record<string, unknown> : null;
+}
+function skillFiles(dir: string): string[] {
+ return readdirSync(dir, { withFileTypes: true }).filter(entry => entry.isDirectory())
+ .map(entry => join(dir, entry.name, 'SKILL.md')).filter(path => existsSync(path));
+}
+
+describe('plugin lanes carry when_to_use (#5858)', () => {
+ const lanes = [join(ROOT, 'plugin', 'skills'), ...readdirSync(join(ROOT, 'plugin-variants')).map(variant => join(ROOT, 'plugin-variants', variant, 'skills'))]
+ .filter(dir => existsSync(dir));
+ for (const lane of lanes) {
+ test(`${lane.slice(ROOT.length + 1)}: every skill with triggers has a bounded when_to_use`, () => {
+ const withTriggers = skillFiles(lane).map(path => ({ path, fm: frontmatter(path) }))
+ .filter(({ fm }) => Array.isArray(fm?.triggers) && (fm!.triggers as unknown[]).length > 0);
+ expect(withTriggers.length).toBeGreaterThan(0);
+ for (const { path, fm } of withTriggers) {
+ expect(typeof fm!.when_to_use, path).toBe('string');
+ expect(String(fm!.when_to_use)).toContain(String((fm!.triggers as string[])[0]).trim());
+ expect(String(fm!.description ?? '').length + String(fm!.when_to_use).length, path).toBeLessThanOrEqual(1536);
+ }
+ });
+ }
+
+ test('source skills stay free of generated when_to_use', () => {
+ for (const path of skillFiles(join(ROOT, 'skills'))) expect(frontmatter(path)?.when_to_use, path).toBeUndefined();
+ });
+});