Skip to content

skills: add --skill subset filter to the download path - #252

Merged
xsh310 merged 6 commits into
databricks:mainfrom
xsh310:skills-download-skill-level
Jul 31, 2026
Merged

skills: add --skill subset filter to the download path#252
xsh310 merged 6 commits into
databricks:mainfrom
xsh310:skills-download-skill-level

Conversation

@xsh310

@xsh310 xsh310 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a --skill filter to the download path of ucode configure skills, so a user can download a named subset of a schema's skills instead of every skill:

# Download only the named skill(s) from the schema (comma-separated for several).
ucode configure skills --location cat.sch --skill my_skill
ucode configure skills --location cat.sch --skill skill_a,skill_b

This mirrors the existing --services subset filter on ucode configure mcp --location cat.sch --service github.

Behavior

  • Subset by leaf name. Only the named skills are downloaded from each --location schema; every other skill is skipped.
  • Applies to every --location schema when several are given.
  • Unknown names warn, don't fail (Ignoring requested skills not found in \cat.sch`: …), so a partial match still downloads the rest — matching --services` handling.
  • Omitted → whole schema (unchanged default).
  • Download-only. Rejected with --mcp (the skills MCP connection is schema-scoped, with no per-skill route) and rejected without --location.
  • The schema-less MCP connection registration after download is unchanged; --skill never touches skill_locations.

The filter is applied purely at the orchestration layer (download_skills) — no changes to the download client, the on-disk writer, or mcp.py.

How do you know it works?

  • New unit tests in tests/test_skills_download.py: filter downloads only matching leaves; unknown names warn and the rest still download; empty-set filter downloads nothing; None filter downloads everything; configure_skills_download_command threads the set through to download_skills.
  • New CLI tests in tests/test_cli.py: --skill dispatches with the parsed set (single + comma list); --skill + --mcp exits 1; --skill without --location exits 1. Updated the two existing download-dispatch assertions for the new skills= kwarg.
  • Full non-e2e suite passes locally (uv run pytest, 1055 passed, including test_lint.py), and uv run ruff check . / ruff format are clean.
  • Manually smoke-tested the CLI: --help shows the flag, and both rejection paths exit 1 with clear messages.

xsh310 added 3 commits July 30, 2026 22:19
`ucode configure skills --location cat.sch --skill my_skill` downloads only
the named skill(s) from each schema instead of every skill, mirroring the
`--services` subset filter on `configure mcp`. Matched by leaf name; unknown
names warn and are skipped. Download-only — rejected with `--mcp` (the skills
MCP connection is schema-scoped) and without `--location`.

Co-authored-by: Isaac
A single skill-name set can't be split across schemas, so reject --skill
combined with more than one --location, mirroring `configure mcp` (whose
--service filter also takes a single --location).

Co-authored-by: Isaac
Trim the multi-location and download_skills comments to why-only, and
delegate the configure_skills_download_command docstring to download_skills
instead of restating the filter semantics.

Co-authored-by: Isaac
Comment thread src/ucode/cli.py Outdated
Comment thread src/ucode/skills_download.py Outdated
xsh310 added 3 commits July 31, 2026 00:17
- Drop the redundant single-location comment (the error message is clear).
- Reword the unknown-skill warning to "Skipping requested skill(s) not found",
  matching the file's other "Skipping ..." warnings.

Co-authored-by: Isaac
- Use `my-skill` (hyphen) in all --skill examples/help; underscores don't
  match SKILL_NAME_PATTERN (^[a-z0-9-]+$), so `my_skill` could never match a
  real skill.
- When a --skill filter selects none of a non-empty schema's skills, print
  "No requested skills to download from ..." instead of the misleading
  "No skills found in ...".

Co-authored-by: Isaac
The message string is self-explanatory; the two branches don't need a comment
distinguishing them.

Co-authored-by: Isaac
@xsh310
xsh310 marked this pull request as ready for review July 31, 2026 00:37
@xsh310
xsh310 merged commit edc7762 into databricks:main Jul 31, 2026
2 checks passed
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.

2 participants