Skip to content

fix: install agent skills project-scoped so the PromptScript target lands (#4642) - #6580

Draft
nwparker wants to merge 2 commits into
mainfrom
nwparker/fix-4642
Draft

nwparker wants to merge 2 commits into
mainfrom
nwparker/fix-4642

Conversation

@nwparker

@nwparker nwparker commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #4642 by replacing Orca's unusable global PromptScript install/update commands with home-scoped project installs that land in the skill source Orca already discovers.

Evidence of fix

Before (live): npx skills add ... --skill orchestration --global printed Installation complete / Installed 1 skill, then PromptScript does not support global skill installation, exited 0, and created no PromptScript SKILL.md.

After (live): the project-scoped -y form exited 0, created ~/.agents/skills/orchestration/SKILL.md plus skills-lock.json, emitted no PromptScript failure, and Orca classified the install as a visible home source. GitHub checks are green.

ELI5

Orca asked the installer to put a skill “everywhere,” but the one format Orca reads refuses global installation. The fix installs it in the user's home folder, where Orca already looks.

User-facing trade-offs

  • Installs are home-scoped rather than machine-global; the removed global path never installed Orca's PromptScript target successfully.
  • Surfaced/copyable commands first move to the user's home so results do not depend on the caller's current project.
  • The POSIX wrapper was live-smoked; native Windows home scoping is covered by focused tests rather than a live Windows shell run.

🧑‍🤝‍🧑 Impact & ELI5

1) What's broken today (ELI5). Anyone who tries to turn on Orca's extra agent abilities (the orchestration skill, computer-use, the Linear integration) by clicking the in-app "Install" button hits a silent dead end. The installer runs, cheerfully prints "✓ Installed 1 skill," and finishes with a green light — but the one piece Orca actually needs never gets installed. So Settings keeps showing "Not installed," the user clicks install again, gets another fake success, and the skill never appears. It looks like the app is lying to you. This hits every user trying to enable these features through the app (the issue was reported on Windows/WSL2, but the broken command was used everywhere), and it's a hard blocker for those features — not a cosmetic annoyance.

2) What this PR does (ELI5). The installer was passing a "--global" option that means "install for the whole machine." It turns out the specific format Orca reads (PromptScript) flatly refuses to be installed that way — but the installer tool shrugged it off, skipped that one piece, and still reported overall success. This PR simply stops asking for the machine-wide install and instead installs into the user's home folder (and adds a "-y" so the installer doesn't stop to ask a question in the auto-run terminal). Orca already looks for skills in that home folder. So: it now actually installs the skill where Orca can see it, instead of trying a global install that quietly throws the important part away.

3) Tradeoffs / regressions — honest answer. Effectively no regressions. Nothing is disabled and there's no new setup step for the normal in-app flow — the "global" path it removed never actually installed the skill Orca uses, so nobody loses a working behavior. Orca was already only ever looking in the home folder (there is no machine-wide "global" location in its detection at all), so the install now lands exactly where the app already checks. The "-y" auto-confirm is the right call for a terminal the app runs automatically. The earlier manual-copy caveat is now removed: every surfaced setup/copy command forces the process cwd to the user's home before invoking the project-scoped npx skills command (POSIX/WSL: cd "$HOME" && ...; native Windows: PowerShell Set-Location -Path ~). The inner install remains project-scoped because PromptScript still cannot install globally, but Orca now pins that project scope to the scanned home source. Product tradeoff is now zero. Honest validation caveat: the POSIX wrapper was live-smoked from a non-home cwd in this macOS worktree; the native Windows wrapper is covered by unit tests here rather than a live Windows shell run.


Summary

Fixes #4642

The in-app agent-skill install/update commands hardcoded the --global flag. The npx skills CLI cannot install the PromptScript target — the only target Orca actually consumes — in global mode. It silently skips that one target, still prints a success banner (Installed 1 skill), and exits 0. The PromptScript failure is buried as a trailing footnote (Failed to install 1 — orchestration → PromptScript: PromptScript does not support global skill installation). Net effect: the documented/in-app install command reports success every time but the orchestration / computer-use / Linear skill never installs for Orca, so Settings keeps showing the install prompt.

