Skip to content

Conversation

@LeekJay
Copy link

@LeekJay LeekJay commented Jan 29, 2026

Summary

Add recursive directory scanning to discover skills in nested directories like superpowers (e.g., skills/superpowers/brainstorming/SKILL.md).

Problem

Currently, the skill loader only scans one level deep in ~/.config/opencode/skills/. When superpowers is installed following the official documentation:

ln -s ~/.config/opencode/superpowers/skills ~/.config/opencode/skills/superpowers

The resulting structure is:

~/.config/opencode/skills/superpowers/
├── brainstorming/
│   └── SKILL.md
├── systematic-debugging/
│   └── SKILL.md
└── ...

The loader sees superpowers as a directory, looks for superpowers/SKILL.md (doesn't exist), and stops - never discovering the nested skills.

Solution

  • Add namePrefix, depth, and maxDepth parameters to loadSkillsFromDir
  • Recurse into subdirectories when no SKILL.md found at current level
  • Construct hierarchical skill names (e.g., superpowers/brainstorming)
  • Limit recursion depth to 2 levels to prevent infinite loops

Changes

  • src/features/opencode-skill-loader/loader.ts: Add recursive scanning logic
  • src/features/opencode-skill-loader/loader.test.ts: Add tests for nested skill discovery

Testing

All existing tests pass, plus 4 new tests for nested skill discovery:

  • Discovers skills in nested directories (superpowers pattern)
  • Discovers multiple skills in nested directories
  • Respects max depth limit
  • Flat skills still work alongside nested skills
bun test src/features/opencode-skill-loader/
# 66 pass, 0 fail

Related


Summary by cubic

Adds recursive scanning to the skill loader to discover skills in nested directories. This enables compatibility with superpowers-installed skills and keeps flat skills working.

  • New Features
    • Recursively scans subdirectories up to 2 levels when no SKILL.md is found at the current level.
    • Builds hierarchical skill names from directory paths (e.g., superpowers/brainstorming).
    • Adds namePrefix, depth, and maxDepth parameters; updates loadSkillFromPath; tests cover nested discovery and depth limits.

Written for commit 64b29ea. Summary will update on new commits.

Add recursive directory scanning to discover skills in nested directories
like superpowers (e.g., skills/superpowers/brainstorming/SKILL.md).

Changes:
- Add namePrefix, depth, and maxDepth parameters to loadSkillsFromDir
- Recurse into subdirectories when no SKILL.md found at current level
- Construct hierarchical skill names (e.g., 'superpowers/brainstorming')
- Limit recursion depth to 2 levels to prevent infinite loops

This enables compatibility with the superpowers plugin which installs
skills as: ~/.config/opencode/skills/superpowers/ -> superpowers/skills/

Fixes skill discovery for nested directory structures.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@LeekJay
Copy link
Author

LeekJay commented Jan 29, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 29, 2026
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