panopticon-cli 0.3.7 → 0.4.4
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 +1610 -121
- package/dist/agents-B5NRTVHK.js +40 -0
- package/dist/chunk-7HHDVXBM.js +349 -0
- package/dist/chunk-7HHDVXBM.js.map +1 -0
- package/dist/chunk-H45CLB7E.js +2044 -0
- package/dist/chunk-H45CLB7E.js.map +1 -0
- package/dist/{chunk-C6A7S65K.js → chunk-ITI4IC5A.js} +188 -43
- package/dist/chunk-ITI4IC5A.js.map +1 -0
- package/dist/cli/index.js +8007 -2781
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/public/assets/index-BDd8hGYb.css +32 -0
- package/dist/dashboard/public/assets/index-sFwLPko-.js +556 -0
- package/dist/dashboard/public/index.html +3 -2
- package/dist/dashboard/server.js +39015 -69826
- package/dist/index.d.ts +136 -1
- package/dist/index.js +36 -4
- package/package.json +10 -3
- package/scripts/git-hooks/post-checkout +109 -0
- package/templates/claude-md/sections/beads.md +1 -2
- package/templates/claude-md/sections/warnings.md +46 -2
- package/templates/context/CLAUDE.md.template +22 -0
- package/templates/context/REOPEN_PROMPT.md.template +75 -0
- package/templates/docker/dotnet/docker-compose.yml +2 -0
- package/templates/docker/monorepo/docker-compose.yml +4 -0
- package/templates/docker/nextjs/docker-compose.yml +1 -0
- package/templates/docker/python-fastapi/docker-compose.yml +3 -0
- package/templates/docker/react-vite/docker-compose.yml +1 -0
- package/templates/docker/spring-boot/docker-compose.yml +3 -0
- package/dist/chunk-BH6BR26M.js +0 -173
- package/dist/chunk-BH6BR26M.js.map +0 -1
- package/dist/chunk-C6A7S65K.js.map +0 -1
- package/dist/chunk-P5TQ5C3J.js +0 -103
- package/dist/chunk-P5TQ5C3J.js.map +0 -1
- package/dist/dashboard/public/assets/index-CUoYoWX_.css +0 -32
- package/dist/dashboard/public/assets/index-CY0Ew5B9.js +0 -423
- package/dist/projects-54CV437J.js +0 -34
- /package/dist/{projects-54CV437J.js.map → agents-B5NRTVHK.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,32 +1,72 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# Panopticon CLI
|
|
2
4
|
|
|
3
|
-
Multi-agent orchestration for AI coding assistants
|
|
5
|
+
**Multi-agent orchestration for AI coding assistants**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/panopticon-cli)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://nodejs.org/)
|
|
10
|
+
[](https://github.com/eltmon/panopticon/pulls)
|
|
4
11
|
|
|
5
12
|
> *"The Panopticon had six sides, one for each of the Founders of Gallifrey..."*
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
<img src="docs/dashboard-overview.png" alt="Panopticon Dashboard" width="800" />
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
---
|
|
8
19
|
|
|
9
|
-
|
|
20
|
+
## What is Panopticon?
|
|
21
|
+
|
|
22
|
+
| Without Panopticon | With Panopticon |
|
|
23
|
+
|:------------------|:----------------|
|
|
24
|
+
| Manually juggle multiple AI agents | **Automatic orchestration** - spawn, monitor, and coordinate agents from a dashboard |
|
|
25
|
+
| Agents start fresh every session | **Persistent context** - skills, state files, and beads track work across sessions |
|
|
26
|
+
| Simple tasks eat Opus credits | **Smart model routing** - Haiku for simple, Sonnet for medium, Opus for complex |
|
|
27
|
+
| Stuck agents waste your time | **Automatic recovery** - detect stuck agents and hand off to specialists |
|
|
28
|
+
| AI tools have separate configs | **Universal skills** - one SKILL.md works across Claude, Codex, Cursor, Gemini |
|
|
29
|
+
|
|
30
|
+
## Screenshots
|
|
31
|
+
|
|
32
|
+
<div align="center">
|
|
33
|
+
<table>
|
|
34
|
+
<tr>
|
|
35
|
+
<td><img src="docs/planning-session-dialog.png" alt="Planning Dialog" width="300" /></td>
|
|
36
|
+
<td><img src="docs/planning-session-discovery.png" alt="Discovery Phase" width="300" /></td>
|
|
37
|
+
<td><img src="docs/planning-session-active.png" alt="Active Session" width="300" /></td>
|
|
38
|
+
</tr>
|
|
39
|
+
<tr>
|
|
40
|
+
<td align="center"><em>Start planning</em></td>
|
|
41
|
+
<td align="center"><em>Discovery phase</em></td>
|
|
42
|
+
<td align="center"><em>Active session</em></td>
|
|
43
|
+
</tr>
|
|
44
|
+
</table>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
## Key Features
|
|
48
|
+
|
|
49
|
+
| Feature | Description |
|
|
50
|
+
|:--------|:------------|
|
|
51
|
+
| **Multi-Agent Orchestration** | Spawn and manage AI agents in tmux sessions via dashboard or CLI |
|
|
52
|
+
| **Cloister Lifecycle Manager** | Automatic model routing, stuck detection, and specialist handoffs |
|
|
53
|
+
| **Universal Skills** | One SKILL.md format works across all supported AI tools |
|
|
54
|
+
| **Workspaces** | Git worktree-based feature branches with Docker isolation |
|
|
55
|
+
| **Convoys** | Run parallel agents on related issues with auto-synthesis |
|
|
56
|
+
| **Specialists** | Dedicated review, test, and merge agents for quality control |
|
|
57
|
+
| **Heartbeat Monitoring** | Real-time agent activity tracking via Claude Code hooks |
|
|
58
|
+
| **Legacy Codebase Support** | AI self-monitoring skills that learn from your codebase |
|
|
59
|
+
|
|
60
|
+
## Supported Tools
|
|
10
61
|
|
|
11
62
|
| Tool | Support |
|
|
12
|
-
|
|
63
|
+
|:-----|:--------|
|
|
13
64
|
| **Claude Code** | Full support |
|
|
14
65
|
| **Codex** | Skills sync |
|
|
15
66
|
| **Cursor** | Skills sync |
|
|
16
67
|
| **Gemini CLI** | Skills sync |
|
|
17
68
|
| **Google Antigravity** | Skills sync |
|
|
18
69
|
|
|
19
|
-
### Features
|
|
20
|
-
|
|
21
|
-
- **Multi-agent orchestration** - Spawn and manage multiple AI agents in tmux sessions
|
|
22
|
-
- **Cloister AI Lifecycle Manager** - Automatic model routing, stuck detection, and specialist handoffs
|
|
23
|
-
- **Universal skills** - One SKILL.md format works across all supported tools
|
|
24
|
-
- **Heartbeat Hooks** - Real-time agent activity monitoring via Claude Code hooks
|
|
25
|
-
- **Multi-project support** - YAML-based project registry with label-based issue routing
|
|
26
|
-
- **Health Monitoring** - Deacon-style stuck detection with auto-recovery
|
|
27
|
-
- **Context Engineering** - Structured state management (STATE.md, WORKSPACE.md)
|
|
28
|
-
- **Agent CVs** - Work history tracking for capability-based routing
|
|
29
|
-
|
|
30
70
|
---
|
|
31
71
|
|
|
32
72
|
## Legacy Codebase Support
|
|
@@ -158,54 +198,12 @@ The AI adapts to your org structure, not the other way around.
|
|
|
158
198
|
## Quick Start
|
|
159
199
|
|
|
160
200
|
```bash
|
|
161
|
-
|
|
162
|
-
npm install -g panopticon-cli
|
|
163
|
-
|
|
164
|
-
# Install prerequisites and setup (includes optional HTTPS/Traefik)
|
|
165
|
-
pan install
|
|
166
|
-
|
|
167
|
-
# Sync skills to all AI tools
|
|
168
|
-
pan sync
|
|
169
|
-
|
|
170
|
-
# Check system health
|
|
171
|
-
pan doctor
|
|
201
|
+
npm install -g panopticon-cli && pan install && pan sync && pan up
|
|
172
202
|
```
|
|
173
203
|
|
|
174
|
-
|
|
204
|
+
**That's it!** Dashboard runs at https://pan.localhost (or http://localhost:3010 if you skip HTTPS setup).
|
|
175
205
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
# Full install (includes Traefik + mkcert for HTTPS)
|
|
180
|
-
pan install
|
|
181
|
-
|
|
182
|
-
# Add to /etc/hosts (macOS/Linux)
|
|
183
|
-
echo "127.0.0.1 pan.localhost" | sudo tee -a /etc/hosts
|
|
184
|
-
|
|
185
|
-
# Start with HTTPS
|
|
186
|
-
pan up
|
|
187
|
-
# → Dashboard: https://pan.localhost
|
|
188
|
-
# → Traefik UI: https://traefik.pan.localhost:8080
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
**Minimal install** (skip Traefik, use ports):
|
|
192
|
-
```bash
|
|
193
|
-
pan install --minimal
|
|
194
|
-
pan up
|
|
195
|
-
# → Dashboard: http://localhost:3010
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
See [docs/DNS_SETUP.md](docs/DNS_SETUP.md) for detailed DNS configuration (especially for WSL2).
|
|
199
|
-
|
|
200
|
-
## Supported Platforms
|
|
201
|
-
|
|
202
|
-
| Platform | Support |
|
|
203
|
-
|----------|---------|
|
|
204
|
-
| **Linux** | Full support |
|
|
205
|
-
| **macOS** | Full support |
|
|
206
|
-
| **Windows** | WSL2 required |
|
|
207
|
-
|
|
208
|
-
> **Windows users:** Panopticon requires WSL2 (Windows Subsystem for Linux 2). Native Windows is not supported. [Install WSL2](https://docs.microsoft.com/en-us/windows/wsl/install)
|
|
206
|
+
📖 **[Full installation guide, requirements, and platform support →](https://panopticon-cli.com/quickstart)**
|
|
209
207
|
|
|
210
208
|
## Requirements
|
|
211
209
|
|
|
@@ -221,7 +219,8 @@ See [docs/DNS_SETUP.md](docs/DNS_SETUP.md) for detailed DNS configuration (espec
|
|
|
221
219
|
### Optional
|
|
222
220
|
- **mkcert** - For HTTPS certificates (recommended)
|
|
223
221
|
- **Linear API key** - For issue tracking integration
|
|
224
|
-
- **Beads CLI (bd)** - For persistent task tracking across sessions
|
|
222
|
+
- **Beads CLI (bd)** - For persistent task tracking across sessions. Auto-installed by `pan install`. Upgrade with `pan beads upgrade`.
|
|
223
|
+
- **Google Stitch MCP** - For AI-powered UI design integration (see below)
|
|
225
224
|
|
|
226
225
|
### Platform Support
|
|
227
226
|
|
|
@@ -268,6 +267,111 @@ Panopticon supports multiple issue trackers:
|
|
|
268
267
|
|
|
269
268
|
Secondary trackers sync issues to the dashboard alongside Linear issues, allowing unified project management.
|
|
270
269
|
|
|
270
|
+
### Multi-Model Support
|
|
271
|
+
|
|
272
|
+
Panopticon integrates with [claude-code-router](https://github.com/musistudio/claude-code-router) to enable using multiple AI model providers alongside Anthropic models. Configure which models to use for different agent types and task complexities.
|
|
273
|
+
|
|
274
|
+
📖 **[Complete work types guide and configuration examples →](docs/WORK-TYPES.md)**
|
|
275
|
+
📋 **[Configuration file reference and presets →](docs/CONFIGURATION.md)**
|
|
276
|
+
🧠 **[Model recommendations for optimal cost/performance →](docs/MODEL_RECOMMENDATIONS.md)**
|
|
277
|
+
|
|
278
|
+
#### Supported Providers and Models
|
|
279
|
+
|
|
280
|
+
**Anthropic** (via Claude Code / Claude API)
|
|
281
|
+
- `claude-opus-4-5` - Most capable, best for planning and complex tasks
|
|
282
|
+
- `claude-sonnet-4-5` - Balanced performance and cost
|
|
283
|
+
- `claude-haiku-4-5` - Fast and cost-effective for simple tasks
|
|
284
|
+
|
|
285
|
+
**OpenAI**
|
|
286
|
+
- `gpt-5.2-codex` - Agentic coding and research
|
|
287
|
+
- `o3-deep-research` - Deep research capabilities
|
|
288
|
+
- `gpt-4o` - General-purpose model
|
|
289
|
+
- `gpt-4o-mini` - Faster, more cost-effective variant
|
|
290
|
+
|
|
291
|
+
**Google (Gemini)**
|
|
292
|
+
- `gemini-3-pro-preview` - Supports `thinking_level: high|low`
|
|
293
|
+
- `gemini-3-flash-preview` - Supports `thinking_level: minimal|low|medium|high`
|
|
294
|
+
|
|
295
|
+
**Z.AI**
|
|
296
|
+
- `glm-4.7` - General-purpose model
|
|
297
|
+
- `glm-4.7-flash` - Faster variant
|
|
298
|
+
|
|
299
|
+
#### Configuration via Dashboard
|
|
300
|
+
|
|
301
|
+
1. Open the Panopticon dashboard and navigate to **Settings**
|
|
302
|
+
2. Configure **API keys** for external providers:
|
|
303
|
+
- OpenAI API Key
|
|
304
|
+
- Google AI API Key
|
|
305
|
+
- Z.AI API Key
|
|
306
|
+
3. Configure **models per agent type**:
|
|
307
|
+
- Review Agent - Model for code review
|
|
308
|
+
- Test Agent - Model for running tests
|
|
309
|
+
- Merge Agent - Model for handling merges
|
|
310
|
+
- Planning Agent - Model for autonomous planning
|
|
311
|
+
4. Configure **models by task complexity** (for PAN-75):
|
|
312
|
+
- Trivial tasks → Cost-effective models (e.g., `claude-haiku-4-5`)
|
|
313
|
+
- Expert tasks → Most capable models (e.g., `claude-opus-4-5`)
|
|
314
|
+
|
|
315
|
+
**Configuration Files:**
|
|
316
|
+
|
|
317
|
+
Panopticon uses YAML-based configuration (new in v0.5+):
|
|
318
|
+
|
|
319
|
+
| File | Purpose |
|
|
320
|
+
|------|---------|
|
|
321
|
+
| `~/.panopticon/config.yaml` | Global model settings, provider enable/disable, API key references |
|
|
322
|
+
| `~/.panopticon.env` | API keys and sensitive credentials (auto-loaded) |
|
|
323
|
+
| `.panopticon.yaml` | Per-project config (optional, overrides global) |
|
|
324
|
+
|
|
325
|
+
**Security:** For added security, restrict file permissions:
|
|
326
|
+
```bash
|
|
327
|
+
chmod 600 ~/.panopticon/config.yaml ~/.panopticon.env
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**Environment Variables:** API keys are loaded from `~/.panopticon.env` at startup:
|
|
331
|
+
```bash
|
|
332
|
+
# ~/.panopticon.env
|
|
333
|
+
KIMI_API_KEY="sk-kimi-..."
|
|
334
|
+
OPENAI_API_KEY="sk-..."
|
|
335
|
+
GOOGLE_AI_KEY="AIza..."
|
|
336
|
+
ZAI_API_KEY="..."
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
In `config.yaml`, reference them with `$` syntax:
|
|
340
|
+
```yaml
|
|
341
|
+
models:
|
|
342
|
+
providers:
|
|
343
|
+
kimi:
|
|
344
|
+
enabled: true
|
|
345
|
+
api_key: $KIMI_API_KEY
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
#### Router Configuration
|
|
349
|
+
|
|
350
|
+
**Panopticon owns the router configuration.** When you save settings in the dashboard, Panopticon automatically generates `~/.claude-code-router/config.json` with the appropriate provider and routing configuration. Manual edits to this file will be overwritten on the next settings change.
|
|
351
|
+
|
|
352
|
+
#### Example Use Cases
|
|
353
|
+
|
|
354
|
+
**Cost optimization:**
|
|
355
|
+
```
|
|
356
|
+
Specialist agents → claude-sonnet-4-5 (balanced)
|
|
357
|
+
Planning agent → claude-opus-4-5 (most capable)
|
|
358
|
+
Simple tasks → claude-haiku-4-5 (cost-effective)
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**Multi-provider setup:**
|
|
362
|
+
```
|
|
363
|
+
Code review → gpt-4o (OpenAI's code understanding)
|
|
364
|
+
Testing → claude-sonnet-4-5 (Anthropic's reliability)
|
|
365
|
+
Planning → claude-opus-4-5 (Anthropic's reasoning)
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**Research-heavy workflows:**
|
|
369
|
+
```
|
|
370
|
+
Research tasks → o3-deep-research (OpenAI)
|
|
371
|
+
Implementation → claude-sonnet-4-5 (Anthropic)
|
|
372
|
+
Code review → gemini-3-pro-preview (Google)
|
|
373
|
+
```
|
|
374
|
+
|
|
271
375
|
### Register Projects
|
|
272
376
|
|
|
273
377
|
Register your local project directories so Panopticon knows where to create workspaces:
|
|
@@ -303,6 +407,109 @@ If you have multiple Linear projects, configure which local directory each maps
|
|
|
303
407
|
|
|
304
408
|
The dashboard uses this mapping to determine where to create workspaces when you click "Create Workspace" or "Start Agent" for an issue.
|
|
305
409
|
|
|
410
|
+
## Google Stitch Integration
|
|
411
|
+
|
|
412
|
+
Panopticon integrates with [Google Stitch](https://stitch.withgoogle.com), Google's AI-powered UI design tool, enabling design-to-code workflows.
|
|
413
|
+
|
|
414
|
+
### What is Google Stitch?
|
|
415
|
+
|
|
416
|
+
Google Stitch generates production-ready UI designs from natural language prompts or image inputs. It's free (350 standard + 50 experimental generations/month) and requires only a Google account.
|
|
417
|
+
|
|
418
|
+
### Setup (Optional)
|
|
419
|
+
|
|
420
|
+
Use the `/pan-stitch` skill to set up the integration:
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
# Run the setup skill
|
|
424
|
+
/pan-stitch
|
|
425
|
+
|
|
426
|
+
# Or manually:
|
|
427
|
+
# 1. Install gcloud CLI
|
|
428
|
+
curl -sSL https://sdk.cloud.google.com | bash
|
|
429
|
+
|
|
430
|
+
# 2. Authenticate
|
|
431
|
+
gcloud auth login
|
|
432
|
+
gcloud auth application-default login
|
|
433
|
+
|
|
434
|
+
# 3. Create project and enable API
|
|
435
|
+
gcloud projects create stitch-tools-$(date +%s)
|
|
436
|
+
gcloud config set project YOUR_PROJECT_ID
|
|
437
|
+
gcloud billing projects link YOUR_PROJECT_ID --billing-account=YOUR_BILLING_ID
|
|
438
|
+
gcloud beta services mcp enable stitch.googleapis.com # MUST use beta!
|
|
439
|
+
|
|
440
|
+
# 4. Register MCP (note "proxy" subcommand)
|
|
441
|
+
claude mcp add -e GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID -s user stitch -- npx -y @_davideast/stitch-mcp proxy
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### How It Works
|
|
445
|
+
|
|
446
|
+
When Stitch is configured, the planning agent can:
|
|
447
|
+
|
|
448
|
+
1. **Create UI designs** - Generate screens for UI-related issues
|
|
449
|
+
2. **Document in STATE.md** - Record Stitch project/screen IDs for workers
|
|
450
|
+
3. **Worker agents pick up designs** - Use the Stitch skills to convert to React
|
|
451
|
+
|
|
452
|
+
### Bidirectional Sync
|
|
453
|
+
|
|
454
|
+
Designs are stored in your Google account and sync bidirectionally:
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
Planning Agent creates design via MCP
|
|
458
|
+
↓
|
|
459
|
+
Stored in Google Cloud (your account)
|
|
460
|
+
↓
|
|
461
|
+
Visible on stitch.withgoogle.com
|
|
462
|
+
↓
|
|
463
|
+
Worker agent retrieves via MCP → converts to React
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
- **MCP → Web UI:** Designs created by agents appear in Stitch web UI
|
|
467
|
+
- **Web UI → MCP:** Designs created in web UI are accessible to agents
|
|
468
|
+
- **Edit anywhere:** Refine AI-generated designs in the web UI before workers convert them
|
|
469
|
+
|
|
470
|
+
### Available MCP Tools
|
|
471
|
+
|
|
472
|
+
| Tool | Purpose |
|
|
473
|
+
|------|---------|
|
|
474
|
+
| `create_project` | Create a new Stitch project |
|
|
475
|
+
| `list_projects` | List all your projects (owned/shared) |
|
|
476
|
+
| `get_project` | Get project details |
|
|
477
|
+
| `list_screens` | List screens in a project |
|
|
478
|
+
| `get_screen` | Get screen details + HTML/CSS download URLs |
|
|
479
|
+
| `generate_screen_from_text` | Generate a screen from a text prompt |
|
|
480
|
+
|
|
481
|
+
### Stitch Skills
|
|
482
|
+
|
|
483
|
+
| Skill | Purpose |
|
|
484
|
+
|-------|---------|
|
|
485
|
+
| `/pan-stitch` | Setup and configure Stitch MCP |
|
|
486
|
+
| `/stitch-design-md` | Create DESIGN.md from Stitch projects |
|
|
487
|
+
| `/stitch-react-components` | Convert Stitch HTML to React components |
|
|
488
|
+
|
|
489
|
+
### STATE.md Integration
|
|
490
|
+
|
|
491
|
+
When planning UI work, add a Stitch section to STATE.md:
|
|
492
|
+
|
|
493
|
+
```markdown
|
|
494
|
+
## UI Designs
|
|
495
|
+
|
|
496
|
+
### Stitch Assets
|
|
497
|
+
- **Project ID:** 12345678
|
|
498
|
+
- **Screen:** "Dashboard" (screen ID: 87654321)
|
|
499
|
+
- **Design Notes:** Dark mode, glassmorphism cards, gradient accents
|
|
500
|
+
- **DESIGN.md:** Generated at `src/components/DESIGN.md`
|
|
501
|
+
|
|
502
|
+
Worker: Use `/stitch-react-components` to convert the Dashboard screen to React.
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
### Manual Workflow (No MCP)
|
|
506
|
+
|
|
507
|
+
If you prefer not to set up the MCP:
|
|
508
|
+
|
|
509
|
+
1. Design at https://stitch.withgoogle.com
|
|
510
|
+
2. Export HTML/CSS from the UI
|
|
511
|
+
3. Use `/stitch-react-components` with the exported files
|
|
512
|
+
|
|
306
513
|
## Cloister: AI Lifecycle Manager
|
|
307
514
|
|
|
308
515
|
Cloister is Panopticon's intelligent agent lifecycle manager. It monitors all running agents and automatically handles:
|
|
@@ -389,6 +596,90 @@ The merge-agent uses a specialized prompt template that instructs it to:
|
|
|
389
596
|
- Document conflict resolution decisions
|
|
390
597
|
- Provide detailed feedback on what was merged
|
|
391
598
|
|
|
599
|
+
#### Review Pipeline Flow
|
|
600
|
+
|
|
601
|
+
The review pipeline is a sequential handoff between specialists:
|
|
602
|
+
|
|
603
|
+
```
|
|
604
|
+
Human clicks "Review"
|
|
605
|
+
│
|
|
606
|
+
▼
|
|
607
|
+
┌───────────────────┐
|
|
608
|
+
│ review-agent │ Reviews code, checks for issues
|
|
609
|
+
└─────────┬─────────┘
|
|
610
|
+
│ If PASSED: queues test-agent
|
|
611
|
+
│ If BLOCKED: sends feedback to work-agent
|
|
612
|
+
▼
|
|
613
|
+
┌───────────────────┐
|
|
614
|
+
│ test-agent │ Runs test suite, analyzes failures
|
|
615
|
+
└─────────┬─────────┘
|
|
616
|
+
│ If PASSED: marks ready for merge
|
|
617
|
+
│ If FAILED: sends feedback to work-agent
|
|
618
|
+
▼
|
|
619
|
+
┌───────────────────┐
|
|
620
|
+
│ (Human clicks │ Human approval required
|
|
621
|
+
│ "Approve & Merge"│ before merge
|
|
622
|
+
└─────────┬─────────┘
|
|
623
|
+
▼
|
|
624
|
+
┌───────────────────┐
|
|
625
|
+
│ merge-agent │ Performs merge, resolves conflicts
|
|
626
|
+
└───────────────────┘
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
**Key Points:**
|
|
630
|
+
- **Human-initiated start** - A human must click "Review" to start the pipeline
|
|
631
|
+
- **Automatic handoffs** - review-agent → test-agent happens automatically
|
|
632
|
+
- **Human approval for merge** - Merge is NOT automatic; human clicks "Approve & Merge"
|
|
633
|
+
- **Feedback loops** - Failed reviews/tests send feedback back to the work-agent
|
|
634
|
+
|
|
635
|
+
#### Queue Processing
|
|
636
|
+
|
|
637
|
+
Each specialist has a task queue (`~/.panopticon/specialists/{name}/hook.json`) managed via the FPP (Fixed Point Principle):
|
|
638
|
+
|
|
639
|
+
```
|
|
640
|
+
1. Task arrives (via API or handoff)
|
|
641
|
+
│
|
|
642
|
+
▼
|
|
643
|
+
2. wakeSpecialistOrQueue() checks if specialist is busy
|
|
644
|
+
│
|
|
645
|
+
├── If IDLE: Wake specialist immediately with task
|
|
646
|
+
│
|
|
647
|
+
└── If BUSY: Add task to queue (hook.json)
|
|
648
|
+
│
|
|
649
|
+
▼
|
|
650
|
+
3. When specialist completes current task:
|
|
651
|
+
│
|
|
652
|
+
├── Updates status via API (passed/failed/skipped)
|
|
653
|
+
│
|
|
654
|
+
└── Dashboard automatically wakes specialist for next queued task
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
**Queue priority order:** `urgent` > `high` > `normal` > `low`
|
|
658
|
+
|
|
659
|
+
**Completion triggers:** When a specialist reports status (`passed`, `failed`, or `skipped`), the dashboard:
|
|
660
|
+
1. Sets the specialist state to `idle`
|
|
661
|
+
2. Checks the specialist's queue for pending work
|
|
662
|
+
3. If work exists, immediately wakes the specialist with the next task
|
|
663
|
+
|
|
664
|
+
#### Agent Self-Requeue (Circuit Breaker)
|
|
665
|
+
|
|
666
|
+
After a human initiates the first review, work-agents can request re-review up to 3 times automatically:
|
|
667
|
+
|
|
668
|
+
```bash
|
|
669
|
+
# Work-agent requests re-review after fixing issues
|
|
670
|
+
pan work request-review MIN-123 -m "Fixed: added tests for edge cases"
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
**Circuit breaker behavior:**
|
|
674
|
+
- First human click resets the counter to 0
|
|
675
|
+
- Each `pan work request-review` increments the counter
|
|
676
|
+
- After 3 automatic re-requests, returns HTTP 429
|
|
677
|
+
- Human must click "Review" in dashboard to continue
|
|
678
|
+
|
|
679
|
+
This prevents infinite loops where an agent repeatedly fails review.
|
|
680
|
+
|
|
681
|
+
**API endpoint:** `POST /api/workspaces/:issueId/request-review`
|
|
682
|
+
|
|
392
683
|
#### Specialist Auto-Initialization
|
|
393
684
|
|
|
394
685
|
When Cloister starts, it automatically initializes specialists that don't exist yet. This ensures the test-agent, review-agent, and merge-agent are ready to receive wake signals without manual setup.
|
|
@@ -626,33 +917,593 @@ projects:
|
|
|
626
917
|
- default: true
|
|
627
918
|
path: /home/user/projects/myn
|
|
628
919
|
|
|
629
|
-
panopticon:
|
|
630
|
-
name: "Panopticon"
|
|
631
|
-
path: /home/user/projects/panopticon
|
|
632
|
-
linear_team: PAN
|
|
920
|
+
panopticon:
|
|
921
|
+
name: "Panopticon"
|
|
922
|
+
path: /home/user/projects/panopticon
|
|
923
|
+
linear_team: PAN
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
### Label-Based Routing
|
|
927
|
+
|
|
928
|
+
Issues are routed to different subdirectories based on their labels:
|
|
929
|
+
|
|
930
|
+
1. **Labeled issues** - Matched against `issue_routing` rules in order
|
|
931
|
+
2. **Default route** - Issues without matching labels use the `default: true` path
|
|
932
|
+
3. **Fallback** - If no default, uses the project root path
|
|
933
|
+
|
|
934
|
+
Example: An issue with label "splash" in the MIN team would create its workspace at `/home/user/projects/myn/splash/workspaces/feature-min-xxx/`.
|
|
935
|
+
|
|
936
|
+
### Custom Workspace Commands (Legacy)
|
|
937
|
+
|
|
938
|
+
> **Note:** For most polyrepo projects, use the built-in `workspace` configuration (see below) instead of custom scripts. Custom commands are only needed for highly specialized setups.
|
|
939
|
+
|
|
940
|
+
For projects that need logic beyond what the configuration supports, you can specify custom workspace scripts:
|
|
941
|
+
|
|
942
|
+
```yaml
|
|
943
|
+
projects:
|
|
944
|
+
myn:
|
|
945
|
+
name: "Mind Your Now"
|
|
946
|
+
path: /home/user/projects/myn
|
|
947
|
+
linear_team: MIN
|
|
948
|
+
# Custom scripts handle complex workspace setup
|
|
949
|
+
workspace_command: /home/user/projects/myn/infra/new-feature
|
|
950
|
+
workspace_remove_command: /home/user/projects/myn/infra/remove-feature
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
When `workspace_command` is specified, Panopticon calls your script instead of creating a standard git worktree. The script receives the normalized issue ID (e.g., `min-123`) as an argument.
|
|
954
|
+
|
|
955
|
+
When `workspace_remove_command` is specified, Panopticon calls your script when deleting workspaces (e.g., aborting planning with "delete workspace" enabled). This is important for complex setups that need to:
|
|
956
|
+
- Stop Docker containers and remove volumes
|
|
957
|
+
- Clean up root-owned files created by containers
|
|
958
|
+
- Remove git worktrees from multiple repositories
|
|
959
|
+
- Release port assignments
|
|
960
|
+
- Remove DNS entries
|
|
961
|
+
|
|
962
|
+
**What your custom script should handle:**
|
|
963
|
+
- Creating git worktrees for multiple repositories (polyrepo structure)
|
|
964
|
+
- Setting up Docker Compose files and dev containers
|
|
965
|
+
- Configuring environment variables and `.env` files
|
|
966
|
+
- Setting up DNS entries for workspace-specific URLs (e.g., Traefik routing)
|
|
967
|
+
- Creating a `./dev` script for container management
|
|
968
|
+
- Copying agent configuration templates (CLAUDE.md, .mcp.json, etc.)
|
|
969
|
+
|
|
970
|
+
**Example script flow:**
|
|
971
|
+
```bash
|
|
972
|
+
#!/bin/bash
|
|
973
|
+
# new-feature script for a polyrepo project
|
|
974
|
+
ISSUE_ID=$1 # e.g., "min-123"
|
|
975
|
+
|
|
976
|
+
# Create worktrees for frontend and api repos
|
|
977
|
+
git -C /path/to/frontend worktree add ../workspaces/feature-$ISSUE_ID/fe feature/$ISSUE_ID
|
|
978
|
+
git -C /path/to/api worktree add ../workspaces/feature-$ISSUE_ID/api feature/$ISSUE_ID
|
|
979
|
+
|
|
980
|
+
# Generate docker-compose from templates
|
|
981
|
+
sed "s/{{FEATURE_FOLDER}}/feature-$ISSUE_ID/g" template.yml > workspace/docker-compose.yml
|
|
982
|
+
|
|
983
|
+
# Set up DNS and Traefik routing
|
|
984
|
+
# ... additional setup
|
|
985
|
+
```
|
|
986
|
+
|
|
987
|
+
The standard `pan workspace create` command will automatically detect and use your custom script.
|
|
988
|
+
|
|
989
|
+
#### Container Configuration Tips
|
|
990
|
+
|
|
991
|
+
When setting up Docker containers for workspaces, avoid these common pitfalls:
|
|
992
|
+
|
|
993
|
+
**Maven projects:**
|
|
994
|
+
- DO NOT set `MAVEN_CONFIG=/some/path` as an environment variable
|
|
995
|
+
- Maven interprets `MAVEN_CONFIG` as additional CLI arguments, not a directory path
|
|
996
|
+
- This causes "Unknown lifecycle phase" errors (e.g., "Unknown lifecycle phase /maven-cache")
|
|
997
|
+
- Instead, use `-Dmaven.repo.local=/path/to/cache` in the Maven command
|
|
998
|
+
|
|
999
|
+
```yaml
|
|
1000
|
+
# WRONG - causes Maven startup failure
|
|
1001
|
+
environment:
|
|
1002
|
+
- MAVEN_CONFIG=/maven-cache
|
|
1003
|
+
|
|
1004
|
+
# CORRECT - use command line argument
|
|
1005
|
+
command: ./mvnw spring-boot:run -Dmaven.repo.local=/maven-cache/repository
|
|
1006
|
+
volumes:
|
|
1007
|
+
- ~/.m2:/maven-cache:cached
|
|
1008
|
+
```
|
|
1009
|
+
|
|
1010
|
+
**pnpm projects:**
|
|
1011
|
+
- Set `PNPM_HOME=/path` to configure the pnpm store location
|
|
1012
|
+
- Mount a named volume for the store to share across containers
|
|
1013
|
+
|
|
1014
|
+
### What Your Project Needs to Provide
|
|
1015
|
+
|
|
1016
|
+
Panopticon is an orchestration layer - it manages workspaces, agents, and workflows, but **your project repository provides the actual templates and configuration**.
|
|
1017
|
+
|
|
1018
|
+
Projects can be as simple as just a git repo (for worktree-only workspaces) or as complex as a full polyrepo with Docker, Traefik, and database seeding. Here's what you need for each level:
|
|
1019
|
+
|
|
1020
|
+
### Required: Workspace Templates
|
|
1021
|
+
|
|
1022
|
+
Your project needs a `.devcontainer/` or template directory with:
|
|
1023
|
+
|
|
1024
|
+
```
|
|
1025
|
+
your-project/
|
|
1026
|
+
├── infra/
|
|
1027
|
+
│ └── .devcontainer-template/ # Template for workspace containers
|
|
1028
|
+
│ ├── docker-compose.devcontainer.yml.template
|
|
1029
|
+
│ ├── compose.infra.yml.template # Optional: separate infra services
|
|
1030
|
+
│ ├── Dockerfile
|
|
1031
|
+
│ └── devcontainer.json.template
|
|
1032
|
+
└── ...
|
|
1033
|
+
```
|
|
1034
|
+
|
|
1035
|
+
**Docker Compose templates** should use placeholders that Panopticon will replace:
|
|
1036
|
+
|
|
1037
|
+
```yaml
|
|
1038
|
+
# docker-compose.devcontainer.yml.template
|
|
1039
|
+
services:
|
|
1040
|
+
api:
|
|
1041
|
+
build: ./api
|
|
1042
|
+
user: vscode # Run as non-root to avoid permission issues
|
|
1043
|
+
labels:
|
|
1044
|
+
- "traefik.http.routers.{{FEATURE_FOLDER}}-api.rule=Host(`api-{{FEATURE_FOLDER}}.{{DOMAIN}}`)"
|
|
1045
|
+
environment:
|
|
1046
|
+
- DATABASE_URL=postgres://app:app@postgres:5432/mydb
|
|
1047
|
+
|
|
1048
|
+
frontend:
|
|
1049
|
+
build: ./fe
|
|
1050
|
+
user: vscode # Run as non-root to avoid permission issues
|
|
1051
|
+
labels:
|
|
1052
|
+
- "traefik.http.routers.{{FEATURE_FOLDER}}.rule=Host(`{{FEATURE_FOLDER}}.{{DOMAIN}}`)"
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
> **⚠️ Important: File Permissions**
|
|
1056
|
+
>
|
|
1057
|
+
> Always run containers as a non-root user (e.g., `user: vscode`) to avoid permission issues.
|
|
1058
|
+
> Files created by root-owned containers cannot be removed by `pan workspace destroy` without sudo.
|
|
1059
|
+
> The Microsoft devcontainers base image includes a `vscode` user (UID 1000) that matches most host users.
|
|
1060
|
+
|
|
1061
|
+
### Required for HTTPS: Traefik Configuration
|
|
1062
|
+
|
|
1063
|
+
If you want local HTTPS (recommended), provide a Traefik compose file:
|
|
1064
|
+
|
|
1065
|
+
```
|
|
1066
|
+
your-project/
|
|
1067
|
+
├── infra/
|
|
1068
|
+
│ └── docker-compose.traefik.yml # Traefik reverse proxy
|
|
1069
|
+
└── ...
|
|
1070
|
+
```
|
|
1071
|
+
|
|
1072
|
+
Example Traefik config:
|
|
1073
|
+
```yaml
|
|
1074
|
+
# infra/docker-compose.traefik.yml
|
|
1075
|
+
services:
|
|
1076
|
+
traefik:
|
|
1077
|
+
image: traefik:v2.10
|
|
1078
|
+
ports:
|
|
1079
|
+
- "80:80"
|
|
1080
|
+
- "443:443"
|
|
1081
|
+
volumes:
|
|
1082
|
+
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
1083
|
+
- ~/.panopticon/traefik/certs:/certs:ro
|
|
1084
|
+
command:
|
|
1085
|
+
- --providers.docker=true
|
|
1086
|
+
- --entrypoints.web.address=:80
|
|
1087
|
+
- --entrypoints.websecure.address=:443
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
### Required for Database Seeding: Seed Directory
|
|
1091
|
+
|
|
1092
|
+
For projects with databases:
|
|
1093
|
+
|
|
1094
|
+
```
|
|
1095
|
+
your-project/
|
|
1096
|
+
├── infra/
|
|
1097
|
+
│ └── seed/
|
|
1098
|
+
│ └── seed.sql # Sanitized production data
|
|
1099
|
+
└── ...
|
|
1100
|
+
```
|
|
1101
|
+
|
|
1102
|
+
Your compose template should mount this:
|
|
1103
|
+
```yaml
|
|
1104
|
+
services:
|
|
1105
|
+
postgres:
|
|
1106
|
+
image: postgres:16
|
|
1107
|
+
volumes:
|
|
1108
|
+
- /path/to/project/infra/seed:/docker-entrypoint-initdb.d:ro
|
|
1109
|
+
```
|
|
1110
|
+
|
|
1111
|
+
### Optional: Agent Templates
|
|
1112
|
+
|
|
1113
|
+
For customizing how agents work in your project:
|
|
1114
|
+
|
|
1115
|
+
```
|
|
1116
|
+
your-project/
|
|
1117
|
+
├── infra/
|
|
1118
|
+
│ └── .agent-template/
|
|
1119
|
+
│ ├── CLAUDE.md.template # Project-specific AI instructions
|
|
1120
|
+
│ └── .mcp.json.template # MCP server configuration
|
|
1121
|
+
└── .claude/
|
|
1122
|
+
└── skills/ # Project-specific skills
|
|
1123
|
+
└── my-project-standards/
|
|
1124
|
+
└── SKILL.md
|
|
1125
|
+
```
|
|
1126
|
+
|
|
1127
|
+
### Configuration in projects.yaml
|
|
1128
|
+
|
|
1129
|
+
Point Panopticon to your templates:
|
|
1130
|
+
|
|
1131
|
+
```yaml
|
|
1132
|
+
# ~/.panopticon/projects.yaml
|
|
1133
|
+
projects:
|
|
1134
|
+
myproject:
|
|
1135
|
+
name: "My Project"
|
|
1136
|
+
path: /home/user/projects/myproject
|
|
1137
|
+
linear_team: PRJ
|
|
1138
|
+
|
|
1139
|
+
workspace:
|
|
1140
|
+
type: polyrepo # or monorepo
|
|
1141
|
+
workspaces_dir: workspaces
|
|
1142
|
+
|
|
1143
|
+
docker:
|
|
1144
|
+
traefik: infra/docker-compose.traefik.yml
|
|
1145
|
+
compose_template: infra/.devcontainer-template
|
|
1146
|
+
|
|
1147
|
+
database:
|
|
1148
|
+
seed_file: /home/user/projects/myproject/infra/seed/seed.sql
|
|
1149
|
+
container_name: "{{PROJECT}}-postgres-1"
|
|
1150
|
+
|
|
1151
|
+
agent:
|
|
1152
|
+
template_dir: infra/.agent-template
|
|
1153
|
+
templates:
|
|
1154
|
+
- source: CLAUDE.md.template
|
|
1155
|
+
target: CLAUDE.md
|
|
1156
|
+
```
|
|
1157
|
+
|
|
1158
|
+
### Quick Checklist
|
|
1159
|
+
|
|
1160
|
+
| Component | Required? | Location | Purpose |
|
|
1161
|
+
|-----------|-----------|----------|---------|
|
|
1162
|
+
| Docker Compose template | Yes (for Docker workspaces) | `infra/.devcontainer-template/` | Container configuration |
|
|
1163
|
+
| Traefik config | Only for HTTPS | `infra/docker-compose.traefik.yml` | Reverse proxy |
|
|
1164
|
+
| Seed file | Only if database needed | `infra/seed/seed.sql` | Pre-populate database |
|
|
1165
|
+
| Agent template | Recommended | `infra/.agent-template/` | AI instructions |
|
|
1166
|
+
| Project skills | Optional | `.claude/skills/` | Project-specific workflows |
|
|
1167
|
+
|
|
1168
|
+
### Example: Minimal Setup
|
|
1169
|
+
|
|
1170
|
+
For a simple monorepo with no Docker:
|
|
1171
|
+
|
|
1172
|
+
```yaml
|
|
1173
|
+
# ~/.panopticon/projects.yaml
|
|
1174
|
+
projects:
|
|
1175
|
+
simple-app:
|
|
1176
|
+
name: "Simple App"
|
|
1177
|
+
path: /home/user/projects/simple-app
|
|
1178
|
+
linear_team: APP
|
|
1179
|
+
# No workspace config needed - uses git worktrees
|
|
1180
|
+
```
|
|
1181
|
+
|
|
1182
|
+
Panopticon creates workspaces as git worktrees. Docker, HTTPS, and seeding are opt-in.
|
|
1183
|
+
|
|
1184
|
+
---
|
|
1185
|
+
|
|
1186
|
+
## Polyrepo Workspace Configuration
|
|
1187
|
+
|
|
1188
|
+
For projects with multiple git repositories (like separate frontend/backend repos), configure workspace settings directly in `projects.yaml`.
|
|
1189
|
+
|
|
1190
|
+
### Recommended: Separate Infra Repository
|
|
1191
|
+
|
|
1192
|
+
For polyrepo projects, we strongly recommend maintaining a **dedicated infrastructure repository** alongside your code repos:
|
|
1193
|
+
|
|
1194
|
+
```
|
|
1195
|
+
myproject/
|
|
1196
|
+
├── infra/ # Infrastructure repo (git)
|
|
1197
|
+
│ ├── .devcontainer-template/ # Templates for workspace creation
|
|
1198
|
+
│ │ ├── dev.template # Dev script template
|
|
1199
|
+
│ │ ├── compose.infra.yml.template
|
|
1200
|
+
│ │ └── docker-compose.devcontainer.yml.template
|
|
1201
|
+
│ ├── new-feature # Script to create workspaces
|
|
1202
|
+
│ ├── remove-feature # Script to clean up workspaces
|
|
1203
|
+
│ ├── certs/ # SSL certificates
|
|
1204
|
+
│ └── traefik/ # Traefik config
|
|
1205
|
+
├── frontend/ # Frontend repo (git)
|
|
1206
|
+
├── backend/ # Backend repo (git)
|
|
1207
|
+
└── workspaces/ # Feature workspaces (git worktrees)
|
|
1208
|
+
└── feature-xxx/
|
|
1209
|
+
├── fe/ # Worktree of frontend
|
|
1210
|
+
├── api/ # Worktree of backend
|
|
1211
|
+
└── .devcontainer/ # Generated from templates
|
|
1212
|
+
```
|
|
1213
|
+
|
|
1214
|
+
**Benefits of a separate infra repo:**
|
|
1215
|
+
|
|
1216
|
+
1. **Version-controlled templates** - Dev script changes are tracked and shared
|
|
1217
|
+
2. **Centralized configuration** - DNS, ports, Traefik rules in one place
|
|
1218
|
+
3. **Workspace consistency** - All workspaces use the same templates
|
|
1219
|
+
4. **Team collaboration** - Infra changes go through normal PR review
|
|
1220
|
+
5. **Easy updates** - Fix a template once, regenerate affected workspaces
|
|
1221
|
+
|
|
1222
|
+
**Key files in the infra repo:**
|
|
1223
|
+
|
|
1224
|
+
| File | Purpose |
|
|
1225
|
+
|------|---------|
|
|
1226
|
+
| `dev.template` | Template for `./dev` script (container management) |
|
|
1227
|
+
| `new-feature` | Creates workspace with git worktrees + devcontainer |
|
|
1228
|
+
| `remove-feature` | Cleans up workspace and worktrees |
|
|
1229
|
+
| `.devcontainer-template/` | Docker Compose and devcontainer templates |
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
```yaml
|
|
1234
|
+
projects:
|
|
1235
|
+
myapp:
|
|
1236
|
+
name: "My App"
|
|
1237
|
+
path: /home/user/projects/myapp
|
|
1238
|
+
linear_team: APP
|
|
1239
|
+
|
|
1240
|
+
workspace:
|
|
1241
|
+
type: polyrepo
|
|
1242
|
+
workspaces_dir: workspaces
|
|
1243
|
+
# Default branch for all repos (optional, defaults to 'main')
|
|
1244
|
+
default_branch: main
|
|
1245
|
+
|
|
1246
|
+
# Git repositories to include in each workspace
|
|
1247
|
+
# Each repo is a SEPARATE git repository with its own .git
|
|
1248
|
+
repos:
|
|
1249
|
+
- name: fe
|
|
1250
|
+
path: frontend # Relative to project root
|
|
1251
|
+
branch_prefix: "feature/"
|
|
1252
|
+
# default_branch: main # Can override workspace default per-repo
|
|
1253
|
+
- name: api
|
|
1254
|
+
path: backend
|
|
1255
|
+
branch_prefix: "feature/"
|
|
1256
|
+
# default_branch: develop # Example: API uses 'develop' as default
|
|
1257
|
+
|
|
1258
|
+
# DNS entries for local development
|
|
1259
|
+
dns:
|
|
1260
|
+
domain: myapp.test
|
|
1261
|
+
entries:
|
|
1262
|
+
- "{{FEATURE_FOLDER}}.{{DOMAIN}}"
|
|
1263
|
+
- "api-{{FEATURE_FOLDER}}.{{DOMAIN}}"
|
|
1264
|
+
sync_method: wsl2hosts # or: hosts_file, dnsmasq
|
|
1265
|
+
|
|
1266
|
+
# Port assignments for services
|
|
1267
|
+
ports:
|
|
1268
|
+
redis:
|
|
1269
|
+
range: [6380, 6499]
|
|
1270
|
+
|
|
1271
|
+
# Service definitions - how to start each service
|
|
1272
|
+
services:
|
|
1273
|
+
- name: api
|
|
1274
|
+
path: api
|
|
1275
|
+
start_command: ./mvnw spring-boot:run
|
|
1276
|
+
docker_command: ./mvnw spring-boot:run
|
|
1277
|
+
health_url: "https://api-{{FEATURE_FOLDER}}.{{DOMAIN}}/actuator/health"
|
|
1278
|
+
port: 8080
|
|
1279
|
+
- name: frontend
|
|
1280
|
+
path: fe
|
|
1281
|
+
start_command: pnpm start
|
|
1282
|
+
docker_command: pnpm start
|
|
1283
|
+
health_url: "https://{{FEATURE_FOLDER}}.{{DOMAIN}}"
|
|
1284
|
+
port: 3000
|
|
1285
|
+
|
|
1286
|
+
# Docker configuration
|
|
1287
|
+
docker:
|
|
1288
|
+
traefik: infra/docker-compose.traefik.yml
|
|
1289
|
+
compose_template: infra/.devcontainer-template
|
|
1290
|
+
|
|
1291
|
+
# Agent configuration templates
|
|
1292
|
+
agent:
|
|
1293
|
+
template_dir: infra/.agent-template
|
|
1294
|
+
templates:
|
|
1295
|
+
- source: CLAUDE.md.template
|
|
1296
|
+
target: CLAUDE.md
|
|
1297
|
+
symlinks:
|
|
1298
|
+
- .claude/commands
|
|
1299
|
+
- .claude/skills
|
|
1300
|
+
|
|
1301
|
+
# Environment template
|
|
1302
|
+
env:
|
|
1303
|
+
template: |
|
|
1304
|
+
COMPOSE_PROJECT_NAME={{COMPOSE_PROJECT}}
|
|
1305
|
+
FRONTEND_URL=https://{{FEATURE_FOLDER}}.{{DOMAIN}}
|
|
1306
|
+
```
|
|
1307
|
+
|
|
1308
|
+
**Template Placeholders:**
|
|
1309
|
+
|
|
1310
|
+
| Placeholder | Example | Description |
|
|
1311
|
+
|------------|---------|-------------|
|
|
1312
|
+
| `{{FEATURE_NAME}}` | `min-123` | Normalized issue ID |
|
|
1313
|
+
| `{{FEATURE_FOLDER}}` | `feature-min-123` | Workspace folder name |
|
|
1314
|
+
| `{{BRANCH_NAME}}` | `feature/min-123` | Git branch name |
|
|
1315
|
+
| `{{COMPOSE_PROJECT}}` | `myapp-feature-min-123` | Docker Compose project |
|
|
1316
|
+
| `{{DOMAIN}}` | `myapp.test` | DNS domain |
|
|
1317
|
+
|
|
1318
|
+
**Service Templates:**
|
|
1319
|
+
|
|
1320
|
+
Panopticon provides built-in templates for common frameworks. Use these to avoid boilerplate:
|
|
1321
|
+
|
|
1322
|
+
| Template | Start Command | Port |
|
|
1323
|
+
|----------|--------------|------|
|
|
1324
|
+
| `react` | `npm start` | 3000 |
|
|
1325
|
+
| `react-vite` | `npm run dev` | 5173 |
|
|
1326
|
+
| `react-pnpm` | `pnpm start` | 3000 |
|
|
1327
|
+
| `nextjs` | `npm run dev` | 3000 |
|
|
1328
|
+
| `spring-boot-maven` | `./mvnw spring-boot:run` | 8080 |
|
|
1329
|
+
| `spring-boot-gradle` | `./gradlew bootRun` | 8080 |
|
|
1330
|
+
| `express` | `npm start` | 3000 |
|
|
1331
|
+
| `fastapi` | `uvicorn main:app --reload` | 8000 |
|
|
1332
|
+
| `django` | `python manage.py runserver` | 8000 |
|
|
1333
|
+
|
|
1334
|
+
Use a template by referencing it in your service config:
|
|
1335
|
+
|
|
1336
|
+
```yaml
|
|
1337
|
+
services:
|
|
1338
|
+
- name: api
|
|
1339
|
+
template: spring-boot-maven
|
|
1340
|
+
path: api
|
|
1341
|
+
health_url: "https://api-{{FEATURE_FOLDER}}.myapp.test/health"
|
|
1342
|
+
```
|
|
1343
|
+
|
|
1344
|
+
See `/pan-workspace-config` skill for complete documentation.
|
|
1345
|
+
|
|
1346
|
+
### Polyrepo Merge Considerations
|
|
1347
|
+
|
|
1348
|
+
> **⚠️ Important:** Polyrepo merging requires special handling. The current merge-agent is optimized for monorepos.
|
|
1349
|
+
|
|
1350
|
+
For polyrepo projects:
|
|
1351
|
+
|
|
1352
|
+
| Feature | Status | Notes |
|
|
1353
|
+
|---------|--------|-------|
|
|
1354
|
+
| Workspace creation | ✅ Supported | Creates worktrees in each repo |
|
|
1355
|
+
| Branch management | ✅ Supported | Each repo gets its own feature branch |
|
|
1356
|
+
| Agent work | ✅ Supported | Agents can work across repos |
|
|
1357
|
+
| Merge | ⚠️ Manual | Push each repo's branch, merge via GitLab/GitHub |
|
|
1358
|
+
|
|
1359
|
+
**Current workflow for polyrepo merges:**
|
|
1360
|
+
|
|
1361
|
+
1. Agent completes work and pushes branches to each repo
|
|
1362
|
+
2. Create merge requests for each repo manually (or via `gh pr create`)
|
|
1363
|
+
3. Review and merge each MR separately
|
|
1364
|
+
4. The "Approve & Merge" button is not yet polyrepo-aware
|
|
1365
|
+
|
|
1366
|
+
**Future enhancement:** Polyrepo-aware merge-agent that handles multiple repos automatically.
|
|
1367
|
+
|
|
1368
|
+
### Managing Projects
|
|
1369
|
+
|
|
1370
|
+
```bash
|
|
1371
|
+
# List registered projects
|
|
1372
|
+
pan project list
|
|
1373
|
+
|
|
1374
|
+
# Add a project
|
|
1375
|
+
pan project add /path/to/project --name myproject --linear-team PRJ
|
|
1376
|
+
|
|
1377
|
+
# Remove a project
|
|
1378
|
+
pan project remove myproject
|
|
1379
|
+
```
|
|
1380
|
+
|
|
1381
|
+
### Database Seeding
|
|
1382
|
+
|
|
1383
|
+
Many projects need a pre-populated database for development and testing. Panopticon provides database seeding commands that work with your existing infrastructure.
|
|
1384
|
+
|
|
1385
|
+
**Problem:** Development databases often need:
|
|
1386
|
+
- Schema with 100+ migrations already applied
|
|
1387
|
+
- Seed data for testing (users, reference data)
|
|
1388
|
+
- External QA database connections
|
|
1389
|
+
- Database snapshots from staging/production (sanitized)
|
|
1390
|
+
|
|
1391
|
+
**Solution:** Configure database seeding in `projects.yaml`:
|
|
1392
|
+
|
|
1393
|
+
```yaml
|
|
1394
|
+
projects:
|
|
1395
|
+
myapp:
|
|
1396
|
+
workspace:
|
|
1397
|
+
database:
|
|
1398
|
+
# Path to seed file (loaded on first container start)
|
|
1399
|
+
seed_file: /path/to/sanitized-seed.sql
|
|
1400
|
+
|
|
1401
|
+
# Command to create new snapshots from external source
|
|
1402
|
+
snapshot_command: "kubectl exec -n prod pod/postgres -- pg_dump -U app mydb"
|
|
1403
|
+
|
|
1404
|
+
# Or connect to external database directly
|
|
1405
|
+
external_db:
|
|
1406
|
+
host: qa-db.example.com
|
|
1407
|
+
database: myapp_qa
|
|
1408
|
+
user: readonly
|
|
1409
|
+
password_env: QA_DB_PASSWORD
|
|
1410
|
+
|
|
1411
|
+
# Container naming pattern
|
|
1412
|
+
container_name: "{{PROJECT}}-postgres-1"
|
|
1413
|
+
|
|
1414
|
+
# Migration tool (for status checks)
|
|
1415
|
+
migrations:
|
|
1416
|
+
type: flyway # flyway | liquibase | prisma | typeorm | custom
|
|
1417
|
+
path: src/main/resources/db/migration
|
|
1418
|
+
```
|
|
1419
|
+
|
|
1420
|
+
**Commands:**
|
|
1421
|
+
|
|
1422
|
+
```bash
|
|
1423
|
+
# Create a snapshot from production/staging
|
|
1424
|
+
pan db snapshot --project myapp --output /path/to/seed.sql
|
|
1425
|
+
|
|
1426
|
+
# Seed a workspace database
|
|
1427
|
+
pan db seed MIN-123
|
|
1428
|
+
|
|
1429
|
+
# Check database status
|
|
1430
|
+
pan db status MIN-123
|
|
1431
|
+
|
|
1432
|
+
# Clean kubectl noise from pg_dump files
|
|
1433
|
+
pan db clean /path/to/dump.sql
|
|
1434
|
+
|
|
1435
|
+
# View database configuration
|
|
1436
|
+
pan db config myapp
|
|
1437
|
+
```
|
|
1438
|
+
|
|
1439
|
+
**Workflow for capturing production data:**
|
|
1440
|
+
|
|
1441
|
+
1. **Create snapshot** from production (via kubectl or direct connection):
|
|
1442
|
+
```bash
|
|
1443
|
+
pan db snapshot --project myapp --sanitize
|
|
1444
|
+
```
|
|
1445
|
+
|
|
1446
|
+
2. **Verify** the seed file:
|
|
1447
|
+
```bash
|
|
1448
|
+
pan db clean /path/to/seed.sql --dry-run
|
|
1449
|
+
```
|
|
1450
|
+
|
|
1451
|
+
3. **Update projects.yaml** with seed file path
|
|
1452
|
+
|
|
1453
|
+
4. **Workspaces** automatically seed on first postgres container start
|
|
1454
|
+
|
|
1455
|
+
**Container integration:**
|
|
1456
|
+
|
|
1457
|
+
Your Docker Compose template should mount the seed directory:
|
|
1458
|
+
|
|
1459
|
+
```yaml
|
|
1460
|
+
# compose.infra.yml
|
|
1461
|
+
services:
|
|
1462
|
+
postgres:
|
|
1463
|
+
image: postgres:16
|
|
1464
|
+
volumes:
|
|
1465
|
+
- pgdata:/var/lib/postgresql/data
|
|
1466
|
+
# Seed database on first startup
|
|
1467
|
+
- /path/to/project/infra/seed:/docker-entrypoint-initdb.d:ro
|
|
633
1468
|
```
|
|
634
1469
|
|
|
635
|
-
|
|
1470
|
+
**Troubleshooting:**
|
|
636
1471
|
|
|
637
|
-
|
|
1472
|
+
| Issue | Solution |
|
|
1473
|
+
|-------|----------|
|
|
1474
|
+
| "relation does not exist" | Seed file missing or incomplete - run `pan db snapshot` |
|
|
1475
|
+
| Slow database startup | Large seed file - consider pruning old data |
|
|
1476
|
+
| kubectl garbage in dump | Run `pan db clean <file>` to remove stderr noise |
|
|
1477
|
+
| Migrations fail after seed | Check Flyway version matches seed file's schema_history |
|
|
638
1478
|
|
|
639
|
-
|
|
640
|
-
2. **Default route** - Issues without matching labels use the `default: true` path
|
|
641
|
-
3. **Fallback** - If no default, uses the project root path
|
|
1479
|
+
### Agent Completion Notifications
|
|
642
1480
|
|
|
643
|
-
|
|
1481
|
+
Panopticon includes a notification system that alerts you when agents complete their work.
|
|
644
1482
|
|
|
645
|
-
|
|
1483
|
+
**Desktop Notifications:**
|
|
1484
|
+
|
|
1485
|
+
The `notify-complete` script sends desktop notifications across platforms:
|
|
646
1486
|
|
|
1487
|
+
| Platform | Notification Method |
|
|
1488
|
+
|----------|---------------------|
|
|
1489
|
+
| WSL2/Windows | PowerShell toast notifications |
|
|
1490
|
+
| macOS | osascript display notification |
|
|
1491
|
+
| Linux | notify-send |
|
|
1492
|
+
|
|
1493
|
+
**Usage:**
|
|
647
1494
|
```bash
|
|
648
|
-
#
|
|
649
|
-
|
|
1495
|
+
# Send a completion notification
|
|
1496
|
+
~/.panopticon/bin/notify-complete MIN-123 "Fixed login button" "https://gitlab.com/mr/456"
|
|
1497
|
+
```
|
|
650
1498
|
|
|
651
|
-
|
|
652
|
-
pan project add /path/to/project --name myproject --linear-team PRJ
|
|
1499
|
+
**Completion log:** All notifications are logged to `~/.panopticon/agent-completed.log` with timestamps.
|
|
653
1500
|
|
|
654
|
-
|
|
655
|
-
|
|
1501
|
+
**Integration with agent workflows:**
|
|
1502
|
+
|
|
1503
|
+
Agents can call `notify-complete` at the end of their work:
|
|
1504
|
+
```bash
|
|
1505
|
+
# In agent completion script or /work-complete skill
|
|
1506
|
+
notify-complete "$ISSUE_ID" "$SUMMARY" "$MR_URL"
|
|
656
1507
|
```
|
|
657
1508
|
|
|
658
1509
|
---
|
|
@@ -670,8 +1521,71 @@ pan skills # List available skills
|
|
|
670
1521
|
pan status # Show running agents
|
|
671
1522
|
pan up # Start dashboard (Docker or minimal)
|
|
672
1523
|
pan down # Stop dashboard and services
|
|
1524
|
+
pan update # Update Panopticon to latest version
|
|
1525
|
+
pan backup # Create backup of ~/.panopticon/
|
|
1526
|
+
pan restore # Restore from backup
|
|
1527
|
+
pan setup hooks # Install Claude Code hooks (heartbeat, etc.)
|
|
1528
|
+
```
|
|
1529
|
+
|
|
1530
|
+
### Beads Management
|
|
1531
|
+
|
|
1532
|
+
Beads is an optional git-backed issue tracker for persistent task tracking. Panopticon includes commands to manage beads databases and automatic cleanup after merges.
|
|
1533
|
+
|
|
1534
|
+
**Installation:** Beads is automatically installed during `pan install`. You can also install/upgrade manually:
|
|
1535
|
+
|
|
1536
|
+
```bash
|
|
1537
|
+
# Check beads version and available updates
|
|
1538
|
+
pan beads upgrade --check
|
|
1539
|
+
|
|
1540
|
+
# Upgrade to latest version
|
|
1541
|
+
pan beads upgrade
|
|
1542
|
+
|
|
1543
|
+
# Show beads statistics (total, open, closed, old)
|
|
1544
|
+
pan beads stats
|
|
1545
|
+
|
|
1546
|
+
# Compact beads - remove closed issues older than 30 days
|
|
1547
|
+
pan beads compact
|
|
1548
|
+
|
|
1549
|
+
# Customize the threshold (e.g., 60 days)
|
|
1550
|
+
pan beads compact --days 60
|
|
1551
|
+
|
|
1552
|
+
# Preview what would be removed (dry run)
|
|
1553
|
+
pan beads compact --dry-run
|
|
1554
|
+
```
|
|
1555
|
+
|
|
1556
|
+
**Recommended version:** v0.47.1+ includes important fixes for git worktree isolation.
|
|
1557
|
+
|
|
1558
|
+
**Workspace Isolation:**
|
|
1559
|
+
|
|
1560
|
+
With beads v0.47.1+, workspaces share the same database but use labels for isolation:
|
|
1561
|
+
|
|
1562
|
+
```bash
|
|
1563
|
+
# In workspace for PAN-83, list only that workspace's tasks
|
|
1564
|
+
bd list --label workspace:pan-83
|
|
1565
|
+
|
|
1566
|
+
# Or use bd ready with label filter
|
|
1567
|
+
bd ready --label workspace:pan-83
|
|
673
1568
|
```
|
|
674
1569
|
|
|
1570
|
+
Panopticon automatically creates beads with `workspace:<issue-id>` labels when you create a workspace. Agents can filter to see only their workspace's tasks.
|
|
1571
|
+
|
|
1572
|
+
**Automatic Compaction:**
|
|
1573
|
+
|
|
1574
|
+
After every successful merge, the merge-agent automatically:
|
|
1575
|
+
1. Checks for closed beads older than 30 days
|
|
1576
|
+
2. If found, runs `bd admin compact --days 30`
|
|
1577
|
+
3. Commits the compacted beads
|
|
1578
|
+
4. Pushes to remote
|
|
1579
|
+
|
|
1580
|
+
This keeps the beads database clean without manual intervention.
|
|
1581
|
+
|
|
1582
|
+
**Why compact beads?**
|
|
1583
|
+
|
|
1584
|
+
Beads are committed to git for collaborative planning (see "Git-Backed Collaborative Planning" section). Over time, closed issues accumulate. Compaction removes old closed issues while preserving:
|
|
1585
|
+
- Open issues (always kept)
|
|
1586
|
+
- Recently closed issues (< 30 days by default)
|
|
1587
|
+
- All issue history in git commits
|
|
1588
|
+
|
|
675
1589
|
#### What `pan sync` Does
|
|
676
1590
|
|
|
677
1591
|
`pan sync` synchronizes Panopticon assets to all supported AI tools:
|
|
@@ -694,13 +1608,199 @@ pan work issue MIN-123
|
|
|
694
1608
|
# List all running agents
|
|
695
1609
|
pan work status
|
|
696
1610
|
|
|
697
|
-
# Send a message to an agent
|
|
1611
|
+
# Send a message to an agent (handles Enter key automatically)
|
|
698
1612
|
pan work tell min-123 "Please also add tests"
|
|
699
1613
|
|
|
700
1614
|
# Kill an agent
|
|
701
1615
|
pan work kill min-123
|
|
1616
|
+
|
|
1617
|
+
# Show work completed and awaiting review
|
|
1618
|
+
pan work pending
|
|
1619
|
+
|
|
1620
|
+
# Approve agent work, merge MR, update Linear
|
|
1621
|
+
pan work approve min-123
|
|
1622
|
+
|
|
1623
|
+
# List issues from configured trackers
|
|
1624
|
+
pan work list
|
|
1625
|
+
|
|
1626
|
+
# Triage issues from secondary tracker
|
|
1627
|
+
pan work triage
|
|
1628
|
+
|
|
1629
|
+
# Reopen a closed issue and re-run planning
|
|
1630
|
+
pan work reopen min-123
|
|
1631
|
+
|
|
1632
|
+
# Request re-review after fixing feedback (for agents, max 3 auto-requeues)
|
|
1633
|
+
pan work request-review min-123 -m "Fixed: added tests and removed duplication"
|
|
1634
|
+
|
|
1635
|
+
# Deep wipe: completely reset all state for an issue
|
|
1636
|
+
pan work wipe min-123 # Cleans up agents, state, Linear status
|
|
1637
|
+
pan work wipe min-123 -w # Also delete workspace
|
|
1638
|
+
pan work wipe min-123 -y -w # Skip confirmation
|
|
1639
|
+
|
|
1640
|
+
# Recover crashed agents
|
|
1641
|
+
pan work recover min-123
|
|
1642
|
+
pan work recover --all
|
|
1643
|
+
```
|
|
1644
|
+
|
|
1645
|
+
### Convoys: Multi-Agent Orchestration
|
|
1646
|
+
|
|
1647
|
+
Convoys enable Panopticon to run multiple AI agents in parallel for complex tasks like code review. Instead of a single agent doing everything, specialized agents focus on specific concerns and a synthesis agent combines their findings.
|
|
1648
|
+
|
|
1649
|
+
**Why Convoys?**
|
|
1650
|
+
|
|
1651
|
+
When reviewing code, a single AI agent must context-switch between:
|
|
1652
|
+
- Checking for logic errors
|
|
1653
|
+
- Looking for security vulnerabilities
|
|
1654
|
+
- Analyzing performance issues
|
|
1655
|
+
|
|
1656
|
+
This leads to:
|
|
1657
|
+
- Shallow reviews (can't go deep on everything)
|
|
1658
|
+
- Missed issues (focus on one area, miss others)
|
|
1659
|
+
- Long sequential execution (can't parallelize)
|
|
1660
|
+
|
|
1661
|
+
Convoys solve this by **specialization + parallelization**:
|
|
1662
|
+
- 3 focused agents review in parallel (10x faster)
|
|
1663
|
+
- Each agent goes deep in their domain
|
|
1664
|
+
- Synthesis agent combines findings with prioritization
|
|
1665
|
+
|
|
1666
|
+
#### Built-in Convoy Templates
|
|
1667
|
+
|
|
1668
|
+
| Template | Agents | Use Case |
|
|
1669
|
+
|----------|--------|----------|
|
|
1670
|
+
| `code-review` | correctness, security, performance, synthesis | Comprehensive code review |
|
|
1671
|
+
| `planning` | planner | Codebase exploration and planning |
|
|
1672
|
+
| `triage` | (dynamic) | Parallel issue triage |
|
|
1673
|
+
| `health-monitor` | monitor | Check health of running agents |
|
|
1674
|
+
|
|
1675
|
+
#### Quick Start
|
|
1676
|
+
|
|
1677
|
+
```bash
|
|
1678
|
+
# Run a parallel code review
|
|
1679
|
+
pan convoy start code-review --files "src/**/*.ts"
|
|
1680
|
+
|
|
1681
|
+
# Check status
|
|
1682
|
+
pan convoy status
|
|
1683
|
+
|
|
1684
|
+
# List all convoys (running and completed)
|
|
1685
|
+
pan convoy list
|
|
1686
|
+
|
|
1687
|
+
# Stop a convoy
|
|
1688
|
+
pan convoy stop <convoy-id>
|
|
1689
|
+
```
|
|
1690
|
+
|
|
1691
|
+
#### How Code Review Convoy Works
|
|
1692
|
+
|
|
1693
|
+
```
|
|
1694
|
+
pan convoy start code-review --files "src/**/*.ts"
|
|
1695
|
+
│
|
|
1696
|
+
├─→ Phase 1 (Parallel): 3 specialized reviewers run simultaneously
|
|
1697
|
+
│ ├─→ Correctness (Haiku) → correctness.md
|
|
1698
|
+
│ ├─→ Security (Sonnet) → security.md
|
|
1699
|
+
│ └─→ Performance (Haiku) → performance.md
|
|
1700
|
+
│
|
|
1701
|
+
└─→ Phase 2 (Sequential): Synthesis agent runs after Phase 1 completes
|
|
1702
|
+
└─→ Synthesis reads all 3 reviews → synthesis.md
|
|
1703
|
+
```
|
|
1704
|
+
|
|
1705
|
+
**Phase 1 - Specialized Reviews (Parallel)**
|
|
1706
|
+
- **Correctness** (Haiku) - Logic errors, edge cases, type safety
|
|
1707
|
+
- **Security** (Sonnet) - OWASP Top 10, injection, XSS, auth issues
|
|
1708
|
+
- **Performance** (Haiku) - N+1 queries, blocking ops, memory leaks
|
|
1709
|
+
|
|
1710
|
+
**Phase 2 - Synthesis (Sequential)**
|
|
1711
|
+
- Reads all three review files
|
|
1712
|
+
- Removes duplicates (same issue found by multiple reviewers)
|
|
1713
|
+
- Prioritizes findings (blocker → critical → high → medium → low)
|
|
1714
|
+
- Generates unified report with action items
|
|
1715
|
+
|
|
1716
|
+
#### What is Synthesis?
|
|
1717
|
+
|
|
1718
|
+
Synthesis is the process of combining findings from multiple parallel agents into a single, prioritized, actionable report.
|
|
1719
|
+
|
|
1720
|
+
**Without synthesis**, after 3 parallel reviews you get:
|
|
1721
|
+
- 3 separate markdown files to read
|
|
1722
|
+
- Duplicate findings (same issue reported differently)
|
|
1723
|
+
- No prioritization (which to fix first?)
|
|
1724
|
+
- Mental overhead to merge them yourself
|
|
1725
|
+
|
|
1726
|
+
**With synthesis**, you get:
|
|
1727
|
+
- Single unified report
|
|
1728
|
+
- Deduplicated findings
|
|
1729
|
+
- AI-prioritized by severity × impact
|
|
1730
|
+
- Clear action items
|
|
1731
|
+
|
|
1732
|
+
**Example synthesis output:**
|
|
1733
|
+
|
|
1734
|
+
```markdown
|
|
1735
|
+
# Code Review - Complete Analysis
|
|
1736
|
+
|
|
1737
|
+
## Executive Summary
|
|
1738
|
+
- 2 blockers (MUST FIX)
|
|
1739
|
+
- 3 critical issues
|
|
1740
|
+
- 5 high-priority items
|
|
1741
|
+
|
|
1742
|
+
## Top Priority
|
|
1743
|
+
1. SQL injection in auth.ts:42 (Security, Critical)
|
|
1744
|
+
2. execSync blocking event loop in sync.ts:89 (Performance, Blocker)
|
|
1745
|
+
3. Null pointer in user fetch in api.ts:156 (Correctness, High)
|
|
1746
|
+
|
|
1747
|
+
## Blocker Issues
|
|
1748
|
+
[Detailed findings with code examples and fixes]
|
|
1749
|
+
|
|
1750
|
+
## Critical Issues
|
|
1751
|
+
[...]
|
|
1752
|
+
|
|
1753
|
+
## Review Statistics
|
|
1754
|
+
- Files reviewed: 12
|
|
1755
|
+
- Issues found: 10
|
|
1756
|
+
- Duplicates removed: 3
|
|
1757
|
+
```
|
|
1758
|
+
|
|
1759
|
+
#### Convoy Commands
|
|
1760
|
+
|
|
1761
|
+
```bash
|
|
1762
|
+
# Start a convoy
|
|
1763
|
+
pan convoy start <template> [options]
|
|
1764
|
+
--files <pattern> # File pattern (e.g., "src/**/*.ts")
|
|
1765
|
+
--pr-url <url> # Pull request URL
|
|
1766
|
+
--issue-id <id> # Issue ID
|
|
1767
|
+
--project-path <path> # Project path (defaults to cwd)
|
|
1768
|
+
|
|
1769
|
+
# Check convoy status
|
|
1770
|
+
pan convoy status [convoy-id] # Show status (defaults to most recent)
|
|
1771
|
+
|
|
1772
|
+
# List convoys
|
|
1773
|
+
pan convoy list # All convoys
|
|
1774
|
+
pan convoy list --status running # Filter by status
|
|
1775
|
+
|
|
1776
|
+
# Stop a convoy
|
|
1777
|
+
pan convoy stop <convoy-id> # Kill all agents, mark failed
|
|
1778
|
+
```
|
|
1779
|
+
|
|
1780
|
+
#### Custom Convoy Templates
|
|
1781
|
+
|
|
1782
|
+
Create custom templates in `~/.panopticon/convoy-templates/`:
|
|
1783
|
+
|
|
1784
|
+
```json
|
|
1785
|
+
{
|
|
1786
|
+
"name": "lightweight-review",
|
|
1787
|
+
"description": "Quick security-only review",
|
|
1788
|
+
"agents": [
|
|
1789
|
+
{
|
|
1790
|
+
"role": "security",
|
|
1791
|
+
"subagent": "code-review-security",
|
|
1792
|
+
"parallel": false
|
|
1793
|
+
}
|
|
1794
|
+
],
|
|
1795
|
+
"config": {
|
|
1796
|
+
"outputDir": ".claude/reviews",
|
|
1797
|
+
"timeout": 600000
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
702
1800
|
```
|
|
703
1801
|
|
|
1802
|
+
Then use with: `pan convoy start lightweight-review --files "src/**/*.ts"`
|
|
1803
|
+
|
|
704
1804
|
### Health Monitoring
|
|
705
1805
|
|
|
706
1806
|
```bash
|
|
@@ -714,6 +1814,63 @@ pan work health status
|
|
|
714
1814
|
pan work health daemon --interval 30
|
|
715
1815
|
```
|
|
716
1816
|
|
|
1817
|
+
### Test Runner
|
|
1818
|
+
|
|
1819
|
+
```bash
|
|
1820
|
+
# Run all tests for a workspace
|
|
1821
|
+
pan test run min-123
|
|
1822
|
+
|
|
1823
|
+
# Run tests for main branch
|
|
1824
|
+
pan test run main
|
|
1825
|
+
|
|
1826
|
+
# Run specific test suites only
|
|
1827
|
+
pan test run min-123 --tests backend,frontend_unit
|
|
1828
|
+
|
|
1829
|
+
# List configured tests for a project
|
|
1830
|
+
pan test list
|
|
1831
|
+
|
|
1832
|
+
# List tests for specific project
|
|
1833
|
+
pan test list myproject
|
|
1834
|
+
```
|
|
1835
|
+
|
|
1836
|
+
**Test Configuration:**
|
|
1837
|
+
|
|
1838
|
+
Configure test suites in `projects.yaml`:
|
|
1839
|
+
|
|
1840
|
+
```yaml
|
|
1841
|
+
projects:
|
|
1842
|
+
myapp:
|
|
1843
|
+
tests:
|
|
1844
|
+
backend:
|
|
1845
|
+
type: maven # maven, vitest, jest, playwright, pytest, cargo
|
|
1846
|
+
path: api # Path relative to workspace
|
|
1847
|
+
command: ./mvnw test # Command to run
|
|
1848
|
+
|
|
1849
|
+
frontend_unit:
|
|
1850
|
+
type: vitest
|
|
1851
|
+
path: fe
|
|
1852
|
+
command: pnpm test:unit --run
|
|
1853
|
+
container: true # Run inside Docker container
|
|
1854
|
+
container_name: "{{COMPOSE_PROJECT}}-fe-1"
|
|
1855
|
+
|
|
1856
|
+
frontend_e2e:
|
|
1857
|
+
type: playwright
|
|
1858
|
+
path: fe
|
|
1859
|
+
command: pnpm test:e2e
|
|
1860
|
+
env:
|
|
1861
|
+
BASE_URL: "https://{{FEATURE_FOLDER}}.myapp.test"
|
|
1862
|
+
```
|
|
1863
|
+
|
|
1864
|
+
**Reports:**
|
|
1865
|
+
|
|
1866
|
+
Test results are saved to `{project}/reports/test-run-{target}-{timestamp}.md` with detailed logs for each suite.
|
|
1867
|
+
|
|
1868
|
+
**Notifications:**
|
|
1869
|
+
|
|
1870
|
+
Desktop notifications are sent when tests complete (disable with `--no-notify`).
|
|
1871
|
+
|
|
1872
|
+
See `/pan-test-config` skill for complete documentation.
|
|
1873
|
+
|
|
717
1874
|
### FPP Hooks (Fixed Point Principle)
|
|
718
1875
|
|
|
719
1876
|
```bash
|
|
@@ -737,6 +1894,67 @@ pan work hook mail agent-min-123 "Review feedback received"
|
|
|
737
1894
|
|
|
738
1895
|
This allows multiple agents to work on different features simultaneously without conflicts.
|
|
739
1896
|
|
|
1897
|
+
> **IMPORTANT: Main Project Branch Convention**
|
|
1898
|
+
>
|
|
1899
|
+
> The main project directory should **ALWAYS** stay on the `main` branch. All feature work happens in workspaces (git worktrees), never in the main project.
|
|
1900
|
+
>
|
|
1901
|
+
> - **Main project**: Always on `main` - serves as the stable reference point
|
|
1902
|
+
> - **Workspaces**: Each has its own feature branch checked out
|
|
1903
|
+
> - **Want to check something?** Create a worktree, don't checkout in main
|
|
1904
|
+
> - **Quick test?** Create a worktree
|
|
1905
|
+
> - **Emergency hotfix?** Create a worktree
|
|
1906
|
+
>
|
|
1907
|
+
> This convention ensures:
|
|
1908
|
+
> 1. Specialists (review-agent, test-agent) always find the correct code
|
|
1909
|
+
> 2. Merge operations have a clean target
|
|
1910
|
+
> 3. Multiple agents don't interfere with each other
|
|
1911
|
+
>
|
|
1912
|
+
> If you see a warning like "Main project is on branch 'feature/xxx' instead of 'main'", something has incorrectly checked out a feature branch in the main project. Fix it with `git checkout main`.
|
|
1913
|
+
|
|
1914
|
+
#### Git Hooks for Branch Protection
|
|
1915
|
+
|
|
1916
|
+
Panopticon provides git hooks to enforce the main branch convention. These hooks are automatically installed:
|
|
1917
|
+
|
|
1918
|
+
- **On `pan project add`** - Hooks are installed when registering a new project
|
|
1919
|
+
- **On `pan sync`** - Hooks are updated in all registered projects
|
|
1920
|
+
|
|
1921
|
+
The hooks are polyrepo-aware and will install in all git repositories within your project.
|
|
1922
|
+
|
|
1923
|
+
**Auto-revert behavior:**
|
|
1924
|
+
- **Agents & planning sessions**: Automatically revert to `main` if they accidentally checkout a feature branch
|
|
1925
|
+
- **Human users**: Display a prominent warning (no auto-revert by default)
|
|
1926
|
+
|
|
1927
|
+
To enable auto-revert for humans:
|
|
1928
|
+
```bash
|
|
1929
|
+
export PANOPTICON_AUTO_REVERT_CHECKOUT=1 # Add to .bashrc/.zshrc
|
|
1930
|
+
```
|
|
1931
|
+
|
|
1932
|
+
Manual hook installation (for projects not in registry):
|
|
1933
|
+
```bash
|
|
1934
|
+
./scripts/install-git-hooks.sh /path/to/your/project
|
|
1935
|
+
```
|
|
1936
|
+
|
|
1937
|
+
#### Planning vs Work Agent Safeguard
|
|
1938
|
+
|
|
1939
|
+
The dashboard prevents starting a work agent (`agent-<issue>`) while a planning agent (`planning-<issue>`) is still running for the same issue. This prevents conflicts where both agents try to modify the same workspace.
|
|
1940
|
+
|
|
1941
|
+
If you see "Planning agent is still running" when trying to start work:
|
|
1942
|
+
1. **Complete the planning session** - Use "Complete Planning" button
|
|
1943
|
+
2. **Or abort planning** - Use "Abort Planning" if you want to discard
|
|
1944
|
+
3. **Or kill the session manually** - `tmux kill-session -t planning-<issue>`
|
|
1945
|
+
|
|
1946
|
+
#### Specialist Agent Safeguards
|
|
1947
|
+
|
|
1948
|
+
All specialist agents (review-agent, test-agent, merge-agent) are configured to:
|
|
1949
|
+
1. **Run in workspaces only** - Never in the main project directory
|
|
1950
|
+
2. **Never checkout branches** - They work with the branch already in the workspace
|
|
1951
|
+
3. **Create workspaces if needed** - Use `pan workspace create <ISSUE-ID>` instead of `git checkout`
|
|
1952
|
+
|
|
1953
|
+
These safeguards are enforced through:
|
|
1954
|
+
- **Prompt instructions** - Clear warnings in all specialist prompts
|
|
1955
|
+
- **Code enforcement** - Specialists spawn with workspace as cwd
|
|
1956
|
+
- **Git hooks** - Auto-revert if checkout detected in tmux sessions
|
|
1957
|
+
|
|
740
1958
|
#### Git-Backed Collaborative Planning
|
|
741
1959
|
|
|
742
1960
|
| Start Planning | Codebase Exploration | Discovery Questions |
|
|
@@ -744,15 +1962,24 @@ This allows multiple agents to work on different features simultaneously without
|
|
|
744
1962
|
|  |  |  |
|
|
745
1963
|
| Click to create workspace and start AI planning | Claude explores the codebase, reads docs, understands patterns | Interactive questions to clarify requirements and approach |
|
|
746
1964
|
|
|
747
|
-
Planning artifacts are stored **inside the workspace
|
|
1965
|
+
Planning artifacts are stored **inside the workspace**:
|
|
1966
|
+
|
|
1967
|
+
> ⚠️ **Note: `.planning/` is currently ephemeral (not tracked in git)**
|
|
1968
|
+
>
|
|
1969
|
+
> The `.planning/` directory is listed in `.gitignore` to prevent cross-contamination between issues. When branches merge, planning state from issue A could contaminate issue B's workspace, causing agents to work on the wrong tasks.
|
|
1970
|
+
>
|
|
1971
|
+
> **Current behavior:** Planning state is local to your machine only. If you switch machines, you'll need to re-run the planning session.
|
|
1972
|
+
>
|
|
1973
|
+
> See [#111](https://github.com/eltmon/panopticon-cli/issues/111) for the future enhancement to support cross-machine planning sync safely.
|
|
748
1974
|
|
|
749
1975
|
```
|
|
750
1976
|
workspaces/feature-min-123/
|
|
751
|
-
├── .planning/
|
|
752
|
-
│ ├──
|
|
753
|
-
│ ├──
|
|
1977
|
+
├── .planning/ # ⚠️ NOT tracked in git (ephemeral)
|
|
1978
|
+
│ ├── STATE.md # Current planning state
|
|
1979
|
+
│ ├── output.jsonl # Full conversation history
|
|
1980
|
+
│ ├── PLANNING_PROMPT.md # Initial planning prompt
|
|
754
1981
|
│ ├── CONTINUATION_PROMPT.md # Context for continued sessions
|
|
755
|
-
│ └── output-*.jsonl
|
|
1982
|
+
│ └── output-*.jsonl # Backup of previous rounds
|
|
756
1983
|
└── ... (code)
|
|
757
1984
|
```
|
|
758
1985
|
|
|
@@ -763,47 +1990,24 @@ When the planning session completes, the AI generates:
|
|
|
763
1990
|
- **Beads tasks** - Trackable sub-tasks with dependencies for the implementation
|
|
764
1991
|
- **Feature PRD** - Copied to `docs/prds/active/{issue}-plan.md` for documentation
|
|
765
1992
|
|
|
766
|
-
**
|
|
767
|
-
|
|
768
|
-
1. **Collaborative async planning** - Push your branch, someone else pulls and continues the planning session with full context
|
|
769
|
-
2. **Context recovery** - If Claude's context compacts, the full conversation is preserved in the branch
|
|
770
|
-
3. **Audit trail** - See how planning decisions were made, what files were explored, what questions were asked
|
|
771
|
-
4. **Branch portability** - The planning state travels with the feature branch
|
|
772
|
-
|
|
773
|
-
**Dashboard workflow (recommended):**
|
|
774
|
-
|
|
775
|
-
The planning dialog has **Pull** and **Push** buttons that handle git operations automatically:
|
|
776
|
-
|
|
777
|
-
| Button | What it does |
|
|
778
|
-
|--------|--------------|
|
|
779
|
-
| **Pull** | Fetches from origin, creates workspace from remote branch if needed, pulls latest changes |
|
|
780
|
-
| **Push** | Commits `.planning/` artifacts and pushes to origin |
|
|
1993
|
+
**Future capabilities (currently disabled - see note above):**
|
|
781
1994
|
|
|
782
|
-
1.
|
|
783
|
-
2.
|
|
784
|
-
3. Person B continues the planning session and clicks **Push** when done
|
|
1995
|
+
1. ~~**Collaborative async planning** - Push your branch, someone else pulls and continues the planning session with full context~~
|
|
1996
|
+
2. ~~**Branch portability** - The planning state travels with the feature branch~~
|
|
785
1997
|
|
|
786
|
-
**
|
|
787
|
-
```bash
|
|
788
|
-
# Person A starts planning
|
|
789
|
-
pan work plan MIN-123
|
|
790
|
-
# ... answers discovery questions, gets interrupted ...
|
|
791
|
-
|
|
792
|
-
# Push the branch (includes planning context)
|
|
793
|
-
cd workspaces/feature-min-123
|
|
794
|
-
git add .planning && git commit -m "WIP: planning session"
|
|
795
|
-
git push origin feature/min-123
|
|
1998
|
+
**What still works:**
|
|
796
1999
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
# Claude has full context from Person A's session
|
|
801
|
-
```
|
|
2000
|
+
1. **Context recovery** - If Claude's context compacts, STATE.md and beads preserve the planning decisions
|
|
2001
|
+
2. **Audit trail** - See decisions made in STATE.md
|
|
2002
|
+
3. **Beads tasks** - Sub-tasks created during planning ARE persisted (beads uses label-based isolation)
|
|
802
2003
|
|
|
803
2004
|
```bash
|
|
804
2005
|
# Create a workspace (git worktree) without starting an agent
|
|
805
2006
|
pan workspace create MIN-123
|
|
806
2007
|
|
|
2008
|
+
# Create workspace and start Docker containers
|
|
2009
|
+
pan workspace create MIN-123 --docker
|
|
2010
|
+
|
|
807
2011
|
# List all workspaces
|
|
808
2012
|
pan workspace list
|
|
809
2013
|
|
|
@@ -814,6 +2018,69 @@ pan workspace destroy MIN-123
|
|
|
814
2018
|
pan workspace destroy MIN-123 --force
|
|
815
2019
|
```
|
|
816
2020
|
|
|
2021
|
+
#### Docker Integration
|
|
2022
|
+
|
|
2023
|
+
The `--docker` flag automatically starts containers after workspace creation:
|
|
2024
|
+
|
|
2025
|
+
```bash
|
|
2026
|
+
pan workspace create MIN-123 --docker
|
|
2027
|
+
```
|
|
2028
|
+
|
|
2029
|
+
**What it does:**
|
|
2030
|
+
1. Creates the workspace (git worktree or custom command)
|
|
2031
|
+
2. Looks for docker-compose files in:
|
|
2032
|
+
- `{workspace}/docker-compose.yml`
|
|
2033
|
+
- `{workspace}/docker-compose.yaml`
|
|
2034
|
+
- `{workspace}/.devcontainer/docker-compose.yml`
|
|
2035
|
+
- `{workspace}/.devcontainer/docker-compose.devcontainer.yml`
|
|
2036
|
+
- `{workspace}/.devcontainer/compose.yml`
|
|
2037
|
+
3. Runs `docker compose -p "{project}-feature-{issue}" -f {file} up -d --build`
|
|
2038
|
+
|
|
2039
|
+
**Docker Project Naming:**
|
|
2040
|
+
|
|
2041
|
+
Each workspace gets a unique Docker Compose project name to avoid container conflicts:
|
|
2042
|
+
- Format: `{project-name}-feature-{issue-id}` (e.g., `mind-your-now-feature-min-123`)
|
|
2043
|
+
- The project name comes from `name` in your `~/.panopticon/projects.yaml`
|
|
2044
|
+
- Container names follow: `{project}-{service}-1` (e.g., `mind-your-now-feature-min-123-api-1`)
|
|
2045
|
+
|
|
2046
|
+
This allows multiple workspaces to run simultaneously without port or name conflicts.
|
|
2047
|
+
|
|
2048
|
+
**Why this matters:**
|
|
2049
|
+
- Containers start warming up while you review the issue
|
|
2050
|
+
- Environment is ready when the planning agent starts asking questions
|
|
2051
|
+
- You can test assumptions during planning without waiting for builds
|
|
2052
|
+
|
|
2053
|
+
**Dashboard integration:**
|
|
2054
|
+
|
|
2055
|
+
The planning dialog includes a "Start Docker containers" checkbox:
|
|
2056
|
+
- **Default:** Enabled (containers start automatically)
|
|
2057
|
+
- **Preference saved:** Your choice is remembered in browser localStorage
|
|
2058
|
+
- **Key:** `panopticon.planning.startDocker`
|
|
2059
|
+
|
|
2060
|
+
To change the default via browser console:
|
|
2061
|
+
```javascript
|
|
2062
|
+
// Disable Docker by default
|
|
2063
|
+
localStorage.setItem('panopticon.planning.startDocker', 'false');
|
|
2064
|
+
|
|
2065
|
+
// Enable Docker by default (this is the out-of-box default)
|
|
2066
|
+
localStorage.setItem('panopticon.planning.startDocker', 'true');
|
|
2067
|
+
```
|
|
2068
|
+
|
|
2069
|
+
**Example workflow:**
|
|
2070
|
+
```bash
|
|
2071
|
+
# From dashboard: click "Start Planning" (Docker enabled by default)
|
|
2072
|
+
# Or from CLI:
|
|
2073
|
+
pan workspace create MIN-123 --docker
|
|
2074
|
+
|
|
2075
|
+
# While containers build in background:
|
|
2076
|
+
# - Review the Linear issue
|
|
2077
|
+
# - Check related PRs
|
|
2078
|
+
# - Think about approach
|
|
2079
|
+
|
|
2080
|
+
# By the time you're ready to engage with the planning agent,
|
|
2081
|
+
# the dev environment is warm and ready for testing
|
|
2082
|
+
```
|
|
2083
|
+
|
|
817
2084
|
### Project Management
|
|
818
2085
|
|
|
819
2086
|
```bash
|
|
@@ -823,6 +2090,12 @@ pan project add /path/to/project --name myproject
|
|
|
823
2090
|
# List managed projects
|
|
824
2091
|
pan project list
|
|
825
2092
|
|
|
2093
|
+
# Show project details
|
|
2094
|
+
pan project show myproject
|
|
2095
|
+
|
|
2096
|
+
# Initialize project config (creates .panopticon.json)
|
|
2097
|
+
pan project init
|
|
2098
|
+
|
|
826
2099
|
# Remove a project
|
|
827
2100
|
pan project remove myproject
|
|
828
2101
|
```
|
|
@@ -869,20 +2142,29 @@ pan cloister start
|
|
|
869
2142
|
# Stop Cloister
|
|
870
2143
|
pan cloister stop
|
|
871
2144
|
|
|
2145
|
+
# Emergency stop all agents (force kill)
|
|
2146
|
+
pan cloister emergency-stop
|
|
2147
|
+
|
|
872
2148
|
# Check Cloister status
|
|
873
2149
|
pan cloister status
|
|
874
2150
|
|
|
875
2151
|
# List all specialists
|
|
876
2152
|
pan specialists list
|
|
877
2153
|
|
|
878
|
-
# Wake a
|
|
879
|
-
pan specialists wake merge-agent
|
|
2154
|
+
# Wake a specialist (resumes previous session if exists)
|
|
2155
|
+
pan specialists wake merge-agent
|
|
2156
|
+
|
|
2157
|
+
# Wake and send a task
|
|
2158
|
+
pan specialists wake merge-agent --task "Review PR #123 for security issues"
|
|
880
2159
|
|
|
881
2160
|
# View specialist queue
|
|
882
|
-
pan specialists queue
|
|
2161
|
+
pan specialists queue merge-agent
|
|
883
2162
|
|
|
884
|
-
# Reset specialist
|
|
2163
|
+
# Reset a single specialist (wipes context)
|
|
885
2164
|
pan specialists reset merge-agent
|
|
2165
|
+
|
|
2166
|
+
# Reset ALL specialists (fresh start)
|
|
2167
|
+
pan specialists reset --all
|
|
886
2168
|
```
|
|
887
2169
|
|
|
888
2170
|
## Dashboard
|
|
@@ -920,6 +2202,16 @@ Stop with `pan down`.
|
|
|
920
2202
|
| **Skills** | Available skills and their descriptions |
|
|
921
2203
|
| **Health** | System health checks and diagnostics |
|
|
922
2204
|
|
|
2205
|
+
### Issue Filtering
|
|
2206
|
+
|
|
2207
|
+
The dashboard automatically filters issues to reduce visual clutter:
|
|
2208
|
+
|
|
2209
|
+
- **Linear issues** - Shows current cycle issues only
|
|
2210
|
+
- **Done column** - Shows items completed in the last 24 hours
|
|
2211
|
+
- **Canceled column** - Shows items canceled in the last 24 hours
|
|
2212
|
+
|
|
2213
|
+
This filtering applies to both Linear and GitHub issues. Older completed items are excluded from the dashboard but remain in your issue tracker.
|
|
2214
|
+
|
|
923
2215
|
### Issue Cards
|
|
924
2216
|
|
|
925
2217
|
Issue cards on the Kanban board display:
|
|
@@ -1034,6 +2326,8 @@ Panopticon ships with 25+ skills organized into categories:
|
|
|
1034
2326
|
| `pan-convoy-synthesis` | Synthesize convoy coordination |
|
|
1035
2327
|
| `pan-subagent-creator` | Create specialized subagents |
|
|
1036
2328
|
| `pan-skill-creator` | Create new skills (guided) |
|
|
2329
|
+
| `pan-workspace-config` | Configure polyrepo workspaces, DNS, ports |
|
|
2330
|
+
| `pan-test-config` | Configure project test suites |
|
|
1037
2331
|
|
|
1038
2332
|
### Utilities
|
|
1039
2333
|
|
|
@@ -1298,6 +2592,26 @@ Each agent's state is tracked in `~/.panopticon/agents/{agent-id}/state.json`:
|
|
|
1298
2592
|
|
|
1299
2593
|
**State Cleanup:** When an agent is killed or aborted (`pan work kill`), Panopticon automatically cleans up its state files to prevent stale data from affecting future runs.
|
|
1300
2594
|
|
|
2595
|
+
### Deep Wipe
|
|
2596
|
+
|
|
2597
|
+
For issues that get into a stuck or inconsistent state, use `pan work wipe` to completely reset:
|
|
2598
|
+
|
|
2599
|
+
```bash
|
|
2600
|
+
pan work wipe MIN-123 # Basic cleanup
|
|
2601
|
+
pan work wipe MIN-123 -w # Also delete workspace
|
|
2602
|
+
pan work wipe MIN-123 -y -w # Skip confirmation
|
|
2603
|
+
```
|
|
2604
|
+
|
|
2605
|
+
**Deep wipe cleans up:**
|
|
2606
|
+
- Tmux sessions (`planning-min-123`, `agent-min-123`)
|
|
2607
|
+
- Agent state directories (`~/.panopticon/agents/planning-*`, `agent-*`)
|
|
2608
|
+
- Legacy planning directories (`project/.planning/min-123/`)
|
|
2609
|
+
- Workspace (if `-w` flag is used)
|
|
2610
|
+
- Linear issue status (reset to Backlog)
|
|
2611
|
+
- Linear labels (removes "Review Ready", "Planning")
|
|
2612
|
+
|
|
2613
|
+
**Dashboard UI:** When aborting planning, click "🔥 Deep Wipe" for a complete reset.
|
|
2614
|
+
|
|
1301
2615
|
## Health Monitoring (Deacon Pattern)
|
|
1302
2616
|
|
|
1303
2617
|
Panopticon implements the Deacon pattern for stuck agent detection:
|
|
@@ -1390,8 +2704,183 @@ If you're both developing Panopticon AND using it for your own projects:
|
|
|
1390
2704
|
3. **Config is shared** - workspaces/agents work the same either way
|
|
1391
2705
|
4. **Test in a real project** - your own usage is the best test
|
|
1392
2706
|
|
|
2707
|
+
### Developer Skills (dev-skills/)
|
|
2708
|
+
|
|
2709
|
+
Panopticon has two types of skills:
|
|
2710
|
+
|
|
2711
|
+
| Directory | Purpose | Synced When |
|
|
2712
|
+
|-----------|---------|-------------|
|
|
2713
|
+
| `skills/` | User-facing skills for all Panopticon users | Always via `pan sync` |
|
|
2714
|
+
| `dev-skills/` | Developer-only skills for Panopticon contributors | Only in dev mode |
|
|
2715
|
+
|
|
2716
|
+
**Dev mode is automatically detected** when running from the Panopticon source repo (npm link). Skills in `dev-skills/` are:
|
|
2717
|
+
- Checked into the repo and version-controlled
|
|
2718
|
+
- Only synced to developers' machines, not end users
|
|
2719
|
+
- Shown with `[dev]` label in `pan sync --dry-run`
|
|
2720
|
+
|
|
2721
|
+
```bash
|
|
2722
|
+
# Check what will be synced (including dev-skills)
|
|
2723
|
+
pan sync --dry-run
|
|
2724
|
+
|
|
2725
|
+
# Output shows:
|
|
2726
|
+
# Developer mode detected - dev-skills will be synced
|
|
2727
|
+
# ...
|
|
2728
|
+
# + skill/test-specialist-workflow [dev]
|
|
2729
|
+
```
|
|
2730
|
+
|
|
2731
|
+
### Testing the Specialist System
|
|
2732
|
+
|
|
2733
|
+
The `test-specialist-workflow` skill provides end-to-end testing for the specialist handoff pipeline.
|
|
2734
|
+
|
|
2735
|
+
**Location:** `dev-skills/test-specialist-workflow/SKILL.md`
|
|
2736
|
+
|
|
2737
|
+
**What it tests:**
|
|
2738
|
+
- Full approve workflow: review-agent → test-agent → merge-agent
|
|
2739
|
+
- Specialist handoffs via `pan specialists wake --task`
|
|
2740
|
+
- Merge completion and branch preservation
|
|
2741
|
+
|
|
2742
|
+
**Usage:**
|
|
2743
|
+
|
|
2744
|
+
```bash
|
|
2745
|
+
# First sync to get dev-skills
|
|
2746
|
+
pan sync
|
|
2747
|
+
|
|
2748
|
+
# In Claude Code, invoke the skill
|
|
2749
|
+
/test-specialist-workflow
|
|
2750
|
+
```
|
|
2751
|
+
|
|
2752
|
+
The skill guides you through:
|
|
2753
|
+
|
|
2754
|
+
1. **Prerequisites check** - Dashboard running, specialists available
|
|
2755
|
+
2. **Create test issue** - GitHub issue for tracking
|
|
2756
|
+
3. **Create workspace** - Git worktree for the test
|
|
2757
|
+
4. **Make test change** - Trivial commit to verify merge
|
|
2758
|
+
5. **Trigger approve** - Kicks off the specialist pipeline
|
|
2759
|
+
6. **Monitor handoffs** - Watch each specialist complete and hand off
|
|
2760
|
+
7. **Verify merge** - Confirm change reached main branch
|
|
2761
|
+
8. **Cleanup** - Close issue, remove workspace
|
|
2762
|
+
|
|
2763
|
+
**Expected timeline:** 2-4 minutes total
|
|
2764
|
+
|
|
2765
|
+
**When to use:**
|
|
2766
|
+
- After making changes to the specialist system
|
|
2767
|
+
- After modifying the approve workflow
|
|
2768
|
+
- As a smoke test before releases
|
|
2769
|
+
|
|
1393
2770
|
## Troubleshooting
|
|
1394
2771
|
|
|
2772
|
+
### WSL2 Stability Issues (Windows Users)
|
|
2773
|
+
|
|
2774
|
+
WSL2 can experience crashes and networking issues, especially under heavy AI agent workloads. Here are recommended `.wslconfig` settings to improve stability.
|
|
2775
|
+
|
|
2776
|
+
**Create/edit `C:\Users\<username>\.wslconfig`:**
|
|
2777
|
+
|
|
2778
|
+
```ini
|
|
2779
|
+
[wsl2]
|
|
2780
|
+
# Resource allocation (adjust based on your system)
|
|
2781
|
+
memory=40GB
|
|
2782
|
+
processors=18
|
|
2783
|
+
swap=8GB
|
|
2784
|
+
|
|
2785
|
+
# Localhost forwarding between Windows and WSL
|
|
2786
|
+
localhostForwarding=true
|
|
2787
|
+
|
|
2788
|
+
# Disable GPU/GUI passthrough - reduces dxg driver errors
|
|
2789
|
+
guiApplications=false
|
|
2790
|
+
|
|
2791
|
+
# ============================================================
|
|
2792
|
+
# WINDOWS 11 ONLY - Comment these out on Windows 10!
|
|
2793
|
+
# These settings require Windows 11 22H2 or later.
|
|
2794
|
+
# On Windows 10 they are silently ignored or may cause issues.
|
|
2795
|
+
# ============================================================
|
|
2796
|
+
|
|
2797
|
+
# Route DNS through Windows - prevents getaddrinfo() failures
|
|
2798
|
+
# dnsTunneling=true # Windows 11 only
|
|
2799
|
+
|
|
2800
|
+
# Inherit Windows proxy settings
|
|
2801
|
+
# autoProxy=true # Windows 11 only
|
|
2802
|
+
|
|
2803
|
+
# Aggressively reclaim cached memory
|
|
2804
|
+
# autoMemoryReclaim=dropCache # Windows 11 only
|
|
2805
|
+
|
|
2806
|
+
# Use sparse VHD to allow better memory compaction
|
|
2807
|
+
# sparseVhd=true # Windows 11 only
|
|
2808
|
+
|
|
2809
|
+
# Mirrored networking (may conflict with Docker Desktop)
|
|
2810
|
+
# networkingMode=mirrored # Windows 11 only
|
|
2811
|
+
```
|
|
2812
|
+
|
|
2813
|
+
**After changing `.wslconfig`:**
|
|
2814
|
+
```powershell
|
|
2815
|
+
wsl --shutdown
|
|
2816
|
+
# Then relaunch your WSL terminal
|
|
2817
|
+
```
|
|
2818
|
+
|
|
2819
|
+
**Verify settings applied:**
|
|
2820
|
+
```bash
|
|
2821
|
+
# Check resources
|
|
2822
|
+
free -h # Should show configured memory
|
|
2823
|
+
nproc # Should show configured processors
|
|
2824
|
+
swapon --show # Should show configured swap
|
|
2825
|
+
|
|
2826
|
+
# Check networking mode (Windows 11 only)
|
|
2827
|
+
ip addr show eth0 # NAT mode shows 172.x.x.x IP
|
|
2828
|
+
# Mirrored mode shares Windows network directly
|
|
2829
|
+
```
|
|
2830
|
+
|
|
2831
|
+
#### Windows 10 Limitations
|
|
2832
|
+
|
|
2833
|
+
| Feature | Windows 10 | Windows 11 22H2+ |
|
|
2834
|
+
|---------|-----------|------------------|
|
|
2835
|
+
| `memory`, `processors`, `swap` | ✅ Works | ✅ Works |
|
|
2836
|
+
| `localhostForwarding` | ✅ Works | ✅ Works |
|
|
2837
|
+
| `guiApplications=false` | ✅ Works | ✅ Works |
|
|
2838
|
+
| `networkingMode=mirrored` | ❌ Not supported | ✅ Supported |
|
|
2839
|
+
| `dnsTunneling=true` | ❌ Not supported | ✅ Supported |
|
|
2840
|
+
| `autoProxy=true` | ❌ Not supported | ✅ Supported |
|
|
2841
|
+
| `autoMemoryReclaim` | ❌ Not supported | ✅ Supported |
|
|
2842
|
+
| `sparseVhd=true` | ❌ Not supported | ✅ Supported |
|
|
2843
|
+
|
|
2844
|
+
**Windows 10 users:** Most advanced WSL2 features require Windows 11. On Windows 10, only the basic resource limits and `localhostForwarding`/`guiApplications` settings are supported. Other settings will be silently ignored or may cause instability.
|
|
2845
|
+
|
|
2846
|
+
If you experience frequent WSL2 crashes on Windows 10, consider:
|
|
2847
|
+
- Using only the basic settings shown above (memory, processors, swap, localhostForwarding, guiApplications)
|
|
2848
|
+
- Reducing `memory` allocation if system is under pressure
|
|
2849
|
+
- Upgrading to Windows 11 for full WSL2 feature support
|
|
2850
|
+
- Checking Windows Event Viewer for specific crash causes
|
|
2851
|
+
|
|
2852
|
+
#### Additional Windows 10 Workarounds
|
|
2853
|
+
|
|
2854
|
+
If NAT networking is unstable on Windows 10:
|
|
2855
|
+
|
|
2856
|
+
```powershell
|
|
2857
|
+
# 1. Update WSL to latest version
|
|
2858
|
+
wsl --update
|
|
2859
|
+
|
|
2860
|
+
# 2. Check for VPN/firewall conflicts
|
|
2861
|
+
# Disable VPN temporarily to test if it's causing issues
|
|
2862
|
+
|
|
2863
|
+
# 3. Reset Windows network stack (run as Admin)
|
|
2864
|
+
netsh winsock reset
|
|
2865
|
+
netsh int ip reset
|
|
2866
|
+
|
|
2867
|
+
# 4. Restart after network reset
|
|
2868
|
+
Restart-Computer
|
|
2869
|
+
```
|
|
2870
|
+
|
|
2871
|
+
**Common conflict sources:**
|
|
2872
|
+
- VPN clients (especially corporate VPNs)
|
|
2873
|
+
- Docker Desktop (can conflict with WSL networking)
|
|
2874
|
+
- Third-party firewalls
|
|
2875
|
+
- Hyper-V virtual switch issues
|
|
2876
|
+
|
|
2877
|
+
**If NAT fails completely**, WSL 2.3.25+ automatically falls back to VirtioProxy mode. This is less performant but more stable. You'll see: `"Failed to configure network (networkingMode Nat), falling back to networkingMode VirtioProxy."`
|
|
2878
|
+
|
|
2879
|
+
**References:**
|
|
2880
|
+
- [Microsoft WSL Networking Documentation](https://learn.microsoft.com/en-us/windows/wsl/networking)
|
|
2881
|
+
- [WSL GitHub Issues - Networking](https://github.com/microsoft/WSL/issues?q=networking+mirrored)
|
|
2882
|
+
- [WSL NAT Fallback Issue #12297](https://github.com/microsoft/WSL/issues/12297)
|
|
2883
|
+
|
|
1395
2884
|
### Slow Vite/React Frontend with Multiple Workspaces
|
|
1396
2885
|
|
|
1397
2886
|
If running multiple containerized workspaces with Vite/React frontends, you may notice CPU spikes and slow HMR. This is because Vite's default file watching polls every 100ms, which compounds with multiple instances.
|