nightshift-mcp 2.1.1 → 2.1.3
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 +364 -383
- package/dist/daemon-manager.d.ts +18 -0
- package/dist/daemon-manager.d.ts.map +1 -1
- package/dist/daemon-manager.js +151 -3
- package/dist/daemon-manager.js.map +1 -1
- package/dist/daemon.d.ts +1 -0
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +39 -5
- package/dist/daemon.js.map +1 -1
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +5 -3
- package/dist/orchestrator.js.map +1 -1
- package/dist/tools/agents.d.ts.map +1 -1
- package/dist/tools/agents.js +8 -5
- package/dist/tools/agents.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,383 +1,364 @@
|
|
|
1
|
-
# NightShift MCP
|
|
2
|
-
|
|
3
|
-
**Multi-agent orchestration across AI models. The responsible kind of multi-agent chaos.**
|
|
4
|
-
|
|
5
|
-
An [MCP](https://modelcontextprotocol.io/) server that coordinates Claude, Codex, Gemini, Vibe, Goose, and local Ollama models as an agentic team. Structured delegation, shared task management, autonomous workflows, and production-grade reliability features. Works with any MCP-compatible client.
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# Install
|
|
11
|
-
npm install -g nightshift-mcp
|
|
12
|
-
|
|
13
|
-
# Configure for Claude Code (~/.claude.json)
|
|
14
|
-
{
|
|
15
|
-
"mcpServers": {
|
|
16
|
-
"nightshift": { "command": "nightshift-mcp", "args": [] }
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
# Configure for Codex (~/.codex/config.toml)
|
|
21
|
-
[mcp_servers.nightshift]
|
|
22
|
-
command = "nightshift-mcp"
|
|
23
|
-
args = []
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
All agents must run in the **same project directory** to share coordination state.
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# Terminal 1 # Terminal 2
|
|
30
|
-
cd ~/myproject cd ~/myproject
|
|
31
|
-
claude codex
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Features
|
|
35
|
-
|
|
36
|
-
### Orchestration
|
|
37
|
-
- **Agent spawning**: Spawn Claude, Codex, Gemini, Vibe, Goose, or Ollama as subprocesses with full lifecycle tracking
|
|
38
|
-
- **Autonomous mode**: Single `orchestrate` tool runs claim-implement-complete loops until all stories pass
|
|
39
|
-
- **Daemon mode**: Event-driven background orchestrator with file watchers, health checks, and auto-recovery
|
|
40
|
-
- **Delegation**: Hand off stories or research tasks to specific agents with full context injection
|
|
41
|
-
- **Failover handling**: Seamless handoffs when an agent hits rate limits or context windows
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
- **
|
|
48
|
-
- **
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- **Token tracking**: Parses token usage from
|
|
53
|
-
- **Run log + stats**: Structured JSONL log per spawn. `get_run_stats`
|
|
54
|
-
- **Rate limit detection**: Parses 429s, "quota exceeded", retry-after from agent output. Returns structured `rate_limited` status.
|
|
55
|
-
- **Agent role tagging**: `role` param on `spawn_agent`, `delegate_story` — planner, coder, fixer, verifier, etc.
|
|
56
|
-
- **Configurable pipelines**: Define multi-step agent pipelines
|
|
57
|
-
- **Tool usage tracking**: Parses which tools agents used
|
|
58
|
-
|
|
59
|
-
### Task Management
|
|
60
|
-
- **PRD-driven workflow**: User stories in `prd.json` with priorities, dependencies (`dependsOn`), and tags for routing
|
|
61
|
-
- **Bug tracking**: `bugs.json` for post-testing feedback loops
|
|
62
|
-
- **Savepoints**: Git-based checkpoints (or JSON fallback) with rollback support
|
|
63
|
-
- **Progress tracking**: Shared learnings via `progress.txt`
|
|
64
|
-
|
|
65
|
-
### Communication
|
|
66
|
-
- **Multi-agent chat**: Structured messaging via `.robot-chat/chat.txt` with agent name, timestamp, and message type
|
|
67
|
-
- **Context store**: Topic-based context retrieval — agents store and query learnings instead of prompt-stuffing
|
|
68
|
-
- **Execution tracing**: Parent-child trace trees for debugging multi-agent runs
|
|
69
|
-
|
|
70
|
-
### Platform
|
|
71
|
-
- **Cross-platform**: Windows, Linux, macOS
|
|
72
|
-
- **6 agent types**: Claude, Codex, Gemini, Vibe, Goose, Ollama
|
|
73
|
-
- **52 MCP tools** across 10 categories
|
|
74
|
-
- **NightShift CLI**: `nightshift` command for agent coordination without MCP
|
|
75
|
-
- **Zero external services**: Everything runs locally with SQLite + file storage
|
|
76
|
-
|
|
77
|
-
##
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
│
|
|
97
|
-
|
|
98
|
-
│
|
|
99
|
-
│
|
|
100
|
-
│
|
|
101
|
-
│
|
|
102
|
-
│
|
|
103
|
-
│
|
|
104
|
-
│
|
|
105
|
-
│
|
|
106
|
-
│
|
|
107
|
-
│
|
|
108
|
-
│ │
|
|
109
|
-
│
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
|
235
|
-
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
|
245
|
-
|
|
246
|
-
| `
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
|
250
|
-
|
|
251
|
-
| `
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
|
255
|
-
|
|
256
|
-
| `
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
|
262
|
-
|
|
263
|
-
| `
|
|
264
|
-
| `
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
|
270
|
-
|
|
271
|
-
| `
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
|
290
|
-
|
|
291
|
-
|
|
|
292
|
-
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
|
342
|
-
|
|
343
|
-
|
|
|
344
|
-
|
|
|
345
|
-
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
| **Pipeline config** | `.robot-chat/pipeline-override.json` | JSON (runtime) |
|
|
366
|
-
|
|
367
|
-
Add `.robot-chat/` to your `.gitignore` — coordination state is ephemeral.
|
|
368
|
-
|
|
369
|
-
## Development
|
|
370
|
-
|
|
371
|
-
```bash
|
|
372
|
-
git clone https://gitlab.com/Pike1868/nightshift-mcp.git
|
|
373
|
-
cd nightshift-mcp
|
|
374
|
-
npm install
|
|
375
|
-
npm run build
|
|
376
|
-
npm test # 113 tests
|
|
377
|
-
npm run dev # watch mode
|
|
378
|
-
npm link # global CLI access
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
## License
|
|
382
|
-
|
|
383
|
-
MIT
|
|
1
|
+
# NightShift MCP
|
|
2
|
+
|
|
3
|
+
**Multi-agent orchestration across AI models. The responsible kind of multi-agent chaos.**
|
|
4
|
+
|
|
5
|
+
An [MCP](https://modelcontextprotocol.io/) server that coordinates Claude, Codex, Gemini, Vibe, Goose, and local Ollama models as an agentic team. Structured delegation, shared task management, autonomous workflows, and production-grade reliability features. Works with any MCP-compatible client.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Install
|
|
11
|
+
npm install -g nightshift-mcp
|
|
12
|
+
|
|
13
|
+
# Configure for Claude Code (~/.claude.json)
|
|
14
|
+
{
|
|
15
|
+
"mcpServers": {
|
|
16
|
+
"nightshift": { "command": "nightshift-mcp", "args": [] }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
# Configure for Codex (~/.codex/config.toml)
|
|
21
|
+
[mcp_servers.nightshift]
|
|
22
|
+
command = "nightshift-mcp"
|
|
23
|
+
args = []
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
All agents must run in the **same project directory** to share coordination state.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Terminal 1 # Terminal 2
|
|
30
|
+
cd ~/myproject cd ~/myproject
|
|
31
|
+
claude codex
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
### Orchestration
|
|
37
|
+
- **Agent spawning**: Spawn Claude, Codex, Gemini, Vibe, Goose, or Ollama as subprocesses with full lifecycle tracking
|
|
38
|
+
- **Autonomous mode**: Single `orchestrate` tool runs claim-implement-complete loops until all stories pass
|
|
39
|
+
- **Daemon mode**: Event-driven background orchestrator with file watchers, health checks, and auto-recovery
|
|
40
|
+
- **Delegation**: Hand off stories or research tasks to specific agents with full context injection
|
|
41
|
+
- **Failover handling**: Seamless handoffs when an agent hits rate limits or context windows
|
|
42
|
+
- **Runtime project switching**: Switch active project without restarting the MCP server
|
|
43
|
+
|
|
44
|
+
### Reliability
|
|
45
|
+
- **Health tracker**: Per-agent failure tracking. Auto-disables failing agents, re-enables after configurable cooldown. Persisted across daemon restarts.
|
|
46
|
+
- **Immutable audit trail**: Append-only SQLite table records every spawn, completion, failure, and stuck-agent kill
|
|
47
|
+
- **Run records**: Structured execution history per agent run — duration, exit status, files changed, scope leak detection
|
|
48
|
+
- **Budget tracking**: Per-agent cost tracking with daily/monthly limits, warning thresholds, enable/disable toggle
|
|
49
|
+
- **Autoresearch**: Built-in analytics queries — agent success rates, average duration, scope leak rates
|
|
50
|
+
|
|
51
|
+
### Observability
|
|
52
|
+
- **Token tracking**: Parses token usage from agent output. Every `spawn_agent` call logs to `.robot-chat/runs.jsonl`.
|
|
53
|
+
- **Run log + stats**: Structured JSONL log per spawn. `get_run_stats` for aggregate tokens per agent, avg durations, rate limit counts.
|
|
54
|
+
- **Rate limit detection**: Parses 429s, "quota exceeded", retry-after from agent output. Returns structured `rate_limited` status.
|
|
55
|
+
- **Agent role tagging**: `role` param on `spawn_agent`, `delegate_story` — planner, coder, fixer, verifier, etc.
|
|
56
|
+
- **Configurable pipelines**: Define multi-step agent pipelines with tag-based routing. `get_pipeline` / `set_pipeline` tools.
|
|
57
|
+
- **Tool usage tracking**: Parses which tools agents used from output.
|
|
58
|
+
|
|
59
|
+
### Task Management
|
|
60
|
+
- **PRD-driven workflow**: User stories in `prd.json` with priorities, dependencies (`dependsOn`), and tags for routing
|
|
61
|
+
- **Bug tracking**: `bugs.json` for post-testing feedback loops
|
|
62
|
+
- **Savepoints**: Git-based checkpoints (or JSON fallback) with rollback support
|
|
63
|
+
- **Progress tracking**: Shared learnings via `progress.txt`
|
|
64
|
+
|
|
65
|
+
### Communication
|
|
66
|
+
- **Multi-agent chat**: Structured messaging via `.robot-chat/chat.txt` with agent name, timestamp, and message type
|
|
67
|
+
- **Context store**: Topic-based context retrieval — agents store and query learnings instead of prompt-stuffing
|
|
68
|
+
- **Execution tracing**: Parent-child trace trees for debugging multi-agent runs
|
|
69
|
+
|
|
70
|
+
### Platform
|
|
71
|
+
- **Cross-platform**: Windows, Linux, macOS
|
|
72
|
+
- **6 agent types**: Claude, Codex, Gemini, Vibe, Goose, Ollama
|
|
73
|
+
- **52 MCP tools** across 10 categories
|
|
74
|
+
- **NightShift CLI**: `nightshift` command for agent coordination without MCP
|
|
75
|
+
- **Zero external services**: Everything runs locally with SQLite + file storage
|
|
76
|
+
|
|
77
|
+
## Architecture
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
┌───────────────────────────────────────────────────────────┐
|
|
81
|
+
│ NightShift MCP │
|
|
82
|
+
├───────────────────────────────────────────────────────────┤
|
|
83
|
+
│ │
|
|
84
|
+
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌──────┐ ┌──────────┐ │
|
|
85
|
+
│ │ Claude │ │ Codex │ │ Gemini │ │ Vibe │ │Goose/Olla│ │
|
|
86
|
+
│ └───┬────┘ └───┬────┘ └───┬────┘ └──┬───┘ └────┬─────┘ │
|
|
87
|
+
│ └──────────┴─────┬─────┴─────────┴──────────┘ │
|
|
88
|
+
│ ▼ │
|
|
89
|
+
│ ┌─────────────────────┐ │
|
|
90
|
+
│ │ .robot-chat/ │ │
|
|
91
|
+
│ │ │ │
|
|
92
|
+
│ │ chat.txt (msg) │ │
|
|
93
|
+
│ │ nightshift.db (v2) │ │
|
|
94
|
+
│ │ workflow.json │ │
|
|
95
|
+
│ │ trace.json │ │
|
|
96
|
+
│ │ context/ │ │
|
|
97
|
+
│ └─────────────────────┘ │
|
|
98
|
+
│ │ │
|
|
99
|
+
│ ┌────────────────┼────────────────┐ │
|
|
100
|
+
│ ▼ ▼ ▼ │
|
|
101
|
+
│ ┌────────┐ ┌────────────┐ ┌──────────┐ │
|
|
102
|
+
│ │prd.json│ │ nightshift │ │progress │ │
|
|
103
|
+
│ │(stories│ │ .db │ │ .txt │ │
|
|
104
|
+
│ │ + bugs)│ │ (audit, │ │(learnings│ │
|
|
105
|
+
│ │ │ │ budget, │ │ patterns)│ │
|
|
106
|
+
│ │ │ │ runs, │ │ │ │
|
|
107
|
+
│ │ │ │ circuits) │ │ │ │
|
|
108
|
+
│ └────────┘ └────────────┘ └──────────┘ │
|
|
109
|
+
│ │
|
|
110
|
+
└───────────────────────────────────────────────────────────┘
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Usage Patterns
|
|
114
|
+
|
|
115
|
+
### Fully autonomous
|
|
116
|
+
```
|
|
117
|
+
orchestrate()
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Parallel delegation
|
|
121
|
+
```
|
|
122
|
+
delegate_story(agent: "codex", storyId: "US-001", background: true)
|
|
123
|
+
delegate_story(agent: "gemini", storyId: "US-002", background: true)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Research then implement
|
|
127
|
+
```
|
|
128
|
+
delegate_research(task: "Analyze auth patterns and recommend approach")
|
|
129
|
+
delegate_story(agent: "codex", storyId: "US-001")
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Pipeline (multi-step)
|
|
133
|
+
```
|
|
134
|
+
set_pipeline(name: "default", steps: [
|
|
135
|
+
{ agent: "gemini", role: "planner" },
|
|
136
|
+
{ agent: "codex", role: "implementer" },
|
|
137
|
+
{ agent: "claude", role: "verifier" }
|
|
138
|
+
])
|
|
139
|
+
orchestrate()
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Daemon (hands-off)
|
|
143
|
+
```bash
|
|
144
|
+
nightshift-daemon --verbose --max-agents 4
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## PRD Setup
|
|
148
|
+
|
|
149
|
+
Create `prd.json` in your project root:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"project": "MyApp",
|
|
154
|
+
"userStories": [
|
|
155
|
+
{
|
|
156
|
+
"id": "US-001",
|
|
157
|
+
"title": "Set up project structure",
|
|
158
|
+
"acceptanceCriteria": ["Add routes", "Create base components"],
|
|
159
|
+
"priority": 1,
|
|
160
|
+
"passes": false
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "US-002",
|
|
164
|
+
"title": "Add database schema",
|
|
165
|
+
"priority": 2,
|
|
166
|
+
"passes": false,
|
|
167
|
+
"dependsOn": ["US-001"],
|
|
168
|
+
"tags": ["code", "infrastructure"]
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Story fields
|
|
175
|
+
|
|
176
|
+
| Field | Type | Required | Default | Description |
|
|
177
|
+
|-------|------|----------|---------|-------------|
|
|
178
|
+
| `id` | string | yes | — | Unique ID (e.g., "US-001") |
|
|
179
|
+
| `title` | string | yes | — | Short title |
|
|
180
|
+
| `description` | string | no | "" | Detailed description |
|
|
181
|
+
| `acceptanceCriteria` | string[] | no | [] | Completion criteria |
|
|
182
|
+
| `priority` | number | no | 999 | Lower = higher priority |
|
|
183
|
+
| `passes` | boolean | no | false | Whether complete |
|
|
184
|
+
| `dependsOn` | string[] | no | — | Story IDs that must complete first |
|
|
185
|
+
| `tags` | string[] | no | — | Routing hints (e.g., `["code"]`, `["research"]`) |
|
|
186
|
+
|
|
187
|
+
Tags influence agent routing: `research`/`planning` prefers Gemini/Claude, `code`/`implementation` prefers Codex/Claude.
|
|
188
|
+
|
|
189
|
+
## Bug Tracking
|
|
190
|
+
|
|
191
|
+
Add `bugs.json` when testing reveals issues:
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"project": "MyApp",
|
|
196
|
+
"bugs": [
|
|
197
|
+
{
|
|
198
|
+
"id": "BUG-001",
|
|
199
|
+
"title": "Login fails on mobile",
|
|
200
|
+
"description": "Login button unresponsive on iOS Safari",
|
|
201
|
+
"priority": 1,
|
|
202
|
+
"fixed": false
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
When all stories pass and all bugs are fixed, NightShift posts `READY_TO_TEST` to the chat.
|
|
209
|
+
|
|
210
|
+
## Tools Reference
|
|
211
|
+
|
|
212
|
+
NightShift provides 52 tools across 10 categories. Key tools listed below — use `nightshift_setup(showExamples: true)` or `nightshift_help` for full documentation.
|
|
213
|
+
|
|
214
|
+
### Communication
|
|
215
|
+
| Tool | Description |
|
|
216
|
+
|------|-------------|
|
|
217
|
+
| `read_robot_chat` | Read recent messages (filter by agent, type, limit) |
|
|
218
|
+
| `write_robot_chat` | Post a message (STATUS_UPDATE, QUESTION, ERROR, etc.) |
|
|
219
|
+
| `check_failovers` | Find unclaimed failover requests |
|
|
220
|
+
| `claim_failover` | Take over work from a stuck agent |
|
|
221
|
+
| `list_agents` | See who's active with activity stats |
|
|
222
|
+
| `watch_chat` | Cursor-based polling for new messages |
|
|
223
|
+
|
|
224
|
+
### Task Management
|
|
225
|
+
| Tool | Description |
|
|
226
|
+
|------|-------------|
|
|
227
|
+
| `read_prd` | Read PRD with completion summary |
|
|
228
|
+
| `get_next_story` | Get highest priority incomplete story |
|
|
229
|
+
| `claim_story` | Claim a story and notify via chat |
|
|
230
|
+
| `complete_story` | Mark done, log progress, create savepoint |
|
|
231
|
+
| `read_bugs` / `claim_bug` / `mark_bug_fixed` | Bug lifecycle |
|
|
232
|
+
|
|
233
|
+
### Agent Spawning
|
|
234
|
+
| Tool | Description |
|
|
235
|
+
|------|-------------|
|
|
236
|
+
| `list_available_agents` | Check which CLIs are installed and runnable |
|
|
237
|
+
| `spawn_agent` | Spawn agent, wait for completion (sync) |
|
|
238
|
+
| `spawn_agent_background` | Spawn agent, return immediately (async) |
|
|
239
|
+
| `delegate_story` | Delegate a story with full context injection |
|
|
240
|
+
| `delegate_research` | Delegate research/analysis task |
|
|
241
|
+
| `get_run_stats` | Token usage, durations, rate limits from run log |
|
|
242
|
+
|
|
243
|
+
### Orchestration & Pipelines
|
|
244
|
+
| Tool | Description |
|
|
245
|
+
|------|-------------|
|
|
246
|
+
| `orchestrate` | Autonomous claim-implement-complete loop |
|
|
247
|
+
| `get_agent_status` | Check background agent by PID |
|
|
248
|
+
| `list_running_agents` | All spawned agents with status |
|
|
249
|
+
| `set_project_path` | Switch active project at runtime |
|
|
250
|
+
| `get_pipeline` | View configured pipelines and tag routing |
|
|
251
|
+
| `set_pipeline` | Create/update agent pipelines at runtime |
|
|
252
|
+
|
|
253
|
+
### Workflow
|
|
254
|
+
| Tool | Description |
|
|
255
|
+
|------|-------------|
|
|
256
|
+
| `init_workflow` | Initialize with project goal and phases |
|
|
257
|
+
| `advance_phase` / `set_phase` | Phase management |
|
|
258
|
+
| `record_decision` | Record strategic decisions with rationale |
|
|
259
|
+
|
|
260
|
+
### Context & Tracing
|
|
261
|
+
| Tool | Description |
|
|
262
|
+
|------|-------------|
|
|
263
|
+
| `store_context` / `query_context` | Topic-based context store |
|
|
264
|
+
| `get_trace` | Execution trace (flat or tree view) |
|
|
265
|
+
|
|
266
|
+
### Recovery
|
|
267
|
+
| Tool | Description |
|
|
268
|
+
|------|-------------|
|
|
269
|
+
| `create_savepoint` | Manual git checkpoint |
|
|
270
|
+
| `list_savepoints` | List all savepoints |
|
|
271
|
+
| `rollback_savepoint` | Reset to a previous savepoint |
|
|
272
|
+
|
|
273
|
+
### Setup
|
|
274
|
+
| Tool | Description |
|
|
275
|
+
|------|-------------|
|
|
276
|
+
| `nightshift_setup` | Configuration check and templates |
|
|
277
|
+
| `nightshift_debug` | Diagnostic report with suggested fixes |
|
|
278
|
+
|
|
279
|
+
## Daemon
|
|
280
|
+
|
|
281
|
+
The daemon provides hands-off, event-driven orchestration:
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
nightshift-daemon [options]
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
| Flag | Default | Description |
|
|
288
|
+
|------|---------|-------------|
|
|
289
|
+
| `--verbose, -v` | false | Debug logging |
|
|
290
|
+
| `--dry-run` | false | Preview without spawning |
|
|
291
|
+
| `--health-check <N>` | 2m | Health check interval |
|
|
292
|
+
| `--max-agents <N>` | 3 | Max concurrent agents |
|
|
293
|
+
|
|
294
|
+
**What it does:**
|
|
295
|
+
- Watches `prd.json` and `chat.txt` for changes
|
|
296
|
+
- Auto-spawns agents for unassigned stories
|
|
297
|
+
- Health tracker disables failing agents, re-enables after cooldown
|
|
298
|
+
- Detects and kills stuck agents
|
|
299
|
+
- Claims failover requests
|
|
300
|
+
- Quarantines stories that fail repeatedly
|
|
301
|
+
- Logs everything to the SQLite audit trail
|
|
302
|
+
|
|
303
|
+
## Local Models
|
|
304
|
+
|
|
305
|
+
NightShift supports local models via [Goose](https://github.com/block/goose) + Ollama or direct Ollama integration.
|
|
306
|
+
|
|
307
|
+
### Goose + Ollama
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
export NIGHTSHIFT_GOOSE_PROVIDER=ollama
|
|
311
|
+
export NIGHTSHIFT_GOOSE_MODEL=<your-model>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
spawn_agent(agent: "goose", prompt: "Fix the pagination bug")
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Direct Ollama
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
export NIGHTSHIFT_OLLAMA_MODEL=<your-model>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
spawn_agent(agent: "ollama", prompt: "Review this PR")
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Any Ollama-compatible model works. Choose a model that fits your available resources.
|
|
329
|
+
|
|
330
|
+
## Data Storage
|
|
331
|
+
|
|
332
|
+
NightShift uses a hybrid storage approach:
|
|
333
|
+
|
|
334
|
+
| Data | Storage | Format |
|
|
335
|
+
|------|---------|--------|
|
|
336
|
+
| Agent chat | `.robot-chat/chat.txt` | Human-readable text |
|
|
337
|
+
| PRD / stories | `prd.json` | JSON |
|
|
338
|
+
| Bugs | `bugs.json` | JSON |
|
|
339
|
+
| Progress | `progress.txt` | Append-only text |
|
|
340
|
+
| Workflow | `.robot-chat/workflow.json` | JSON with file locking |
|
|
341
|
+
| Trace | `.robot-chat/trace.json` | JSON |
|
|
342
|
+
| Context | `.robot-chat/context/*.json` | Per-topic JSON files |
|
|
343
|
+
| **Audit trail** | `.robot-chat/nightshift.db` | SQLite (immutable) |
|
|
344
|
+
| **Run records** | `.robot-chat/nightshift.db` | SQLite |
|
|
345
|
+
| **Budget** | `.robot-chat/nightshift.db` | SQLite |
|
|
346
|
+
| **Health tracker** | `.robot-chat/nightshift.db` | SQLite |
|
|
347
|
+
| **Run log** | `.robot-chat/runs.jsonl` | JSONL (append-only) |
|
|
348
|
+
| **Pipeline config** | `.robot-chat/pipeline-override.json` | JSON (runtime) |
|
|
349
|
+
|
|
350
|
+
Add `.robot-chat/` to your `.gitignore` — coordination state is ephemeral.
|
|
351
|
+
|
|
352
|
+
## Development
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
npm install
|
|
356
|
+
npm run build
|
|
357
|
+
npm test # run test suite
|
|
358
|
+
npm run dev # watch mode
|
|
359
|
+
npm link # global CLI access
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## License
|
|
363
|
+
|
|
364
|
+
MIT
|