Skip to content

CLI: skills install --auto and refresh keep a cua-driver opt-out and removed skill folders across updates - #185

Open
shivamhwp wants to merge 3 commits into
ardia-browser:mainfrom
shivamhwp:issue-watch/ardia-4769
Open

shivamhwp wants to merge 3 commits into
ardia-browser:mainfrom
shivamhwp:issue-watch/ardia-4769

Conversation

@shivamhwp

@shivamhwp shivamhwp commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Closes ardia-browser/ardia#4769

Ardia runs ardia skills install --auto and then ardia skills refresh after every CLI update, and between them they undid every opt-out. install --auto always reinstalled cua-driver's skill and reset the marker to "companions": ["cua-driver"], even after --no-cua or a deleted cua-driver folder. refresh then rewrote skills.json with only the folders still on disk, so a removed ardia folder was skipped once and reinstalled, with cua-driver, on the next update.

Now install --auto uses the rule refresh already had. Next to an existing copy, it puts cua-driver back only where the marker names it and ardia's copy is still there; a fresh folder gets it unless someone else's cua-driver skill is already there. Either way the marker records the choice. refresh keeps the user-level folders it recorded (the only ones install --auto looks at), so a copy the user removed, or took over by deleting its .ardia-skill, stays skipped. Project folders that are gone or no longer ardia's are still pruned, as before. A plain ardia skills install without --no-cua still installs cua-driver, so opting back in is one command. docs/cli.md says all of this.

Before and after. The CLI ran from source (bun src/main.ts, Bun 1.4.5, Linux) against a throwaway HOME with ~/.claude present and ARDIA_CLI_HOME set. Each "update" is skills install --auto followed by skills refresh. The table shows the state after the second update.

Scenario origin/main (d87fc6c) This PR
install --no-cua, then 2 updates cua-driver back, companions: ["cua-driver"] cua-driver absent, companions: []
install, delete cua-driver/, then 2 updates cua-driver back cua-driver absent
install, delete ardia/ and cua-driver/, then 2 updates update 1 skips (removed after an earlier install), skills.json becomes [], update 2 reinstalls both both updates skip; skills.json keeps the folder
install --no-cua, delete .ardia-skill, update, delete ardia/, 2 updates both reinstalled skipped
standalone install --auto next to another cua-driver skill, which is then removed ardia's cua-driver installed not installed
fresh machine, 1 update ardia + cua-driver ardia + cua-driver (unchanged)

One output change: next to someone else's cua-driver skill, install --auto no longer prints the kept … cua-driver's own installer? line, because it no longer tries to install there. A plain install still prints it (skills--install-cua-foreign-kept).

Tested at 63294f7 on Linux:

  • bun run typecheck and tsrs --noEmit -p tests/m3: pass.
  • All 27 cases in tests/parity/cases/skills.json, through tests/parity/engine.ts against scripts/build.sh's binary (Bun 1.3.14): pass.
  • tests/skills-commit.test.ts and tests/after-update-stop.test.ts: 16 pass, 0 fail, 5 macOS-only skips.

Not shown: the full bun run test and bun run test:parity suites and macOS. They weren't run locally; this PR's CI runs them on macos-15 and ubuntu-24.04.


Run Proof on this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Refresh and automatic installs now preserve remembered project- and user-level folders, including user-level entries whose folders or markers have been removed.
    • Companion skill handling now respects prior opt-outs: refresh and automatic installs restore companions only when previously recorded or covered by a legacy marker. Fresh installs add a companion only when one is not already present; --no-cua or removing the companion keeps it absent during updates. A standard install without --no-cua can add it again.
  • Documentation
    • Updated CLI guidance to explain folder retention and companion skill behavior.

…members removed folders

The afterUpdate pair undid both opt-outs on every CLI update. install --auto
always installed cua-driver next to each ardia skill and reset the marker's
companions, ignoring "companions": [] from --no-cua and a deleted cua-driver
folder. refresh then rewrote skills.json with only the folders still on disk,
so a removed ardia folder was skipped once and reinstalled, with cua-driver,
on the next update.

