Skip to content

feat: cherry-pick skills/commands/agents/MCPs on install (#119)#123

Draft
SecKatie wants to merge 9 commits into
mainfrom
feat/cherry-pick-install
Draft

feat: cherry-pick skills/commands/agents/MCPs on install (#119)#123
SecKatie wants to merge 9 commits into
mainfrom
feat/cherry-pick-install

Conversation

@SecKatie

@SecKatie SecKatie commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds an interactive item selector to lola install so users can opt out of skills, commands, agents, MCPs, or AGENTS.md instructions they don't want without forking the module. Closes #119.

  • New CLI flags: --skill / --command / --agent / --mcp (each repeatable and comma-separated), --instructions / --no-instructions, plus -y/--yes to skip the picker.
  • In TTY mode, lola install first asks "install everything?"; choosing no opens a fuzzy-searchable multi-select picker. Entries are type-prefixed (skill: …, cmd: /…, agent: @…, mcp: …, instructions: AGENTS.md). All entries start deselected; Tab toggles a single item and Alt-A inverts the current selection (toggle-all). Submitting with nothing checked is treated as a cancel.
  • On reinstall, the picker pre-selects items already installed for the module (annotated (installed)) and marks newly-upstream items (new) so users can see the delta at a glance.
  • New Installation.full_install flag locks cherry-picked installs to the original selection on lola update — newly-upstream items (skills, commands, agents, MCPs, or AGENTS.md) are not silently picked up. Full installs keep tracking upstream. Renamed registry entries are reapplied so picks survive reloads. Legacy installed.yml entries load as full_install=True; the field is only emitted to YAML when False.
  • File-conflict prompts (skill / command / agent) gain an Overwrite All action that auto-overwrites every remaining collision of that kind for the current install.

Related Issues

Closes #119

Test Plan

  • pytest — 962 tests passing (new tests in tests/test_cli_install_cherry_pick.py)
  • ruff check src tests — clean
  • bandit -r src — clean (false-positive B105 on the __all__ sentinel suppressed with # nosec)
  • Manual: lola install <module> asks "install everything?"; declining opens the fuzzy picker with everything deselected; Alt-A toggles all on; subsetting writes only chosen files and full_install: false to installed.yml
  • Manual: lola install <module> --skill foo --command bar installs just foo + bar; omitted categories install nothing; AGENTS.md instructions are only written when --instructions is passed
  • Manual: cherry-pick install + add a new skill upstream + lola update does not pick up the new skill; same flow with a full install does
  • Manual: cherry-pick install that skipped instructions + drop an AGENTS.md upstream + lola update does not install instructions

CLI shape

lola install my-module                            # asks "install everything?", then picker if no
lola install my-module -y                         # install everything, no prompt
lola install my-module --skill pr-review --skill commit
lola install my-module --skill pr-review,commit --command review
lola install my-module --skill pr-review --instructions

AI Disclosure

AI-assisted with Claude Code.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b6b2037c-069a-44b7-9e87-dd4974e8a8da

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request implements cherry-pick functionality for module item installation and updates. Users can now selectively install specific skills, commands, agents, and MCPs via CLI flags or an interactive multi-select prompt, rather than always installing complete modules. Installations are tracked with a full_install boolean flag, and the update command respects cherry-picked selections by regenerating only originally chosen items instead of all new upstream additions.

Changes

Cherry-Pick Module Item Installation and Update

Layer / File(s) Summary
Data Model & Contracts
src/lola/models.py
Installation dataclass gains full_install: bool = True. Serialization conditionally emits the field only when False; deserialization defaults to True when absent (backward compatibility).
Interactive Multi-Select Prompt
src/lola/prompts.py
New select_module_items(...) provides checkbox UI across skills, commands, agents, MCPs. "All" sentinel returns complete lists; deselecting it returns only chosen items per category. Cancellation returns None.
Installation Filtering & Item Selection
src/lola/targets/install.py
Added _filter_selected(items, selected) helper. Updated _install_skills, _install_commands, _install_agents, _install_mcps to accept optional selected: set[str] | None and install only filtered subsets. MCP generation now filters mcpServers by selection and adjusts failure counts accordingly.
Installation API Extension
src/lola/targets/install.py
install_to_assistant(...) signature extended with selected_skills, selected_commands, selected_agents, selected_mcps sets. Computes full_install = False when any selection is non-None; passes selections through to installers and persists full_install in Installation record.
CLI Install Command & Selection Resolution
src/lola/cli/install.py
New multi-use flags --skill/--command/--agent/--mcp and -y/--yes flag. Added _expand_csv() helper to parse comma-separated values. Selection resolution: explicit flags validated against module → selected_* sets, or interactive picker (unless -y skips it). Docstring updated with cherry-pick examples.
CLI Update Command & Selection Scoping
src/lola/cli/install.py
New _resolve_update_items() helper determines regeneration scope: full installs → all upstream items; cherry-picks → original selected items only. Updated _update_skills, _update_commands, _update_agents, _update_mcps to filter to resolved items. Registry persistence: inst.skills always updated from generated; inst.commands/agents/mcps conditionally set from upstream (full) or resolved subset (cherry-pick).
Existing Interactive Tests Updates
tests/test_cli_install.py
Three interactive CLI tests updated to include -y flag in install_cmd invocations, preserving mocked behaviors and assertions.
New Cherry-Pick Test Suite
tests/test_cli_install_cherry_pick.py
Comprehensive test coverage: _expand_csv() parsing (empty, single, multiple, comma-separated, whitespace/empty-dropping); select_module_items() behavior (all-sentinel, subsets, cancellation); Installation.full_install semantics (defaults, conditional serialization, legacy defaults, round-trip); install_cmd flag plumbing (no-flags, -y, filter validation, comma expansion, unknown-item errors); update_cmd scoping (cherry-picks lock to selection, full installs pick up new upstream).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 A picker's dream comes true at last,
With flags to choose what skills to cast,
No more install the whole kit wide—
Just cherry-pick what's by your side,
And updates know just what you chose. 🌸

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 74.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: cherry-pick skills/commands/agents/MCPs on install (#119)' clearly and concisely summarizes the main feature addition—allowing selective installation of module components—and references the related issue.
Linked Issues check ✅ Passed The PR fully implements the feature request from issue #119: cherry-pick module components (skills, commands, agents, MCPs) at install time with interactive selection, CLI flags, and selective update behavior.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the cherry-pick installation feature: CLI flags, interactive picker, Installation model tracking, update behavior adjustments, and comprehensive test coverage.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cherry-pick-install

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SecKatie SecKatie marked this pull request as ready for review May 10, 2026 00:26

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lola/cli/install.py`:
- Around line 392-403: The _resolve_update_items function is incorrectly
comparing upstream module_items to installed artifact names (inst_items), which
fails for cherry-picked/renamed installs (e.g., inst.skills, inst.commands,
inst.agents) and causes renamed items to be orphaned; modify the logic so that
when ctx.inst.full_install is False you compare module_items against the
persisted source IDs (not the installed names) — either add/use a
source→installed mapping on the instance (e.g., inst.source_map or
inst._source_ids) that maps upstream names to installed names and check
membership against that mapping’s keys, or store a source_name field per
installed artifact and use that for the set lookup instead of inst_items; update
any code that populates inst_items (installation/registration flow) to persist
the source mapping so _resolve_update_items can reference it.
- Around line 1528-1538: The full_install branch indiscriminately replaces
inst.agents and inst.mcps with ctx.current_agents/current_mcps even when
_update_agents()/_update_mcps() returned early; change the assignments so you
only adopt upstream (current_*) values when the corresponding
ctx.installed_agents or ctx.installed_mcps indicate an actual update (i.e., are
truthy or non-empty); otherwise leave inst.agents and inst.mcps as they were in
the registry. Keep inst.commands using ctx.current_commands as before, but for
agents and mcps check ctx.installed_agents and ctx.installed_mcps before
assigning to inst.agents and inst.mcps.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5ca31da7-f808-4db4-881f-13c8be6e3fc8

📥 Commits

Reviewing files that changed from the base of the PR and between 3d3229e and 6860ef2.

📒 Files selected for processing (6)
  • src/lola/cli/install.py
  • src/lola/models.py
  • src/lola/prompts.py
  • src/lola/targets/install.py
  • tests/test_cli_install.py
  • tests/test_cli_install_cherry_pick.py

Comment thread src/lola/cli/install.py
Comment thread src/lola/cli/install.py
@SecKatie SecKatie requested a review from mrbrandao May 10, 2026 00:40
@SecKatie SecKatie marked this pull request as draft May 10, 2026 00:50
SecKatie and others added 3 commits May 9, 2026 21:27
Add Vercel-style item selection to `lola install`. Users can now opt out
of skills, commands, agents, or MCPs they don't want without forking the
module.

- New CLI flags: --skill / --command / --agent / --mcp (each repeatable
  and comma-separated) plus -y/--yes to skip the picker.
- Interactive picker in TTY mode: a single checkbox listing every item
  with type prefixes and "All" pre-selected at the top.
- Installation.full_install flag locks cherry-picked installs to the
  original selection on `lola update` — newly-upstream items are not
  silently picked up. Full installs continue to track upstream.
- Legacy installed.yml entries load as full_install=True; the field is
  only emitted to YAML when False.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the checkbox+sentinel "All" item with a fuzzy-searchable
multi-select. Pressing Enter with nothing toggled installs everything,
which removes the UI inconsistency where the "All" pseudo-item could
not be auto-deselected when picking specific items.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@SecKatie SecKatie force-pushed the feat/cherry-pick-install branch from 28ba5ae to e016526 Compare May 10, 2026 01:29
InquirerPy's fuzzy multiselect returns the currently-highlighted item on
Enter when nothing is tab-toggled, so the picker's "Enter with no
selection = all" path was unreachable and pressing Enter installed only
one item. Drop the dead branch and advertise the inherited Alt-A
toggle-all-true keybinding in long_instruction.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds cherry-pick support to lola install (via new CLI filters and an interactive picker) and updates lola update behavior to either keep tracking upstream (full installs) or lock to the originally selected subset (cherry-picked installs), persisting the needed state in installed.yml.

Changes:

  • Add --skill/--command/--agent/--mcp (repeatable + CSV) and -y/--yes to control non-interactive vs. interactive install selection.
  • Track cherry-picked vs full installs with Installation.full_install plus per-item source mapping fields to preserve rename/conflict resolutions.
  • Update install/update pipelines to filter installs by selection and prevent cherry-picked updates from silently expanding to newly upstream items.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_cli_install.py Updates existing interactive install tests to bypass the new module-item picker via -y.
tests/test_cli_install_cherry_pick.py Adds coverage for CSV expansion, picker parsing, cherry-pick filtering, and update locking behavior.
src/lola/targets/install.py Adds selection filtering + source maps during install; plumbs selection into install pipeline and records full_install.
src/lola/prompts.py Introduces the fuzzy multi-select prompt for choosing module items to install.
src/lola/models.py Extends Installation persistence with full_install and per-category *_sources mappings.
src/lola/cli/install.py Adds CLI flags, selection resolution, and update logic intended to respect cherry-picked installs and renames.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lola/prompts.py Outdated
Comment thread src/lola/cli/install.py
Comment thread src/lola/cli/install.py Outdated
Comment thread src/lola/cli/install.py Outdated
@trevor-vaughan

Copy link
Copy Markdown
Contributor

Just gave this a shot and ended up not being able to navigate back up the tree once I started exploring. I had hacked together something at https://github.com/trevor-vaughan/lobstertrap-lola/tree/feat/cherry-pick that does (roughly) what I want but I like the multi-level menu experience. Happy to open a PR (or you can steal whatever you like).

Replace the single cherry-pick picker with an "all vs choose items"
prompt so full installs don't require visiting the picker, and fix
update to keep identity-mapped picks and renamed registry entries
when reloading from disk.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@SecKatie

Copy link
Copy Markdown
Collaborator Author

@trevor-vaughan I'll take a look!

SecKatie and others added 3 commits May 12, 2026 19:52
Adds `instructions: AGENTS.md` as a togglable entry in the interactive
picker, and a `--instructions/--no-instructions` CLI flag. When any
cherry-pick flag is passed, instructions are skipped unless
`--instructions` is also supplied — making opt-in explicit and aligning
the summary line with what was actually installed. Full install
(`lola install <mod>` with no flags and no picker) is unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Fresh installs now start with every picker entry unchecked instead of
checked, so confirming without explicit picks doesn't sweep in everything.
Alt-A (and Ctrl-A) rebind from "select all" to "toggle all" so a single
keystroke flips every visible item — useful both for selecting everything
in one go on a fresh install and for clearing the pre-selected set on
re-install.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…mapped picker items

Two bugs surfaced in manual testing of the cherry-pick install flow:

1. Cherry-picked installs that opted out of instructions silently picked
   them up on `lola update` whenever upstream gained an AGENTS.md.
   `_update_instructions` now respects `full_install=False` +
   `has_instructions=False` and removes any stray instructions instead of
   regenerating them.

2. `_current_for_picker` dropped identity-mapped items when the source map
   only contained renames (compacted form). Switched to
   `{source_map.get(name, name) for name in installed}` so the picker
   pre-selects every previously-installed item.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@SecKatie

Copy link
Copy Markdown
Collaborator Author

@trevor-vaughan I love the ideas! I made changes to this PR and fixed some bugs. Wanna try it again?

@trevor-vaughan

Copy link
Copy Markdown
Contributor

That seems better. I would suggest adding the hint about ^A/^R to select all and none at the top. Also, when I tried a new install, the current state wasn't reflected by what is currently installed. The selector stack was definitely a bit fiddly.

Redesign installed.yml around v2 installation and module_cache records so assistant outputs and local cache copies have distinct lifecycles.

Route install, update, uninstall, and mod rm through registry cache ownership decisions, including safe cache cleanup only after the last referencing installation is removed.

Reuse recorded user-scope cache paths during update and preserve existing installed names/source mappings so cherry-picked items refresh without spurious conflict prompts.
@jkonecny12

Copy link
Copy Markdown
Contributor

Hello, thank you for this feature. I'm really missing this option in current lola and would be great to get it in.

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.

[FEATURE] - Cherry Pick Skills

4 participants