Skip to content

skill: add ucode skill add for additive skill configuration - #360

Draft
xsh310 wants to merge 3 commits into
databricks:mainfrom
xsh310:skills-add-command
Draft

skill: add ucode skill add for additive skill configuration#360
xsh310 wants to merge 3 commits into
databricks:mainfrom
xsh310:skills-add-command

Conversation

@xsh310

@xsh310 xsh310 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

What

Adds ucode skill add, the additive sibling of ucode configure skills, under a new skill command namespace.

  • ucode skill add --location <c.s>,… --mcp — unions the given schemas into the skills MCP connection's skill_locations instead of replacing them.
  • ucode skill add --location <c.s>,… [--path <dir>] [--skills <name>,…] — downloads a schema's skills to disk (the existing, already-additive download path), leaving already-downloaded skills in place.

--skills narrows a download to a subset of one schema's skills and accepts either bare securable names (which need a single --location) or fully-qualified <catalog>.<schema>.<name> names (which derive the schema and work without --location; standalone FQNs must all share one schema). This mirrors mcp add --services exactly. --path/--skills are download-only and rejected with --mcp.

Why

Per the team discussion on consolidating skill/MCP management: ucode configure skills --mcp replaces the connection's location set, but adding a new schema shouldn't clobber the ones already configured. This mirrors ucode mcp add (append semantics) and is the first step of moving skill management off ucode configure into a dedicated ucode skill <verb> namespace.

The namespace is singular (skill, not skills) to avoid the skills … --skills stutter and to mirror ucode mcp + --services.

This is PR 1 of 3:

  1. ucode skill add (--mcp) ← this PR
  2. ucode skill remove --mcp
  3. --agents on skill add/remove

How

  • mcp.py: add_skills_command() unions via a new _union_locations() helper (the scalar analog of _union_missing), then reuses _update_skills_mcp to rebuild and persist the single skills connection. configure_skills_mcp_command (replace) is untouched.
  • cli.py: new skill typer namespace + skill add command. --mcp routes to add_skills_command; the default routes to configure_skills_download_command. --skills resolution reuses the same FQN/short-name logic as mcp add --services (derive the schema from standalone FQNs; bare names require --location), reducing names to their securable leaf for the download filter.
  • Download mode is additive by nature, so no library changes were needed there. ucode configure skills is left untouched.

Testing

uv run ruff format --check, uv run ruff check, and uv run ty check src/ all pass. Added tests covering _union_locations (append/dedupe/empty-base), add_skills_command (unions into scope, existing-schema no-op, empty-state registration), and the skill add CLI (mode dispatch, FQN derivation, bare-name-without-location and cross-schema errors, and every validation guard). Full non-e2e suite passes except one pre-existing failure (test_managed_wizard.py::TestCliWiring::test_successful_apply_exits_zero) that fails identically on main.

This pull request and its description were written by Isaac.

xsh310 added 3 commits August 19, 2026 18:15
`ucode configure skills --mcp` replaces the skills MCP connection's location
set; `ucode skills add` is its additive sibling. With `--mcp` it unions the
given schemas into `skill_locations` (via `_union_locations`, the scalar analog
of `_union_missing`) instead of replacing them; the default download mode reuses
the already-additive download path. Requires `--location`.

This mirrors `ucode mcp add` under a new `skills` command namespace, part of
moving skill/MCP management off `ucode configure`.

Co-authored-by: Isaac
- Drop `ucode configure skills` comparisons from the command docstring and README
- Tighten `add_skills_command` to a one-line docstring; drop the self-explanatory
  `_union_locations` docstring and an inline comment
- Reword `--mcp` conflict errors to "--path/--skill is not supported when using --mcp"

Co-authored-by: Isaac
… support

Match the updated spec:
- Namespace `ucode skills` → `ucode skill` (singular) to avoid the
  `skills … --skills` stutter and mirror `ucode mcp` + `--services`.
- Download-subset flag `--skill` → `--skills` (plural), matching `--services`.
- `--skills` now accepts fully-qualified `<catalog>.<schema>.<name>` names,
  deriving the schema when `--location` is omitted (bare names still need
  `--location`; standalone FQNs must share one schema) — the same resolution
  `mcp add --services` uses.

Co-authored-by: Isaac
@xsh310 xsh310 changed the title skills: add ucode skills add for additive skill configuration skill: add ucode skill add for additive skill configuration Aug 21, 2026
Comment thread src/ucode/cli.py
Comment on lines +1196 to +1197
if not locations:
raise RuntimeError("--location is required for `ucode skill add`.")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this error message correct? I think we can also use --skills solely right?

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