fix(cua-driver-rs)(skills): strip nested cua-driver/cua-driver-rs/ wrapper from skill tarball - #1684
Conversation
…apper from skill tarball 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR normalizes skill-pack tarball layouts by restructuring the CI staging process to remove nested directories and updating the extraction logic to intelligently handle both current and legacy tarball formats across multiple historical versions. ChangesTarball Layout Standardization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
User reported `~/.claude/skills/cua-driver/cua-driver-rs/SKILL.md` after running `cua-driver skills install` — a redundant `cua-driver-rs/` dir nested inside the pack root.
Root cause: tarball-shape mismatch. The CD workflow historically staged files under `/cua-driver-rs/` (and briefly `/cua-driver/` after #1677) — two wrapping dirs. The extractor only stripped one. So files landed at `dest/cua-driver{-rs}/` instead of `dest/`.
Fix
1. `extract_tar_gz` strips a second wrapper iff named `cua-driver` or `cua-driver-rs`:
```rust
let mut peek = components.clone();
if let Some(next) = peek.next() {
if next.as_os_str() == "cua-driver" || next.as_os_str() == "cua-driver-rs" {
components.next();
}
}
```
Covers three tarball shapes:
Stripping is name-gated so a future skill pack with a real subdir (e.g. `examples/`) doesn't accidentally get flattened.
2. CD workflow flattens the staging dir — no more inner `cua-driver/` between the version-stamped outer dir and the .md files.
Tests
4 new unit tests in `skills::tests` cover the three legacy shapes + a "preserve real subdir" guard. All pass.
End-to-end on the user's machine
After this lands + the user runs `cua-driver skills install --force`:
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests
Chores