@thiagodiogo/pscode 1.0.1 → 2.0.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 (60) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +142 -142
  3. package/bin/pscode.js +4 -4
  4. package/dist/cli/index.js +0 -1
  5. package/dist/commands/feedback.js +4 -4
  6. package/dist/commands/schema.js +60 -60
  7. package/dist/core/collections/initiatives/templates.js +57 -57
  8. package/dist/core/command-generation/adapters/claude.js +8 -8
  9. package/dist/core/command-generation/adapters/codex.js +6 -6
  10. package/dist/core/command-generation/adapters/cursor.js +8 -8
  11. package/dist/core/command-generation/adapters/gemini.js +5 -5
  12. package/dist/core/command-generation/adapters/github-copilot.js +5 -5
  13. package/dist/core/complete.d.ts +0 -1
  14. package/dist/core/complete.js +35 -59
  15. package/dist/core/completions/command-registry.js +0 -4
  16. package/dist/core/completions/generators/bash-generator.js +41 -41
  17. package/dist/core/completions/generators/fish-generator.js +7 -7
  18. package/dist/core/completions/generators/powershell-generator.js +29 -29
  19. package/dist/core/completions/generators/zsh-generator.js +33 -33
  20. package/dist/core/completions/templates/bash-templates.js +24 -24
  21. package/dist/core/completions/templates/fish-templates.js +38 -38
  22. package/dist/core/completions/templates/powershell-templates.js +28 -28
  23. package/dist/core/completions/templates/zsh-templates.js +39 -39
  24. package/dist/core/init.js +0 -1
  25. package/dist/core/profile-sync-drift.js +0 -1
  26. package/dist/core/profiles.d.ts +3 -3
  27. package/dist/core/profiles.js +2 -3
  28. package/dist/core/shared/skill-generation.js +1 -3
  29. package/dist/core/shared/tool-detection.d.ts +2 -2
  30. package/dist/core/shared/tool-detection.js +0 -2
  31. package/dist/core/templates/skill-templates.d.ts +0 -1
  32. package/dist/core/templates/skill-templates.js +0 -1
  33. package/dist/core/templates/workflows/apply-change.js +264 -264
  34. package/dist/core/templates/workflows/archive-change.js +204 -204
  35. package/dist/core/templates/workflows/bulk-archive-change.js +472 -472
  36. package/dist/core/templates/workflows/continue-change.js +214 -214
  37. package/dist/core/templates/workflows/explore.js +735 -735
  38. package/dist/core/templates/workflows/feedback.js +97 -97
  39. package/dist/core/templates/workflows/ff-change.js +180 -180
  40. package/dist/core/templates/workflows/new-change.js +123 -123
  41. package/dist/core/templates/workflows/onboard.js +584 -584
  42. package/dist/core/templates/workflows/propose.js +324 -324
  43. package/dist/core/templates/workflows/trello-draft.js +194 -194
  44. package/dist/core/templates/workflows/trello-setup.js +292 -292
  45. package/dist/core/templates/workflows/verify-change.js +318 -318
  46. package/dist/core/workspace/open-surface.js +30 -30
  47. package/package.json +18 -20
  48. package/schemas/spec-driven/schema.yaml +153 -153
  49. package/schemas/spec-driven/templates/design.md +19 -19
  50. package/schemas/spec-driven/templates/proposal.md +23 -23
  51. package/schemas/spec-driven/templates/spec.md +8 -8
  52. package/schemas/spec-driven/templates/tasks.md +9 -9
  53. package/schemas/workspace-planning/schema.yaml +72 -72
  54. package/schemas/workspace-planning/templates/design.md +33 -33
  55. package/schemas/workspace-planning/templates/proposal.md +28 -28
  56. package/schemas/workspace-planning/templates/spec.md +9 -9
  57. package/schemas/workspace-planning/templates/tasks.md +15 -15
  58. package/scripts/postinstall.js +83 -83
  59. package/dist/core/templates/workflows/sync-specs.d.ts +0 -10
  60. package/dist/core/templates/workflows/sync-specs.js +0 -290
