Skip to content

Add agent-specific skill removal - #486

Open
artjen wants to merge 1 commit into
skill-removefrom
skill-agent-remove
Open

Add agent-specific skill removal#486
artjen wants to merge 1 commit into
skill-removefrom
skill-agent-remove

Conversation

@artjen

@artjen artjen commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Why

Global removal is too broad when a developer only wants to undo an addition made for one agent. Shared defaults must remain shared, so targeted removal needs different semantics.

What changed

This PR adds --agents to ucode skill remove --mcp.

How it works

  • With --agents, the picker shows only additions explicitly stored for the selected agents.
  • Selected entries are removed only from those agents' additions.
  • The shared default is never changed, so all agents continue to inherit it.
  • Other agents' additions and MCP URLs remain untouched.
  • If an explicit addition duplicates a shared default, removing the addition removes that durable intent while access continues through the default.

Builds on global removal in #469.

Testing

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

Tests cover agent selection, targeted persistence, unaffected clients, and additions overlapping the shared default.


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.

🟡 Changes recommended

Agent-scoped removal currently risks persisting new empty override entries for scoped agents that had no prior additions, mutating state beyond the intended targets.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR extends ucode skill remove --mcp to support agent-scoped removal via a new --agents option, allowing developers to remove only per-agent skill additions while preserving the shared default skill scope inherited by all agents.

Changes:

  • Added --agents to ucode skill remove --mcp and forwarded the parsed agent set into the removal implementation.
  • Updated remove_skills_command to switch semantics: global mode removes from shared defaults + all additions; scoped mode removes only from the selected agents’ additions.
  • Added/updated tests and documentation to cover agent-scoped prompting and persistence behavior.
File summaries
File Description
src/ucode/mcp.py Adds an agents scope to skill removal and changes picker/removal logic to operate on per-agent additions when scoped.
src/ucode/cli.py Introduces --agents for skill remove --mcp and forwards the normalized set to remove_skills_command.
tests/test_mcp.py Adds coverage for agent-scoped skill removal semantics (only selected client additions affected, defaults preserved).
tests/test_cli.py Updates dispatch expectations and adds a test to ensure --agents is forwarded correctly.
README.md Documents the new --agents behavior and updates the command summary.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread src/ucode/mcp.py
Copilot AI review requested due to automatic review settings September 3, 2026 20:32
@artjen
artjen force-pushed the skill-agent-remove branch from cde43f5 to e0ede42 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 scoped-removal implementation matches the stated semantics and is backed by targeted tests covering persistence and non-impact to other agents.

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

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