panopticon-cli 0.5.0 → 0.5.1

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.
Files changed (55) hide show
  1. package/dist/{agents-E43Y3HNU.js → agents-5OPQKM5K.js} +4 -3
  2. package/dist/{chunk-OMNXYPXC.js → chunk-2V4NF7J2.js} +14 -1
  3. package/dist/chunk-2V4NF7J2.js.map +1 -0
  4. package/dist/{chunk-WQG2TYCB.js → chunk-4YSYJ4HM.js} +2 -2
  5. package/dist/{chunk-NTO3EDB3.js → chunk-76F6DSVS.js} +47 -8
  6. package/dist/chunk-76F6DSVS.js.map +1 -0
  7. package/dist/{chunk-GR6ZZMCX.js → chunk-F5555J3A.js} +18 -1
  8. package/dist/chunk-F5555J3A.js.map +1 -0
  9. package/dist/{chunk-PPRFKTVC.js → chunk-NLQRED36.js} +2 -2
  10. package/dist/{chunk-AAFQANKW.js → chunk-OWHXCGVO.js} +29 -29
  11. package/dist/chunk-OWHXCGVO.js.map +1 -0
  12. package/dist/{chunk-HZT2AOPN.js → chunk-VHKSS7QX.js} +28 -5
  13. package/dist/chunk-VHKSS7QX.js.map +1 -0
  14. package/dist/{chunk-GFP3PIPB.js → chunk-YGJ54GW2.js} +1 -1
  15. package/dist/chunk-YGJ54GW2.js.map +1 -0
  16. package/dist/cli/index.js +401 -318
  17. package/dist/cli/index.js.map +1 -1
  18. package/dist/dashboard/public/assets/{index-DQHkwvvJ.js → index-Ce6q21Fm.js} +135 -135
  19. package/dist/dashboard/public/assets/{index-BxpjweAL.css → index-NzpI0ItZ.css} +1 -1
  20. package/dist/dashboard/public/index.html +2 -2
  21. package/dist/dashboard/server.js +1420 -1007
  22. package/dist/{feedback-writer-LVZ5TFYZ.js → feedback-writer-VRMMWWTW.js} +2 -2
  23. package/dist/git-utils-I2UDKNZH.js +131 -0
  24. package/dist/git-utils-I2UDKNZH.js.map +1 -0
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +2 -2
  27. package/dist/{projects-JEIVIYC6.js → projects-CFX3RTDL.js} +4 -2
  28. package/dist/{remote-workspace-AHVHQEES.js → remote-workspace-7FPGF2RM.js} +2 -2
  29. package/dist/{review-status-EPFG4XM7.js → review-status-TDPSOU5J.js} +2 -2
  30. package/dist/{specialist-context-ZC6A4M3I.js → specialist-context-WGUUYDWY.js} +3 -3
  31. package/dist/{specialist-logs-KLGJCEUL.js → specialist-logs-XJB5TCKJ.js} +3 -3
  32. package/dist/{specialists-O4HWDJL5.js → specialists-5LBRHYFA.js} +3 -3
  33. package/dist/{traefik-QN7R5I6V.js → traefik-WFMQX2LY.js} +3 -3
  34. package/dist/{workspace-manager-IE4JL2JP.js → workspace-manager-E434Z45T.js} +2 -2
  35. package/package.json +1 -1
  36. package/scripts/record-cost-event.js +5 -5
  37. package/skills/pan-new-project/SKILL.md +304 -0
  38. package/dist/chunk-AAFQANKW.js.map +0 -1
  39. package/dist/chunk-GFP3PIPB.js.map +0 -1
  40. package/dist/chunk-GR6ZZMCX.js.map +0 -1
  41. package/dist/chunk-HZT2AOPN.js.map +0 -1
  42. package/dist/chunk-NTO3EDB3.js.map +0 -1
  43. package/dist/chunk-OMNXYPXC.js.map +0 -1
  44. /package/dist/{agents-E43Y3HNU.js.map → agents-5OPQKM5K.js.map} +0 -0
  45. /package/dist/{chunk-WQG2TYCB.js.map → chunk-4YSYJ4HM.js.map} +0 -0
  46. /package/dist/{chunk-PPRFKTVC.js.map → chunk-NLQRED36.js.map} +0 -0
  47. /package/dist/{feedback-writer-LVZ5TFYZ.js.map → feedback-writer-VRMMWWTW.js.map} +0 -0
  48. /package/dist/{projects-JEIVIYC6.js.map → projects-CFX3RTDL.js.map} +0 -0
  49. /package/dist/{remote-workspace-AHVHQEES.js.map → remote-workspace-7FPGF2RM.js.map} +0 -0
  50. /package/dist/{review-status-EPFG4XM7.js.map → review-status-TDPSOU5J.js.map} +0 -0
  51. /package/dist/{specialist-context-ZC6A4M3I.js.map → specialist-context-WGUUYDWY.js.map} +0 -0
  52. /package/dist/{specialist-logs-KLGJCEUL.js.map → specialist-logs-XJB5TCKJ.js.map} +0 -0
  53. /package/dist/{specialists-O4HWDJL5.js.map → specialists-5LBRHYFA.js.map} +0 -0
  54. /package/dist/{traefik-QN7R5I6V.js.map → traefik-WFMQX2LY.js.map} +0 -0
  55. /package/dist/{workspace-manager-IE4JL2JP.js.map → workspace-manager-E434Z45T.js.map} +0 -0
