deepflow 0.1.9 → 0.1.11

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.
@@ -9,11 +9,9 @@ Update deepflow to the latest version from npm.
9
9
  npx deepflow@latest
10
10
  ```
11
11
 
12
- 2. When prompted, choose the same installation level you used before (Global or Project).
12
+ 2. The installer auto-detects your existing installation (global or project) and updates it.
13
13
 
14
- 3. The installer will update all commands, skills, agents, and hooks.
15
-
16
- 4. Restart Claude Code to apply changes.
14
+ 3. Restart Claude Code to apply changes.
17
15
 
18
16
  ## What Gets Updated
19
17
 
package/README.md CHANGED
@@ -30,9 +30,12 @@
30
30
  ## Quick Start
31
31
 
32
32
  ```bash
33
- # Install
33
+ # Install (or update)
34
34
  npx deepflow
35
35
 
36
+ # Uninstall
37
+ npx deepflow --uninstall
38
+
36
39
  # In your project
37
40
  claude
38
41
 
package/bin/install.js CHANGED
@@ -24,12 +24,41 @@ const PROJECT_DIR = path.join(process.cwd(), '.claude');
24
24
  const PACKAGE_DIR = path.resolve(__dirname, '..');
25
25
 
26
26
  async function main() {
27
+ // Handle --uninstall flag
28
+ if (process.argv.includes('--uninstall')) {
29
+ return uninstall();
30
+ }
31
+
27
32
  console.log('');
28
33
  console.log(`${c.cyan}deepflow installer${c.reset}`);
29
34
  console.log('');
30
35
 
31
- // Ask for installation level
32
- const level = await askInstallLevel();
36
+ // Detect existing installations
37
+ const globalInstalled = isInstalled(GLOBAL_DIR);
38
+ const projectInstalled = isInstalled(PROJECT_DIR);
39
+
40
+ let level;
41
+
42
+ if (globalInstalled && projectInstalled) {
43
+ // Both installed - ask which to update
44
+ console.log(`${c.yellow}!${c.reset} Found installations in both locations:`);
45
+ console.log(` Global: ${GLOBAL_DIR}`);
46
+ console.log(` Project: ${PROJECT_DIR}`);
47
+ console.log('');
48
+ level = await askInstallLevel('Which do you want to update?');
49
+ } else if (globalInstalled) {
50
+ // Only global - update it
51
+ console.log(`Updating global installation...`);
52
+ level = 'global';
53
+ } else if (projectInstalled) {
54
+ // Only project - update it
55
+ console.log(`Updating project installation...`);
56
+ level = 'project';
57
+ } else {
58
+ // Fresh install - ask
59
+ level = await askInstallLevel('Where do you want to install deepflow?');
60
+ }
61
+
33
62
  const CLAUDE_DIR = level === 'global' ? GLOBAL_DIR : PROJECT_DIR;
34
63
  const levelLabel = level === 'global' ? 'globally' : 'in this project';
35
64
 
@@ -98,8 +127,7 @@ async function main() {
98
127
  log('Version file installed');
99
128
  }
100
129
 
101
- // Clear stale update cache to prevent false warnings
102
- // Cache is always global, so clear it regardless of install level
130
+ // Clear stale update cache
103
131
  const cacheFile = path.join(GLOBAL_DIR, 'cache', 'df-update-check.json');
104
132
  if (fs.existsSync(cacheFile)) {
105
133
  fs.unlinkSync(cacheFile);
@@ -148,6 +176,12 @@ async function main() {
148
176
  console.log('');
149
177
  }
150
178
 
179
+ function isInstalled(claudeDir) {
180
+ // Check if deepflow commands exist
181
+ const commandsDir = path.join(claudeDir, 'commands', 'df');
182
+ return fs.existsSync(commandsDir) && fs.readdirSync(commandsDir).length > 0;
183
+ }
184
+
151
185
  function copyDir(src, dest) {
152
186
  if (!fs.existsSync(src)) return;
153
187
 
@@ -212,8 +246,8 @@ function ask(question) {
212
246
  });
213
247
  }
214
248
 
215
- async function askInstallLevel() {
216
- console.log('Where do you want to install deepflow?');
249
+ async function askInstallLevel(prompt) {
250
+ console.log(prompt);
217
251
  console.log('');
218
252
  console.log(` ${c.cyan}1${c.reset}) Global ${c.dim}(~/.claude/ - available in all projects)${c.reset}`);
219
253
  console.log(` ${c.cyan}2${c.reset}) Project ${c.dim}(./.claude/ - only this project)${c.reset}`);
@@ -231,6 +265,77 @@ function log(msg) {
231
265
  console.log(` ${c.green}✓${c.reset} ${msg}`);
232
266
  }
233
267
 
268
+ async function uninstall() {
269
+ console.log('');
270
+ console.log(`${c.cyan}deepflow uninstaller${c.reset}`);
271
+ console.log('');
272
+
273
+ const globalInstalled = isInstalled(GLOBAL_DIR);
274
+ const projectInstalled = isInstalled(PROJECT_DIR);
275
+
276
+ if (!globalInstalled && !projectInstalled) {
277
+ console.log('No deepflow installation found.');
278
+ return;
279
+ }
280
+
281
+ let level;
282
+
283
+ if (globalInstalled && projectInstalled) {
284
+ console.log('Found installations in both locations:');
285
+ console.log(` Global: ${GLOBAL_DIR}`);
286
+ console.log(` Project: ${PROJECT_DIR}`);
287
+ console.log('');
288
+ level = await askInstallLevel('Which do you want to remove?');
289
+ } else if (globalInstalled) {
290
+ level = 'global';
291
+ } else {
292
+ level = 'project';
293
+ }
294
+
295
+ const CLAUDE_DIR = level === 'global' ? GLOBAL_DIR : PROJECT_DIR;
296
+ const levelLabel = level === 'global' ? 'global' : 'project';
297
+
298
+ const confirm = await ask(`Remove ${levelLabel} installation from ${CLAUDE_DIR}? [y/N] `);
299
+ if (confirm.toLowerCase() !== 'y') {
300
+ console.log('Cancelled.');
301
+ return;
302
+ }
303
+
304
+ console.log('');
305
+
306
+ // Remove deepflow files
307
+ const toRemove = [
308
+ 'commands/df',
309
+ 'skills/atomic-commits',
310
+ 'skills/code-completeness',
311
+ 'skills/gap-discovery',
312
+ 'agents/reasoner.md',
313
+ 'deepflow'
314
+ ];
315
+
316
+ if (level === 'global') {
317
+ toRemove.push('hooks/df-statusline.js', 'hooks/df-check-update.js');
318
+ }
319
+
320
+ for (const item of toRemove) {
321
+ const fullPath = path.join(CLAUDE_DIR, item);
322
+ if (fs.existsSync(fullPath)) {
323
+ fs.rmSync(fullPath, { recursive: true });
324
+ console.log(` ${c.green}✓${c.reset} Removed ${item}`);
325
+ }
326
+ }
327
+
328
+ // Clear update cache
329
+ const cacheFile = path.join(GLOBAL_DIR, 'cache', 'df-update-check.json');
330
+ if (fs.existsSync(cacheFile)) {
331
+ fs.unlinkSync(cacheFile);
332
+ }
333
+
334
+ console.log('');
335
+ console.log(`${c.green}Uninstall complete.${c.reset}`);
336
+ console.log('');
337
+ }
338
+
234
339
  main().catch(err => {
235
340
  console.error('Installation failed:', err.message);
236
341
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepflow",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Stay in flow state - lightweight spec-driven task orchestration for Claude Code",
5
5
  "keywords": [
6
6
  "claude",