@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
@@ -18,210 +18,210 @@ export function getPsCompleteCommandTemplate() {
18
18
  };
19
19
  }
20
20
  function getArchiveInstructions() {
21
- return `Complete a change.
22
-
23
- **Input**: Optionally specify a change name (e.g., \`/ps:complete add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
24
-
25
- **Steps**
26
-
27
- 1. **If no change name provided, prompt for selection**
28
-
29
- Run \`pscode list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
30
-
31
- Show only active changes (not already archived).
32
- Include the schema used for each change if available.
33
-
34
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
35
-
36
- 2. **Check artifact completion status**
37
-
38
- Run \`pscode status --change "<name>" --json\` to check artifact completion.
39
-
40
- Parse the JSON to understand:
41
- - \`schemaName\`: The workflow being used
42
- - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
43
- - \`artifacts\`: List of artifacts with their status (\`done\` or other)
44
-
45
- If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace archive is not supported in this slice and STOP.
46
-
47
- **If any artifacts are not \`done\`:**
48
- - Display warning listing incomplete artifacts
49
- - Use **AskUserQuestion tool** to confirm user wants to proceed
50
- - Proceed if user confirms
51
-
52
- 3. **Check task completion status**
53
-
54
- Read the tasks file (typically \`tasks.md\`) to check for incomplete tasks.
55
-
56
- Count tasks marked with \`- [ ]\` (incomplete) vs \`- [x]\` (complete).
57
-
58
- **If incomplete tasks found:**
59
- - Display warning showing count of incomplete tasks
60
- - Use **AskUserQuestion tool** to confirm user wants to proceed
61
- - Proceed if user confirms
62
-
63
- **If no tasks file exists:** Proceed without task-related warning.
64
-
65
- 4. **Assess delta spec sync state**
66
-
67
- Use \`artifactPaths.specs.existingOutputPaths\` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
68
-
69
- **If delta specs exist:**
70
- - Compare each delta spec with its corresponding main spec at \`pscode/specs/<capability>/spec.md\`
71
- - Determine what changes would be applied (adds, modifications, removals, renames)
72
- - Show a combined summary before prompting
73
-
74
- **Prompt options:**
75
- - If changes needed: "Sync now (recommended)", "Archive without syncing"
76
- - If already synced: "Archive now", "Sync anyway", "Cancel"
77
-
78
- If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke pscode-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
79
-
80
- 5. **Perform the archive**
81
-
82
- Create an \`archive\` directory under \`planningHome.changesDir\` if it doesn't exist:
83
- \`\`\`bash
84
- mkdir -p "<planningHome.changesDir>/archive"
85
- \`\`\`
86
-
87
- Generate target name using current date: \`YYYY-MM-DD-<change-name>\`
88
-
89
- **Check if target already exists:**
90
- - If yes: Fail with error, suggest renaming existing archive or using different date
91
- - If no: Move \`changeRoot\` to the archive directory
92
-
93
- \`\`\`bash
94
- mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
95
- \`\`\`
96
-
97
- 6. **Trello Integration — move card to "Concluído" (optional)**
98
-
99
- Use the **Read tool** (NOT a shell command) to read \`pscode/trello.yaml\` from the current working directory.
100
- The Read tool is cross-platform and works on Windows, macOS, and Linux — never use \`cat\` or shell commands to read this file.
101
- If the Read tool returns an error (file not found), skip all Trello steps.
102
-
103
- Otherwise parse and extract \`boardId\`, \`lists.done\` (and optionally \`lists.testing\`, \`lists.deploy\`, \`lists.developing\`, \`lists.ready\`, \`lists.refining\`, \`lists.backlog\`).
104
-
105
- Search for the change's card across all configured lists in reverse-workflow order:
106
- \`deploy\` → \`testing\` → \`developing\` → \`ready\` → \`refining\` → \`backlog\`.
107
- Stop as soon as a matching card is found.
108
-
109
- **If \`lists.done\` is configured:**
110
- - **Card found:** move it to \`lists.done\` and mark as complete:
111
- \`\`\`tool
112
- mcp__claude_ai_Trello_Custom__update_card { card_id: "<id>", list_id: "<lists.done.id>", dueComplete: true }
113
- \`\`\`
114
- - **No card found:** create one in \`lists.done\`:
115
- \`\`\`tool
116
- mcp__claude_ai_Trello_Custom__create_card
117
- list_id: "<lists.done.id>"
118
- name: "<human-readable change name in Portuguese>"
119
- desc: "Concluida via /ps:complete"
120
- \`\`\`
121
- Then mark it complete.
122
-
123
- Assign current user:
124
- \`\`\`tool
125
- mcp__claude_ai_Trello_Custom__get_me
126
- mcp__claude_ai_Trello_Custom__add_card_member { card_id: "<cardId>", member_id: "<me.id>" }
127
- \`\`\`
128
-
129
- Mark any checklist items as complete:
130
- \`\`\`tool
131
- mcp__claude_ai_Trello_Custom__get_card_checklists { card_id: "<cardId>" }
132
- \`\`\`
133
- For each checklist item not already complete, call:
134
- \`\`\`tool
135
- mcp__claude_ai_Trello_Custom__update_checkitem { card_id: "<cardId>", checklist_id: "<clId>", checkitem_id: "<itemId>", state: "complete" }
136
- \`\`\`
137
-
138
- Add a completion comment in Portuguese:
139
- \`\`\`tool
140
- mcp__claude_ai_Trello_Custom__add_comment
141
- card_id: "<cardId>"
142
- text: |
143
- Change concluida via /ps:complete
144
-
145
- Change: <change-name>
146
- Schema: <schema-name>
147
- Arquivada em: <archive-path>
148
- Specs: <sincronizado / sem delta specs / sync pulado>
149
- Tasks: <N>/<N> concluidas
150
-
151
- Fluxo encerrado. Nenhuma acao adicional necessaria.
152
- \`\`\`
153
-
154
- If any Trello call fails, continue — Trello is auxiliary, never blocking.
155
-
156
- 7. **Display summary**
157
-
158
- Show archive completion summary including:
159
- - Change name
160
- - Schema that was used
161
- - Archive location
162
- - Spec sync status (synced / sync skipped / no delta specs)
163
- - Note about any warnings (incomplete artifacts/tasks)
164
- - Trello: mention if card was moved to "Concluído"
165
-
166
- **Output On Success**
167
-
168
- \`\`\`
169
- ## Archive Complete
170
-
171
- **Change:** <change-name>
172
- **Schema:** <schema-name>
173
- **Archived to:** <archive-path>
174
- **Specs:** ✓ Synced to main specs
175
- **Trello:** Card moved to ✅ Concluído ← only shown if Trello is configured
176
-
177
- All artifacts complete. All tasks complete.
178
- \`\`\`
179
-
180
- **Output On Success With Warnings**
181
-
182
- \`\`\`
183
- ## Archive Complete (with warnings)
184
-
185
- **Change:** <change-name>
186
- **Schema:** <schema-name>
187
- **Archived to:** <archive-path>
188
- **Specs:** Sync skipped (user chose to skip)
189
- **Trello:** Card moved to ✅ Concluído ← only shown if Trello is configured
190
-
191
- **Warnings:**
192
- - Archived with 2 incomplete artifacts
193
- - Archived with 3 incomplete tasks
194
- - Delta spec sync was skipped
195
-
196
- Review the archive if this was not intentional.
197
- \`\`\`
198
-
199
- **Output On Error (Archive Exists)**
200
-
201
- \`\`\`
202
- ## Archive Failed
203
-
204
- **Change:** <change-name>
205
- **Target:** <archive-path>
206
-
207
- Target archive directory already exists.
208
-
209
- **Options:**
210
- 1. Rename the existing archive
211
- 2. Delete the existing archive if it's a duplicate
212
- 3. Wait until a different date to archive
213
- \`\`\`
214
-
215
- **Guardrails**
216
- - Always prompt for change selection if not provided
217
- - Use artifact graph (pscode status --json) for completion checking
218
- - Don't block archive on warnings — just inform and confirm
219
- - Preserve .pscode.yaml when moving to archive (it moves with the directory)
220
- - Show clear summary of what happened
221
- - If sync is requested, use pscode-sync-specs approach (agent-driven)
222
- - If delta specs exist, always run the sync assessment and show the combined summary before prompting
223
- - If Trello tools fail, continue normally — Trello is auxiliary, not blocking
224
- - All content written to Trello must be in Portuguese
21
+ return `Complete a change.
22
+
23
+ **Input**: Optionally specify a change name (e.g., \`/ps:complete add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
24
+
25
+ **Steps**
26
+
27
+ 1. **If no change name provided, prompt for selection**
28
+
29
+ Run \`pscode list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
30
+
31
+ Show only active changes (not already archived).
32
+ Include the schema used for each change if available.
33
+
34
+ **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
35
+
36
+ 2. **Check artifact completion status**
37
+
38
+ Run \`pscode status --change "<name>" --json\` to check artifact completion.
39
+
40
+ Parse the JSON to understand:
41
+ - \`schemaName\`: The workflow being used
42
+ - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
43
+ - \`artifacts\`: List of artifacts with their status (\`done\` or other)
44
+
45
+ If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace archive is not supported in this slice and STOP.
46
+
47
+ **If any artifacts are not \`done\`:**
48
+ - Display warning listing incomplete artifacts
49
+ - Use **AskUserQuestion tool** to confirm user wants to proceed
50
+ - Proceed if user confirms
51
+
52
+ 3. **Check task completion status**
53
+
54
+ Read the tasks file (typically \`tasks.md\`) to check for incomplete tasks.
55
+
56
+ Count tasks marked with \`- [ ]\` (incomplete) vs \`- [x]\` (complete).
57
+
58
+ **If incomplete tasks found:**
59
+ - Display warning showing count of incomplete tasks
60
+ - Use **AskUserQuestion tool** to confirm user wants to proceed
61
+ - Proceed if user confirms
62
+
63
+ **If no tasks file exists:** Proceed without task-related warning.
64
+
65
+ 4. **Assess delta spec sync state**
66
+
67
+ Use \`artifactPaths.specs.existingOutputPaths\` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
68
+
69
+ **If delta specs exist:**
70
+ - Compare each delta spec with its corresponding main spec at \`pscode/specs/<capability>/spec.md\`
71
+ - Determine what changes would be applied (adds, modifications, removals, renames)
72
+ - Show a combined summary before prompting
73
+
74
+ **Prompt options:**
75
+ - If changes needed: "Sync now (recommended)", "Archive without syncing"
76
+ - If already synced: "Archive now", "Sync anyway", "Cancel"
77
+
78
+ If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke pscode-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
79
+
80
+ 5. **Perform the archive**
81
+
82
+ Create an \`archive\` directory under \`planningHome.changesDir\` if it doesn't exist:
83
+ \`\`\`bash
84
+ mkdir -p "<planningHome.changesDir>/archive"
85
+ \`\`\`
86
+
87
+ Generate target name using current date: \`YYYY-MM-DD-<change-name>\`
88
+
89
+ **Check if target already exists:**
90
+ - If yes: Fail with error, suggest renaming existing archive or using different date
91
+ - If no: Move \`changeRoot\` to the archive directory
92
+
93
+ \`\`\`bash
94
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
95
+ \`\`\`
96
+
97
+ 6. **Trello Integration — move card to "Concluído" (optional)**
98
+
99
+ Use the **Read tool** (NOT a shell command) to read \`pscode/trello.yaml\` from the current working directory.
100
+ The Read tool is cross-platform and works on Windows, macOS, and Linux — never use \`cat\` or shell commands to read this file.
101
+ If the Read tool returns an error (file not found), skip all Trello steps.
102
+
103
+ Otherwise parse and extract \`boardId\`, \`lists.done\` (and optionally \`lists.testing\`, \`lists.deploy\`, \`lists.developing\`, \`lists.ready\`, \`lists.refining\`, \`lists.backlog\`).
104
+
105
+ Search for the change's card across all configured lists in reverse-workflow order:
106
+ \`deploy\` → \`testing\` → \`developing\` → \`ready\` → \`refining\` → \`backlog\`.
107
+ Stop as soon as a matching card is found.
108
+
109
+ **If \`lists.done\` is configured:**
110
+ - **Card found:** move it to \`lists.done\` and mark as complete:
111
+ \`\`\`tool
112
+ mcp__claude_ai_Trello_Custom__update_card { card_id: "<id>", list_id: "<lists.done.id>", dueComplete: true }
113
+ \`\`\`
114
+ - **No card found:** create one in \`lists.done\`:
115
+ \`\`\`tool
116
+ mcp__claude_ai_Trello_Custom__create_card
117
+ list_id: "<lists.done.id>"
118
+ name: "<human-readable change name in Portuguese>"
119
+ desc: "Concluida via /ps:complete"
120
+ \`\`\`
121
+ Then mark it complete.
122
+
123
+ Assign current user:
124
+ \`\`\`tool
125
+ mcp__claude_ai_Trello_Custom__get_me
126
+ mcp__claude_ai_Trello_Custom__add_card_member { card_id: "<cardId>", member_id: "<me.id>" }
127
+ \`\`\`
128
+
129
+ Mark any checklist items as complete:
130
+ \`\`\`tool
131
+ mcp__claude_ai_Trello_Custom__get_card_checklists { card_id: "<cardId>" }
132
+ \`\`\`
133
+ For each checklist item not already complete, call:
134
+ \`\`\`tool
135
+ mcp__claude_ai_Trello_Custom__update_checkitem { card_id: "<cardId>", checklist_id: "<clId>", checkitem_id: "<itemId>", state: "complete" }
136
+ \`\`\`
137
+
138
+ Add a completion comment in Portuguese:
139
+ \`\`\`tool
140
+ mcp__claude_ai_Trello_Custom__add_comment
141
+ card_id: "<cardId>"
142
+ text: |
143
+ Change concluida via /ps:complete
144
+
145
+ Change: <change-name>
146
+ Schema: <schema-name>
147
+ Arquivada em: <archive-path>
148
+ Specs: <sincronizado / sem delta specs / sync pulado>
149
+ Tasks: <N>/<N> concluidas
150
+
151
+ Fluxo encerrado. Nenhuma acao adicional necessaria.
152
+ \`\`\`
153
+
154
+ If any Trello call fails, continue — Trello is auxiliary, never blocking.
155
+
156
+ 7. **Display summary**
157
+
158
+ Show archive completion summary including:
159
+ - Change name
160
+ - Schema that was used
161
+ - Archive location
162
+ - Spec sync status (synced / sync skipped / no delta specs)
163
+ - Note about any warnings (incomplete artifacts/tasks)
164
+ - Trello: mention if card was moved to "Concluído"
165
+
166
+ **Output On Success**
167
+
168
+ \`\`\`
169
+ ## Archive Complete
170
+
171
+ **Change:** <change-name>
172
+ **Schema:** <schema-name>
173
+ **Archived to:** <archive-path>
174
+ **Specs:** ✓ Synced to main specs
175
+ **Trello:** Card moved to ✅ Concluído ← only shown if Trello is configured
176
+
177
+ All artifacts complete. All tasks complete.
178
+ \`\`\`
179
+
180
+ **Output On Success With Warnings**
181
+
182
+ \`\`\`
183
+ ## Archive Complete (with warnings)
184
+
185
+ **Change:** <change-name>
186
+ **Schema:** <schema-name>
187
+ **Archived to:** <archive-path>
188
+ **Specs:** Sync skipped (user chose to skip)
189
+ **Trello:** Card moved to ✅ Concluído ← only shown if Trello is configured
190
+
191
+ **Warnings:**
192
+ - Archived with 2 incomplete artifacts
193
+ - Archived with 3 incomplete tasks
194
+ - Delta spec sync was skipped
195
+
196
+ Review the archive if this was not intentional.
197
+ \`\`\`
198
+
199
+ **Output On Error (Archive Exists)**
200
+
201
+ \`\`\`
202
+ ## Archive Failed
203
+
204
+ **Change:** <change-name>
205
+ **Target:** <archive-path>
206
+
207
+ Target archive directory already exists.
208
+
209
+ **Options:**
210
+ 1. Rename the existing archive
211
+ 2. Delete the existing archive if it's a duplicate
212
+ 3. Wait until a different date to archive
213
+ \`\`\`
214
+
215
+ **Guardrails**
216
+ - Always prompt for change selection if not provided
217
+ - Use artifact graph (pscode status --json) for completion checking
218
+ - Don't block archive on warnings — just inform and confirm
219
+ - Preserve .pscode.yaml when moving to archive (it moves with the directory)
220
+ - Show clear summary of what happened
221
+ - If sync is requested, use pscode-sync-specs approach (agent-driven)
222
+ - If delta specs exist, always run the sync assessment and show the combined summary before prompting
223
+ - If Trello tools fail, continue normally — Trello is auxiliary, not blocking
224
+ - All content written to Trello must be in Portuguese
225
225
  `;
226
226
  }
227
227
  //# sourceMappingURL=archive-change.js.map