Skip to content

Scope skill remove --mcp to named agents - #525

Draft
xsh310 wants to merge 1 commit into
xshen/skill-removefrom
xshen/skill-per-agent-remove
Draft

Scope skill remove --mcp to named agents#525
xsh310 wants to merge 1 commit into
xshen/skill-removefrom
xshen/skill-per-agent-remove

Conversation

@xsh310

@xsh310 xsh310 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

What

Adds an --agents option to ucode skill remove --mcp so a schema can be removed from a chosen subset of configured agents and kept on the rest, mirroring ucode mcp remove --agents. This is the core bug fix in the series.

The bug

Before per-agent scopes, an all-agent add wrote a shared layer while a per-agent remove edited a separate one, so they did not compose: skill add --mcp X (all) followed by skill remove --mcp --agents claude was a silent no-op, and often printed a misleading "nothing to remove". Now that developer scope is a single per-agent map, the two operations act on the same layer.

How

  • remove_skills_command(agents=None) forwards agents to setup_mcp_clients, which scopes the client set. The picker offers only those clients' schemas and removal edits only their maps; other agents keep the schema and are not re-registered.
  • The "nothing to remove" note names the scope when --agents was given.
  • cli.py: skill remove gains the --agents option; without it, removal stays global.

Tests

  • test_mcp.py: add-all then remove --agents claude removes the schema for claude only and re-registers only claude; the picker is offered only the named clients' scope; an empty named scope is a no-op.
  • test_cli.py: --mcp forwards agents=None; --mcp --agents claude,codex forwards the parsed set.

uv run pytest tests/test_mcp.py tests/test_cli.py tests/test_lint.py is green.

Stacking

Fourth in the stacked per-agent skills series, based on xshen/skill-remove (#524). Reviewing the diff against that base shows just this change. It rebuilds behavior originally designed by Arthur Jenoudet on the current per-client-map state model.

This pull request and its description were written by Isaac.

Give `ucode skill remove --mcp` an `--agents` option so a schema can be removed
from a chosen subset of configured agents and kept on the rest, mirroring
`ucode mcp remove --agents`. `remove_skills_command` takes an optional `agents`
set and forwards it to `setup_mcp_clients`, which scopes the client set; the
picker then offers only those clients' schemas and removal edits only their maps.

This closes the compose gap: `skill add --mcp X` (all agents) followed by
`skill remove --mcp --agents claude` now removes X from claude while codex keeps
it, and the schema is actually offered instead of the false "nothing to remove".

Co-authored-by: Arthur Jenoudet <arthur.jenoudet@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@xsh310
xsh310 force-pushed the xshen/skill-per-agent-remove branch from a26bb75 to 6d166ed Compare September 8, 2026 05:43
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.

1 participant