@neotx/agents 0.1.0-alpha.2 → 0.1.0-alpha.21
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/GUIDE.md +595 -0
- package/README.md +178 -0
- package/SUPERVISOR.md +282 -0
- package/agents/developer.yml +1 -1
- package/agents/reviewer.yml +10 -0
- package/agents/scout.yml +12 -0
- package/package.json +3 -2
- package/prompts/architect.md +49 -88
- package/prompts/developer.md +73 -147
- package/prompts/fixer.md +58 -173
- package/prompts/refiner.md +71 -160
- package/prompts/reviewer.md +142 -0
- package/prompts/scout.md +231 -0
- package/agents/reviewer-coverage.yml +0 -10
- package/agents/reviewer-perf.yml +0 -10
- package/agents/reviewer-quality.yml +0 -10
- package/agents/reviewer-security.yml +0 -10
- package/prompts/reviewer-coverage.md +0 -159
- package/prompts/reviewer-perf.md +0 -141
- package/prompts/reviewer-quality.md +0 -150
- package/prompts/reviewer-security.md +0 -158
- package/workflows/feature.yml +0 -21
- package/workflows/hotfix.yml +0 -5
- package/workflows/refine.yml +0 -6
- package/workflows/review.yml +0 -15
package/GUIDE.md
ADDED
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
# Neo — AI Integration Guide
|
|
2
|
+
|
|
3
|
+
You are reading the neo integration guide. This document explains how an AI agent can use neo to orchestrate autonomous developer agents across git repositories.
|
|
4
|
+
|
|
5
|
+
neo is a framework that wraps the Claude Agent SDK with clone isolation, 3-level recovery, DAG workflows, concurrency control, budget guards, and approval gates. Agents work in isolated git clones — your main branch is never touched.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Two ways to use neo
|
|
10
|
+
|
|
11
|
+
### Mode A: Supervisor (recommended)
|
|
12
|
+
|
|
13
|
+
**This is the recommended way to use neo.** The supervisor is a long-lived autonomous daemon that acts as your CTO. You send it messages in natural language and it handles everything — agent selection, dispatch ordering, review cycles, retries, and memory.
|
|
14
|
+
|
|
15
|
+
The supervisor is NOT a chatbot. It's an event-driven heartbeat loop that:
|
|
16
|
+
- Picks up your messages at the next heartbeat
|
|
17
|
+
- Dispatches the right agents in the right order
|
|
18
|
+
- Monitors progress and reacts to completions/failures
|
|
19
|
+
- Persists memory across sessions — it learns your codebase over time
|
|
20
|
+
- Handles the full lifecycle: refine → architect → develop → review → fix → done
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Start the supervisor (background daemon)
|
|
24
|
+
neo supervise --detach
|
|
25
|
+
|
|
26
|
+
# Send a task — the supervisor handles the rest
|
|
27
|
+
neo supervise --message "Implement user authentication with JWT. Create login/register endpoints, middleware, and tests."
|
|
28
|
+
|
|
29
|
+
# The supervisor autonomously:
|
|
30
|
+
# 1. Analyzes your request
|
|
31
|
+
# 2. Dispatches architect if design is needed
|
|
32
|
+
# 3. Dispatches developer for each task
|
|
33
|
+
# 4. Dispatches reviewer to review PRs
|
|
34
|
+
# 5. Dispatches fixer if issues are found
|
|
35
|
+
# 6. Reports back via activity log
|
|
36
|
+
|
|
37
|
+
# Check supervisor status
|
|
38
|
+
neo supervisor status
|
|
39
|
+
|
|
40
|
+
# View what the supervisor is doing
|
|
41
|
+
neo supervisor activity --limit 10
|
|
42
|
+
|
|
43
|
+
# Send follow-up instructions
|
|
44
|
+
neo supervise --message "Prioritize the auth middleware — we need it before the API routes"
|
|
45
|
+
|
|
46
|
+
# Check costs
|
|
47
|
+
neo cost --short
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Why supervisor mode?** You don't need to know which agent to use, how to chain them, or when to retry. The supervisor makes those decisions based on its experience and memory. It also handles edge cases (review cycles, CI failures, anti-loop guards) that are tedious to manage manually.
|
|
51
|
+
|
|
52
|
+
### Mode B: Direct dispatch (advanced)
|
|
53
|
+
|
|
54
|
+
For cases where you want full control over the workflow — you decide what to build, which agent to use, and when to follow up. Useful for one-off tasks or when you have a specific agent pipeline in mind.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Dispatch a developer agent
|
|
58
|
+
neo run developer --prompt "Add input validation to POST /api/users" \
|
|
59
|
+
--repo /path/to/project --branch feat/input-validation \
|
|
60
|
+
--meta '{"label":"input-validation","stage":"develop"}'
|
|
61
|
+
|
|
62
|
+
# Check progress
|
|
63
|
+
neo runs --short --status running
|
|
64
|
+
|
|
65
|
+
# Read the result when done
|
|
66
|
+
neo runs <runId>
|
|
67
|
+
|
|
68
|
+
# Check costs
|
|
69
|
+
neo cost --short
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
You handle the develop → review → fix cycle yourself. See "Typical Workflows" at the end for examples.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Installation & Setup
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Prerequisites: Node.js >= 22, git >= 2.20, Claude Code CLI installed
|
|
80
|
+
|
|
81
|
+
# Install neo globally
|
|
82
|
+
npm install -g @neotx/cli
|
|
83
|
+
|
|
84
|
+
# Verify installation
|
|
85
|
+
neo doctor
|
|
86
|
+
|
|
87
|
+
# Initialize in your project
|
|
88
|
+
cd /path/to/your/project
|
|
89
|
+
neo init
|
|
90
|
+
|
|
91
|
+
# (Optional) Add MCP integrations
|
|
92
|
+
neo mcp add github # requires GITHUB_TOKEN env var
|
|
93
|
+
neo mcp add linear # requires LINEAR_API_KEY env var
|
|
94
|
+
neo mcp add notion # requires NOTION_TOKEN env var
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Available Agents
|
|
100
|
+
|
|
101
|
+
| Agent | Model | Mode | Use when |
|
|
102
|
+
|-------|-------|------|----------|
|
|
103
|
+
| `developer` | opus | writable | Implementing code changes, bug fixes, new features |
|
|
104
|
+
| `architect` | opus | readonly | Designing systems, planning features, decomposing work |
|
|
105
|
+
| `reviewer` | sonnet | readonly | Code review — blocks on ≥1 CRITICAL or ≥3 WARNINGs |
|
|
106
|
+
| `fixer` | opus | writable | Fixing issues found by reviewer — targets root causes |
|
|
107
|
+
| `refiner` | opus | readonly | Evaluating ticket quality, splitting vague tickets |
|
|
108
|
+
|
|
109
|
+
**Custom agents:** Drop a YAML file in `.neo/agents/` to extend built-in agents:
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
# .neo/agents/my-developer.yml
|
|
113
|
+
name: my-developer
|
|
114
|
+
extends: developer
|
|
115
|
+
promptAppend: |
|
|
116
|
+
Always use our internal logger instead of console.log.
|
|
117
|
+
Follow the patterns in src/shared/conventions.ts.
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
List all agents: `neo agents`
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Complete Command Reference
|
|
125
|
+
|
|
126
|
+
### neo run — Dispatch an agent
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
neo run <agent> --prompt "..." --repo <path> --branch <name> [flags]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
| Flag | Type | Default | Description |
|
|
133
|
+
|------|------|---------|-------------|
|
|
134
|
+
| `--prompt` | string | required | Task description for the agent |
|
|
135
|
+
| `--repo` | string | `.` | Target repository path |
|
|
136
|
+
| `--branch` | string | required | Branch name for the isolated clone |
|
|
137
|
+
| `--priority` | string | `medium` | `critical`, `high`, `medium`, `low` |
|
|
138
|
+
| `--meta` | JSON string | — | Metadata: `{"label":"...","ticketId":"...","stage":"..."}` |
|
|
139
|
+
| `--detach`, `-d` | boolean | `true` | Run in background, return immediately |
|
|
140
|
+
| `--sync`, `-s` | boolean | `false` | Run in foreground (blocking) |
|
|
141
|
+
| `--git-strategy` | string | `branch` | `branch` (push only) or `pr` (create PR) |
|
|
142
|
+
| `--output` | string | — | `json` for machine-readable output |
|
|
143
|
+
|
|
144
|
+
**Detached output:** returns `runId` and PID immediately. Use `neo logs -f <runId>` to follow.
|
|
145
|
+
|
|
146
|
+
**Example with full metadata:**
|
|
147
|
+
```bash
|
|
148
|
+
neo run developer \
|
|
149
|
+
--prompt "Add rate limiting to POST /api/upload: max 10 req/min/IP, return 429 with Retry-After" \
|
|
150
|
+
--repo /path/to/api \
|
|
151
|
+
--branch feat/rate-limiting \
|
|
152
|
+
--priority high \
|
|
153
|
+
--meta '{"label":"T1-rate-limit","ticketId":"PROJ-42","stage":"develop"}' \
|
|
154
|
+
--git-strategy pr
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### neo runs — Monitor runs
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
neo runs # List all runs for current repo
|
|
161
|
+
neo runs <runId> # Full details + agent output (prefix match on ID)
|
|
162
|
+
neo runs --short # Compact output (minimal tokens)
|
|
163
|
+
neo runs --short --status running # Check active runs
|
|
164
|
+
neo runs --last 5 # Last N runs
|
|
165
|
+
neo runs --status failed # Filter by status: completed, failed, running
|
|
166
|
+
neo runs --repo my-project # Filter by repo
|
|
167
|
+
neo runs --output json # Machine-readable
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Important:** After an agent completes, ALWAYS read `neo runs <runId>` — it contains the agent's structured output (PR URLs, issues found, plans, milestones).
|
|
171
|
+
|
|
172
|
+
### neo supervise — Manage the supervisor daemon
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
neo supervise # Start daemon + open live TUI
|
|
176
|
+
neo supervise --detach # Start daemon in background (no TUI)
|
|
177
|
+
neo supervise --attach # Open TUI for running daemon
|
|
178
|
+
neo supervise --status # Show supervisor status (PID, port, costs, heartbeats)
|
|
179
|
+
neo supervise --kill # Stop the running supervisor
|
|
180
|
+
neo supervise --message "..." # Send a message to the supervisor inbox
|
|
181
|
+
neo supervise --name my-supervisor # Use a named supervisor instance (default: "supervisor")
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Status output includes:** PID, port, session ID, started timestamp, heartbeat count, last heartbeat, cost today, cost total, status (running/idle/stopped).
|
|
185
|
+
|
|
186
|
+
### neo supervisor — Query supervisor state
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
neo supervisor status # Current status + recent activity (top 5)
|
|
190
|
+
neo supervisor status --json # Machine-readable status
|
|
191
|
+
neo supervisor activity # Activity log (last 50 entries)
|
|
192
|
+
neo supervisor activity --type dispatch # Filter: decision, action, error, event, message, plan, dispatch
|
|
193
|
+
neo supervisor activity --since "2024-01-15T00:00:00Z" --until "2024-01-16T00:00:00Z"
|
|
194
|
+
neo supervisor activity --limit 20
|
|
195
|
+
neo supervisor activity --json # Machine-readable
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### neo logs — Event journal
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
neo logs # Last 20 events
|
|
202
|
+
neo logs --last 50 # Last N events
|
|
203
|
+
neo logs --type session:complete # Filter: session:start, session:complete, session:fail, cost:update, budget:alert
|
|
204
|
+
neo logs --run <runId> # Events for a specific run
|
|
205
|
+
neo logs --follow --run <runId> # Live tail of a running agent's log
|
|
206
|
+
neo logs --short # Ultra-compact (one-line per event)
|
|
207
|
+
neo logs --output json # Machine-readable
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### neo log — Report to supervisor
|
|
211
|
+
|
|
212
|
+
Agents use this to report progress. Reports appear in the supervisor's TUI and activity log.
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
neo log progress "3/5 endpoints done"
|
|
216
|
+
neo log action "Pushed to branch feat/auth"
|
|
217
|
+
neo log decision "Chose JWT over sessions — simpler for MVP"
|
|
218
|
+
neo log blocker "Tests failing, missing dependency" # Also wakes the supervisor via inbox
|
|
219
|
+
neo log milestone "All tests passing, PR opened"
|
|
220
|
+
neo log discovery "Repo uses Prisma + PostgreSQL"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Flags: `--memory` (force to memory store), `--knowledge` (force to knowledge), `--procedure` (write as procedure memory).
|
|
224
|
+
|
|
225
|
+
### neo cost — Budget tracking
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
neo cost # Today's total + all-time + breakdown by agent and repo
|
|
229
|
+
neo cost --short # One-liner: today=$X.XX sessions=N agent1=$X.XX
|
|
230
|
+
neo cost --repo my-project # Filter by repo
|
|
231
|
+
neo cost --output json # Machine-readable
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### neo memory — Persistent memory store
|
|
235
|
+
|
|
236
|
+
The supervisor maintains semantic memory using SQLite + FTS5 + optional vector embeddings.
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
# Write memory
|
|
240
|
+
neo memory write --type fact --scope /path/to/repo "main branch uses protected merges"
|
|
241
|
+
neo memory write --type procedure --scope /path/to/repo "After architect run: parse milestones, create tasks"
|
|
242
|
+
neo memory write --type focus --expires 2h "Working on auth module — 3 tasks remaining"
|
|
243
|
+
neo memory write --type task --scope /path/to/repo --severity high --category "neo runs abc123" "Implement login endpoint"
|
|
244
|
+
neo memory write --type feedback --scope /path/to/repo "User wants PR descriptions in French"
|
|
245
|
+
|
|
246
|
+
# Update
|
|
247
|
+
neo memory update <id> "Updated content"
|
|
248
|
+
neo memory update <id> --outcome done # pending, in_progress, done, blocked, abandoned
|
|
249
|
+
|
|
250
|
+
# Search & list
|
|
251
|
+
neo memory search "authentication" # Semantic search (uses embeddings if available)
|
|
252
|
+
neo memory list # All memories
|
|
253
|
+
neo memory list --type fact # Filter by type: fact, procedure, episode, focus, feedback, task
|
|
254
|
+
|
|
255
|
+
# Delete
|
|
256
|
+
neo memory forget <id>
|
|
257
|
+
|
|
258
|
+
# Statistics
|
|
259
|
+
neo memory stats # Count by type and scope
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Memory types:**
|
|
263
|
+
|
|
264
|
+
| Type | Use when | TTL |
|
|
265
|
+
|------|----------|-----|
|
|
266
|
+
| `fact` | Stable truth affecting dispatch decisions | Permanent (decays) |
|
|
267
|
+
| `procedure` | Same failure 3+ times, reusable how-to | Permanent |
|
|
268
|
+
| `focus` | Current working context (scratchpad) | `--expires` required |
|
|
269
|
+
| `task` | Planned work items | Until done/abandoned |
|
|
270
|
+
| `feedback` | Recurring review complaints | Permanent |
|
|
271
|
+
| `episode` | Event log entries | Permanent (decays) |
|
|
272
|
+
|
|
273
|
+
Additional flags: `--scope` (default: global), `--source` (developer/reviewer/supervisor/user), `--severity` (critical/high/medium/low), `--category` (context reference), `--tags` (comma-separated).
|
|
274
|
+
|
|
275
|
+
### neo decision — Decision gates
|
|
276
|
+
|
|
277
|
+
Decision gates allow the supervisor to pause and wait for user input on important choices. Scout agents create decisions when they find issues that require human judgment. Users answer decisions via CLI, and the supervisor routes based on the answer.
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# Create a decision with options
|
|
281
|
+
neo decision create "Should we refactor the auth module or patch the existing code?" \
|
|
282
|
+
--options "refactor:Full refactor:Clean solution but takes 2 days,patch:Quick patch:Fast but adds tech debt" \
|
|
283
|
+
--default-answer patch \
|
|
284
|
+
--expires-in 24h \
|
|
285
|
+
--context "Found 3 security issues in auth module"
|
|
286
|
+
|
|
287
|
+
# List all pending decisions
|
|
288
|
+
neo decision pending
|
|
289
|
+
|
|
290
|
+
# List all decisions (including answered)
|
|
291
|
+
neo decision list
|
|
292
|
+
|
|
293
|
+
# Get details of a specific decision
|
|
294
|
+
neo decision get dec_abc123
|
|
295
|
+
|
|
296
|
+
# Answer a decision
|
|
297
|
+
neo decision answer dec_abc123 refactor
|
|
298
|
+
|
|
299
|
+
# JSON output for programmatic use
|
|
300
|
+
neo decision list --json
|
|
301
|
+
neo decision get dec_abc123 --json
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
| Flag | Type | Default | Description |
|
|
305
|
+
|------|------|---------|-------------|
|
|
306
|
+
| `--options`, `-o` | string | — | Options in format `key:label` or `key:label:description` (comma-separated) |
|
|
307
|
+
| `--default-answer`, `-d` | string | — | Default answer key used if decision expires |
|
|
308
|
+
| `--expires-in`, `-e` | duration | `24h` | Expiration duration (e.g., `30m`, `24h`, `7d`) |
|
|
309
|
+
| `--type`, `-t` | string | `generic` | Decision type for categorization |
|
|
310
|
+
| `--context`, `-c` | string | — | Additional context for the decision |
|
|
311
|
+
| `--name` | string | `supervisor` | Supervisor name |
|
|
312
|
+
| `--json` | boolean | `false` | Output as JSON |
|
|
313
|
+
|
|
314
|
+
**Actions:**
|
|
315
|
+
|
|
316
|
+
| Action | Description |
|
|
317
|
+
|--------|-------------|
|
|
318
|
+
| `create` | Create a new decision gate (VALUE = question text) |
|
|
319
|
+
| `list` | List all decisions |
|
|
320
|
+
| `pending` | List only unanswered decisions |
|
|
321
|
+
| `get` | Get details of a decision (VALUE = decision ID) |
|
|
322
|
+
| `answer` | Answer a decision (VALUE = decision ID, followed by answer key) |
|
|
323
|
+
|
|
324
|
+
**Typical workflow:**
|
|
325
|
+
|
|
326
|
+
1. **Scout finds issue** → Agent discovers something requiring human judgment
|
|
327
|
+
2. **Creates decision** → `neo decision create "..." --options "..."` with clear options
|
|
328
|
+
3. **User is notified** → Decision appears in `neo decision pending`
|
|
329
|
+
4. **User answers** → `neo decision answer <id> <key>`
|
|
330
|
+
5. **Supervisor routes** → Picks up the answer and dispatches appropriate follow-up
|
|
331
|
+
|
|
332
|
+
**Example: Security issue triage**
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
# Scout agent creates a decision after finding vulnerabilities
|
|
336
|
+
neo decision create "Found SQL injection in UserService. How should we proceed?" \
|
|
337
|
+
--options "block:Block release:Stop deployment until fixed,hotfix:Hotfix now:Emergency patch within 2h,schedule:Schedule fix:Add to next sprint" \
|
|
338
|
+
--default-answer block \
|
|
339
|
+
--expires-in 4h \
|
|
340
|
+
--type security \
|
|
341
|
+
--context "CVE-2024-1234 affects getUserById(). Risk: HIGH"
|
|
342
|
+
|
|
343
|
+
# User checks pending decisions
|
|
344
|
+
neo decision pending
|
|
345
|
+
# Output:
|
|
346
|
+
# ID TYPE QUESTION EXPIRES
|
|
347
|
+
# dec_x7k9m2 security Found SQL injection in UserService... 3h 45m
|
|
348
|
+
|
|
349
|
+
# User answers
|
|
350
|
+
neo decision answer dec_x7k9m2 hotfix
|
|
351
|
+
|
|
352
|
+
# Supervisor receives the answer and dispatches fixer agent with hotfix priority
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### neo webhooks — Event notifications
|
|
356
|
+
|
|
357
|
+
Neo can push events to external URLs when things happen (agent completes, budget alert, etc.).
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
neo webhooks # List all registered webhooks
|
|
361
|
+
neo webhooks add https://example.com/neo-events # Register a new endpoint
|
|
362
|
+
neo webhooks remove https://example.com/neo-events # Deregister
|
|
363
|
+
neo webhooks test # Test all endpoints (shows response codes + latency)
|
|
364
|
+
neo webhooks --output json # Machine-readable
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
**Events emitted:** `supervisor_started`, `heartbeat`, `run_dispatched`, `run_completed`, `supervisor_stopped`, `session:start`, `session:complete`, `session:fail`, `cost:update`, `budget:alert`.
|
|
368
|
+
|
|
369
|
+
**Webhook payloads** are JSON. Optional HMAC signature verification via `X-Neo-Signature` header (configure `supervisor.secret` in config).
|
|
370
|
+
|
|
371
|
+
**Receiving webhooks in your app:**
|
|
372
|
+
```
|
|
373
|
+
POST /webhook
|
|
374
|
+
Content-Type: application/json
|
|
375
|
+
X-Neo-Signature: sha256=<hmac>
|
|
376
|
+
|
|
377
|
+
{
|
|
378
|
+
"event": "run_completed",
|
|
379
|
+
"source": "neo-supervisor",
|
|
380
|
+
"payload": {
|
|
381
|
+
"runId": "abc-123",
|
|
382
|
+
"status": "completed",
|
|
383
|
+
"costUsd": 1.24,
|
|
384
|
+
"durationMs": 45000
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### neo mcp — MCP server integrations
|
|
390
|
+
|
|
391
|
+
MCP (Model Context Protocol) servers give agents access to external tools (Linear, GitHub, Notion, etc.).
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
neo mcp list # List configured MCP servers
|
|
395
|
+
|
|
396
|
+
# Add a preset (auto-configured)
|
|
397
|
+
neo mcp add linear # Requires LINEAR_API_KEY env var
|
|
398
|
+
neo mcp add github # Requires GITHUB_TOKEN env var
|
|
399
|
+
neo mcp add notion # Requires NOTION_TOKEN env var
|
|
400
|
+
neo mcp add jira # Requires JIRA_API_TOKEN + JIRA_URL env vars
|
|
401
|
+
neo mcp add slack # Requires SLACK_BOT_TOKEN env var
|
|
402
|
+
|
|
403
|
+
# Add a custom MCP server
|
|
404
|
+
neo mcp add my-server --type stdio --command npx --serverArgs "@org/my-mcp-server"
|
|
405
|
+
neo mcp add my-http-server --type http --url http://localhost:8080
|
|
406
|
+
|
|
407
|
+
# Remove
|
|
408
|
+
neo mcp remove linear
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
Once configured, MCP tools are available to the supervisor and agents during their sessions.
|
|
412
|
+
|
|
413
|
+
### neo repos — Repository management
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
neo repos # List registered repositories
|
|
417
|
+
neo repos add /path/to/repo --name my-project --branch main
|
|
418
|
+
neo repos remove my-project # By name or path
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### neo agents — List agents
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
neo agents # Table: name, model, sandbox, source (builtin/custom)
|
|
425
|
+
neo agents --output json # Machine-readable
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### neo doctor — Health check
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
neo doctor # Check all prerequisites
|
|
432
|
+
neo doctor --fix # Auto-fix missing directories, stale sessions
|
|
433
|
+
neo doctor --output json # Machine-readable
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## Configuration Reference
|
|
439
|
+
|
|
440
|
+
Neo stores global configuration in `~/.neo/config.yml`. Created automatically on `neo init`.
|
|
441
|
+
|
|
442
|
+
```yaml
|
|
443
|
+
repos:
|
|
444
|
+
- path: "/path/to/your/repo"
|
|
445
|
+
defaultBranch: main
|
|
446
|
+
branchPrefix: feat
|
|
447
|
+
pushRemote: origin
|
|
448
|
+
gitStrategy: branch # "branch" or "pr"
|
|
449
|
+
|
|
450
|
+
concurrency:
|
|
451
|
+
maxSessions: 5 # Total concurrent agent sessions
|
|
452
|
+
maxPerRepo: 4 # Max sessions per repository
|
|
453
|
+
|
|
454
|
+
budget:
|
|
455
|
+
dailyCapUsd: 500 # Hard daily spending limit
|
|
456
|
+
alertThresholdPct: 80 # Emit budget:alert at this threshold
|
|
457
|
+
|
|
458
|
+
recovery:
|
|
459
|
+
maxRetries: 3 # Retry attempts per session
|
|
460
|
+
backoffBaseMs: 30000 # Base delay between retries
|
|
461
|
+
|
|
462
|
+
sessions:
|
|
463
|
+
initTimeoutMs: 120000 # Timeout waiting for session init
|
|
464
|
+
maxDurationMs: 3600000 # Max session duration (1 hour)
|
|
465
|
+
|
|
466
|
+
supervisor:
|
|
467
|
+
port: 7777 # Webhook server port
|
|
468
|
+
dailyCapUsd: 50 # Supervisor-specific daily cap
|
|
469
|
+
secret: "" # HMAC secret for webhook signature verification
|
|
470
|
+
|
|
471
|
+
memory:
|
|
472
|
+
embeddings: true # Enable local vector embeddings for semantic search
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
### Editing configuration
|
|
476
|
+
|
|
477
|
+
The config file is plain YAML — edit directly:
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
# Open in editor
|
|
481
|
+
nano ~/.neo/config.yml
|
|
482
|
+
|
|
483
|
+
# Or use neo init to reset defaults
|
|
484
|
+
neo init
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### Per-project setup
|
|
488
|
+
|
|
489
|
+
Each project has a `.neo/` directory (created by `neo init`):
|
|
490
|
+
|
|
491
|
+
```
|
|
492
|
+
.neo/
|
|
493
|
+
├── agents/ # Custom agent YAML definitions
|
|
494
|
+
│ └── my-dev.yml # Extends built-in agents
|
|
495
|
+
└── (created by init)
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
---
|
|
499
|
+
|
|
500
|
+
## Programmatic API
|
|
501
|
+
|
|
502
|
+
For deep integration, use `@neotx/core` directly:
|
|
503
|
+
|
|
504
|
+
```typescript
|
|
505
|
+
import { AgentRegistry, loadGlobalConfig, Orchestrator } from "@neotx/core";
|
|
506
|
+
|
|
507
|
+
const config = await loadGlobalConfig();
|
|
508
|
+
const orchestrator = new Orchestrator(config);
|
|
509
|
+
|
|
510
|
+
// Load agents
|
|
511
|
+
const registry = new AgentRegistry("path/to/agents");
|
|
512
|
+
await registry.load();
|
|
513
|
+
for (const agent of registry.list()) {
|
|
514
|
+
orchestrator.registerAgent(agent);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// Listen to events
|
|
518
|
+
orchestrator.on("session:complete", (e) => console.log(`Done: $${e.costUsd}`));
|
|
519
|
+
orchestrator.on("session:fail", (e) => console.log(`Failed: ${e.error}`));
|
|
520
|
+
orchestrator.on("budget:alert", (e) => console.log(`Budget: ${e.utilizationPct}%`));
|
|
521
|
+
|
|
522
|
+
// Dispatch
|
|
523
|
+
await orchestrator.start();
|
|
524
|
+
const result = await orchestrator.dispatch({
|
|
525
|
+
agent: "developer",
|
|
526
|
+
repo: "/path/to/repo",
|
|
527
|
+
prompt: "Add rate limiting to the API",
|
|
528
|
+
priority: "high",
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
console.log(result.status); // "success" | "failure"
|
|
532
|
+
console.log(result.costUsd); // 1.24
|
|
533
|
+
await orchestrator.shutdown();
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
## Typical Workflows
|
|
539
|
+
|
|
540
|
+
### Feature implementation (supervisor — recommended)
|
|
541
|
+
|
|
542
|
+
```bash
|
|
543
|
+
# Just describe what you want — the supervisor orchestrates everything
|
|
544
|
+
neo supervise --message "Implement JWT authentication: login/register endpoints, middleware, refresh tokens, and tests"
|
|
545
|
+
|
|
546
|
+
# Monitor progress
|
|
547
|
+
neo supervisor status
|
|
548
|
+
neo supervisor activity --type dispatch
|
|
549
|
+
neo runs --short --status running
|
|
550
|
+
neo cost --short
|
|
551
|
+
|
|
552
|
+
# Send follow-up context if needed
|
|
553
|
+
neo supervise --message "The JWT secret should come from env var JWT_SECRET, not hardcoded"
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
The supervisor will autonomously: refine the task if vague → dispatch architect for design → dispatch developer for each sub-task → dispatch reviewer → dispatch fixer if issues → report completion.
|
|
557
|
+
|
|
558
|
+
### Bug fix (supervisor)
|
|
559
|
+
|
|
560
|
+
```bash
|
|
561
|
+
neo supervise --message "Fix: POST /api/users returns 500 when email contains '+'. The Zod schema rejects it. High priority."
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
### Code review (supervisor)
|
|
565
|
+
|
|
566
|
+
```bash
|
|
567
|
+
neo supervise --message "Review PR #42 on branch feat/caching. Focus on cache invalidation strategy and memory leaks."
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
### Feature implementation (direct dispatch — advanced)
|
|
571
|
+
|
|
572
|
+
```bash
|
|
573
|
+
# 1. Design
|
|
574
|
+
neo run architect --prompt "Design auth system with JWT" --repo . --branch feat/auth
|
|
575
|
+
|
|
576
|
+
# 2. Read architect output, get task list
|
|
577
|
+
neo runs <architectRunId>
|
|
578
|
+
|
|
579
|
+
# 3. Implement each task
|
|
580
|
+
neo run developer --prompt "Task 1: Create JWT middleware" --repo . --branch feat/auth \
|
|
581
|
+
--meta '{"label":"T1-jwt-middleware","stage":"develop"}'
|
|
582
|
+
|
|
583
|
+
# 4. Review
|
|
584
|
+
neo run reviewer --prompt "Review PR on branch feat/auth" --repo . --branch feat/auth
|
|
585
|
+
|
|
586
|
+
# 5. Fix if needed
|
|
587
|
+
neo run fixer --prompt "Fix issues: missing token expiry check" --repo . --branch feat/auth
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
### Bug fix (direct dispatch)
|
|
591
|
+
|
|
592
|
+
```bash
|
|
593
|
+
neo run developer --prompt "Fix: POST /api/users returns 500 when email contains '+'. The Zod schema rejects it." \
|
|
594
|
+
--repo . --branch fix/email-validation --priority high
|
|
595
|
+
```
|