Skip to content

Bundled skills and commands not auto-discovered on install #28

Description

@tomdurrant

Problem

@juliusbrussee/caveman-code ships with several packaged resources in subdirectories:

  • skills/ — 6 skills (cavekit-methodology, cavekit-design-system, cavekit-revision, cavekit-validation-first, caveman-compress, plugin-creator)
  • commands/ — 11 command markdown files (clean, commit, explain, fix-types, goal, log, migrate, perf, review, sec-review, test)
  • agents/ — 5 agent defs (critic, explore, implementer, reviewer, tester)

Agents are correctly auto-discoveredloadAgentDefs() in dist/core/agent-defs/loader.js explicitly joins getPackageDir() with "agents" and scans for bundled defaults.

Skills and commands are not. Installing via npm install -g @juliusbrussee/caveman-code leaves these resources invisible to the agent. There is no postinstall script, onboarding step, or setup command that links or registers them.

Root cause

Skills

dist/core/resource-loader.js calls loadSkills() with includeDefaults: false, passing only paths resolved by the package manager. The package manager resolves paths from settings, auto-discovered directories (~/.cave/agent/skills/, ~/.agents/skills/, .cave/skills/, .agents/skills/), and installed packages — but never adds the main package's own skills/ directory.

There is no join(getPackageDir(), "skills") anywhere in the skill discovery pipeline.

Commands

loadMarkdownCommands() in dist/core/slash-commands.js supports a defaultsDir option for bundled commands, and findBundledCommandsDir() correctly resolves <package>/commands/. However, neither function is ever called in the runtime — they're exported from the SDK but unused. There is no caller that passes defaultsDir: findBundledCommandsDir(getPackageDir()).

Expected behavior

Installing @juliusbrussee/caveman-code should make all bundled resources available:

  1. Skills in <available_skills> — the agent should know about cavekit-methodology, cavekit-design-system, etc.
  2. Commandsplan.md, commit.md, review.md, etc. should be available as markdown slash commands
  3. The /skills hub overlay should list these as "bundled" resources

Suggested fix

Skills

Add the package's skills/ directory to the discovery paths, analogous to how loadAgentDefs handles bundled agents:

// In addAutoDiscoveredResources() or reload()
const bundledSkillsDir = join(getPackageDir(), "skills");

Commands

Wire up loadMarkdownCommands with defaultsDir in the interactive mode or session startup:

import { findBundledCommandsDir, loadMarkdownCommands } from "...";
const defaultsDir = findBundledCommandsDir(getPackageDir());
if (defaultsDir) {
  loadMarkdownCommands({ cwd, agentDir, defaultsDir });
}

Workaround

mkdir -p ~/.cave/agent/skills
for d in $(find $(dirname $(dirname $(readlink -f $(which caveman))))/skills -maxdepth 1 -type d | tail -n +2); do
  ln -sf "$d" ~/.cave/agent/skills/
done

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions