Skip to content

feat(skill): config option to control which default skill directories are scanned#1540

Open
juev wants to merge 1 commit into
XiaomiMiMo:mainfrom
juev:feat/configurable-skill-sources
Open

feat(skill): config option to control which default skill directories are scanned#1540
juev wants to merge 1 commit into
XiaomiMiMo:mainfrom
juev:feat/configurable-skill-sources

Conversation

@juev

@juev juev commented Jul 3, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #1561

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

On startup MiMo-Code scans the skill directories of other agent tools: ~/.claude, ~/.agents, ~/.codex and ~/.opencode, plus their project-local counterparts. That is convenient, but on a machine where several of these tools are installed side by side it causes a real problem: two tools often ship a skill with the same name, and which copy wins depends on scan order. The duplicate only shows up as a log warning, so from the user's point of view the result looks random. Today the only way to turn a source off is an environment variable, and the .agents directory has no switch at all.

This PR adds a skills.sources section to the config, one boolean per source:

{
  "skills": {
    "sources": {
      "claude": false,
      "codex": false
    }
  }
}

Available keys are builtin, compose, claude, agents, codex and opencode. Every key defaults to true, so nothing changes for existing setups — you only list the sources you want off. Disabling a source skips both its home-directory and project-local variants, because a half-disabled source would still produce the same name collisions. The existing MIMOCODE_DISABLE_* environment variables keep working and win over the config: they could only ever disable things, so an env-disabled source stays off no matter what the config says. Adding custom directories was already possible through skills.paths, so this PR deliberately does not duplicate that.

The docs page for skills got a new "Control skill sources" section, and while writing it I noticed the .codex locations were scanned by the code but missing from the docs, so they are listed now too.

One thing I intentionally left out: regenerating the JS SDK types. Running the SDK build script on a clean main already produces ~700 lines of unrelated churn (the checked-in generated file is behind the current OpenAPI output), and I did not want to bury a small feature in that. If you'd rather have the regen included here, say the word.

How did you verify your code works?

Followed TDD: added five tests to the skill test suite first (disable .claude, .codex, .agents at project level, disable .claude at the global home level, and one making sure an unrelated sources entry does not affect other sources), watched four of them fail, then implemented the change and watched all of them pass. Full skill suite (18 tests), the config test suite and bun typecheck across all packages pass. Also verified manually that with no sources section behavior is byte-for-byte the old one, since every check defaults to enabled.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…directories

MiMo-Code scans ~/.claude, ~/.agents, ~/.codex and ~/.opencode (plus their
project-local counterparts) for skills. When several agent tools are
installed side by side, same-name skills collide and which copy wins is
effectively random from the user's point of view. The only way to turn a
source off was an environment variable, and .agents had no switch at all.

Add an optional skills.sources map to the config schema with one boolean
per source: builtin, compose, claude, agents, codex, opencode. Every key
defaults to true, so existing setups are unaffected. Disabling a source
skips both its global and project-local directories. The existing
MIMOCODE_DISABLE_* environment variables keep working and take
precedence over the config.

Also document the .codex skill locations that were already scanned but
missing from the skills docs.
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.

[FEATURE]: Allow disabling individual default skill sources via config (skills.sources)

1 participant