| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 6 | 6 | 0% |
| Commands | 0 | 1 | 1 | 0% |
| Section tags | 1 | 0 | 6 | 14% |
What each file covers
Sections
0 shared · 6 only in A · 6 only in B- − @second-brain/collectors — Agent Instructions
- − Entry Point
- − Collectors (6)
- − Providers (5)
- − Adding a New Collector
- − Other Directories
- + Second Brain — Agent Instructions
- + Monorepo Map
- + Commands
- + Conventions
- + Data Model
- + Docs
Commands
0 shared · 1 only in A · 1 only in B- − git
- + pnpm install / build / test / check-types / lint / dev / clean
Section tags
1 shared · 0 only in A · 6 only in B- + setup
- + test
- + code-style
- + types
- + monorepo
- + docs
- agent-behaviour
Line diff
thangaram611/second-brain · packages/collectors/AGENTS.md
@@ −1 @@
1# @second-brain/collectors — Agent Instructions
2
3Data collectors and streaming providers that feed the knowledge graph.
4
5## Entry Point
6
7`src/pipeline/runner.ts` → `PipelineRunner` with `register()` and `run()`.
8
9## Collectors (6)
10
11| Collector | Directory | What it collects |
12|-----------|-----------|-----------------|
13| `git` | `src/git/` | Commits, branches, file history |
14| `ast` | `src/ast/` | Code symbols, dependencies, structure |
15| `github` | `src/github/` | Issues, PRs, reviews, comments |
16| `gitlab` | `src/gitlab/` | MRs, issues, pipelines |
17| `conversation` | `src/conversation/` | Chat/conversation transcripts |
18| `docs` | `src/docs/` | Documentation files (markdown, etc.) |
19
20## Providers (5)
21
22| Provider | Directory | Transport |
23|----------|-----------|-----------|
24| `custom` | `src/providers/` | Programmatic API |
25| `git` | `src/providers/` | Git hooks / polling |
26| `github` | `src/providers/` | GitHub webhooks |
27| `gitlab` | `src/providers/` | GitLab webhooks |
28| `webhook-relay` | `src/providers/` | Generic webhook relay |
29
30## Adding a New Collector
31
321. Implement the `Collector` interface in a new `src/<name>/` directory
332. Register in `src/pipeline/runner.ts`
34
35## Other Directories
36
37- `src/extraction/` — LLM-based entity extraction helpers
38- `src/git-context/` — Git context resolution
39- `src/realtime/` — Real-time event streaming
40- `src/watch/` — File system watchers
41
thangaram611/second-brain · AGENTS.md
@@ +1 @@
1# Second Brain — Agent Instructions
2
3Developer knowledge graph — shared engineering memory for teams ("git remembers the code; Second Brain remembers why"). pnpm monorepo, Turborepo, Node.js 24+, TypeScript 5.8+ strict, ESM only.
4
5Each package/app has its own AGENTS.md with package-specific instructions.
6
7## Monorepo Map
8
9```
10packages/types → Shared TS types
11packages/core → Graph engine (SQLite + Drizzle + FTS5 + sqlite-vec)
12packages/collectors → Data collectors + streaming providers
13packages/ingestion → LLM extraction + embedding pipeline
14packages/sync → Yjs CRDT sync bridge
15packages/mcp-server → MCP tools (32 tools, stdio + HTTP)
16apps/server → Express 5 REST + WebSocket (:7430)
17apps/ui → React 19 + Cytoscape.js + Zustand (:5173)
18apps/relay → Hocuspocus CRDT relay (:7421)
19tools/cli → brain CLI (Commander.js)
20```
21
22## Commands
23
24```bash
25pnpm install / build / test / check-types / lint / dev / clean
26```
27
28Per-package: `cd <pkg> && pnpm test|build|dev`
29
30## Conventions
31
32- ESM only (`"type": "module"`), `.mjs`/`.d.mts` output, `tsdown` for builds
33- ULIDs via `ulidx` for IDs — never UUID
34- ISO 8601 strings for timestamps — never unix/Date
35- SQLite (better-sqlite3) + Drizzle ORM, WAL mode
36- Zod v4 for external input validation
37- Namespace on all entities/relations: `'personal'` = local, project ID = synced
38- Vitest + in-memory SQLite (`:memory:`) for tests
39- Named exports, re-export from package `index.ts`
40- Workspace imports (`@second-brain/core`, `@second-brain/types`)
41- Strict mode, no `any`, no path aliases
42
43## Data Model
44
45- **15 entity types**: concept, decision, pattern, person, file, symbol, event, tool, fact, conversation, reference, pull_request, merge_request, branch, review
46- **20 relation types**: 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_with
47
48Defined in `packages/types/src/entity.ts` and `packages/types/src/relation.ts`.
49
50## Docs
51
52- [docs/architecture.md](./docs/architecture.md) — Full technical architecture
53- [docs/getting-started.md](./docs/getting-started.md) — Usage guide
54- [docs/api-reference.md](./docs/api-reference.md) — REST API + MCP + CLI reference
55
@@ −1 +1 @@
1−# @second-brain/collectors — Agent Instructions
1+# Second Brain — Agent Instructions
22
3−Data collectors and streaming providers that feed the knowledge graph.
3+Developer knowledge graph — shared engineering memory for teams ("git remembers the code; Second Brain remembers why"). pnpm monorepo, Turborepo, Node.js 24+, TypeScript 5.8+ strict, ESM only.
44
5−## Entry Point
5+Each package/app has its own AGENTS.md with package-specific instructions.
66
7−`src/pipeline/runner.ts` → `PipelineRunner` with `register()` and `run()`.
7+## Monorepo Map
88
9−## Collectors (6)
9+```
10+packages/types → Shared TS types
11+packages/core → Graph engine (SQLite + Drizzle + FTS5 + sqlite-vec)
12+packages/collectors → Data collectors + streaming providers
13+packages/ingestion → LLM extraction + embedding pipeline
14+packages/sync → Yjs CRDT sync bridge
15+packages/mcp-server → MCP tools (32 tools, stdio + HTTP)
16+apps/server → Express 5 REST + WebSocket (:7430)
17+apps/ui → React 19 + Cytoscape.js + Zustand (:5173)
18+apps/relay → Hocuspocus CRDT relay (:7421)
19+tools/cli → brain CLI (Commander.js)
20+```
1021
11−| Collector | Directory | What it collects |
12−|-----------|-----------|-----------------|
13−| `git` | `src/git/` | Commits, branches, file history |
14−| `ast` | `src/ast/` | Code symbols, dependencies, structure |
15−| `github` | `src/github/` | Issues, PRs, reviews, comments |
16−| `gitlab` | `src/gitlab/` | MRs, issues, pipelines |
17−| `conversation` | `src/conversation/` | Chat/conversation transcripts |
18−| `docs` | `src/docs/` | Documentation files (markdown, etc.) |
22+## Commands
1923
20−## Providers (5)
24+```bash
25+pnpm install / build / test / check-types / lint / dev / clean
26+```
2127
22−| Provider | Directory | Transport |
23−|----------|-----------|-----------|
24−| `custom` | `src/providers/` | Programmatic API |
25−| `git` | `src/providers/` | Git hooks / polling |
26−| `github` | `src/providers/` | GitHub webhooks |
27−| `gitlab` | `src/providers/` | GitLab webhooks |
28−| `webhook-relay` | `src/providers/` | Generic webhook relay |
28+Per-package: `cd <pkg> && pnpm test|build|dev`
2929
30−## Adding a New Collector
30+## Conventions
3131
32−1. Implement the `Collector` interface in a new `src/<name>/` directory
33−2. Register in `src/pipeline/runner.ts`
32+- ESM only (`"type": "module"`), `.mjs`/`.d.mts` output, `tsdown` for builds
33+- ULIDs via `ulidx` for IDs — never UUID
34+- ISO 8601 strings for timestamps — never unix/Date
35+- SQLite (better-sqlite3) + Drizzle ORM, WAL mode
36+- Zod v4 for external input validation
37+- Namespace on all entities/relations: `'personal'` = local, project ID = synced
38+- Vitest + in-memory SQLite (`:memory:`) for tests
39+- Named exports, re-export from package `index.ts`
40+- Workspace imports (`@second-brain/core`, `@second-brain/types`)
41+- Strict mode, no `any`, no path aliases
3442
35−## Other Directories
43+## Data Model
3644
37−- `src/extraction/` — LLM-based entity extraction helpers
38−- `src/git-context/` — Git context resolution
39−- `src/realtime/` — Real-time event streaming
40−- `src/watch/` — File system watchers
45+- **15 entity types**: concept, decision, pattern, person, file, symbol, event, tool, fact, conversation, reference, pull_request, merge_request, branch, review
46+- **20 relation types**: 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_with
47+
48+Defined in `packages/types/src/entity.ts` and `packages/types/src/relation.ts`.
49+
50+## Docs
51+
52+- [docs/architecture.md](./docs/architecture.md) — Full technical architecture
53+- [docs/getting-started.md](./docs/getting-started.md) — Usage guide
54+- [docs/api-reference.md](./docs/api-reference.md) — REST API + MCP + CLI reference
4155
