Add per-agent scoping to skill add --mcp - #522
Open
xsh310 wants to merge 2 commits into
Open
Conversation
xsh310
force-pushed
the
xshen/skill-per-agent-add
branch
from
September 8, 2026 05:43
3e8757f to
a3378e8
Compare
xsh310
force-pushed
the
xshen/skill-per-agent-add
branch
from
September 8, 2026 18:25
a3378e8 to
4918b2d
Compare
xsh310
force-pushed
the
xshen/skill-per-agent-add
branch
from
September 8, 2026 19:09
4918b2d to
b1219a3
Compare
xsh310
marked this pull request as ready for review
September 8, 2026 20:31
xsh310
force-pushed
the
xshen/skill-per-agent-add
branch
from
September 8, 2026 22:12
b1219a3 to
fdeee67
Compare
Give `ucode skill add --mcp` an `--agents` option so a schema can be added to a chosen subset of configured coding agents instead of all of them, mirroring `ucode mcp add --agents`. `add_skills_command` takes an optional `agents` set and forwards it to `setup_mcp_clients`, which scopes the client set; the per-client map is updated only for the targeted clients. `--agents` is rejected outside `--mcp` since downloaded skills use shared directory families. The `--mcp --agents` path bootstraps only agents that are not configured for MCP yet, so re-targeting an already-configured agent no longer re-runs the agent setup (re-login, binary reinstall, re-validate). It computes the not-yet-ready subset and passes just those to `_configure_agents_for_mcp`, while still scoping the skills update to every named agent. Co-authored-by: Arthur Jenoudet <arthur.jenoudet@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
xsh310
force-pushed
the
xshen/skill-per-agent-add
branch
from
September 8, 2026 22:16
fdeee67 to
8589f8d
Compare
`skill add --agents ""` (or `,`) raised a hard "No agents provided" error, while the other agent-scoped commands (`mcp add`, `mcp remove`) fold an empty --agents value to None and act globally. Match them so `skill add --mcp` mirrors `ucode mcp add` exactly: an empty --agents now targets every configured agent instead of erroring. Co-authored-by: Arthur Jenoudet <arthur.jenoudet@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an
--agentsoption toucode skill add --mcpso a skill schema can be added to a chosen subset of configured coding agents instead of all of them. This mirrorsucode mcp add --agents, closing the gap between how the skills MCP path and the general MCP path scope work per agent.How
add_skills_command(locations, agents=None)forwardsagentstosetup_mcp_clients, which scopes the returned client set. The per-client skill-location map is updated only for the targeted clients; the rest keep their scope untouched.cli.py,skill addgains the--agentsoption, bootstraps any named agent that is not configured yet via_configure_agents_for_mcp, and guards that--agentsis only valid with--mcp(downloaded skills use shared directory families and cannot be agent scoped).--agents, behavior is unchanged: every configured agent is updated.Tests
test_mcp.py: per-agent add touches only the named client's scope and re-registers only that client; a global add reaches every configured client while preserving per-client divergence; adding a schema an agent already has is a no-op.test_cli.py:--agentsis parsed, bootstrapped, and forwarded for--mcp; an empty--agentslist is rejected;--agentsis rejected in download mode.uv run pytest tests/test_mcp.py tests/test_cli.py tests/test_lint.pyis green.Manual verification (installed build)
Installed the stack tip with
uv tool install --reinstall .(ucode0.1.0+91.g5c0dc1e) and exercised the command in an isolated sandbox: a temporaryHOME, stubclaude/codexbinaries that record every registration ucode issues, andDATABRICKS_BEARERset so auth is satisfied offline. State was seeded with both agents configured and no skills.ucode skill add --location shared.skills --mcpshared.skills; each re-registered onceadd_skills_command(["claude.only"], agents={"claude"})claude=[shared.skills, claude.only],codex=[shared.skills]; only claude re-registered; summary showed divergent per-client URLs--locationucode skill addERROR --location is required for ucode skill add.--agentswithout--mcpucode skill add --location a.b --agents claudeERROR --agents is only supported when using --mcp--agentsucode skill add --location a.b --mcp --agents ,ERROR No agents provided for --agents ...The
--agentsadd path first runs an interactive agent bootstrap, so the per-agent case droveadd_skills_command(..., agents=...)directly against the installed package with only that prompt stubbed; state I/O and per-client agent registration ran for real. CLI parsing and bootstrap are covered by the mocked unit tests.Stacking
This is the first of a stacked series that adds per-agent scoping to the skills MCP connection, built on top of
xshen/per-client-skill-scopes(per-client skill scope map) andskill-managed-download-only(managed skills delivered by download only). Reviewing the diff against its base branch 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.