Skip to content

feat: add OpenCode and Codex to tool compatibility#16

Merged
theDakshJaitly merged 2 commits intomainfrom
feat/opencode-codex
Apr 5, 2026
Merged

feat: add OpenCode and Codex to tool compatibility#16
theDakshJaitly merged 2 commits intomainfrom
feat/opencode-codex

Conversation

@theDakshJaitly
Copy link
Copy Markdown
Owner

Summary

  • Add OpenCode and Codex (OpenAI) as options 5 and 6 in the mex setup tool selection menu
  • OpenCode: creates .opencode/opencode.json with instructions field pointing to .mex/AGENTS.md
  • Codex: copies AGENTS.md template to project root (Codex reads it natively — no subdirectory support)
  • Updated setup.sh bash script with matching menu changes
  • Updated README, .tool-configs/README.md, and bundled templates

Closes #12

Test plan

  • npx promexeus setup → select option 5 (OpenCode) → verify .opencode/opencode.json created
  • npx promexeus setup → select option 6 (Codex) → verify AGENTS.md at project root
  • npx promexeus setup → select option 7 (Multiple) → select 1 5 6 → all three configs created
  • --dry-run works for new options
  • Existing tests pass (npm test)

🤖 Generated with Claude Code

Add OpenCode and Codex (OpenAI) as supported AI tools in the setup
menu. OpenCode uses .opencode/opencode.json with an instructions field
pointing to .mex/AGENTS.md. Codex reads a root-level AGENTS.md natively.

Closes #12
Copilot AI review requested due to automatic review settings April 5, 2026 00:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds OpenCode and Codex (OpenAI) as supported tool configurations in mex setup, including new template/config files and documentation updates.

Changes:

  • Added OpenCode and Codex options to the interactive setup menu (src/setup/index.ts) and setup.sh.
  • Introduced OpenCode config (opencode.json) in both .tool-configs/ and templates/.tool-configs/.
  • Updated compatibility documentation in README.md and tool-config READMEs.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/setup/index.ts Adds menu options and copy destinations for OpenCode/Codex configs.
setup.sh Mirrors the updated tool-selection menu and copy logic for new configs.
README.md Extends the multi-tool compatibility table with OpenCode/Codex.
.tool-configs/README.md Documents new tool config locations and setup commands.
.tool-configs/opencode.json Adds OpenCode configuration pointing at scaffold instructions.
templates/.tool-configs/README.md Adds the same documentation to the packaged templates.
templates/.tool-configs/opencode.json Adds the OpenCode config template for mex setup to copy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

README.md Outdated
| OpenCode | `.opencode/opencode.json` |
| Codex (OpenAI) | `AGENTS.md` |

All config files contain identical content. `mex setup` asks which tool you use and copies the right one.
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README claims “All config files contain identical content”, but OpenCode uses a JSON config that only references .mex/AGENTS.md rather than embedding the same markdown content. Please update this statement (and/or clarify that OpenCode is an exception and what it points to) so docs match the actual generated files.

Suggested change
All config files contain identical content. `mex setup` asks which tool you use and copies the right one.
Most config files contain the same instructions directly. OpenCode is the exception: `.opencode/opencode.json` points to `.mex/AGENTS.md` instead of embedding the markdown content. `mex setup` asks which tool you use and creates the appropriate config.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0576b57 — updated wording to clarify OpenCode references AGENTS.md by path instead of embedding content.

Comment on lines 13 to 16
| 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` |
Copy link

Copilot AI Apr 5, 2026

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0576b57.

Comment on lines +12 to +16
| 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` |
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This templates README says “All contain the same content”, but opencode.json is JSON and only references .mex/AGENTS.md instead of containing the same markdown content. Please update the wording to reflect the OpenCode/Codex behavior so generated docs are accurate.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0576b57.

Comment on lines 44 to +48
"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
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description/issue #12 mention updating drift checking to include the new tool config(s), but drift’s project-root tool-config scan currently only includes CLAUDE.md, .cursorrules, and .windsurfrules (see src/drift/index.ts:98). With OpenCode/Codex support added here, drift should also consider .opencode/opencode.json and AGENTS.md (and likely .github/copilot-instructions.md) when present, otherwise changes to those files won’t be detected.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid point — drift checking should include the new tool configs. Out of scope for this PR; tracked as a follow-up.

@@ -0,0 +1,4 @@
{
"$schema": "https://opencode.ai/config.json",
"instructions": [".mex/AGENTS.md"]
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config points OpenCode at .mex/AGENTS.md, while the surrounding docs describe tool configs as pointing to .mex/ROUTER.md / having identical embedded content. Please make the project’s guidance consistent (either change this to reference .mex/ROUTER.md if that’s what OpenCode should load, or update the READMEs to explicitly document that OpenCode loads .mex/AGENTS.md).

Suggested change
"instructions": [".mex/AGENTS.md"]
"instructions": [".mex/ROUTER.md"]

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

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.

@@ -0,0 +1,4 @@
{
"$schema": "https://opencode.ai/config.json",
"instructions": [".mex/AGENTS.md"]
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config references .mex/AGENTS.md, but the templates/.tool-configs README claims tool configs all contain the same content / point to .mex/ROUTER.md. Please align the template config and documentation (either reference .mex/ROUTER.md here, or update the docs to call out the indirection via .mex/AGENTS.md).

Suggested change
"instructions": [".mex/AGENTS.md"]
"instructions": [".mex/ROUTER.md"]

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

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.

Address Copilot review — "all identical content" wording was
inaccurate after adding OpenCode's JSON config.
@theDakshJaitly theDakshJaitly self-assigned this Apr 5, 2026
@theDakshJaitly theDakshJaitly merged commit b01e81d into main Apr 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add OpenCode to supported tool configs

2 participants