Copilot instructions
.github/copilot-instructions.mdCopilot instructions
Quality
96/100
Scores the file, not the repository.Length
438 words
9 headings · 2 code blocksRepository
0
— · pushed 31 days agoLast changed
3 days ago
First indexed 3 days ago.1# GitHub Copilot Instructions — Second Brain23## Project45Developer knowledge graph — pnpm monorepo with Turborepo. Node.js 22+, TypeScript 5.8+ strict mode, ESM only.67For full architecture details, see [docs/architecture.md](../docs/architecture.md).8For agent-level instructions, see [AGENTS.md](../AGENTS.md).910## Tech Stack1112- **Runtime**: Node.js 22+, ESM modules only (`"type": "module"`)13- **Language**: TypeScript 5.8+ (strict mode, explicit return types, no `any`)14- **Database**: SQLite via better-sqlite3 + Drizzle ORM, WAL mode15- **Search**: FTS5 (BM25) + sqlite-vec (cosine KNN), fused via Reciprocal Rank Fusion16- **Validation**: Zod v4 for all external inputs17- **Testing**: Vitest with in-memory SQLite (`:memory:`), globals enabled18- **Build**: tsdown (ESM bundler), tsc (type-check only)19- **Frontend**: React 19, Zustand, Cytoscape.js, Tailwind CSS, Radix UI20- **Sync**: Yjs CRDTs via Hocuspocus relay21- **IDs**: ULIDs (via ulidx). Never UUID22- **Timestamps**: ISO 8601 strings. Never unix timestamps2324## Conventions2526### DO27- Use named exports, re-export from package index.ts28- Use workspace imports: `@second-brain/core`, `@second-brain/types`29- Use Zod schemas for request validation in routes30- Write tests with Vitest using in-memory SQLite31- Use `batchUpsert` for bulk operations (merges observations/tags on conflict)32- Keep observations as atomic, concise facts (string arrays)33- Use try-catch with descriptive error messages3435### DON'T36- Use path aliases (rely on workspace resolution)37- Use `any` type38- Import from package internals (use public API via index.ts)39- Use UUIDs (use ULIDs from ulidx)40- Use Date objects or unix timestamps in storage41- Manually write to entities_fts table (auto-maintained via triggers)42- Sync the 'personal' namespace43- Mutate stored confidence values (decay is read-side only)4445## Monorepo Structure4647```48packages/types — Shared TypeScript types49packages/core — Knowledge graph engine (Brain class)50packages/collectors — Data collectors + streaming providers51packages/ingestion — LLM extraction + embedding pipeline52packages/sync — Yjs CRDT sync bridge53packages/mcp-server — MCP tools (32 tools, stdio + HTTP)54apps/server — Express 5 REST API + WebSocket (port 7430)55apps/ui — React 19 + Cytoscape.js web app (port 5173)56apps/relay — Hocuspocus CRDT relay (port 7421)57tools/cli — brain CLI (Commander.js)58```5960## Commands6162```bash63pnpm install # Install dependencies64pnpm build # Build all packages65pnpm test # Run all tests66pnpm check-types # Type-check everything67pnpm dev # Start dev servers68```6970## Data Model7172- **Entity types** (15): concept, decision, pattern, person, file, symbol, event, tool, fact, conversation, reference, implementation, pull_request, merge_request, branch73- **Relation types** (20): relates_to, depends_on, implements, supersedes, contradicts, derived_from, authored_by, decided_in, uses, tests, contains, co_changes_with, preceded_by, blocks, reviewed_by, merged_in_mr, merged_in_pr, touches_file, owns, parallel_with74- Every entity/relation has a `namespace` field75- Bitemporal: eventTime + ingestTime76- Confidence with time-based decay (read-side only)77
Also in thangaram611/second-brain
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| thangaram611/second-brain.clinerules/01-project.md · 0 | Cline rules | setuptestmonorepodo-not | 65/100 | 3 days ago | |
| thangaram611/second-brain.clinerules/02-conventions.md · 0 | Cline rules | teststyledo-not | 40/100 | 3 days ago | |
| thangaram611/second-brain.clinerules/03-backend.md · 0 | Cline rules | styledatabase | 37/100 | 3 days ago | |
| thangaram611/second-brain.clinerules/04-frontend.md · 0 | Cline rules | style | 28/100 | 3 days ago | |
| thangaram611/second-brain.clinerules/05-testing.md · 0 | Cline rules | testdo-not | 35/100 | 3 days ago | |
| thangaram611/second-brain.clinerules/06-data-model.md · 0 | Cline rules | types | 25/100 | 3 days ago | |
| thangaram611/second-brain.cursor/rules/backend.mdc · 0 | Cursor rules | do-not | 31/100 | 3 days ago | |
| thangaram611/second-brain.cursor/rules/data-model.mdc · 0 | Cursor rules | types | 30/100 | 3 days ago | |
| thangaram611/second-brain.cursor/rules/frontend.mdc · 0 | Cursor rules | do-not | 31/100 | 3 days ago | |
| thangaram611/second-brain.cursor/rules/project.mdc · 0 | Cursor rules | testdo-notagent-behaviour | 50/100 | 3 days ago | |
| thangaram611/second-brain.cursor/rules/testing.mdc · 0 | Cursor rules | testdo-not | 27/100 | 3 days ago | |
| thangaram611/second-brain.windsurfrules · 0 | Windsurf rules | setupteststylearch+4 | 75/100 | 3 days ago | |
| thangaram611/second-brainAGENTS.md · 0 | AGENTS.md | setupteststyletypes+3 | 74/100 | 3 days ago | |
| thangaram611/second-brainCLAUDE.md · 0 | CLAUDE.md | agent-behaviour | 16/100 | 3 days ago | |
| thangaram611/second-brainapps/relay/AGENTS.md · 0 | AGENTS.md | monorepoagent-behaviour | 33/100 | 3 days ago | |
| thangaram611/second-brainapps/server/AGENTS.md · 0 | AGENTS.md | styleapimonorepoagent-behaviour | 56/100 | 3 days ago | |
| thangaram611/second-brainapps/ui/AGENTS.md · 0 | AGENTS.md | styleuimonorepoagent-behaviour | 56/100 | 3 days ago | |
| thangaram611/second-brainpackages/collectors/AGENTS.md · 0 | AGENTS.md | agent-behaviour | 52/100 | 3 days ago | |
| thangaram611/second-brainpackages/core/AGENTS.md · 0 | AGENTS.md | testtypesdatabaseagent-behaviour | 62/100 | 3 days ago | |
| thangaram611/second-brainpackages/ingestion/AGENTS.md · 0 | AGENTS.md | styleagent-behaviour | 48/100 | 3 days ago |
Diff against .clinerules/01-project.md Diff against .clinerules/02-conventions.md Diff against .clinerules/03-backend.md Diff against .clinerules/04-frontend.md Diff against .clinerules/05-testing.md Diff against .clinerules/06-data-model.md Diff against .cursor/rules/backend.mdc Diff against .cursor/rules/data-model.mdc Diff against .cursor/rules/frontend.mdc Diff against .cursor/rules/project.mdc Diff against .cursor/rules/testing.mdc Diff against .windsurfrules Diff against AGENTS.md Diff against CLAUDE.md Diff against apps/relay/AGENTS.md Diff against apps/server/AGENTS.md Diff against apps/ui/AGENTS.md Diff against packages/collectors/AGENTS.md Diff against packages/core/AGENTS.md Diff against packages/ingestion/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 3 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 3 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 3 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 24 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 3 days ago | |
| keycloak/keycloak.github/copilot-instructions.md · 36k | Copilot instructions | setupbuildtestlint-format+6 | 93/100 | 3 days ago |
