symbiote-cli 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/README.md +60 -47
  2. package/dist/src/brain/intent.d.ts.map +1 -1
  3. package/dist/src/brain/intent.js +8 -1
  4. package/dist/src/brain/intent.js.map +1 -1
  5. package/dist/src/commands/dna.d.ts.map +1 -1
  6. package/dist/src/commands/dna.js +5 -11
  7. package/dist/src/commands/dna.js.map +1 -1
  8. package/dist/src/commands/hooks.d.ts.map +1 -1
  9. package/dist/src/commands/hooks.js +56 -45
  10. package/dist/src/commands/hooks.js.map +1 -1
  11. package/dist/src/commands/impact.d.ts.map +1 -1
  12. package/dist/src/commands/impact.js +9 -4
  13. package/dist/src/commands/impact.js.map +1 -1
  14. package/dist/src/commands/mcp.js +5 -6
  15. package/dist/src/commands/mcp.js.map +1 -1
  16. package/dist/src/commands/scan.d.ts.map +1 -1
  17. package/dist/src/commands/scan.js +11 -6
  18. package/dist/src/commands/scan.js.map +1 -1
  19. package/dist/src/commands/serve.d.ts.map +1 -1
  20. package/dist/src/commands/serve.js +8 -3
  21. package/dist/src/commands/serve.js.map +1 -1
  22. package/dist/src/commands/shared.d.ts +1 -1
  23. package/dist/src/commands/shared.d.ts.map +1 -1
  24. package/dist/src/commands/shared.js +1 -1
  25. package/dist/src/commands/shared.js.map +1 -1
  26. package/dist/src/commands/unbond.d.ts.map +1 -1
  27. package/dist/src/commands/unbond.js +3 -0
  28. package/dist/src/commands/unbond.js.map +1 -1
  29. package/dist/src/core/parser.js +28 -0
  30. package/dist/src/core/parser.js.map +1 -1
  31. package/dist/src/cortex/engine.d.ts.map +1 -1
  32. package/dist/src/cortex/engine.js +4 -3
  33. package/dist/src/cortex/engine.js.map +1 -1
  34. package/dist/src/cortex/pgq-queries.d.ts.map +1 -1
  35. package/dist/src/cortex/pgq-queries.js +1 -1
  36. package/dist/src/cortex/pgq-queries.js.map +1 -1
  37. package/dist/src/cortex/real-time-enrichment.d.ts.map +1 -1
  38. package/dist/src/cortex/real-time-enrichment.js +1 -0
  39. package/dist/src/cortex/real-time-enrichment.js.map +1 -1
  40. package/dist/src/cortex/repository.d.ts +1 -0
  41. package/dist/src/cortex/repository.d.ts.map +1 -1
  42. package/dist/src/cortex/repository.js +20 -3
  43. package/dist/src/cortex/repository.js.map +1 -1
  44. package/dist/src/cortex/stage-0-structure.js +5 -4
  45. package/dist/src/cortex/stage-0-structure.js.map +1 -1
  46. package/dist/src/cortex/stage-2-resolution.js +3 -3
  47. package/dist/src/cortex/stage-2-resolution.js.map +1 -1
  48. package/dist/src/cortex/stage-4-types.js +0 -5
  49. package/dist/src/cortex/stage-4-types.js.map +1 -1
  50. package/dist/src/cortex/stage-5-flow.js +7 -3
  51. package/dist/src/cortex/stage-5-flow.js.map +1 -1
  52. package/dist/src/cortex/stage-6-topology.d.ts.map +1 -1
  53. package/dist/src/cortex/stage-6-topology.js +2 -3
  54. package/dist/src/cortex/stage-6-topology.js.map +1 -1
  55. package/dist/src/cortex/stage-7-intelligence.d.ts.map +1 -1
  56. package/dist/src/cortex/stage-7-intelligence.js +1 -1
  57. package/dist/src/cortex/stage-7-intelligence.js.map +1 -1
  58. package/dist/src/cortex/types.d.ts +0 -5
  59. package/dist/src/cortex/types.d.ts.map +1 -1
  60. package/dist/src/dna/embeddings.d.ts.map +1 -1
  61. package/dist/src/dna/embeddings.js +2 -0
  62. package/dist/src/dna/embeddings.js.map +1 -1
  63. package/dist/src/dna/export.d.ts.map +1 -1
  64. package/dist/src/dna/export.js.map +1 -1
  65. package/dist/src/dna/profile.d.ts +1 -2
  66. package/dist/src/dna/profile.d.ts.map +1 -1
  67. package/dist/src/dna/profile.js +9 -21
  68. package/dist/src/dna/profile.js.map +1 -1
  69. package/dist/src/hooks/handlers/pre-tool-use.d.ts.map +1 -1
  70. package/dist/src/hooks/handlers/pre-tool-use.js +18 -13
  71. package/dist/src/hooks/handlers/pre-tool-use.js.map +1 -1
  72. package/dist/src/index.d.ts +1 -1
  73. package/dist/src/index.d.ts.map +1 -1
  74. package/dist/src/index.js +1 -1
  75. package/dist/src/index.js.map +1 -1
  76. package/dist/src/init/agent-connector.d.ts.map +1 -1
  77. package/dist/src/init/agent-connector.js +25 -13
  78. package/dist/src/init/agent-connector.js.map +1 -1
  79. package/dist/src/mcp/proxy-handler.d.ts.map +1 -1
  80. package/dist/src/mcp/proxy-handler.js +12 -5
  81. package/dist/src/mcp/proxy-handler.js.map +1 -1
  82. package/dist/src/mcp/proxy-server.d.ts.map +1 -1
  83. package/dist/src/mcp/proxy-server.js +2 -1
  84. package/dist/src/mcp/proxy-server.js.map +1 -1
  85. package/dist/src/mcp/server.d.ts.map +1 -1
  86. package/dist/src/mcp/server.js +7 -36
  87. package/dist/src/mcp/server.js.map +1 -1
  88. package/dist/src/mcp/tool-response.d.ts +3 -2
  89. package/dist/src/mcp/tool-response.d.ts.map +1 -1
  90. package/dist/src/mcp/tool-response.js +4 -7
  91. package/dist/src/mcp/tool-response.js.map +1 -1
  92. package/dist/src/mcp/tools/dna-tools.d.ts +0 -1
  93. package/dist/src/mcp/tools/dna-tools.d.ts.map +1 -1
  94. package/dist/src/mcp/tools/dna-tools.js.map +1 -1
  95. package/dist/src/mcp/tools/graph-tools.js +3 -3
  96. package/dist/src/mcp/tools/graph-tools.js.map +1 -1
  97. package/dist/src/mcp/tools/health-tools.js +2 -2
  98. package/dist/src/mcp/tools/health-tools.js.map +1 -1
  99. package/dist/src/mcp/tools/impact-tools.js +3 -3
  100. package/dist/src/mcp/tools/impact-tools.js.map +1 -1
  101. package/dist/src/mcp/tools/project-tools.js +2 -2
  102. package/dist/src/mcp/tools/project-tools.js.map +1 -1
  103. package/dist/src/mcp/tools/rename-tool.d.ts +0 -1
  104. package/dist/src/mcp/tools/rename-tool.d.ts.map +1 -1
  105. package/dist/src/mcp/tools/rename-tool.js +8 -2
  106. package/dist/src/mcp/tools/rename-tool.js.map +1 -1
  107. package/dist/src/storage/db.js +1 -1
  108. package/dist/src/storage/db.js.map +1 -1
  109. package/dist/src/storage/repository.d.ts.map +1 -1
  110. package/dist/src/storage/repository.js +1 -0
  111. package/dist/src/storage/repository.js.map +1 -1
  112. package/dist/tsconfig.tsbuildinfo +1 -1
  113. package/package.json +4 -1
  114. package/skills/symbiote-init/SKILL.md +124 -70
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "symbiote-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Symbiote bonds with your AI tools — giving them memory, context, and your coding DNA.",
5
5
  "type": "module",
