Skip to content

feat(config): discover commands from .agents/commands and .claude/commands - #30629

Closed
mugnimaestra wants to merge 1 commit into
anomalyco:devfrom
mugnimaestra:feat/external-commands
Closed

feat(config): discover commands from .agents/commands and .claude/commands#30629
mugnimaestra wants to merge 1 commit into
anomalyco:devfrom
mugnimaestra:feat/external-commands

Conversation

@mugnimaestra

@mugnimaestramugnimaestra commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes#27972
Closes#14240

Type of change

  • New feature

What does this PR do?

Discovers slash commands from external directories (.agents/commands/, .claude/commands/) in addition to the existing .opencode/command(s)/ paths. Brings command discovery to parity with how skills are already discovered from multiple paths.

Commands placed in .agents/commands/ or .claude/commands/ are automatically discovered:

.agents/commands/deploy.md → /deploy
.claude/commands/review.md → /review

Custom paths via opencode.json:

{ "commands": { "paths": ["my-team/commands"] } }

Discovery precedence (lowest → highest): global ~/.agents/commands/ and ~/.claude/commands/, then project .agents/commands/ and .claude/commands/ (walking up), then commands.paths custom folders, then .opencode/command(s)/ (existing, wins).

How did you verify your code works?

  • bun typecheck from packages/opencode — no errors from changed files
  • bun test test/config/config.test.ts — 96/96 pass including 4 new tests:
    • loads commands from .agents/commands
    • loads commands from .claude/commands
    • .opencode/command overrides .agents/commands
    • loads commands from config.commands.paths
  • bun test test/skill/skill.test.ts — 16/16 pass, no regression
  • Full turbo typecheck passed on push (27 packages, 21/21 successful)

Checklist

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

…mands
Add external command discovery that mirrors the existing skill discovery
paths. Commands are now loaded from:
- ~/.agents/commands/ and ~/.claude/commands/ (global)
- .agents/commands/ and .claude/commands/ (project, walking up)
- Custom paths via config.commands.paths
.opencode/command(s)/ entries take precedence over external commands.
Also adds ConfigCommandsV1 schema with a paths field for custom command
folder paths, paralleling ConfigSkillsV1.
Closesanomalyco#27972Closesanomalyco#14240
@github-actionsgithub-actionsBot added contributor needs:compliance This means the issue will auto-close after 2 hours. labels Jun 3, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

I found one related PR that should be checked:

Related PR:

This PR appears related to command discovery from the .agents directory. Since PR #30629 (the current PR) closes issue #27972 and this related PR #27973 addresses similar functionality, you should verify whether #27973 is a duplicate or complementary work that might need to be coordinated or merged together.

@github-actionsgithub-actionsBot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jun 3, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

@mysticfall

Copy link
Copy Markdown

Can we reopen this PR? This is the last missing piece needed to standardise a workflow over 40+ subprojects in my company.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Support commands in .agents/commands [FEATURE]: Configurable search paths for commands and agents (parity with skills)

2 participants

@mugnimaestra@mysticfall