Skip to content

feat(cua-driver-rs)(skills): default to host-only platform docs (--all-platforms to keep the full set) - #1686

Merged
f-trycua merged 1 commit into
mainfrom
skills-filter-host-platform
May 24, 2026
Merged

feat(cua-driver-rs)(skills): default to host-only platform docs (--all-platforms to keep the full set)#1686
f-trycua merged 1 commit into
mainfrom
skills-filter-host-platform

Conversation

@f-trycua

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

Copy link
Copy Markdown
Collaborator

Summary

User on Windows reported `LINUX.md` sitting in their installed skill pack. The pack ships `WINDOWS.md`, `MACOS.md`, and `LINUX.md` all in one tarball, but a single host only needs one of those.

Default install now filters per host. README + SKILL + cross-platform docs (RECORDING, WEB_APPS, TESTS) are always kept; only the platform-specific deep-dive matches the host.

`--all-platforms` opt-in keeps the full set for users who assist across OSes from one machine.

Result on Windows

Before:
```
LINUX.md MACOS.md README.md RECORDING.md SKILL.md TESTS.md WEB_APPS.md WINDOWS.md
```

After (default `cua-driver skills install`):
```
README.md RECORDING.md SKILL.md TESTS.md WEB_APPS.md WINDOWS.md
```

After `cua-driver skills install --all-platforms`:
```
LINUX.md MACOS.md README.md RECORDING.md SKILL.md TESTS.md WEB_APPS.md WINDOWS.md
```

Bonus

Found `MACOS.md` was missing from `SKILL_FILES` — the `--from main` per-file fetch path skipped it. Added.

Tests

2 new unit tests in `skills::tests`:

  • `extract_per_host_filter_drops_other_platform_docs` — verifies host gets ONLY its platform's .md
  • `extract_all_platforms_flag_keeps_every_platform_doc` — verifies opt-out preserves all three

6/6 skill tests pass on Windows. Smoke-tested with real `cua-driver skills install --from main --force` — produces a Windows-only doc set.

Test plan

  • Build clean, 0 warnings
  • 6/6 skill tests pass
  • Real install smoke-tested on Windows (per-host filter works)
  • Reviewer: same on macOS / Linux — should get only MACOS.md / LINUX.md respectively
  • Reviewer: `cua-driver skills install --all-platforms --force` should keep all three

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added --all-platforms flag for skill-pack installation, allowing control over whether platform-specific documentation is installed for all platforms or just the host platform
  • Documentation

    • Updated documentation clarifying that install/update operations default to downloading only the host platform's deep-dive documentation files
  • Tests

    • Enhanced test coverage for platform-specific documentation filtering behavior

Review Change Stack

…l-platforms to keep the full set)

The skill pack ships docs for all three platforms (WINDOWS.md /
MACOS.md / LINUX.md) in one tarball but only one of them is relevant
to any given host. User on Windows complained about LINUX.md sitting
in their skill install.

Default install now filters: WINDOWS.md kept on Windows, MACOS.md on
macOS, LINUX.md on Linux. Other platforms' .md files are skipped
during extraction (release tarball path) and during per-file fetch
(--from main path). README, SKILL, RECORDING, WEB_APPS, TESTS are
always kept.

`--all-platforms` opt-in restores the previous behaviour for users
who help across OSes from one machine and want every deep-dive
present in their agent prompt context.

Wiring:
- new `excluded_platform_docs(all_platforms)` returns the basenames
  to skip per #[cfg(target_os = "...")]
- `is_excluded_platform_doc(basename, all_platforms)` is the predicate
- threaded through `fetch_into` (per-file branch + tarball branch)
- extract_tar_gz now takes `all_platforms: bool`

Also: added MACOS.md to SKILL_FILES — was missing from the --from main
list, so macOS users on bleeding-edge dev validation were missing
their own platform doc.

2 new unit tests:
- extract_per_host_filter_drops_other_platform_docs
- extract_all_platforms_flag_keeps_every_platform_doc
6/6 skill tests pass on Windows. End-to-end install on a Windows host
produces a skill dir with WINDOWS.md only, no LINUX.md / MACOS.md.
@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 2:27pm

Request Review

@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

cua-driver skills install/update now supports a new --all-platforms flag to control platform-scoped skill-pack extraction. By default, only the host platform's deep-dive markdown docs are kept; the flag allows retention of all platform docs. The implementation adds platform-filtering helpers, threads an all_platforms boolean through fetch and extraction pipelines, and adds corresponding test coverage.

Changes

Skill-pack platform-scoped installation

