@brunosps00/dev-workflow 0.4.1 → 0.4.3

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.
package/lib/constants.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const COMMANDS = {
2
2
  en: [
3
3
  { name: 'dw-analyze-project', description: 'Analyze repository stack, patterns, and conventions to generate project rules' },
4
- { name: 'dw-autopilot', description: 'Full pipeline orchestrator: from a wish to a PR with minimal intervention (research, PRD, tasks, execution, QA, review, commit)' },
4
+ { name: 'dw-autopilot', description: 'Full pipeline orchestrator from a wish to a PR with minimal intervention (research, PRD, tasks, execution, QA, review, commit)' },
5
5
  { name: 'dw-brainstorm', description: 'Explore ideas and directions before starting implementation' },
6
6
  { name: 'dw-bugfix', description: 'Analyze and fix bugs with automatic triage (bug vs feature vs scope)' },
7
7
  { name: 'dw-code-review', description: 'Formal code review (Level 3) with persisted report' },
@@ -26,7 +26,7 @@ const COMMANDS = {
26
26
  ],
27
27
  'pt-br': [
28
28
  { name: 'dw-analyze-project', description: 'Analisa stack, patterns e convencoes do repositorio para gerar regras do projeto' },
29
- { name: 'dw-autopilot', description: 'Orquestrador completo: de um desejo ate o PR com minima intervencao (pesquisa, PRD, tasks, execucao, QA, review, commit)' },
29
+ { name: 'dw-autopilot', description: 'Orquestrador completo de um desejo ate o PR com minima intervencao (pesquisa, PRD, tasks, execucao, QA, review, commit)' },
30
30
  { name: 'dw-brainstorm', description: 'Explorar ideias e direcoes antes de comecar a implementacao' },
31
31
  { name: 'dw-bugfix', description: 'Analisar e corrigir bugs com triagem automatica (bug vs feature vs escopo)' },
32
32
  { name: 'dw-code-review', description: 'Code review formal (Nivel 3) com relatorio persistido' },
@@ -56,7 +56,7 @@ const PLATFORMS = {
56
56
  dir: '.claude/skills',
57
57
  wrapperTemplate: (name, description) => `---
58
58
  name: ${name}
59
- description: ${description}
59
+ description: "${description.replace(/"/g, '\\"')}"
60
60
  ---
61
61
 
62
62
  Read and follow ALL instructions in \`.dw/commands/${name}.md\`.
@@ -66,7 +66,7 @@ Read and follow ALL instructions in \`.dw/commands/${name}.md\`.
66
66
  dir: '.agents/skills',
67
67
  wrapperTemplate: (name, description) => `---
68
68
  name: ${name}
69
- description: ${description}
69
+ description: "${description.replace(/"/g, '\\"')}"
70
70
  ---
71
71
  <system_instructions>
72
72
  Source of truth: \`.dw/commands/${name}.md\`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brunosps00/dev-workflow",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "AI-driven development workflow commands for any project. Scaffolds a complete PRD-to-PR pipeline with multi-platform AI assistant support.",
5
5
  "bin": {
6
6
  "dev-workflow": "./bin/dev-workflow.js"
@@ -273,6 +273,20 @@ Save to `{{PRD_PATH}}/dw-code-review.md`:
273
273
 
274
274
  **REJECTED**: Tests failing, RFs not implemented, serious rules violations, security issues, or CRITICAL issues.
275
275
 
276
+ ## Next Steps by Status
277
+
278
+ <critical>The suggested next step MUST match the review status. NEVER suggest /dw-fix-qa after code-review — that command is exclusively for bugs found by /dw-run-qa.</critical>
279
+
280
+ - **APPROVED**: Suggest `/dw-commit` followed by `/dw-generate-pr`
281
+ - **APPROVED WITH CAVEATS**: List the caveats. Suggest fixing the caveats, re-running build + lint with --fix, then re-running `/dw-code-review`
282
+ - **REJECTED**: List the findings that caused rejection. The correct flow is:
283
+ 1. Fix the findings listed in the report
284
+ 2. Run build and lint with `--fix` until they pass
285
+ 3. Re-run `/dw-code-review`
286
+ 4. Repeat until APPROVED
287
+ - Do NOT suggest `/dw-fix-qa` (that is for visual QA bugs)
288
+ - Do NOT suggest `/dw-run-qa` before resolving code-review findings
289
+
276
290
  **Approval Decision Flow:**
277
291
  ```dot
278
292
  digraph approval {
@@ -4,6 +4,7 @@ You are a frontend redesign specialist for the current workspace. This command e
4
4
  <critical>Do NOT redesign without first auditing the current implementation. Always read the code and capture the visual state before proposing changes.</critical>
5
5
  <critical>ALWAYS propose design directions and wait for user approval before implementing any changes.</critical>
6
6
  <critical>Preserve existing functionality. Redesign is visual/UX, not behavioral. If the change alters behavior, redirect to `/dw-create-prd`.</critical>
7
+ <critical>MOBILE FIRST is MANDATORY. Every design proposal MUST include both mobile AND desktop versions. Implementation MUST start with mobile and then adapt for desktop. Do NOT present only the desktop layout — if the proposal does not show how it looks on mobile, it is incomplete.</critical>
7
8
 
8
9
  ## When to Use
9
10
  - Use for rebuild/modernization of existing pages or components
@@ -57,10 +58,10 @@ Use diagnostic tools based on the project's framework:
57
58
  1. Identify the target: page, component, or route to be redesigned.
58
59
  2. **AUDIT**: read the current implementation, identify the CSS stack (Tailwind, CSS Modules, styled-components, etc.), capture screenshot if `webapp-testing` is available, run react-doctor if React project.
59
60
  3. Ask 3 to 5 questions about redesign goals: style direction, brand constraints, inspirations, target audience, priority devices.
60
- 4. **PROPOSE**: present 2 to 3 design directions using `ui-ux-pro-max` — each with color palette, typography pairing, layout style, and rationale.
61
+ 4. **PROPOSE**: present 2 to 3 design directions using `ui-ux-pro-max` — each with color palette, typography pairing, layout style, and rationale. For EACH direction, explicitly describe the mobile layout (<=768px) and desktop layout (>=1024px), including how elements reorganize, stack, or hide between breakpoints.
61
62
  5. Wait for explicit user approval before implementing.
62
- 6. **IMPLEMENT**: apply the chosen design respecting the existing stack. Use `vercel-react-best-practices` for React/Next.js. Maintain the project's CSS methodology.
63
- 7. **VALIDATE**: capture after-state, compare before/after, verify accessibility (WCAG 2.2 via `ui-ux-pro-max`), run react-doctor `--diff` if React.
63
+ 6. **IMPLEMENT**: apply the chosen design with a mobile-first approach — implement the mobile layout first, then add media queries/breakpoints for tablet and desktop. Respect the existing stack. Use `vercel-react-best-practices` for React/Next.js. Maintain the project's CSS methodology.
64
+ 7. **VALIDATE**: capture after-state in BOTH resolutions (mobile and desktop), compare before/after, verify accessibility (WCAG 2.2 via `ui-ux-pro-max`), run react-doctor `--diff` if React. If `webapp-testing` is available, capture screenshots at 375px viewport (mobile) and 1440px viewport (desktop).
64
65
  8. **PERSIST CONTRACT**: if the user approved a direction, generate `design-contract.md` in the PRD directory (`.dw/spec/prd-[name]/design-contract.md`) with: approved direction, color palette, typography pairing, layout rules, accessibility rules, and component rules. This contract will be read by `dw-run-task` and `dw-run-plan` to ensure visual consistency.
65
66
 
66
67
  ## GSD Integration
@@ -107,7 +108,8 @@ If GSD is NOT installed:
107
108
  - Prefer incremental changes that can be reviewed visually
108
109
  - When in doubt about style direction, ask — don't assume
109
110
  - If the page has no tests, flag regression risk before changing
110
- - Mobile responsiveness is mandatory unless explicitly scoped out by the user
111
+ - Mobile-first is the default implement mobile first, adapt for desktop after
112
+ - Validate at least 2 breakpoints: mobile (375px) and desktop (1440px)
111
113
  - In Angular projects, respect Angular component patterns (style encapsulation, ViewEncapsulation)
112
114
 
113
115
  ## Useful Outputs
@@ -97,7 +97,13 @@ Refer to `.dw/rules/` for project-specific URLs and frameworks.
97
97
  - `{{PRD_PATH}}/QA/screenshots/`
98
98
  - `{{PRD_PATH}}/QA/logs/`
99
99
  - `{{PRD_PATH}}/QA/scripts/`
100
- - Read `.dw/templates/qa-test-credentials.md` and choose the appropriate user/profile for the scenario
100
+ <critical>BEFORE executing any test involving login or authentication, search for test credentials in the codebase. Look for (in priority order):
101
+ 1. `.dw/templates/qa-test-credentials.md`
102
+ 2. Any file with "credenciais", "credentials", "test-users", "test-accounts", "auth", "login", "usuarios-teste" in the name (recursive glob search)
103
+ 3. Environment variables in `.env.test`, `.env.local`, `.env.development`
104
+ 4. Documentation in README or docs/ mentioning test users
105
+ If NO credentials are found, STOP and ask the user before continuing. Do NOT guess credentials or use fake data.</critical>
106
+ - Choose the appropriate user/profile for the test scenario
101
107
  - Verify the application is running on localhost
102
108
  - Use `browser_navigate` from Playwright MCP to access the application
103
109
  - Confirm the page loaded correctly with `browser_snapshot`
@@ -216,7 +222,20 @@ Use `browser_snapshot` to verify labels and semantic structure.
216
222
  - Capture screenshots of main screens with `browser_take_screenshot` and save to `{{PRD_PATH}}/QA/screenshots/`
217
223
  - Check layouts in different states (empty, with data, error, loading)
218
224
  - Document visual inconsistencies found
219
- - Check responsiveness if applicable (different viewports)
225
+
226
+ ### 6.1. Mobile Validation (Required)
227
+
228
+ <critical>ALL visual checks MUST include tests at mobile viewport (375px) IN ADDITION to desktop (1440px). QA approval REQUIRES that BOTH resolutions are functional and visually acceptable. If the mobile layout is broken, unusable, or visually degraded, QA CANNOT be approved.</critical>
229
+
230
+ - Capture screenshots at 375px viewport (mobile) for EACH tested screen
231
+ - Capture screenshots at 1440px viewport (desktop) for comparison
232
+ - Verify: elements do not overlap, text is readable, buttons are tappable (min 44x44px), no horizontal scroll, forms are usable
233
+ - Save screenshots with suffix: `[screen]-mobile.png` and `[screen]-desktop.png`
234
+
235
+ If mobile FAILS visual validation:
236
+ - Document issues in `{{PRD_PATH}}/QA/bugs.md` with severity **High** and tag `[MOBILE]`
237
+ - In the final report, recommend `/dw-redesign-ui` as the next step to fix the mobile layout with a mobile-first approach
238
+ - QA CANNOT be approved with broken mobile
220
239
 
221
240
  ### 7. Bug Documentation (If issues found)
222
241
 
@@ -253,6 +253,20 @@ Salvar em `{{PRD_PATH}}/dw-code-review.md`:
253
253
 
254
254
  **REPROVADO**: Testes falhando, RFs não implementados, violação grave de rules, problemas de segurança, ou CRITICAL issues.
255
255
 
256
+ ## Próximos Passos por Status
257
+
258
+ <critical>O próximo passo sugerido DEVE corresponder ao status do review. NUNCA sugira /dw-fix-qa após code-review — esse comando é exclusivo para bugs encontrados pelo /dw-run-qa.</critical>
259
+
260
+ - **APROVADO**: Sugira `/dw-commit` seguido de `/dw-generate-pr`
261
+ - **APROVADO COM RESSALVAS**: Liste as ressalvas. Sugira corrigir as ressalvas, re-executar build + lint com --fix, e então re-executar `/dw-code-review`
262
+ - **REPROVADO**: Liste os findings que causaram a reprovação. O fluxo correto é:
263
+ 1. Corrigir os findings listados no relatório
264
+ 2. Executar build e lint com `--fix` até passar
265
+ 3. Re-executar `/dw-code-review`
266
+ 4. Repetir até APROVADO
267
+ - NÃO sugira `/dw-fix-qa` (esse é para bugs de QA visual)
268
+ - NÃO sugira `/dw-run-qa` antes de resolver os findings do code-review
269
+
256
270
  **Fluxo de Decisão de Aprovação:**
257
271
  ```dot
258
272
  digraph approval {
@@ -4,6 +4,7 @@ Você é um especialista em redesign de frontend para o workspace atual. Este co
4
4
  <critical>NÃO redesenhe sem antes auditar a implementação atual. Sempre leia o código e capture o estado visual antes de propor mudanças.</critical>
5
5
  <critical>SEMPRE proponha direções de design e espere aprovação do usuário antes de implementar qualquer mudança.</critical>
6
6
  <critical>Preserve a funcionalidade existente. Redesign é visual/UX, não comportamental. Se a mudança alterar comportamento, redirecione para `/dw-create-prd`.</critical>
7
+ <critical>MOBILE FIRST é OBRIGATÓRIO. Toda proposta de design DEVE incluir versão mobile E desktop. A implementação DEVE começar pelo mobile e depois adaptar para desktop. NÃO apresente apenas o layout desktop — se a proposta não mostrar como fica no mobile, está incompleta.</critical>
7
8
 
8
9
  ## Quando Usar
9
10
  - Use para rebuild/modernização visual de páginas ou componentes existentes
@@ -57,10 +58,10 @@ Utilize ferramentas de diagnóstico conforme o framework do projeto:
57
58
  1. Identifique o alvo: página, componente ou rota que será redesenhada.
58
59
  2. **AUDITAR**: leia a implementação atual, identifique stack CSS (Tailwind, CSS Modules, styled-components, etc.), capture screenshot se `webapp-testing` disponível, rode react-doctor se projeto React.
59
60
  3. Faça 3 a 5 perguntas sobre objetivos do redesign: direção de estilo, constraints de marca, inspirações, público-alvo, dispositivos prioritários.
60
- 4. **PROPOR**: apresente 2 a 3 direções de design usando `ui-ux-pro-max` — cada uma com paleta de cores, par tipográfico, estilo de layout e racional.
61
+ 4. **PROPOR**: apresente 2 a 3 direções de design usando `ui-ux-pro-max` — cada uma com paleta de cores, par tipográfico, estilo de layout e racional. Para CADA direção, descreva explicitamente o layout mobile (<=768px) e o layout desktop (>=1024px), incluindo como os elementos se reorganizam, empilham ou escondem entre breakpoints.
61
62
  5. Espere aprovação explícita do usuário antes de implementar.
62
- 6. **IMPLEMENTAR**: aplique o design escolhido respeitando a stack existente. Use `vercel-react-best-practices` para React/Next.js. Mantenha a metodologia CSS do projeto.
63
- 7. **VALIDAR**: capture estado depois, compare antes/depois, verifique acessibilidade (WCAG 2.2 via `ui-ux-pro-max`), rode react-doctor `--diff` se React.
63
+ 6. **IMPLEMENTAR**: aplique o design escolhido com abordagem mobile-first — implemente primeiro o layout mobile e depois adicione media queries/breakpoints para tablet e desktop. Respeite a stack existente. Use `vercel-react-best-practices` para React/Next.js. Mantenha a metodologia CSS do projeto.
64
+ 7. **VALIDAR**: capture estado depois em AMBAS as resoluções (mobile e desktop), compare antes/depois, verifique acessibilidade (WCAG 2.2 via `ui-ux-pro-max`), rode react-doctor `--diff` se React. Se `webapp-testing` disponível, capture screenshots em viewport 375px (mobile) e 1440px (desktop).
64
65
  8. **PERSISTIR CONTRATO**: se o usuário aprovou uma direção, gere `design-contract.md` no diretório do PRD (`.dw/spec/prd-[nome]/design-contract.md`) com: direção aprovada, paleta de cores, par tipográfico, regras de layout, regras de acessibilidade e regras de componentes. Este contrato será lido por `dw-run-task` e `dw-run-plan` para garantir consistência visual.
65
66
 
66
67
  ## Integração GSD
@@ -107,7 +108,8 @@ Se o GSD NÃO estiver instalado:
107
108
  - Prefira mudanças incrementais que possam ser revisadas visualmente
108
109
  - Quando em dúvida sobre direção de estilo, pergunte — não assuma
109
110
  - Se a página não tem testes, sinalize risco de regressão antes de alterar
110
- - Responsividade mobile é mandatória salvo escopo explícito do usuário
111
+ - Mobile-first é o padrão implemente mobile primeiro, adapte para desktop depois
112
+ - Valide em pelo menos 2 breakpoints: mobile (375px) e desktop (1440px)
111
113
  - Em projetos Angular, respeite os padrões de componentes do Angular (encapsulação de estilos, ViewEncapsulation)
112
114
 
113
115
  ## Saídas Úteis
@@ -97,7 +97,13 @@ Consulte `.dw/rules/` para URLs e frameworks específicos do projeto.
97
97
  - `{{PRD_PATH}}/QA/screenshots/`
98
98
  - `{{PRD_PATH}}/QA/logs/`
99
99
  - `{{PRD_PATH}}/QA/scripts/`
100
- - Ler `.dw/templates/qa-test-credentials.md` e escolher o usuário/perfil apropriado para o cenário
100
+ <critical>ANTES de executar qualquer teste que envolva login ou autenticação, busque credenciais de teste no codebase. Procure por (em ordem de prioridade):
101
+ 1. `.dw/templates/qa-test-credentials.md`
102
+ 2. Qualquer arquivo com "credenciais", "credentials", "test-users", "test-accounts", "auth", "login", "usuarios-teste" no nome (busca recursiva com glob)
103
+ 3. Variáveis de ambiente em `.env.test`, `.env.local`, `.env.development`
104
+ 4. Documentação em README ou docs/ que mencione usuários de teste
105
+ Se NENHUMA credencial for encontrada, PARE e pergunte ao usuário antes de continuar. NÃO tente adivinhar credenciais ou usar dados falsos.</critical>
106
+ - Escolher o usuário/perfil apropriado para o cenário de teste
101
107
  - Verificar se a aplicação está rodando em localhost
102
108
  - Usar `browser_navigate` do Playwright MCP para acessar a aplicação
103
109
  - Confirmar que a página carregou corretamente com `browser_snapshot`
@@ -216,7 +222,20 @@ Use `browser_snapshot` para verificar labels e estrutura semântica.
216
222
  - Capturar screenshots das telas principais com `browser_take_screenshot` e salvar em `{{PRD_PATH}}/QA/screenshots/`
217
223
  - Verificar layouts em diferentes estados (vazio, com dados, erro, loading)
218
224
  - Documentar inconsistências visuais encontradas
219
- - Verificar responsividade se aplicável (diferentes viewports)
225
+
226
+ ### 6.1. Validação Mobile (Obrigatório)
227
+
228
+ <critical>TODA verificação visual DEVE incluir testes em viewport mobile (375px) ALÉM do desktop (1440px). A aprovação do QA REQUER que AMBAS as resoluções estejam funcionais e visualmente aceitáveis. Se o layout mobile estiver quebrado, inutilizável ou visualmente degradado, o QA NÃO pode ser aprovado.</critical>
229
+
230
+ - Capture screenshots em viewport 375px (mobile) para CADA tela testada
231
+ - Capture screenshots em viewport 1440px (desktop) para comparação
232
+ - Verifique: elementos não se sobrepõem, texto é legível, botões são clicáveis (min 44x44px), scroll horizontal não existe, formulários são usáveis
233
+ - Salve screenshots com sufixo: `[tela]-mobile.png` e `[tela]-desktop.png`
234
+
235
+ Se o mobile FALHAR na validação visual:
236
+ - Documente os problemas em `{{PRD_PATH}}/QA/bugs.md` com severidade **Alta** e tag `[MOBILE]`
237
+ - No relatório final, recomende `/dw-redesign-ui` como próximo passo para corrigir o layout mobile com abordagem mobile-first
238
+ - O QA NÃO pode ser aprovado com mobile quebrado
220
239
 
221
240
  ### 7. Documentação de Bugs (Se encontrar problemas)
222
241