panopticon-cli 0.4.6 → 0.4.7

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 (102) hide show
  1. package/package.json +2 -1
  2. package/skills/beads/README.md +120 -0
  3. package/skills/beads/SKILL.md +214 -0
  4. package/skills/beads/adr/0001-bd-prime-as-source-of-truth.md +59 -0
  5. package/skills/beads/resources/AGENTS.md +62 -0
  6. package/skills/beads/resources/ASYNC_GATES.md +168 -0
  7. package/skills/beads/resources/BOUNDARIES.md +469 -0
  8. package/skills/beads/resources/CHEMISTRY_PATTERNS.md +197 -0
  9. package/skills/beads/resources/CLI_REFERENCE.md +558 -0
  10. package/skills/beads/resources/DEPENDENCIES.md +747 -0
  11. package/skills/beads/resources/INTEGRATION_PATTERNS.md +407 -0
  12. package/skills/beads/resources/ISSUE_CREATION.md +139 -0
  13. package/skills/beads/resources/MOLECULES.md +354 -0
  14. package/skills/beads/resources/PATTERNS.md +341 -0
  15. package/skills/beads/resources/RESUMABILITY.md +207 -0
  16. package/skills/beads/resources/STATIC_DATA.md +54 -0
  17. package/skills/beads/resources/TROUBLESHOOTING.md +489 -0
  18. package/skills/beads/resources/WORKFLOWS.md +623 -0
  19. package/skills/beads/resources/WORKTREES.md +94 -0
  20. package/skills/beads-completion-check/SKILL.md +90 -0
  21. package/skills/beads-panopticon-guide/SKILL.md +171 -0
  22. package/skills/bug-fix/SKILL.md +32 -0
  23. package/skills/clear-writing/SKILL.md +105 -0
  24. package/skills/clear-writing/references/elements-of-style/01-introductory.md +3 -0
  25. package/skills/clear-writing/references/elements-of-style/02-elementary-rules-of-usage.md +214 -0
  26. package/skills/clear-writing/references/elements-of-style/03-elementary-principles-of-composition.md +398 -0
  27. package/skills/clear-writing/references/elements-of-style/04-a-few-matters-of-form.md +89 -0
  28. package/skills/clear-writing/references/elements-of-style/05-words-and-expressions-commonly-misused.md +342 -0
  29. package/skills/clear-writing/references/signs-of-ai-writing.md +901 -0
  30. package/skills/code-review/SKILL.md +37 -0
  31. package/skills/code-review-performance/SKILL.md +53 -0
  32. package/skills/code-review-security/SKILL.md +35 -0
  33. package/skills/dependency-update/SKILL.md +30 -0
  34. package/skills/feature-work/SKILL.md +39 -0
  35. package/skills/incident-response/SKILL.md +32 -0
  36. package/skills/knowledge-capture/SKILL.md +463 -0
  37. package/skills/onboard-codebase/SKILL.md +34 -0
  38. package/skills/opus-plan/SKILL.md +400 -0
  39. package/skills/pan-approve/SKILL.md +136 -0
  40. package/skills/pan-code-review/SKILL.md +249 -0
  41. package/skills/pan-config/SKILL.md +164 -0
  42. package/skills/pan-convoy-synthesis/SKILL.md +249 -0
  43. package/skills/pan-diagnose/SKILL.md +360 -0
  44. package/skills/pan-docker/SKILL.md +279 -0
  45. package/skills/pan-docs/SKILL.md +113 -0
  46. package/skills/pan-down/SKILL.md +434 -0
  47. package/skills/pan-health/SKILL.md +240 -0
  48. package/skills/pan-help/SKILL.md +237 -0
  49. package/skills/pan-install/SKILL.md +339 -0
  50. package/skills/pan-issue/SKILL.md +596 -0
  51. package/skills/pan-kill/SKILL.md +172 -0
  52. package/skills/pan-logs/SKILL.md +255 -0
  53. package/skills/pan-network/SKILL.md +320 -0
  54. package/skills/pan-oversee/SKILL.md +290 -0
  55. package/skills/pan-plan/SKILL.md +521 -0
  56. package/skills/pan-projects/SKILL.md +239 -0
  57. package/skills/pan-quickstart/SKILL.md +440 -0
  58. package/skills/pan-reload/SKILL.md +44 -0
  59. package/skills/pan-rescue/SKILL.md +271 -0
  60. package/skills/pan-restart/SKILL.md +53 -0
  61. package/skills/pan-setup/SKILL.md +478 -0
  62. package/skills/pan-skill-creator/SKILL.md +168 -0
  63. package/skills/pan-skill-creator/references/output-patterns.md +141 -0
  64. package/skills/pan-skill-creator/references/workflows.md +90 -0
  65. package/skills/pan-skill-creator/scripts/init_skill.py +176 -0
  66. package/skills/pan-status/SKILL.md +493 -0
  67. package/skills/pan-subagent-creator/SKILL.md +295 -0
  68. package/skills/pan-subagent-creator/assets/validate-readonly-query.sh +35 -0
  69. package/skills/pan-subagent-creator/references/example-agents.md +308 -0
  70. package/skills/pan-subagent-creator/scripts/init_agent.py +126 -0
  71. package/skills/pan-sync/SKILL.md +272 -0
  72. package/skills/pan-tell/SKILL.md +157 -0
  73. package/skills/pan-test-config/SKILL.md +208 -0
  74. package/skills/pan-tracker/SKILL.md +288 -0
  75. package/skills/pan-up/SKILL.md +458 -0
  76. package/skills/pan-workspace-config/SKILL.md +303 -0
  77. package/skills/refactor/SKILL.md +30 -0
  78. package/skills/refactor-radar/SKILL.md +475 -0
  79. package/skills/release/SKILL.md +25 -0
  80. package/skills/send-feedback-to-agent/SKILL.md +98 -0
  81. package/skills/session-health/SKILL.md +76 -0
  82. package/skills/session-health/scripts/check_sessions.py +166 -0
  83. package/skills/skill-creator/SKILL.md +92 -0
  84. package/skills/skill-creator/scripts/init_skill.py +152 -0
  85. package/skills/skill-creator/scripts/package_skill.py +123 -0
  86. package/skills/stitch-design-md/README.md +34 -0
  87. package/skills/stitch-design-md/SKILL.md +172 -0
  88. package/skills/stitch-design-md/examples/DESIGN.md +154 -0
  89. package/skills/stitch-react-components/README.md +36 -0
  90. package/skills/stitch-react-components/SKILL.md +47 -0
  91. package/skills/stitch-react-components/examples/gold-standard-card.tsx +80 -0
  92. package/skills/stitch-react-components/package-lock.json +231 -0
  93. package/skills/stitch-react-components/package.json +16 -0
  94. package/skills/stitch-react-components/resources/architecture-checklist.md +15 -0
  95. package/skills/stitch-react-components/resources/component-template.tsx +37 -0
  96. package/skills/stitch-react-components/resources/stitch-api-reference.md +14 -0
  97. package/skills/stitch-react-components/resources/style-guide.json +27 -0
  98. package/skills/stitch-react-components/scripts/fetch-stitch.sh +30 -0
  99. package/skills/stitch-react-components/scripts/validate.js +68 -0
  100. package/skills/stitch-setup/SKILL.md +94 -0
  101. package/skills/web-design-guidelines/SKILL.md +39 -0
  102. package/skills/work-complete/SKILL.md +79 -0
