技能

技能是注入到智能体系统提示词中的领域知识插件。CLI-JAW 内置 32 个活跃技能和 195 个参考技能,涵盖开发、云平台、文档等领域。

技能的工作原理

每个技能是一个包含 SKILL.md 文件的目录。活跃技能会自动加载到系统提示词中。参考技能会被列为可用,但除非激活,否则不会被注入。

~/.cli-jaw/skills/
├── dev/SKILL.md           # Active: common development rules
├── dev-frontend/SKILL.md  # Active: frontend-specific guidance
├── browser/SKILL.md       # Active: browser automation
└── ...

~/.cli-jaw/skills_ref/
├── registry.json          # Reference skill catalog
├── cloudflare/SKILL.md    # Available on demand
├── docker/SKILL.md
└── ...

技能分类

分类示例
开发dev, dev-frontend, dev-backend, dev-data, dev-testing, dev-code-reviewer, dev-scaffolding, dev-security, dev-debugging, dev-pabcd
云 / 基础设施cloudflare, agents-sdk, durable-objects, sandbox-sdk, workers-best-practices, wrangler
浏览器browser, web-ai, vision-click, desktop-control
文档pdf, pdf-vision, pptx, xlsx, docx, hwp
通讯telegram-send, notion, github, x-post
系统memory, init, review, security-review, verify, simplify, code-review

CLI 命令

# List all skills
jaw skill list

# Install a skill
jaw skill install cloudflare

# Remove a skill
jaw skill remove cloudflare

# Get skill info
jaw skill info dev-frontend

# Reset skills to defaults
jaw skill reset

斜杠命令

命令说明
/skill list显示活跃技能和参考技能的数量
/skill reset软重置技能为默认值

SKILL.md 格式

技能文件是一个遵循特定结构的 Markdown 文档:

# Skill Name

Brief description of what this skill provides.

## When to Use

Trigger conditions for when the agent should activate this skill.

## Rules

1. Specific rules the agent must follow.
2. Another rule.

## Examples

```bash
# Example command or code
```

自定义技能创作

你可以通过在 ~/.cli-jaw/skills/ 中添加目录来创建自定义技能:

mkdir -p ~/.cli-jaw/skills/my-custom-skill
cat > ~/.cli-jaw/skills/my-custom-skill/SKILL.md << 'EOF'
# My Custom Skill

Custom domain knowledge for my specific workflow.

## Rules

1. Always prefer TypeScript over JavaScript.
2. Use pnpm instead of npm.
EOF

该技能将在下一次智能体运行时自动加载到系统提示词中。

提示词注入

技能通过 src/prompt/builder.ts 中的 getSystemPrompt() 注入到系统提示词中。渲染逻辑如下:

员工技能

员工提示词(getEmployeePromptV2())会自动包含角色特定和阶段特定的技能。例如,"Frontend" 员工会获得 dev-frontend,在 Check 阶段,员工会获得 dev-testing