From 08183f69297d5523d0021d0cc545267641ed1269 Mon Sep 17 00:00:00 2001 From: Dean Sharon Date: Mon, 3 Nov 2025 22:54:58 +0000 Subject: [PATCH 1/4] fix: install skills in flat structure for auto-discovery Skills must be directly under ~/.claude/skills/ for Claude Code to discover them. The nested devflow/ subdirectory was preventing skill auto-activation. Changes: - Install skills to ~/.claude/skills/ (flat) instead of ~/.claude/skills/devflow/ - Add migration cleanup for old devflow/ subdirectory - Preserve user's personal skills during cleanup - Keep commands and agents in devflow/ subdirectories (working correctly) Result: - Skills are now discoverable: ~/.claude/skills/pattern-check/SKILL.md - Old structure cleaned automatically during upgrade - Commands still work: /devflow:code-review, /devflow:commit, etc. Fixes auto-activation for all 7 skills: - pattern-check, test-design, code-smell - research, debug, input-validation, error-handling --- src/cli/commands/init.ts | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/cli/commands/init.ts b/src/cli/commands/init.ts index 7e1ff448..40a7cdeb 100644 --- a/src/cli/commands/init.ts +++ b/src/cli/commands/init.ts @@ -164,7 +164,7 @@ export const initCommand = new Command('init') name: 'agents' }, { - target: path.join(claudeDir, 'skills', 'devflow'), + target: path.join(claudeDir, 'skills'), source: path.join(claudeSourceDir, 'skills', 'devflow'), name: 'skills' }, @@ -177,10 +177,39 @@ export const initCommand = new Command('init') // Clean old DevFlow files before installing for (const dir of devflowDirectories) { - try { - await fs.rm(dir.target, { recursive: true, force: true }); - } catch (e) { - // Directory might not exist on first install + if (dir.name === 'skills') { + // Special handling for skills: clean old nested structure and individual skills + // Remove old devflow/ subdirectory if it exists (migration from old structure) + const oldSkillsDir = path.join(claudeDir, 'skills', 'devflow'); + try { + await fs.rm(oldSkillsDir, { recursive: true, force: true }); + } catch (e) { + // Directory might not exist + } + + // Remove individual skill directories that we're about to reinstall + try { + const skillEntries = await fs.readdir(dir.source, { withFileTypes: true }); + for (const entry of skillEntries) { + if (entry.isDirectory()) { + const skillTarget = path.join(dir.target, entry.name); + try { + await fs.rm(skillTarget, { recursive: true, force: true }); + } catch (e) { + // Skill might not exist + } + } + } + } catch (e) { + // Source directory might not exist + } + } else { + // For other components (commands, agents, scripts), clean the entire directory + try { + await fs.rm(dir.target, { recursive: true, force: true }); + } catch (e) { + // Directory might not exist on first install + } } } From 1dc79cd566ca437760dbe9cfa3fde673b0e79d6c Mon Sep 17 00:00:00 2001 From: Dean Sharon Date: Tue, 4 Nov 2025 07:10:16 +0000 Subject: [PATCH 2/4] fix: update uninstall to remove flat skill structure Previously uninstall tried to remove ~/.claude/skills/devflow/ which no longer exists since skills are now in flat structure. Changes: - Remove individual skill directories instead of devflow/ subdirectory - Remove all 7 skills: pattern-check, test-design, code-smell, research, debug, input-validation, error-handling - Also clean up old devflow/ subdirectory if it exists (migration) - Show count of removed skills in output Result: - Uninstall now properly removes all skills - Install/uninstall cycle works correctly - Clean migration from old nested to new flat structure --- src/cli/commands/uninstall.ts | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/cli/commands/uninstall.ts b/src/cli/commands/uninstall.ts index 65ad74f0..e059c241 100644 --- a/src/cli/commands/uninstall.ts +++ b/src/cli/commands/uninstall.ts @@ -85,7 +85,6 @@ export const uninstallCommand = new Command('uninstall') const devflowDirectories = [ { path: path.join(claudeDir, 'commands', 'devflow'), name: 'commands' }, { path: path.join(claudeDir, 'agents', 'devflow'), name: 'agents' }, - { path: path.join(claudeDir, 'skills', 'devflow'), name: 'skills' }, { path: devflowScriptsDir, name: 'scripts' } ]; @@ -100,6 +99,40 @@ export const uninstallCommand = new Command('uninstall') } } + // Remove individual DevFlow skills (flat structure) + const skillsDir = path.join(claudeDir, 'skills'); + const devflowSkills = [ + 'pattern-check', + 'test-design', + 'code-smell', + 'research', + 'debug', + 'input-validation', + 'error-handling' + ]; + + let skillsRemoved = 0; + for (const skillName of devflowSkills) { + try { + const skillPath = path.join(skillsDir, skillName); + await fs.rm(skillPath, { recursive: true, force: true }); + skillsRemoved++; + } catch (error) { + // Skill might not exist, continue + } + } + + if (skillsRemoved > 0) { + console.log(` ✅ Removed ${skillsRemoved} DevFlow skills`); + } + + // Also remove old nested skills structure if it exists (migration cleanup) + try { + await fs.rm(path.join(claudeDir, 'skills', 'devflow'), { recursive: true, force: true }); + } catch { + // Old structure doesn't exist, ignore + } + console.log(); } From 09ec8e37f95d489e7f2285dd14f56a303b1fb3a4 Mon Sep 17 00:00:00 2001 From: Dean Sharon Date: Tue, 4 Nov 2025 07:11:22 +0000 Subject: [PATCH 3/4] docs: update skill installation paths in documentation Skills are now installed flat for Claude Code auto-discovery. Updated documentation to reflect the correct structure. Changes: - README.md: Update installation path descriptions - CLAUDE.md: Update file structure and installation paths - Add note explaining why skills use flat structure Before: ~/.claude/skills/devflow/pattern-check/ After: ~/.claude/skills/pattern-check/ --- CLAUDE.md | 6 ++++-- README.md | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index bafa5d7b..b136ef76 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -414,7 +414,7 @@ src/ └── claude/ # Claude Code assets ├── agents/devflow/ # Sub-agent definitions ├── commands/devflow/ # Slash command definitions - ├── skills/devflow/ # Auto-activate skill definitions + ├── skills/devflow/ # Skill source (installed flat) ├── scripts/ # Supporting scripts └── settings.json # Claude Code settings ``` @@ -422,10 +422,12 @@ src/ ### Installation Paths - Commands: `~/.claude/commands/devflow/` - Agents: `~/.claude/agents/devflow/` -- Skills: `~/.claude/skills/devflow/` +- Skills: `~/.claude/skills/` (flat structure - no devflow/ subdirectory) - Scripts: `~/.devflow/scripts/` - Settings: `~/.claude/settings.json` +**Note:** Skills are installed flat (directly under `skills/`) for Claude Code auto-discovery. Commands and agents use the `devflow/` subdirectory for namespacing. + ## Testing Guidelines ### Command Testing diff --git a/README.md b/README.md index 56bb59c2..2c7bedfb 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ Covers patterns for all major languages and operating systems. **User Scope** (default): - Installs commands to `~/.claude/commands/devflow/` - Installs sub-agents to `~/.claude/agents/devflow/` -- Installs skills to `~/.claude/skills/devflow/` +- Installs skills to `~/.claude/skills/` (flat structure for auto-discovery) - Installs scripts to `~/.devflow/scripts/` - Updates `~/.claude/settings.json` (statusline and model) - Creates `.claudeignore` at git repository root @@ -211,7 +211,7 @@ Covers patterns for all major languages and operating systems. **Local Scope** (`--scope local`): - Installs commands to `/.claude/commands/devflow/` - Installs sub-agents to `/.claude/agents/devflow/` -- Installs skills to `/.claude/skills/devflow/` +- Installs skills to `/.claude/skills/` (flat structure for auto-discovery) - Installs scripts to `/.devflow/scripts/` - Creates `/.claude/settings.json` (statusline and model) - Creates `.claudeignore` at git repository root @@ -287,7 +287,7 @@ src/ └── claude/ # Claude Code configuration ├── agents/devflow/ # Sub-agent definitions (.md) ├── commands/devflow/ # Slash command definitions (.md) - ├── skills/devflow/ # Auto-activate skill definitions (.md) + ├── skills/devflow/ # Skill source (installed flat to ~/.claude/skills/) ├── scripts/ # statusline.sh └── settings.json # Claude Code settings ``` From 88fdaf4956af811ba102942775d61f6ee54cfe39 Mon Sep 17 00:00:00 2001 From: Dean Sharon Date: Tue, 4 Nov 2025 07:12:50 +0000 Subject: [PATCH 4/4] docs: remove internal implementation details from user docs Users don't need to know about flat structure - that's an internal implementation detail. Removed '(flat structure for auto-discovery)' comments from README as they add confusion without user value. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c7bedfb..cd7cf630 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ Covers patterns for all major languages and operating systems. **User Scope** (default): - Installs commands to `~/.claude/commands/devflow/` - Installs sub-agents to `~/.claude/agents/devflow/` -- Installs skills to `~/.claude/skills/` (flat structure for auto-discovery) +- Installs skills to `~/.claude/skills/` - Installs scripts to `~/.devflow/scripts/` - Updates `~/.claude/settings.json` (statusline and model) - Creates `.claudeignore` at git repository root @@ -211,7 +211,7 @@ Covers patterns for all major languages and operating systems. **Local Scope** (`--scope local`): - Installs commands to `/.claude/commands/devflow/` - Installs sub-agents to `/.claude/agents/devflow/` -- Installs skills to `/.claude/skills/` (flat structure for auto-discovery) +- Installs skills to `/.claude/skills/` - Installs scripts to `/.devflow/scripts/` - Creates `/.claude/settings.json` (statusline and model) - Creates `.claudeignore` at git repository root