weiping/gbrain-cn/brain-ingest-gate
Claude Code and agent skill by weiping/gbrain-cn
- community
Checking that the SKILL.md file is still in the repository.
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 entities registry-first (a vector score is a floor for prose, never a gate for named things), then run the read-the-top-hit dedup decision tree (clear-dup / plausible-dup / clear). Owns dedup; delegates enrichment to the shipped ingestion skills. Routing convention, not an operation-boundary enforcement.
Install
npx vskill@latest install weiping/gbrain-cn/brain-ingest-gateSKILL.md
The same SKILL.md was published earlier as weiping/gbrain-cn/brain-ingest-gate.
Brain Ingest Gate — Resolve and Dedup Before Anything Enters the Brain
Convention: see conventions/brain-first.md —the lookup chain (gbrain entity→search→query→get) is the samechain this gate runs before every write.Convention: see _brain-filing-rules.md —when the gate's verdict is "write", the primary subject picks the directory.Convention:skills/conventions/quality.mdowns the cross-cutting pagerules (citations, Iron Law back-linking, notability) — every page the gatelets through follows them. Gate-specific delta: the gate only decideswrite/link/skip; the admitting skill applies the quality rules on write.
The Rule
No content enters the brain without passing this gate. A raw `cp` or `mv` into the brain repo is a bug.
One insight, one place. If it already exists, link to it — don't clone it. Before any new page is written (file migration, bulk import, manual gbrain put, subagent output), two checks run in order:
- Named-Entity Resolution Gate — is this about a named thing that
already has a page under its chosen name?
- Dedup Gate — does the brain already state this insight somewhere?
Scope honesty: this gate is a routing convention — the harness resolves it into context when an ingest-shaped intent matches, and a well-behaved agent follows it. Nothing in the gbrain runtime mechanically blocks an unenriched or duplicate write if the skill never loads.
Why gbrain needs this gate
The native pipeline does NOT do semantic dedup for you:
- `gbrain import` / `gbrain sync` skip only matching frontmatter IDs.
Identical content under a different slug or ID indexes twice — every duplicate becomes a second search hit competing with the canonical page.
- `gbrain capture`'s dedup is a 24-hour exact content-hash — it catches
re-captures of identical bytes, not the same insight reworded.
- The `remember` verb dedupes facts, not pages.
Semantic dedup and named-entity resolution are this skill's job, in full.
When This Gate Fires
- File migration — moving files already in the workspace into the brain
repo ("move this to brain").
- Bulk imports — batch moves of any kind into brain directories, BEFORE
gbrain sync or gbrain import indexes them. For batches, also read conventions/test-before-bulk.md: gate 3-5 items and inspect the decisions before running the rest.
- Manual writes —
gbrain putorgbrain captureof rich content, or
direct file writes into the brain repo.
- Subagent output — background agents writing notes or pages into the
brain.
What This Gate Owns vs Delegates
This skill is a gate, not a pipeline. It owns the pre-write checks below. Everything downstream of a "write" verdict is delegated to shipped skills — do not restate their steps here or inline:
| Concern | Delegate to | |
|---|---|---|
| Routing new external content (meetings, articles, media) | ingest | |
| Entity detection + notability on inbound content | signal-detector | |
| Creating/updating person + company pages, tiered effort, backlinks | enrich | |
| Concept pages, tiering, cluster synthesis | concept-synthesis | |
| Back-link enforcement (Iron Law) | conventions/quality.md | |
| Which directory the page lands in | _brain-filing-rules.md |
Named-Entity Resolution Gate (runs FIRST)
Fires whenever the content is about a NAMED project, place, company, person, or anything someone "wants to build / found / make."
Vector similarity alone cannot be trusted to catch named-entity dupes: a page stored under its chosen NAME will not embed close to the generic English phrase someone happens to describe it with. The classic failure: a search for a descriptive phrase scores the canonical named page below the prose floor, so a duplicate stub gets written on top of a years-old page. Stored by named meaning; retrieval attempted by literal generic phrase.
The rules
- Resolve registry-first, not by the generic phrase. gbrain's native
registry is the entity surface:
``bash gbrain entity "<name>" # zero-LLM card: page, aka list, near-miss suggestions ``
A card hit means the page exists — STOP, link, don't clone. On a miss (or for concept-shaped nouns), fall through to gbrain query "<name>" --limit 3. If the brain also keeps an explicit index of named initiatives (e.g. a page under concepts/), read it before concluding anything is new.
- Expand through aliases before searching. Named pages should carry an
aliases: frontmatter list (generic label + chosen name + any nickname + signature phrase). Search EACH alias and the generic label, not just the phrase the user happened to say.
- A vector score is a floor for prose, NEVER a gate for named things.
If there is ANY plausible named match, open and read the candidate page (gbrain get <slug>) before concluding it doesn't exist. A named page can be the right answer at a score that would be a clear miss for prose.
- When a NEW named thing appears, bake its aliases in the same write.
Create the page with the full aliases: list so every future synonym resolves through gbrain entity. One frontmatter list covers all future phrasings — O(1), not a per-instance reminder.
Why a gate and not a memory note
A memory reminder ("query the real name, not the generic phrase") is a per-instance sticky note: it only works if it happens to be in hot context that turn, doesn't generalize to the next named entity, and rots. This skill loads when an ingest-shaped task routes here. Process rules belong in the triggered gate, not in hot memory.
Dedup Gate (runs SECOND)
Before writing ANY new page (for named things, the resolution gate above runs first and takes precedence):
- Extract the core claim — 1-2 sentences capturing what's novel about the
new content.
- Search for it:
``bash gbrain search "<core claim>" --limit 5 ``
- OPEN AND READ the top hit (
gbrain get <slug>). Never band on the
score alone. Donor systems publish cosine cutoffs for this step — do NOT port them: gbrain search returns fused hybrid rank scores, not cosine similarity, and no numeric threshold maps across. The band comes from reading, not from the number.
- Assign a band:
| Band | Meaning | Action | |
|---|---|---|---|
| clear-dup | The top hit already states the same insight about the same subject | STOP. Link to the existing page (gbrain link / gbrain timeline-add) instead of writing. | |
| plausible-dup | Same territory; possibly a new angle | Read both fully. Same insight → link, don't write. Genuinely new angle → write WITH a cross-link to the existing page. | |
| clear | Nothing in the top results covers the claim | Write normally through the delegated enrichment skills. |
Decision tree
When to skip dedup
- Operational/state files — time-series records, not knowledge.
- Meeting transcripts — each meeting is unique by definition (entities
INSIDE it still go through the named-entity gate via the delegated skills).
- Timeline entries on existing pages — back-links are additive, not
duplicative.
- Media files — dedup by filename/hash, not semantic similarity.
Verification
After the batch, verify the gate's output holds:
If check-backlinks check reports gaps on pages the gate just admitted, the enrichment delegation was skipped — route back through enrich before declaring the ingest done.
Contract
This skill guarantees:
- No new page enters the brain through this skill's flows without the
named-entity resolution check and the dedup check running first.
- Every "duplicate" verdict names the matched slug and produces a link or
timeline entry instead of a clone.
- New named-entity pages carry an
aliases:frontmatter list in the same
write that creates them.
- Dedup bands are assigned by READING the top hit, never by score alone; no
numeric similarity thresholds are used against gbrain's fused scores.
- Enrichment is delegated to shipped skills (ingest, enrich, signal-detector,
concept-synthesis) — never restated or reimplemented inline.
- Batches end with a
gbrain check-backlinks checkverification pass. - Routing matches the canonical triggers in the frontmatter.
- Output written under the directories listed in
writes_to:. - Examples use placeholder names and paths.
The full behavior contract is documented in the body sections above.
Output Format
One decision line per item checked, then the verification result:
Every "linked" or "duplicate" row MUST name the matched slug. If any row says "written", the enrichment delegation (which skill handled it) should be recoverable from the conversation.
When it fails
Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:
- The "is this already in the brain?" search is empty with a degraded notice: an empty keyword-only result is not proof the content is missing. Check by slug, URL or exact title before importing.
gbrain capture/putreturnswrite_pending(exit 10): the content is accepted. Pollgbrain write-request <request_id>; do not capture it again.source_binding_requiredorinsufficient_scopeon an MCP write: this connection cannot write that source. Tell the user which source and scope are missing; the brain host's operator grants them.
Anti-Patterns
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 91 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugin/skills/brain-ingest-gate/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Sep 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/weiping/gbrain-cn/brain-ingest-gate)