Skip to content

chore(cua-driver-rs): drop -rs from MCP identity + skill pack name - #1677

Merged
f-trycua merged 1 commit into
mainfrom
drop-rs-from-mcp-identity-and-skill-name
May 24, 2026
Merged

chore(cua-driver-rs): drop -rs from MCP identity + skill pack name#1677
f-trycua merged 1 commit into
mainfrom
drop-rs-from-mcp-identity-and-skill-name

Conversation

@f-trycua

@f-trycua f-trycua commented May 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three user-visible places where the binary still advertised `-rs` after the `libs/cua-driver-rs/` folder rename. Renamed all three and added one-shot legacy cleanup so existing installs migrate silently.

What changed

Where Before After
MCP `serverInfo.name` (`mcp-server/src/protocol.rs`) `"cua-driver-rs"` `"cua-driver"`
MCP `instructions` text starts `cua-driver-rs: cross-platform…` starts `cua-driver: cross-platform…`
`SKILL_PACK_NAME` (`cua-driver/src/skills.rs`) `"cua-driver-rs"` `"cua-driver"`
Repo skill dir `libs/cua-driver/rust/Skills/cua-driver-rs/` `libs/cua-driver/rust/Skills/cua-driver/`

The `serverInfo.name` + `instructions` change is what fixes the other-Claude-session complaint that prompted this PR ("the cua-driver-rs skill isn't loaded").

Migration (zero-prompt, runs on next `cua-driver skills install`)

  • new `sweep_legacy_skill_pack()` in skills.rs removes `/skills/cua-driver-rs/` and any `<agent_skills>/cua-driver-rs` symlink/junction. Only when it's a managed link — never clobbers a user-managed real dir.
  • `skills uninstall` now sweeps BOTH the current name and the legacy one so a partial uninstall still finishes.
  • `uninstall.sh` + `uninstall.ps1` expanded their junction lists to include both names.

What's intentionally NOT changing

Per the user-confirmed scoping from PR #1674:

  • Asset name `cua-driver-rs-v-skills.tar.gz` — unchanged (keeps backward-compat with pinned URLs). The CD workflow now packages a `cua-driver/` top-level dir inside the legacy-named tarball; the on-binary tarball extractor strips whatever top-level dir it finds, so both old and new tarballs extract correctly.
  • Tag prefix `cua-driver-rs-v*` — unchanged.
  • Env var prefix `CUA_DRIVER_RS_*` — unchanged.
  • Crate names — already without `-rs`.

Test plan

  • Build clean on Windows (0 warnings)
  • `cargo test` green (49+28+6 across cua-driver / mcp-server / cursor-overlay)
  • Smoke-tested `cua-driver mcp` initialize: `serverInfo.name = "cua-driver"`, instructions starts `"cua-driver: cross-platform…"` (confirmed via stdin-pipe + jq)
  • Reviewer: run `./scripts/install-local.{sh,ps1}` then `cua-driver skills install` against a fresh machine; expect `~/.claude/skills/cua-driver/` link, no `cua-driver-rs/` artifact
  • Reviewer: run `cua-driver skills install` on a machine that already has `~/.claude/skills/cua-driver-rs/` installed; expect the legacy link to be removed and the new one created in one step
  • Reviewer: re-trigger `cd-rust-cua-driver.yml` to confirm the skills tarball builds cleanly with the new directory layout
  • Reviewer: the other-Claude-session test that prompted this PR (`cua-driver` skill now "loaded" without the `-rs` qualifier)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Skill installation now automatically removes legacy skill pack instances to ensure clean upgrades.
    • Uninstall process comprehensively removes both current and legacy skill pack references and symlinks across all supported agent directories.
  • Documentation

    • Updated skill pack naming conventions, installation paths, and system messages to reflect current structure.

Review Change Stack

Three user-visible places where the binary still advertised "-rs"
after the libs/cua-driver-rs/ folder rename. Renamed all three and
added one-shot legacy cleanup so existing installs migrate silently.

1. MCP `serverInfo.name`: "cua-driver-rs" → "cua-driver"
   (mcp-server/src/protocol.rs)

2. MCP `instructions` text: "cua-driver-rs: cross-platform…" →
   "cua-driver: …" and the in-string skill-name reference too.
   This is the text Claude / Codex / etc. see in their system prompt.

3. SKILL_PACK_NAME: "cua-driver-rs" → "cua-driver" + repo dir
   git-mv libs/cua-driver/rust/Skills/cua-driver-rs/ → cua-driver/.
   Install dir on disk changes from <HomeDir>/skills/cua-driver-rs/
   to <HomeDir>/skills/cua-driver/, and same for agent links under
   ~/.claude/skills/, ~/.agents/skills/, ~/.openclaw/skills/, and
   the OpenCode dir.