Both command builders live in src/shared/agent-feature-install-commands.ts and every install surface flows through them, so the defect is centralized there.

Fix: drop --global and add -y to the install command, and drop --global from the update command (project-scoped). Key insight that keeps this minimal: the in-app setup terminal always runs in the home directory (OnboardingInlineCommandTerminal resolves its cwd via getFloatingTerminalCwd({ path: '~' })), so a project-scoped install lands in ~/.agents/skills/<skill>. Skill discovery already classifies ~/.agents/skills as a 'home' source (skill-discovery-sources.ts), which is exactly what every feature-setup surface filters on (GLOBAL_AGENT_SKILL_SOURCE_KINDS = ['home']). No detection-layer change is required — the install now lands in a path the UI already inspects. The native-Windows update-normalization regex in CliSkillRuntimeSetup.tsx was updated to match the new (no---global) update form so it keeps rewriting updates to idempotent reinstalls on Windows host.

Zero-tradeoff follow-up: surfaced setup/copy commands now home-scope the project install before running it, so copied commands behave the same as the in-app terminal even when pasted from an arbitrary project directory. This covers onboarding, settings, feature tips, mobile emulator setup, WSL wrapping, and native Windows host wrapping.

Screenshots

No visual change to component markup. The user-visible effect is behavioral: after running the in-app install, Settings > Agent Orchestration (and the other skill panels) now flip to "Installed" instead of remaining stuck on "Not installed". Live npx skills before/after evidence is posted as a PR comment.

Testing

  • pnpm lint (oxlint on all changed files — clean)
  • pnpm typecheck (tsconfig.node.json and tsconfig.tc.web.json — clean; pre-existing TS6307 project-reference errors in untouched worktree-logic.ts are unrelated and present on base)
  • pnpm test (scoped: shared command builders, discovery, useInstalledAgentSkills, all settings/onboarding/sidebar/feature-wall/setup-guide/emulator/floating-terminal skill tests)
  • pnpm build (not run; no build-affecting change — string + regex edits only)
  • Added/updated high-quality regression tests (see below)

Additional zero-tradeoff follow-up validation:

  • pnpm exec vitest run --config config/vitest.config.ts src/main/skills/discovery.test.ts src/renderer/src/hooks/useInstalledAgentSkills.test.ts src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.test.tsx src/renderer/src/components/settings/BrowserUseSkillStep.test.tsx src/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx src/renderer/src/components/settings/OrchestrationPane.test.tsx src/renderer/src/components/settings/CliSection.test.tsx src/renderer/src/components/settings/AgentSkillSetupPanel.test.tsx src/shared/agent-feature-install-commands.test.ts — 10 files / 90 tests passed
  • pnpm exec oxlint <changed files> — clean
  • pnpm run typecheck:node — clean
  • pnpm run typecheck:web — clean
  • Live POSIX wrapper smoke from a non-home cwd with isolated HOME: skill landed in $HOME/.agents/skills/orchestration/SKILL.md, not the arbitrary work dir

Regression guards added:

  • agent-feature-install-commands.test.ts: asserts the new project-scoped install/update forms and that neither emits --global.
  • discovery.test.ts: builds the real install command and proves a non-global install run from the home dir is classified as a 'home' source (the install→detection coupling the bug broke).
  • useInstalledAgentSkills.test.ts: proves the ['home'] filter reports a home-sourced orchestration install as installed.
  • Updated the ~9 test files that pinned the literal --global strings, including the Windows update-normalization tests.

AI Review Report

Reviewed the full diff adversarially. Main risks checked:

  • Install/detection coupling (the core risk the issue flags): verified the setup terminal cwd is the home dir, so the project-scoped install lands in ~/.agents/skills = 'home' source, which the existing detection filter already matches. Confirmed end-to-end with a live npx skills add ... -y run creating ./.agents/skills/orchestration/SKILL.md + skills-lock.json, exit 0, no PromptScript failure.
  • Windows host normalization: normalizeWindowsSkillUpdateCommand regex updated to match npx skills update <name> (no --global); on win32 host the update is still rewritten to an idempotent reinstall.
  • WSL/remote runtime: buildSkillCommandForRuntime wraps the new commands unchanged; the -y flag passes through the WSL login-shell wrapping fine. WSL discovery scans the WSL home, so a project-scoped install in the WSL home is still detected.
  • Cross-platform: no path separators or metaKey involved; all command strings are platform-agnostic and pass through the existing runtime-wrapping layer.