6
6
  "imports": {
@@ -98,5 +98,8 @@
98
98
  "type": "git",
99
99
  "url": "git+https://github.com/MohmmedAshraf/symbiote.git"
100
100
  },
101
+ "bugs": {
102
+ "url": "https://github.com/MohmmedAshraf/symbiote/issues"
103
+ },
101
104
  "homepage": "https://github.com/MohmmedAshraf/symbiote"
102
105
  }
@@ -11,18 +11,35 @@ MCP server is already registered globally by `symbiote install`. This skill only
11
11
 
12
12
  ## Process
13
13
 
14
- 1. Scan the codebase
14
+ 1. Scan the codebase and start the server
15
15
  2. Write project overview
16
- 3. Build extraction lists from context
17
- 4. Dispatch subagent to record everything
18
- 5. Print one-line summary
16
+ 3. Scan ALL projects for developer identity
17
+ 4. Build complete DNA entries, constraints, and decisions
18
+ 5. Dispatch subagent with pre-built entries
19
+ 6. Print one-line summary
19
20
 
20
- ## Step 1: Scan
21
+ ## Step 1: Scan and Start Server
22
+
23
+ Run these as SEPARATE bash commands:
21
24
 
22
25
  ```bash
23
26
  npx symbiote-cli scan
24
27
  ```
