Skip to content

feat(skills): add explicit skill sources - #49114

Open
Studnicky wants to merge 2 commits into
anomalyco:devfrom
Studnicky:feat/explicit-skill-sources
Open

Studnicky wants to merge 2 commits into
anomalyco:devfrom
Studnicky:feat/explicit-skill-sources

Conversation

@Studnicky

@Studnicky Studnicky commented Sep 15, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #49108

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

OpenCode discovers skills from several compatibility directories. Separate Claude, Agent, OpenCode, model-version, and A/B skill trees can intentionally contain the same skill directory names, but the current loader stores them under one name-keyed collection and loads them concurrently. This makes collisions ambiguous and can fail while constructing the system prompt.

This PR adds explicit skill source configuration:

{
  "skills": {
    "sources": [
      { "id": "opencode", "path": "~/.config/opencode/skills", "enabled": true },
      { "id": "agents", "path": "~/.agents/skills", "enabled": true },
      { "id": "claude", "path": "~/.claude/skills", "enabled": true }
    ],
    "collision": "source-qualified"
  }
}

Explicit sources replace implicit compatibility-root discovery. In source-qualified mode, same-named skills remain separate as claude/review and agents/review. In last-wins mode, duplicate selection is deterministic because discovered files load in stable order. Existing discovery behavior remains unchanged when explicit sources are absent. Malformed skill files continue through the existing diagnostic path without crashing.

The implementation is limited to configuration schema, skill discovery, deterministic loading, and regression coverage. It does not replace or duplicate the compatibility-loader refactor in #48881; it adds the user-facing source-selection and collision policy on top of the loader contract.

How did you verify your code works?

  • bun test test/skill/skill.test.ts: 19 passed, 0 failed, 53 assertions
  • bun run typecheck: passed
  • bunx prettier --check: passed
  • bunx oxlint: 0 warnings, 0 errors
  • Local fork runtime check: debug skill --pure reported both agents/review and claude/review from an isolated config
  • Repository pre-push hook: 30 typecheck tasks passed

Screenshots / recordings

Not applicable; this is a configuration and backend behavior change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found one potentially related PR:

Related PR:

Other potentially adjacent PRs:

The most likely duplicate or closely related work would be PR #48881 since it's explicitly about unifying skill loading logic, which could conflict with or complement the explicit skill sources feature you're adding.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

[FEATURE]: explicit skill sources and source-qualified duplicates

1 participant