Skip to content

mcp-setup skill defaults to .mcp.json when no tool directory exists in consumer repos #120

Description

@yvonnedevlinrh

Describe the bug

The mcp-setup skill's Step 5 ("Detect Tool Environment") determines the active AI tool by scanning for .claude-plugin/, .opencode/, and .cursor-plugin/ directories. When none are found, it falls through to "Unknown" and defaults to writing .mcp.json in Claude Code format.

In consumer repos (repos that use complypack but are not the complypack repo itself), these directories typically don't exist at the time /comply-setup is first invoked. An OpenCode user in a fresh consumer repo gets Claude Code config format regardless of their actual tool.

#110 / PR #112 fixed the opencode.json format when OpenCode is detected, but the detection itself still relies on the .opencode/ directory already existing — which is a chicken-and-egg problem: the user is running /comply-setup precisely because they haven't set things up yet.

To Reproduce

  1. Clone a consumer repo that has no .opencode/, .claude-plugin/, or .cursor-plugin/ directories
  2. Place the mcp-setup skill in a location where OpenCode can load it (e.g., via lola's --append-context from .lola/modules/, or a global skillsdirectory)
  3. Run /comply-setup in OpenCode
  4. Step 5 scans for tool directories — none found — falls through to "Unknown"
  5. Skill writes .mcp.json in Claude Code format instead of opencode.json

Note: If the skill is installed via lola install ... -a opencode --scope project,lola creates .opencode/ first, which makes detection work as a side effect. But the skill's logic is still fragile for other installation paths.

Expected behavior

When no tool directories are found, the skill should ask the user which tool they are using instead of silently defaulting to Claude Code format:

No AI tool directories detected in this repository.
Which AI coding tool are you using?

  1. Claude Code
  2. OpenCode
  3. Cursor

Alternatively, the skill could detect the runtime environment through other signals (e.g., OpenCode sets specific environment variables or context that the skill could inspect).

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

Medium

Effort

None yet

Projects

Status
In progress 📋

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions