Bunli
PackagesPlugin Packages

@bunli/plugin-skills

Sync CLI commands as agent skill files for AI coding agents

Installation

bun add @bunli/plugin-skills

Overview

@bunli/plugin-skills syncs your Bunli CLI commands as skill files for AI coding agents. When installed, agents like Claude Code, Cursor, and others can discover and use your CLI commands as part of their skill ecosystem.

Features

  • Multi-agent support - Syncs to 40+ AI coding agents
  • Universal agents - Uses .agents/skills directory (Clau, Cline, Codex, Cursor, etc.)
  • Non-universal agents - Creates symlinks from agent-specific dirs to canonical skills dir
  • Project-local or global - Install skills per-project or system-wide
  • Smart detection - Only installs for agents detected on the system

Basic Usage

import { createCLI, defineCommand } from "@bunli/core";
import { skillsPlugin } from "@bunli/plugin-skills";

const cli = await createCLI({
  name: "my-cli",
  plugins: [skillsPlugin()],
});

cli.command(
  defineCommand({
    name: "build" as const,
    description: "Build the project",
    handler: async ({ flags }) => {
      /* ... */
    },
  }),
);

await cli.run();

Then in your project:

# Sync skills for detected agents
my-cli skills sync

# List detected agents
my-cli skills list

Built-in Agents

The plugin supports these agents out of the box:

Universal Agents

Use .agents/skills as their skills directory:

AgentGlobal Skills Dir
Amp~/.config/agents/skills
Antigravity~/.gemini/antigravity/skills
Cline~/.agents/skills
Codex~/.codex/skills
Cursor~/.cursor/skills
Deep Agents~/.deepagents/agent/skills
Gemini CLI~/.gemini/skills
GitHub Copilot~/.copilot/skills
Kimi Code CLI~/.config/agents/skills
OpenCode~/.config/opencode/skills
Warp~/.agents/skills

Non-Universal Agents

Use agent-specific directories (plugin creates symlinks):

AgentGlobal Skills DirProject Skills Dir
AdaL~/.adal/skills.adal/skills
Augment~/.augment/skills.augment/skills
Claude Code~/.claude/skills.claude/skills
CodeBuddy~/.codebuddy/skills.codebuddy/skills
Command Code~/.commandcode/skills.commandcode/skills
Continue~/.continue/skills.continue/skills
Cortex Code~/.snowflake/cortex/skills.cortex/skills
Crush~/.config/crush/skills.crush/skills
Droid~/.factory/skills.factory/skills
Goose~/.config/goose/skills.goose/skills
iFlow CLI~/.iflow/skills.iflow/skills
Junie~/.junie/skills.junie/skills
Kilo Code~/.kilocode/skills.kilocode/skills
Kiro CLI~/.kiro/skills.kiro/skills
Kode~/.kode/skills.kode/skills
MCPJam~/.mcpjam/skills.mcpjam/skills
Mistral Vibe~/.vibe/skills.vibe/skills
Mux~/.mux/skills.mux/skills
Neovate~/.neovate/skills.neovate/skills
OpenClaw~/.openclaw/skillsskills
OpenHands~/.openhands/skills.openhands/skills
Pi~/.pi/agent/skills.pi/skills
Pochi~/.pochi/skills.pochi/skills
Qoder~/.qoder/skills.qoder/skills
Qwen Code~/.qwen/skills.qwen/skills
Roo Code~/.roo/skills.roo/skills
Trae~/.trae/skills.trae/skills
Trae CN~/.trae-cn/skills.trae/skills
Windsurf~/.codeium/windsurf/skills.windsurf/skills
Zencoder~/.zencoder/skills.zencoder/skills

Plugin Options

interface SkillsPluginOptions {
  /** CLI description for the generated skill files */
  description?: string;

  /** Additional custom agents beyond the built-in list */
  agents?: Agent[];
}

Commands

skills sync

Generate and install skill files for detected agents:

my-cli skills sync           # Sync with defaults
my-cli skills sync --global  # Global installation (default)
my-cli skills sync --force   # Force regeneration

Options:

  • --global, -g - Install globally (default) or project-local
  • --force, -f - Force regeneration even if up to date

skills list

List detected agents on the system:

my-cli skills list

Example output:

Detected 3 agent(s):

  Claude Code
    ~/.claude/skills

  Cursor
    ~/.cursor/skills

  Cline
    ~/.agents/skills

Custom Agents

Add custom agent support:

import { skillsPlugin } from "@bunli/plugin-skills";

const cli = await createCLI({
  plugins: [
    skillsPlugin({
      description: "My custom CLI tool",
      agents: [
        {
          name: "MyAgent",
          globalSkillsDir: "~/.myagent/skills",
          projectSkillsDir: ".myagent/skills",
          universal: true,
          detect: () => process.env.MY_AGENT_DETECTED === "1",
        },
      ],
    }),
  ],
});

Skill File Format

The plugin generates Markdown skill files (SKILL.md) with YAML frontmatter:

---
name: my-cli-build
description: Build the project
---

# my-cli build

Build the project.

## Options

| Flag          | Type      | Default | Description        |
| ------------- | --------- | ------- | ------------------ |
| `--env, -e`   | `union`   | `dev`   | Target environment |
| `--watch, -w` | `boolean` | `false` | Watch mode         |

Each skill file includes:

  • name — slug format (my-cli-build)
  • description — from the command's description field
  • Options table — derived from the command's Zod option schemas

How It Works

  1. Detection - Scans for agents by checking for their config directories
  2. Discovery - Collects all registered CLI commands
  3. Generation - Creates skill files for each command
  4. Installation - Installs to project-local or global skills directories
  5. Symlinking - For non-universal agents, creates symlinks to the canonical .agents/skills directory

Integration with AI Agents

Once synced, agents can discover and invoke your CLI commands:

Agent: "Build the project using the CLI tool"

Looks for skill: "my-cli:build"

Executes: my-cli build

See Also

On this page