Migration (zero-prompt, runs on next `cua-driver skills install`):
- new `sweep_legacy_skill_pack()` removes <HomeDir>/skills/cua-driver-rs/
  and any `<agent_skills>/cua-driver-rs` symlink/junction (only when
  it's a managed link — never clobbers a user-managed real dir).
- `skills uninstall` now sweeps BOTH the current name and the legacy
  one so a partial uninstall still finishes.
- uninstall.sh + uninstall.ps1 expanded their junction lists to
  include both names.

Asset name `cua-driver-rs-v<v>-skills.tar.gz` intentionally unchanged
per the broader "tag prefix + asset names stay" decision. The CD
workflow's Skills staging now packages a `cua-driver/` top-level dir
inside the (legacy-named) tarball; the on-binary tarball extractor
strips whatever top-level dir it finds, so both old and new tarballs
extract correctly.

Smoke-tested on Windows: `cua-driver mcp` initialize returns
`serverInfo.name = "cua-driver"` and instructions text starts with
`"cua-driver: cross-platform…"`. cargo build/test all green.
@vercel

vercel Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored May 24, 2026 11:31am

Request Review

@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e54d6f70-91bc-4534-bb02-4dc9aa5365b0

📥 Commits

Reviewing files that changed from the base of the PR and between 2ebadd5 and 366efcd.

📒 Files selected for processing (14)
  • .github/workflows/cd-rust-cua-driver.yml
  • libs/cua-driver/rust/Skills/cua-driver/LINUX.md
  • libs/cua-driver/rust/Skills/cua-driver/MACOS.md
  • libs/cua-driver/rust/Skills/cua-driver/README.md
  • libs/cua-driver/rust/Skills/cua-driver/RECORDING.md
  • libs/cua-driver/rust/Skills/cua-driver/SKILL.md
  • libs/cua-driver/rust/Skills/cua-driver/TESTS.md
  • libs/cua-driver/rust/Skills/cua-driver/WEB_APPS.md
  • libs/cua-driver/rust/Skills/cua-driver/WINDOWS.md
  • libs/cua-driver/rust/crates/cua-driver/src/cli.rs
  • libs/cua-driver/rust/crates/cua-driver/src/skills.rs
  • libs/cua-driver/rust/crates/mcp-server/src/protocol.rs
  • libs/cua-driver/scripts/uninstall.ps1
  • libs/cua-driver/scripts/uninstall.sh

📝 Walkthrough

Walkthrough

This PR renames the cua-driver skill-pack from cua-driver-rs to cua-driver across installer, uninstaller, release packaging, and MCP server components, adding migration logic to remove legacy local installations and symlinks/junctions during upgrade.

Changes

Skill-pack rename and backwards-compatible migration

Layer / File(s) Summary
Skill pack naming constants and documentation updates
libs/cua-driver/rust/crates/cua-driver/src/skills.rs, libs/cua-driver/rust/crates/cua-driver/src/cli.rs
Introduces module constants SKILL_PACK_NAME (cua-driver) and LEGACY_SKILL_PACK_NAME (cua-driver-rs), and updates all CLI and skills documentation to describe the new naming, install destinations, and fetch paths.
Installation migration and legacy sweep function
libs/cua-driver/rust/crates/cua-driver/src/skills.rs
Adds sweep_legacy_skill_pack() to best-effort remove legacy local installations under <HomeDir>/skills/cua-driver-rs/ and legacy symlinks/junctions named cua-driver-rs across agent directories. Integrates the sweep into install/update before fetching new content. Updates the --from=main fetch URL to use the new Skills/cua-driver source path.
Uninstall expansion for both current and legacy variants
libs/cua-driver/rust/crates/cua-driver/src/skills.rs, libs/cua-driver/scripts/uninstall.ps1, libs/cua-driver/scripts/uninstall.sh
Expands Rust uninstall to iterate removal over both current (cua-driver) and legacy (cua-driver-rs) link names. Adds named constants to shell and PowerShell scripts to target both current and legacy skill directories across .claude, .agents, .openclaw, and opencode agent paths. When --all is set, deletes both local stage directories.
Release workflow packaging and asset paths
.github/workflows/cd-rust-cua-driver.yml
Updates the "Stage release files" step to create and populate cua-driver/ subdirectory within the asset stage and to copy source files from the renamed libs/cua-driver/rust/Skills/cua-driver directory instead of the legacy cua-driver-rs path.
MCP server name and generated instructions
libs/cua-driver/rust/crates/mcp-server/src/protocol.rs
Updates initialize_result to report serverInfo.name as cua-driver. Changes agent_instructions() documentation to reference Skills/cua-driver/SKILL.md and updates the generated system-instructions header and guidance text to use the new skill-pack name.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • trycua/cua#1366: Both PRs adjust the libs/cua-driver/scripts/uninstall.sh cleanup logic for the ~/.claude/skills/cua-driver skill symlink—main adds rename/legacy (cua-driver-rs) variants while the other introduces bundle-targeted removal—so they're directly connected at the uninstall/symlink code level.
  • trycua/cua#1558: Both PRs modify the libs/cua-driver/scripts uninstaller flow around Rust backend removal—main PR updates skill-pack name cleanup (cua-driver vs cua-driver-rs) while retrieved PR adds/structures Rust delegation via uninstall.sh/_uninstall-rust.sh—so they overlap in the Rust-uninstall portions of the uninstall scripting.

Poem

🐰 The old name cua-driver-rs takes its final bow,
As cua-driver smoothly takes the stage just now,
With legacy sweeps and symlink care so true,
Migration and cleanup in all that we do! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: renaming the MCP identity and skill pack from 'cua-driver-rs' to 'cua-driver', which is the primary goal across all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch drop-rs-from-mcp-identity-and-skill-name

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.

@f-trycua
f-trycua merged commit ed85fc3 into main May 24, 2026
6 of 7 checks passed
@f-trycua
f-trycua deleted the drop-rs-from-mcp-identity-and-skill-name branch May 24, 2026 12:21
f-trycua added a commit that referenced this pull request May 24, 2026
… .cua-driver-rs/ + repairs dangling agent links (#1683)

User reported `cua-driver skills install` placing the skill pack at
`~/.cua-driver-rs/skills/cua-driver/` even after PR #1677 renamed the
SKILL_PACK_NAME — because skills.rs's home_dir() still hardcoded
`.cua-driver-rs/` as the package-home subdir, inconsistent with
telemetry.rs which migrated to `.cua-driver/` in v0.2.16.

Three changes:

1. **home_dir() now defaults to `~/.cua-driver/`** (lifted the same
   HOME_SUBDIRECTORY / LEGACY_HOME_SUBDIRECTORY constants telemetry.rs
   already uses). `CUA_DRIVER_RS_HOME` env override still wins.

2. **sweep_legacy_skill_pack() expanded** to clean any of three legacy
   shapes:
     - <NewHome>/skills/cua-driver-rs/          (old pack NAME under new home)
     - <LegacyHome>/skills/cua-driver/          (new pack NAME under old home — the user's case)
     - <LegacyHome>/skills/cua-driver-rs/       (old NAME under old home)
   Then attempts to remove the empty `<LegacyHome>/skills/` and
   `<LegacyHome>/` themselves — but only if they're actually empty
   (`fs::remove_dir`, never `remove_dir_all`), so a legacy Unix install
   that still has a packages/ tree alongside keeps its dot-folder.

3. **link_agent() repairs dangling links**, not just creates missing
   ones. After sweep removes the old target, the agent dir
   (`~/.claude/skills/cua-driver` etc.) holds a junction pointing at
   nothing. The old guard `if link.exists() || symlink_metadata.is_ok`
   misread that as "already linked, skip" and left it broken. Now:
     - link.exists() = true                     → real / valid link (skip)
     - has metadata + !exists + is_symlink/junction → dangling, remove + recreate
     - real directory                           → user-managed (skip)

   `is_symlink_or_junction` already gated dangerous removals — never
   touches a user-managed real dir.

`uninstall --all` similarly extended to sweep the legacy home dir.

End-to-end verified on Windows:
  - legacy pack at ~/.cua-driver-rs/skills/cua-driver  ← gone after install
  - stale junction at ~/.claude/skills/cua-driver      ← repaired (now points at
                                                          ~/.cua-driver/skills/cua-driver)
  - new home ~/.cua-driver-rs/                          ← removed (was empty after sweep)
f-trycua added a commit that referenced this pull request May 24, 2026
…apper from skill tarball (#1684)

User reported `~/.claude/skills/cua-driver/cua-driver-rs/SKILL.md` after
`skills install` on Windows — a nested `cua-driver-rs/` dir inside the
pack root.

Root cause: tarball-shape mismatch with the extractor. The CD workflow
historically staged files at `<outer>/cua-driver-rs/` (and after #1677,
`<outer>/cua-driver/`) — TWO wrapping dirs. The extractor only stripped
ONE. So files landed at `dest/cua-driver{-rs}/<file>` instead of
`dest/<file>`.

Two pieces:

1. **`extract_tar_gz` now strips a second wrapper IF named
   `cua-driver` or `cua-driver-rs`**. This covers three historical
   tarball shapes:
     - v0.2.18 and earlier: `…-skills/cua-driver-rs/<file>`
     - v0.2.19 (briefly):   `…-skills/cua-driver/<file>`
     - v0.2.20+ (post-fix): `…-skills/<file>`   (flat — CD workflow now)

   Stripping is name-gated so a future skill pack with a real subdir
   (e.g. `examples/`) doesn't get accidentally flattened.

2. **CD workflow flattens the staging dir** — no more redundant inner
   `cua-driver/` between `<outer>` and the .md files. New tarballs are
   single-wrap.

Four unit tests cover the three legacy shapes + a "preserve real
subdir" guard.

End-to-end fix: on the user's machine, the live v0.2.18 release
tarball still has the legacy double-wrap shape, so the binary needs
to keep extracting it correctly via the smart extractor — which it
now does. `skills update` will sweep the nested `cua-driver-rs/` dir
out (`fetch_into` wipes dest first) and re-extract flat.
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