@@ -0,0 +1,304 @@
1
+ ---
2
+ name: pan-new-project
3
+ description: >
4
+ Complete setup for registering a new project with Panopticon. Handles
5
+ project registration, issue prefix, workspace config, trust setup,
6
+ beads init, tracker config, and validates against working projects.
7
+ triggers:
8
+ - new project
9
+ - add new project
10
+ - register new project
11
+ - setup new project
12
+ - onboard project
13
+ - pan new project
14
+ allowed-tools:
15
+ - Bash
16
+ - Read
17
+ - Edit
18
+ - Write
19
+ - Glob
20
+ - Grep
21
+ - AskUserQuestion
22
+ version: "2.0.0"
23
+ author: "Ed Becker"
24
+ license: "MIT"
25
+ ---
26
+
27
+ # New Project Setup
28
+
29
+ **Trigger:** `/pan-new-project`
30
+
31
+ Sets up a new project for Panopticon management. This is the ONLY correct
32
+ way to add a new project. Do NOT just run `pan project add` alone — it
33
+ creates a skeleton entry that breaks planning agents, workspace creation,
34
+ issue routing, and beads.
35
+
36
+ ---
37
+
38
+ ## WHY THIS SKILL EXISTS
39
+
40
+ Running `pan project add /path --name foo` alone causes these failures:
41
+
42
+ | Missing config | Symptom |
43
+ |----------------|---------|
44
+ | `linear_team` (issue prefix) | Planning agents start in `$HOME`, not the project root |
45
+ | Trust entry in `~/.claude.json` | Claude Code shows trust dialog, blocking autonomous agents |
46
+ | `GITHUB_REPOS` entry | Issues don't appear on the dashboard kanban board |
47
+ | `beads.role` in git config | Every `bd` command prints "beads.role not configured" warnings |
48
+ | `workspaces/` directory | Git worktree creation fails |
49
+ | `.gitignore` entry | `workspaces/` gets committed accidentally |
50
+ | Test config | Specialist test agents can't run tests |
51
+
52
+ ---
53
+
54
+ ## EXECUTION STEPS
55
+
56
+ ### Step 1: Gather Project Information
57
+
58
+ Ask the user for (or auto-detect from the filesystem):
59
+
60
+ | Field | Required | Example | Notes |
61
+ |-------|----------|---------|-------|
62
+ | Path | Yes | `/home/eltmon/Projects/myapp` | Must exist, must have `.git/` |
63
+ | Name | Yes | `myapp` | Short lowercase key for projects.yaml |
64
+ | Issue prefix | Yes | `APP` | Maps `APP-123` → this project. Goes in `linear_team` field |
65
+ | Tracker | Yes | `github` / `linear` / `gitlab` | Where issues live |
66
+ | Repo slug | Yes | `owner/repo` | `github_repo` or `gitlab_repo` |
67
+ | Workspace type | Yes | `standalone` / `monorepo` / `polyrepo` | How git worktrees work |
68
+
69
+ **Auto-detection:**
70
+ - `go.mod` → Go, test: `make test` or `go test ./...`
71
+ - `package.json` → Node/TS, test: `npm test` or `pnpm test`
72
+ - `pom.xml` / `mvnw` → Java/Maven, test: `./mvnw test`
73
+ - `Cargo.toml` → Rust, test: `cargo test`
74
+ - `pyproject.toml` → Python, test: `pytest`
75
+
76
+ ### Step 2: Register Project
77
+
78
+ ```bash
79
+ pan project add <path> --name <name>
80
+ ```
81
+
82
+ This creates a minimal entry AND pre-trusts the directory in `~/.claude.json`
83
+ (the `projectAddCommand` calls `preTrustDirectory` automatically).
84
+
85
+ ### Step 3: Configure projects.yaml
86
+
87
+ Edit `~/.panopticon/projects.yaml` to add the FULL configuration.
88
+
89
+ **Minimum viable config:**
90
+
91
+ ```yaml
92
+ <project-key>:
93
+ name: <name>
94
+ path: <absolute-path>
95
+ linear_team: <PREFIX> # CRITICAL: issue prefix for routing
96
+ github_repo: <owner/repo> # or gitlab_repo
97
+ workspace:
98
+ type: <standalone|monorepo|polyrepo>
99
+ workspaces_dir: workspaces
100
+ default_branch: main
101
+ tests:
102
+ unit:
103
+ type: <go|vitest|maven|pytest|cargo>
104
+ path: .
105
+ command: <test command>
106
+ ```
107
+
108
+ **Full config** (for projects with services, Docker, DNS):
109
+
110
+ ```yaml
111
+ <project-key>:
112
+ name: <name>
113
+ path: <absolute-path>
114
+ linear_team: <PREFIX>
115
+ github_repo: <owner/repo>
116
+ workspace:
117
+ type: <type>
118
+ workspaces_dir: workspaces
119
+ default_branch: main
120
+ dns:
121
+ domain: <name>.localhost
122
+ entries:
123
+ - "{{FEATURE_FOLDER}}.{{DOMAIN}}"
124
+ sync_method: hosts_file
125
+ docker:
126
+ traefik: templates/traefik
127
+ compose_template: infra/.devcontainer-template
128
+ agent:
129
+ template_dir: infra/.agent-template
130
+ copy_dirs:
131
+ - .claude/commands
132
+ - .claude/skills
133
+ services:
134
+ - name: <service>
135
+ path: .
136
+ start_command: <cmd>
137
+ health_url: <url>
138
+ port: <port>
139
+ env:
140
+ secrets_file: ~/.myapp/.env
141
+ tests:
142
+ unit:
143
+ type: <type>
144
+ path: .
145
+ command: <cmd>
146
+ ```
147
+
148
+ ### Step 4: Add to Dashboard Tracker Config
149
+
150
+ For **GitHub** projects, add to `GITHUB_REPOS` in `~/.panopticon.env`:
151
+
152
+ ```bash
153
+ # Format: owner/repo:PREFIX (comma-separated)
154
+ # Example: current value might be:
155
+ # GITHUB_REPOS=eltmon/panopticon-cli:PAN
156
+ # Append the new project:
157
+ # GITHUB_REPOS=eltmon/panopticon-cli:PAN,owner/newrepo:APP
158
+ ```
159
+
160
+ Read current value, append new repo, write back. The dashboard polls this
161
+ to fetch issues from GitHub.
162
+
163
+ For **Linear** projects, issues are fetched automatically by team — no
164
+ extra config needed beyond `linear_team` in projects.yaml.
165
+
166
+ For **GitLab** projects, TBD — not yet supported in dashboard polling.
167
+
168
+ ### Step 5: Initialize Beads
169
+
170
+ ```bash
171
+ cd <project-path>
172
+ git config beads.role agent
173
+ ```
174
+
175
+ This prevents the `"beads.role not configured"` warning on every `bd` command.
176
+ New worktrees inherit this automatically since Panopticon now sets it during
177
+ workspace creation (`workspace-manager.ts` and `worktree.ts`).
178
+
179
+ ### Step 6: Create workspaces/ Directory
180
+
181
+ ```bash
182
+ mkdir -p <project-path>/workspaces
183
+ ```
184
+
185
+ Check `.gitignore` — add `workspaces/` if not already there:
186
+ ```bash
187
+ grep -q '^workspaces/' <project-path>/.gitignore 2>/dev/null || \
188
+ echo 'workspaces/' >> <project-path>/.gitignore
189
+ ```
190
+
191
+ ### Step 7: Create CLAUDE.md (if missing)
192
+
193
+ Check if the project has a `CLAUDE.md`. If not, create a minimal one:
194
+
195
+ ```markdown
196
+ # <Project Name>
197
+
198
+ ## Project Overview
199
+ <Brief description>
200
+
201
+ ## Stack
202
+ <Language, framework, key dependencies>
203
+
204
+ ## Development
205
+ <How to build, run, test>
206
+
207
+ ## Testing
208
+ <Test commands, coverage requirements>
209
+ ```
210
+
211
+ ### Step 8: Validate Configuration
212
+
213
+ Run ALL of these checks and report pass/fail:
214
+
215
+ ```bash
216
+ # 1. Project registered
217
+ pan project list | grep <name>
218
+
219
+ # 2. Issue prefix resolves (won't crash)
220
+ # Check projects.yaml has linear_team: <PREFIX>
221
+
222
+ # 3. Trust is set in ~/.claude.json
223
+ node -e "
224
+ const d=JSON.parse(require('fs').readFileSync(
225
+ require('os').homedir()+'/.claude.json','utf8'));
226
+ console.log(d.projects?.['<path>']?.hasTrustDialogAccepted
227
+ ? 'PASS: trusted' : 'FAIL: not trusted');
228
+ "
229
+
230
+ # 4. Dashboard can see issues (GitHub only)
231
+ grep 'GITHUB_REPOS' ~/.panopticon.env | grep -q '<PREFIX>' && \
232
+ echo "PASS: in GITHUB_REPOS" || echo "FAIL: not in GITHUB_REPOS"
233
+
234
+ # 5. Beads configured
235
+ cd <path> && git config beads.role && echo "PASS" || echo "FAIL: beads.role not set"
236
+
237
+ # 6. workspaces/ exists
238
+ test -d <path>/workspaces && echo "PASS" || echo "FAIL: no workspaces/"
239
+
240
+ # 7. workspaces/ in .gitignore
241
+ grep -q 'workspaces' <path>/.gitignore 2>/dev/null && \
242
+ echo "PASS" || echo "FAIL: workspaces/ not in .gitignore"
243
+
244
+ # 8. CLAUDE.md exists
245
+ test -f <path>/CLAUDE.md && echo "PASS" || echo "WARN: no CLAUDE.md"
246
+
247
+ # 9. Git clean
248
+ cd <path> && git status --short | head -5
249
+ ```
250
+
251
+ ### Step 9: Summary
252
+
253
+ ```
254
+ ## New Project Setup Complete: <NAME>
255
+
256
+ Path: <path>
257
+ Issue prefix: <PREFIX> (e.g., <PREFIX>-1, <PREFIX>-42)
258
+ Tracker: GitHub (<owner/repo>)
259
+ Workspace type: <type>
260
+ Tests: <command>
261
+ Trusted: Yes
262
+ Beads: Configured
263
+ Dashboard: Issues visible
264
+
265
+ Validation: 8/8 checks passed
266
+
267
+ Next steps:
268
+ 1. Create issues on <tracker>
269
+ 2. Run: pan opus-plan <PREFIX>-<N> (plan with Opus)
270
+ 3. Run: pan work issue <PREFIX>-<N> (spawn implementation agent)
271
+ ```
272
+
273
+ ---
274
+
275
+ ## REFERENCE: Working Project Configs
276
+
277
+ ### panopticon-cli (monorepo, GitHub)
278
+ - `linear_team: PAN`, `github_repo: eltmon/panopticon-cli`
279
+ - `workspace.type: monorepo`
280
+ - Has: dns, docker, agent, services, env, tests
281
+
282
+ ### mind-your-now (polyrepo, Linear/GitLab)
283
+ - `linear_team: MIN`, `gitlab_repo: eltmon/mind-your-now`
284
+ - `workspace.type: polyrepo` with 6 sub-repos
285
+ - Has: dns, docker, database, agent, services, tunnel, hume, env, tests
286
+
287
+ ### myn-cli (standalone, GitHub)
288
+ - `linear_team: CLI`, `github_repo: mindyournow/myn-cli`
289
+ - `workspace.type: standalone`
290
+ - Has: tests
291
+
292
+ ---
293
+
294
+ ## COMMON MISTAKES
295
+
296
+ 1. **Missing `linear_team`** — The #1 cause of "planning agent starts in $HOME."
297
+ Despite the name, this field is the issue PREFIX for ALL trackers, not just Linear.
298
+ 2. **Not in `GITHUB_REPOS`** — Issues don't appear on dashboard kanban board.
299
+ 3. **No `beads.role`** — Every `bd` command prints warning noise in agent output.
300
+ 4. **Not pre-trusting the directory** — Agent gets stuck on trust dialog.
301
+ 5. **Wrong `workspace.type`** — `standalone` = single repo, `monorepo` = one repo with
302
+ worktrees, `polyrepo` = multiple repos under one parent dir.
303
+ 6. **Missing `workspaces/` directory** — Git worktree creation fails.
304
+ 7. **Missing `.gitignore` entry** — `workspaces/` gets committed accidentally.