Security Audit

No new input handling, command execution, path handling, auth, secrets, or IPC surface. The change only edits two static command-string templates and one regex; the repository URL and skill names are unchanged constants. Dropping --global and adding -y reduces blast radius (project-local install dir instead of global). The -y flag auto-confirms the skills CLI's interactive selection, which is appropriate for an auto-run setup terminal and matches the issue's confirmed clean-success workaround. No dependency changes.

Notes

  • Provider-agnostic and SSH/remote-aware: the fix is in the shared command builders that the WSL/remote wrapping consumes.
  • Electron end-to-end repro was not run in this isolated worktree (no built out/ artifacts and no display); evidence is the live npx skills CLI before/after plus the unit/integration regression tests, which directly prove the install→detection path.
  • Future suggestion (out of scope): the npx skills CLI itself masking a per-target failure behind a success banner + exit 0 is an upstream UX hazard; worth surfacing partial-failure status in the in-app terminal if the CLI ever exposes it.

Made with Orca 🐋

…ands

The in-app skill install/update commands hardcoded --global. The npx skills
CLI cannot install the PromptScript target (the one Orca consumes) in global
mode: it skips that single target, still prints a success banner, and exits 0,
so the skill silently never installs for Orca.

Drop --global and add -y to the install command (and drop --global from the
update command). The setup terminal runs in the home dir, so a project-scoped
install lands in ~/.agents/skills, which discovery already classifies as a
'home' source the feature-setup surfaces detect — no detection change needed.
Also update the native-Windows update-normalization regex to match the new
project-scoped update form.

Fixes #4642

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nwparker, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 43408a59-42b0-4cc0-a239-6a95764b6697

📥 Commits

Reviewing files that changed from the base of the PR and between e51b2df and 2c7c63f.

📒 Files selected for processing (19)
  • src/main/skills/discovery.test.ts
  • src/main/telemetry/onboarding-feature-setup-validator.test.ts
  • src/renderer/src/components/emulator-pane/MobileEmulatorAgentSetupGuideSteps.tsx
  • src/renderer/src/components/feature-tips/CliSkillSetupTerminal.tsx
  • src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts
  • src/renderer/src/components/onboarding/onboarding-feature-setup.ts
  • src/renderer/src/components/settings/AgentSkillSetupPanel.test.tsx
  • src/renderer/src/components/settings/BrowserUseSkillStep.test.tsx
  • src/renderer/src/components/settings/CliSection.test.tsx
  • src/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx
  • src/renderer/src/components/settings/CliSkillRuntimeSetup.tsx
  • src/renderer/src/components/settings/OrchestrationPane.test.tsx
  • src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.test.tsx
  • src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.update-command.test.tsx
  • src/renderer/src/hooks/useInstalledAgentSkills.test.ts
  • src/renderer/src/lib/agent-feature-install-commands.ts
  • src/renderer/src/lib/agent-feature-skill-home-command.ts
  • src/shared/agent-feature-install-commands.test.ts
  • src/shared/agent-feature-install-commands.ts

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.

@nwparker

Copy link
Copy Markdown
Contributor Author

Evidence

Live npx skills before/after (the exact behavior the issue hinges on)

BEFORE — buggy --global form (what the app emitted):

$ npx skills add https://github.com/stablyai/orca --skill orchestration --global
◇  Installation complete
◇  Installed 1 skill
■  Failed to install 1
   ✗ orchestration → PromptScript: PromptScript does not support global skill installation
exit code: 0
SKILL.md created: 0      <-- PromptScript target silently skipped

AFTER — fixed project-scoped -y form (what the app emits now):

