docs: document ~/.opencode as valid global config directory #6174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Statement
What pain point in the dev workflow does this address?
Users who version control their OpenCode configurations in
~/.opencode/(instead of~/.config/opencode/) found that the documentation was inconsistent about which paths are valid for global configuration.What was the previous state?
~/.opencode/skill/and incorrectly listed.claude/skills/as supported~/.config/opencode/Why is this change needed now?
Issue #6171 reported this inconsistency. Users need clear documentation to properly organize their configurations.
Technical Changes
High-level approach:
Updated all configuration documentation to consistently document both
~/.config/opencode/and~/.opencode/as valid global configuration directories.Key components modified/added:
packages/web/src/content/docs/skills.mdx- Complete rewrite with table format, XDG notepackages/web/src/content/docs/agents.mdx- Added ~/.opencode/agent/packages/web/src/content/docs/commands.mdx- Added ~/.opencode/command/packages/web/src/content/docs/modes.mdx- Added ~/.opencode/mode/packages/web/src/content/docs/plugins.mdx- Added ~/.opencode/plugin/packages/web/src/content/docs/custom-tools.mdx- Added ~/.opencode/tool/packages/web/src/content/docs/config.mdx- Updated agent/command referencesDesign decisions and rationale:
The code in
packages/opencode/src/config/config.ts(lines 70-86) shows that BOTH paths are scanned:And lines 108-112 confirm ALL features use this same directory list:
Skills also use
Config.directories()inpackages/opencode/src/skill/skill.ts.Alternatives considered:
Could have documented only
~/.config/opencode/as the canonical path, but since~/.opencode/is actively supported in the code and some users prefer it for dotfiles management, documenting both is the correct approach.Dependencies added/updated:
Impact
For Developers
New commands/workflows available:
No new commands - this is documentation only.
Changed behavior:
None - the code already supported both paths.
Breaking changes:
For AI Agents
Can agents discover and use the new functionality?
How does this enhance agent capabilities?
N/A - documentation fix only.
Verification
Automated Tests
Manual Testing
.claude/skills/reference (not supported in code)Manual testing steps performed:
packages/opencode/src/config/config.tslines 70-112packages/opencode/src/skill/skill.tsto confirm it uses Config.directories().claude/skills- confirmed it's NOT supportedRelated Work
Related PRs/Issues:
Changelog Entry
Type: docs
Summary (1-2 lines):
Document that both
~/.config/opencode/and~/.opencode/are valid global configuration directories for all features (agents, commands, modes, plugins, skills, tools).Full entry: