diff --git a/README.md b/README.md index 866ba70..63e8815 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ Edit the `config.json` file to define your setup. Config must specify at least one of `global`, `globalOverrides`, or `projects`. +> **Note:** OpenCode reads `~/.config/opencode/AGENTS.md` for global rules and falls back to `~/.claude/CLAUDE.md` only when the OpenCode-specific file is absent. If you configure both `claude` and `opencode` globals, the OpenCode file takes precedence and no duplication occurs. + ### 3\. Synchronize Rules To synchronize the rules for all configured projects, run the default command: diff --git a/src/config/loader.createSampleConfig.test.ts b/src/config/loader.createSampleConfig.test.ts index da61084..c47df3f 100644 --- a/src/config/loader.createSampleConfig.test.ts +++ b/src/config/loader.createSampleConfig.test.ts @@ -27,6 +27,9 @@ describe("createSampleConfig", () => { const content = vi.mocked(fs.writeFile).mock.calls[0]?.[1] as string; expect(content).toContain('"rulesSource"'); expect(content).toContain('"global-rules/*.md"'); + expect(content).toContain('"globalOverrides"'); + expect(content).toContain('"claude"'); + expect(content).toContain('"codex"'); expect(content).toContain('"projects"'); }); diff --git a/src/config/loader.ts b/src/config/loader.ts index f014239..57a2ae9 100644 --- a/src/config/loader.ts +++ b/src/config/loader.ts @@ -18,6 +18,10 @@ import type { Config as ConfigShape } from "./config.js"; const SAMPLE_CONFIG = { rulesSource: "/path/to/rules", global: ["global-rules/*.md"], + globalOverrides: { + claude: ["claude-specific/*.md"], + codex: ["codex-specific/*.md"], + }, projects: [ { path: "/path/to/project",