$ npx skills add https://github.com/stablyai/orca --skill orchestration -y
│  ./.agents/skills/orchestration
◇  Installation complete
◇  Installed 1 skill
   ✓ ./.agents/skills/orchestration
exit code: 0
SKILL.md created: ./.agents/skills/orchestration/SKILL.md
lock file:        ./skills-lock.json     <-- no PromptScript failure line

Because the in-app setup terminal runs in the home dir, ./.agents/skills resolves to ~/.agents/skills, which discovery classifies as a 'home' source — the exact source the feature-setup surfaces detect.

Unit / integration test output

./node_modules/.bin/vitest run --config config/vitest.config.ts src/shared/agent-feature-install-commands.test.ts src/main/skills/discovery.test.ts src/renderer/src/hooks/useInstalledAgentSkills.test.ts

Test Files  3 passed (3)
     Tests  27 passed (27)

Settings/skill consumer surfaces (OrchestrationPane, CliSkillRuntimeSetup, AgentSkillSetupPanel, BrowserUseSkillStep, CliSection, Linear prompts, onboarding, telemetry validator):

Test Files  5 passed (5)   Tests 25 passed   (settings command tests)
Test Files  4 passed (4)   Tests 41 passed   (linear + onboarding + telemetry)
Test Files 80 passed (80)  Tests 473 passed  (full settings + skills sweep)
Test Files 49 passed (49)  Tests 348 passed  (feature-wall/setup-guide/emulator/floating-terminal/onboarding)

Lint / typecheck

oxlint <changed files>                              -> clean (exit 0)
tsgo --noEmit -p config/tsconfig.node.json          -> exit 0
tsgo --noEmit -p config/tsconfig.tc.web.json        -> exit 0

(The TS6307 errors under tsconfig.web.json are pre-existing project-reference config issues in untouched worktree-logic.ts/wsl.ts; they appear identically on the base commit. The repo's actual web typecheck entry point is tsconfig.tc.web.json, which is clean.)

@nwparker

Copy link
Copy Markdown
Contributor Author

Zero-tradeoff follow-up

Pushed 2c7c63f8f9 to remove the remaining manual-copy caveat. Surfaced skill setup/copy commands now force the project-scoped npx skills install/update to run from the user home before invoking the skills CLI:

  • POSIX / WSL: cd "$HOME" && ...
  • native Windows host: powershell.exe ... Set-Location -Path ~ ...

That means copied commands now land in the same scanned home source as the in-app terminal, even if pasted from another project directory. Product tradeoff is now zero. Honest validation caveat: the POSIX wrapper was live-smoked from a non-home cwd in this macOS worktree; the Windows wrapper is covered by unit tests here, not a live Windows shell run.

Validation:

  • pnpm exec vitest run --config config/vitest.config.ts src/main/skills/discovery.test.ts src/renderer/src/hooks/useInstalledAgentSkills.test.ts src/renderer/src/components/onboarding/onboarding-feature-setup.test.ts src/renderer/src/components/sidebar/LinearAgentSkillSetupPrompt.test.tsx src/renderer/src/components/settings/BrowserUseSkillStep.test.tsx src/renderer/src/components/settings/CliSkillRuntimeSetup.test.tsx src/renderer/src/components/settings/OrchestrationPane.test.tsx src/renderer/src/components/settings/CliSection.test.tsx src/renderer/src/components/settings/AgentSkillSetupPanel.test.tsx src/shared/agent-feature-install-commands.test.ts — 10 files / 90 tests passed
  • pnpm exec oxlint <changed files> — clean
  • pnpm run typecheck:node — clean
  • pnpm run typecheck:web — clean
  • Live POSIX wrapper smoke from a non-home cwd with isolated HOME: skill landed under $HOME/.agents/skills/orchestration, not the arbitrary work dir

@OrcaWin

OrcaWin commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Moving this PR to draft because it has been untouched for more than 80 days (latest recorded PR activity or commit timestamp: 2026-07-10T10:08:33Z; checked on 2026-10-27). This keeps the review queue focused on active work while preserving the proposal. Please mark it ready for review when work resumes.

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.

[Bug]: npx skills add --global silently fails the PromptScript target but exits 0 — skills never install for Orca

2 participants