Add agent-specific skill removal - #486
Conversation
There was a problem hiding this comment.
🟡 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
--agentstoucode skill remove --mcpand forwarded the parsed agent set into the removal implementation. - Updated
remove_skills_commandto 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.
cde43f5 to
e0ede42
Compare
There was a problem hiding this comment.
🟢 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
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
--agentstoucode skill remove --mcp.How it works
--agents, the picker shows only additions explicitly stored for the selected agents.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 passeduv 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 CLI • Give Feedback 💬