@brunosps00/dev-workflow 0.4.3 → 0.4.5

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.
@@ -2,6 +2,7 @@
2
2
 
3
3
  const { run } = require('../lib/init');
4
4
  const installDeps = require('../lib/install-deps');
5
+ const uninstall = require('../lib/uninstall');
5
6
 
6
7
  const args = process.argv.slice(2);
7
8
  const command = args[0];
@@ -28,6 +29,8 @@ const HELP_TEXT = `
28
29
  update Update managed files (commands, templates, references, scripts, skills, wrappers, MCPs)
29
30
  Preserves: .dw/rules/, .dw/spec/, user data
30
31
  install-deps Install system dependencies (Playwright browsers, MCP servers)
32
+ uninstall Remove all managed files (commands, templates, wrappers, skills, MCPs)
33
+ Preserves: .dw/rules/, .dw/spec/, .planning/ (user data)
31
34
  help Show this help message
32
35
 
33
36
  Options:
@@ -41,6 +44,7 @@ const HELP_TEXT = `
41
44
  npx dev-workflow init --force # Overwrite existing files
42
45
  npx dev-workflow update --lang=en # Update all managed files to latest version
43
46
  npx dev-workflow install-deps # Install Playwright browsers and MCP servers
47
+ npx dev-workflow uninstall # Remove all managed files (preserves user data)
44
48
  `;
45
49
 
46
50
  async function main() {
@@ -54,6 +58,9 @@ async function main() {
54
58
  case 'install-deps':
55
59
  installDeps.run();
56
60
  break;
61
+ case 'uninstall':
62
+ uninstall.run();
63
+ break;
57
64
  case 'help':
58
65
  case '--help':
59
66
  case '-h':
@@ -0,0 +1,111 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const { COMMANDS, PLATFORMS, MCP_SERVERS } = require('./constants');
4
+
5
+ function run() {
6
+ const projectRoot = process.cwd();
7
+
8
+ console.log('\n dev-workflow uninstall');
9
+ console.log(` ${'='.repeat(40)}\n`);
10
+
11
+ let removed = 0;
12
+ let skipped = 0;
13
+
14
+ function removeDir(dirPath, label) {
15
+ if (fs.existsSync(dirPath)) {
16
+ fs.rmSync(dirPath, { recursive: true });
17
+ console.log(` \x1b[31m-\x1b[0m ${path.relative(projectRoot, dirPath)} [removed]`);
18
+ removed++;
19
+ } else {
20
+ skipped++;
21
+ }
22
+ }
23
+
24
+ function removeFile(filePath) {
25
+ if (fs.existsSync(filePath)) {
26
+ fs.unlinkSync(filePath);
27
+ console.log(` \x1b[31m-\x1b[0m ${path.relative(projectRoot, filePath)} [removed]`);
28
+ removed++;
29
+ } else {
30
+ skipped++;
31
+ }
32
+ }
33
+
34
+ // 1. Remove .dw/commands/, .dw/templates/, .dw/references/, .dw/scripts/
35
+ console.log(' Managed files:');
36
+ removeDir(path.join(projectRoot, '.dw', 'commands'), '.dw/commands/');
37
+ removeDir(path.join(projectRoot, '.dw', 'templates'), '.dw/templates/');
38
+ removeDir(path.join(projectRoot, '.dw', 'references'), '.dw/references/');
39
+ removeDir(path.join(projectRoot, '.dw', 'scripts'), '.dw/scripts/');
40
+ console.log();
41
+
42
+ // 2. Remove platform wrappers (only dw-* skills, not user skills)
43
+ console.log(' Platform wrappers:');
44
+ const allCommandNames = COMMANDS.en.map(c => c.name);
45
+
46
+ for (const [, platform] of Object.entries(PLATFORMS)) {
47
+ for (const name of allCommandNames) {
48
+ if (platform.flat) {
49
+ removeFile(path.join(projectRoot, platform.dir, `${name}.md`));
50
+ } else {
51
+ removeDir(path.join(projectRoot, platform.dir, name));
52
+ }
53
+ }
54
+ }
55
+ console.log();
56
+
57
+ // 3. Remove bundled skills from .agents/skills/
58
+ console.log(' Bundled skills:');
59
+ const bundledSkills = [
60
+ 'humanizer',
61
+ 'remotion-best-practices',
62
+ 'security-review',
63
+ 'ui-ux-pro-max',
64
+ 'vercel-react-best-practices',
65
+ 'webapp-testing',
66
+ ];
67
+ for (const skill of bundledSkills) {
68
+ removeDir(path.join(projectRoot, '.agents', 'skills', skill));
69
+ }
70
+ console.log();
71
+
72
+ // 4. Remove MCP servers from .claude/settings.json
73
+ console.log(' MCP Servers:');
74
+ const settingsPath = path.join(projectRoot, '.claude', 'settings.json');
75
+ if (fs.existsSync(settingsPath)) {
76
+ try {
77
+ const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
78
+ if (settings.mcpServers) {
79
+ for (const name of Object.keys(MCP_SERVERS)) {
80
+ if (settings.mcpServers[name]) {
81
+ delete settings.mcpServers[name];
82
+ console.log(` \x1b[31m-\x1b[0m MCP server: ${name} [removed]`);
83
+ removed++;
84
+ }
85
+ }
86
+ fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n', 'utf-8');
87
+ }
88
+ } catch {
89
+ console.log(' Could not parse .claude/settings.json, skipping MCP cleanup');
90
+ }
91
+ }
92
+ console.log();
93
+
94
+ // 5. Remove .opencode/package.json
95
+ removeFile(path.join(projectRoot, '.opencode', 'package.json'));
96
+
97
+ // 6. Remove legacy .codex/skills/
98
+ removeDir(path.join(projectRoot, '.codex', 'skills'));
99
+
100
+ // Note: .dw/rules/, .dw/spec/, .planning/ are USER DATA — never removed
101
+ console.log(`\n ${'='.repeat(40)}`);
102
+ console.log(` Done! ${removed} removed, ${skipped} already absent`);
103
+ console.log();
104
+ console.log(' Preserved (user data):');
105
+ console.log(' .dw/rules/ (project rules)');
106
+ console.log(' .dw/spec/ (PRDs and specs)');
107
+ console.log(' .planning/ (GSD state)');
108
+ console.log();
109
+ }
110
+
111
+ module.exports = { run };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brunosps00/dev-workflow",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
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"
@@ -53,6 +53,7 @@ If this command is invoked to resume an interrupted autopilot (via `/dw-resume`)
53
53
  Evaluate whether the topic requires deep research:
54
54
  - **YES** (run `/dw-deep-research`): new technology for the project, unknown domain, external API integrations, critical architectural decisions
55
55
  - **NO** (skip to step 3): simple feature in an already mapped domain, refactoring existing code, basic CRUD
56
+ - If skipping, DOCUMENT the reason in the progress block. E.g.: "Research skipped — domain already mapped in .dw/rules/[file].md". The user must see the justification.
56
57
 
57
58
  If executed, use `standard` mode by default. Incorporate findings into subsequent steps.
58
59
 
@@ -60,8 +61,8 @@ If executed, use `standard` mode by default. Incorporate findings into subsequen
60
61
 
61
62
  Run `/dw-brainstorm` with accumulated context (intel + research).
62
63
  - Generate 3 directions
63
- - Automatically converge on the most pragmatic option for the project context
64
- - Do NOT wait for user approval (brainstorm is automatic in autopilot)
64
+ - Present the 3 directions to the user with your recommendation highlighted and justified
65
+ - Wait for user confirmation on which direction to follow before proceeding
65
66
 
66
67
  ### Step 4: PRD (Interactive — 7+ Questions)
67
68
 
@@ -72,6 +73,7 @@ Run `/dw-create-prd` using brainstorm findings.
72
73
  - Ask at least 7 questions about: problem, target users, critical features, scope, constraints, design, integration
73
74
  - In each question, present a recommendation grounded in brainstorm and deep-research findings (if executed). E.g.: "Based on the research, I recommend X because [evidence]. Do you agree or prefer a different direction?"
74
75
  - Wait for user responses to each question
76
+ - This step is BLOCKING — the command STOPS until a response is received from the user for EACH question. If the user does not respond, do NOT proceed. Do NOT assume answers based on context.
75
77
  - Only after receiving all responses, write the complete PRD in `.dw/spec/prd-[name]/prd.md`
76
78
 
77
79
  ### === GATE 1: PRD Approval ===
@@ -92,6 +94,7 @@ Run `/dw-create-techspec` from the approved PRD.
92
94
  - Ask at least 7 questions about: preferred architecture, existing vs new libs, testing strategy, integration with existing systems, infrastructure constraints, performance, security
93
95
  - In each question, present a technical recommendation grounded in brainstorm, deep-research, and approved PRD findings. E.g.: "Research indicated lib X has better performance for this case [source]. Want to use X or have another preference?"
94
96
  - Wait for user responses to each question
97
+ - This step is BLOCKING — the command STOPS until a response is received from the user for EACH question. If the user does not respond, do NOT proceed. Do NOT assume answers based on context.
95
98
  - Only after receiving all responses, generate in `.dw/spec/prd-[name]/techspec.md`
96
99
 
97
100
  ### Step 6: Tasks
@@ -114,7 +117,7 @@ Present to the user:
114
117
  Evaluate whether tasks involve frontend:
115
118
  - **YES** (run `/dw-redesign-ui`): if there are tasks with visual components AND the `ui-ux-pro-max` skill is available
116
119
  - Generate the design contract in `.dw/spec/prd-[name]/design-contract.md`
117
- - Do NOT wait for approval (contract is automatic in autopilot, based on PRD requirements)
120
+ - Present a summary of the design contract to the user (palette, typography, mobile/desktop layout) as a visual checkpoint before proceeding
118
121
  - **NO** (skip to step 8): purely backend/infra tasks
119
122
 
120
123
  ### Step 8: Execution
@@ -150,7 +153,7 @@ Run `/dw-run-qa` with Playwright MCP.
150
153
 
151
154
  If QA found bugs:
152
155
  - Run `/dw-fix-qa` to fix and retest
153
- - Loop until stable
156
+ - Loop until stable (maximum 5 cycles). After 5 cycles, STOP and ask the user how to proceed.
154
157
 
155
158
  ### Step 12: Implementation Review (Post-QA)
156
159
 
@@ -219,6 +222,8 @@ Save the file `.dw/spec/prd-[name]/autopilot-state.json` with the following form
219
222
  - If the session drops, `/dw-resume` will read this file and continue from the correct step
220
223
  - When the pipeline finishes (after commit or PR), remove the file or mark `"status": "completed"`
221
224
 
225
+ <critical>After EACH completed step, display the updated progress block to the user. This is MANDATORY — the user MUST see what was done and what comes next. If a step was skipped, the reason MUST appear in the progress block.</critical>
226
+
222
227
  ## Progress Format
223
228
 
224
229
  During execution, report progress in this format:
@@ -53,6 +53,7 @@ Se este comando for invocado para retomar um autopilot interrompido (via `/dw-re
53
53
  Avalie se o topico necessita de pesquisa profunda:
54
54
  - **SIM** (execute `/dw-deep-research`): tecnologia nova para o projeto, dominio desconhecido, integracoes com APIs externas, decisoes arquiteturais criticas
55
55
  - **NAO** (pule para etapa 3): feature simples no dominio ja mapeado, refatoracao de algo existente, CRUD basico
56
+ - Se pular, DOCUMENTE o motivo no bloco de progresso. Ex: "Pesquisa pulada — dominio ja mapeado em .dw/rules/[arquivo].md". O usuario deve ver a justificativa.
56
57
 
57
58
  Se executar, use modo `standard` por padrao. Incorpore os findings nas etapas seguintes.
58
59
 
@@ -60,8 +61,8 @@ Se executar, use modo `standard` por padrao. Incorpore os findings nas etapas se
60
61
 
61
62
  Execute `/dw-brainstorm` com o contexto acumulado (intel + pesquisa).
62
63
  - Gere 3 direcoes
63
- - Convirja automaticamente na opcao mais pragmatica para o contexto do projeto
64
- - NAO aguarde aprovacao do usuario (brainstorm e automatico no autopilot)
64
+ - Apresente as 3 direcoes ao usuario com sua recomendacao destacada e justificativa
65
+ - Aguarde confirmacao do usuario sobre qual direcao seguir antes de prosseguir
65
66
 
66
67
  ### Etapa 4: PRD (Interativo — 7+ Perguntas)
67
68
 
@@ -72,6 +73,7 @@ Execute `/dw-create-prd` usando os findings do brainstorm.
72
73
  - Faca pelo menos 7 perguntas ao usuario sobre: problema, usuarios-alvo, funcionalidades criticas, escopo, restricoes, design, integracao
73
74
  - Em cada pergunta, apresente uma recomendacao embasada nos findings do brainstorm e do deep-research (se executado). Ex: "Com base na pesquisa, recomendo X porque [evidencia]. Concorda ou prefere outra direcao?"
74
75
  - Aguarde as respostas do usuario para cada pergunta
76
+ - Este passo e BLOQUEANTE — o comando PARA ate receber resposta do usuario para CADA pergunta. Se o usuario nao responder, NAO prossiga. NAO assuma respostas com base no contexto.
75
77
  - So apos receber todas as respostas, redija o PRD completo em `.dw/spec/prd-[nome]/prd.md`
76
78
 
77
79
  ### ═══ GATE 1: Aprovacao do PRD ═══
@@ -92,6 +94,7 @@ Execute `/dw-create-techspec` a partir do PRD aprovado.
92
94
  - Faca pelo menos 7 perguntas ao usuario sobre: arquitetura preferida, libs existentes vs novas, estrategia de testes, integracao com sistemas existentes, restricoes de infraestrutura, performance, seguranca
93
95
  - Em cada pergunta, apresente uma recomendacao tecnica embasada nos findings do brainstorm, deep-research e PRD aprovado. Ex: "A pesquisa indicou que a lib X tem melhor performance para este caso [fonte]. Quer usar X ou tem outra preferencia?"
94
96
  - Aguarde as respostas do usuario para cada pergunta
97
+ - Este passo e BLOQUEANTE — o comando PARA ate receber resposta do usuario para CADA pergunta. Se o usuario nao responder, NAO prossiga. NAO assuma respostas com base no contexto.
95
98
  - So apos receber todas as respostas, gere em `.dw/spec/prd-[nome]/techspec.md`
96
99
 
97
100
  ### Etapa 6: Tasks
@@ -114,7 +117,7 @@ Apresente ao usuario:
114
117
  Avalie se as tasks envolvem frontend:
115
118
  - **SIM** (execute `/dw-redesign-ui`): se houver tasks com componentes visuais E a skill `ui-ux-pro-max` estiver disponivel
116
119
  - Gere o design contract em `.dw/spec/prd-[nome]/design-contract.md`
117
- - NAO aguarde aprovacao (o contract e automatico no autopilot, baseado nos requisitos do PRD)
120
+ - Apresente um resumo do design contract ao usuario (paleta, tipografia, layout mobile/desktop) como checkpoint visual antes de prosseguir
118
121
  - **NAO** (pule para etapa 8): tasks puramente backend/infra
119
122
 
120
123
  ### Etapa 8: Execucao
@@ -150,7 +153,7 @@ Execute `/dw-run-qa` com Playwright MCP.
150
153
 
151
154
  Se o QA encontrou bugs:
152
155
  - Execute `/dw-fix-qa` para corrigir e retestar
153
- - Loop ate estabilizar
156
+ - Loop ate estabilizar (maximo 5 ciclos). Apos 5 ciclos, PARE e pergunte ao usuario como deseja prosseguir.
154
157
 
155
158
  ### Etapa 12: Review de Implementacao (Pos-QA)
156
159
 
@@ -219,6 +222,8 @@ Salve o arquivo `.dw/spec/prd-[nome]/autopilot-state.json` com o seguinte format
219
222
  - Se a sessao cair, o `/dw-resume` lera este arquivo e continuara da etapa correta
220
223
  - Ao finalizar o pipeline (apos commit ou PR), remova o arquivo ou marque `"status": "completed"`
221
224
 
225
+ <critical>Apos CADA etapa completada, exiba o bloco de progresso atualizado ao usuario. Isso e OBRIGATORIO — o usuario DEVE ver o que foi feito e o que vem a seguir. Se uma etapa foi pulada, o motivo DEVE aparecer no bloco de progresso.</critical>
226
+
222
227
  ## Formato de Progresso
223
228
 
224
229
  Durante a execucao, reporte progresso no formato: