Skip to content

fix(skills): install all default sandbox skills (build-os ref + resilient install)#733

Merged
sweetmantech merged 2 commits into
mainfrom
fix/default-skill-install
Jul 1, 2026
Merged

fix(skills): install all default sandbox skills (build-os ref + resilient install)#733
sweetmantech merged 2 commits into
mainfrom
fix/default-skill-install

Conversation

@sweetmantech

@sweetmantech sweetmantech commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Part of recoupable/chat#1833 (prerequisite item). Base: main.

Problem

Task sandboxes shipped with only 2 of 6 default skills. Two bugs:

  1. DEFAULT_GLOBAL_SKILL_REFS listed recoup-platform-build-workspace (renamed to recoup-platform-build-os) → npx skills add 404s.
  2. installGlobalSkills threw on the first failure, so that bad ref aborted the loop and every skill after it (all three recoup-roster-*) never installed.

Verified on the Apache→OneRPM run (chat#1833): loading recoup-roster-list-artists returned "Skill not found. Available: recoup-platform-api-access, recoup-platform-email-helper."

Fix

  • defaultGlobalSkillRefs.ts: recoup-platform-build-workspacerecoup-platform-build-os.
  • installGlobalSkills.ts: best-effort per skill — console.error + continue instead of throw, so one bad ref can't block the rest.

Tests (TDD)

  • New RED→GREEN test: installGlobalSkills continues past a failed skill, still attempts the rest, logs the failure, never throws.
  • Full lib/skills suite green (49), tsc + eslint clean.

🤖 Generated with Claude Code


Summary by cubic

Ensure all default sandbox skills install by fixing a renamed ref and making installs resilient. One bad ref no longer blocks the rest.

  • Bug Fixes
    • Updated DEFAULT_GLOBAL_SKILL_REFS: recoup-platform-build-workspacerecoup-platform-build-os to stop npx skills add 404s.
    • Made installGlobalSkills best-effort: never throws; logs and continues so later skills (e.g., recoup-roster-*) still install.

Written for commit e6fc562. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Updated the default platform setup to include the OS build skill instead of the workspace build skill.
  • Bug Fixes

    • Skill installation now continues even if one item fails, allowing the rest of the setup to complete.
    • Failed installs are now reported in the console for easier troubleshooting.

…ient install)

Two bugs left task sandboxes with only 2 of 6 default skills:
- DEFAULT_GLOBAL_SKILL_REFS listed `recoup-platform-build-workspace`, which was
  renamed to `recoup-platform-build-os` → `npx skills add` 404s on it.
- installGlobalSkills threw on the first failed skill, so that bad ref aborted the
  loop and every skill after it (all 3 recoup-roster-*) never installed.

