panopticon-cli 0.3.7 → 0.4.0
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 +1162 -6
- package/dist/agents-RCAPFJG7.js +41 -0
- package/dist/chunk-4BIZ4OVN.js +827 -0
- package/dist/chunk-4BIZ4OVN.js.map +1 -0
- package/dist/{chunk-C6A7S65K.js → chunk-7BGFIAWQ.js} +188 -43
- package/dist/chunk-7BGFIAWQ.js.map +1 -0
- package/dist/chunk-DGUM43GV.js +11 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/{chunk-P5TQ5C3J.js → chunk-U4LCHEVU.js} +14 -1
- package/dist/chunk-U4LCHEVU.js.map +1 -0
- package/dist/cli/index.js +6546 -2413
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/public/assets/index-BZXQno9X.js +540 -0
- package/dist/dashboard/public/assets/{index-CUoYoWX_.css → index-BtAxF_yl.css} +1 -1
- package/dist/dashboard/public/index.html +2 -2
- package/dist/dashboard/server.js +9890 -47449
- package/dist/index.d.ts +12 -1
- package/dist/index.js +10 -3
- package/dist/js-yaml-DLUPUHNL.js +2648 -0
- package/dist/js-yaml-DLUPUHNL.js.map +1 -0
- package/package.json +2 -2
- package/scripts/git-hooks/post-checkout +109 -0
- package/templates/claude-md/sections/beads.md +1 -2
- package/templates/claude-md/sections/warnings.md +19 -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.map +0 -1
- package/dist/dashboard/public/assets/index-CY0Ew5B9.js +0 -423
- package/dist/projects-54CV437J.js +0 -34
- /package/dist/{projects-54CV437J.js.map → agents-RCAPFJG7.js.map} +0 -0
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ Panopticon is a unified orchestration layer for AI coding assistants. It works w
|
|
|
26
26
|
- **Health Monitoring** - Deacon-style stuck detection with auto-recovery
|
|
27
27
|
- **Context Engineering** - Structured state management (STATE.md, WORKSPACE.md)
|
|
28
28
|
- **Agent CVs** - Work history tracking for capability-based routing
|
|
29
|
+
- **Google Stitch Integration** - AI-powered UI design with automatic design-to-code workflows
|
|
29
30
|
|
|
30
31
|
---
|
|
31
32
|
|
|
@@ -221,7 +222,8 @@ See [docs/DNS_SETUP.md](docs/DNS_SETUP.md) for detailed DNS configuration (espec
|
|
|
221
222
|
### Optional
|
|
222
223
|
- **mkcert** - For HTTPS certificates (recommended)
|
|
223
224
|
- **Linear API key** - For issue tracking integration
|
|
224
|
-
- **Beads CLI (bd)** - For persistent task tracking across sessions
|
|
225
|
+
- **Beads CLI (bd)** - For persistent task tracking across sessions. Auto-installed by `pan install`. Upgrade with `pan beads upgrade`.
|
|
226
|
+
- **Google Stitch MCP** - For AI-powered UI design integration (see below)
|
|
225
227
|
|
|
226
228
|
### Platform Support
|
|
227
229
|
|
|
@@ -303,6 +305,80 @@ If you have multiple Linear projects, configure which local directory each maps
|
|
|
303
305
|
|
|
304
306
|
The dashboard uses this mapping to determine where to create workspaces when you click "Create Workspace" or "Start Agent" for an issue.
|
|
305
307
|
|
|
308
|
+
## Google Stitch Integration
|
|
309
|
+
|
|
310
|
+
Panopticon integrates with [Google Stitch](https://stitch.withgoogle.com), Google's AI-powered UI design tool, enabling design-to-code workflows.
|
|
311
|
+
|
|
312
|
+
### What is Google Stitch?
|
|
313
|
+
|
|
314
|
+
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.
|
|
315
|
+
|
|
316
|
+
### Setup (Optional)
|
|
317
|
+
|
|
318
|
+
Use the `/pan-stitch` skill to set up the integration:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
# Run the setup skill
|
|
322
|
+
/pan-stitch
|
|
323
|
+
|
|
324
|
+
# Or manually:
|
|
325
|
+
# 1. Install gcloud CLI
|
|
326
|
+
curl -sSL https://sdk.cloud.google.com | bash
|
|
327
|
+
|
|
328
|
+
# 2. Authenticate
|
|
329
|
+
gcloud auth login
|
|
330
|
+
gcloud auth application-default login
|
|
331
|
+
|
|
332
|
+
# 3. Create project and enable API
|
|
333
|
+
gcloud projects create stitch-tools-$(date +%s)
|
|
334
|
+
gcloud config set project YOUR_PROJECT_ID
|
|
335
|
+
gcloud billing projects link YOUR_PROJECT_ID --billing-account=YOUR_BILLING_ID
|
|
336
|
+
gcloud beta services mcp enable stitch.googleapis.com # MUST use beta!
|
|
337
|
+
|
|
338
|
+
# 4. Register MCP (note "proxy" subcommand)
|
|
339
|
+
claude mcp add -e GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID -s user stitch -- npx -y @_davideast/stitch-mcp proxy
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### How It Works
|
|
343
|
+
|
|
344
|
+
When Stitch is configured, the planning agent can:
|
|
345
|
+
|
|
346
|
+
1. **Create UI designs** - Generate screens for UI-related issues
|
|
347
|
+
2. **Document in STATE.md** - Record Stitch project/screen IDs for workers
|
|
348
|
+
3. **Worker agents pick up designs** - Use the Stitch skills to convert to React
|
|
349
|
+
|
|
350
|
+
### Stitch Skills
|
|
351
|
+
|
|
352
|
+
| Skill | Purpose |
|
|
353
|
+
|-------|---------|
|
|
354
|
+
| `/pan-stitch` | Setup and configure Stitch MCP |
|
|
355
|
+
| `/stitch-design-md` | Create DESIGN.md from Stitch projects |
|
|
356
|
+
| `/stitch-react-components` | Convert Stitch HTML to React components |
|
|
357
|
+
|
|
358
|
+
### STATE.md Integration
|
|
359
|
+
|
|
360
|
+
When planning UI work, add a Stitch section to STATE.md:
|
|
361
|
+
|
|
362
|
+
```markdown
|
|
363
|
+
## UI Designs
|
|
364
|
+
|
|
365
|
+
### Stitch Assets
|
|
366
|
+
- **Project ID:** 12345678
|
|
367
|
+
- **Screen:** "Dashboard" (screen ID: 87654321)
|
|
368
|
+
- **Design Notes:** Dark mode, glassmorphism cards, gradient accents
|
|
369
|
+
- **DESIGN.md:** Generated at `src/components/DESIGN.md`
|
|
370
|
+
|
|
371
|
+
Worker: Use `/stitch-react-components` to convert the Dashboard screen to React.
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Manual Workflow (No MCP)
|
|
375
|
+
|
|
376
|
+
If you prefer not to set up the MCP:
|
|
377
|
+
|
|
378
|
+
1. Design at https://stitch.withgoogle.com
|
|
379
|
+
2. Export HTML/CSS from the UI
|
|
380
|
+
3. Use `/stitch-react-components` with the exported files
|
|
381
|
+
|
|
306
382
|
## Cloister: AI Lifecycle Manager
|
|
307
383
|
|
|
308
384
|
Cloister is Panopticon's intelligent agent lifecycle manager. It monitors all running agents and automatically handles:
|
|
@@ -389,6 +465,90 @@ The merge-agent uses a specialized prompt template that instructs it to:
|
|
|
389
465
|
- Document conflict resolution decisions
|
|
390
466
|
- Provide detailed feedback on what was merged
|
|
391
467
|
|
|
468
|
+
#### Review Pipeline Flow
|
|
469
|
+
|
|
470
|
+
The review pipeline is a sequential handoff between specialists:
|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
Human clicks "Review"
|
|
474
|
+
│
|
|
475
|
+
▼
|
|
476
|
+
┌───────────────────┐
|
|
477
|
+
│ review-agent │ Reviews code, checks for issues
|
|
478
|
+
└─────────┬─────────┘
|
|
479
|
+
│ If PASSED: queues test-agent
|
|
480
|
+
│ If BLOCKED: sends feedback to work-agent
|
|
481
|
+
▼
|
|
482
|
+
┌───────────────────┐
|
|
483
|
+
│ test-agent │ Runs test suite, analyzes failures
|
|
484
|
+
└─────────┬─────────┘
|
|
485
|
+
│ If PASSED: marks ready for merge
|
|
486
|
+
│ If FAILED: sends feedback to work-agent
|
|
487
|
+
▼
|
|
488
|
+
┌───────────────────┐
|
|
489
|
+
│ (Human clicks │ Human approval required
|
|
490
|
+
│ "Approve & Merge"│ before merge
|
|
491
|
+
└─────────┬─────────┘
|
|
492
|
+
▼
|
|
493
|
+
┌───────────────────┐
|
|
494
|
+
│ merge-agent │ Performs merge, resolves conflicts
|
|
495
|
+
└───────────────────┘
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
**Key Points:**
|
|
499
|
+
- **Human-initiated start** - A human must click "Review" to start the pipeline
|
|
500
|
+
- **Automatic handoffs** - review-agent → test-agent happens automatically
|
|
501
|
+
- **Human approval for merge** - Merge is NOT automatic; human clicks "Approve & Merge"
|
|
502
|
+
- **Feedback loops** - Failed reviews/tests send feedback back to the work-agent
|
|
503
|
+
|
|
504
|
+
#### Queue Processing
|
|
505
|
+
|
|
506
|
+
Each specialist has a task queue (`~/.panopticon/specialists/{name}/hook.json`) managed via the FPP (Fixed Point Principle):
|
|
507
|
+
|
|
508
|
+
```
|
|
509
|
+
1. Task arrives (via API or handoff)
|
|
510
|
+
│
|
|
511
|
+
▼
|
|
512
|
+
2. wakeSpecialistOrQueue() checks if specialist is busy
|
|
513
|
+
│
|
|
514
|
+
├── If IDLE: Wake specialist immediately with task
|
|
515
|
+
│
|
|
516
|
+
└── If BUSY: Add task to queue (hook.json)
|
|
517
|
+
│
|
|
518
|
+
▼
|
|
519
|
+
3. When specialist completes current task:
|
|
520
|
+
│
|
|
521
|
+
├── Updates status via API (passed/failed/skipped)
|
|
522
|
+
│
|
|
523
|
+
└── Dashboard automatically wakes specialist for next queued task
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
**Queue priority order:** `urgent` > `high` > `normal` > `low`
|
|
527
|
+
|
|
528
|
+
**Completion triggers:** When a specialist reports status (`passed`, `failed`, or `skipped`), the dashboard:
|
|
529
|
+
1. Sets the specialist state to `idle`
|
|
530
|
+
2. Checks the specialist's queue for pending work
|
|
531
|
+
3. If work exists, immediately wakes the specialist with the next task
|
|
532
|
+
|
|
533
|
+
#### Agent Self-Requeue (Circuit Breaker)
|
|
534
|
+
|
|
535
|
+
After a human initiates the first review, work-agents can request re-review up to 3 times automatically:
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
# Work-agent requests re-review after fixing issues
|
|
539
|
+
pan work request-review MIN-123 -m "Fixed: added tests for edge cases"
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
**Circuit breaker behavior:**
|
|
543
|
+
- First human click resets the counter to 0
|
|
544
|
+
- Each `pan work request-review` increments the counter
|
|
545
|
+
- After 3 automatic re-requests, returns HTTP 429
|
|
546
|
+
- Human must click "Review" in dashboard to continue
|
|
547
|
+
|
|
548
|
+
This prevents infinite loops where an agent repeatedly fails review.
|
|
549
|
+
|
|
550
|
+
**API endpoint:** `POST /api/workspaces/:issueId/request-review`
|
|
551
|
+
|
|
392
552
|
#### Specialist Auto-Initialization
|
|
393
553
|
|
|
394
554
|
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.
|
|
@@ -642,6 +802,395 @@ Issues are routed to different subdirectories based on their labels:
|
|
|
642
802
|
|
|
643
803
|
Example: An issue with label "splash" in the MIN team would create its workspace at `/home/user/projects/myn/splash/workspaces/feature-min-xxx/`.
|
|
644
804
|
|
|
805
|
+
### Custom Workspace Commands (Legacy)
|
|
806
|
+
|
|
807
|
+
> **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.
|
|
808
|
+
|
|
809
|
+
For projects that need logic beyond what the configuration supports, you can specify custom workspace scripts:
|
|
810
|
+
|
|
811
|
+
```yaml
|
|
812
|
+
projects:
|
|
813
|
+
myn:
|
|
814
|
+
name: "Mind Your Now"
|
|
815
|
+
path: /home/user/projects/myn
|
|
816
|
+
linear_team: MIN
|
|
817
|
+
# Custom scripts handle complex workspace setup
|
|
818
|
+
workspace_command: /home/user/projects/myn/infra/new-feature
|
|
819
|
+
workspace_remove_command: /home/user/projects/myn/infra/remove-feature
|
|
820
|
+
```
|
|
821
|
+
|
|
822
|
+
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.
|
|
823
|
+
|
|
824
|
+
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:
|
|
825
|
+
- Stop Docker containers and remove volumes
|
|
826
|
+
- Clean up root-owned files created by containers
|
|
827
|
+
- Remove git worktrees from multiple repositories
|
|
828
|
+
- Release port assignments
|
|
829
|
+
- Remove DNS entries
|
|
830
|
+
|
|
831
|
+
**What your custom script should handle:**
|
|
832
|
+
- Creating git worktrees for multiple repositories (polyrepo structure)
|
|
833
|
+
- Setting up Docker Compose files and dev containers
|
|
834
|
+
- Configuring environment variables and `.env` files
|
|
835
|
+
- Setting up DNS entries for workspace-specific URLs (e.g., Traefik routing)
|
|
836
|
+
- Creating a `./dev` script for container management
|
|
837
|
+
- Copying agent configuration templates (CLAUDE.md, .mcp.json, etc.)
|
|
838
|
+
|
|
839
|
+
**Example script flow:**
|
|
840
|
+
```bash
|
|
841
|
+
#!/bin/bash
|
|
842
|
+
# new-feature script for a polyrepo project
|
|
843
|
+
ISSUE_ID=$1 # e.g., "min-123"
|
|
844
|
+
|
|
845
|
+
# Create worktrees for frontend and api repos
|
|
846
|
+
git -C /path/to/frontend worktree add ../workspaces/feature-$ISSUE_ID/fe feature/$ISSUE_ID
|
|
847
|
+
git -C /path/to/api worktree add ../workspaces/feature-$ISSUE_ID/api feature/$ISSUE_ID
|
|
848
|
+
|
|
849
|
+
# Generate docker-compose from templates
|
|
850
|
+
sed "s/{{FEATURE_FOLDER}}/feature-$ISSUE_ID/g" template.yml > workspace/docker-compose.yml
|
|
851
|
+
|
|
852
|
+
# Set up DNS and Traefik routing
|
|
853
|
+
# ... additional setup
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
The standard `pan workspace create` command will automatically detect and use your custom script.
|
|
857
|
+
|
|
858
|
+
#### Container Configuration Tips
|
|
859
|
+
|
|
860
|
+
When setting up Docker containers for workspaces, avoid these common pitfalls:
|
|
861
|
+
|
|
862
|
+
**Maven projects:**
|
|
863
|
+
- DO NOT set `MAVEN_CONFIG=/some/path` as an environment variable
|
|
864
|
+
- Maven interprets `MAVEN_CONFIG` as additional CLI arguments, not a directory path
|
|
865
|
+
- This causes "Unknown lifecycle phase" errors (e.g., "Unknown lifecycle phase /maven-cache")
|
|
866
|
+
- Instead, use `-Dmaven.repo.local=/path/to/cache` in the Maven command
|
|
867
|
+
|
|
868
|
+
```yaml
|
|
869
|
+
# WRONG - causes Maven startup failure
|
|
870
|
+
environment:
|
|
871
|
+
- MAVEN_CONFIG=/maven-cache
|
|
872
|
+
|
|
873
|
+
# CORRECT - use command line argument
|
|
874
|
+
command: ./mvnw spring-boot:run -Dmaven.repo.local=/maven-cache/repository
|
|
875
|
+
volumes:
|
|
876
|
+
- ~/.m2:/maven-cache:cached
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
**pnpm projects:**
|
|
880
|
+
- Set `PNPM_HOME=/path` to configure the pnpm store location
|
|
881
|
+
- Mount a named volume for the store to share across containers
|
|
882
|
+
|
|
883
|
+
### What Your Project Needs to Provide
|
|
884
|
+
|
|
885
|
+
Panopticon is an orchestration layer - it manages workspaces, agents, and workflows, but **your project repository provides the actual templates and configuration**.
|
|
886
|
+
|
|
887
|
+
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:
|
|
888
|
+
|
|
889
|
+
### Required: Workspace Templates
|
|
890
|
+
|
|
891
|
+
Your project needs a `.devcontainer/` or template directory with:
|
|
892
|
+
|
|
893
|
+
```
|
|
894
|
+
your-project/
|
|
895
|
+
├── infra/
|
|
896
|
+
│ └── .devcontainer-template/ # Template for workspace containers
|
|
897
|
+
│ ├── docker-compose.devcontainer.yml.template
|
|
898
|
+
│ ├── compose.infra.yml.template # Optional: separate infra services
|
|
899
|
+
│ ├── Dockerfile
|
|
900
|
+
│ └── devcontainer.json.template
|
|
901
|
+
└── ...
|
|
902
|
+
```
|
|
903
|
+
|
|
904
|
+
**Docker Compose templates** should use placeholders that Panopticon will replace:
|
|
905
|
+
|
|
906
|
+
```yaml
|
|
907
|
+
# docker-compose.devcontainer.yml.template
|
|
908
|
+
services:
|
|
909
|
+
api:
|
|
910
|
+
build: ./api
|
|
911
|
+
user: vscode # Run as non-root to avoid permission issues
|
|
912
|
+
labels:
|
|
913
|
+
- "traefik.http.routers.{{FEATURE_FOLDER}}-api.rule=Host(`api-{{FEATURE_FOLDER}}.{{DOMAIN}}`)"
|
|
914
|
+
environment:
|
|
915
|
+
- DATABASE_URL=postgres://app:app@postgres:5432/mydb
|
|
916
|
+
|
|
917
|
+
frontend:
|
|
918
|
+
build: ./fe
|
|
919
|
+
user: vscode # Run as non-root to avoid permission issues
|
|
920
|
+
labels:
|
|
921
|
+
- "traefik.http.routers.{{FEATURE_FOLDER}}.rule=Host(`{{FEATURE_FOLDER}}.{{DOMAIN}}`)"
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
> **⚠️ Important: File Permissions**
|
|
925
|
+
>
|
|
926
|
+
> Always run containers as a non-root user (e.g., `user: vscode`) to avoid permission issues.
|
|
927
|
+
> Files created by root-owned containers cannot be removed by `pan workspace destroy` without sudo.
|
|
928
|
+
> The Microsoft devcontainers base image includes a `vscode` user (UID 1000) that matches most host users.
|
|
929
|
+
|
|
930
|
+
### Required for HTTPS: Traefik Configuration
|
|
931
|
+
|
|
932
|
+
If you want local HTTPS (recommended), provide a Traefik compose file:
|
|
933
|
+
|
|
934
|
+
```
|
|
935
|
+
your-project/
|
|
936
|
+
├── infra/
|
|
937
|
+
│ └── docker-compose.traefik.yml # Traefik reverse proxy
|
|
938
|
+
└── ...
|
|
939
|
+
```
|
|
940
|
+
|
|
941
|
+
Example Traefik config:
|
|
942
|
+
```yaml
|
|
943
|
+
# infra/docker-compose.traefik.yml
|
|
944
|
+
services:
|
|
945
|
+
traefik:
|
|
946
|
+
image: traefik:v2.10
|
|
947
|
+
ports:
|
|
948
|
+
- "80:80"
|
|
949
|
+
- "443:443"
|
|
950
|
+
volumes:
|
|
951
|
+
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
952
|
+
- ~/.panopticon/traefik/certs:/certs:ro
|
|
953
|
+
command:
|
|
954
|
+
- --providers.docker=true
|
|
955
|
+
- --entrypoints.web.address=:80
|
|
956
|
+
- --entrypoints.websecure.address=:443
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
### Required for Database Seeding: Seed Directory
|
|
960
|
+
|
|
961
|
+
For projects with databases:
|
|
962
|
+
|
|
963
|
+
```
|
|
964
|
+
your-project/
|
|
965
|
+
├── infra/
|
|
966
|
+
│ └── seed/
|
|
967
|
+
│ └── seed.sql # Sanitized production data
|
|
968
|
+
└── ...
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
Your compose template should mount this:
|
|
972
|
+
```yaml
|
|
973
|
+
services:
|
|
974
|
+
postgres:
|
|
975
|
+
image: postgres:16
|
|
976
|
+
volumes:
|
|
977
|
+
- /path/to/project/infra/seed:/docker-entrypoint-initdb.d:ro
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
### Optional: Agent Templates
|
|
981
|
+
|
|
982
|
+
For customizing how agents work in your project:
|
|
983
|
+
|
|
984
|
+
```
|
|
985
|
+
your-project/
|
|
986
|
+
├── infra/
|
|
987
|
+
│ └── .agent-template/
|
|
988
|
+
│ ├── CLAUDE.md.template # Project-specific AI instructions
|
|
989
|
+
│ └── .mcp.json.template # MCP server configuration
|
|
990
|
+
└── .claude/
|
|
991
|
+
└── skills/ # Project-specific skills
|
|
992
|
+
└── my-project-standards/
|
|
993
|
+
└── SKILL.md
|
|
994
|
+
```
|
|
995
|
+
|
|
996
|
+
### Configuration in projects.yaml
|
|
997
|
+
|
|
998
|
+
Point Panopticon to your templates:
|
|
999
|
+
|
|
1000
|
+
```yaml
|
|
1001
|
+
# ~/.panopticon/projects.yaml
|
|
1002
|
+
projects:
|
|
1003
|
+
myproject:
|
|
1004
|
+
name: "My Project"
|
|
1005
|
+
path: /home/user/projects/myproject
|
|
1006
|
+
linear_team: PRJ
|
|
1007
|
+
|
|
1008
|
+
workspace:
|
|
1009
|
+
type: polyrepo # or monorepo
|
|
1010
|
+
workspaces_dir: workspaces
|
|
1011
|
+
|
|
1012
|
+
docker:
|
|
1013
|
+
traefik: infra/docker-compose.traefik.yml
|
|
1014
|
+
compose_template: infra/.devcontainer-template
|
|
1015
|
+
|
|
1016
|
+
database:
|
|
1017
|
+
seed_file: /home/user/projects/myproject/infra/seed/seed.sql
|
|
1018
|
+
container_name: "{{PROJECT}}-postgres-1"
|
|
1019
|
+
|
|
1020
|
+
agent:
|
|
1021
|
+
template_dir: infra/.agent-template
|
|
1022
|
+
templates:
|
|
1023
|
+
- source: CLAUDE.md.template
|
|
1024
|
+
target: CLAUDE.md
|
|
1025
|
+
```
|
|
1026
|
+
|
|
1027
|
+
### Quick Checklist
|
|
1028
|
+
|
|
1029
|
+
| Component | Required? | Location | Purpose |
|
|
1030
|
+
|-----------|-----------|----------|---------|
|
|
1031
|
+
| Docker Compose template | Yes (for Docker workspaces) | `infra/.devcontainer-template/` | Container configuration |
|
|
1032
|
+
| Traefik config | Only for HTTPS | `infra/docker-compose.traefik.yml` | Reverse proxy |
|
|
1033
|
+
| Seed file | Only if database needed | `infra/seed/seed.sql` | Pre-populate database |
|
|
1034
|
+
| Agent template | Recommended | `infra/.agent-template/` | AI instructions |
|
|
1035
|
+
| Project skills | Optional | `.claude/skills/` | Project-specific workflows |
|
|
1036
|
+
|
|
1037
|
+
### Example: Minimal Setup
|
|
1038
|
+
|
|
1039
|
+
For a simple monorepo with no Docker:
|
|
1040
|
+
|
|
1041
|
+
```yaml
|
|
1042
|
+
# ~/.panopticon/projects.yaml
|
|
1043
|
+
projects:
|
|
1044
|
+
simple-app:
|
|
1045
|
+
name: "Simple App"
|
|
1046
|
+
path: /home/user/projects/simple-app
|
|
1047
|
+
linear_team: APP
|
|
1048
|
+
# No workspace config needed - uses git worktrees
|
|
1049
|
+
```
|
|
1050
|
+
|
|
1051
|
+
Panopticon creates workspaces as git worktrees. Docker, HTTPS, and seeding are opt-in.
|
|
1052
|
+
|
|
1053
|
+
---
|
|
1054
|
+
|
|
1055
|
+
## Polyrepo Workspace Configuration
|
|
1056
|
+
|
|
1057
|
+
For projects with multiple git repositories (like separate frontend/backend repos), configure workspace settings directly in `projects.yaml`:
|
|
1058
|
+
|
|
1059
|
+
```yaml
|
|
1060
|
+
projects:
|
|
1061
|
+
myapp:
|
|
1062
|
+
name: "My App"
|
|
1063
|
+
path: /home/user/projects/myapp
|
|
1064
|
+
linear_team: APP
|
|
1065
|
+
|
|
1066
|
+
workspace:
|
|
1067
|
+
type: polyrepo
|
|
1068
|
+
workspaces_dir: workspaces
|
|
1069
|
+
# Default branch for all repos (optional, defaults to 'main')
|
|
1070
|
+
default_branch: main
|
|
1071
|
+
|
|
1072
|
+
# Git repositories to include in each workspace
|
|
1073
|
+
# Each repo is a SEPARATE git repository with its own .git
|
|
1074
|
+
repos:
|
|
1075
|
+
- name: fe
|
|
1076
|
+
path: frontend # Relative to project root
|
|
1077
|
+
branch_prefix: "feature/"
|
|
1078
|
+
# default_branch: main # Can override workspace default per-repo
|
|
1079
|
+
- name: api
|
|
1080
|
+
path: backend
|
|
1081
|
+
branch_prefix: "feature/"
|
|
1082
|
+
# default_branch: develop # Example: API uses 'develop' as default
|
|
1083
|
+
|
|
1084
|
+
# DNS entries for local development
|
|
1085
|
+
dns:
|
|
1086
|
+
domain: myapp.test
|
|
1087
|
+
entries:
|
|
1088
|
+
- "{{FEATURE_FOLDER}}.{{DOMAIN}}"
|
|
1089
|
+
- "api-{{FEATURE_FOLDER}}.{{DOMAIN}}"
|
|
1090
|
+
sync_method: wsl2hosts # or: hosts_file, dnsmasq
|
|
1091
|
+
|
|
1092
|
+
# Port assignments for services
|
|
1093
|
+
ports:
|
|
1094
|
+
redis:
|
|
1095
|
+
range: [6380, 6499]
|
|
1096
|
+
|
|
1097
|
+
# Service definitions - how to start each service
|
|
1098
|
+
services:
|
|
1099
|
+
- name: api
|
|
1100
|
+
path: api
|
|
1101
|
+
start_command: ./mvnw spring-boot:run
|
|
1102
|
+
docker_command: ./mvnw spring-boot:run
|
|
1103
|
+
health_url: "https://api-{{FEATURE_FOLDER}}.{{DOMAIN}}/actuator/health"
|
|
1104
|
+
port: 8080
|
|
1105
|
+
- name: frontend
|
|
1106
|
+
path: fe
|
|
1107
|
+
start_command: pnpm start
|
|
1108
|
+
docker_command: pnpm start
|
|
1109
|
+
health_url: "https://{{FEATURE_FOLDER}}.{{DOMAIN}}"
|
|
1110
|
+
port: 3000
|
|
1111
|
+
|
|
1112
|
+
# Docker configuration
|
|
1113
|
+
docker:
|
|
1114
|
+
traefik: infra/docker-compose.traefik.yml
|
|
1115
|
+
compose_template: infra/.devcontainer-template
|
|
1116
|
+
|
|
1117
|
+
# Agent configuration templates
|
|
1118
|
+
agent:
|
|
1119
|
+
template_dir: infra/.agent-template
|
|
1120
|
+
templates:
|
|
1121
|
+
- source: CLAUDE.md.template
|
|
1122
|
+
target: CLAUDE.md
|
|
1123
|
+
symlinks:
|
|
1124
|
+
- .claude/commands
|
|
1125
|
+
- .claude/skills
|
|
1126
|
+
|
|
1127
|
+
# Environment template
|
|
1128
|
+
env:
|
|
1129
|
+
template: |
|
|
1130
|
+
COMPOSE_PROJECT_NAME={{COMPOSE_PROJECT}}
|
|
1131
|
+
FRONTEND_URL=https://{{FEATURE_FOLDER}}.{{DOMAIN}}
|
|
1132
|
+
```
|
|
1133
|
+
|
|
1134
|
+
**Template Placeholders:**
|
|
1135
|
+
|
|
1136
|
+
| Placeholder | Example | Description |
|
|
1137
|
+
|------------|---------|-------------|
|
|
1138
|
+
| `{{FEATURE_NAME}}` | `min-123` | Normalized issue ID |
|
|
1139
|
+
| `{{FEATURE_FOLDER}}` | `feature-min-123` | Workspace folder name |
|
|
1140
|
+
| `{{BRANCH_NAME}}` | `feature/min-123` | Git branch name |
|
|
1141
|
+
| `{{COMPOSE_PROJECT}}` | `myapp-feature-min-123` | Docker Compose project |
|
|
1142
|
+
| `{{DOMAIN}}` | `myapp.test` | DNS domain |
|
|
1143
|
+
|
|
1144
|
+
**Service Templates:**
|
|
1145
|
+
|
|
1146
|
+
Panopticon provides built-in templates for common frameworks. Use these to avoid boilerplate:
|
|
1147
|
+
|
|
1148
|
+
| Template | Start Command | Port |
|
|
1149
|
+
|----------|--------------|------|
|
|
1150
|
+
| `react` | `npm start` | 3000 |
|
|
1151
|
+
| `react-vite` | `npm run dev` | 5173 |
|
|
1152
|
+
| `react-pnpm` | `pnpm start` | 3000 |
|
|
1153
|
+
| `nextjs` | `npm run dev` | 3000 |
|
|
1154
|
+
| `spring-boot-maven` | `./mvnw spring-boot:run` | 8080 |
|
|
1155
|
+
| `spring-boot-gradle` | `./gradlew bootRun` | 8080 |
|
|
1156
|
+
| `express` | `npm start` | 3000 |
|
|
1157
|
+
| `fastapi` | `uvicorn main:app --reload` | 8000 |
|
|
1158
|
+
| `django` | `python manage.py runserver` | 8000 |
|
|
1159
|
+
|
|
1160
|
+
Use a template by referencing it in your service config:
|
|
1161
|
+
|
|
1162
|
+
```yaml
|
|
1163
|
+
services:
|
|
1164
|
+
- name: api
|
|
1165
|
+
template: spring-boot-maven
|
|
1166
|
+
path: api
|
|
1167
|
+
health_url: "https://api-{{FEATURE_FOLDER}}.myapp.test/health"
|
|
1168
|
+
```
|
|
1169
|
+
|
|
1170
|
+
See `/pan-workspace-config` skill for complete documentation.
|
|
1171
|
+
|
|
1172
|
+
### Polyrepo Merge Considerations
|
|
1173
|
+
|
|
1174
|
+
> **⚠️ Important:** Polyrepo merging requires special handling. The current merge-agent is optimized for monorepos.
|
|
1175
|
+
|
|
1176
|
+
For polyrepo projects:
|
|
1177
|
+
|
|
1178
|
+
| Feature | Status | Notes |
|
|
1179
|
+
|---------|--------|-------|
|
|
1180
|
+
| Workspace creation | ✅ Supported | Creates worktrees in each repo |
|
|
1181
|
+
| Branch management | ✅ Supported | Each repo gets its own feature branch |
|
|
1182
|
+
| Agent work | ✅ Supported | Agents can work across repos |
|
|
1183
|
+
| Merge | ⚠️ Manual | Push each repo's branch, merge via GitLab/GitHub |
|
|
1184
|
+
|
|
1185
|
+
**Current workflow for polyrepo merges:**
|
|
1186
|
+
|
|
1187
|
+
1. Agent completes work and pushes branches to each repo
|
|
1188
|
+
2. Create merge requests for each repo manually (or via `gh pr create`)
|
|
1189
|
+
3. Review and merge each MR separately
|
|
1190
|
+
4. The "Approve & Merge" button is not yet polyrepo-aware
|
|
1191
|
+
|
|
1192
|
+
**Future enhancement:** Polyrepo-aware merge-agent that handles multiple repos automatically.
|
|
1193
|
+
|
|
645
1194
|
### Managing Projects
|
|
646
1195
|
|
|
647
1196
|
```bash
|
|
@@ -655,6 +1204,134 @@ pan project add /path/to/project --name myproject --linear-team PRJ
|
|
|
655
1204
|
pan project remove myproject
|
|
656
1205
|
```
|
|
657
1206
|
|
|
1207
|
+
### Database Seeding
|
|
1208
|
+
|
|
1209
|
+
Many projects need a pre-populated database for development and testing. Panopticon provides database seeding commands that work with your existing infrastructure.
|
|
1210
|
+
|
|
1211
|
+
**Problem:** Development databases often need:
|
|
1212
|
+
- Schema with 100+ migrations already applied
|
|
1213
|
+
- Seed data for testing (users, reference data)
|
|
1214
|
+
- External QA database connections
|
|
1215
|
+
- Database snapshots from staging/production (sanitized)
|
|
1216
|
+
|
|
1217
|
+
**Solution:** Configure database seeding in `projects.yaml`:
|
|
1218
|
+
|
|
1219
|
+
```yaml
|
|
1220
|
+
projects:
|
|
1221
|
+
myapp:
|
|
1222
|
+
workspace:
|
|
1223
|
+
database:
|
|
1224
|
+
# Path to seed file (loaded on first container start)
|
|
1225
|
+
seed_file: /path/to/sanitized-seed.sql
|
|
1226
|
+
|
|
1227
|
+
# Command to create new snapshots from external source
|
|
1228
|
+
snapshot_command: "kubectl exec -n prod pod/postgres -- pg_dump -U app mydb"
|
|
1229
|
+
|
|
1230
|
+
# Or connect to external database directly
|
|
1231
|
+
external_db:
|
|
1232
|
+
host: qa-db.example.com
|
|
1233
|
+
database: myapp_qa
|
|
1234
|
+
user: readonly
|
|
1235
|
+
password_env: QA_DB_PASSWORD
|
|
1236
|
+
|
|
1237
|
+
# Container naming pattern
|
|
1238
|
+
container_name: "{{PROJECT}}-postgres-1"
|
|
1239
|
+
|
|
1240
|
+
# Migration tool (for status checks)
|
|
1241
|
+
migrations:
|
|
1242
|
+
type: flyway # flyway | liquibase | prisma | typeorm | custom
|
|
1243
|
+
path: src/main/resources/db/migration
|
|
1244
|
+
```
|
|
1245
|
+
|
|
1246
|
+
**Commands:**
|
|
1247
|
+
|
|
1248
|
+
```bash
|
|
1249
|
+
# Create a snapshot from production/staging
|
|
1250
|
+
pan db snapshot --project myapp --output /path/to/seed.sql
|
|
1251
|
+
|
|
1252
|
+
# Seed a workspace database
|
|
1253
|
+
pan db seed MIN-123
|
|
1254
|
+
|
|
1255
|
+
# Check database status
|
|
1256
|
+
pan db status MIN-123
|
|
1257
|
+
|
|
1258
|
+
# Clean kubectl noise from pg_dump files
|
|
1259
|
+
pan db clean /path/to/dump.sql
|
|
1260
|
+
|
|
1261
|
+
# View database configuration
|
|
1262
|
+
pan db config myapp
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
**Workflow for capturing production data:**
|
|
1266
|
+
|
|
1267
|
+
1. **Create snapshot** from production (via kubectl or direct connection):
|
|
1268
|
+
```bash
|
|
1269
|
+
pan db snapshot --project myapp --sanitize
|
|
1270
|
+
```
|
|
1271
|
+
|
|
1272
|
+
2. **Verify** the seed file:
|
|
1273
|
+
```bash
|
|
1274
|
+
pan db clean /path/to/seed.sql --dry-run
|
|
1275
|
+
```
|
|
1276
|
+
|
|
1277
|
+
3. **Update projects.yaml** with seed file path
|
|
1278
|
+
|
|
1279
|
+
4. **Workspaces** automatically seed on first postgres container start
|
|
1280
|
+
|
|
1281
|
+
**Container integration:**
|
|
1282
|
+
|
|
1283
|
+
Your Docker Compose template should mount the seed directory:
|
|
1284
|
+
|
|
1285
|
+
```yaml
|
|
1286
|
+
# compose.infra.yml
|
|
1287
|
+
services:
|
|
1288
|
+
postgres:
|
|
1289
|
+
image: postgres:16
|
|
1290
|
+
volumes:
|
|
1291
|
+
- pgdata:/var/lib/postgresql/data
|
|
1292
|
+
# Seed database on first startup
|
|
1293
|
+
- /path/to/project/infra/seed:/docker-entrypoint-initdb.d:ro
|
|
1294
|
+
```
|
|
1295
|
+
|
|
1296
|
+
**Troubleshooting:**
|
|
1297
|
+
|
|
1298
|
+
| Issue | Solution |
|
|
1299
|
+
|-------|----------|
|
|
1300
|
+
| "relation does not exist" | Seed file missing or incomplete - run `pan db snapshot` |
|
|
1301
|
+
| Slow database startup | Large seed file - consider pruning old data |
|
|
1302
|
+
| kubectl garbage in dump | Run `pan db clean <file>` to remove stderr noise |
|
|
1303
|
+
| Migrations fail after seed | Check Flyway version matches seed file's schema_history |
|
|
1304
|
+
|
|
1305
|
+
### Agent Completion Notifications
|
|
1306
|
+
|
|
1307
|
+
Panopticon includes a notification system that alerts you when agents complete their work.
|
|
1308
|
+
|
|
1309
|
+
**Desktop Notifications:**
|
|
1310
|
+
|
|
1311
|
+
The `notify-complete` script sends desktop notifications across platforms:
|
|
1312
|
+
|
|
1313
|
+
| Platform | Notification Method |
|
|
1314
|
+
|----------|---------------------|
|
|
1315
|
+
| WSL2/Windows | PowerShell toast notifications |
|
|
1316
|
+
| macOS | osascript display notification |
|
|
1317
|
+
| Linux | notify-send |
|
|
1318
|
+
|
|
1319
|
+
**Usage:**
|
|
1320
|
+
```bash
|
|
1321
|
+
# Send a completion notification
|
|
1322
|
+
~/.panopticon/bin/notify-complete MIN-123 "Fixed login button" "https://gitlab.com/mr/456"
|
|
1323
|
+
```
|
|
1324
|
+
|
|
1325
|
+
**Completion log:** All notifications are logged to `~/.panopticon/agent-completed.log` with timestamps.
|
|
1326
|
+
|
|
1327
|
+
**Integration with agent workflows:**
|
|
1328
|
+
|
|
1329
|
+
Agents can call `notify-complete` at the end of their work:
|
|
1330
|
+
```bash
|
|
1331
|
+
# In agent completion script or /work-complete skill
|
|
1332
|
+
notify-complete "$ISSUE_ID" "$SUMMARY" "$MR_URL"
|
|
1333
|
+
```
|
|
1334
|
+
|
|
658
1335
|
---
|
|
659
1336
|
|
|
660
1337
|
## Commands
|
|
@@ -670,8 +1347,71 @@ pan skills # List available skills
|
|
|
670
1347
|
pan status # Show running agents
|
|
671
1348
|
pan up # Start dashboard (Docker or minimal)
|
|
672
1349
|
pan down # Stop dashboard and services
|
|
1350
|
+
pan update # Update Panopticon to latest version
|
|
1351
|
+
pan backup # Create backup of ~/.panopticon/
|
|
1352
|
+
pan restore # Restore from backup
|
|
1353
|
+
pan setup hooks # Install Claude Code hooks (heartbeat, etc.)
|
|
1354
|
+
```
|
|
1355
|
+
|
|
1356
|
+
### Beads Management
|
|
1357
|
+
|
|
1358
|
+
Beads is an optional git-backed issue tracker for persistent task tracking. Panopticon includes commands to manage beads databases and automatic cleanup after merges.
|
|
1359
|
+
|
|
1360
|
+
**Installation:** Beads is automatically installed during `pan install`. You can also install/upgrade manually:
|
|
1361
|
+
|
|
1362
|
+
```bash
|
|
1363
|
+
# Check beads version and available updates
|
|
1364
|
+
pan beads upgrade --check
|
|
1365
|
+
|
|
1366
|
+
# Upgrade to latest version
|
|
1367
|
+
pan beads upgrade
|
|
1368
|
+
|
|
1369
|
+
# Show beads statistics (total, open, closed, old)
|
|
1370
|
+
pan beads stats
|
|
1371
|
+
|
|
1372
|
+
# Compact beads - remove closed issues older than 30 days
|
|
1373
|
+
pan beads compact
|
|
1374
|
+
|
|
1375
|
+
# Customize the threshold (e.g., 60 days)
|
|
1376
|
+
pan beads compact --days 60
|
|
1377
|
+
|
|
1378
|
+
# Preview what would be removed (dry run)
|
|
1379
|
+
pan beads compact --dry-run
|
|
1380
|
+
```
|
|
1381
|
+
|
|
1382
|
+
**Recommended version:** v0.47.1+ includes important fixes for git worktree isolation.
|
|
1383
|
+
|
|
1384
|
+
**Workspace Isolation:**
|
|
1385
|
+
|
|
1386
|
+
With beads v0.47.1+, workspaces share the same database but use labels for isolation:
|
|
1387
|
+
|
|
1388
|
+
```bash
|
|
1389
|
+
# In workspace for PAN-83, list only that workspace's tasks
|
|
1390
|
+
bd list --label workspace:pan-83
|
|
1391
|
+
|
|
1392
|
+
# Or use bd ready with label filter
|
|
1393
|
+
bd ready --label workspace:pan-83
|
|
673
1394
|
```
|
|
674
1395
|
|
|
1396
|
+
Panopticon automatically creates beads with `workspace:<issue-id>` labels when you create a workspace. Agents can filter to see only their workspace's tasks.
|
|
1397
|
+
|
|
1398
|
+
**Automatic Compaction:**
|
|
1399
|
+
|
|
1400
|
+
After every successful merge, the merge-agent automatically:
|
|
1401
|
+
1. Checks for closed beads older than 30 days
|
|
1402
|
+
2. If found, runs `bd admin compact --days 30`
|
|
1403
|
+
3. Commits the compacted beads
|
|
1404
|
+
4. Pushes to remote
|
|
1405
|
+
|
|
1406
|
+
This keeps the beads database clean without manual intervention.
|
|
1407
|
+
|
|
1408
|
+
**Why compact beads?**
|
|
1409
|
+
|
|
1410
|
+
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:
|
|
1411
|
+
- Open issues (always kept)
|
|
1412
|
+
- Recently closed issues (< 30 days by default)
|
|
1413
|
+
- All issue history in git commits
|
|
1414
|
+
|
|
675
1415
|
#### What `pan sync` Does
|
|
676
1416
|
|
|
677
1417
|
`pan sync` synchronizes Panopticon assets to all supported AI tools:
|
|
@@ -694,11 +1434,38 @@ pan work issue MIN-123
|
|
|
694
1434
|
# List all running agents
|
|
695
1435
|
pan work status
|
|
696
1436
|
|
|
697
|
-
# Send a message to an agent
|
|
1437
|
+
# Send a message to an agent (handles Enter key automatically)
|
|
698
1438
|
pan work tell min-123 "Please also add tests"
|
|
699
1439
|
|
|
700
1440
|
# Kill an agent
|
|
701
1441
|
pan work kill min-123
|
|
1442
|
+
|
|
1443
|
+
# Show work completed and awaiting review
|
|
1444
|
+
pan work pending
|
|
1445
|
+
|
|
1446
|
+
# Approve agent work, merge MR, update Linear
|
|
1447
|
+
pan work approve min-123
|
|
1448
|
+
|
|
1449
|
+
# List issues from configured trackers
|
|
1450
|
+
pan work list
|
|
1451
|
+
|
|
1452
|
+
# Triage issues from secondary tracker
|
|
1453
|
+
pan work triage
|
|
1454
|
+
|
|
1455
|
+
# Reopen a closed issue and re-run planning
|
|
1456
|
+
pan work reopen min-123
|
|
1457
|
+
|
|
1458
|
+
# Request re-review after fixing feedback (for agents, max 3 auto-requeues)
|
|
1459
|
+
pan work request-review min-123 -m "Fixed: added tests and removed duplication"
|
|
1460
|
+
|
|
1461
|
+
# Deep wipe: completely reset all state for an issue
|
|
1462
|
+
pan work wipe min-123 # Cleans up agents, state, Linear status
|
|
1463
|
+
pan work wipe min-123 -w # Also delete workspace
|
|
1464
|
+
pan work wipe min-123 -y -w # Skip confirmation
|
|
1465
|
+
|
|
1466
|
+
# Recover crashed agents
|
|
1467
|
+
pan work recover min-123
|
|
1468
|
+
pan work recover --all
|
|
702
1469
|
```
|
|
703
1470
|
|
|
704
1471
|
### Health Monitoring
|
|
@@ -714,6 +1481,63 @@ pan work health status
|
|
|
714
1481
|
pan work health daemon --interval 30
|
|
715
1482
|
```
|
|
716
1483
|
|
|
1484
|
+
### Test Runner
|
|
1485
|
+
|
|
1486
|
+
```bash
|
|
1487
|
+
# Run all tests for a workspace
|
|
1488
|
+
pan test run min-123
|
|
1489
|
+
|
|
1490
|
+
# Run tests for main branch
|
|
1491
|
+
pan test run main
|
|
1492
|
+
|
|
1493
|
+
# Run specific test suites only
|
|
1494
|
+
pan test run min-123 --tests backend,frontend_unit
|
|
1495
|
+
|
|
1496
|
+
# List configured tests for a project
|
|
1497
|
+
pan test list
|
|
1498
|
+
|
|
1499
|
+
# List tests for specific project
|
|
1500
|
+
pan test list myproject
|
|
1501
|
+
```
|
|
1502
|
+
|
|
1503
|
+
**Test Configuration:**
|
|
1504
|
+
|
|
1505
|
+
Configure test suites in `projects.yaml`:
|
|
1506
|
+
|
|
1507
|
+
```yaml
|
|
1508
|
+
projects:
|
|
1509
|
+
myapp:
|
|
1510
|
+
tests:
|
|
1511
|
+
backend:
|
|
1512
|
+
type: maven # maven, vitest, jest, playwright, pytest, cargo
|
|
1513
|
+
path: api # Path relative to workspace
|
|
1514
|
+
command: ./mvnw test # Command to run
|
|
1515
|
+
|
|
1516
|
+
frontend_unit:
|
|
1517
|
+
type: vitest
|
|
1518
|
+
path: fe
|
|
1519
|
+
command: pnpm test:unit --run
|
|
1520
|
+
container: true # Run inside Docker container
|
|
1521
|
+
container_name: "{{COMPOSE_PROJECT}}-fe-1"
|
|
1522
|
+
|
|
1523
|
+
frontend_e2e:
|
|
1524
|
+
type: playwright
|
|
1525
|
+
path: fe
|
|
1526
|
+
command: pnpm test:e2e
|
|
1527
|
+
env:
|
|
1528
|
+
BASE_URL: "https://{{FEATURE_FOLDER}}.myapp.test"
|
|
1529
|
+
```
|
|
1530
|
+
|
|
1531
|
+
**Reports:**
|
|
1532
|
+
|
|
1533
|
+
Test results are saved to `{project}/reports/test-run-{target}-{timestamp}.md` with detailed logs for each suite.
|
|
1534
|
+
|
|
1535
|
+
**Notifications:**
|
|
1536
|
+
|
|
1537
|
+
Desktop notifications are sent when tests complete (disable with `--no-notify`).
|
|
1538
|
+
|
|
1539
|
+
See `/pan-test-config` skill for complete documentation.
|
|
1540
|
+
|
|
717
1541
|
### FPP Hooks (Fixed Point Principle)
|
|
718
1542
|
|
|
719
1543
|
```bash
|
|
@@ -737,6 +1561,67 @@ pan work hook mail agent-min-123 "Review feedback received"
|
|
|
737
1561
|
|
|
738
1562
|
This allows multiple agents to work on different features simultaneously without conflicts.
|
|
739
1563
|
|
|
1564
|
+
> **IMPORTANT: Main Project Branch Convention**
|
|
1565
|
+
>
|
|
1566
|
+
> The main project directory should **ALWAYS** stay on the `main` branch. All feature work happens in workspaces (git worktrees), never in the main project.
|
|
1567
|
+
>
|
|
1568
|
+
> - **Main project**: Always on `main` - serves as the stable reference point
|
|
1569
|
+
> - **Workspaces**: Each has its own feature branch checked out
|
|
1570
|
+
> - **Want to check something?** Create a worktree, don't checkout in main
|
|
1571
|
+
> - **Quick test?** Create a worktree
|
|
1572
|
+
> - **Emergency hotfix?** Create a worktree
|
|
1573
|
+
>
|
|
1574
|
+
> This convention ensures:
|
|
1575
|
+
> 1. Specialists (review-agent, test-agent) always find the correct code
|
|
1576
|
+
> 2. Merge operations have a clean target
|
|
1577
|
+
> 3. Multiple agents don't interfere with each other
|
|
1578
|
+
>
|
|
1579
|
+
> 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`.
|
|
1580
|
+
|
|
1581
|
+
#### Git Hooks for Branch Protection
|
|
1582
|
+
|
|
1583
|
+
Panopticon provides git hooks to enforce the main branch convention. These hooks are automatically installed:
|
|
1584
|
+
|
|
1585
|
+
- **On `pan project add`** - Hooks are installed when registering a new project
|
|
1586
|
+
- **On `pan sync`** - Hooks are updated in all registered projects
|
|
1587
|
+
|
|
1588
|
+
The hooks are polyrepo-aware and will install in all git repositories within your project.
|
|
1589
|
+
|
|
1590
|
+
**Auto-revert behavior:**
|
|
1591
|
+
- **Agents & planning sessions**: Automatically revert to `main` if they accidentally checkout a feature branch
|
|
1592
|
+
- **Human users**: Display a prominent warning (no auto-revert by default)
|
|
1593
|
+
|
|
1594
|
+
To enable auto-revert for humans:
|
|
1595
|
+
```bash
|
|
1596
|
+
export PANOPTICON_AUTO_REVERT_CHECKOUT=1 # Add to .bashrc/.zshrc
|
|
1597
|
+
```
|
|
1598
|
+
|
|
1599
|
+
Manual hook installation (for projects not in registry):
|
|
1600
|
+
```bash
|
|
1601
|
+
./scripts/install-git-hooks.sh /path/to/your/project
|
|
1602
|
+
```
|
|
1603
|
+
|
|
1604
|
+
#### Planning vs Work Agent Safeguard
|
|
1605
|
+
|
|
1606
|
+
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.
|
|
1607
|
+
|
|
1608
|
+
If you see "Planning agent is still running" when trying to start work:
|
|
1609
|
+
1. **Complete the planning session** - Use "Complete Planning" button
|
|
1610
|
+
2. **Or abort planning** - Use "Abort Planning" if you want to discard
|
|
1611
|
+
3. **Or kill the session manually** - `tmux kill-session -t planning-<issue>`
|
|
1612
|
+
|
|
1613
|
+
#### Specialist Agent Safeguards
|
|
1614
|
+
|
|
1615
|
+
All specialist agents (review-agent, test-agent, merge-agent) are configured to:
|
|
1616
|
+
1. **Run in workspaces only** - Never in the main project directory
|
|
1617
|
+
2. **Never checkout branches** - They work with the branch already in the workspace
|
|
1618
|
+
3. **Create workspaces if needed** - Use `pan workspace create <ISSUE-ID>` instead of `git checkout`
|
|
1619
|
+
|
|
1620
|
+
These safeguards are enforced through:
|
|
1621
|
+
- **Prompt instructions** - Clear warnings in all specialist prompts
|
|
1622
|
+
- **Code enforcement** - Specialists spawn with workspace as cwd
|
|
1623
|
+
- **Git hooks** - Auto-revert if checkout detected in tmux sessions
|
|
1624
|
+
|
|
740
1625
|
#### Git-Backed Collaborative Planning
|
|
741
1626
|
|
|
742
1627
|
| Start Planning | Codebase Exploration | Discovery Questions |
|
|
@@ -804,6 +1689,9 @@ pan work plan MIN-123 --continue
|
|
|
804
1689
|
# Create a workspace (git worktree) without starting an agent
|
|
805
1690
|
pan workspace create MIN-123
|
|
806
1691
|
|
|
1692
|
+
# Create workspace and start Docker containers
|
|
1693
|
+
pan workspace create MIN-123 --docker
|
|
1694
|
+
|
|
807
1695
|
# List all workspaces
|
|
808
1696
|
pan workspace list
|
|
809
1697
|
|
|
@@ -814,6 +1702,69 @@ pan workspace destroy MIN-123
|
|
|
814
1702
|
pan workspace destroy MIN-123 --force
|
|
815
1703
|
```
|
|
816
1704
|
|
|
1705
|
+
#### Docker Integration
|
|
1706
|
+
|
|
1707
|
+
The `--docker` flag automatically starts containers after workspace creation:
|
|
1708
|
+
|
|
1709
|
+
```bash
|
|
1710
|
+
pan workspace create MIN-123 --docker
|
|
1711
|
+
```
|
|
1712
|
+
|
|
1713
|
+
**What it does:**
|
|
1714
|
+
1. Creates the workspace (git worktree or custom command)
|
|
1715
|
+
2. Looks for docker-compose files in:
|
|
1716
|
+
- `{workspace}/docker-compose.yml`
|
|
1717
|
+
- `{workspace}/docker-compose.yaml`
|
|
1718
|
+
- `{workspace}/.devcontainer/docker-compose.yml`
|
|
1719
|
+
- `{workspace}/.devcontainer/docker-compose.devcontainer.yml`
|
|
1720
|
+
- `{workspace}/.devcontainer/compose.yml`
|
|
1721
|
+
3. Runs `docker compose -p "{project}-feature-{issue}" -f {file} up -d --build`
|
|
1722
|
+
|
|
1723
|
+
**Docker Project Naming:**
|
|
1724
|
+
|
|
1725
|
+
Each workspace gets a unique Docker Compose project name to avoid container conflicts:
|
|
1726
|
+
- Format: `{project-name}-feature-{issue-id}` (e.g., `mind-your-now-feature-min-123`)
|
|
1727
|
+
- The project name comes from `name` in your `~/.panopticon/projects.yaml`
|
|
1728
|
+
- Container names follow: `{project}-{service}-1` (e.g., `mind-your-now-feature-min-123-api-1`)
|
|
1729
|
+
|
|
1730
|
+
This allows multiple workspaces to run simultaneously without port or name conflicts.
|
|
1731
|
+
|
|
1732
|
+
**Why this matters:**
|
|
1733
|
+
- Containers start warming up while you review the issue
|
|
1734
|
+
- Environment is ready when the planning agent starts asking questions
|
|
1735
|
+
- You can test assumptions during planning without waiting for builds
|
|
1736
|
+
|
|
1737
|
+
**Dashboard integration:**
|
|
1738
|
+
|
|
1739
|
+
The planning dialog includes a "Start Docker containers" checkbox:
|
|
1740
|
+
- **Default:** Enabled (containers start automatically)
|
|
1741
|
+
- **Preference saved:** Your choice is remembered in browser localStorage
|
|
1742
|
+
- **Key:** `panopticon.planning.startDocker`
|
|
1743
|
+
|
|
1744
|
+
To change the default via browser console:
|
|
1745
|
+
```javascript
|
|
1746
|
+
// Disable Docker by default
|
|
1747
|
+
localStorage.setItem('panopticon.planning.startDocker', 'false');
|
|
1748
|
+
|
|
1749
|
+
// Enable Docker by default (this is the out-of-box default)
|
|
1750
|
+
localStorage.setItem('panopticon.planning.startDocker', 'true');
|
|
1751
|
+
```
|
|
1752
|
+
|
|
1753
|
+
**Example workflow:**
|
|
1754
|
+
```bash
|
|
1755
|
+
# From dashboard: click "Start Planning" (Docker enabled by default)
|
|
1756
|
+
# Or from CLI:
|
|
1757
|
+
pan workspace create MIN-123 --docker
|
|
1758
|
+
|
|
1759
|
+
# While containers build in background:
|
|
1760
|
+
# - Review the Linear issue
|
|
1761
|
+
# - Check related PRs
|
|
1762
|
+
# - Think about approach
|
|
1763
|
+
|
|
1764
|
+
# By the time you're ready to engage with the planning agent,
|
|
1765
|
+
# the dev environment is warm and ready for testing
|
|
1766
|
+
```
|
|
1767
|
+
|
|
817
1768
|
### Project Management
|
|
818
1769
|
|
|
819
1770
|
```bash
|
|
@@ -823,6 +1774,12 @@ pan project add /path/to/project --name myproject
|
|
|
823
1774
|
# List managed projects
|
|
824
1775
|
pan project list
|
|
825
1776
|
|
|
1777
|
+
# Show project details
|
|
1778
|
+
pan project show myproject
|
|
1779
|
+
|
|
1780
|
+
# Initialize project config (creates .panopticon.json)
|
|
1781
|
+
pan project init
|
|
1782
|
+
|
|
826
1783
|
# Remove a project
|
|
827
1784
|
pan project remove myproject
|
|
828
1785
|
```
|
|
@@ -869,20 +1826,29 @@ pan cloister start
|
|
|
869
1826
|
# Stop Cloister
|
|
870
1827
|
pan cloister stop
|
|
871
1828
|
|
|
1829
|
+
# Emergency stop all agents (force kill)
|
|
1830
|
+
pan cloister emergency-stop
|
|
1831
|
+
|
|
872
1832
|
# Check Cloister status
|
|
873
1833
|
pan cloister status
|
|
874
1834
|
|
|
875
1835
|
# List all specialists
|
|
876
1836
|
pan specialists list
|
|
877
1837
|
|
|
878
|
-
# Wake a
|
|
879
|
-
pan specialists wake merge-agent
|
|
1838
|
+
# Wake a specialist (resumes previous session if exists)
|
|
1839
|
+
pan specialists wake merge-agent
|
|
1840
|
+
|
|
1841
|
+
# Wake and send a task
|
|
1842
|
+
pan specialists wake merge-agent --task "Review PR #123 for security issues"
|
|
880
1843
|
|
|
881
1844
|
# View specialist queue
|
|
882
|
-
pan specialists queue
|
|
1845
|
+
pan specialists queue merge-agent
|
|
883
1846
|
|
|
884
|
-
# Reset specialist
|
|
1847
|
+
# Reset a single specialist (wipes context)
|
|
885
1848
|
pan specialists reset merge-agent
|
|
1849
|
+
|
|
1850
|
+
# Reset ALL specialists (fresh start)
|
|
1851
|
+
pan specialists reset --all
|
|
886
1852
|
```
|
|
887
1853
|
|
|
888
1854
|
## Dashboard
|
|
@@ -920,6 +1886,16 @@ Stop with `pan down`.
|
|
|
920
1886
|
| **Skills** | Available skills and their descriptions |
|
|
921
1887
|
| **Health** | System health checks and diagnostics |
|
|
922
1888
|
|
|
1889
|
+
### Issue Filtering
|
|
1890
|
+
|
|
1891
|
+
The dashboard automatically filters issues to reduce visual clutter:
|
|
1892
|
+
|
|
1893
|
+
- **Linear issues** - Shows current cycle issues only
|
|
1894
|
+
- **Done column** - Shows items completed in the last 24 hours
|
|
1895
|
+
- **Canceled column** - Shows items canceled in the last 24 hours
|
|
1896
|
+
|
|
1897
|
+
This filtering applies to both Linear and GitHub issues. Older completed items are excluded from the dashboard but remain in your issue tracker.
|
|
1898
|
+
|
|
923
1899
|
### Issue Cards
|
|
924
1900
|
|
|
925
1901
|
Issue cards on the Kanban board display:
|
|
@@ -1034,6 +2010,8 @@ Panopticon ships with 25+ skills organized into categories:
|
|
|
1034
2010
|
| `pan-convoy-synthesis` | Synthesize convoy coordination |
|
|
1035
2011
|
| `pan-subagent-creator` | Create specialized subagents |
|
|
1036
2012
|
| `pan-skill-creator` | Create new skills (guided) |
|
|
2013
|
+
| `pan-workspace-config` | Configure polyrepo workspaces, DNS, ports |
|
|
2014
|
+
| `pan-test-config` | Configure project test suites |
|
|
1037
2015
|
|
|
1038
2016
|
### Utilities
|
|
1039
2017
|
|
|
@@ -1298,6 +2276,26 @@ Each agent's state is tracked in `~/.panopticon/agents/{agent-id}/state.json`:
|
|
|
1298
2276
|
|
|
1299
2277
|
**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
2278
|
|
|
2279
|
+
### Deep Wipe
|
|
2280
|
+
|
|
2281
|
+
For issues that get into a stuck or inconsistent state, use `pan work wipe` to completely reset:
|
|
2282
|
+
|
|
2283
|
+
```bash
|
|
2284
|
+
pan work wipe MIN-123 # Basic cleanup
|
|
2285
|
+
pan work wipe MIN-123 -w # Also delete workspace
|
|
2286
|
+
pan work wipe MIN-123 -y -w # Skip confirmation
|
|
2287
|
+
```
|
|
2288
|
+
|
|
2289
|
+
**Deep wipe cleans up:**
|
|
2290
|
+
- Tmux sessions (`planning-min-123`, `agent-min-123`)
|
|
2291
|
+
- Agent state directories (`~/.panopticon/agents/planning-*`, `agent-*`)
|
|
2292
|
+
- Legacy planning directories (`project/.planning/min-123/`)
|
|
2293
|
+
- Workspace (if `-w` flag is used)
|
|
2294
|
+
- Linear issue status (reset to Backlog)
|
|
2295
|
+
- Linear labels (removes "Review Ready", "Planning")
|
|
2296
|
+
|
|
2297
|
+
**Dashboard UI:** When aborting planning, click "🔥 Deep Wipe" for a complete reset.
|
|
2298
|
+
|
|
1301
2299
|
## Health Monitoring (Deacon Pattern)
|
|
1302
2300
|
|
|
1303
2301
|
Panopticon implements the Deacon pattern for stuck agent detection:
|
|
@@ -1390,8 +2388,166 @@ If you're both developing Panopticon AND using it for your own projects:
|
|
|
1390
2388
|
3. **Config is shared** - workspaces/agents work the same either way
|
|
1391
2389
|
4. **Test in a real project** - your own usage is the best test
|
|
1392
2390
|
|
|
2391
|
+
### Developer Skills (dev-skills/)
|
|
2392
|
+
|
|
2393
|
+
Panopticon has two types of skills:
|
|
2394
|
+
|
|
2395
|
+
| Directory | Purpose | Synced When |
|
|
2396
|
+
|-----------|---------|-------------|
|
|
2397
|
+
| `skills/` | User-facing skills for all Panopticon users | Always via `pan sync` |
|
|
2398
|
+
| `dev-skills/` | Developer-only skills for Panopticon contributors | Only in dev mode |
|
|
2399
|
+
|
|
2400
|
+
**Dev mode is automatically detected** when running from the Panopticon source repo (npm link). Skills in `dev-skills/` are:
|
|
2401
|
+
- Checked into the repo and version-controlled
|
|
2402
|
+
- Only synced to developers' machines, not end users
|
|
2403
|
+
- Shown with `[dev]` label in `pan sync --dry-run`
|
|
2404
|
+
|
|
2405
|
+
```bash
|
|
2406
|
+
# Check what will be synced (including dev-skills)
|
|
2407
|
+
pan sync --dry-run
|
|
2408
|
+
|
|
2409
|
+
# Output shows:
|
|
2410
|
+
# Developer mode detected - dev-skills will be synced
|
|
2411
|
+
# ...
|
|
2412
|
+
# + skill/test-specialist-workflow [dev]
|
|
2413
|
+
```
|
|
2414
|
+
|
|
2415
|
+
### Testing the Specialist System
|
|
2416
|
+
|
|
2417
|
+
The `test-specialist-workflow` skill provides end-to-end testing for the specialist handoff pipeline.
|
|
2418
|
+
|
|
2419
|
+
**Location:** `dev-skills/test-specialist-workflow/SKILL.md`
|
|
2420
|
+
|
|
2421
|
+
**What it tests:**
|
|
2422
|
+
- Full approve workflow: review-agent → test-agent → merge-agent
|
|
2423
|
+
- Specialist handoffs via `pan specialists wake --task`
|
|
2424
|
+
- Merge completion and branch preservation
|
|
2425
|
+
|
|
2426
|
+
**Usage:**
|
|
2427
|
+
|
|
2428
|
+
```bash
|
|
2429
|
+
# First sync to get dev-skills
|
|
2430
|
+
pan sync
|
|
2431
|
+
|
|
2432
|
+
# In Claude Code, invoke the skill
|
|
2433
|
+
/test-specialist-workflow
|
|
2434
|
+
```
|
|
2435
|
+
|
|
2436
|
+
The skill guides you through:
|
|
2437
|
+
|
|
2438
|
+
1. **Prerequisites check** - Dashboard running, specialists available
|
|
2439
|
+
2. **Create test issue** - GitHub issue for tracking
|
|
2440
|
+
3. **Create workspace** - Git worktree for the test
|
|
2441
|
+
4. **Make test change** - Trivial commit to verify merge
|
|
2442
|
+
5. **Trigger approve** - Kicks off the specialist pipeline
|
|
2443
|
+
6. **Monitor handoffs** - Watch each specialist complete and hand off
|
|
2444
|
+
7. **Verify merge** - Confirm change reached main branch
|
|
2445
|
+
8. **Cleanup** - Close issue, remove workspace
|
|
2446
|
+
|
|
2447
|
+
**Expected timeline:** 2-4 minutes total
|
|
2448
|
+
|
|
2449
|
+
**When to use:**
|
|
2450
|
+
- After making changes to the specialist system
|
|
2451
|
+
- After modifying the approve workflow
|
|
2452
|
+
- As a smoke test before releases
|
|
2453
|
+
|
|
1393
2454
|
## Troubleshooting
|
|
1394
2455
|
|
|
2456
|
+
### WSL2 Stability Issues (Windows Users)
|
|
2457
|
+
|
|
2458
|
+
WSL2 can experience crashes and networking issues, especially under heavy AI agent workloads. Here are recommended `.wslconfig` settings to improve stability.
|
|
2459
|
+
|
|
2460
|
+
**Create/edit `C:\Users\<username>\.wslconfig`:**
|
|
2461
|
+
|
|
2462
|
+
```ini
|
|
2463
|
+
[wsl2]
|
|
2464
|
+
# Resource allocation (adjust based on your system)
|
|
2465
|
+
memory=40GB
|
|
2466
|
+
processors=18
|
|
2467
|
+
swap=8GB
|
|
2468
|
+
|
|
2469
|
+
# Localhost forwarding between Windows and WSL
|
|
2470
|
+
localhostForwarding=true
|
|
2471
|
+
|
|
2472
|
+
# Disable GPU/GUI passthrough - reduces dxg driver errors
|
|
2473
|
+
guiApplications=false
|
|
2474
|
+
|
|
2475
|
+
# Route DNS through Windows - prevents getaddrinfo() failures
|
|
2476
|
+
dnsTunneling=true
|
|
2477
|
+
|
|
2478
|
+
# Inherit Windows proxy settings
|
|
2479
|
+
autoProxy=true
|
|
2480
|
+
|
|
2481
|
+
# Windows 11 22H2+ ONLY: Use mirrored networking
|
|
2482
|
+
# This bypasses the Hyper-V NAT layer that can cause "Object Name not found" errors
|
|
2483
|
+
# networkingMode=mirrored
|
|
2484
|
+
```
|
|
2485
|
+
|
|
2486
|
+
**After changing `.wslconfig`:**
|
|
2487
|
+
```powershell
|
|
2488
|
+
wsl --shutdown
|
|
2489
|
+
# Then relaunch your WSL terminal
|
|
2490
|
+
```
|
|
2491
|
+
|
|
2492
|
+
**Verify settings applied:**
|
|
2493
|
+
```bash
|
|
2494
|
+
# Check resources
|
|
2495
|
+
free -h # Should show configured memory
|
|
2496
|
+
nproc # Should show configured processors
|
|
2497
|
+
swapon --show # Should show configured swap
|
|
2498
|
+
|
|
2499
|
+
# Check networking mode (Windows 11 only)
|
|
2500
|
+
ip addr show eth0 # NAT mode shows 172.x.x.x IP
|
|
2501
|
+
# Mirrored mode shares Windows network directly
|
|
2502
|
+
```
|
|
2503
|
+
|
|
2504
|
+
#### Windows 10 Limitations
|
|
2505
|
+
|
|
2506
|
+
| Feature | Windows 10 | Windows 11 22H2+ |
|
|
2507
|
+
|---------|-----------|------------------|
|
|
2508
|
+
| `networkingMode=mirrored` | ❌ Not supported | ✅ Supported |
|
|
2509
|
+
| `dnsTunneling=true` | ✅ Works | ✅ Works |
|
|
2510
|
+
| `guiApplications=false` | ✅ Works | ✅ Works |
|
|
2511
|
+
|
|
2512
|
+
**Windows 10 users:** The `networkingMode=mirrored` setting will be silently ignored. You'll stay on NAT mode, which can be less stable. The other settings (`dnsTunneling`, `guiApplications=false`) still help with stability.
|
|
2513
|
+
|
|
2514
|
+
If you experience frequent WSL2 crashes on Windows 10, consider:
|
|
2515
|
+
- Upgrading to Windows 11 for mirrored networking support
|
|
2516
|
+
- Reducing `memory` allocation if system is under pressure
|
|
2517
|
+
- Checking Windows Event Viewer for specific crash causes
|
|
2518
|
+
|
|
2519
|
+
#### Additional Windows 10 Workarounds
|
|
2520
|
+
|
|
2521
|
+
If NAT networking is unstable on Windows 10:
|
|
2522
|
+
|
|
2523
|
+
```powershell
|
|
2524
|
+
# 1. Update WSL to latest version
|
|
2525
|
+
wsl --update
|
|
2526
|
+
|
|
2527
|
+
# 2. Check for VPN/firewall conflicts
|
|
2528
|
+
# Disable VPN temporarily to test if it's causing issues
|
|
2529
|
+
|
|
2530
|
+
# 3. Reset Windows network stack (run as Admin)
|
|
2531
|
+
netsh winsock reset
|
|
2532
|
+
netsh int ip reset
|
|
2533
|
+
|
|
2534
|
+
# 4. Restart after network reset
|
|
2535
|
+
Restart-Computer
|
|
2536
|
+
```
|
|
2537
|
+
|
|
2538
|
+
**Common conflict sources:**
|
|
2539
|
+
- VPN clients (especially corporate VPNs)
|
|
2540
|
+
- Docker Desktop (can conflict with WSL networking)
|
|
2541
|
+
- Third-party firewalls
|
|
2542
|
+
- Hyper-V virtual switch issues
|
|
2543
|
+
|
|
2544
|
+
**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."`
|
|
2545
|
+
|
|
2546
|
+
**References:**
|
|
2547
|
+
- [Microsoft WSL Networking Documentation](https://learn.microsoft.com/en-us/windows/wsl/networking)
|
|
2548
|
+
- [WSL GitHub Issues - Networking](https://github.com/microsoft/WSL/issues?q=networking+mirrored)
|
|
2549
|
+
- [WSL NAT Fallback Issue #12297](https://github.com/microsoft/WSL/issues/12297)
|
|
2550
|
+
|
|
1395
2551
|
### Slow Vite/React Frontend with Multiple Workspaces
|
|
1396
2552
|
|
|
1397
2553
|
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.
|