25
28
 
29
+ Then start the server:
30
+
31
+ ```bash
32
+ npx symbiote-cli serve --no-open > /dev/null 2>&1 &
33
+ ```
34
+
35
+ Then wait and verify:
36
+
37
+ ```bash
38
+ sleep 3 && curl -s http://127.0.0.1:$(cat .brain/port)/internal/health
39
+ ```
40
+
41
+ IMPORTANT: Do NOT combine scan and serve into one command. The scan must finish and release the DB lock before the server starts.
42
+
26
43
  ## Step 2: Write Project Overview
27
44
 
28
45
  Write `.brain/intent/overview.md` — a concise project summary that gives AI tools instant context.
@@ -45,123 +62,160 @@ Read the codebase context (CLAUDE.md, package.json, top-level structure, scan re
45
62
 
46
63
  - `{top-level-dir}/` — {what it contains}
47
64
  - `{top-level-dir}/` — {what it contains}
48
- - `{sub-dir}/` — {what it contains, if important}
49
65
 
50
66
  ## Key Patterns
51
67
 
52
- - {How data flows, e.g. "Server actions → Zod validation → Drizzle ORM"}
53
- - {How modules connect, e.g. "MCP server exposes graph queries to AI tools"}
54
- - {Any non-obvious architectural pattern}
68
+ - {How data flows}
69
+ - {How modules connect}
55
70
 
56
71
  ## Entry Points
57
72
 
58
- - `{file}` — {what it does}
59
73
  - `{file}` — {what it does}
60
74
  ```
61
75
 
62
- Rules:
76
+ Rules: keep it under 40 lines, no frontmatter, be specific to THIS project.
77
+
78
+ ## Step 3: Scan ALL Projects for Developer Identity
79
+
80
+ Read the developer's full coding identity across every project:
81
+
82
+ 1. `~/.claude/CLAUDE.md` — global instructions
83
+ 2. Every CLAUDE.md in `~/.claude/projects/*/` — all project instructions
84
+ 3. Every `.md` file in `~/.claude/projects/*/memory/` — all memories
85
+ 4. `./CLAUDE.md` — current project
86
+
87
+ Read ALL of these. Do not skip any.
63
88
 
64
- - Keep it under 40 lines total
65
- - No frontmatter — this is a plain markdown file, not an intent entry
66
- - Focus on WHAT and HOW, not rules or preferences (those go in constraints/decisions)
67
- - Be specific to THIS project, not generic descriptions
68
- - Use the project's actual directory names, tech choices, and patterns
89
+ **Also extract the developer's identity** from the global CLAUDE.md:
69
90
 
70
- ## Step 3: Build Extraction Lists
91
+ - Name (look for "Name:", "Author:", or similar)
92
+ - Email
93
+ - GitHub handle
94
+ - Website/URL
71
95
 
72
- Read your context (CLAUDE.md, memories, rule files) and build three separate lists:
96
+ ## Step 4: Build Complete DNA Entries
73
97
 
74
- ### DNA (coding preferences) `record_instruction`
98
+ From everything in Step 3, build three COMPLETE lists. Every entry must be fully formed — do NOT leave fields empty.
75
99
 
76
- Extract how the developer writes code:
100
+ ### DNA entries
77
101
 
78
- - Formatting (indentation, quotes, semicolons, line length)
79
- - Language conventions (strict TypeScript, ESM, etc.)
80
- - Code structure (early returns, composition, small functions)
81
- - Anti-patterns (no `any`, no dead code, no comments)
82
- - Testing preferences (TDD, isolation, framework)
83
- - Workflow (conventional commits, small commits)
102
+ Build each entry as a COMPLETE JSON object with ALL fields filled:
103
+
104
+ ```json
105
+ {
106
+ "rule": "Use 4-space indentation everywhere, never tabs",
107
+ "reason": "Consistency across polyglot stack eliminates context-switching friction and keeps diffs uniform",
108
+ "category": "formatting",
109
+ "applies_to": ["typescript", "javascript", "json", "php"],
110
+ "not_for": ["go"],
111
+ "source": "explicit"
112
+ }
113
+ ```
84
114
 
85
- ### Constraints (project rules) → `propose_constraint`
115
+ **EVERY field is required:**
86
116
 
87
- Extract rules the project enforces:
117
+ - `rule` one specific sentence, self-contained
118
+ - `reason` — WHY this matters. NEVER leave empty. "Comments rot faster than code; good names eliminate narration" is good. Generic "for consistency" is not acceptable.
119
+ - `category` — use organic categories: `formatting`, `patterns`, `architecture`, `workflow`, `testing`, `tooling`, `ai-collaboration`. Not the old fixed categories.
120
+ - `applies_to` — list of languages/frameworks in lowercase. Empty `[]` means universal.
121
+ - `not_for` — exclusions where a rule doesn't apply (e.g., Go uses tabs not spaces). Omit if no exclusions.
122
+ - `source` — always `"explicit"` for init
88
123
 
89
- - "All mutations through server actions"
90
- - "Validate external input with Zod at boundaries"
91
- - "Tests must mirror src/ structure"
124
+ **Categories to cover** (verify you have entries for each):
92
125
 
93
- ### Decisions (architectural choices) `propose_decision`
126
+ - **formatting** indentation, quotes, semicolons, line length, file naming (kebab-case?)
127
+ - **patterns** — early returns, composition over inheritance, small functions, naming, error handling, type strictness
128
+ - **architecture** — project structure, separation of concerns, where logic lives, module boundaries, monorepo patterns
129
+ - **workflow** — commit style, no co-authored-by, never push without asking, no destructive DB ops, challenge plans
130
+ - **testing** — framework per language (Vitest, Pest), TDD, test structure, isolation
131
+ - **tooling** — framework choices per stack: Laravel+Inertia for PHP, Next.js for TS, Supabase, Stripe, Tailwind, shadcn
132
+ - **ai-collaboration** — concise responses, no trailing summaries, research before changing, no docs unless asked
94
133
 
95
- Extract choices with rationale:
134
+ **Confidence scoring:**
96
135
 
97
- - "Chose Vitest over Jest for native ESM support"
98
- - "Using DuckDB for graph storage — local-first, no external deps"
99
- - "Switched to Drizzle for better type safety"
136
+ - Found in 3+ project CLAUDE.md files `1.0`
137
+ - Found in 1-2 projects `0.7`
138
+ - Current project only `0.5`
100
139
 
101
- ### What to Skip (applies to all three)
140
+ **Completeness checklist before proceeding:**
141
+
142
+ - [ ] Formatting rules (indentation, quotes, line length, file naming)
143
+ - [ ] Code patterns (early returns, composition, function size, type strictness)
144
+ - [ ] Architecture (project structure, separation of concerns, module boundaries)
145
+ - [ ] Workflow (commits, pushing, destructive operations, AI collaboration style)
146
+ - [ ] Testing (framework per language, TDD, test structure)
147
+ - [ ] Tooling (framework choices per language/stack)
148
+ - [ ] AI collaboration (response style, autonomy level)
149
+ - [ ] Language-specific entries with proper `applies_to` scoping
150
+ - [ ] `not_for` exclusions where rules don't apply to certain languages
151
+ - [ ] Every `reason` field is filled with a specific WHY
152
+
153
+ ### Constraints (project rules)
154
+
155
+ For THIS project only. Use `propose_constraint` MCP tool.
156
+
157
+ ### Decisions (architectural choices)
158
+
159
+ For THIS project only. Use `propose_decision` MCP tool.
160
+
161
+ ### What to Skip
102
162
 
103
163
  - File paths or directory descriptions
104
164
  - Tool/product feature lists
105
- - Author identity
165
+ - Author identity (captured separately)
106
166
  - CLI commands or usage examples
107
- - Anything describing WHAT the project IS rather than rules/choices/preferences
108
-
109
- ### Formatting Rules (applies to all three)
110
-
111
- Each entry must be:
112
167
 
113
- - One clear, grammatically correct sentence
114
- - Self-contained — understandable without context
115
- - Specific — not vague or overly broad
168
+ ## Step 5: Dispatch Subagent
116
169
 
117
- ## Step 4: Dispatch Subagent
170
+ Launch a single Agent to record everything. Pass the COMPLETE pre-built entries — do NOT ask the subagent to figure out fields.
118
171
 
119
- Launch a single Agent to record everything. Pass it all three lists.
172
+ **Critical: also pass the developer identity** so the subagent can update the profile metadata.
120
173
 
121
174
  **Agent prompt template:**
122
175
 
123
- ````
176
+ ```
124
177
  Record the following Symbiote entries using MCP tools. Call tools in parallel where possible.
125
178
 
126
- **DNA entries** — use `record_instruction` for each. Example call:
127
- ```json
128
- {
129
- "rule": "Use 4-space indentation everywhere, never tabs",
130
- "reason": "Better readability in nested callbacks and PR reviews",
131
- "category": "formatting",
132
- "applies_to": ["typescript", "javascript"],
133
- "source": "explicit"
134
- }
135
- ````
179
+ ## Developer Identity
180
+
181
+ After recording all entries, the profile at ~/.symbiote/profiles/personal.json needs its metadata updated.
182
+ Read the file, update the "profile" block with:
183
+ - name: {developer name}
184
+ - handle: {github handle}
185
+ - bio: {one-liner about their coding identity, synthesized from the DNA entries}
186
+ Then write the file back.
136
187
 
137
- Required: `rule`, `source`. Optional: `reason`, `category`, `applies_to`, `not_for`.
188
+ ## DNA entries
138
189
 
139
- 1. [entry]
140
- 2. [entry]
190
+ Use `record_instruction` for each. Pass the EXACT JSON shown — do not modify or simplify the fields.
141
191
 
142
- **Constraints** use `propose_constraint` for each with `scope: "global"` and a slugified `id`:
192
+ 1. {"rule": "...", "reason": "...", "category": "...", "applies_to": [...], "not_for": [...], "source": "explicit"}
193
+ 2. {"rule": "...", "reason": "...", "category": "...", "applies_to": [...], "source": "explicit"}
194
+ ...
143
195
 
196
+ ## Constraints
197
+
198
+ Use `propose_constraint` for each with `scope: "global"` and a slugified `id`:
144
199
  1. [constraint]
145
200
  2. [constraint]
146
201
 
147
- **Decisions** — use `propose_decision` for each with `scope: "global"` and a slugified `id`:
202
+ ## Decisions
148
203
 
204
+ Use `propose_decision` for each with `scope: "global"` and a slugified `id`:
149
205
  1. [decision]
150
206
  2. [decision]
151
207
 
152
208
  Return counts: { dna: N, constraints: N, decisions: N, failed: N }
153
-
154
209
  ```
155
210
 
156
- ## Step 5: Output
211
+ **IMPORTANT:** List every DNA entry as a complete JSON object in the subagent prompt. The subagent just passes them through to `record_instruction` — it does NOT need to think about what fields to include.
212
+
213
+ ## Step 6: Output
157
214
 
158
215
  One line, nothing more:
159
216
 
160
217
  ```
161
-
162
- Symbiote initialized — scanned 350 files, recorded 18 DNA entries, 5 constraints, 3 decisions.
163
-
218
+ Symbiote initialized — scanned 350 files, recorded 48 DNA entries, 5 constraints, 3 decisions.
164
219
  ```
165
220
 
166
221
  Do NOT render tables, lists, or per-entry details.
167
- ```