@@ -1,290 +0,0 @@
1
- export function getSyncSpecsSkillTemplate() {
2
- return {
3
- name: 'pscode-sync-specs',
4
- description: 'Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.',
5
- instructions: `Sync delta specs from a change to main specs.
6
-
7
- This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
8
-
9
- **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.
10
-
11
- **Steps**
12
-
13
- 1. **If no change name provided, prompt for selection**
14
-
15
- Run \`pscode list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
16
-
17
- Show changes that have delta specs (under \`specs/\` directory).
18
-
19
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
20
-
21
- 2. **Resolve change context**
22
-
23
- Run:
24
- \`\`\`bash
25
- pscode status --change "<name>" --json
26
- \`\`\`
27
-
28
- If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace spec sync is not supported in this slice and STOP. Do not fall back to repo-local paths or edit linked repos.
29
-
30
- 3. **Find delta specs**
31
-
32
- Use \`artifactPaths.specs.existingOutputPaths\` from the status JSON as the list of delta spec files.
33
-
34
- Each delta spec file contains sections like:
35
- - \`## ADDED Requirements\` - New requirements to add
36
- - \`## MODIFIED Requirements\` - Changes to existing requirements
37
- - \`## REMOVED Requirements\` - Requirements to remove
38
- - \`## RENAMED Requirements\` - Requirements to rename (FROM:/TO: format)
39
-
40
- If no delta specs found, inform user and stop.
41
-
42
- 4. **For each delta spec, apply changes to main specs**
43
-
44
- For each repo-local capability delta spec path returned by the CLI:
45
-
46
- a. **Read the delta spec** to understand the intended changes
47
-
48
- b. **Read the main spec** at \`pscode/specs/<capability>/spec.md\` (may not exist yet)
49
-
50
- c. **Apply changes intelligently**:
51
-
52
- **ADDED Requirements:**
53
- - If requirement doesn't exist in main spec → add it
54
- - If requirement already exists → update it to match (treat as implicit MODIFIED)
55
-
56
- **MODIFIED Requirements:**
57
- - Find the requirement in main spec
58
- - Apply the changes - this can be:
59
- - Adding new scenarios (don't need to copy existing ones)
60
- - Modifying existing scenarios
61
- - Changing the requirement description
62
- - Preserve scenarios/content not mentioned in the delta
63
-
64
- **REMOVED Requirements:**
65
- - Remove the entire requirement block from main spec
66
-
67
- **RENAMED Requirements:**
68
- - Find the FROM requirement, rename to TO
69
-
70
- d. **Create new main spec** if capability doesn't exist yet:
71
- - Create \`pscode/specs/<capability>/spec.md\`
72
- - Add Purpose section (can be brief, mark as TBD)
73
- - Add Requirements section with the ADDED requirements
74
-
75
- 5. **Show summary**
76
-
77
- After applying all changes, summarize:
78
- - Which capabilities were updated
79
- - What changes were made (requirements added/modified/removed/renamed)
80
-
81
- **Delta Spec Format Reference**
82
-
83
- \`\`\`markdown
84
- ## ADDED Requirements
85
-
86
- ### Requirement: New Feature
87
- The system SHALL do something new.
88
-
89
- #### Scenario: Basic case
90
- - **WHEN** user does X
91
- - **THEN** system does Y
92
-
93
- ## MODIFIED Requirements
94
-
95
- ### Requirement: Existing Feature
96
- #### Scenario: New scenario to add
97
- - **WHEN** user does A
98
- - **THEN** system does B
99
-
100
- ## REMOVED Requirements
101
-
102
- ### Requirement: Deprecated Feature
103
-
104
- ## RENAMED Requirements
105
-
106
- - FROM: \`### Requirement: Old Name\`
107
- - TO: \`### Requirement: New Name\`
108
- \`\`\`
109
-
110
- **Key Principle: Intelligent Merging**
111
-
112
- Unlike programmatic merging, you can apply **partial updates**:
113
- - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios
114
- - The delta represents *intent*, not a wholesale replacement
115
- - Use your judgment to merge changes sensibly
116
-
117
- **Output On Success**
118
-
119
- \`\`\`
120
- ## Specs Synced: <change-name>
121
-
122
- Updated main specs:
123
-
124
- **<capability-1>**:
125
- - Added requirement: "New Feature"
126
- - Modified requirement: "Existing Feature" (added 1 scenario)
127
-
128
- **<capability-2>**:
129
- - Created new spec file
130
- - Added requirement: "Another Feature"
131
-
132
- Main specs are now updated. The change remains active - archive when implementation is complete.
133
- \`\`\`
134
-
135
- **Guardrails**
136
- - Read both delta and main specs before making changes
137
- - Preserve existing content not mentioned in delta
138
- - If something is unclear, ask for clarification
139
- - Show what you're changing as you go
140
- - The operation should be idempotent - running twice should give same result`,
141
- license: 'MIT',
142
- compatibility: 'Requires pscode CLI.',
143
- metadata: { author: 'pscode', version: '1.0' },
144
- };
145
- }
146
- export function getPsSyncCommandTemplate() {
147
- return {
148
- name: 'PS: Sync',
149
- description: 'Sync delta specs from a change to main specs',
150
- category: 'Workflow',
151
- tags: ['workflow', 'specs', 'experimental'],
152
- content: `Sync delta specs from a change to main specs.
153
-
154
- This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
155
-
156
- **Input**: Optionally specify a change name after \`/ps:sync\` (e.g., \`/ps:sync add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
157
-
158
- **Steps**
159
-
160
- 1. **If no change name provided, prompt for selection**
161
-
162
- Run \`pscode list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
163
-
164
- Show changes that have delta specs (under \`specs/\` directory).
165
-
166
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
167
-
168
- 2. **Resolve change context**
169
-
170
- Run:
171
- \`\`\`bash
172
- pscode status --change "<name>" --json
173
- \`\`\`
174
-
175
- If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace spec sync is not supported in this slice and STOP. Do not fall back to repo-local paths or edit linked repos.
176
-
177
- 3. **Find delta specs**
178
-
179
- Use \`artifactPaths.specs.existingOutputPaths\` from the status JSON as the list of delta spec files.
180
-
181
- Each delta spec file contains sections like:
182
- - \`## ADDED Requirements\` - New requirements to add
183
- - \`## MODIFIED Requirements\` - Changes to existing requirements
184
- - \`## REMOVED Requirements\` - Requirements to remove
185
- - \`## RENAMED Requirements\` - Requirements to rename (FROM:/TO: format)
186
-
187
- If no delta specs found, inform user and stop.
188
-
189
- 4. **For each delta spec, apply changes to main specs**
190
-
191
- For each repo-local capability delta spec path returned by the CLI:
192
-
193
- a. **Read the delta spec** to understand the intended changes
194
-
195
- b. **Read the main spec** at \`pscode/specs/<capability>/spec.md\` (may not exist yet)
196
-
197
- c. **Apply changes intelligently**:
198
-
199
- **ADDED Requirements:**
200
- - If requirement doesn't exist in main spec → add it
201
- - If requirement already exists → update it to match (treat as implicit MODIFIED)
202
-
203
- **MODIFIED Requirements:**
204
- - Find the requirement in main spec
205
- - Apply the changes - this can be:
206
- - Adding new scenarios (don't need to copy existing ones)
207
- - Modifying existing scenarios
208
- - Changing the requirement description
209
- - Preserve scenarios/content not mentioned in the delta
210
-
211
- **REMOVED Requirements:**
212
- - Remove the entire requirement block from main spec
213
-
214
- **RENAMED Requirements:**
215
- - Find the FROM requirement, rename to TO
216
-
217
- d. **Create new main spec** if capability doesn't exist yet:
218
- - Create \`pscode/specs/<capability>/spec.md\`
219
- - Add Purpose section (can be brief, mark as TBD)
220
- - Add Requirements section with the ADDED requirements
221
-
222
- 5. **Show summary**
223
-
224
- After applying all changes, summarize:
225
- - Which capabilities were updated
226
- - What changes were made (requirements added/modified/removed/renamed)
227
-
228
- **Delta Spec Format Reference**
229
-
230
- \`\`\`markdown
231
- ## ADDED Requirements
232
-
233
- ### Requirement: New Feature
234
- The system SHALL do something new.
235
-
236
- #### Scenario: Basic case
237
- - **WHEN** user does X
238
- - **THEN** system does Y
239
-
240
- ## MODIFIED Requirements
241
-
242
- ### Requirement: Existing Feature
243
- #### Scenario: New scenario to add
244
- - **WHEN** user does A
245
- - **THEN** system does B
246
-
247
- ## REMOVED Requirements
248
-
249
- ### Requirement: Deprecated Feature
250
-
251
- ## RENAMED Requirements
252
-
253
- - FROM: \`### Requirement: Old Name\`
254
- - TO: \`### Requirement: New Name\`
255
- \`\`\`
256
-
257
- **Key Principle: Intelligent Merging**
258
-
259
- Unlike programmatic merging, you can apply **partial updates**:
260
- - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios
261
- - The delta represents *intent*, not a wholesale replacement
262
- - Use your judgment to merge changes sensibly
263
-
264
- **Output On Success**
265
-
266
- \`\`\`
267
- ## Specs Synced: <change-name>
268
-
269
- Updated main specs:
270
-
271
- **<capability-1>**:
272
- - Added requirement: "New Feature"
273
- - Modified requirement: "Existing Feature" (added 1 scenario)
274
-
275
- **<capability-2>**:
276
- - Created new spec file
277
- - Added requirement: "Another Feature"
278
-
279
- Main specs are now updated. The change remains active - archive when implementation is complete.
280
- \`\`\`
281
-
282
- **Guardrails**
283
- - Read both delta and main specs before making changes
284
- - Preserve existing content not mentioned in delta
285
- - If something is unclear, ask for clarification
286
- - Show what you're changing as you go
287
- - The operation should be idempotent - running twice should give same result`
288
- };
289
- }
290
- //# sourceMappingURL=sync-specs.js.map