@thiagodiogo/pscode 2.3.0 → 2.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.
Files changed (31) hide show
  1. package/dist/core/init.d.ts +0 -2
  2. package/dist/core/init.js +7 -77
  3. package/dist/core/profile-sync-drift.js +1 -15
  4. package/dist/core/profiles.d.ts +1 -1
  5. package/dist/core/profiles.js +0 -13
  6. package/dist/core/shared/index.d.ts +1 -0
  7. package/dist/core/shared/index.js +1 -0
  8. package/dist/core/shared/prune-orphans.d.ts +39 -0
  9. package/dist/core/shared/prune-orphans.js +149 -0
  10. package/dist/core/shared/skill-generation.js +2 -14
  11. package/dist/core/shared/tool-detection.d.ts +2 -2
  12. package/dist/core/shared/tool-detection.js +1 -13
  13. package/dist/core/templates/skill-templates.d.ts +1 -7
  14. package/dist/core/templates/skill-templates.js +1 -7
  15. package/dist/core/templates/workflows/{archive-change.d.ts → complete-change.d.ts} +1 -1
  16. package/dist/core/templates/workflows/{archive-change.js → complete-change.js} +2 -2
  17. package/dist/core/update.d.ts +0 -20
  18. package/dist/core/update.js +29 -115
  19. package/package.json +1 -1
  20. package/dist/core/templates/workflows/bulk-archive-change.d.ts +0 -10
  21. package/dist/core/templates/workflows/bulk-archive-change.js +0 -491
  22. package/dist/core/templates/workflows/continue-change.d.ts +0 -10
  23. package/dist/core/templates/workflows/continue-change.js +0 -233
  24. package/dist/core/templates/workflows/ff-change.d.ts +0 -10
  25. package/dist/core/templates/workflows/ff-change.js +0 -199
  26. package/dist/core/templates/workflows/new-change.d.ts +0 -10
  27. package/dist/core/templates/workflows/new-change.js +0 -142
  28. package/dist/core/templates/workflows/onboard.d.ts +0 -10
  29. package/dist/core/templates/workflows/onboard.js +0 -606
  30. package/dist/core/templates/workflows/verify-change.d.ts +0 -10
  31. package/dist/core/templates/workflows/verify-change.js +0 -337
