@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,200 +9,200 @@ export function getTrelloDraftSkillTemplate() {
9
9
  };
10
10
  }
11
11
  function getTrelloDraftInstructions() {
12
- return `Capture uma ideia ou conceito bruto diretamente no Backlog do Trello.
13
-
14
- **Input**: Texto após \`/ps:draft\` é a descrição da ideia (pode ser bem rascunho — palavras soltas, fragmentos, intuições vagas).
15
- Se omitido, perguntar ao usuário.
16
-
17
- Este comando é intencionalmente sem atrito. Diferente de \`/ps:task\`, faz estruturação mínima — o objetivo é velocidade de captura, não clareza.
18
-
19
- ---
20
-
21
- ## Step 1 — Read Trello config
22
-
23
- Use the **Read tool** (NOT a shell command) to read \`pscode/trello.yaml\` from the current working directory.
24
- The Read tool is cross-platform and works on Windows, macOS, and Linux — never use \`cat\` or shell commands to read this file.
25
- If the Read tool returns an error (file not found), treat it as "NO_TRELLO_CONFIG".
26
-
27
- **If file not found:**
28
- > ⚠️ Trello não está configurado neste projeto.
29
- > Execute \`/ps:trello-setup\` para configurar a integração antes de usar este comando.
30
-
31
- Stop here if no config.
32
-
33
- Parse the YAML and extract:
34
- - \`boardId\`
35
- - \`lists.backlog.id\` → the list where the card will be created
36
- - \`lists.backlog.name\` → for display purposes
37
- - \`labels\` → \`{ enabled: bool, items?: { bug, implementacao, melhoria, debito-tecnico } }\`
38
-
39
- **If \`lists.backlog\` is not configured:**
40
- > ⚠️ Estágio "backlog" não está configurado em \`pscode/trello.yaml\`.
41
- >
42
- > Execute \`/ps:trello-setup\` para configurar a integração.
43
-
44
- Stop here if backlog list is missing.
45
-
46
- ---
47
-
48
- ## Step 2 — Collect the idea
49
-
50
- If the user provided text, use it as-is.
51
-
52
- If nothing was provided, use **AskUserQuestion** to ask:
53
- > "Qual ideia você quer registrar? (pode ser bem rascunho mesmo)"
54
-
55
- ---
56
-
57
- ## Step 3 — Minimal structuring
58
-
59
- Apply only light formatting. Do NOT over-engineer — this is a draft.
60
-
61
- Produce:
62
-
63
- **a. \`title\`** — The idea in up to ~80 chars, starting with a noun or verb.
64
- - Keep the user's original wording as much as possible
65
- - **No emojis** in the title
66
-
67
- **b. \`context\`** (optional, 1–2 sentences max) — Only add if there's obvious project context to attach.
68
- If the idea is self-contained or opaque, leave blank.
69
-
70
- ---
71
-
72
- ## Step 4 — Detect label (if labels enabled)
73
-
74
- **Only run this step if \`labels.enabled = true\` and \`labels.items\` is present in config.**
75
-
76
- Analyze the idea text and title to determine which label best fits.
77
- Use these classification rules:
78
-
79
- | Label | Quando usar |
80
- |-----------------|-----------------------------------------------------------------------------|
81
- | 🐛 BUG | Menciona erro, falha, bug, quebrado, não funciona, comportamento errado |
82
- | ⚙️ IMPLEMENTAÇÃO | Nova feature, adicionar, criar, implementar algo que não existe ainda |
83
- | ✨ MELHORIA | Melhorar, otimizar, refinar, aprimorar algo que já existe |
84
- | 💳 DÉBITO TÉCNICO | Refatorar, limpar, reorganizar, remover código legado, dívida técnica |
85
-
86
- **Decision logic:**
87
-
88
- 1. If the idea clearly matches one label with high confidence (>80%) → use it silently, without asking.
89
- 2. If the idea is ambiguous or could fit 2+ labels → use **AskUserQuestion** to ask:
90
- > "Que tipo de card é esse?"
91
- > - 🐛 BUG — Erro ou comportamento incorreto
92
- > - ⚙️ IMPLEMENTAÇÃO — Nova funcionalidade
93
- > - ✨ MELHORIA — Aperfeiçoamento de algo existente
94
- > - 💳 DÉBITO TÉCNICO — Refatoração e limpeza de código
95
- > - Sem label — Não categorizar
96
-
97
- 3. If the label key chosen is not in \`labels.items\` (user may have configured a subset), skip labeling.
98
-
99
- Save the resolved label as \`chosenLabel\` (or \`null\` if no label applies or user chose "Sem label").
100
-
101
- ---
102
-
103
- ## Step 5 — Assemble the card description
104
-
105
- **No emojis anywhere in the description.**
106
-
107
- If context is present:
108
- \`\`\`
109
- <context>
110
-
111
- ---
112
- Ideia original: "<raw input verbatim>"
113
-
114
- Proximo passo: /ps:propose para refinar e gerar os artefatos da change.
115
- \`\`\`
116
-
117
- If no context:
118
- \`\`\`
119
- Ideia original: "<raw input verbatim>"
120
-
121
- Proximo passo: /ps:propose para refinar e gerar os artefatos da change.
122
- \`\`\`
123
-
124
- ---
125
-
126
- ## Step 6 — Create the card
127
-
128
- \`\`\`tool
129
- mcp__claude_ai_Trello_Custom__create_card
130
- list_id: "<lists.backlog.id>"
131
- name: "<title>"
132
- desc: "<assembled description>"
133
- \`\`\`
134
-
135
- **Do NOT assign any member.**
136
-
137
- Save the returned card \`id\` as \`cardId\` and \`url\` as \`cardUrl\`.
138
-
139
- ---
140
-
141
- ## Step 7 — Add next-step comment
142
-
143
- Add a comment to the card with the command to take this task to the next stage,
144
- formatted in Markdown so it is easy to copy and paste.
145
-
146
- \`\`\`tool
147
- mcp__claude_ai_Trello_Custom__add_comment
148
- card_id: "<cardId>"
149
- text: |
150
- ## Próximo passo
151
-
152
- Para refinar e gerar os artefatos da change, rode:
153
-
154
- \`\`\`
155
- /ps:propose
156
- \`\`\`
157
- \`\`\`
158
-
159
- If this call fails, log the error and continue — the comment is auxiliary, never blocking.
160
-
161
- ---
162
-
163
- ## Step 8 — Apply label (if resolved)
164
-
165
- **Only if \`chosenLabel\` is not null:**
166
-
167
- \`\`\`tool
168
- mcp__claude_ai_Trello_Custom__add_label_to_card
169
- card_id: "<cardId>"
170
- label_id: "<chosenLabel.id>"
171
- \`\`\`
172
-
173
- If this call fails, log the error and continue — label is auxiliary, never blocking.
174
-
175
- ---
176
-
177
- ## Step 9 — Show summary
178
-
179
- \`\`\`
180
- ## Ideia registrada ✓
181
-
182
- **Título:** <title>
183
- **Lista:** <lists.backlog.name>
184
- **Label:** <chosenLabel emoji + name> (ou "sem label" se não aplicada)
185
- **Card:** <cardUrl>
186
-
187
- Comando da próxima etapa adicionado nos comentários do card.
188
- Sem responsável atribuído.
189
- Quando quiser refinar: \`/ps:explore\` ou \`/ps:task\`
190
- Quando quiser propor diretamente: \`/ps:propose\`
191
- \`\`\`
192
-
193
- ---
194
-
195
- ## Guardrails
196
-
197
- - **Mínima intervenção** — o valor deste comando é a velocidade de captura; não refinar demais
198
- - **Preservar o texto original** verbatim na descrição
199
- - **Nunca atribuir membro** — cards de draft são sempre sem dono
200
- - **Nunca criar change** (\`pscode new change\`) — este comando é apenas Trello
201
- - **Se MCP falhar**, exibir o conteúdo no chat para registro manual
202
- - **Título em português** por padrão, mas se o usuário escreveu em inglês, manter em inglês
203
- - **Labels são opcionais** — se \`labels.enabled = false\` ou o call MCP falhar, continuar sem label
204
- - **Comentário com o comando da próxima etapa é auxiliar** — se o MCP falhar ao comentar, não bloquear a criação do card
205
- - **Perguntar sobre label apenas quando ambíguo** — para ideias claras, classificar silenciosamente
12
+ return `Capture uma ideia ou conceito bruto diretamente no Backlog do Trello.
13
+
14
+ **Input**: Texto após \`/ps:draft\` é a descrição da ideia (pode ser bem rascunho — palavras soltas, fragmentos, intuições vagas).
15
+ Se omitido, perguntar ao usuário.
16
+
17
+ Este comando é intencionalmente sem atrito. Diferente de \`/ps:task\`, faz estruturação mínima — o objetivo é velocidade de captura, não clareza.
18
+
19
+ ---
20
+
21
+ ## Step 1 — Read Trello config
22
+
23
+ Use the **Read tool** (NOT a shell command) to read \`pscode/trello.yaml\` from the current working directory.
24
+ The Read tool is cross-platform and works on Windows, macOS, and Linux — never use \`cat\` or shell commands to read this file.
25
+ If the Read tool returns an error (file not found), treat it as "NO_TRELLO_CONFIG".
26
+
27
+ **If file not found:**
28
+ > ⚠️ Trello não está configurado neste projeto.
29
+ > Execute \`/ps:trello-setup\` para configurar a integração antes de usar este comando.
30
+
31
+ Stop here if no config.
32
+
33
+ Parse the YAML and extract:
34
+ - \`boardId\`
35
+ - \`lists.backlog.id\` → the list where the card will be created
36
+ - \`lists.backlog.name\` → for display purposes
37
+ - \`labels\` → \`{ enabled: bool, items?: { bug, implementacao, melhoria, debito-tecnico } }\`
38
+
39
+ **If \`lists.backlog\` is not configured:**
40
+ > ⚠️ Estágio "backlog" não está configurado em \`pscode/trello.yaml\`.
41
+ >
42
+ > Execute \`/ps:trello-setup\` para configurar a integração.
43
+
44
+ Stop here if backlog list is missing.
45
+
46
+ ---
47
+
48
+ ## Step 2 — Collect the idea
49
+
50
+ If the user provided text, use it as-is.
51
+
52
+ If nothing was provided, use **AskUserQuestion** to ask:
53
+ > "Qual ideia você quer registrar? (pode ser bem rascunho mesmo)"
54
+
55
+ ---
56
+
57
+ ## Step 3 — Minimal structuring
58
+
59
+ Apply only light formatting. Do NOT over-engineer — this is a draft.
60
+
61
+ Produce:
62
+
63
+ **a. \`title\`** — The idea in up to ~80 chars, starting with a noun or verb.
64
+ - Keep the user's original wording as much as possible
65
+ - **No emojis** in the title
66
+
67
+ **b. \`context\`** (optional, 1–2 sentences max) — Only add if there's obvious project context to attach.
68
+ If the idea is self-contained or opaque, leave blank.
69
+
70
+ ---
71
+
72
+ ## Step 4 — Detect label (if labels enabled)
73
+
74
+ **Only run this step if \`labels.enabled = true\` and \`labels.items\` is present in config.**
75
+
76
+ Analyze the idea text and title to determine which label best fits.
77
+ Use these classification rules:
78
+
79
+ | Label | Quando usar |
80
+ |-----------------|-----------------------------------------------------------------------------|
81
+ | 🐛 BUG | Menciona erro, falha, bug, quebrado, não funciona, comportamento errado |
82
+ | ⚙️ IMPLEMENTAÇÃO | Nova feature, adicionar, criar, implementar algo que não existe ainda |
83
+ | ✨ MELHORIA | Melhorar, otimizar, refinar, aprimorar algo que já existe |
84
+ | 💳 DÉBITO TÉCNICO | Refatorar, limpar, reorganizar, remover código legado, dívida técnica |
85
+
86
+ **Decision logic:**
87
+
88
+ 1. If the idea clearly matches one label with high confidence (>80%) → use it silently, without asking.
89
+ 2. If the idea is ambiguous or could fit 2+ labels → use **AskUserQuestion** to ask:
90
+ > "Que tipo de card é esse?"
91
+ > - 🐛 BUG — Erro ou comportamento incorreto
92
+ > - ⚙️ IMPLEMENTAÇÃO — Nova funcionalidade
93
+ > - ✨ MELHORIA — Aperfeiçoamento de algo existente
94
+ > - 💳 DÉBITO TÉCNICO — Refatoração e limpeza de código
95
+ > - Sem label — Não categorizar
96
+
97
+ 3. If the label key chosen is not in \`labels.items\` (user may have configured a subset), skip labeling.
98
+
99
+ Save the resolved label as \`chosenLabel\` (or \`null\` if no label applies or user chose "Sem label").
100
+
101
+ ---
102
+
103
+ ## Step 5 — Assemble the card description
104
+
105
+ **No emojis anywhere in the description.**
106
+
107
+ If context is present:
108
+ \`\`\`
109
+ <context>
110
+
111
+ ---
112
+ Ideia original: "<raw input verbatim>"
113
+
114
+ Proximo passo: /ps:propose para refinar e gerar os artefatos da change.
115
+ \`\`\`
116
+
117
+ If no context:
118
+ \`\`\`
119
+ Ideia original: "<raw input verbatim>"
120
+
121
+ Proximo passo: /ps:propose para refinar e gerar os artefatos da change.
122
+ \`\`\`
123
+
124
+ ---
125
+
126
+ ## Step 6 — Create the card
127
+
128
+ \`\`\`tool
129
+ mcp__claude_ai_Trello_Custom__create_card
130
+ list_id: "<lists.backlog.id>"
131
+ name: "<title>"
132
+ desc: "<assembled description>"
133
+ \`\`\`
134
+
135
+ **Do NOT assign any member.**
136
+
137
+ Save the returned card \`id\` as \`cardId\` and \`url\` as \`cardUrl\`.
138
+
139
+ ---
140
+
141
+ ## Step 7 — Add next-step comment
142
+
143
+ Add a comment to the card with the command to take this task to the next stage,
144
+ formatted in Markdown so it is easy to copy and paste.
145
+
146
+ \`\`\`tool
147
+ mcp__claude_ai_Trello_Custom__add_comment
148
+ card_id: "<cardId>"
149
+ text: |
150
+ ## Próximo passo
151
+
152
+ Para refinar e gerar os artefatos da change, rode:
153
+
154
+ \`\`\`
155
+ /ps:propose
156
+ \`\`\`
157
+ \`\`\`
158
+
159
+ If this call fails, log the error and continue — the comment is auxiliary, never blocking.
160
+
161
+ ---
162
+
163
+ ## Step 8 — Apply label (if resolved)
164
+
165
+ **Only if \`chosenLabel\` is not null:**
166
+
167
+ \`\`\`tool
168
+ mcp__claude_ai_Trello_Custom__add_label_to_card
169
+ card_id: "<cardId>"
170
+ label_id: "<chosenLabel.id>"
171
+ \`\`\`
172
+
173
+ If this call fails, log the error and continue — label is auxiliary, never blocking.
174
+
175
+ ---
176
+
177
+ ## Step 9 — Show summary
178
+
179
+ \`\`\`
180
+ ## Ideia registrada ✓
181
+
182
+ **Título:** <title>
183
+ **Lista:** <lists.backlog.name>
184
+ **Label:** <chosenLabel emoji + name> (ou "sem label" se não aplicada)
185
+ **Card:** <cardUrl>
186
+
187
+ Comando da próxima etapa adicionado nos comentários do card.
188
+ Sem responsável atribuído.
189
+ Quando quiser refinar: \`/ps:explore\` ou \`/ps:task\`
190
+ Quando quiser propor diretamente: \`/ps:propose\`
191
+ \`\`\`
192
+
193
+ ---
194
+
195
+ ## Guardrails
196
+
197
+ - **Mínima intervenção** — o valor deste comando é a velocidade de captura; não refinar demais
198
+ - **Preservar o texto original** verbatim na descrição
199
+ - **Nunca atribuir membro** — cards de draft são sempre sem dono
200
+ - **Nunca criar change** (\`pscode new change\`) — este comando é apenas Trello
201
+ - **Se MCP falhar**, exibir o conteúdo no chat para registro manual
202
+ - **Título em português** por padrão, mas se o usuário escreveu em inglês, manter em inglês
203
+ - **Labels são opcionais** — se \`labels.enabled = false\` ou o call MCP falhar, continuar sem label
204
+ - **Comentário com o comando da próxima etapa é auxiliar** — se o MCP falhar ao comentar, não bloquear a criação do card
205
+ - **Perguntar sobre label apenas quando ambíguo** — para ideias claras, classificar silenciosamente
206
206
  `;
207
207
  }