Fix the ref and make installGlobalSkills best-effort per skill (log + continue),
so one bad ref can't block the rest. Verified on the Apache→OneRPM run
(recoupable/chat#1833): loading recoup-roster-list-artists returned "Skill not
found. Available: recoup-platform-api-access, recoup-platform-email-helper".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
api Ready Ready Preview Jul 1, 2026 8:48pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7e9c56dc-5b3f-401a-a83c-adfda7c67e7c

📥 Commits

Reviewing files that changed from the base of the PR and between db0e2b2 and e6fc562.

⛔ Files ignored due to path filters (2)
  • lib/skills/__tests__/defaultGlobalSkillRefs.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/skills/__tests__/installGlobalSkills.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (2)
  • lib/skills/defaultGlobalSkillRefs.ts
  • lib/skills/installGlobalSkills.ts

📝 Walkthrough

Walkthrough

The default global skill reference was changed from recoup-platform-build-workspace to recoup-platform-build-os. Additionally, installGlobalSkills was updated to log per-skill installation failures via console.error and continue processing remaining skills instead of throwing and aborting the batch.

Changes

Global Skill Install Updates

Layer / File(s) Summary
Default skill reference swap
lib/skills/defaultGlobalSkillRefs.ts
Installed default skill entry changed from recoup-platform-build-workspace to recoup-platform-build-os.
Best-effort install error handling
lib/skills/installGlobalSkills.ts
Doc comment and failure branch updated so failed installs are logged with console.error (including skill name, source, and error output) and the loop continues instead of throwing.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • recoupable/api#527: Modifies the same defaultGlobalSkillRefs.ts and installGlobalSkills.ts files, touching default skill entries and per-ref install error behavior.

Poem

A workspace skill hops out the door,
build-os steps in, ready to explore.
No more crashing at the first mistake,
just log it, shrug, and skills we make. 🐰
Batch installs march on, undeterred—
one failure noted, the rest still heard.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Solid & Clean Code ✅ Passed Touched files keep a single primary export, names align, and the new best-effort path is compact and cohesive with no clear SRP/DRY/KISS regressions.
✨ 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 fix/default-skill-install

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

Confidence score: 4/5

  • In lib/skills/__tests__/installGlobalSkills.test.ts, console.error is restored only on passing paths, so a failing assertion can leak a mocked/silenced logger into later tests and mask real failures or debugging output; move restoration to afterEach (or a try/finally) so cleanup always runs before merging.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="lib/skills/__tests__/installGlobalSkills.test.ts">

<violation number="1" location="lib/skills/__tests__/installGlobalSkills.test.ts:73">
P2: `errorSpy.mockRestore()` only fires on test pass — if any assertion fails, `console.error` stays mocked (silenced) for all subsequent tests. `vi.clearAllMocks()` in `beforeEach` clears call data but does NOT restore the original implementation.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant Installer as installGlobalSkills()
    participant Sandbox as Sandbox
    participant Npx as npx skills add
    participant Console as console
    participant Refs as GlobalSkillRefs[]

    Note over Refs: Includes recoup-platform-build-os (corrected name)

    Installer->>Installer: Validate & dedupe refs via globalSkillRefsSchema

    loop For each globalSkillRef in refs
        Installer->>Npx: npx skills add <source>/<skillName>
        Npx->>Sandbox: Execute install command
        Sandbox-->>Npx: Result { success, stderr, stdout }

        alt success === true
            Npx-->>Installer: Command completed
            Installer->>Installer: Continue to next skill
        else success === false
            Npx-->>Installer: Failure result
            Installer->>Console: console.error("Failed to install skill: ...")
            Installer->>Installer: continue (skip failed skill)
            Note right of Installer: NEW: never throws, logs and continues
        end
    end

    Note over Installer: OLD: first failure threw Error, aborted entire loop

    Installer-->>Installer: Function returns (undefined)
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

// A single bad skill must NOT block the rest — both are attempted.
expect(exec).toHaveBeenCalledTimes(2);
expect(errorSpy).toHaveBeenCalledWith(expect.stringContaining("package not found"));
errorSpy.mockRestore();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: errorSpy.mockRestore() only fires on test pass — if any assertion fails, console.error stays mocked (silenced) for all subsequent tests. vi.clearAllMocks() in beforeEach clears call data but does NOT restore the original implementation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/skills/__tests__/installGlobalSkills.test.ts, line 73:

<comment>`errorSpy.mockRestore()` only fires on test pass — if any assertion fails, `console.error` stays mocked (silenced) for all subsequent tests. `vi.clearAllMocks()` in `beforeEach` clears call data but does NOT restore the original implementation.</comment>

<file context>
@@ -61,8 +63,13 @@ describe("installGlobalSkills", () => {
+    // A single bad skill must NOT block the rest — both are attempted.
+    expect(exec).toHaveBeenCalledTimes(2);
+    expect(errorSpy).toHaveBeenCalledWith(expect.stringContaining("package not found"));
+    errorSpy.mockRestore();
   });
 });
</file context>

@sweetmantech

Copy link
Copy Markdown
Contributor Author

Preview verification — all 6 default skills now install (was 2)

Ran a sandbox skills-availability check on this PR's preview — https://api-giic2y0so-recoup.vercel.app, built from head 6f0f7574. Chat edc3d328-2672-4e1f-a32b-b1bed6da2684.

Result: a fresh sandbox installs all 6 default skills, and the previously-broken roster skills load.

ls -1 ~/.agents/skills/:

recoup-platform-api-access
recoup-platform-build-os          ← the corrected ref (was build-workspace → 404)
recoup-platform-email-helper
recoup-roster-add-artist
recoup-roster-list-artists
recoup-roster-manage-artist

All 6 present — including recoup-platform-build-os and all three recoup-roster-*.

Loading recoup-roster-list-artists (the exact skill that failed on the buggy path) via the skill tool:

{"success":true,"skillName":"recoup-roster-list-artists","skillPath":".../recoup-roster-list-artists","content":"# Recoup — List Artists…"}

success: true.

vs. before #733

On the original OneRPM prod run (chat c38d62cd), loading recoup-roster-list-artists returned:

"Skill not found. Available skills: recoup-platform-api-access, recoup-platform-email-helper" — only 2 of 6.

Because the renamed recoup-platform-build-workspace ref (#3 in DEFAULT_GLOBAL_SKILL_REFS) 404'd and installGlobalSkills threw, aborting the loop before the three recoup-roster-* skills (#4–6). #733 fixes the ref → build-os and makes installGlobalSkills best-effort (log + continue), so a single bad ref can't block the rest.

Net: task sandboxes now get their full toolkit — agents can resolve/verify the roster instead of guessing, directly improving grounding.

@sweetmantech sweetmantech merged commit b3bac3c into main Jul 1, 2026
5 of 6 checks passed
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