@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,337 +0,0 @@
1
- export function getVerifyChangeSkillTemplate() {
2
- return {
3
- name: 'pscode-verify-change',
4
- description: 'Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.',
5
- instructions: `Verify that an implementation matches the change artifacts (specs, tasks, design).
6
-
7
- **Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
8
-
9
- **Steps**
10
-
11
- 1. **If no change name provided, prompt for selection**
12
-
13
- Run \`pscode list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
14
-
15
- Show changes that have implementation tasks (tasks artifact exists).
16
- Include the schema used for each change if available.
17
- Mark changes with incomplete tasks as "(In Progress)".
18
-
19
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
20
-
21
- 2. **Check status to understand the schema**
22
- \`\`\`bash
23
- pscode status --change "<name>" --json
24
- \`\`\`
25
- Parse the JSON to understand:
26
- - \`schemaName\`: The workflow being used (e.g., "spec-driven")
27
- - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
28
- - Which artifacts exist for this change
29
-
30
- If status reports \`actionContext.mode: "workspace-planning"\`, explain that full workspace implementation verification is not supported in this slice and STOP. Do not infer repo-local implementation ownership or edit linked repos.
31
-
32
- 3. **Get planning context and load artifacts**
33
-
34
- \`\`\`bash
35
- pscode instructions apply --change "<name>" --json
36
- \`\`\`
37
-
38
- This returns the change directory and \`contextFiles\` (artifact ID -> array of concrete file paths). Read all available artifacts from \`contextFiles\`.
39
-
40
- 4. **Initialize verification report structure**
41
-
42
- Create a report structure with three dimensions:
43
- - **Completeness**: Track tasks and spec coverage
44
- - **Correctness**: Track requirement implementation and scenario coverage
45
- - **Coherence**: Track design adherence and pattern consistency
46
-
47
- Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
48
-
49
- 5. **Verify Completeness**
50
-
51
- **Task Completion**:
52
- - If \`contextFiles.tasks\` exists, read every file path in it
53
- - Parse checkboxes: \`- [ ]\` (incomplete) vs \`- [x]\` (complete)
54
- - Count complete vs total tasks
55
- - If incomplete tasks exist:
56
- - Add CRITICAL issue for each incomplete task
57
- - Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
58
-
59
- **Spec Coverage**:
60
- - If delta specs exist in \`contextFiles.specs\`:
61
- - Extract all requirements (marked with "### Requirement:")
62
- - For each requirement:
63
- - Search codebase for keywords related to the requirement
64
- - Assess if implementation likely exists
65
- - If requirements appear unimplemented:
66
- - Add CRITICAL issue: "Requirement not found: <requirement name>"
67
- - Recommendation: "Implement requirement X: <description>"
68
-
69
- 6. **Verify Correctness**
70
-
71
- **Requirement Implementation Mapping**:
72
- - For each requirement from delta specs:
73
- - Search codebase for implementation evidence
74
- - If found, note file paths and line ranges
75
- - Assess if implementation matches requirement intent
76
- - If divergence detected:
77
- - Add WARNING: "Implementation may diverge from spec: <details>"
78
- - Recommendation: "Review <file>:<lines> against requirement X"
79
-
80
- **Scenario Coverage**:
81
- - For each scenario in delta specs (marked with "#### Scenario:"):
82
- - Check if conditions are handled in code
83
- - Check if tests exist covering the scenario
84
- - If scenario appears uncovered:
85
- - Add WARNING: "Scenario not covered: <scenario name>"
86
- - Recommendation: "Add test or implementation for scenario: <description>"
87
-
88
- 7. **Verify Coherence**
89
-
90
- **Design Adherence**:
91
- - If \`contextFiles.design\` exists:
92
- - Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
93
- - Verify implementation follows those decisions
94
- - If contradiction detected:
95
- - Add WARNING: "Design decision not followed: <decision>"
96
- - Recommendation: "Update implementation or revise design.md to match reality"
97
- - If no design.md: Skip design adherence check, note "No design.md to verify against"
98
-
99
- **Code Pattern Consistency**:
100
- - Review new code for consistency with project patterns
101
- - Check file naming, directory structure, coding style
102
- - If significant deviations found:
103
- - Add SUGGESTION: "Code pattern deviation: <details>"
104
- - Recommendation: "Consider following project pattern: <example>"
105
-
106
- 8. **Generate Verification Report**
107
-
108
- **Summary Scorecard**:
109
- \`\`\`
110
- ## Verification Report: <change-name>
111
-
112
- ### Summary
113
- | Dimension | Status |
114
- |--------------|------------------|
115
- | Completeness | X/Y tasks, N reqs|
116
- | Correctness | M/N reqs covered |
117
- | Coherence | Followed/Issues |
118
- \`\`\`
119
-
120
- **Issues by Priority**:
121
-
122
- 1. **CRITICAL** (Must fix before archive):
123
- - Incomplete tasks
124
- - Missing requirement implementations
125
- - Each with specific, actionable recommendation
126
-
127
- 2. **WARNING** (Should fix):
128
- - Spec/design divergences
129
- - Missing scenario coverage
130
- - Each with specific recommendation
131
-
132
- 3. **SUGGESTION** (Nice to fix):
133
- - Pattern inconsistencies
134
- - Minor improvements
135
- - Each with specific recommendation
136
-
137
- **Final Assessment**:
138
- - If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
139
- - If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
140
- - If all clear: "All checks passed. Ready for archive."
141
-
142
- **Verification Heuristics**
143
-
144
- - **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
145
- - **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
146
- - **Coherence**: Look for glaring inconsistencies, don't nitpick style
147
- - **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
148
- - **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
149
-
150
- **Graceful Degradation**
151
-
152
- - If only tasks.md exists: verify task completion only, skip spec/design checks
153
- - If tasks + specs exist: verify completeness and correctness, skip design
154
- - If full artifacts: verify all three dimensions
155
- - Always note which checks were skipped and why
156
-
157
- **Output Format**
158
-
159
- Use clear markdown with:
160
- - Table for summary scorecard
161
- - Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
162
- - Code references in format: \`file.ts:123\`
163
- - Specific, actionable recommendations
164
- - No vague suggestions like "consider reviewing"`,
165
- compatibility: 'Requires pscode CLI.',
166
- metadata: { author: 'pscode', version: '1.0' },
167
- };
168
- }
169
- export function getPsVerifyCommandTemplate() {
170
- return {
171
- name: 'PS: Verify',
172
- description: 'Verify implementation matches change artifacts before archiving',
173
- category: 'Workflow',
174
- tags: ['workflow', 'verify', 'experimental'],
175
- content: `Verify that an implementation matches the change artifacts (specs, tasks, design).
176
-
177
- **Input**: Optionally specify a change name after \`/ps:verify\` (e.g., \`/ps:verify add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
178
-
179
- **Steps**
180
-
181
- 1. **If no change name provided, prompt for selection**
182
-
183
- Run \`pscode list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
184
-
185
- Show changes that have implementation tasks (tasks artifact exists).
186
- Include the schema used for each change if available.
187
- Mark changes with incomplete tasks as "(In Progress)".
188
-
189
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
190
-
191
- 2. **Check status to understand the schema**
192
- \`\`\`bash
193
- pscode status --change "<name>" --json
194
- \`\`\`
195
- Parse the JSON to understand:
196
- - \`schemaName\`: The workflow being used (e.g., "spec-driven")
197
- - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
198
- - Which artifacts exist for this change
199
-
200
- If status reports \`actionContext.mode: "workspace-planning"\`, explain that full workspace implementation verification is not supported in this slice and STOP. Do not infer repo-local implementation ownership or edit linked repos.
201
-
202
- 3. **Get planning context and load artifacts**
203
-
204
- \`\`\`bash
205
- pscode instructions apply --change "<name>" --json
206
- \`\`\`
207
-
208
- This returns the change directory and \`contextFiles\` (artifact ID -> array of concrete file paths). Read all available artifacts from \`contextFiles\`.
209
-
210
- 4. **Initialize verification report structure**
211
-
212
- Create a report structure with three dimensions:
213
- - **Completeness**: Track tasks and spec coverage
214
- - **Correctness**: Track requirement implementation and scenario coverage
215
- - **Coherence**: Track design adherence and pattern consistency
216
-
217
- Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
218
-
219
- 5. **Verify Completeness**
220
-
221
- **Task Completion**:
222
- - If \`contextFiles.tasks\` exists, read every file path in it
223
- - Parse checkboxes: \`- [ ]\` (incomplete) vs \`- [x]\` (complete)
224
- - Count complete vs total tasks
225
- - If incomplete tasks exist:
226
- - Add CRITICAL issue for each incomplete task
227
- - Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
228
-
229
- **Spec Coverage**:
230
- - If delta specs exist in \`contextFiles.specs\`:
231
- - Extract all requirements (marked with "### Requirement:")
232
- - For each requirement:
233
- - Search codebase for keywords related to the requirement
234
- - Assess if implementation likely exists
235
- - If requirements appear unimplemented:
236
- - Add CRITICAL issue: "Requirement not found: <requirement name>"
237
- - Recommendation: "Implement requirement X: <description>"
238
-
239
- 6. **Verify Correctness**
240
-
241
- **Requirement Implementation Mapping**:
242
- - For each requirement from delta specs:
243
- - Search codebase for implementation evidence
244
- - If found, note file paths and line ranges
245
- - Assess if implementation matches requirement intent
246
- - If divergence detected:
247
- - Add WARNING: "Implementation may diverge from spec: <details>"
248
- - Recommendation: "Review <file>:<lines> against requirement X"
249
-
250
- **Scenario Coverage**:
251
- - For each scenario in delta specs (marked with "#### Scenario:"):
252
- - Check if conditions are handled in code
253
- - Check if tests exist covering the scenario
254
- - If scenario appears uncovered:
255
- - Add WARNING: "Scenario not covered: <scenario name>"
256
- - Recommendation: "Add test or implementation for scenario: <description>"
257
-
258
- 7. **Verify Coherence**
259
-
260
- **Design Adherence**:
261
- - If \`contextFiles.design\` exists:
262
- - Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
263
- - Verify implementation follows those decisions
264
- - If contradiction detected:
265
- - Add WARNING: "Design decision not followed: <decision>"
266
- - Recommendation: "Update implementation or revise design.md to match reality"
267
- - If no design.md: Skip design adherence check, note "No design.md to verify against"
268
-
269
- **Code Pattern Consistency**:
270
- - Review new code for consistency with project patterns
271
- - Check file naming, directory structure, coding style
272
- - If significant deviations found:
273
- - Add SUGGESTION: "Code pattern deviation: <details>"
274
- - Recommendation: "Consider following project pattern: <example>"
275
-
276
- 8. **Generate Verification Report**
277
-
278
- **Summary Scorecard**:
279
- \`\`\`
280
- ## Verification Report: <change-name>
281
-
282
- ### Summary
283
- | Dimension | Status |
284
- |--------------|------------------|
285
- | Completeness | X/Y tasks, N reqs|
286
- | Correctness | M/N reqs covered |
287
- | Coherence | Followed/Issues |
288
- \`\`\`
289
-
290
- **Issues by Priority**:
291
-
292
- 1. **CRITICAL** (Must fix before archive):
293
- - Incomplete tasks
294
- - Missing requirement implementations
295
- - Each with specific, actionable recommendation
296
-
297
- 2. **WARNING** (Should fix):
298
- - Spec/design divergences
299
- - Missing scenario coverage
300
- - Each with specific recommendation
301
-
302
- 3. **SUGGESTION** (Nice to fix):
303
- - Pattern inconsistencies
304
- - Minor improvements
305
- - Each with specific recommendation
306
-
307
- **Final Assessment**:
308
- - If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
309
- - If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
310
- - If all clear: "All checks passed. Ready for archive."
311
-
312
- **Verification Heuristics**
313
-
314
- - **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
315
- - **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
316
- - **Coherence**: Look for glaring inconsistencies, don't nitpick style
317
- - **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
318
- - **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
319
-
320
- **Graceful Degradation**
321
-
322
- - If only tasks.md exists: verify task completion only, skip spec/design checks
323
- - If tasks + specs exist: verify completeness and correctness, skip design
324
- - If full artifacts: verify all three dimensions
325
- - Always note which checks were skipped and why
326
-
327
- **Output Format**
328
-
329
- Use clear markdown with:
330
- - Table for summary scorecard
331
- - Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
332
- - Code references in format: \`file.ts:123\`
333
- - Specific, actionable recommendations
334
- - No vague suggestions like "consider reviewing"`
335
- };
336
- }
337
- //# sourceMappingURL=verify-change.js.map