coco-research/coco/brain-init
Claude Code and agent skill by coco-research/coco
- community
Checking that the SKILL.md file is still in the repository.
Use when setting up project memory in a new folder or on the first brain:init in a project. Creates project_brain.db, registers the project, and bootstraps it from CLAUDE.local.md, memory files, docs, and emails; safe to re-run.
Install
npx vskill@latest install coco-research/coco/brain-initSKILL.md
/brain:init --- Initialize Project Brain
Sets up a new project_brain.db in the current working directory and bootstraps it from existing project knowledge.
Procedure
Step 1: Check existing state
Run:
- If no DB exists → proceed to Step 2 (full init)
- If DB exists with project(s) → skip to Step 3 (scan only). Tell user: "Brain already initialized. Running scan for new/changed files..."
Step 2: Create the database and project record
Run:
Ask the user:
- Project name (e.g., "My Project A", "My Project B")
- Slug (short URL-safe identifier, e.g., "my-project-a", "my-project-b")
- Description (one-liner)
Then run:
If the project has sub-scopes (like ProjectA-Phase1 and ProjectA-Phase2 under one umbrella), ask if the user wants multiple project records.
Step 3: Scan the project folder
Run the scanner to discover what's available:
This returns a JSON report with:
- manifest_diff: new/changed/unchanged file counts, whether this is the first scan
- files_to_process: paths of new or changed files
- knowledge_sources: which CLAUDE.local.md, memory files, docs, and emails were found
Show the user a summary:
If nothing to process (all unchanged): "Everything up to date. No new knowledge to extract." → done.
Step 4: Extract knowledge from sources (Claude-driven)
Process sources in priority order. For each source, read the file, extract structured knowledge, and collect proposed writes. Do NOT write to the brain yet — collect everything first.
Priority 1: CLAUDE.local.md
If found, read the full file. Extract:
- Sections like "Key Decisions" →
decisions(with date, decision text, decided_by if mentioned) - People mentioned by name →
personentities (with metadata like role, email, team if mentioned) - Systems/tools mentioned →
systementities (e.g., Snowflake, Postgres, Datadog) - Teams mentioned →
teamentities - Folder structure sections →
documententities for key docs - Recent Changes entries →
events(with date, type, title)
Priority 2: Memory files (~/.claude/projects/.../memory/*.md)
Each memory file has frontmatter (name, description, type) and content. Read each file:
- project type memories →
decisionsor context to enrich existing entities - feedback type memories → skip (these are Claude behavior guidance, not project knowledge)
- reference type memories →
systemordocumententities with metadata
Priority 3: Document inventory
For each file in docs/, emails/, and Reference Doc/:
- Create a
documententity with metadata:{"path": "relative/path", "type": "doc|email|reference", "size": N} - Use the filename (cleaned) as the entity name
- Do NOT read the full content of every file — just register them in the inventory
Priority 4: CLAUDE.md (project-level, if exists)
Same extraction as CLAUDE.local.md but lower priority (may overlap).
Step 5: Present extraction summary
Show proposed writes:
Ask: "Write all to brain? [Y/n/adjust]"
Step 6: Execute writes
On confirmation, write in this order using Python:
- Entities — use
upsert_entity(idempotent, safe to re-run) - Relationships — use
create_relationship(also idempotent) - Decisions — use
create_decision(check for duplicates by matching decision text before inserting) - Events — use
create_event(check for duplicates by matching title + date) - Document entities — use
upsert_entitywith type="document"
After all writes, sync to MemPalace and brain.json:
After writes complete, update the manifest:
Step 7: Report
Step 8: Generate knowledge articles
After completing brain writes (Step 6) and confirming the manifest is updated (Step 6 scan-update), initialize the knowledge engine for this project.
First, register the project with the knowledge engine:
This is required before the cron can harvest the project. (FIX M1: register_project must be called before running any cron phases.)
Then, bootstrap article generation:
Or equivalently via CLI:
This runs:
- Phase 2 (harvest evidence from the brain DB you just populated + infer relationships)
- Phase 3 (generate articles for all entities — first run will generate all)
- Phase 5 (FTS5 index the new articles)
Show the user:
Skip this step silently if:
~/.coco/knowledge/does not exist (knowledge engine not installed)- The
cron.pycall fails for any reason (non-blocking — brain init still succeeds)
Important Rules
- Dedup before writing. Always check what exists in the DB before proposing new writes. Use
upsert_entitywhich handles this automatically for entities. - Don't read every file. For doc inventory, just register the file — don't parse 130KB HTML files to extract content. That's what
/brain-updateis for (conversation-driven). - Date everything. Decisions and events need dates. Parse from the source if available, fall back to file modification date, then today.
- Memory files are structured. They have frontmatter — use the
typefield to decide what to extract. - Manifest tracks scan state. Always run
scan-updateafter writes so the next scan is incremental.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsystems/brain/skills/brain-init/SKILL.md
Popularity
- Repository stars
- 427
- Repository forks
- 12
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/coco-research/coco/brain-init)