RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Diff/thangaram611-second-brain-tools-cli-agents ↔ thangaram611-second-brain-agents

Comparison

A · AGENTS.md · thangaram611/second-brainB · AGENTS.md · thangaram611/second-brain
What each file covers, counted
DimensionSharedOnly in AOnly in BOverlap
Sections14510%
Commands0010%
Section tags10614%

What each file covers

Sections

1 shared · 4 only in A · 5 only in B
  • − tools/cli — Agent Instructions
  • − Entry Point
  • − Adding a New CLI Command
  • − Other Key Files
  • + Second Brain — Agent Instructions
  • + Monorepo Map
  • + Conventions
  • + Data Model
  • + Docs
  •   Commands

Commands

0 shared · 0 only in A · 1 only in B
  • + 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

+44 added−34 removed11 unchanged20.0% identical
thangaram611/second-brain · tools/cli/AGENTS.md
@@ −1 @@
1# tools/cli — Agent Instructions
2 
3`brain` CLI tool built with Commander.js for interacting with the knowledge graph.
4 
5## Entry Point
6 
7`src/index.ts` → Commander program. Commands in `src/commands/`.
8 
 
 
 
 
 
 
 
 
 
 
 
 
 
9## Commands
10 
11| File | Command(s) | Purpose |
12|------|-----------|---------|
13| `init-reset.ts` | `init`, `init server`, `init client`, `reset`, `admin`, `doctor`, `auth rotate` | Solo/team initialization, admin, diagnostics, auth |
14| `add.ts` | `add` | Add entities manually |
15| `decide.ts` | `decide` | Record decisions |
16| `recall.ts` | `recall` | Build assistant context blocks |
17| `search.ts` | `search` | Full-text search |
18| `query.ts` | `query` | Natural-language graph query |
19| `index-cmd.ts` | `index` | Run collector pipelines |
20| `embed.ts` | `embed` | Generate embeddings |
21| `export-import.ts` | `export`, `import` | JSON export/import |
22| `status.ts` | `status` | Show brain status/stats |
23| `sync.ts` | `sync` | Manage sync state |
24| `wire-unwire.ts` | `wire`, `unwire` | Connect/disconnect repositories |
25| `wire-assistant.ts` | `wire-assistant`, `unwire-assistant` | Install/remove assistant hooks |
26| `watch.ts` | `watch` | File system watcher |
27| `tail.ts` | `tail` | Stream recent changes |
28| `flip-branch.ts` | `flip-branch` | Switch branch context |
29| `ownership-cmd.ts` | `ownership` | Entity ownership management |
30| `personal-cmd.ts` | `personal` | Personal namespace operations |
31 
32## Adding a New CLI Command
33 
341. Create command file in `src/commands/`
352. Export a function that takes the Commander `program` object
363. Register in `src/index.ts`
37 
38## Other Key Files
 
 
 
 
 
 
 
 
 
39 
40- `src/keychain.ts` — Credential storage
41- `src/personal-crypto.ts` — Encryption for personal namespace
42- `src/git-context-daemon.ts` — Background git context tracking
43- `src/sse-relay.ts` — SSE relay for real-time events
44- `src/lib/` — Shared CLI utilities
 
 
 
 
 
 
 
45 
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−# tools/cli — Agent Instructions
1+# Second Brain — Agent Instructions
22  
3−`brain` CLI tool built with Commander.js for interacting with 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/index.ts` → Commander program. Commands in `src/commands/`.
7+## Monorepo Map
88  
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+```
21+ 
922 ## Commands
1023  
11−| File | Command(s) | Purpose |
12−|------|-----------|---------|
13−| `init-reset.ts` | `init`, `init server`, `init client`, `reset`, `admin`, `doctor`, `auth rotate` | Solo/team initialization, admin, diagnostics, auth |
14−| `add.ts` | `add` | Add entities manually |
15−| `decide.ts` | `decide` | Record decisions |
16−| `recall.ts` | `recall` | Build assistant context blocks |
17−| `search.ts` | `search` | Full-text search |
18−| `query.ts` | `query` | Natural-language graph query |
19−| `index-cmd.ts` | `index` | Run collector pipelines |
20−| `embed.ts` | `embed` | Generate embeddings |
21−| `export-import.ts` | `export`, `import` | JSON export/import |
22−| `status.ts` | `status` | Show brain status/stats |
23−| `sync.ts` | `sync` | Manage sync state |
24−| `wire-unwire.ts` | `wire`, `unwire` | Connect/disconnect repositories |
25−| `wire-assistant.ts` | `wire-assistant`, `unwire-assistant` | Install/remove assistant hooks |
26−| `watch.ts` | `watch` | File system watcher |
27−| `tail.ts` | `tail` | Stream recent changes |
28−| `flip-branch.ts` | `flip-branch` | Switch branch context |
29−| `ownership-cmd.ts` | `ownership` | Entity ownership management |
30−| `personal-cmd.ts` | `personal` | Personal namespace operations |
24+```bash
25+pnpm install / build / test / check-types / lint / dev / clean
26+```
3127  
32−## Adding a New CLI Command
28+Per-package: `cd <pkg> && pnpm test|build|dev`
3329  
34−1. Create command file in `src/commands/`
35−2. Export a function that takes the Commander `program` object
36−3. Register in `src/index.ts`
30+## Conventions
3731  
38−## Other Key Files
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
3942  
40−- `src/keychain.ts` — Credential storage
41−- `src/personal-crypto.ts` — Encryption for personal namespace
42−- `src/git-context-daemon.ts` — Background git context tracking
43−- `src/sse-relay.ts` — SSE relay for real-time events
44−- `src/lib/` — Shared CLI utilities
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+ 
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
4555  
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack