Skip to content

Add interactive picker for ug skill add download - #579

Open
xsh310 wants to merge 3 commits into
skills-picker-download-corefrom
skills-picker-download-wiring
Open

Add interactive picker for ug skill add download#579
xsh310 wants to merge 3 commits into
skills-picker-download-corefrom
skills-picker-download-wiring

Conversation

@xsh310

@xsh310 xsh310 commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

What

PR D (final) of the ug skill add interactive-picker stack: it wires the feature. Running ug skill add with no --mcp, --location, or --skills on an interactive terminal now opens a picker of the workspace's skills to download, mirroring ug mcp add's picker exactly.

Design doc: ug_skill_add_download_interactive_picker_design.md (PR table, row D). Builds on PR A (picker primitives), PR B (walk_catalog_schemas), and PR C (download_selected_skills).

Changes

All in skills_download.py (discovery + picker glue) and cli.py (routing):

  • list_all_skills — workspace-wide skill walk via walk_catalog_schemas (catalogs → schemas → skills in parallel under a wall-clock deadline), flattening and streaming each schema's finalized skills by FQN.
  • Picker glue_skill_download_choice (value = FQN, title flags on-disk bundles, which stay selectable so a re-download can update them), _skills_download_background_loader (runs list_all_skills on the token the command already fetched and streams discovered skills into the open picker as choices), and prompt_for_skill_download_choices (scrolling_checkbox with loading_noun="skills").
  • configure_skills_download_picker_command — opens the picker immediately, streams skills in behind it, then download_selected_skills + register_schemaless_skills_connection on save. Ctrl-C downloads nothing and leaves the connection untouched.
  • skills_add — opens the picker when --mcp, --location, and --skills are all omitted on an interactive terminal (via _stdin_is_interactive). The typed --location / --skills paths are unchanged, and a non-interactive run (piped/CI) still errors with --location is required.
  • README — documents the no-argument picker.

Edge cases (handled by the reused primitives)

  • Empty / streaming: the picker opens on an empty list and fills in via the background loader.
  • Deadline / partial results: walk_catalog_schemas returns what it found once the budget is exceeded.
  • Permission / discovery failure: discovery runs on the picker's daemon thread, so a 403 or transient failure just stops the stream and the picker stays open.
  • Ctrl-C: exit 0, nothing downloaded, no registration.

Testing

uv run ruff check ., ruff format --check src tests, ty check src, and uv run pytest all pass (the 2 pre-existing e2e failures in test_e2e_user_agent and test_claude_smart_routing_v2 are unrelated and also fail on the base branch). New unit tests cover list_all_skills (flatten, stream, dedupe by FQN, progress, deadline, walk-failure reason), the picker glue (choice on-disk flag, background loader streaming, prompt selection and cancel), the picker command (download+register, Ctrl-C no-op), and CLI routing (interactive opens the picker, --skills stays on the typed path, non-interactive errors).

Stacked on #578.

Screen.Recording.2026-09-11.at.10.04.14.PM.mov

This pull request and its description were written by Isaac.

@xsh310
xsh310 added this pull request to stack #576 September 12, 2026 00:40
Comment thread src/ucode/skills_download.py Outdated
Comment thread src/ucode/skills_download.py
@xsh310
xsh310 marked this pull request as ready for review September 12, 2026 07:13
@xsh310
xsh310 force-pushed the skills-picker-download-wiring branch from 1fe68d5 to a693c46 Compare September 12, 2026 07:16
xsh310 and others added 3 commits September 14, 2026 03:08
Wire the interactive download picker for `ug skill add`, the feature the
earlier refactors set up. It mirrors the MCP-services picker.

- list_all_skills: workspace-wide skill walk via walk_catalog_schemas
  (catalogs -> schemas -> skills in parallel under a deadline), flattening
  and streaming each schema's finalized skills by FQN. discover_all_skills
  wraps it with a token, the counterpart to discover_all_mcp_service_names.
- Picker glue in skills_download.py: _skill_download_choice (value = FQN,
  title flags on-disk bundles), _skills_download_background_loader (streams
  discovered skills in as choices), prompt_for_skill_download_choices
  (scrolling_checkbox with loading_noun="skills").
- configure_skills_download_picker_command: open the picker immediately,
  stream skills in, then download_selected_skills + register on save;
  Ctrl-C downloads nothing.
- skills_add opens the picker when --mcp, --location, and --skills are all
  omitted on an interactive terminal; the typed paths are unchanged, and a
  non-interactive run still errors with "--location is required".
- README: document the no-argument picker.

Tests cover list_all_skills (flatten/stream/dedupe/progress/deadline/reason),
discover_all_skills, the picker glue, the picker command, and CLI routing.

Co-authored-by: Isaac <no-reply@databricks.com>
It was a thin single-use wrapper; the loader now runs list_all_skills on
the token the picker command already fetched, dropping a redundant token
lookup. (The MCP path keeps discover_all_mcp_service_names because it has a
synchronous sibling, discover_mcp_service_names, that skills lacks.)

Co-authored-by: Isaac <no-reply@databricks.com>
It hands back list[SkillRef], so on_skills reads truer than the on_services
name carried over from the MCP walk for symmetry.

Co-authored-by: Isaac <no-reply@databricks.com>
@xsh310
xsh310 force-pushed the skills-picker-download-wiring branch from a693c46 to e68b9c6 Compare September 14, 2026 03:08
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