@brunosps00/dev-workflow 0.4.4 → 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.4",
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"