You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ab85ac4
Browse filesBrowse the repository at this point in the historyBrowse files
feat(config): prefer redcode.json with opencode.json fallback (#32)
* feat(config): prefer redcode.json with opencode.json fallback
The global config directory is already `~/.config/redcode/`, but the file
inside it was still OpenCode-named, so the effective path read as an
accident. Teach every config scope to prefer the Redcode-named file while
continuing to accept the OpenCode-named one.
Precedence follows the shape the loader already had. A directory's config
names are merged, not shadowed — `opencode.json` and `opencode.jsonc`
already merged with the later name winning — so `redcode.json` and
`redcode.jsonc` are appended to that list rather than replacing it. Both
files apply and the Redcode-named one wins the fields they share.
Directory proximity still outranks the file name.
Nothing is created beside an existing config. The global seed and the
`opencode mcp add` target only use a Redcode name when no config exists at
all; otherwise the file already on disk is edited in place.
Also point the `customize-opencode` skill at `~/.config/redcode/`, which
has been the real config directory since the directory rename.
Claude-Session: https://claude.ai/code/session_016rycAgbtqsRQH4qBv8nkE7
* fix(core): create redcode.json when hook import has no config to edit
`Hook.importClaude` writes into the project's highest-priority config
document, which now correctly resolves to a Redcode-named file when one
exists. Only a project with no config at all falls through to creating one,
and that path still used the OpenCode name — the one remaining place where
a brand-new file would be created under the old name.
Claude-Session: https://claude.ai/code/session_016rycAgbtqsRQH4qBv8nkE7
Prefer `redcode.json` / `redcode.jsonc` for global and project configuration, keeping `opencode.json` / `opencode.jsonc` as a fallback.
6
+
7
+
The global config directory is already `~/.config/redcode/`, but the file inside it was still OpenCode-named. Both names are now read everywhere, in every scope. Existing configs keep working with no migration and no warning: when a directory holds both names they are merged exactly the way `opencode.json` and `opencode.jsonc` already merge, with the Redcode-named file winning the fields they share. Directory proximity still outranks the file name, so a nested `opencode.json` beats a `redcode.json` further up.
8
+
9
+
Files are never created beside an existing config. A global config or an `opencode mcp add` target is only written under the Redcode name when no config exists at all; otherwise the file already on disk is edited in place.
10
+
11
+
The `customize-opencode` skill no longer points the agent at `~/.config/opencode/`, which has not been the config directory since the directory rename.
Copy file name to clipboardExpand all lines: packages/core/src/plugin/skill.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ export const Plugin = define({
20
20
skill: SkillV2.Info.make({
21
21
name: "customize-opencode",
22
22
description:
23
-
"Use ONLY when the user is editing or creating opencode's own configuration: opencode.json, opencode.jsonc, files under .opencode/, or files under ~/.config/opencode/. Also use when creating or fixing opencode agents, subagents, commands, skills, plugins, MCP servers, or permission rules. Do not use for the user's own application code, or for any project that is not configuring opencode itself.",
23
+
"Use ONLY when the user is editing or creating opencode's own configuration: redcode.json, redcode.jsonc, the legacy opencode.json and opencode.jsonc, files under .opencode/, or files under ~/.config/redcode/. Also use when creating or fixing opencode agents, subagents, commands, skills, plugins, MCP servers, or permission rules. Do not use for the user's own application code, or for any project that is not configuring opencode itself.",
0 commit comments