Layer / File(s) Summary
Platform filtering helpers and CLI integration
libs/cua-driver/rust/crates/cua-driver/src/skills.rs
Documentation updated to describe default (host-only) and --all-platforms behavior. excluded_platform_docs(all_platforms) and is_excluded_platform_doc(...) helpers use compile-time cfg(target_os=...) to determine which platform-specific .md files to exclude. CLI parsing extracts the --all-platforms flag for downstream use.
Fetch pipeline threading and filtering
libs/cua-driver/rust/crates/cua-driver/src/skills.rs
fetch_into signature extended to accept all_platforms: bool. Conditional skip added to avoid downloading excluded platform docs when fetching per-file from --from=main. Parameter threaded from install/update command path.
Tar extraction filtering and unpacking
libs/cua-driver/rust/crates/cua-driver/src/skills.rs
extract_tar_gz signature extended to accept all_platforms: bool. Per-host filtering logic inserted before tar unpacking: excluded platform docs are skipped when all_platforms=false, while platform-agnostic files (e.g., README.md, SKILL.md) are always preserved. Parameter threaded from versioned release extraction path.
Test signature updates and platform filtering coverage
libs/cua-driver/rust/crates/cua-driver/src/skills.rs
Existing extraction tests updated to call new extract_tar_gz(..., all_platforms) signature. New and expanded test cases verify per-host filtering (only host platform doc retained when all_platforms=false) and all-platform retention (all docs when all_platforms=true).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • trycua/cua#1684: Modifies the same extract_tar_gz tarball extraction pipeline; one PR strips wrapper-path nesting, the other adds platform-scoped doc filtering.

Poem

🐰 A skill pack lands, with platforms three,
But the host declares: "Just docs for me!"
–Unless all-platforms says "keep them near,"
Then every doc gets unpacked here.

🚥 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 clearly and specifically summarizes the main change: filtering platform-specific skill docs by default to host-only, with an optional flag to keep all platform docs.
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 skills-filter-host-platform

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.

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

Actionable comments posted: 1

🤖 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 `@libs/cua-driver/rust/crates/cua-driver/src/skills.rs`:
- Around line 22-25: The module docstring in skills.rs incorrectly says "Default
install drops only the host platform's deep-dive .md" while the implementation
actually keeps the host doc and drops the non-host docs; update the top-of-file
module docs (the module-level comment in skills.rs) to state that the default
install keeps the host platform's deep-dive .md and drops the other platform .md
files (and note the --all-platforms flag keeps all three), making the wording
consistent with the implementation.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e3c43d59-8d71-4207-b157-86b25b1e43e4

📥 Commits

Reviewing files that changed from the base of the PR and between a9ddde6 and 61d4cb2.

📒 Files selected for processing (1)
  • libs/cua-driver/rust/crates/cua-driver/src/skills.rs

Comment on lines +22 to +25
//! Default install drops only the host platform's deep-dive .md
//! (WINDOWS.md / MACOS.md / LINUX.md — whichever matches). Pass
//! `--all-platforms` to keep all three (useful when assisting users
//! across OSes from one machine).

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Correct the default-behavior wording in the module docs.

This says default install drops the host platform doc, but the implementation keeps the host doc and drops the non-host docs.

Suggested patch
-//! Default install drops only the host platform's deep-dive .md
+//! Default install keeps only the host platform's deep-dive .md
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
//! Default install drops only the host platform's deep-dive .md
//! (WINDOWS.md / MACOS.md / LINUX.md — whichever matches). Pass
//! `--all-platforms` to keep all three (useful when assisting users
//! across OSes from one machine).
//! Default install keeps only the host platform's deep-dive .md
//! (WINDOWS.md / MACOS.md / LINUX.md — whichever matches). Pass
//! `--all-platforms` to keep all three (useful when assisting users
//! across OSes from one machine).
🤖 Prompt for 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.

In `@libs/cua-driver/rust/crates/cua-driver/src/skills.rs` around lines 22 - 25,
The module docstring in skills.rs incorrectly says "Default install drops only
the host platform's deep-dive .md" while the implementation actually keeps the
host doc and drops the non-host docs; update the top-of-file module docs (the
module-level comment in skills.rs) to state that the default install keeps the
host platform's deep-dive .md and drops the other platform .md files (and note
the --all-platforms flag keeps all three), making the wording consistent with
the implementation.

@f-trycua
f-trycua merged commit 7b3f29d into main May 24, 2026
6 of 7 checks passed
@f-trycua
f-trycua deleted the skills-filter-host-platform branch May 24, 2026 14:43
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