brain-ingest-gate
Pre-write quality gate for content entering the brain. No raw copies: a bare cp/mv into the brain repo is a bug. Before any new page lands, resolve named…
Brain knowledge base operations. The core read/write cycle: brain-first lookup, read-enrich-write loop, source attribution, ambient enrichment, back-linking. Read this before any brain interaction.
$ npx -y skills add garrytan/gbrain --skill brain-ops --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/brain-opsContext preview
The summary Claude sees to decide when to auto-load this skill.
Brain knowledge base operations. The core read/write cycle: brain-first lookup, read-enrich-write loop, source attribution, ambient enrichment, back-linking. Read this before any brain interaction.
name: brain-ops version: 1.2.0 upstream: brain-ops@fc834ee description: | Brain knowledge base operations. The core read/write cycle: brain-first lookup, read-enrich-write loop, source attribution, ambient enrichment, back-linking. Read this before any brain interaction. triggers: - any brain read/write/lookup/citation tools: - search - query - get_page - put_page - add_link - add_timeline_entry - get_backlinks - sync_brain mutating: true writes_pages: true writes_to: - people/ - companies/ - deals/ - concepts/ - meetings/
Recall relevant context before responding. Save explicit requests with provenance; automatic capture is off until the user opts in. Reading this skill does not enable capture, delegation, or paid enrichment. A chat-only instruction suppresses writes for that turn, including when standing capture is enabled.
> **Convention:** See `skills/conventions/brain-first.md` for the 5-step lookup protocol. > **Convention:** See `skills/conventions/quality.md` for citation and back-link rules.
> **Memory verbs (MEMORY_VERBS v1, gbrain ≥ 0.43).** Over MCP, prefer the five > core memory verbs for the read/write cycle: **`remember(fact, provenance, > ttl?)`** to save a single durable fact (mandatory provenance; dedupes + > supersedes), **`recall(query | entity, budget_tokens)`** to read it back > budget-packed, **`entity(name)`** for a zero-LLM card, **`synthesize(question)`** > for the expensive cross-page answer, **`forget(id)`** to withdraw active memory > (history, source material, and backups may remain). `context_pack` and `delta` > complete the seven-verb surface. Use > `remember` instead of `extract_facts` when you already have ONE formed fact; > `put_page` / `add_link` / `add_timeline_entry` stay the page/graph write path. > Fall back to the classic ops when the verbs aren't on the surface. Contract: > `docs/protocol/MEMORY_VERBS_v1.md`. > > **Keyless brains:** when `extract_facts` returns `skipped: > extraction_unavailable`, YOU are the extractor — pull the facts from the turn > yourself and write each one via `remember` with `kind` set (event | preference > | commitment | belief | fact — those five are the frozen protocol enum; the > `idea` kind the extractor and DB carry is NOT one of them) and the > visibility the envelope's `agent_action` names > (default private — pin it; `remember` defaults to world), or author a > `## Facts` fence on the entity page. A `skipped: extraction_failed` envelope > (server-side extractor errored on this turn; `reason` names why) invites the > same manual `remember` fallback for that turn — automatic extraction stays > on for future writes.
This skill guarantees:
loop; enrichment requires its separately configured authority
Every mention of a person or company with a brain page MUST create a back-link FROM that entity's page TO the page mentioning them. An unlinked mention is a broken brain. See `skills/conventions/quality.md` for format.
Before using ANY external API to research a person, company, or topic:
1. `gbrain entity "<name>"` (v0.43+) — ONE known person/company/project → full card (description, aliases, open threads, recent events, edges, backlink/fact counts). Zero LLM calls, sub-100ms. This one call replaces steps 2–6 for known-entity lookups; near-misses return suggestions. 2. `gbrain search "name"` — exact-token lookup for existing pages (cheap hybrid, no expansion) 3. `gbrain query "natural question about name"` — concept/landscape questions go here FIRST (expansion recovers synonym phrasings; a nonzero `search` count is not proof of completeness) 4. `gbrain get <slug>` — if you know the slug, read the full page 5. Check backlinks: who references this entity? 6. Check timeline: recent events involving this entity
The brain almost always has something. External APIs fill gaps, not start from scratch.
**⚠️ NEVER scope/count a corpus with shallow `ls` — query gbrain or `find`.** Federated sources often carry MULTIPLE coexisting directory conventions — a flat legacy layer AND a date-nested `meetings/YYYY/MM/` layer. A non-recursive `ls dir/*.md` sees only one and undercounts massively. Real example: a shallow `ls` of one source's `meetings/` counted 132 files, almost all the user's, and concluded that WAS the corpus — missing thousands of transcripts nested under `meetings/YYYY/MM/`. To count/scope a brain corpus:
For questions that need synthesis, temporal grounding, or analytical answers — not just "find the page" but "answer the question":
1. Use `gbrain think "<question>"` — multi-hop synthesis across pages + takes + the graph. Temporal questions route through trajectory analysis; everything else gets an LLM-synthesized, cited answer with conflict + gap analysis. Returns a grounded answer, not just a list of matching pages. 2. Best for: "when did acme-example last raise
Give the agent you already use a memory you control. GBrain stores explicit facts with their sources, supports corrections and withdrawal, and makes the same memory available across your agents.
Repo: garrytan/gbrain
Pre-write quality gate for content entering the brain. No raw copies: a bare cp/mv into the brain repo is a bug. Before any new page lands, resolve named…
When you report a brain page to the user — created, edited, committed, or relayed from a subagent — a working link is part of the deliverable, in the SAME…
Deduplicate and synthesize raw concept stubs into a tiered intellectual map (T1 Canon to T4 Riff), tracing idea evolution across sources over time. Transforms…
Token-hygiene audit of the always-loaded context stack — CLAUDE.md, AGENTS.md, auto-memory MEMORY.md, and the bootstrap-rendered identity files (SOUL.md,…
When the user corrects a factual error, root-cause it immediately. Don't just note the correction — trace the error to its source, fix the source, and prevent…
Confirmation gate before any bulk delete, cleanup, or destructive operation that could result in data loss — shell-level (rm -rf, git rm, bulk sed) or…