@@ -1,606 +0,0 @@
1
- export function getOnboardSkillTemplate() {
2
- return {
3
- name: 'pscode-onboard',
4
- description: 'Guided onboarding for Pscode - walk through a complete workflow cycle with narration and real codebase work.',
5
- instructions: getOnboardInstructions(),
6
- compatibility: 'Requires pscode CLI.',
7
- metadata: { author: 'pscode', version: '1.0' },
8
- };
9
- }
10
- function getOnboardInstructions() {
11
- return `Guide the user through their first complete Pscode workflow cycle. This is a teaching experience—you'll do real work in their codebase while explaining each step.
12
-
13
- ---
14
-
15
- ## Preflight
16
-
17
- Before starting, check if the Pscode CLI is installed:
18
-
19
- \`\`\`bash
20
- # Unix/macOS
21
- pscode --version 2>&1 || echo "CLI_NOT_INSTALLED"
22
- # Windows (PowerShell)
23
- # if (Get-Command pscode -ErrorAction SilentlyContinue) { pscode --version } else { echo "CLI_NOT_INSTALLED" }
24
- \`\`\`
25
-
26
- **If CLI not installed:**
27
- > Pscode CLI is not installed. Install it first, then come back to \`/ps:onboard\`.
28
-
29
- Stop here if not installed.
30
-
31
- ---
32
-
33
- ## Phase 1: Welcome
34
-
35
- Display:
36
-
37
- \`\`\`
38
- ## Welcome to Pscode!
39
-
40
- I'll walk you through a complete change cycle—from idea to implementation—using a real task in your codebase. Along the way, you'll learn the workflow by doing it.
41
-
42
- **What we'll do:**
43
- 1. Pick a small, real task in your codebase
44
- 2. Explore the problem briefly
45
- 3. Create a change (the container for our work)
46
- 4. Build the artifacts: proposal → specs → design → tasks
47
- 5. Implement the tasks
48
- 6. Archive the completed change
49
-
50
- **Time:** ~15-20 minutes
51
-
52
- Let's start by finding something to work on.
53
- \`\`\`
54
-
55
- ---
56
-
57
- ## Phase 2: Task Selection
58
-
59
- ### Codebase Analysis
60
-
61
- Scan the codebase for small improvement opportunities. Look for:
62
-
63
- 1. **TODO/FIXME comments** - Search for \`TODO\`, \`FIXME\`, \`HACK\`, \`XXX\` in code files
64
- 2. **Missing error handling** - \`catch\` blocks that swallow errors, risky operations without try-catch
65
- 3. **Functions without tests** - Cross-reference \`src/\` with test directories
66
- 4. **Type issues** - \`any\` types in TypeScript files (\`: any\`, \`as any\`)
67
- 5. **Debug artifacts** - \`console.log\`, \`console.debug\`, \`debugger\` statements in non-debug code
68
- 6. **Missing validation** - User input handlers without validation
69
-
70
- Also check recent git activity:
71
- \`\`\`bash
72
- # Unix/macOS
73
- git log --oneline -10 2>/dev/null || echo "No git history"
74
- # Windows (PowerShell)
75
- # git log --oneline -10 2>$null; if ($LASTEXITCODE -ne 0) { echo "No git history" }
76
- \`\`\`
77
-
78
- ### Present Suggestions
79
-
80
- From your analysis, present 3-4 specific suggestions:
81
-
82
- \`\`\`
83
- ## Task Suggestions
84
-
85
- Based on scanning your codebase, here are some good starter tasks:
86
-
87
- **1. [Most promising task]**
88
- Location: \`src/path/to/file.ts:42\`
89
- Scope: ~1-2 files, ~20-30 lines
90
- Why it's good: [brief reason]
91
-
92
- **2. [Second task]**
93
- Location: \`src/another/file.ts\`
94
- Scope: ~1 file, ~15 lines
95
- Why it's good: [brief reason]
96
-
97
- **3. [Third task]**
98
- Location: [location]
99
- Scope: [estimate]
100
- Why it's good: [brief reason]
101
-
102
- **4. Something else?**
103
- Tell me what you'd like to work on.
104
-
105
- Which task interests you? (Pick a number or describe your own)
106
- \`\`\`
107
-
108
- **If nothing found:** Fall back to asking what the user wants to build:
109
- > I didn't find obvious quick wins in your codebase. What's something small you've been meaning to add or fix?
110
-
111
- ### Scope Guardrail
112
-
113
- If the user picks or describes something too large (major feature, multi-day work):
114
-
115
- \`\`\`
116
- That's a valuable task, but it's probably larger than ideal for your first Pscode run-through.
117
-
118
- For learning the workflow, smaller is better—it lets you see the full cycle without getting stuck in implementation details.
119
-
120
- **Options:**
121
- 1. **Slice it smaller** - What's the smallest useful piece of [their task]? Maybe just [specific slice]?
122
- 2. **Pick something else** - One of the other suggestions, or a different small task?
123
- 3. **Do it anyway** - If you really want to tackle this, we can. Just know it'll take longer.
124
-
125
- What would you prefer?
126
- \`\`\`
127
-
128
- Let the user override if they insist—this is a soft guardrail.
129
-
130
- ---
131
-
132
- ## Phase 3: Explore Demo
133
-
134
- Once a task is selected, briefly demonstrate explore mode:
135
-
136
- \`\`\`
137
- Before we create a change, let me quickly show you **explore mode**—it's how you think through problems before committing to a direction.
138
- \`\`\`
139
-
140
- Spend 1-2 minutes investigating the relevant code:
141
- - Read the file(s) involved
142
- - Draw a quick ASCII diagram if it helps
143
- - Note any considerations
144
-
145
- \`\`\`
146
- ## Quick Exploration
147
-
148
- [Your brief analysis—what you found, any considerations]
149
-
150
- ┌─────────────────────────────────────────┐
151
- │ [Optional: ASCII diagram if helpful] │
152
- └─────────────────────────────────────────┘
153
-
154
- Explore mode (\`/ps:explore\`) is for this kind of thinking—investigating before implementing. You can use it anytime you need to think through a problem.
155
-
156
- Now let's create a change to hold our work.
157
- \`\`\`
158
-
159
- **PAUSE** - Wait for user acknowledgment before proceeding.
160
-
161
- ---
162
-
163
- ## Phase 4: Create the Change
164
-
165
- **EXPLAIN:**
166
- \`\`\`
167
- ## Creating a Change
168
-
169
- A "change" in Pscode is a container for all the thinking and planning around a piece of work. It lives at the \`changeRoot\` reported by \`pscode status --change "<name>" --json\` and holds your artifacts—proposal, specs, design, tasks.
170
-
171
- Let me create one for our task.
172
- \`\`\`
173
-
174
- **DO:** Create the change with a derived kebab-case name:
175
- \`\`\`bash
176
- pscode new change "<derived-name>"
177
- \`\`\`
178
-
179
- **SHOW:**
180
- \`\`\`
181
- Created: <changeRoot from status JSON>
182
-
183
- The folder structure:
184
- \`\`\`
185
- <changeRoot>/
186
- ├── proposal.md ← Why we're doing this (empty, we'll fill it)
187
- ├── design.md ← How we'll build it (empty)
188
- ├── specs/ ← Detailed requirements (empty)
189
- └── tasks.md ← Implementation checklist (empty)
190
- \`\`\`
191
-
192
- Now let's fill in the first artifact—the proposal.
193
- \`\`\`
194
-
195
- ---
196
-
197
- ## Phase 5: Proposal
198
-
199
- **EXPLAIN:**
200
- \`\`\`
201
- ## The Proposal
202
-
203
- The proposal captures **why** we're making this change and **what** it involves at a high level. It's the "elevator pitch" for the work.
204
-
205
- I'll draft one based on our task.
206
- \`\`\`
207
-
208
- **DO:** Draft the proposal content (don't save yet):
209
-
210
- \`\`\`
211
- Here's a draft proposal:
212
-
213
- ---
214
-
215
- ## Why
216
-
217
- [1-2 sentences explaining the problem/opportunity]
218
-
219
- ## What Changes
220
-
221
- [Bullet points of what will be different]
222
-
223
- ## Capabilities
224
-
225
- ### New Capabilities
226
- - \`<capability-name>\`: [brief description]
227
-
228
- ### Modified Capabilities
229
- <!-- If modifying existing behavior -->
230
-
231
- ## Impact
232
-
233
- - \`src/path/to/file.ts\`: [what changes]
234
- - [other files if applicable]
235
-
236
- ---
237
-
238
- Does this capture the intent? I can adjust before we save it.
239
- \`\`\`
240
-
241
- **PAUSE** - Wait for user approval/feedback.
242
-
243
- After approval, save the proposal:
244
- \`\`\`bash
245
- pscode instructions proposal --change "<name>" --json
246
- \`\`\`
247
- Then write the content to the \`resolvedOutputPath\` from \`pscode instructions proposal --change "<name>" --json\`.
248
-
249
- \`\`\`
250
- Proposal saved. This is your "why" document—you can always come back and refine it as understanding evolves.
251
-
252
- Next up: specs.
253
- \`\`\`
254
-
255
- ---
256
-
257
- ## Phase 6: Specs
258
-
259
- **EXPLAIN:**
260
- \`\`\`
261
- ## Specs
262
-
263
- Specs define **what** we're building in precise, testable terms. They use a requirement/scenario format that makes expected behavior crystal clear.
264
-
265
- For a small task like this, we might only need one spec file.
266
- \`\`\`
267
-
268
- **DO:** Resolve where the spec file should be created:
269
- \`\`\`bash
270
- pscode instructions specs --change "<name>" --json
271
- # Use resolvedOutputPath from the JSON. If it is a glob, choose the concrete file path using the schema instruction and workspace planning context.
272
- \`\`\`
273
-
274
- Draft the spec content:
275
-
276
- \`\`\`
277
- Here's the spec:
278
-
279
- ---
280
-
281
- ## ADDED Requirements
282
-
283
- ### Requirement: <Name>
284
-
285
- <Description of what the system should do>
286
-
287
- #### Scenario: <Scenario name>
288
-
289
- - **WHEN** <trigger condition>
290
- - **THEN** <expected outcome>
291
- - **AND** <additional outcome if needed>
292
-
293
- ---
294
-
295
- This format—WHEN/THEN/AND—makes requirements testable. You can literally read them as test cases.
296
- \`\`\`
297
-
298
- Save to the concrete file path chosen from \`resolvedOutputPath\`.
299
-
300
- ---
301
-
302
- ## Phase 7: Design
303
-
304
- **EXPLAIN:**
305
- \`\`\`
306
- ## Design
307
-
308
- The design captures **how** we'll build it—technical decisions, tradeoffs, approach.
309
-
310
- For small changes, this might be brief. That's fine—not every change needs deep design discussion.
311
- \`\`\`
312
-
313
- **DO:** Draft design.md:
314
-
315
- \`\`\`
316
- Here's the design:
317
-
318
- ---
319
-
320
- ## Context
321
-
322
- [Brief context about the current state]
323
-
324
- ## Goals / Non-Goals
325
-
326
- **Goals:**
327
- - [What we're trying to achieve]
328
-
329
- **Non-Goals:**
330
- - [What's explicitly out of scope]
331
-
332
- ## Decisions
333
-
334
- ### Decision 1: [Key decision]
335
-
336
- [Explanation of approach and rationale]
337
-
338
- ---
339
-
340
- For a small task, this captures the key decisions without over-engineering.
341
- \`\`\`
342
-
343
- Save to the \`resolvedOutputPath\` from \`pscode instructions design --change "<name>" --json\`.
344
-
345
- ---
346
-
347
- ## Phase 8: Tasks
348
-
349
- **EXPLAIN:**
350
- \`\`\`
351
- ## Tasks
352
-
353
- Finally, we break the work into implementation tasks—checkboxes that drive the apply phase.
354
-
355
- These should be small, clear, and in logical order.
356
- \`\`\`
357
-
358
- **DO:** Generate tasks based on specs and design:
359
-
360
- \`\`\`
361
- Here are the implementation tasks:
362
-
363
- ---
364
-
365
- ## 1. [Category or file]
366
-
367
- - [ ] 1.1 [Specific task]
368
- - [ ] 1.2 [Specific task]
369
-
370
- ## 2. Verify
371
-
372
- - [ ] 2.1 [Verification step]
373
-
374
- ---
375
-
376
- Each checkbox becomes a unit of work in the apply phase. Ready to implement?
377
- \`\`\`
378
-
379
- **PAUSE** - Wait for user to confirm they're ready to implement.
380
-
381
- Save to the \`resolvedOutputPath\` from \`pscode instructions tasks --change "<name>" --json\`.
382
-
383
- ---
384
-
385
- ## Phase 9: Apply (Implementation)
386
-
387
- **EXPLAIN:**
388
- \`\`\`
389
- ## Implementation
390
-
391
- Now we implement each task, checking them off as we go. I'll announce each one and occasionally note how the specs/design informed the approach.
392
- \`\`\`
393
-
394
- **DO:** For each task:
395
-
396
- 1. Announce: "Working on task N: [description]"
397
- 2. Implement the change in the codebase
398
- 3. Reference specs/design naturally: "The spec says X, so I'm doing Y"
399
- 4. Mark complete in tasks.md: \`- [ ]\` → \`- [x]\`
400
- 5. Brief status: "✓ Task N complete"
401
-
402
- Keep narration light—don't over-explain every line of code.
403
-
404
- After all tasks:
405
-
406
- \`\`\`
407
- ## Implementation Complete
408
-
409
- All tasks done:
410
- - [x] Task 1
411
- - [x] Task 2
412
- - [x] ...
413
-
414
- The change is implemented! One more step—let's complete it.
415
- \`\`\`
416
-
417
- ---
418
-
419
- ## Phase 10: Complete
420
-
421
- **EXPLAIN:**
422
- \`\`\`
423
- ## Completing
424
-
425
- When a change is complete, we complete it. The archive path is derived from \`planningHome.changesDir\` and the date.
426
-
427
- Completed changes become your project's decision history—you can always find them later to understand why something was built a certain way.
428
- \`\`\`
429
-
430
- **DO:**
431
- \`\`\`bash
432
- pscode complete "<name>"
433
- \`\`\`
434
-
435
- **SHOW:**
436
- \`\`\`
437
- Archived to: \`<planningHome.changesDir>/archive/YYYY-MM-DD-<name>/\`
438
-
439
- The change is now part of your project's history. The code is in your codebase, the decision record is preserved.
440
- \`\`\`
441
-
442
- ---
443
-
444
- ## Phase 11: Trello Integration (optional)
445
-
446
- After the core workflow is complete, check if the Trello MCP server is available:
447
-
448
- \`\`\`tool
449
- mcp__claude_ai_Trello_Custom__get_me
450
- \`\`\`
451
-
452
- **If the call succeeds** (Trello MCP is available):
453
-
454
- \`\`\`
455
- ## 🎉 Trello disponível!
456
-
457
- Detectei que o servidor MCP do Trello está ativo. O Pscode pode sincronizar
458
- automaticamente cards no Trello conforme você avança nas suas changes.
459
-
460
- **Benefícios da integração:**
461
- - /ps:task → adiciona tarefa ao Backlog do Trello
462
- - /ps:draft → registra ideias em "Para Explorar"
463
- - /ps:propose → move card para "Em Refinamento"
464
- - /ps:apply → move card para "Em Desenvolvimento" e depois "Em Teste"
465
- - /ps:complete → move card para "Concluído"
466
-
467
- Deseja configurar agora?
468
- \`\`\`
469
-
470
- Use **AskUserQuestion** to ask: "Configurar integração com Trello agora?" (Sim, configurar agora / Não, depois).
471
-
472
- If "Sim": invoke \`/ps:trello-setup\` instructions directly (run the trello-setup skill inline).
473
-
474
- If "Não": mention they can run \`/ps:trello-setup\` at any time.
475
-
476
- **If the call fails** (Trello MCP not available): skip this phase silently.
477
-
478
- ---
479
-
480
- ## Phase 12: Recap & Next Steps
481
-
482
- \`\`\`
483
- ## Congratulations!
484
-
485
- You just completed a full Pscode cycle:
486
-
487
- 1. **Explore** - Thought through the problem
488
- 2. **New** - Created a change container
489
- 3. **Proposal** - Captured WHY
490
- 4. **Specs** - Defined WHAT in detail
491
- 5. **Design** - Decided HOW
492
- 6. **Tasks** - Broke it into steps
493
- 7. **Apply** - Implemented the work
494
- 8. **Archive** - Preserved the record
495
-
496
- This same rhythm works for any size change—a small fix or a major feature.
497
-
498
- ---
499
-
500
- ## Command Reference
501
-
502
- **Core workflow:**
503
-
504
- | Command | What it does |
505
- |------------------------|--------------------------------------------|
506
- | \`/ps:propose\` | Create a change and generate all artifacts |
507
- | \`/ps:explore\` | Think through problems before/during work |
508
- | \`/ps:apply\` | Implement tasks from a change |
509
- | \`/ps:complete\` | Complete a change |
510
-
511
- **Additional commands:**
512
-
513
- | Command | What it does |
514
- |------------------------|----------------------------------------------------------|
515
- | \`/ps:new\` | Start a new change, step through artifacts one at a time |
516
- | \`/ps:continue\` | Continue working on an existing change |
517
- | \`/ps:ff\` | Fast-forward: create all artifacts at once |
518
- | \`/ps:verify\` | Verify implementation matches artifacts |
519
-
520
- **Trello integration (if configured):**
521
-
522
- | Command | What it does |
523
- |------------------------|----------------------------------------------------------|
524
- | \`/ps:task\` | Add an ownerless task to the Trello Backlog |
525
- | \`/ps:draft\` | Capture a raw idea in "Para Explorar" |
526
- | \`/ps:trello-setup\`| Configure or reconfigure Trello integration |
527
-
528
- ---
529
-
530
- ## What's Next?
531
-
532
- Try \`/ps:propose\` on something you actually want to build. You've got the rhythm now!
533
- \`\`\`
534
-
535
- ---
536
-
537
- ## Graceful Exit Handling
538
-
539
- ### User wants to stop mid-way
540
-
541
- If the user says they need to stop, want to pause, or seem disengaged:
542
-
543
- \`\`\`
544
- No problem! Your change is saved at the \`changeRoot\` reported by \`pscode status --change "<name>" --json\`.
545
-
546
- To pick up where we left off later:
547
- - \`/ps:continue <name>\` - Resume artifact creation
548
- - \`/ps:apply <name>\` - Jump to implementation (if tasks exist)
549
-
550
- The work won't be lost. Come back whenever you're ready.
551
- \`\`\`
552
-
553
- Exit gracefully without pressure.
554
-
555
- ### User just wants command reference
556
-
557
- If the user says they just want to see the commands or skip the tutorial:
558
-
559
- \`\`\`
560
- ## Pscode Quick Reference
561
-
562
- **Core workflow:**
563
-
564
- | Command | What it does |
565
- |--------------------------|--------------------------------------------|
566
- | \`/ps:propose <name>\` | Create a change and generate all artifacts |
567
- | \`/ps:explore\` | Think through problems (no code changes) |
568
- | \`/ps:apply <name>\` | Implement tasks |
569
- | \`/ps:complete <name>\` | Complete when done |
570
-
571
- **Additional commands:**
572
-
573
- | Command | What it does |
574
- |---------------------------|-------------------------------------|
575
- | \`/ps:new <name>\` | Start a new change, step by step |
576
- | \`/ps:continue <name>\` | Continue an existing change |
577
- | \`/ps:ff <name>\` | Fast-forward: all artifacts at once |
578
- | \`/ps:verify <name>\` | Verify implementation |
579
-
580
- Try \`/ps:propose\` to start your first change.
581
- \`\`\`
582
-
583
- Exit gracefully.
584
-
585
- ---
586
-
587
- ## Guardrails
588
-
589
- - **Follow the EXPLAIN → DO → SHOW → PAUSE pattern** at key transitions (after explore, after proposal draft, after tasks, after archive)
590
- - **Keep narration light** during implementation—teach without lecturing
591
- - **Don't skip phases** even if the change is small—the goal is teaching the workflow
592
- - **Pause for acknowledgment** at marked points, but don't over-pause
593
- - **Handle exits gracefully**—never pressure the user to continue
594
- - **Use real codebase tasks**—don't simulate or use fake examples
595
- - **Adjust scope gently**—guide toward smaller tasks but respect user choice`;
596
- }
597
- export function getPsOnboardCommandTemplate() {
598
- return {
599
- name: 'PS: Onboard',
600
- description: 'Guided onboarding - walk through a complete Pscode workflow cycle with narration',
601
- category: 'Workflow',
602
- tags: ['workflow', 'onboarding', 'tutorial', 'learning'],
603
- content: getOnboardInstructions(),
604
- };
605
- }
606
- //# sourceMappingURL=onboard.js.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Skill Template Workflow Modules
3
- *
4
- * This file is generated by splitting the legacy monolithic
5
- * templates file into workflow-focused modules.
6
- */
7
- import type { SkillTemplate, CommandTemplate } from '../types.js';
8
- export declare function getVerifyChangeSkillTemplate(): SkillTemplate;
9
- export declare function getPsVerifyCommandTemplate(): CommandTemplate;
10
- //# sourceMappingURL=verify-change.d.ts.map