@@ -0,0 +1,521 @@
1
+ ---
2
+ name: pan-plan
3
+ description: Interactive planning workflow with AI-assisted discovery
4
+ triggers:
5
+ - plan issue
6
+ - create plan
7
+ - planning session
8
+ - pan plan
9
+ - ai planning
10
+ allowed-tools:
11
+ - Bash
12
+ - Read
13
+ - Glob
14
+ - Grep
15
+ - Write
16
+ - AskUserQuestion
17
+ ---
18
+
19
+ # Panopticon Planning Workflow
20
+
21
+ ## Overview
22
+
23
+ This skill guides you through Panopticon's interactive planning feature, where an AI agent explores the codebase, asks discovery questions, and creates a comprehensive execution plan before any code is written.
24
+
25
+ ## When to Use
26
+
27
+ - User wants to plan before implementing
28
+ - Issue is complex or poorly defined
29
+ - User needs to understand codebase first
30
+ - Multiple implementation approaches possible
31
+ - User wants AI to research and recommend approach
32
+ - User asks "how should I implement this?"
33
+
34
+ ## What is AI Planning?
35
+
36
+ Panopticon's planning workflow:
37
+
38
+ 1. **AI explores codebase** - Searches for relevant files, patterns, dependencies
39
+ 2. **AI asks discovery questions** - Clarifies requirements, gathers context
40
+ 3. **AI researches approaches** - Investigates how similar features work
41
+ 4. **AI creates plan** - Documents step-by-step implementation strategy
42
+ 5. **User reviews and approves** - Plan becomes guide for implementation agent
43
+
44
+ **Benefits:**
45
+ - No code changes during planning (read-only)
46
+ - AI learns codebase architecture before implementing
47
+ - User can course-correct early
48
+ - Plan serves as reference during implementation
49
+ - Better architectural decisions
50
+
51
+ ## Basic Usage
52
+
53
+ ```bash
54
+ # Start planning session for an issue
55
+ pan work plan PAN-3
56
+
57
+ # Plan with specific focus
58
+ pan work plan PAN-3 --focus security
59
+
60
+ # Plan with time limit
61
+ pan work plan PAN-3 --timeout 10m
62
+ ```
63
+
64
+ ## Planning Workflow
65
+
66
+ ### Step 1: Start Planning Session
67
+
68
+ ```bash
69
+ pan work plan PAN-3
70
+ ```
71
+
72
+ **What happens:**
73
+ 1. Creates planning workspace (read-only clone)
74
+ 2. Loads issue details from tracker
75
+ 3. Spawns AI planning agent in tmux session
76
+ 4. Opens interactive terminal in dashboard
77
+
78
+ ### Step 2: AI Discovery Phase
79
+
80
+ The planning agent will:
81
+ - Search codebase for relevant files
82
+ - Identify existing patterns and conventions
83
+ - Look for similar features already implemented
84
+ - Analyze dependencies and architecture
85
+ - Review test coverage and documentation
86
+
87
+ **Example discovery actions:**
88
+ ```bash
89
+ # Agent searches for authentication code
90
+ Grep pattern="login\|authenticate" output_mode="files_with_matches"
91
+
92
+ # Agent examines existing patterns
93
+ Read file_path="src/auth/LoginService.ts"
94
+
95
+ # Agent checks test structure
96
+ Glob pattern="**/*test.ts"
97
+ ```
98
+
99
+ ### Step 3: Interactive Questions
100
+
101
+ The agent will ask clarifying questions via the dashboard:
102
+
103
+ **Example questions:**
104
+ - "Should we use JWT or session-based authentication?"
105
+ - "Where should the new API endpoint be located?"
106
+ - "Should this be a new service or extend existing UserService?"
107
+ - "What database tables need to be created or modified?"
108
+
109
+ **How to answer:**
110
+ - Questions appear in dashboard chat interface
111
+ - Click on answer options or type custom response
112
+ - Agent uses answers to refine the plan
113
+
114
+ ### Step 4: Plan Creation
115
+
116
+ Agent writes comprehensive plan to `PLANNING.md`:
117
+
118
+ **Plan structure:**
119
+ ```markdown
120
+ # PAN-3: Add User Authentication
121
+
122
+ ## Summary
123
+ Brief overview of what will be implemented
124
+
125
+ ## Architecture Decisions
126
+ - Use JWT tokens (user preferred over sessions)
127
+ - Extend existing AuthService
128
+ - Add auth middleware to Express app
129
+ - Store tokens in Redis with 24h TTL
130
+
131
+ ## Implementation Steps
132
+ 1. Create JWT token generation in AuthService
133
+ 2. Add login endpoint POST /api/auth/login
134
+ 3. Add middleware to verify tokens
135
+ 4. Update User model with password hashing
136
+ 5. Add refresh token logic
137
+ 6. Write integration tests
138
+
139
+ ## Files to Create
140
+ - src/auth/JwtService.ts
141
+ - src/auth/authMiddleware.ts
142
+ - tests/auth/jwt.test.ts
143
+
144
+ ## Files to Modify
145
+ - src/auth/AuthService.ts (add JWT methods)
146
+ - src/api/routes.ts (add auth routes)
147
+ - src/models/User.ts (add password field)
148
+
149
+ ## Dependencies to Add
150
+ - jsonwebtoken@9.0.0
151
+ - bcrypt@5.1.0
152
+ - @types/jsonwebtoken
153
+ - @types/bcrypt
154
+
155
+ ## Testing Strategy
156
+ - Unit tests for JWT generation/verification
157
+ - Integration tests for login flow
158
+ - Security tests for token validation
159
+ - E2E tests for protected routes
160
+
161
+ ## Security Considerations
162
+ - Hash passwords with bcrypt (salt rounds: 10)
163
+ - Sign JWTs with strong secret (env var)
164
+ - Short-lived access tokens (15min)
165
+ - Long-lived refresh tokens (7 days)
166
+ - Rate limiting on login endpoint
167
+
168
+ ## Edge Cases
169
+ - Expired tokens
170
+ - Invalid tokens
171
+ - Missing auth header
172
+ - Password reset flow (future work)
173
+
174
+ ## Success Criteria
175
+ - [ ] User can login with email/password
176
+ - [ ] JWT token returned on successful login
177
+ - [ ] Protected routes require valid token
178
+ - [ ] Invalid tokens return 401
179
+ - [ ] All tests pass
180
+ ```
181
+
182
+ ### Step 5: Review Plan
183
+
184
+ ```bash
185
+ # View the plan
186
+ cat ~/panopticon/planning/PAN-3/PLANNING.md
187
+
188
+ # Or view in dashboard
189
+ # Click on "View Plan" in the planning session panel
190
+ ```
191
+
192
+ **Review checklist:**
193
+ - Are architectural decisions sound?
194
+ - Are all requirements covered?
195
+ - Are edge cases identified?
196
+ - Is testing strategy comprehensive?
197
+ - Are dependencies appropriate?
198
+ - Is implementation order logical?
199
+
200
+ ### Step 6: Approve or Revise
201
+
202
+ **Option A: Approve plan**
203
+ ```bash
204
+ # Accept the plan and create workspace
205
+ pan work issue PAN-3 --with-plan
206
+
207
+ # This will:
208
+ # 1. Create implementation workspace
209
+ # 2. Copy PLANNING.md to workspace
210
+ # 3. Spawn implementation agent with plan context
211
+ ```
212
+
213
+ **Option B: Revise plan**
214
+ ```bash
215
+ # Send feedback to planning agent
216
+ pan work tell PAN-3-planning "Consider using refresh tokens"
217
+
218
+ # Agent will update plan based on feedback
219
+ # Review updated plan and approve when ready
220
+ ```
221
+
222
+ **Option C: Reject and plan manually**
223
+ ```bash
224
+ # Exit planning session
225
+ pan work kill PAN-3-planning
226
+
227
+ # Create plan manually
228
+ mkdir -p ~/panopticon/planning/PAN-3/
229
+ vim ~/panopticon/planning/PAN-3/PLANNING.md
230
+
231
+ # Then create workspace with manual plan
232
+ pan work issue PAN-3
233
+ ```
234
+
235
+ ## Advanced Planning
236
+
237
+ ### Planning with Context
238
+
239
+ ```bash
240
+ # Plan with reference to related issues
241
+ pan work plan PAN-3 --context "PAN-1,PAN-2"
242
+
243
+ # Plan with specific files to focus on
244
+ pan work plan PAN-3 --files "src/auth/**"
245
+
246
+ # Plan with architectural constraints
247
+ pan work plan PAN-3 --constraints "Must use existing AuthService"
248
+ ```
249
+
250
+ ### Planning Focus Areas
251
+
252
+ ```bash
253
+ # Focus on security
254
+ pan work plan PAN-3 --focus security
255
+
256
+ # Focus on performance
257
+ pan work plan PAN-3 --focus performance
258
+
259
+ # Focus on testing
260
+ pan work plan PAN-3 --focus testing
261
+
262
+ # Focus on architecture
263
+ pan work plan PAN-3 --focus architecture
264
+ ```
265
+
266
+ ### Iterative Planning
267
+
268
+ ```bash
269
+ # Create high-level plan first
270
+ pan work plan PAN-3 --depth overview
271
+
272
+ # Review and then create detailed plan
273
+ pan work plan PAN-3 --depth detailed
274
+ ```
275
+
276
+ ## Dashboard Planning Interface
277
+
278
+ The dashboard provides rich planning UI:
279
+
280
+ **Features:**
281
+ - **Live terminal**: See agent's exploration in real-time
282
+ - **Question prompts**: Answer questions with buttons/forms
283
+ - **Plan preview**: Rendered markdown view of plan
284
+ - **File explorer**: Browse files agent is examining
285
+ - **Diff viewer**: See proposed changes (if any)
286
+ - **Approval workflow**: Approve/reject/request-changes
287
+
288
+ **Access:** http://localhost:3001/planning/PAN-3
289
+
290
+ ## Planning Best Practices
291
+
292
+ ### 1. Start with Planning for Complex Issues
293
+
294
+ ✅ **Good candidates for planning:**
295
+ - New features with unclear requirements
296
+ - Refactoring large subsystems
297
+ - Security-sensitive changes
298
+ - Performance optimization (need profiling first)
299
+ - Integration with new external APIs
300
+
301
+ ❌ **Skip planning for:**
302
+ - Simple bug fixes
303
+ - Typo corrections
304
+ - Documentation updates
305
+ - Trivial changes
306
+
307
+ ### 2. Guide the Planning Agent
308
+
309
+ **Provide context:**
310
+ ```bash
311
+ # When starting planning session, add context
312
+ pan work tell PAN-3-planning "This is for the mobile app, not web"
313
+ pan work tell PAN-3-planning "User prefers GraphQL over REST"
314
+ ```
315
+
316
+ **Answer questions thoughtfully:**
317
+ - Don't just pick first option
318
+ - Consider long-term implications
319
+ - Ask agent to research if unsure
320
+
321
+ ### 3. Review Plans Critically
322
+
323
+ **Check for:**
324
+ - Missing error handling
325
+ - Unaddressed edge cases
326
+ - Overly complex solutions
327
+ - Missing tests
328
+ - Security vulnerabilities
329
+ - Performance implications
330
+
331
+ ### 4. Iterate if Needed
332
+
333
+ Don't settle for first plan:
334
+ ```bash
335
+ # Request refinement
336
+ pan work tell PAN-3-planning "Simplify the auth middleware approach"
337
+
338
+ # Ask for alternatives
339
+ pan work tell PAN-3-planning "What if we used OAuth instead?"
340
+ ```
341
+
342
+ ## Troubleshooting
343
+
344
+ ### Planning session won't start
345
+
346
+ **Problem:** `pan work plan` fails or hangs
347
+
348
+ **Solutions:**
349
+ ```bash
350
+ # Check tmux is available
351
+ which tmux
352
+
353
+ # Check planning directory exists
354
+ mkdir -p ~/.panopticon/planning/
355
+
356
+ # Check issue exists in tracker
357
+ pan work list | grep PAN-3
358
+
359
+ # Try with verbose output
360
+ pan work plan PAN-3 --verbose
361
+ ```
362
+
363
+ ### Agent isn't asking questions
364
+
365
+ **Problem:** Planning agent creates plan without any questions
366
+
367
+ **Solutions:**
368
+ - This is normal for simple, well-defined issues
369
+ - Agent only asks when clarification needed
370
+ - You can proactively send context:
371
+ ```bash
372
+ pan work tell PAN-3-planning "Please ask questions about approach"
373
+ ```
374
+
375
+ ### Plan is too high-level
376
+
377
+ **Problem:** Plan lacks implementation details
378
+
379
+ **Solutions:**
380
+ ```bash
381
+ # Request more detail
382
+ pan work tell PAN-3-planning "Please add more specific implementation steps"
383
+
384
+ # Specify depth
385
+ pan work plan PAN-3 --depth detailed
386
+ ```
387
+
388
+ ### Plan is too detailed
389
+
390
+ **Problem:** Plan is overwhelming with minutiae
391
+
392
+ **Solutions:**
393
+ ```bash
394
+ # Request overview
395
+ pan work tell PAN-3-planning "Focus on high-level architecture, less detail"
396
+
397
+ # Or start with overview depth
398
+ pan work plan PAN-3 --depth overview
399
+ ```
400
+
401
+ ### Can't view plan in dashboard
402
+
403
+ **Problem:** Dashboard doesn't show plan
404
+
405
+ **Solutions:**
406
+ ```bash
407
+ # Verify plan file exists
408
+ ls ~/panopticon/planning/PAN-3/PLANNING.md
409
+
410
+ # Restart dashboard
411
+ pan down && pan up
412
+
413
+ # View plan manually
414
+ cat ~/panopticon/planning/PAN-3/PLANNING.md
415
+ ```
416
+
417
+ ## Planning Workflow Variations
418
+
419
+ ### Sequential Planning
420
+
421
+ For epics with multiple sub-issues:
422
+
423
+ ```bash
424
+ # Plan parent issue
425
+ pan work plan EPIC-1
426
+
427
+ # Plan child issues with context from parent
428
+ pan work plan PAN-3 --context EPIC-1
429
+ pan work plan PAN-4 --context EPIC-1
430
+ ```
431
+
432
+ ### Collaborative Planning
433
+
434
+ Multiple team members reviewing plan:
435
+
436
+ ```bash
437
+ # Planning agent creates plan
438
+ pan work plan PAN-3
439
+
440
+ # Team reviews in dashboard
441
+ # Click "Request Changes" in UI
442
+
443
+ # Agent revises based on team feedback
444
+ # Team approves when ready
445
+ ```
446
+
447
+ ### Research-Heavy Planning
448
+
449
+ For unfamiliar domains:
450
+
451
+ ```bash
452
+ # Start planning with research focus
453
+ pan work plan PAN-3 --research
454
+
455
+ # Agent will:
456
+ # - Search for documentation
457
+ # - Look for examples in codebase
458
+ # - Suggest learning resources
459
+ # - Propose proof-of-concept approach
460
+ ```
461
+
462
+ ## Plan Quality Indicators
463
+
464
+ ### High-Quality Plan
465
+
466
+ - ✅ Clear summary and scope
467
+ - ✅ Specific architectural decisions with rationale
468
+ - ✅ Ordered implementation steps
469
+ - ✅ All files to create/modify identified
470
+ - ✅ Dependencies listed with versions
471
+ - ✅ Comprehensive testing strategy
472
+ - ✅ Security considerations addressed
473
+ - ✅ Edge cases documented
474
+ - ✅ Success criteria defined
475
+
476
+ ### Needs Improvement
477
+
478
+ - ❌ Vague or generic steps
479
+ - ❌ No architectural decisions
480
+ - ❌ Missing test strategy
481
+ - ❌ No edge cases considered
482
+ - ❌ Unclear success criteria
483
+
484
+ ## After Planning
485
+
486
+ Once plan is approved:
487
+
488
+ ```bash
489
+ # Create workspace with plan
490
+ pan work issue PAN-3 --with-plan
491
+
492
+ # Implementation agent will have:
493
+ # - Full plan as context
494
+ # - Files identified in plan
495
+ # - Architecture decisions documented
496
+ # - Test requirements clear
497
+ ```
498
+
499
+ Implementation agent can reference plan:
500
+ ```bash
501
+ # Agent reads plan
502
+ Read file_path="PLANNING.md"
503
+
504
+ # Agent follows implementation steps
505
+ # Agent verifies against success criteria
506
+ ```
507
+
508
+ ## Related Skills
509
+
510
+ - `/pan-issue` - Create workspace and spawn agent
511
+ - `/pan-help` - Command reference
512
+ - `/pan-status` - Monitor planning session
513
+ - `/feature-work` - Implementation workflow (post-planning)
514
+ - `/onboard-codebase` - Codebase exploration (similar to planning discovery)
515
+
516
+ ## More Information
517
+
518
+ - Planning sessions are read-only (no code changes)
519
+ - Plans saved in `~/.panopticon/planning/<issue-id>/PLANNING.md`
520
+ - Dashboard planning UI: http://localhost:3001/planning/<issue-id>
521
+ - Run `pan work plan --help` for more options