Skip to content

fix: embed skill content instead of reading from disk#2992

Merged
louisgv merged 2 commits intoOpenRouterTeam:mainfrom
AhmedTMM:fix/embed-skill-content
Mar 25, 2026
Merged

fix: embed skill content instead of reading from disk#2992
louisgv merged 2 commits intoOpenRouterTeam:mainfrom
AhmedTMM:fix/embed-skill-content

Conversation

@AhmedTMM
Copy link
Collaborator

Summary

  • The skills/ directory exists in the repo but isn't bundled when the CLI is installed via npm — readSkillContent() couldn't find files at runtime, causing No spawn skill file for agent: claude on every deploy
  • Fixed by embedding all skill content as string constants directly in spawn-skill.ts
  • Removed fs-based getSkillsDir(), readSkillContent(), getSpawnSkillSourceFile() in favor of a single AGENT_SKILLS config map with inline content
  • Net -20 lines (147 added, 167 removed)

Test plan

  • bunx @biomejs/biome check src/ — zero errors
  • bun test src/__tests__/spawn-skill.test.ts — 43 pass, 0 fail
  • spawn claude sprite --beta recursive → skill file written successfully

🤖 Generated with Claude Code

AhmedTMM and others added 2 commits March 25, 2026 15:56
The spawn skill injection condition used `enabledSteps?.has("spawn")`
which is falsy when enabledSteps is undefined (no --steps flag). Now
checks the recursive beta flag directly and falls through when no
explicit steps are selected, matching how auto-update works.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The skills/ directory exists in the repo but isn't bundled when the CLI
is installed via npm. readSkillContent() couldn't find the files at
runtime, causing "No spawn skill file for agent" on every deploy.

Fixed by embedding all skill content directly as string constants in the
module. Removed fs-based getSkillsDir/readSkillContent/getSpawnSkillSourceFile
in favor of a single AGENT_SKILLS config map with inline content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

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

Security Review

Verdict: APPROVED
Commit: 0c09003

Findings

✅ No security issues found

Security Analysis

  • Command injection: SAFE - base64 validated with regex, paths hardcoded
  • Path traversal: SAFE - all paths are hardcoded constants
  • File permissions: GOOD - chmod 644 for instruction files
  • Error handling: ROBUST - graceful degradation on failure
  • Content safety: SAFE - static markdown documentation only
  • Feature gating: CORRECT - properly gated behind SPAWN_BETA flag

Tests

  • ✅ bun test: 43 pass, 0 fail
  • ✅ biome lint: 0 errors
  • ✅ bash -n: N/A (no shell scripts modified)

Summary

This PR refactors skill injection to embed content directly instead of reading from disk, improving npm package reliability. All security properties are preserved: paths are hardcoded, base64 is validated, and error handling is robust.


-- security/pr-reviewer

@louisgv louisgv merged commit b47d6bb into OpenRouterTeam:main Mar 25, 2026
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.

2 participants