-
Notifications
You must be signed in to change notification settings - Fork 37
feat: add OpenCode and Codex to tool compatibility #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,4 @@ | ||||||
| { | ||||||
| "$schema": "https://opencode.ai/config.json", | ||||||
| "instructions": [".mex/AGENTS.md"] | ||||||
|
||||||
| "instructions": [".mex/AGENTS.md"] | |
| "instructions": [".mex/ROUTER.md"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AGENTS.md is intentional. It's the always-loaded anchor (~150 tokens) that then directs to ROUTER.md. All other tool configs embed the AGENTS.md content; OpenCode references it by path. Changing to ROUTER.md would skip the anchor layer.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,8 @@ const TOOL_CONFIGS: Record<string, { src: string; dest: string }> = { | |
| "2": { src: ".tool-configs/.cursorrules", dest: ".cursorrules" }, | ||
| "3": { src: ".tool-configs/.windsurfrules", dest: ".windsurfrules" }, | ||
| "4": { src: ".tool-configs/copilot-instructions.md", dest: ".github/copilot-instructions.md" }, | ||
| "5": { src: ".tool-configs/opencode.json", dest: ".opencode/opencode.json" }, | ||
| "6": { src: ".tool-configs/CLAUDE.md", dest: "AGENTS.md" }, // Codex reads AGENTS.md at root | ||
|
Comment on lines
44
to
+48
|
||
| }; | ||
|
|
||
| // ── Helpers ── | ||
|
|
@@ -309,11 +311,13 @@ async function selectToolConfig( | |
| console.log(" 2) Cursor"); | ||
| console.log(" 3) Windsurf"); | ||
| console.log(" 4) GitHub Copilot"); | ||
| console.log(" 5) Multiple (select next)"); | ||
| console.log(" 6) None / skip"); | ||
| console.log(" 5) OpenCode"); | ||
| console.log(" 6) Codex (OpenAI)"); | ||
| console.log(" 7) Multiple (select next)"); | ||
| console.log(" 8) None / skip"); | ||
| console.log(); | ||
|
|
||
| const choice = (await rl.question("Choice [1-6] (default: 1): ")).trim() || "1"; | ||
| const choice = (await rl.question("Choice [1-8] (default: 1): ")).trim() || "1"; | ||
|
|
||
| let selectedClaude = false; | ||
|
|
||
|
|
@@ -352,16 +356,18 @@ async function selectToolConfig( | |
| case "2": | ||
| case "3": | ||
| case "4": | ||
| case "5": | ||
| case "6": | ||
| copyConfig(choice); | ||
| break; | ||
| case "5": { | ||
| const multi = (await rl.question("Enter tool numbers separated by spaces (e.g. 1 2 4): ")).trim(); | ||
| case "7": { | ||
| const multi = (await rl.question("Enter tool numbers separated by spaces (e.g. 1 2 5): ")).trim(); | ||
| for (const c of multi.split(/\s+/)) { | ||
| copyConfig(c); | ||
| } | ||
| break; | ||
| } | ||
| case "6": | ||
| case "8": | ||
| info("Skipped tool config — AGENTS.md in .mex/ works with any tool that can read files"); | ||
| break; | ||
| default: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Tool Configuration Files | ||
|
|
||
| These files make the scaffold work with specific AI coding tools. | ||
| Most embed the same content — a pointer to `.mex/ROUTER.md`. OpenCode uses a JSON config that references `.mex/AGENTS.md` instead. | ||
|
|
||
| ## Which file does your tool use? | ||
|
|
||
| | Tool | File to use | | ||
| |------|-------------| | ||
| | Claude Code | `CLAUDE.md` → copy or symlink to project root | | ||
| | Cursor | `.cursorrules` → copy or symlink to project root | | ||
| | Windsurf | `.windsurfrules` → copy or symlink to project root | | ||
| | GitHub Copilot | `copilot-instructions.md` → copy to `.github/` in project root | | ||
| | OpenCode | `opencode.json` → copy to `.opencode/` in project root | | ||
| | Codex (OpenAI) | Copy `CLAUDE.md` as `AGENTS.md` to project root | | ||
| | Any other tool | Point agent to `.mex/AGENTS.md` | | ||
|
Comment on lines
+12
to
+16
|
||
|
|
||
| ## Setup | ||
|
|
||
| Copy the relevant file to the correct location in your project root: | ||
|
|
||
| ```bash | ||
| # Claude Code | ||
| cp .tool-configs/CLAUDE.md ./CLAUDE.md | ||
|
|
||
| # Cursor | ||
| cp .tool-configs/.cursorrules ./.cursorrules | ||
|
|
||
| # Windsurf | ||
| cp .tool-configs/.windsurfrules ./.windsurfrules | ||
|
|
||
| # Copilot | ||
| mkdir -p .github && cp .tool-configs/copilot-instructions.md ./.github/copilot-instructions.md | ||
|
|
||
| # OpenCode | ||
| mkdir -p .opencode && cp .tool-configs/opencode.json ./.opencode/opencode.json | ||
|
|
||
| # Codex (OpenAI) | ||
| cp .tool-configs/CLAUDE.md ./AGENTS.md | ||
| ``` | ||
|
|
||
| ## If your tool is not listed | ||
|
|
||
| Add "Read .mex/ROUTER.md before starting any task" to your tool's system prompt | ||
| or paste it at the start of each session. The scaffold works identically. | ||
|
|
||
| ## Content | ||
|
|
||
| Most files embed the Circle 1 anchor from `.mex/AGENTS.md`. OpenCode's `opencode.json` references it by path instead. | ||
| `.mex/AGENTS.md` is the source of truth. If you update it, update your root tool config too. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,4 @@ | ||||||
| { | ||||||
| "$schema": "https://opencode.ai/config.json", | ||||||
| "instructions": [".mex/AGENTS.md"] | ||||||
|
||||||
| "instructions": [".mex/AGENTS.md"] | |
| "instructions": [".mex/ROUTER.md"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above — AGENTS.md is the correct entry point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This table is introduced as “All contain the same content”, but the new OpenCode entry uses
opencode.json, which does not contain the same markdown content as the other tool configs (it references.mex/AGENTS.md). Please adjust the wording to reflect the OpenCode/Codex behavior (e.g., “most contain…” or call out the JSON indirection) to avoid misleading setup instructions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 0576b57.