Skip to content

Add agent-scoped skill configuration - #484

Open
artjen wants to merge 1 commit into
skill-agent-scopesfrom
skill-agent-add-command
Open

Add agent-scoped skill configuration#484
artjen wants to merge 1 commit into
skill-agent-scopesfrom
skill-agent-add-command

Conversation

@artjen

@artjen artjen commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Why

Developers need to expose a skill schema to one coding agent without also exposing it to every other configured agent. This prevents unintended skill-tool crossover between agents.

What changed

This PR adds --agents to ucode skill add --mcp and documents agent-scoped additions.

How it works

  • Named agents are set up before their MCP configuration is changed.
  • Without --agents, locations are added to the shared default.
  • With --agents, locations are added only to each selected agent's durable additions.
  • Adding a location already present in the default still records the explicit agent intent.
  • Download mode rejects --agents because its on-disk skill directories are shared.

Builds on the client-aware state model in #468.

Testing

  • uv run pytest tests/test_skills_download.py tests/test_mcp.py tests/test_cli.py -q — 501 passed
  • uv run ruff check .
  • uv run ty check src/

Tests cover global and targeted persistence, unaffected client URLs, durable overlapping additions, CLI forwarding, and download-mode validation.


Stack created with GitHub Stacks CLIGive Feedback 💬

@artjen
artjen marked this pull request as ready for review September 3, 2026 20:11
Copilot AI lite review requested due to automatic review settings September 3, 2026 20:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation matches the stated behavior, is well-covered by targeted tests, and preserves backward-compatible defaults for existing users.

Pull request overview

This PR extends ucode skill add --mcp to support agent-scoped skill schema additions via a new --agents option, enabling one agent’s skills MCP scope to be updated without affecting other configured agents.

Changes:

  • Add --agents to ucode skill add --mcp, wiring it through CLI parsing/setup into MCP state updates.
  • Update skills MCP state so agent-scoped additions persist under per-client overrides while leaving the shared default scope intact.
  • Add unit tests and README documentation covering agent-scoped behavior and download-mode validation.
File summaries
File Description
src/ucode/mcp.py Extend add_skills_command to optionally write per-agent skill scope overrides and update only selected clients.
src/ucode/cli.py Add --agents to skill add, validate it is MCP-only, and forward the resolved agent scope to add_skills_command.
tests/test_mcp.py Add coverage for agent-scoped additions, preserving overrides during global additions, and persisting explicit intent.
tests/test_cli.py Verify CLI agent scope setup/forwarding for --mcp and rejection of --agents in download mode.
README.md Document agent-scoped MCP additions and clarify why download mode rejects --agents.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 3, 2026 20:32
@artjen
artjen force-pushed the skill-agent-add-command branch from 806106e to e3ac2f3 Compare September 3, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation matches the described behavior, preserves existing scope semantics, and includes focused tests covering agent-scoped persistence and CLI validation paths.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@artjen
artjen requested a review from xsh310 September 3, 2026 20:39
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