feat: Add OpenCode rule profile with AGENTS.md and MCP config (#970)

* add opencode to profile lists

* add opencode profile / modify mcp config after add

* add changeset

* not necessary; main config being updated

* add issue link

* add/fix tests

* fix url and docsUrl

* update test for new urls

* fix formatting

* update/fix tests
This commit is contained in:
Joe Danziger
2025-07-16 13:01:02 -04:00
committed by Ralph Khreish
parent 88c434a939
commit 36c4a7a869
10 changed files with 605 additions and 38 deletions

View File

@@ -19,6 +19,7 @@ describe('Rule Transformer - General', () => {
'codex',
'cursor',
'gemini',
'opencode',
'roo',
'trae',
'vscode',
@@ -211,6 +212,11 @@ describe('Rule Transformer - General', () => {
mcpConfigName: 'settings.json',
expectedPath: '.gemini/settings.json'
},
opencode: {
mcpConfig: true,
mcpConfigName: 'opencode.json',
expectedPath: 'opencode.json'
},
roo: {
mcpConfig: true,
mcpConfigName: 'mcp.json',
@@ -253,11 +259,19 @@ describe('Rule Transformer - General', () => {
const profileConfig = getRulesProfile(profile);
if (profileConfig.mcpConfig !== false) {
// Profiles with MCP configuration should have valid paths
// The mcpConfigPath should start with the profileDir
if (profile === 'claude') {
// Claude uses root directory (.), so path.join('.', '.mcp.json') = '.mcp.json'
expect(profileConfig.mcpConfigPath).toBe('.mcp.json');
// Handle root directory profiles differently
if (profileConfig.profileDir === '.') {
if (profile === 'claude') {
// Claude explicitly uses '.mcp.json'
expect(profileConfig.mcpConfigPath).toBe('.mcp.json');
} else {
// Other root profiles normalize to just the filename
expect(profileConfig.mcpConfigPath).toBe(
profileConfig.mcpConfigName
);
}
} else {
// Non-root profiles should have profileDir/configName pattern
expect(profileConfig.mcpConfigPath).toMatch(
new RegExp(
`^${profileConfig.profileDir.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}/`