# Brain Ingest Gate

Pre-write quality gate for content entering the brain.

- Repository: https://github.com/garrytan/gbrain (31427 stars)
- Category: Writing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add garrytan/gbrain --skill brain-ingest-gate -g -a claude-code -y`
Codex: `npx skills add garrytan/gbrain --skill brain-ingest-gate -g -a codex -y`
Cursor: `npx skills add garrytan/gbrain --skill brain-ingest-gate -g -a cursor -y`
Gemini CLI: `npx skills add garrytan/gbrain --skill brain-ingest-gate -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add garrytan/gbrain`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Brain Ingest Gate, Resolve and Dedup Before Anything Enters the Brain

> **Convention:** see [conventions/brain-first.md](../conventions/brain-first.md), > the lookup chain (`gbrain entity` → `search` → `query` → `get`) is the same
> chain this gate runs before every write.
>
> **Convention:** see [_brain-filing-rules.md](../_brain-filing-rules.md), > when the gate's verdict is "write", the primary subject picks the directory.
>
> **Convention:** `skills/conventions/quality.md` owns the cross-cutting page
> rules (citations, Iron Law back-linking, notability), every page the gate
> lets through follows them. Gate-specific delta: the gate only decides
> write/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:

1. **Named-Entity Resolution Gate**, is this about a named thing that
   already has a page under its chosen name?
2. **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:

The rest: https://github.com/garrytan/gbrain/blob/HEAD/plugin-variants/gbrain-coding/skills/brain-ingest-gate/SKILL.md
