Skip to content

feat(skills): auto-load skills into system prompt + CLI install commands#891

Open
h4sht wants to merge 1 commit into
CodebuffAI:mainfrom
h4sht:feat/skills-auto-load-cli
Open

feat(skills): auto-load skills into system prompt + CLI install commands#891
h4sht wants to merge 1 commit into
CodebuffAI:mainfrom
h4sht:feat/skills-auto-load-cli

Conversation

@h4sht

@h4sht h4sht commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Skills now behave like Claude Code — installed skills are automatically loaded into the agent's system prompt and always available without needing the agent to explicitly call the `skill` tool.

Problem

Before this PR, skills were a cumbersome two-step process:

  1. Install skills via `npx skills add` from the terminal
  2. The agent had to explicitly call the `skill` tool by name to load each skill's content

This meant:

  • No way to install skills from within the CLI (had to switch to terminal)
  • Skills weren't automatically available — agent had to know to load them
  • The `/skill:name` slash command injected raw skill YAML as user prompt text, mixing skill content with user requests

Solution

1. CLI Commands

Two new slash commands:

  • `/skills install <owner/repo> [--skill ]` — Downloads a skill via `npx skills add` into `.agents/skills/`. Shows install output and refreshes the skill registry. Installed skills will be available in the next session (use `/new`).

  • `/skills list` — Shows all currently installed skills with their names and descriptions.

2. System Prompt Auto-Injection

When a session starts, all loaded skills are injected directly into the agent's system prompt as a `# Pre-loaded Skills` section. The YAML frontmatter is stripped so the model only sees the actual instructions. The agent is told it does NOT need to call the `skill` tool.

3. Updated Agent Prompt

The base2 agent prompt now reflects that skills are pre-loaded and directs users to use `/skills install` slash commands instead of `npx skills add`.

Files Changed

File Change
`cli/src/commands/command-registry.ts` Added `/skills install` and `/skills list` commands with `execSync` for npx
`packages/agent-runtime/src/run-agent-step.ts` Inject loaded skills into system prompt after generation
`agents/base2/base2.ts` Updated skill instructions bullet to reflect auto-loading
`cli/src/data/slash-commands.ts` Added `/skills` to slash command menu

Backward Compatibility

  • The `skill` tool is preserved — it still works for dynamic loading if needed
  • Existing `/skill:name` slash commands continue to work (no alias conflict)
  • Skills installed via `npx skills add` are still picked up at session start

Known Limitations

  • Newly installed skills require a session restart (`/new`) to appear in the system prompt
  • `execSync` is used for installation (blocks UI briefly) — could be upgraded to async spawn in a follow-up
  • Skills are injected for all non-child agents, not just the orchestrator

Skills now behave like Claude Code — installed skills are automatically
loaded into the agent's system prompt and always available without needing
to call the `skill` tool.

CLI commands:
- /skills install <owner/repo> [--skill <name>] — download a skill via npx
- /skills list — show all installed skills

System prompt injection:
- Loaded skills are injected into the system prompt with YAML frontmatter
  stripped, so the agent always has their full instructions available
- The `skill` tool remains for backward compatibility but is no longer
  required since skills are pre-loaded

Agent prompt update:
- base2 agent prompt reflects that skills are pre-loaded and tells the
  agent to use /skills slash commands instead of npx skills add
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