208
208
  export function getTrelloDraftCommandTemplate() {
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Trello Next-Step Comment Utility
3
+ *
4
+ * Builds and posts a Trello comment at the end of each workflow step,
5
+ * showing the exact command (with card title pre-filled) to advance
6
+ * to the next stage.
7
+ *
8
+ * Usage: import buildNextStepComment and call it with the current stage
9
+ * and card title. Post the result via mcp__claude_ai_Trello_Custom__add_comment.
10
+ */
11
+ export type WorkflowStage = 'draft' | 'explore' | 'propose' | 'apply';
12
+ /**
13
+ * Returns the markdown text for the next-step comment.
14
+ * Paste this into mcp__claude_ai_Trello_Custom__add_comment as `text`.
15
+ */
16
+ export declare function buildNextStepComment(stage: WorkflowStage, cardTitle: string): string;
17
+ /**
18
+ * Returns the instruction block to be embedded inside a workflow template.
19
+ * Tells the AI agent how and when to post the next-step comment.
20
+ *
21
+ * @param stage The current workflow stage (determines which command appears)
22
+ * @param titleVar The template variable name that holds the card title at runtime
23
+ * (e.g. "<title>", "<cardTitle>"). Default: "<title>"
24
+ */
25
+ export declare function getNextStepCommentInstructionBlock(stage: WorkflowStage, titleVar?: string): string;
26
+ //# sourceMappingURL=trello-next-step-comment.d.ts.map
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Trello Next-Step Comment Utility
3
+ *
4
+ * Builds and posts a Trello comment at the end of each workflow step,
5
+ * showing the exact command (with card title pre-filled) to advance
6
+ * to the next stage.
7
+ *
8
+ * Usage: import buildNextStepComment and call it with the current stage
9
+ * and card title. Post the result via mcp__claude_ai_Trello_Custom__add_comment.
10
+ */
11
+ const NEXT_STEP = {
12
+ draft: { command: 'ps:propose', label: 'Refinar e gerar os artefatos da change' },
13
+ explore: { command: 'ps:propose', label: 'Propor a change com todos os artefatos' },
14
+ propose: { command: 'ps:apply', label: 'Implementar as tasks da change' },
15
+ apply: { command: 'ps:complete', label: 'Finalizar e sincronizar a change' },
16
+ };
17
+ /**
18
+ * Returns the markdown text for the next-step comment.
19
+ * Paste this into mcp__claude_ai_Trello_Custom__add_comment as `text`.
20
+ */
21
+ export function buildNextStepComment(stage, cardTitle) {
22
+ const next = NEXT_STEP[stage];
23
+ const escapedTitle = cardTitle.replace(/"/g, '\\"');
24
+ return `**Avançar etapa:** ${next.label}
25
+
26
+ \`\`\`
27
+ /${next.command} "${escapedTitle}"
28
+ \`\`\``;
29
+ }
30
+ /**
31
+ * Returns the instruction block to be embedded inside a workflow template.
32
+ * Tells the AI agent how and when to post the next-step comment.
33
+ *
34
+ * @param stage The current workflow stage (determines which command appears)
35
+ * @param titleVar The template variable name that holds the card title at runtime
36
+ * (e.g. "<title>", "<cardTitle>"). Default: "<title>"
37
+ */
38
+ export function getNextStepCommentInstructionBlock(stage, titleVar = '<title>') {
39
+ const next = NEXT_STEP[stage];
40
+ const escapedTitleVar = titleVar.replace(/"/g, '\\"');
41
+ return `## Step — Add next-step comment
42
+
43
+ Post a comment on the card so the team always has the ready-to-paste command for the next stage.
44
+
45
+ \`\`\`tool
46
+ mcp__claude_ai_Trello_Custom__add_comment
47
+ card_id: "<cardId>"
48
+ text: |
49
+ **Avançar etapa:** ${next.label}
50
+
51
+ \`\`\`
52
+ /${next.command} "${escapedTitleVar}"
53
+ \`\`\`
54
+ \`\`\`
55
+
56
+ If this call fails, log the error and continue — the comment is auxiliary, never blocking.`;
57
+ }
58
+ //# sourceMappingURL=trello-next-step-comment.js.map