@thiagodiogo/pscode 2.0.0 → 2.1.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 (49) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +142 -142
  3. package/bin/pscode.js +4 -4
  4. package/dist/commands/feedback.js +4 -4
  5. package/dist/commands/schema.js +60 -60
  6. package/dist/core/collections/initiatives/templates.js +57 -57
  7. package/dist/core/command-generation/adapters/claude.js +8 -8
  8. package/dist/core/command-generation/adapters/codex.js +6 -6
  9. package/dist/core/command-generation/adapters/cursor.js +8 -8
  10. package/dist/core/command-generation/adapters/gemini.js +5 -5
  11. package/dist/core/command-generation/adapters/github-copilot.js +5 -5
  12. package/dist/core/completions/generators/bash-generator.js +41 -41
  13. package/dist/core/completions/generators/fish-generator.js +7 -7
  14. package/dist/core/completions/generators/powershell-generator.js +29 -29
  15. package/dist/core/completions/generators/zsh-generator.js +33 -33
  16. package/dist/core/completions/templates/bash-templates.js +24 -24
  17. package/dist/core/completions/templates/fish-templates.js +38 -38
  18. package/dist/core/completions/templates/powershell-templates.js +28 -28
  19. package/dist/core/completions/templates/zsh-templates.js +39 -39
  20. package/dist/core/profiles.d.ts +1 -1
  21. package/dist/core/profiles.js +1 -1
  22. package/dist/core/templates/workflows/apply-change.js +264 -264
  23. package/dist/core/templates/workflows/archive-change.js +204 -204
  24. package/dist/core/templates/workflows/bulk-archive-change.js +472 -472
  25. package/dist/core/templates/workflows/continue-change.js +214 -214
  26. package/dist/core/templates/workflows/explore.js +735 -735
  27. package/dist/core/templates/workflows/feedback.js +97 -97
  28. package/dist/core/templates/workflows/ff-change.js +180 -180
  29. package/dist/core/templates/workflows/new-change.js +123 -123
  30. package/dist/core/templates/workflows/onboard.js +584 -584
  31. package/dist/core/templates/workflows/propose.js +324 -324
  32. package/dist/core/templates/workflows/trello-draft.js +194 -194
  33. package/dist/core/templates/workflows/trello-next-step-comment.d.ts +26 -0
  34. package/dist/core/templates/workflows/trello-next-step-comment.js +58 -0
  35. package/dist/core/templates/workflows/trello-setup.js +292 -292
  36. package/dist/core/templates/workflows/verify-change.js +318 -318
  37. package/dist/core/workspace/open-surface.js +30 -30
  38. package/package.json +1 -1
  39. package/schemas/spec-driven/schema.yaml +153 -153
  40. package/schemas/spec-driven/templates/design.md +19 -19
  41. package/schemas/spec-driven/templates/proposal.md +23 -23
  42. package/schemas/spec-driven/templates/spec.md +8 -8
  43. package/schemas/spec-driven/templates/tasks.md +9 -9
  44. package/schemas/workspace-planning/schema.yaml +72 -72
  45. package/schemas/workspace-planning/templates/design.md +33 -33
  46. package/schemas/workspace-planning/templates/proposal.md +28 -28
  47. package/schemas/workspace-planning/templates/spec.md +9 -9
  48. package/schemas/workspace-planning/templates/tasks.md +15 -15
  49. package/scripts/postinstall.js +83 -83
@@ -9,298 +9,298 @@ export function getTrelloSetupSkillTemplate() {
9
9
  };
10
10
  }
