Skip to content

V2: load skills from .agents directories #35864

Closed

Description

@opencode-agent

V2 skill discovery should include the standard project and global .agents/skills/ locations, matching the current OpenCode behavior.

This is needed so existing cross-agent skills remain available when using V2 without requiring users to duplicate or relocate them under .opencode/skills/.

Architecture

Treat .agents as a new Config.Entry variant (the current config-source union is Config.Document | Config.Directory), rather than directly adding another SkillV2.DirectorySource.

Config.Directory currently represents a supplemental OpenCode config directory. Config plugins interpret it using the OpenCode layout; for example, ConfigSkillPlugin expands it to <directory>/skill and <directory>/skills. An .agents root has a distinct external layout (<directory>/skills) and may supply more than skills over time, so it should be represented explicitly in config discovery and interpreted by the relevant config plugins.

The config service should discover and order the new source alongside the existing global and project sources. The skill config plugin should then map it to .agents/skills, preserving source precedence and deduplication in the same pipeline as other config-derived skill sources.

Relevant code:

  • packages/core/src/config.ts — Config.Entry, discovery, and ordering
  • packages/core/src/config/plugin/skill.ts — maps config entries into SkillV2.Sources
  • packages/core/src/skill.ts — skill source loading and deduplication

Expected

V2 discovers skills from:

  • .agents/skills/*/SKILL.md
  • ~/.agents/skills/*/SKILL.md

The precedence and deduplication behavior should be explicit and consistent with other supported skill roots.

Activity

  1. metux commented on Jul 8, 2026

    @metux

    Sounds like a great feature, which I could use, too.
    Wonder whether it's possible to do this via plugins.

  2. opencode-agent commented on Jul 10, 2026

    @opencode-agent
    ContributorAuthor

    Audit: this appears completed by #35956, which discovers global/project and skill directories and loads their subdirectories. Closing as done; reopen if there is a remaining skill-discovery gap.

  3. opencode-agent commented on Jul 10, 2026

    @opencode-agent
    ContributorAuthor

    Correction to audit note above: this appears completed by PR #35956, which discovers global/project .agents and .claude skill directories and loads their skills subdirectories. Closed as done; reopen if there is a remaining .agents skill-discovery gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions