@proxysoul/soulforge 1.0.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.
package/README.md ADDED
@@ -0,0 +1,805 @@
1
+ <h1 align="center">SoulForge</h1>
2
+
3
+ <p align="center">
4
+ <strong>Graph-Powered Code Intelligence</strong><br/>
5
+ Multi-agent coding with codebase-aware AI — embedded Neovim, 22 themes, terminal-native
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-BSL%201.1-blue.svg" alt="License" /></a>
10
+ <a href="#"><img src="https://img.shields.io/badge/version-1.0.0-brightgreen.svg" alt="Version" /></a>
11
+ <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-strict-blue.svg" alt="TypeScript" /></a>
12
+ <a href="#testing"><img src="https://img.shields.io/badge/tests-2292%20passing-brightgreen.svg" alt="Tests" /></a>
13
+ <a href="https://bun.sh"><img src="https://img.shields.io/badge/runtime-Bun-f472b6.svg" alt="Bun" /></a>
14
+ </p>
15
+
16
+ <p align="center">
17
+ <em>Built by <a href="https://github.com/proxysoul">proxySoul</a></em>
18
+ </p>
19
+
20
+ ---
21
+
22
+ ## Table of Contents
23
+
24
+ - [What is SoulForge?](#what-is-soulforge)
25
+ - [Highlights](#highlights)
26
+ - [Architecture](#architecture)
27
+ - [Installation](#installation)
28
+ - [Usage](#usage)
29
+ - [CLI Flags](#cli-flags)
30
+ - [Keyboard Shortcuts](#keyboard-shortcuts)
31
+ - [Slash Commands](#slash-commands)
32
+ - [Forge Modes](#forge-modes)
33
+ - [Tool Suite](#tool-suite)
34
+ - [LLM Providers](#llm-providers)
35
+ - [Custom Providers](#custom-providers)
36
+ - [Task Router](#task-router)
37
+ - [Repo Map](#repo-map)
38
+ - [Context Management](#context-management)
39
+ - [Project Toolchain Detection](#project-toolchain-detection)
40
+ - [Project Instructions](#project-instructions)
41
+ - [Configuration](#configuration)
42
+ - [Testing](#testing)
43
+ - [Documentation](#documentation)
44
+ - [Roadmap](#roadmap)
45
+ - [Inspirations](#inspirations)
46
+ - [License](#license)
47
+
48
+ ---
49
+
50
+ ## What is SoulForge?
51
+
52
+ Your real Neovim — config, plugins, LSP — embedded in an AI agent that understands your codebase structurally. Graph-powered intelligence, multi-agent dispatch, 10 providers. Works over SSH.
53
+
54
+ <p align="center">
55
+ <img src="assets/dark-forge.png" alt="SoulForge — Graph-Powered Code Intelligence" width="900" />
56
+ </p>
57
+
58
+ ### How it compares
59
+
60
+ | | SoulForge | Claude Code | Copilot CLI | Codex CLI | Aider |
61
+ |---|---|---|---|---|---|
62
+ | **Editor** | Embedded Neovim (LazyVim, your config) | No editor | No editor | No editor | No editor |
63
+ | **Code graph** | SQLite graph — PageRank, blast radius, cochange, clone detection, FTS5 search, unused export detection, file profiles, identifier frequency | None (file reads + grep) | None | None (MCP plugins available) | Tree-sitter repo map + PageRank |
64
+ | **Code intelligence** | 4-tier fallback: LSP → ts-morph → tree-sitter → regex. Dual LSP (Neovim bridge + standalone). 30 languages | LSP via plugin marketplace (rename supported, no auto-install, no fallback chain) | LSP (VS Code engines) | MCP-based LSP via plugins | Tree-sitter AST |
65
+ | **Compound tools** | `rename_symbol`, `move_symbol`, `refactor` — compiler-guaranteed, atomic, cross-file | Rename via LSP | — | -- | — |
66
+ | **Semantic context** | AST summaries for top 500 symbols, dispatch auto-enrichment with symbol line ranges | — | — | -- | Tree-sitter tag summaries |
67
+ | **Multi-agent** | Parallel dispatch (8 agents, 3 concurrent, shared file cache, edit ownership) | Subagents + Agent Teams | Subagents + Fleet | Multi-agent v2 + subagents | Single agent |
68
+ | **Providers** | 10 (LLM Gateway, Anthropic, OpenAI, Google, xAI, Ollama, +4) | Anthropic models (API, Bedrock, Vertex) | Multi-model (Anthropic, OpenAI, Google) | OpenAI models | 100+ LLMs |
69
+ | **Task routing** | Per-task model assignment (plan, code, explore, search, trivial, cleanup, compact) | Single model | Single model | Per-agent model assignment | Single model |
70
+ | **Cost visibility** | Per task, per agent, per model | `/cost` per session | Request counts | Server-side tracking | Per message |
71
+ | **Context management** | 2-layer: per-step pruning + V1 (LLM summary) / V2 (deterministic extraction) compaction | Auto-compaction | Context window management | Server-side compaction | — |
72
+ | **MCP** | Roadmap | Yes | Yes | Yes | No |
73
+ | **License** | BSL 1.1 (source-available) | Proprietary | Proprietary | Apache 2.0 | Apache 2.0 |
74
+
75
+ > *Competitor features verified as of March 29, 2026. This landscape moves fast — [let us know](https://github.com/ProxySoul/soulforge/issues) if something's changed.*
76
+
77
+ ---
78
+
79
+ ## Highlights
80
+
81
+ <table>
82
+ <tr>
83
+ <td width="50%">
84
+
85
+ ### Embedded Neovim + LazyVim
86
+ Your actual Neovim — LazyVim distribution with 30+ plugins, LSP servers auto-installed via Mason, Catppuccin theme, noice, lualine, treesitter highlighting. The AI reads, navigates, and edits through the same editor you use. Your config, your muscle memory.
87
+
88
+ </td>
89
+ <td width="50%">
90
+
91
+ ### Multi-Agent Dispatch
92
+ Parallelize work across explore, code, and web search agents. Shared file cache prevents redundant reads. Edit coordination prevents conflicts. Up to 8 agents, 3 concurrent slots. [Deep dive →](docs/agent-bus.md)
93
+
94
+ </td>
95
+ </tr>
96
+ <tr>
97
+ <td>
98
+
99
+ ### Graph-Powered Repo Map
100
+ SQLite-backed codebase graph with PageRank ranking, cochange analysis, blast radius estimation, and clone detection. The agent understands which files matter, what changes together, and how far edits ripple — before reading a single line. [Deep dive →](docs/repo-map.md)
101
+
102
+ </td>
103
+ <td>
104
+
105
+ ### 4-Tier Code Intelligence
106
+ LSP → ts-morph → tree-sitter → regex fallback chain. 30 languages with convention-based visibility detection. Dual LSP backend: bridges to Neovim's LSP when the editor is open, spawns standalone servers when it's not. [Deep dive →](docs/architecture.md)
107
+
108
+ </td>
109
+ </tr>
110
+ <tr>
111
+ <td>
112
+
113
+ ### Compound Tools
114
+ `rename_symbol`, `move_symbol`, `refactor`, `project` do the complete job in one call. Compiler-guaranteed renames. Atomic moves with import updates across all importers. [Deep dive →](docs/compound-tools.md)
115
+
116
+ </td>
117
+ <td>
118
+
119
+ ### Task Router + Cost Transparency
120
+ Assign models per task: Opus for planning, Sonnet for coding, Haiku for search. Token usage visible per task, per agent, per model — you see exactly what you're spending and the router optimizes it automatically.
121
+
122
+ </td>
123
+ </tr>
124
+ <tr>
125
+ <td>
126
+
127
+ ### Context Management
128
+ Two-layer compaction keeps long sessions productive: rolling tool-result pruning per step, plus V1 (LLM summary) or V2 (deterministic extraction) compaction on threshold. [Deep dive →](docs/compaction.md)
129
+
130
+ </td>
131
+ <td>
132
+
133
+ ### User Steering
134
+ Type messages while the agent is working — they queue up and inject into the next agent step. Steer without interrupting. Abort cleanly with Ctrl+X. [Deep dive →](docs/steering.md)
135
+
136
+ </td>
137
+ </tr>
138
+ <tr>
139
+ <td>
140
+
141
+ ### 10 Providers, Any Model
142
+ LLM Gateway, Anthropic, OpenAI, Google, xAI, Ollama (local), OpenRouter, Vercel AI Gateway, Proxy, and custom OpenAI-compatible APIs. You own the API keys. No vendor lock-in. [Deep dive →](docs/provider-options.md)
143
+
144
+ </td>
145
+ <td>
146
+
147
+ ### Cross-Tab Coordination
148
+ Up to 5 concurrent tabs with per-tab model selection and advisory file claims. Run Opus in one tab for complex architecture, Haiku in another for quick searches. Agents see what other tabs are editing, get warnings on contested files, and git operations are blocked during active dispatch. [Deep dive →](docs/cross-tab-coordination.md)
149
+
150
+ </td>
151
+ </tr>
152
+ <tr>
153
+ <td>
154
+
155
+ ### Project Toolchain
156
+ Auto-detects lint, typecheck, test, and build commands across 23 ecosystems from config files. Pre-commit gate blocks `git commit` on lint/type errors. Monorepo package discovery. [Deep dive →](docs/project-tool.md)
157
+
158
+ </td>
159
+ <td>
160
+
161
+ ### Skills & Approval Gates
162
+ Installable skill system for domain-specific capabilities. Destructive action approval — `rm -rf`, `git push --force`, sensitive file edits individually prompted. Auto mode for full autonomy when you want it.
163
+
164
+ </td>
165
+ </tr>
166
+ </table>
167
+
168
+ ---
169
+
170
+ ## Architecture
171
+
172
+ The Forge Agent is the orchestrator. It holds 34 tools including the `dispatch` tool, which creates an AgentBus and launches parallel subagents. Subagents share file/tool caches through the bus and coordinate edits via ownership tracking.
173
+
174
+ ```mermaid
175
+ graph TB
176
+ User([User Input]) --> Chat[useChat Hook]
177
+ Chat --> Forge[Forge Agent]
178
+
179
+ subgraph Forge Tools
180
+ Tools[34 Direct Tools]
181
+ Dispatch[dispatch tool]
182
+ end
183
+
184
+ Forge --> Tools
185
+ Forge --> Dispatch
186
+
187
+ Dispatch --> |creates| Bus[AgentBus<br/>file cache · tool cache<br/>findings · edit ownership]
188
+
189
+ Bus --> |spawns with bus| E1[Explore Agent]
190
+ Bus --> |spawns with bus| E2[Explore Agent]
191
+ Bus --> |spawns with bus| C[Code Agent]
192
+
193
+ E1 & E2 & C --> |read/write cache| Bus
194
+
195
+ Tools --> Intel[Intelligence Router]
196
+ Tools --> Nvim[Neovim<br/>msgpack-RPC]
197
+ Tools --> RepoMap[(Repo Map<br/>SQLite · PageRank)]
198
+ Tools --> Mem[(Memory<br/>SQLite · FTS5)]
199
+
200
+ Intel --> LSP[LSP]
201
+ Intel --> TSM[ts-morph]
202
+ Intel --> TS[tree-sitter]
203
+ Intel --> Regex[regex]
204
+
205
+ style Forge fill:#9B30FF,color:#fff
206
+ style Bus fill:#336,color:#fff
207
+ style Dispatch fill:#663,color:#fff
208
+ style RepoMap fill:#1a3,color:#fff
209
+ style Mem fill:#1a3,color:#fff
210
+ style Nvim fill:#57A143,color:#fff
211
+ ```
212
+
213
+ ### Intelligence Fallback Chain
214
+
215
+ Queries route through backends by tier. Each backend reports what it supports; the router picks the highest-tier backend available for the operation.
216
+
217
+ ```mermaid
218
+ graph LR
219
+ Query([Symbol Query]) --> LSP{LSP<br/>available?}
220
+ LSP -->|yes| LSPResult[Precise<br/>types · refs · diagnostics]
221
+ LSP -->|no| TSMorph{ts-morph<br/>available?}
222
+ TSMorph -->|yes| TSMResult[AST<br/>signatures · exports]
223
+ TSMorph -->|no| TreeSitter{tree-sitter<br/>grammar?}
224
+ TreeSitter -->|yes| TSResult[Structural<br/>outlines · imports]
225
+ TreeSitter -->|no| RegexResult[Best-effort<br/>pattern matching]
226
+
227
+ style LSPResult fill:#4a7,color:#fff
228
+ style TSMResult fill:#47a,color:#fff
229
+ style TSResult fill:#a74,color:#fff
230
+ style RegexResult fill:#a47,color:#fff
231
+ ```
232
+
233
+ ### Multi-Agent Dispatch
234
+
235
+ Up to 8 agents run concurrently (3 parallel slots) with staggered starts. All agents share a file cache through AgentBus — when one agent reads a file, others get it for free. Agents with `dependsOn` wait for their dependencies before starting.
236
+
237
+ ```mermaid
238
+ sequenceDiagram
239
+ participant U as User
240
+ participant F as Forge Agent
241
+ participant D as dispatch tool
242
+ participant B as AgentBus
243
+ participant E1 as Explore 1
244
+ participant E2 as Explore 2
245
+ participant C as Code Agent
246
+
247
+ U->>F: "Audit auth and refactor middleware"
248
+ F->>D: dispatch(3 tasks)
249
+ D->>B: new AgentBus()
250
+ par Concurrent (3 slots, staggered)
251
+ D->>E1: launch (t=0ms)
252
+ D->>E2: launch (t=150ms)
253
+ D->>C: launch (dependsOn: E1, E2)
254
+ end
255
+ E1->>B: cache file reads + findings
256
+ E2->>B: cache file reads + findings
257
+ Note over B: Code agent reads<br/>hit cache instantly
258
+ B-->>C: dependencies resolved
259
+ C->>C: Edit with full context
260
+ C->>B: done (edits applied)
261
+ D->>F: All agents complete → merged result
262
+ ```
263
+
264
+ ---
265
+
266
+ ## Installation
267
+
268
+ Pick the method that fits your workflow. SoulForge checks for prerequisites on first launch and offers to install Neovim and Nerd Fonts if missing.
269
+
270
+ ### Prebuilt Binary (recommended)
271
+
272
+ Download the latest release for your platform from [GitHub Releases](https://github.com/ProxySoul/soulforge/releases/latest), extract, and run the installer:
273
+
274
+ ```bash
275
+ tar xzf soulforge-*.tar.gz
276
+ cd soulforge-*/
277
+ ./install.sh
278
+ ```
279
+
280
+ The installer places everything in `~/.soulforge/` and adds it to your PATH. Then run `soulforge` (or `sf`).
281
+
282
+ <details>
283
+ <summary><strong>Homebrew</strong></summary>
284
+
285
+ ```bash
286
+ brew tap proxysoul/tap
287
+ brew install soulforge
288
+ ```
289
+
290
+ </details>
291
+
292
+ <details>
293
+ <summary><strong>npm / Bun</strong></summary>
294
+
295
+ Requires [Bun](https://bun.sh) >= 1.0 as the runtime.
296
+
297
+ ```bash
298
+ bun install -g @proxysoul/soulforge
299
+ # or: npm install -g @proxysoul/soulforge
300
+
301
+ soulforge # or: sf
302
+ ```
303
+
304
+ </details>
305
+
306
+ <details>
307
+ <summary><strong>Self-contained bundle (includes Neovim, ripgrep, fd, lazygit)</strong></summary>
308
+
309
+ The bundle ships everything — Neovim 0.11, ripgrep, fd, lazygit, tree-sitter grammars, Nerd Font symbols, and a local LLM proxy. No system dependencies required. Build it from source:
310
+
311
+ ```bash
312
+ git clone https://github.com/ProxySoul/soulforge.git
313
+ cd soulforge
314
+ bun install
315
+
316
+ # Build bundle (macOS ARM64 by default)
317
+ ./scripts/bundle.sh # → dist/bundle/soulforge-1.0.0-darwin-arm64/
318
+ ./scripts/bundle.sh x64 # Intel Mac
319
+ ./scripts/bundle.sh x64 linux # Linux x64
320
+ ./scripts/bundle.sh arm64 linux # Linux ARM64
321
+
322
+ # Install
323
+ cd dist/bundle/soulforge-*/
324
+ ./install.sh # installs to ~/.soulforge, adds to PATH
325
+
326
+ # Uninstall
327
+ ~/.soulforge/uninstall.sh
328
+ ```
329
+
330
+ </details>
331
+
332
+ <details>
333
+ <summary><strong>Build from source</strong></summary>
334
+
335
+ Requires [Bun](https://bun.sh) >= 1.0 and [Neovim](https://neovim.io) >= 0.11.
336
+
337
+ ```bash
338
+ git clone https://github.com/ProxySoul/soulforge.git
339
+ cd soulforge
340
+ bun install
341
+
342
+ # Run in development mode
343
+ bun run dev
344
+
345
+ # Or build and link globally
346
+ bun run build
347
+ bun link
348
+ soulforge
349
+ ```
350
+
351
+ </details>
352
+
353
+ ### Quick start
354
+
355
+ ```bash
356
+ soulforge # Launch — select a model with Ctrl+L
357
+ soulforge --set-key anthropic sk-ant-... # Or save a key first
358
+ soulforge --list-providers # Check which providers are ready
359
+ ```
360
+
361
+ See [GETTING_STARTED.md](GETTING_STARTED.md) for a full walkthrough — first launch, model setup, editor configuration, and tips.
362
+
363
+ ---
364
+
365
+ ## Usage
366
+
367
+ ### CLI Flags
368
+
369
+ ```bash
370
+ soulforge # Launch TUI
371
+ soulforge --session <id> # Resume a saved session
372
+ soulforge --headless "your prompt here" # Stream to stdout
373
+ soulforge --headless --json "prompt" # Structured JSON
374
+ soulforge --headless --events "prompt" # JSONL event stream
375
+ soulforge --headless --model provider/model # Override model
376
+ soulforge --headless --mode architect # Read-only analysis
377
+ soulforge --headless --system "role" "prompt"# Inject system prompt
378
+ soulforge --headless --include file.ts # Pre-load files
379
+ soulforge --headless --session <id> "prompt" # Resume session
380
+ soulforge --headless --save-session "prompt" # Save for later
381
+ soulforge --headless --max-steps 10 # Limit steps
382
+ soulforge --headless --timeout 60000 # Abort after 60s
383
+ soulforge --headless --no-repomap "prompt" # Skip repo map
384
+ soulforge --headless --diff "fix the bug" # Show changed files
385
+ soulforge --headless --no-render "prompt" # Raw output (no ANSI styling)
386
+ soulforge --headless --chat # Interactive multi-turn chat
387
+ soulforge --headless --chat --events # Chat with JSONL events
388
+ echo "prompt" | soulforge --headless # Pipe from stdin
389
+ soulforge --list-providers # Provider status
390
+ soulforge --list-models [provider] # Available models
391
+ soulforge --set-key <provider> <key> # Save API key
392
+ soulforge --version # Version info
393
+ ```
394
+
395
+ [Headless mode deep dive →](docs/headless.md)
396
+
397
+ ### Keyboard Shortcuts
398
+
399
+ | Key | Action |
400
+ |-----|--------|
401
+ | `Ctrl+L` | Select LLM model |
402
+ | `Ctrl+E` | Toggle editor panel |
403
+ | `Ctrl+G` | Git menu |
404
+ | `Ctrl+S` | Skills browser |
405
+ | `Ctrl+K` | Command picker |
406
+ | `Ctrl+T` | New tab |
407
+ | `Ctrl+W` | Close tab |
408
+ | `Ctrl+X` | Abort current generation |
409
+ | `Tab` | Switch tabs |
410
+ | `Escape` | Toggle chat/editor focus |
411
+
412
+ ### Slash Commands
413
+
414
+ 85 commands available — press `/` or `Ctrl+K` to browse. Key ones by category:
415
+
416
+ **Models & Providers**
417
+ `/model` `/router` `/provider` `/model-scope`
418
+
419
+ **Agent & Modes**
420
+ `/mode` `/plan` `/agent-features` `/reasoning`
421
+
422
+ **Editor & Display**
423
+ `/editor` `/split` `/diff-style` `/chat-style` `/vim-hints` `/open <file>`
424
+
425
+ **Git** (all under `/git`)
426
+ `/git` `/git commit` `/git push` `/git pull` `/git branch` `/git log` `/git diff` `/git stash` `/git lazygit` `/git co-author`
427
+
428
+ **Intelligence & LSP**
429
+ `/lsp` `/lsp-install` `/lsp-restart` `/diagnose` `/repo-map` `/web-search` `/keys`
430
+
431
+ **Context & Memory**
432
+ `/compact` `/context` `/memory` `/compaction` `/instructions`
433
+
434
+ **Sessions & Tabs**
435
+ `/sessions` `/tab` `/tab new` `/tab close` `/tab rename` `/claim`
436
+
437
+ **Files & Changes**
438
+ `/changes` `/files` `/open <file>`
439
+
440
+ **System**
441
+ `/setup` `/skills` `/privacy` `/storage` `/errors` `/status` `/proxy`
442
+
443
+ [Full command reference →](docs/commands-reference.md)
444
+
445
+ ### Forge Modes
446
+
447
+ | Mode | Description |
448
+ |------|-------------|
449
+ | **default** | Full agent — reads and writes code |
450
+ | **auto** | Full tool access, executes immediately, minimal questions |
451
+ | **architect** | Read-only design and architecture |
452
+ | **socratic** | Questions first, then suggestions |
453
+ | **challenge** | Adversarial review, finds flaws |
454
+ | **plan** | Research → structured plan → execute |
455
+
456
+ ---
457
+
458
+ ## Tool Suite
459
+
460
+ SoulForge ships 34 tools organized by capability:
461
+
462
+ ### Code Intelligence
463
+
464
+ | Tool | What it does |
465
+ |------|-------------|
466
+ | `read_code` | Extract function/class/type by name (LSP-powered) |
467
+ | `navigate` | Definition, references, call hierarchy, implementations |
468
+ | `analyze` | File diagnostics, unused symbols, complexity |
469
+ | `rename_symbol` | Compiler-guaranteed rename across all files |
470
+ | `move_symbol` | Move to another file + update all importers |
471
+ | `refactor` | Extract function/variable, organize imports |
472
+
473
+ ### Codebase Analysis (zero LLM cost)
474
+
475
+ | Tool | What it does |
476
+ |------|-------------|
477
+ | `soul_grep` | Count-mode ripgrep with repo map intercept |
478
+ | `soul_find` | Fuzzy file/symbol search, PageRank-ranked, signatures included |
479
+ | `soul_analyze` | Identifier frequency, unused exports, file profiles, top files by PageRank, external package usage, symbol lookup by kind/name with signatures |
480
+ | `soul_impact` | Dependency graph — dependents, cochanges, blast radius |
481
+
482
+ ### Project Management
483
+
484
+ | Tool | What it does |
485
+ |------|-------------|
486
+ | `project` | Auto-detected lint, format, test, build, typecheck across [23 ecosystems](#project-toolchain-detection) |
487
+ | `project(list)` | Discover monorepo packages with per-package capabilities |
488
+ | `dispatch` | Parallel multi-agent execution (up to 8 agents, 3 concurrent) |
489
+ | `git` | Structured git operations with auto co-author tracking |
490
+
491
+ <details>
492
+ <summary><strong>All tools</strong></summary>
493
+
494
+ **Read/Write:** `read_file` (with `target` param for symbol extraction), `edit_file` (also handles create/write), `multi_edit`, `undo_edit`, `list_dir`, `glob`, `grep`
495
+
496
+ **Shell:** `shell` (with pre-commit lint gate, co-author injection, project tool redirect)
497
+
498
+ **Memory:** `memory` (actions: write, search, list, delete)
499
+
500
+ **Agent:** `dispatch`, `web_search`, `fetch_page`
501
+
502
+ **Editor:** `editor` (Neovim integration — read, edit, navigate, diagnostics, format)
503
+
504
+ **Planning:** `plan`, `update_plan_step`, `task_list`, `ask_user`
505
+
506
+ </details>
507
+
508
+ ---
509
+
510
+ ## LLM Providers
511
+
512
+ | Provider | Models | Setup |
513
+ |----------|--------|-------|
514
+ | [**LLM Gateway**](https://llmgateway.io) | Multi-model gateway (OpenAI, Claude, Gemini, DeepSeek) | `LLM_GATEWAY_API_KEY` |
515
+ | [**Anthropic**](https://console.anthropic.com/) | Claude 4.6 Opus/Sonnet, Haiku 4.5 | `ANTHROPIC_API_KEY` |
516
+ | [**OpenAI**](https://platform.openai.com/) | GPT-4.5, o3, o4-mini | `OPENAI_API_KEY` |
517
+ | [**Google**](https://aistudio.google.com/) | Gemini 2.5 Pro/Flash | `GOOGLE_GENERATIVE_AI_API_KEY` |
518
+ | [**xAI**](https://console.x.ai/) | Grok 3 | `XAI_API_KEY` |
519
+ | [**Ollama**](https://ollama.ai) | Any local model | Auto-detected |
520
+ | [**OpenRouter**](https://openrouter.ai) | 200+ models | `OPENROUTER_API_KEY` |
521
+ | [**Vercel AI Gateway**](https://vercel.com/ai-gateway) | Unified gateway for 15+ providers with caching, fallbacks, rate limiting | `AI_GATEWAY_API_KEY` |
522
+ | [**Proxy**](https://github.com/router-for-me/CLIProxyAPI) | Local proxy with auto-lifecycle management — starts/stops with SoulForge | `PROXY_API_KEY` |
523
+ | **Custom** | Any OpenAI-compatible API — add via config | Any env var |
524
+
525
+ ### Custom Providers
526
+
527
+ Add any OpenAI-compatible API as a provider — no code changes needed:
528
+
529
+ ```json
530
+ // ~/.soulforge/config.json (global) or .soulforge/config.json (project)
531
+ {
532
+ "providers": [
533
+ {
534
+ "id": "deepseek",
535
+ "name": "DeepSeek",
536
+ "baseURL": "https://api.deepseek.com/v1",
537
+ "envVar": "DEEPSEEK_API_KEY",
538
+ "models": ["deepseek-chat", "deepseek-coder"],
539
+ "modelsAPI": "https://api.deepseek.com/v1/models"
540
+ }
541
+ ]
542
+ }
543
+ ```
544
+
545
+ Then use `deepseek/deepseek-chat` as a model ID anywhere — TUI model picker, headless `--model`, task router slots. Custom providers show `[custom]` in listings. If a custom `id` conflicts with a built-in, it auto-renames to `{id}-custom`.
546
+
547
+ [Custom providers reference →](docs/headless.md#custom-providers)
548
+
549
+ ### Task Router
550
+
551
+ Assign different models to different jobs. Configure via `/router`:
552
+
553
+ | Slot | Default | Purpose |
554
+ |------|---------|---------|
555
+ | Planning | Sonnet | Architecture, design decisions |
556
+ | Coding | Opus | Implementation, bug fixes |
557
+ | Exploration | Opus | Research, code reading |
558
+ | Web Search | Haiku | Search queries |
559
+ | Trivial | Haiku | Small, simple tasks (auto-detected) |
560
+ | De-sloppify | Haiku | Post-implementation cleanup pass |
561
+ | Compact | Haiku | Context compaction summaries |
562
+
563
+ ---
564
+
565
+ ## Repo Map
566
+
567
+ SQLite-backed graph of your entire codebase, updated in real-time as files are edited.
568
+
569
+ ```mermaid
570
+ graph LR
571
+ Scan[File Scanner<br/>watches edits] --> Parse[tree-sitter<br/>30 languages]
572
+ Parse --> Symbols[(Symbols<br/>name · kind · line · exports)]
573
+ Parse --> Refs[(References<br/>cross-file imports)]
574
+ Refs --> Graph[Dependency Graph]
575
+ Graph --> PR[PageRank]
576
+ Graph --> CC[Cochange<br/>git log analysis]
577
+ Graph --> BR[Blast Radius]
578
+ Symbols --> FTS[FTS5 Search]
579
+ Symbols --> Clones[Clone Detection<br/>minhash signatures]
580
+
581
+ style Symbols fill:#1a3,color:#fff
582
+ style Refs fill:#1a3,color:#fff
583
+ style PR fill:#47a,color:#fff
584
+ style CC fill:#47a,color:#fff
585
+ style BR fill:#47a,color:#fff
586
+ ```
587
+
588
+ **Powers:** `soul_find` (PageRank-ranked search with signatures), `soul_grep` (zero-cost identifier counts), `soul_analyze` (unused exports with dead code vs unnecessary export classification, file profiles, top files, external packages, symbol-by-kind queries with signatures), `soul_impact` (blast radius, dependency chains), dispatch enrichment (auto-injects symbol line ranges), AST semantic summaries (docstrings for top 500 symbols).
589
+
590
+ **Language support:** Convention-based visibility detection for 30 languages. Export inference via Go capitalization, Rust/Zig `pub`, Python/Dart underscore convention, Java/Kotlin/Swift/C#/Scala not-private, PHP, Elixir `def`/`defp`, C/C++/ObjC header files, Solidity, and more. Identifier extraction patterns cover camelCase, PascalCase, snake_case, and hyphenated (Elisp) naming conventions across all supported languages.
591
+
592
+ **Monorepo support:** Partial. The repo map indexes files within the working directory. Cross-package dependencies within a monorepo are not yet tracked — each package is treated as an independent unit. The `project` tool handles monorepo workspace discovery separately.
593
+
594
+ [Full reference →](docs/repo-map.md)
595
+
596
+ ---
597
+
598
+ ## Context Management
599
+
600
+ ```mermaid
601
+ graph TB
602
+ subgraph "Per-Step — every API call"
603
+ Pruning[Tool Result Pruning<br/>last 4 full · older → summaries]
604
+ end
605
+
606
+ subgraph "On Threshold — auto-triggered"
607
+ V1[V1 Compaction<br/>LLM summarization]
608
+ V2[V2 Compaction<br/>deterministic extraction<br/>+ 2k token gap-fill]
609
+ end
610
+
611
+ subgraph "Always Active"
612
+ Steering[User Steering<br/>queue + inject mid-stream]
613
+ Sessions[Session Save<br/>incremental · crash-resilient]
614
+ PreCommit[Pre-Commit Gate<br/>lint + typecheck before commit]
615
+ end
616
+
617
+ style Pruning fill:#47a,color:#fff
618
+ style V1 fill:#a74,color:#fff
619
+ style V2 fill:#4a7,color:#fff
620
+ style PreCommit fill:#a47,color:#fff
621
+ ```
622
+
623
+ - **Tool result pruning** — older tool results become one-line summaries enriched with repo map symbols
624
+ - **V1 compaction** — full LLM summarization when context exceeds threshold
625
+ - **V2 compaction** — deterministic state extraction from tool calls, cheap LLM gap-fill
626
+ - **User steering** — type while the agent works, messages inject at the next step
627
+ - **Pre-commit gate** — auto-runs native lint + typecheck before allowing `git commit`
628
+
629
+ [Compaction deep dive →](docs/compaction.md) · [Steering deep dive →](docs/steering.md)
630
+
631
+ ---
632
+
633
+ ## Project Toolchain Detection
634
+
635
+ The `project` tool auto-detects your toolchain from config files — no setup required:
636
+
637
+ | Ecosystem | Lint | Typecheck | Test | Build |
638
+ |-----------|------|-----------|------|-------|
639
+ | **JS/TS (Bun)** | biome / oxlint / eslint | tsc | bun test | bun run build |
640
+ | **JS/TS (Node)** | biome / oxlint / eslint | tsc | npm test | npm run build |
641
+ | **Deno** | deno lint | deno check | deno test | — |
642
+ | **Rust** | cargo clippy | cargo check | cargo test | cargo build |
643
+ | **Go** | golangci-lint / go vet | go build | go test | go build |
644
+ | **Python** | ruff / flake8 | pyright / mypy | pytest | — |
645
+ | **PHP** | phpstan / psalm | phpstan / psalm | phpunit | — |
646
+ | **Ruby** | rubocop | — | rspec / rails test | — |
647
+ | **Swift** | swiftlint | swift build | swift test | swift build |
648
+ | **Elixir** | credo | dialyzer | mix test | mix compile |
649
+ | **Java/Kotlin** | gradle check | javac / kotlinc | gradle test | gradle build |
650
+ | **C/C++** | clang-tidy | cmake build | ctest | cmake build |
651
+ | **Dart/Flutter** | dart analyze | dart analyze | flutter test | flutter build |
652
+ | **Zig** | — | zig build | zig build test | zig build |
653
+ | **Haskell** | hlint | stack build | stack test | stack build |
654
+ | **Scala** | — | sbt compile | sbt test | sbt compile |
655
+ | **.NET/C#** | dotnet format | dotnet build | dotnet test | dotnet build |
656
+ | **iOS/Xcode** | swiftlint | xcodebuild build | xcodebuild test | xcodebuild build |
657
+ | **Java (Maven)** | checkstyle | mvn compile | mvn test | mvn package |
658
+ | **C/C++ (Make)** | — | — | make test | make |
659
+ | **Clojure** | clj-kondo | — | lein test / clj -M:test | lein uberjar |
660
+
661
+ **Monorepo support:** `project(action: "list")` discovers workspace packages across pnpm, npm/yarn, Cargo, and Go workspaces.
662
+
663
+ [Full reference →](docs/project-tool.md)
664
+
665
+ ---
666
+
667
+ ## Project Instructions
668
+
669
+ SoulForge loads `SOULFORGE.md` from your project root as project-specific instructions — conventions, architecture notes, toolchain preferences — injected into every prompt.
670
+
671
+ You can also load instruction files from other AI tools to reduce friction when migrating or working across tools:
672
+
673
+ | File | Source | Default |
674
+ |------|--------|---------|
675
+ | `SOULFORGE.md` | SoulForge | **on** |
676
+ | `CLAUDE.md` | Claude Code | off |
677
+ | `.cursorrules` | Cursor | off |
678
+ | `.github/copilot-instructions.md` | GitHub Copilot | off |
679
+ | `.clinerules` | Cline | off |
680
+ | `.windsurfrules` | Windsurf | off |
681
+ | `.aider.conf.yml` | Aider | off |
682
+ | `AGENTS.md` | OpenAI Codex | off |
683
+ | `.opencode/instructions.md` | OpenCode | off |
684
+ | `AMPLIFY.md` | Amp | off |
685
+
686
+ Toggle via `/instructions` in the TUI or set `"instructionFiles"` in config:
687
+
688
+ ```json
689
+ { "instructionFiles": ["soulforge", "claude", "cursorrules"] }
690
+ ```
691
+
692
+ ---
693
+
694
+ ## Configuration
695
+
696
+ Layered config: global (`~/.soulforge/config.json`) + project (`.soulforge/config.json`).
697
+
698
+ ```json
699
+ {
700
+ "defaultModel": "anthropic/claude-sonnet-4-6",
701
+ "thinking": { "mode": "adaptive" },
702
+ "repoMap": true,
703
+ "semanticSummaries": "ast",
704
+ "diffStyle": "default",
705
+ "chatStyle": "accent",
706
+ "vimHints": true,
707
+ "providers": [
708
+ {
709
+ "id": "deepseek",
710
+ "name": "DeepSeek",
711
+ "baseURL": "https://api.deepseek.com/v1",
712
+ "envVar": "DEEPSEEK_API_KEY",
713
+ "models": ["deepseek-chat", "deepseek-coder"]
714
+ }
715
+ ]
716
+ }
717
+ ```
718
+
719
+ See [GETTING_STARTED.md](GETTING_STARTED.md) for the full reference.
720
+
721
+ ---
722
+
723
+ ## Testing
724
+
725
+ ```bash
726
+ bun test # 2292 tests across 49 files
727
+ bun run typecheck # tsc --noEmit
728
+ bun run lint # biome check (lint + format)
729
+ bun run lint:fix # auto-fix
730
+ ```
731
+
732
+ ---
733
+
734
+ ## Documentation
735
+
736
+ | Document | Description |
737
+ |----------|-------------|
738
+ | **[Command Reference](docs/commands-reference.md)** | All 85 commands by category |
739
+ | **[Headless Mode](docs/headless.md)** | Non-interactive CLI for CI/CD, scripting, automation |
740
+ | **[Architecture](docs/architecture.md)** | System overview, data flow, component lifecycle |
741
+ | **[Repo Map](docs/repo-map.md)** | PageRank, cochange, blast radius, clone detection |
742
+ | **[Agent Bus](docs/agent-bus.md)** | Multi-agent coordination, shared cache, edit ownership |
743
+ | **[Compound Tools](docs/compound-tools.md)** | rename_symbol, move_symbol, refactor internals |
744
+ | **[Compaction](docs/compaction.md)** | V1/V2 context management strategies |
745
+ | **[Project Tool](docs/project-tool.md)** | Toolchain detection, pre-commit checks, monorepo discovery |
746
+ | **[Steering](docs/steering.md)** | Mid-stream user input injection |
747
+ | **[Provider Options](docs/provider-options.md)** | Thinking modes, context management, degradation |
748
+ | **[Prompt System](docs/prompt-system.md)** | Per-family prompts, Soul Map injection, mode overlays |
749
+ | [Getting Started](GETTING_STARTED.md) | Installation, configuration, first steps |
750
+ | [Contributing](CONTRIBUTING.md) | Dev setup, project structure, PR guidelines |
751
+ | [Security](SECURITY.md) | Security policy, forbidden file management, responsible disclosure |
752
+
753
+ ---
754
+
755
+ ## Roadmap
756
+
757
+ **SoulForge beyond the TUI** — the intelligence layer is being extracted into reusable packages:
758
+
759
+ ```
760
+ @soulforge/intelligence Core library — repo map, tools, agent loop
761
+
762
+ @soulforge/mcp MCP server — plug into Claude Code, Cursor, Copilot
763
+
764
+ sf --headless CLI mode — CI/CD, scripts, automation ✓ shipped
765
+
766
+ SoulForge TUI Full experience (what you're looking at now)
767
+ ```
768
+
769
+ - **`@soulforge/intelligence`** — graph intelligence, 34 tools, and agent orchestration as an importable package. Build your own AI tools on top of SoulForge's brain.
770
+ - **`@soulforge/mcp`** — expose soul_grep, soul_find, soul_analyze, soul_impact, navigate, read_code as MCP tools. Any AI tool that supports MCP gets SoulForge's graph intelligence.
771
+ - **`sf --headless`** — non-interactive mode. Pipe in a prompt, get back results. For CI/CD, automation, and benchmarks. [Documentation →](docs/headless.md)
772
+
773
+ **In progress:**
774
+ - **MCP support** — consume external MCP servers from within SoulForge + expose tools as an MCP server
775
+ - **Repo Map visualization** — interactive dependency graph, PageRank heatmap, blast radius explorer
776
+ - **GitHub CLI integration** — native `gh_pr`, `gh_issue`, `gh_status` tools with structured output
777
+ - **Dispatch worktrees** — git worktree per code agent for conflict-free parallel edits
778
+ - **[ACP support](https://agentclientprotocol.com/)** — Agent Client Protocol integration. Run SoulForge as a coding agent inside Zed, JetBrains, Neovim (agentic.nvim), or any ACP-compatible editor. Headless mode already covers 80% of the protocol surface — `sf --acp` would expose graph intelligence, multi-agent dispatch, and all 34 tools via JSON-RPC 2.0 over stdio
779
+
780
+ **Planned:**
781
+ - **Monorepo graph support** — cross-package dependency tracking for pnpm/npm/yarn workspaces, Cargo workspaces, Go workspaces (`go.work`), Nx/Turborepo, and Bazel/Buck. Currently the repo map treats each workspace root as an isolated unit — cross-package imports resolve as external dependencies instead of internal edges. This means PageRank, blast radius, and unused export detection don't span package boundaries.
782
+ - **Benchmarks** — side-by-side comparisons: tool calls, edit accuracy, token efficiency on large codebases
783
+ - **Orchestrated workflows** — sequential agent handoffs (planner → TDD → reviewer → security)
784
+
785
+ ---
786
+
787
+ ## Inspirations
788
+
789
+ SoulForge builds on ideas from projects we respect:
790
+
791
+ - **[Aider](https://github.com/Aider-AI/aider)** — tree-sitter repo maps with PageRank for code context. Similar approach to SoulForge's repo map, though SoulForge adds cochange analysis, blast radius, clone detection, and real-time graph updates.
792
+ - **[OpenCode](https://github.com/opencode-ai/opencode)** — per-provider prompt routing. SoulForge's family-specific prompt system takes a similar approach with separate base prompts for Claude, OpenAI, Gemini, and a generic fallback.
793
+ - **[Everything Claude Code (ECC)](https://github.com/affaan-m/everything-claude-code)** — design philosophy: enforce behavior with code, not prompt instructions. Our `targetFiles` schema validation, pre-commit lint gates, confident tool output, and auto-enrichment patterns come from this thinking.
794
+ - **[Vercel AI SDK](https://sdk.vercel.ai)** — the multi-provider abstraction layer that makes 9 providers possible with a single tool loop interface.
795
+ - **[Neovim](https://neovim.io)** — the editor. SoulForge embeds it via msgpack-RPC rather than reimplementing it, because your config and muscle memory shouldn't be a compromise.
796
+
797
+ ---
798
+
799
+ ## License
800
+
801
+ [Business Source License 1.1](LICENSE). Free for personal and internal use. Commercial use requires a [commercial license](COMMERCIAL_LICENSE.md). Converts to Apache 2.0 on March 15, 2030. Third-party licenses in [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
802
+
803
+ <p align="center">
804
+ <sub>Built with care by <a href="https://github.com/proxysoul">proxySoul</a></sub>
805
+ </p>