11
11
  function getTrelloSetupInstructions() {
12
- return `Configure Trello integration for your Pscode workflow.
13
-
14
- This skill writes \`pscode/trello.yaml\` — a small config file that all Trello-aware commands
15
- (\`/ps:task\`, \`/ps:draft\`, \`/ps:propose\`, \`/ps:apply\`, \`/ps:archive\`) read at
16
- runtime to know which Trello list corresponds to each workflow stage and which labels are available.
17
-
18
- ---
19
-
20
- ## Step 1 — Check MCP availability
21
-
22
- Try to identify the current Trello user:
23
-
24
- \`\`\`tool
25
- mcp__claude_ai_Trello_Custom__get_me
26
- \`\`\`
27
-
28
- **If this call fails or returns an error:**
29
- > ⚠️ The Trello MCP server is not available in this session.
30
- >
31
- > To enable it, add the Trello MCP server to your Claude Code configuration:
32
- > \`\`\`
33
- > claude mcp add trello <server-url>
34
- > \`\`\`
35
- > Then restart Claude Code and re-run \`/ps:trello-setup\`.
36
-
37
- Stop here if MCP is unavailable.
38
-
39
- ---
40
-
41
- ## Step 2 — Read existing config
42
-
43
- Use the **Read tool** (NOT a shell command) to read \`pscode/trello.yaml\` from the current working directory.
44
- The Read tool is cross-platform and works on Windows, macOS, and Linux — never use \`cat\` or shell commands to read this file.
45
- If the Read tool returns an error (file not found), treat it as state C (no config).
46
-
47
- Parse the file content. Three possible states:
48
-
49
- ### A) \`configured: true\` — already fully configured
50
- Display the current configuration and ask: "Reconfigurar a integração Trello?" (Sim / Não).
51
- If "Não", stop here.
52
-
53
- ### B) \`configured: false\` — partial config saved by \`pscode init\`
54
-
55
- This means the user already answered the preference questions in the CLI.
56
- Extract the following fields:
57
- - \`hasExistingBoard\` → bool
58
- - \`boardId\` → string (only if hasExistingBoard = true)
59
- - \`stages\` → array of selected stage keys
60
- - \`stageNames\` → map of stage key → display name
61
- - \`labels\` → \`{ enabled: bool, selected?: string[] }\`
62
-
63
- Display:
64
- \`\`\`
65
- ## Continuando configuração do Trello
66
-
67
- Detectei preferências salvas durante o \`pscode init\`:
68
-
69
- Quadro existente: <Sim/Não>
70
- \${hasExistingBoard ? 'Board ID: <boardId>' : 'Criar novo quadro'}
71
- Estágios selecionados: <stage1>, <stage2>, ...
72
- Labels: \${labels?.enabled ? (labels.selected ?? ['bug','implementacao','melhoria','debito-tecnico']).join(', ') : 'desativadas'}
73
-
74
- ✓ Pulando perguntas já respondidas — indo direto para conexão das listas.
75
- \`\`\`
76
-
77
- Skip Steps 3A/3B and go directly to **Step 3C** (connect lists for existing board)
78
- or **Step 3D** (create board for new board).
79
- Then proceed to **Step 3E** (create labels) if \`labels.enabled = true\`.
80
-
81
- ### C) "NO_CONFIG" — fresh setup, no preferences saved yet
82
-
83
- Proceed to Step 3 normally (full interactive flow).
84
-
85
- ---
86
-
87
- ## Step 3 — Select or create board
88
-
89
- **(Skip this step if partial config was found in Step 2B)**
90
-
91
- Use **AskUserQuestion** to ask:
92
-
93
- > "Você já tem um quadro Trello configurado com as colunas do seu fluxo?"
94
- > - Sim, já tenho um quadro
95
- > - Não, quero criar um novo quadro
96
-
97
- Then ask which columns the user wants using **AskUserQuestion** with \`multiSelect: true\`:
98
-
99
- | Estágio | Coluna sugerida |
100
- |------------|------------------------|
101
- | backlog ✱ | 📋 Backlog |
102
- | refining | 🔍 Em Refinamento |
103
- | ready | ✅ Ready to Dev |
104
- | developing | 🚧 Em Desenvolvimento |
105
- | testing | 🧪 Em Teste |
106
- | deploy | 🚀 Ready to Deploy |
107
- | done ✱ | ✅ Concluído |
108
- | cancelled | ❌ Cancelado |
109
-
110
- *(✱ = obrigatório)*
111
-
112
- At minimum, require **backlog** and **done**.
113
-
114
- Optionally ask for custom column names.
115
-
116
- Then ask about labels using **AskUserQuestion**:
117
- > "Deseja usar labels/etiquetas para categorizar os cards automaticamente?"
118
- > - Sim — o agente analisa o contexto e aplica a label correta (BUG, IMPLEMENTAÇÃO, MELHORIA, DÉBITO TÉCNICO)
119
- > - Não — sem labels
120
-
121
- If "Sim", ask which labels to enable (multiSelect):
122
- - 🐛 BUG — Erro ou comportamento incorreto
123
- - ⚙️ IMPLEMENTAÇÃO — Nova funcionalidade desenvolvida do zero
124
- - ✨ MELHORIA — Aperfeiçoamento ou otimização de algo existente
125
- - 💳 DÉBITO TÉCNICO — Refatoração, limpeza de código ou resolução de dívida técnica
126
-
127
- Save the chosen label keys as \`labelsToCreate\` (defaults: all four if none unchecked).
128
-
129
- ---
130
-
131
- ## Step 3C — Connect lists for existing board
132
-
133
- **(Used when \`hasExistingBoard: true\`, whether from CLI init or this step)**
134
-
135
- 1. Fetch the lists of the board:
136
- \`\`\`tool
137
- mcp__claude_ai_Trello_Custom__get_lists { board_id: "<boardId>" }
138
- \`\`\`
139
-
140
- 2. For each selected stage, use **AskUserQuestion** to let the user match a Trello list.
141
- Show the lists returned above. Group the questions:
142
- - Group 1 (discovery): backlog, refining
143
- - Group 2 (execution): ready, developing, testing
144
- - Group 3 (closure): deploy, done, cancelled
145
-
146
- For stages the user doesn't want to map, let them choose "Não usar este estágio".
147
-
148
- ---
149
-
150
- ## Step 3D — Create new board
151
-
152
- **(Used when \`hasExistingBoard: false\`)**
153
-
154
- 1. Use **AskUserQuestion** to ask for a board name
155
- (default: "Pscode — <project-name inferred from directory>").
156
-
157
- 2. Create the Trello board:
158
- \`\`\`tool
159
- mcp__claude_ai_Trello_Custom__create_board { name: "<boardName>" }
160
- \`\`\`
161
- Save \`board.id\` as \`boardId\`.
162
-
163
- 3. Fetch the auto-created lists and archive them:
164
- \`\`\`tool
165
- mcp__claude_ai_Trello_Custom__get_lists { board_id: "<boardId>" }
166
- \`\`\`
167
- For each auto-created list:
168
- \`\`\`tool
169
- mcp__claude_ai_Trello_Custom__archive_list { list_id: "<id>" }
170
- \`\`\`
171
-
172
- 4. Create the workflow lists in order (one \`create_list\` call per selected stage):
173
- \`\`\`tool
174
- mcp__claude_ai_Trello_Custom__create_list { board_id: "<boardId>", name: "<stageName>", pos: "bottom" }
175
- \`\`\`
176
- Save each returned \`id\` mapped to its stage key.
177
-
178
- ---
179
-
180
- ## Step 3E — Create labels on the board
181
-
182
- **(Run after Step 3C or 3D, only if labels are enabled)**
183
-
184
- The canonical label definitions are:
185
-
186
- | Chave | Nome | Cor |
187
- |-----------------|-----------------|--------|
188
- | bug | BUG | red |
189
- | implementacao | IMPLEMENTAÇÃO | blue |
190
- | melhoria | MELHORIA | green |
191
- | debito-tecnico | DÉBITO TÉCNICO | orange |
192
-
193
- **For each label key in \`labelsToCreate\`:**
194
-
195
- 1. First, check existing labels on the board to avoid duplicates:
196
- \`\`\`tool
197
- mcp__claude_ai_Trello_Custom__get_board_labels { board_id: "<boardId>" }
198
- \`\`\`
199
-
200
- 2. For each label key that does NOT already exist (match by name, case-insensitive):
201
- \`\`\`tool
202
- mcp__claude_ai_Trello_Custom__create_label { board_id: "<boardId>", name: "<name>", color: "<color>" }
203
- \`\`\`
204
-
205
- 3. Collect and save each label: \`{ id: "<returnedId>", name: "<name>", color: "<color>" }\`
206
- If the label already existed, use its existing \`id\` and \`color\`.
207
-
208
- If any \`create_label\` call fails, log the error and continue — labels are auxiliary, never blocking.
209
-
210
- ---
211
-
212
- ## Step 4 — Write final configuration
213
-
214
- Assemble and write \`pscode/trello.yaml\` with \`configured: true\`.
215
-
216
- Use the **Write tool** (NOT a shell command) to write the file — it is cross-platform and works on Windows, macOS, and Linux.
217
-
218
- **Full YAML structure when labels are enabled:**
219
-
220
- \`\`\`yaml
221
- configured: true
222
- boardId: "<boardId>"
223
- boardName: "<boardName>"
224
- lists:
225
- backlog:
226
- id: "<id>"
227
- name: "<name>"
228
- # ... only the stages that were mapped
229
- labels:
230
- enabled: true
231
- items:
232
- bug:
233
- id: "<labelId>"
234
- name: "BUG"
235
- color: "red"
236
- implementacao:
237
- id: "<labelId>"
238
- name: "IMPLEMENTAÇÃO"
239
- color: "blue"
240
- melhoria:
241
- id: "<labelId>"
242
- name: "MELHORIA"
243
- color: "green"
244
- debito-tecnico:
245
- id: "<labelId>"
246
- name: "DÉBITO TÉCNICO"
247
- color: "orange"
248
- \`\`\`
249
-
250
- **When labels are disabled:**
251
-
252
- \`\`\`yaml
253
- configured: true
254
- boardId: "<boardId>"
255
- boardName: "<boardName>"
256
- lists:
257
- # ...
258
- labels:
259
- enabled: false
260
- \`\`\`
261
-
262
- ---
263
-
264
- ## Step 5 — Confirm and summarize
265
-
266
- \`\`\`
267
- ## ✅ Trello configurado com sucesso!
268
-
269
- **Board:** <boardName>
270
- **Arquivo:** pscode/trello.yaml
271
-
272
- **Estágios configurados:**
273
- 📋 backlog → <name>
274
- ...
275
-
276
- **Labels configuradas:** ← apenas se labels.enabled = true
277
- 🐛 BUG
278
- ⚙️ IMPLEMENTAÇÃO
279
- ✨ MELHORIA
280
- 💳 DÉBITO TÉCNICO
281
-
282
- A partir de agora, todos os comandos Pscode irão sincronizar cards automaticamente.
283
- O agente irá tentar categorizar cada card com a label adequada ao criá-lo.
284
-
285
- **Próximos passos:**
286
- /ps:draft → Registrar uma ideia no Backlog (frictionless)
287
- /ps:task → Adicionar tarefa ao Backlog
288
- /ps:propose → Propor uma change (cria card no Trello)
289
- \`\`\`
290
-
291
- ---
292
-
293
- ## Guardrails
294
-
295
- - **Nunca prosseguir sem MCP** — se o Trello MCP não estiver disponível, parar e orientar
296
- - **Backlog e done são obrigatórios** — não permitir configuração sem esses dois estágios
297
- - **Nunca deletar cards ou listas existentes** — ao criar board, apenas arquivar as listas padrão
298
- - **Se partial config encontrada** (\`configured: false\`), pular as perguntas já respondidas e mencionar isso ao usuário
299
- - **Todos os nomes em português** por padrão, respeitando o que o usuário escolheu no init
300
- - **Se qualquer chamada MCP falhar**, exibir o erro e perguntar se deseja tentar novamente
301
- - **Não sobrescrever config \`configured: true\` sem confirmação explícita**
302
- - **Labels são opcionais** — se criação de label falhar, continuar normalmente sem labels
303
- - **Não duplicar labels** — verificar labels existentes no board antes de criar novas
12
+ return `Configure Trello integration for your Pscode workflow.
13
+
14
+ This skill writes \`pscode/trello.yaml\` — a small config file that all Trello-aware commands
15
+ (\`/ps:task\`, \`/ps:draft\`, \`/ps:propose\`, \`/ps:apply\`, \`/ps:archive\`) read at
16
+ runtime to know which Trello list corresponds to each workflow stage and which labels are available.
17
+
18
+ ---
19
+
20
+ ## Step 1 — Check MCP availability
21
+
22
+ Try to identify the current Trello user:
23
+
24
+ \`\`\`tool
25
+ mcp__claude_ai_Trello_Custom__get_me
26
+ \`\`\`
27
+
28
+ **If this call fails or returns an error:**
29
+ > ⚠️ The Trello MCP server is not available in this session.
30
+ >
31
+ > To enable it, add the Trello MCP server to your Claude Code configuration:
32
+ > \`\`\`
33
+ > claude mcp add trello <server-url>
34
+ > \`\`\`
35
+ > Then restart Claude Code and re-run \`/ps:trello-setup\`.
36
+
37
+ Stop here if MCP is unavailable.
38
+
39
+ ---
40
+
41
+ ## Step 2 — Read existing config
42
+
43
+ Use the **Read tool** (NOT a shell command) to read \`pscode/trello.yaml\` from the current working directory.
44
+ The Read tool is cross-platform and works on Windows, macOS, and Linux — never use \`cat\` or shell commands to read this file.
45
+ If the Read tool returns an error (file not found), treat it as state C (no config).
46
+
47
+ Parse the file content. Three possible states:
48
+
49
+ ### A) \`configured: true\` — already fully configured
50
+ Display the current configuration and ask: "Reconfigurar a integração Trello?" (Sim / Não).
51
+ If "Não", stop here.
52
+
53
+ ### B) \`configured: false\` — partial config saved by \`pscode init\`
54
+
55
+ This means the user already answered the preference questions in the CLI.
56
+ Extract the following fields:
57
+ - \`hasExistingBoard\` → bool
58
+ - \`boardId\` → string (only if hasExistingBoard = true)
59
+ - \`stages\` → array of selected stage keys
60
+ - \`stageNames\` → map of stage key → display name
61
+ - \`labels\` → \`{ enabled: bool, selected?: string[] }\`
62
+
63
+ Display:
64
+ \`\`\`
65
+ ## Continuando configuração do Trello
66
+
67
+ Detectei preferências salvas durante o \`pscode init\`:
68
+
69
+ Quadro existente: <Sim/Não>
70
+ \${hasExistingBoard ? 'Board ID: <boardId>' : 'Criar novo quadro'}
71
+ Estágios selecionados: <stage1>, <stage2>, ...
72
+ Labels: \${labels?.enabled ? (labels.selected ?? ['bug','implementacao','melhoria','debito-tecnico']).join(', ') : 'desativadas'}
73
+
74
+ ✓ Pulando perguntas já respondidas — indo direto para conexão das listas.
75
+ \`\`\`
76
+
77
+ Skip Steps 3A/3B and go directly to **Step 3C** (connect lists for existing board)
78
+ or **Step 3D** (create board for new board).
79
+ Then proceed to **Step 3E** (create labels) if \`labels.enabled = true\`.
80
+
81
+ ### C) "NO_CONFIG" — fresh setup, no preferences saved yet
82
+
83
+ Proceed to Step 3 normally (full interactive flow).
84
+
85
+ ---
86
+
87
+ ## Step 3 — Select or create board
88
+
89
+ **(Skip this step if partial config was found in Step 2B)**
90
+
91
+ Use **AskUserQuestion** to ask:
92
+
93
+ > "Você já tem um quadro Trello configurado com as colunas do seu fluxo?"
94
+ > - Sim, já tenho um quadro
95
+ > - Não, quero criar um novo quadro
96
+
97
+ Then ask which columns the user wants using **AskUserQuestion** with \`multiSelect: true\`:
98
+
99
+ | Estágio | Coluna sugerida |
100
+ |------------|------------------------|
101
+ | backlog ✱ | 📋 Backlog |
102
+ | refining | 🔍 Em Refinamento |
103
+ | ready | ✅ Ready to Dev |
104
+ | developing | 🚧 Em Desenvolvimento |
105
+ | testing | 🧪 Em Teste |
106
+ | deploy | 🚀 Ready to Deploy |
107
+ | done ✱ | ✅ Concluído |
108
+ | cancelled | ❌ Cancelado |
109
+
110
+ *(✱ = obrigatório)*
111
+
112
+ At minimum, require **backlog** and **done**.
113
+
114
+ Optionally ask for custom column names.
115
+
116
+ Then ask about labels using **AskUserQuestion**:
117
+ > "Deseja usar labels/etiquetas para categorizar os cards automaticamente?"
118
+ > - Sim — o agente analisa o contexto e aplica a label correta (BUG, IMPLEMENTAÇÃO, MELHORIA, DÉBITO TÉCNICO)
119
+ > - Não — sem labels
120
+
121
+ If "Sim", ask which labels to enable (multiSelect):
122
+ - 🐛 BUG — Erro ou comportamento incorreto
123
+ - ⚙️ IMPLEMENTAÇÃO — Nova funcionalidade desenvolvida do zero
124
+ - ✨ MELHORIA — Aperfeiçoamento ou otimização de algo existente
125
+ - 💳 DÉBITO TÉCNICO — Refatoração, limpeza de código ou resolução de dívida técnica
126
+
127
+ Save the chosen label keys as \`labelsToCreate\` (defaults: all four if none unchecked).
128
+
129
+ ---
130
+
131
+ ## Step 3C — Connect lists for existing board
132
+
133
+ **(Used when \`hasExistingBoard: true\`, whether from CLI init or this step)**
134
+
135
+ 1. Fetch the lists of the board:
136
+ \`\`\`tool
137
+ mcp__claude_ai_Trello_Custom__get_lists { board_id: "<boardId>" }
138
+ \`\`\`
139
+
140
+ 2. For each selected stage, use **AskUserQuestion** to let the user match a Trello list.
141
+ Show the lists returned above. Group the questions:
142
+ - Group 1 (discovery): backlog, refining
143
+ - Group 2 (execution): ready, developing, testing
144
+ - Group 3 (closure): deploy, done, cancelled
145
+
146
+ For stages the user doesn't want to map, let them choose "Não usar este estágio".
147
+
148
+ ---
149
+
150
+ ## Step 3D — Create new board
151
+
152
+ **(Used when \`hasExistingBoard: false\`)**
153
+
154
+ 1. Use **AskUserQuestion** to ask for a board name
155
+ (default: "Pscode — <project-name inferred from directory>").
156
+
157
+ 2. Create the Trello board:
158
+ \`\`\`tool
159
+ mcp__claude_ai_Trello_Custom__create_board { name: "<boardName>" }
160
+ \`\`\`
161
+ Save \`board.id\` as \`boardId\`.
162
+
163
+ 3. Fetch the auto-created lists and archive them:
164
+ \`\`\`tool
165
+ mcp__claude_ai_Trello_Custom__get_lists { board_id: "<boardId>" }
166
+ \`\`\`
167
+ For each auto-created list:
168
+ \`\`\`tool
169
+ mcp__claude_ai_Trello_Custom__archive_list { list_id: "<id>" }
170
+ \`\`\`
171
+
172
+ 4. Create the workflow lists in order (one \`create_list\` call per selected stage):
173
+ \`\`\`tool
174
+ mcp__claude_ai_Trello_Custom__create_list { board_id: "<boardId>", name: "<stageName>", pos: "bottom" }
175
+ \`\`\`
176
+ Save each returned \`id\` mapped to its stage key.
177
+
178
+ ---
179
+
180
+ ## Step 3E — Create labels on the board
181
+
182
+ **(Run after Step 3C or 3D, only if labels are enabled)**
183
+
184
+ The canonical label definitions are:
185
+
186
+ | Chave | Nome | Cor |
187
+ |-----------------|-----------------|--------|
188
+ | bug | BUG | red |
189
+ | implementacao | IMPLEMENTAÇÃO | blue |
190
+ | melhoria | MELHORIA | green |
191
+ | debito-tecnico | DÉBITO TÉCNICO | orange |
192
+
193
+ **For each label key in \`labelsToCreate\`:**
194
+
195
+ 1. First, check existing labels on the board to avoid duplicates:
196
+ \`\`\`tool
197
+ mcp__claude_ai_Trello_Custom__get_board_labels { board_id: "<boardId>" }
198
+ \`\`\`
199
+
200
+ 2. For each label key that does NOT already exist (match by name, case-insensitive):
201
+ \`\`\`tool
202
+ mcp__claude_ai_Trello_Custom__create_label { board_id: "<boardId>", name: "<name>", color: "<color>" }
203
+ \`\`\`
204
+
205
+ 3. Collect and save each label: \`{ id: "<returnedId>", name: "<name>", color: "<color>" }\`
206
+ If the label already existed, use its existing \`id\` and \`color\`.
207
+
208
+ If any \`create_label\` call fails, log the error and continue — labels are auxiliary, never blocking.
209
+
210
+ ---
211
+
212
+ ## Step 4 — Write final configuration
213
+
214
+ Assemble and write \`pscode/trello.yaml\` with \`configured: true\`.
215
+
216
+ Use the **Write tool** (NOT a shell command) to write the file — it is cross-platform and works on Windows, macOS, and Linux.
217
+
218
+ **Full YAML structure when labels are enabled:**
219
+
220
+ \`\`\`yaml
221
+ configured: true
222
+ boardId: "<boardId>"
223
+ boardName: "<boardName>"
224
+ lists:
225
+ backlog:
226
+ id: "<id>"
227
+ name: "<name>"
228
+ # ... only the stages that were mapped
229
+ labels:
230
+ enabled: true
231
+ items:
232
+ bug:
233
+ id: "<labelId>"
234
+ name: "BUG"
235
+ color: "red"
236
+ implementacao:
237
+ id: "<labelId>"
238
+ name: "IMPLEMENTAÇÃO"
239
+ color: "blue"
240
+ melhoria:
241
+ id: "<labelId>"
242
+ name: "MELHORIA"
243
+ color: "green"
244
+ debito-tecnico:
245
+ id: "<labelId>"
246
+ name: "DÉBITO TÉCNICO"
247
+ color: "orange"
248
+ \`\`\`
249
+
250
+ **When labels are disabled:**
251
+
252
+ \`\`\`yaml
253
+ configured: true
254
+ boardId: "<boardId>"
255
+ boardName: "<boardName>"
256
+ lists:
257
+ # ...
258
+ labels:
259
+ enabled: false
260
+ \`\`\`
261
+
262
+ ---
263
+
264
+ ## Step 5 — Confirm and summarize
265
+
266
+ \`\`\`
267
+ ## ✅ Trello configurado com sucesso!
268
+
269
+ **Board:** <boardName>
270
+ **Arquivo:** pscode/trello.yaml
271
+
272
+ **Estágios configurados:**
273
+ 📋 backlog → <name>
274
+ ...
275
+
276
+ **Labels configuradas:** ← apenas se labels.enabled = true
277
+ 🐛 BUG
278
+ ⚙️ IMPLEMENTAÇÃO
279
+ ✨ MELHORIA
280
+ 💳 DÉBITO TÉCNICO
281
+
282
+ A partir de agora, todos os comandos Pscode irão sincronizar cards automaticamente.
283
+ O agente irá tentar categorizar cada card com a label adequada ao criá-lo.
284
+
285
+ **Próximos passos:**
286
+ /ps:draft → Registrar uma ideia no Backlog (frictionless)
287
+ /ps:task → Adicionar tarefa ao Backlog
288
+ /ps:propose → Propor uma change (cria card no Trello)
289
+ \`\`\`
290
+
291
+ ---
292
+
293
+ ## Guardrails
294
+
295
+ - **Nunca prosseguir sem MCP** — se o Trello MCP não estiver disponível, parar e orientar
296
+ - **Backlog e done são obrigatórios** — não permitir configuração sem esses dois estágios
297
+ - **Nunca deletar cards ou listas existentes** — ao criar board, apenas arquivar as listas padrão
298
+ - **Se partial config encontrada** (\`configured: false\`), pular as perguntas já respondidas e mencionar isso ao usuário
299
+ - **Todos os nomes em português** por padrão, respeitando o que o usuário escolheu no init
300
+ - **Se qualquer chamada MCP falhar**, exibir o erro e perguntar se deseja tentar novamente
301
+ - **Não sobrescrever config \`configured: true\` sem confirmação explícita**
302
+ - **Labels são opcionais** — se criação de label falhar, continuar normalmente sem labels
303
+ - **Não duplicar labels** — verificar labels existentes no board antes de criar novas
304
304
  `;
305
305
  }
306
306
  export function getTrelloSetupCommandTemplate() {