install --auto now uses refresh's own rule for the companion: put it back only
where the marker names it (or predates companions) and ardia's copy is there,
or on a fresh install. refresh keeps a recorded folder that is gone, so the
"removed after an earlier install" skip lasts. A plain install without --no-cua
still installs cua-driver, so opting back in is one command.

Refs ardia-browser/ardia#4769
… records the companion choice

refresh kept a recorded folder only when it was ours or gone, so taking a copy
over by deleting its marker dropped it from skills.json, and deleting the folder
afterwards let the next update reinstall ardia and cua-driver. It now keeps every
recorded folder; install --auto already skips one that is gone or not ours.

A standalone install --auto next to someone else's cua-driver skill left the
marker's companions unset, so removing that skill made the next install --auto
put ardia's copy there. It now records the companion the way refresh does.

wantsCompanion takes the marker refresh already read and checks for a link
before reading through it.
…uto checks

Keeping every recorded folder let skills.json grow with project folders that
are no longer ardia's; past the 1 MiB read limit the record reads as empty and
the opt-outs go with it, and each refresh kept printing "skipped" for them.
install --auto only ever looks at the user-level folders, so refresh keeps those
it recorded, removed or taken over, and prunes project folders as before.
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Skill installation state

Layer / File(s) Summary
Companion installation policy
plugins/cli/ts/src/skills.ts
install accepts opt-out-aware computer-use settings. The installer checks the recorded companion choice and existing companion folder before installing cua-driver. installDetected passes the opt-out-aware setting when computer use is enabled.
Refresh folder and companion state
plugins/cli/ts/src/skills.ts, plugins/cli/docs/cli.md
refresh retains previously recorded user-level folders, processes owned folders, and saves the remembered folder list. It uses the companion decision helper. The CLI documentation describes companion handling during refresh and installation.

Suggested reviewers: mantrakp04

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 63294

Skills install --auto and refresh now keep a cua-driver opt-out and removed user-level skill folders across updates, as the linked issue requests. No concrete merge-blocking problem was found. Confirm that the failing CI check is unrelated to this change before merging.

Security architecture risk: Low · up to 63294

Automatic updates now respect companion opt-outs and leave deliberately removed skills alone. The trade-off is that a rare interruption during folder replacement can also look like a deliberate removal, leaving the local skill missing until the user reinstalls it. The change does not expand what automatic updates can install or overwrite.

Retained concerns

  • Low · reliability · inferred: On filesystems using the two-rename replacement fallback, a hard interruption between renames can leave a recorded user-level skill absent with its prior contents still in the backup folder. Both automatic commands check for absence before reaching backup recovery. The base refresh cleared the record so a later automatic install could reach recovery; the head retains it, so later updates continue to skip the skill. Impact is limited to local skill availability and recovery.
Security review details

Security Blast Radius

  • inferred — The inspected automatic paths do not add a caller with new authority, a companion source, or a destination. The companion gate narrows when the existing installer runs, and refresh still visits the same union of recorded and user-level destinations.

Trust Boundaries and Controls

  • observed — A retained record entry does not authorize writes. Refresh still requires the folder to be present and pass the ownership check, which rejects unsafe path chains and symlinked skill folders. The companion installer separately preserves existing foreign copies.

Resilience and Maintainability Implications

  • inferred — Successful sequential updates preserve an explicit companion opt-out. If the companion installation reports a handled failure, the automatic path does not record success and can reevaluate on retry. The record's rename publishes a complete file but does not make concurrent read-modify-write sequences atomic; the potential for concurrent updates to overwrite one another predates this PR.

Hardening Proposals

  • proposed — Distinguish a verified interrupted replacement from a deliberate removal before treating a missing user-level folder as an opt-out. Preserve the existing path and ownership checks, and cover both cases in a recovery regression test.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: adfe8cb5-b560-4f52-b94b-e67074b74841
Commits

Reviewing files that changed from the base of the PR and between d87fc6c and 63294f7.

Files selected for processing: 2

  • plugins/cli/docs/cli.md
  • plugins/cli/ts/src/skills.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
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.

CLI: allow opting out of cua-driver skill permanently across CLI updates

1 participant