Skip to content

fix: install skills in flat structure for auto-discovery#18

Merged
dean0x merged 4 commits intomainfrom
fix/skills-flat-structure
Nov 4, 2025
Merged

fix: install skills in flat structure for auto-discovery#18
dean0x merged 4 commits intomainfrom
fix/skills-flat-structure

Conversation

@dean0x
Copy link
Owner

@dean0x dean0x commented Nov 4, 2025

Summary

Skills were not auto-activating because they were installed in a nested directory structure that Claude Code couldn't discover. This PR fixes the installation to use a flat structure.

Problem

  • Before: Skills installed to ~/.claude/skills/devflow/pattern-check/SKILL.md
  • Issue: Claude Code expects ~/.claude/skills/pattern-check/SKILL.md
  • Result: Skills existed but were never discovered or activated

Commands and agents support subdirectory namespacing, but skills require flat structure for auto-discovery.

Changes

Installation (init.ts)

  • Install skills directly under ~/.claude/skills/ instead of ~/.claude/skills/devflow/
  • Add migration cleanup for old nested structure
  • Preserve user's personal skills during upgrade

Uninstallation (uninstall.ts)

  • Remove individual skill directories (pattern-check, test-design, etc.)
  • Clean up old nested structure if it exists
  • Show count of removed skills in output

Documentation

  • Update CLAUDE.md with technical explanation of flat structure requirement
  • Keep README.md clean (users don't need implementation details)

Testing

  • ✅ Skills now appear in Claude's <available_skills>
  • ✅ All 7 skills discovered: pattern-check, test-design, code-smell, research, debug, input-validation, error-handling
  • ✅ Install/uninstall cycle works correctly
  • ✅ Migration from old nested structure works automatically
  • ✅ User's personal skills preserved during upgrade

Impact

Before this fix:

  • Skills were dormant (installed but not discovered)
  • No auto-activation
  • Users had non-functional skill system

After this fix:

  • Skills are discovered by Claude Code
  • Auto-activation works as documented
  • Clean migration for existing installations

🎯 This unblocks the core value proposition of DevFlow's quality enforcement system.

Dean Sharon added 4 commits November 3, 2025 22:54
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
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
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/
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.
@dean0x dean0x merged commit 248ef8f into main Nov 4, 2025
@dean0x dean0x deleted the fix/skills-flat-structure branch November 4, 2025 07:14
dean0x pushed a commit that referenced this pull request Mar 14, 2026
Batch 1 — Mechanical fixes:
- Fix duplicate step 5→6 in 4 explorer prompts (implement-teams.md)
- Fix fractional 2.5→3 renumbering in 4 reviewer prompts (code-review-teams.md)
- Fix fractional 1.5→2 renumbering in reviewer.md responsibilities
- Update stale counts: 24→31 skills, 8→17 plugins (file-organization.md)
- Add missing ambient-prompt.sh to hooks listing (file-organization.md)

Batch 2 — DRY extraction via knowledge-persistence skill:
- Create shared/skills/knowledge-persistence/SKILL.md with canonical procedure
  (ADR/PF formats, lock protocol, capacity cap, dedup, TL;DR update)
- Replace 8 inline extraction procedures with skill references in
  implement, code-review, debug, resolve (base + teams variants)
- Register skill in 4 plugin manifests (plugin.json + plugins.ts)

Batch 3 — Hook improvements:
- Collapse head+sed+grep into single sed -n for TL;DR extraction
- Guard section joins to prevent leading newlines when Section 1 skipped

Batch 4 — Quick fixes:
- Add TL;DR-only rationale comment to skimmer.md step 6
- Log createMemoryDir errors in verbose mode instead of silent catch
- Add 3 hook integration tests (TL;DR injection, no leading newlines,
  no knowledge section when files absent)

Issues dismissed: #9 (TL;DR sanitization — trust model), #10 (integrity
verification — instruction-enforced), #17 (mkdir failure test — low value),
#18 (phase ordering cosmetic), #19 (intentional scope exclusion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant