
schema-author
Evolve your brain's schema pack. Add page types, propose new ones from corpus scans, backfill page.type on existing pages, audit pack health. Triggers when an agent notices untyped pages, custom domains needing typed entities (researcher, contract, deposition), or wants to see what types the pack declares.
- Installs
- 167
- Last 24h
- +9
- Trending rank
- #9278
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/garrytan/gbrain --skill schema-author- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads schema-author automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
schema-author — evolve your schema pack
Non-goals (use these other skills instead)
This skill AUTHORS the schema pack (adds page types, link verbs, prefixes, flags). For these adjacent jobs, route elsewhere:
- Filing one specific page →
skills/brain-taxonomist/SKILL.md. Brain- taxonomist routes at WRITE TIME ("where does this note go?"). schema-author changes the rules at AUTHORING TIME ("what types and prefixes exist?"). - Schema-check as part of EIIRP iteration →
skills/eiirp/SKILL.mdalready has a schema-check phase. Don't duplicate. - Just looking up a type's settings →
gbrain schema explain <type>directly. This skill is for CHANGING the pack, not READING from it. - Querying who knows about X →
gbrain whoknows <topic>directly. schema-author makes a type expert-routable; it does not run the query.
Convention
Convention: see conventions/brain-first.md for the lookup chain (search → query → get_page → external).
Convention: see conventions/schema-evolution.md for "when to add a type vs alias vs prefix" — the heuristic.
When to invoke
Invoke when the user (or a sibling skill) says any of:
- "Add a
researchertype to my schema" - "I have 4000 untyped pages under
meetings/" - "My brain doesn't know that
journal-articleis a type" - "Set
paperto be extractable" - "Propose types from what I've ingested"
- "Sync the new types to backfill existing pages"
DON'T invoke for "where does THIS note go" (use brain-taxonomist) or
"who knows about X" (use expert-routing / gbrain whoknows).
Tutorial + vision
- Why this matters:
docs/what-schemas-unlock.md— 7 killer use cases (4000 invisible meetings made queryable, founder ops brain, research brain, legal brain, team brain, agent-as-co-curator) plus the structural argument for why types matter at query time. Read this before pitching schema authoring to a user — it's the doc that explains the difference between a pile of notes and a brain with structure. - 5-minute walkthrough:
docs/schema-author-tutorial.md— fork the bundled pack, add a researcher type, sync, prove the T1.5 wiring viagbrain whoknows. Use placeholder pages so it runs against any brain without affecting real content.
Workflow
Phase 1 — Brain (know which pack is active)
gbrain schema active --json
Output gives you pack_name, version, sha8, page_types_count, source_tier.
If source_tier === "default", the user is on bundled gbrain-base and any
mutation will need a fork first (Phase 4).
Phase 2 — Assess (what does the current pack cover?)
gbrain schema stats --json
Returns per-type page counts, untyped count, and dead_prefixes (pack-
declared prefixes with zero matching pages — probable mis-declarations).
If coverage < 90%, there's untyped content worth typing.
gbrain schema review-orphans --json
Untyped pages drilldown. Look for shared path prefixes (e.g. "12 of these
are under research/papers/") — those are candidates for a new type.
Phase 3 — Propose (what types should the pack add?)
gbrain schema detect --json
Clusters pages by source_path and proposes candidate types. Heuristic
only (no LLM call).
gbrain schema suggest --json
LLM-refined candidates with confidence scores. Use the top-3 hit rate as the signal for which to promote.
Phase 4 — Apply (mutate the pack)
If the active pack is bundled (gbrain-base or gbrain-recommended),
fork it first:
gbrain schema fork gbrain-base mine
gbrain schema use mine
Then add the types one at a time:
gbrain schema add-type researcher \
--primitive entity \
--prefix people/researchers/ \
--extractable \
--expert
For complex multi-mutation refactors (e.g. add a type AND the link verb
that points to it), agents reaching this surface over MCP can use the
batched schema_apply_mutations op:
{"op": "add_type", "name": "researcher", "primitive": "entity", "prefix": "people/researchers/", "extractable": true, "expert_routing": true}
{"op": "add_type", "name": "paper", "primitive": "annotation", "prefix": "research/papers/", "extractable": true}
{"op": "add_link_type", "name": "authored", "inference": {"page_type": "researcher", "target_type": "paper"}}
Validate before sync:
gbrain schema lint --with-db
The --with-db flag opts into the 4 DB-aware rules
(extractable_empty_corpus, mutation_count_anomaly,
stored_type_is_alias, stored_type_undeclared) that detect
mis-declared types you'd otherwise discover only at runtime.
Phase 5 — Sync (backfill existing pages with the new types)
Dry-run first:
gbrain schema sync --json
Returns per-prefix would_apply counts + sample slugs. If the numbers
look right:
gbrain schema sync --apply
Chunked UPDATE in 1000-row batches; never wedges concurrent writers.
Idempotent on re-run (second --apply finds nothing to backfill).
Phase 6 — Verify
gbrain schema stats --json
Coverage should be ≥95% now. Spot-check the new type:
gbrain whoknows "machine learning"
If researcher was declared --expert, results should include
researcher-typed pages. (The pack-aware wiring at the query path was
added in v0.40.6.0 — pre-v0.40.6 brains silently ignored custom
expert-routed types.)
Phase 7 — Commit (preserve the change)
If the pack is in source control, commit and push only the pack file:
cd ~/.gbrain/schema-packs/mine
gbrain git commit-push -m "schema: add researcher + paper types + authored link" -- pack.json
It takes the checkout's writer lock and merges a rejected push without
rebasing, so it is safe when other agents share the checkout. On a non-zero
exit: retry once on commit_lock_busy; on integrate_conflict stop and ask
the user which version of pack.json wins; on git_push_unavailable the
remote is unreachable (the commit is saved; rerun with --push-only later) or,
when the pack repo has no remote at all, nothing was committed: commit just the
pack locally with git add pack.json && git commit -m "<msg>" -- pack.json. Never fall back to
stash, pull --rebase or a plain push (outcomes).
If the brain daemon is running (gbrain serve --http), other processes
pick up the change within 1 second (stat-mtime TTL gate in
loadActivePack — v0.40.6.0 closed the cross-process invalidation gap).
Outputs
- Mutated pack file at
~/.gbrain/schema-packs/<name>/pack.{json,yaml}. - Audit row in
~/.gbrain/audit/schema-mutations-YYYY-Www.jsonlper mutation. pages.typebackfilled on matching rows aftersync --apply.- Query paths (
whoknows,find_experts) now route through the new expert types.
Contract
- Inputs: a natural-language request that names a type / prefix / link verb / flag change, OR the result of
gbrain schema review-orphansshowing untyped pages that need a new type. - Outputs: mutated pack file at
~/.gbrain/schema-packs/<name>/pack.{json,yaml}+ an audit row in~/.gbrain/audit/schema-mutations-YYYY-Www.jsonl+ (ifsync --applyran) backfilledpages.typeon matching rows. - Side effects: invalidates the in-process pack cache + the query cache for the source. Other processes pick up the change within 1 second (stat-mtime TTL).
- Idempotency: every primitive is idempotent.
add-alias/add-prefixno-op on duplicate;sync --applyfinds nothing to update on second run. - Trust: CLI = local trust (no scope check). MCP = OAuth
adminscope (write ops). Audit log capturesactor: mcp:<clientId8>per mutation. - Atomicity: every mutation is wrapped in
withMutation's atomic write (.tmp + fsync + rename) + per-packO_CREAT|O_EXCLlock. Crash mid-write leaves the original file untouched.
When it fails
Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:
- Mutation codes:
PACK_READONLY→ fork first (gbrain schema fork gbrain-base mine);STILL_REFERENCED→ remove the named references first;LOCK_BUSY→ wait about 30 seconds and retry. - Over MCP, a mutation returns
insufficient_scope: schema writes need theadminscope, which only the brain host's operator grants; tell the user. - The pre-write lint gate rejects a change: read the error, fix the named prefix or alias collision, and re-run; never bypass lint.
Anti-Patterns
- Don't mutate
gbrain-baseorgbrain-recommended. Fork first (gbrain schema fork gbrain-base mine). These are bundled packs; edits would be lost on upgrade. The mutation primitives refuse withPACK_READONLY. - Don't add a type for a directory you imported once for triage. Pack types are permanent decisions; one-time imports are not. See
skills/conventions/schema-evolution.mdfor the <20-pages-don't-pack-codify heuristic. - Don't add
--expertto a type with nopath_prefixes. Theexpert_routing_without_prefixlint warns about this — expert-routed types with no prefix never match a put_page inference, sowhoknowssilently never surfaces them. - Don't promote a
schema suggestcandidate without verifying the prefix matches real content. Runlint --with-dbbeforeadd-typeto catch prefix collisions pre-write. - Don't conflate "filing one page" with "evolving the schema." Filing routes via
brain-taxonomist; schema-author is for authoring the type taxonomy itself. The Non-goals section above names the boundary. - Don't skip the dry-run before
sync --apply. Always runsyncfirst to seewould_applycounts + sample slugs. A pack prefix that matches 50,000 pages is recoverable but slow; verifying first is cheap. - Don't remove a type without checking references.
remove-typerefuses withSTILL_REFERENCEDif another type'saliases/enrichable_types/link_types/frontmatter_linksreferences it. Break the references first; don't add--force.
Output Format
When invoked, this skill produces structured output suitable for both human + JSON consumption:
Per-mutation result (JSON):
{"schema_version": 1, "pack": "mine", "path": "~/.gbrain/schema-packs/mine/pack.json", "format": "json", "prev_sha8": "a1b2c3d4", "new_sha8": "e5f6g7h8"}
Per-batch result (from schema_apply_mutations MCP op):
{"schema_version": 1, "pack": "mine", "batch_id": "batch-1716491400-abc123", "mutations_applied": 3, "results": [{...}, {...}, {...}]}
Stats JSON (per-source + aggregate + dead-prefix hints):
{"schema_version": 1, "pack_identity": "mine@1.0.0+abc12345", "aggregate": {"total_pages": 4823, "typed_pages": 4710, "untyped_pages": 113, "coverage": 0.9766, "by_type": [{"type": "person", "count": 2104}, ...]}, "per_source": [...], "dead_prefixes": [{"type": "researcher", "prefix": "people/researchers/"}]}
Sync dry-run JSON:
{"schema_version": 1, "apply": false, "pack_identity": "mine@1.0.0+abc12345", "per_prefix": [{"type": "meeting", "prefix": "meetings/", "would_apply": 4000, "sample_slugs": ["meetings/2026-01-01-foo", ...], "dead_prefix": false, "applied": 0}], "total_would_apply": 4000, "total_applied": 0}
Human output (the agent's final summary):
- One line per mutation:
Pack: <name> (<format>)andSha8: <prev> → <new> - Stats: total pages, typed %, untyped count, per-type breakdown, dead-prefix list
- Sync: per-prefix
would_apply/appliedcount + sample slugs in dry-run mode
On failure, the error envelope follows the standard StructuredAgentError shape: {error, code, message, details?}. Codes from the mutation primitives: PACK_NOT_FOUND, PACK_READONLY, PACK_CORRUPT, TYPE_EXISTS, TYPE_NOT_FOUND, INVALID_PRIMITIVE, INVALID_RESULT, IO_ERROR, STILL_REFERENCED, LOCK_BUSY.
Failure modes
PACK_READONLY→ you tried to mutategbrain-baseorgbrain-recommended. Fork first.INVALID_RESULT→ the mutation would create a dangling reference or prefix collision. The pre-write lint gate caught it. Read the error message; the lint rule name names the problem.STILL_REFERENCED→ you tried to remove a type that another type'saliases/enrichable_types/link_types/frontmatter_linksreferences. The error names every reference. Remove those first.LOCK_BUSY→ another process is mid-mutation. Wait 30s and retry, or pass--forceif you know the holder is wedged.permission_denied(MCP only) → your OAuth client doesn't haveadminscope. Re-register withgbrain auth register-client --scopes admin.
FAQ
What does the schema-author skill do?
Evolve your brain's schema pack. Add page types, propose new ones from corpus scans, backfill page.type on existing pages, audit pack health. Triggers when an agent notices untyped pages, custom domains needing typed entities (researcher, contract, deposition), or wants to see what types the pack declares.
How do I install schema-author?
Run npx skills add https://github.com/garrytan/gbrain --skill schema-author in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/schema-author/ (personal) or .claude/skills/schema-author/ (project).
Which AI agents can use schema-author?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is schema-author safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains schema-author?
It is published by garrytan in garrytan/gbrain. It has 167 recorded installs.
More from garrytan/gbrain
brain-ops
garrytan/gbrain
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.
query
garrytan/gbrain
Answer questions using the brain's knowledge with 3-layer search, synthesis, and citation propagation. Use when the user asks a question, wants a lookup, or needs information from the brain.
maintain
garrytan/gbrain
Brain health checks: back-link enforcement, citation audit, filing validation, stale info detection, orphan pages, and benchmarks. Use when asked to check brain health, run maintenance, or audit quality.
idea-ingest
garrytan/gbrain
Ingest links, articles, tweets, and ideas into the brain. Fetch content, save to brain with analysis, credit the author (people page only when they pass the notability gate), and cross-link. Use when the user shares a link or says "read this", "save this", "think about this".
enrich
garrytan/gbrain
Enrich brain pages with tiered enrichment protocol. Creates and updates person/company pages with compiled truth, timeline, and cross-links. Use when a new entity is mentioned or an existing page needs updating.
meeting-ingestion
garrytan/gbrain
Ingest meeting transcripts from ANY meeting recorder into brain pages with attendee enrichment, entity propagation, and timeline merge. One unified pipeline: normalize the source into a standard transcript record, split multi-meeting recordings, resolve speakers by evidence, create the page, pass every surprising claim through the consistency check (transcript + brain + plausibility), enrich every entity, then run the verification checklist — substance AND sequence. A meeting is NOT fully ingested until the enrich skill has processed every entity AND the verification checklist passes, including the sequence verify (PASS or explicit user waive).
Popular security skills
azure-compliance
microsoft/azure-skills
Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.
minimal-run-and-audit
lllllllama/rigorpilot-skills
Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized reprooutputs/ files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.
seo-audit
coreyhaines31/marketingskills
When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," "indexing issues," "stuck on page 2," "striking distance keywords," "title tag rewrite," "low CTR," "local SEO," "Google Business Profile," or "map pack." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.
firebase-security-rules-auditor
firebase/agent-skills
Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.
audit
pbakaus/impeccable
Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.
competitors
coreyhaines31/marketingskills
When the user wants to create competitor comparison or alternative pages for SEO and buyer-facing use. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'competitor teardown,' 'audit our competitor pages,' 'are our comparison pages out of date,' or 'competitive asset audit.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For auditing existing claims (not researching competitors from scratch, which is competitor-profiling; not technical SEO on these pages, which is seo-audit), use the asset audit here. For internal battle cards and sales-specific competitor docs, see sales-enablement.