微信扫码
添加专属顾问
我要投稿
用Skill让AI从"通才"变"专家",Qoder CLI实战指南教你如何打造专属AI工作流。核心内容: 1. Skill的定义与核心价值:将重复性任务转化为可复用的专家知识包 2. 一个完整Skill的构成要素:从元数据到执行规则的详细拆解 3. Prompt与Skill的本质区别:从"做什么"到"如何做"的范式升级
但是对于一些重复性、特定领域的任务,我们每次执行任务时都需要对AI进行重复的调教。
┌─────────────────────────────────────────────────────────────┐│ ││ AI 是一个"超级通才" ││ ││ 它什么都会,但什么都不精 ││ ││ 它不记得你上次是怎么要求的 ││ ││ 它不知道你们团队的规范和偏好 ││ │└─────────────────────────────────────────────────────────────┘
我们需要的是:
一种方式,让 AI 记住"怎么做某件事",下次只需说一句话,它就能按照我们定义的方式执行。
这就是 Skill。
Skill 是什么
01 官方定义
Skill = 可复用的专家知识包
它是一组打包好的指令、知识和工具,让 AI 在特定领域从"通才"变成"专家"
Skill可以教会Qoder如何以特定的SOP完成特定任务
02 让人眼前一亮的优势
03 一个 Skill 长什么样
# ~/.qoder/skills/api-mocker/SKILL.md---name: api-mockerdescription: |根据 API 定义生成 Mock 测试数据。当用户说"生成mock数据"、"造测试数据"时使用。---# API Mock 数据生成器## 规则1. 分析用户提供的接口定义2. 根据字段名推断数据语义(name→姓名,email→邮箱)3. 生成 5 条真实感数据## 字段映射- name/姓名 → 中文姓名(王晓明、刘思远)- email → user_xxx@example.com- phone → 138-XXXX-XXXX- avatar → https://api.dicebear.com/7.x/avataaars/svg?seed=随机## 输出JSON 数组,用代码块包裹
就这么简单:一个目录 + 一个 SKILL.md 文件。
04 Prompt vs. Skills
“Skill不就是一个保存Prompt的地方吗?”
没错,但是并没有体现Skill厉害之处。
Prompt告诉AI来做什么,而Skills则告诉AI如何判断以及整个流程如何进行。
Skills让我们能把自己的判断逻辑、处理流程写成一个Qoder可以反复执行的模块。
05 Skill 的三层结构
┌─────────────────────────────────────────────────────────────┐│ Layer 1: 元数据│ ├── name: skill 的名字 ││ └── description: 什么时候该用这个 skill(触发条件) │├─────────────────────────────────────────────────────────────┤│ Layer 2: 核心指令(触发时才加载) ││ └── SKILL.md 正文:具体怎么做 │├─────────────────────────────────────────────────────────────┤│ Layer 3: 附加资源(按需加载) ││ ├── scripts/ → 可执行脚本(Python/Bash) ││ ├── references/ → 参考文档(API 文档、规范说明) ││ └── assets/ → 资源文件(模板、图片) │└─────────────────────────────────────────────────────────────┘
为什么要分层?
AI 的上下文窗口是有限的"公共资源"
如果所有 Skill 的内容都一直在上下文里,会浪费大量 Token
分层设计:只有 name 和 description 始终存在,正文和资源按需加载
这就是渐进式加载(Progressive Disclosure)设计。
怎么使用 Skill
01 Skill 的存储位置
全局 Skill(所有项目可用)~/.qoder/skills/├── pdf-processing/│ └── SKILL.md├── code-reviewer/│ └── SKILL.md└── ...项目 Skill(仅当前项目可用)your-project/└── .qoder/└── skills/└── project-specific-skill/└── SKILL.md
02 查看已安装的 Skill
在 Qoder CLI 中输入:
/skills你会看到类似这样的界面:
> /skills------------------------------------------------------------------------------------------------------------Skill Commands: [User] ProjectSkill list:→ code-reviewer : [user] 审查代码并提供改进建议。当需要代码审查、查找潜...- pdf-processing : [user] -Extract text, fill forms, merge PDFs. Use when working with PDF files,...Press Enter to select · Esc to exit · Tab to cycle tabs · ↑↓ to navigate
三个级别:
User:存储在 ~/.qoder/skills/ ,所有项目可用
Project:存储在 项目/.qoder/skills/ ,仅当前项目可用
03 使用 Skill 的两种方式
方式一:自动触发
你只需正常描述你的需求,AI 会根据 Skill 的 description 自动判断是否使用,例如,pdf-processing技能。
帮我查看这个xxx.pdf的内容这就是为什么 description 很重要 —— 它是 AI 判断"何时使用这个 Skill"的依据。
方式二:手动调用
如果你想强制使用某个 Skill,可以用命令:
/pdf-processing或者在对话中明确指定:
使用 pdf-processing skill 帮我查看这个xxx.pdf的内容Skill实战
01 微服务应用问题排查
场景
在 K8s 集群中部署了一套微服务应用,某天突然发现接口报错 500。需要快速定位是哪个服务出了问题。
传统方式:登录各个 Pod → 翻日志 → 分析调用链 → 定位问题
使用 Skill:进入 Pod → 跟 Qoder CLI 说一句"帮我排查问题" → 自动完成排查
核心思路
这个 Skill 的价值在于:把项目架构知识固化下来
服务有哪些?调用关系是什么?
出问题时该调用哪些接口验证?
日志里哪些关键字代表什么含义?
这些"确定性知识"写进 Skill,让 AI 按照 SOP 自主排查。
Skill 内容
存储到/.qoder/skills/microservice-troubleshooter/SKILL.md
---name: microservice-troubleshooterdescription: |微服务问题排查专家。自动诊断 A、B、C 三个服务组成的微服务架构中的问题,生成排查报告和修复建议。触发场景:用户请求 "排查微服务问题"、"诊断错误"、"分析日志"、"查找异常"等直接触发这个SKILL进行排查---# 微服务问题排查## 项目架构本项目由 3 个 Spring Boot 微服务组成,通过 HTTP (RestTemplate) 进行链式调用:
用户请求 → A服务(/a) → B服务(/b) → C服务(/c) → 返回结果
### 服务说明| 服务 | 端口 | 职责 | 下游依赖 ||------|-------|------|----------|| A | 20001 | 入口服务,接收用户请求 | 调用 B 服务 || B | 20002 | 中间层服务 | 调用 C 服务 || C | 20003 | 末端服务,返回最终结果 | 无 |### 注册中心说明/root/nacos/naming/目录是微服务注册中心的缓存,当前已用【直接】依赖的服务,订阅的微服务实例的地址会缓存到这个目录下,其中包含所有订阅服务的实例列表因此可以在/root/nacos/naming/目录下查找阅读依赖服务的相关信息### 调用链路
HTTP 链路: A(/a) --RestTemplate--> B(/b) --RestTemplate--> C(/c)
## 排查流程### Step 1: 在当前 Pod 测试本地接口通过 curl 调用本地接口,观察返回结果或错误信息:**A 服务接口** (在 A Pod 中执行)```bashcurl localhost:20001/a # HTTP 全链路调用 A→B→Ccurl localhost:20001/a-zone # 同城多活链路curl localhost:20001/actuator/health # 健康检查
B 服务接口(在 B Pod 中执行)
curl localhost:20002/b # 调用 C 服务curl localhost:20002/b-zone # 同城多活curl localhost:20002/actuator/health # 健康检查
C 服务接口(在 C Pod 中执行)
curl localhost:20003/c # 返回 C 服务信息 (末端,不依赖其他服务)curl localhost:20003/c-zone # 同城多活curl localhost:20003/actuator/health # 健康检查
Step 2: 查看当前服务日志中的错误
# 搜索日志中的异常信息grep -i "exception\|error\|失败" *.log | tail -50
Step 3: 分析调用链
如果看到 [A] 调用服务B失败 → 问题在 B 或 C
如果看到 [B] 调用服务C失败 → 问题在 C
如果看到 C service error → C 服务内部错误
注意
如果上述方式都无法找到具体问题,可以在A入口应用Pod中通过
curl localhost:20001/dubbo # Dubbo 全链路调用通过Dubbo全链路调用排查调用链路问题
**Skill 扩展脚本**```markdown## 优先批量检查B服务实例通过 `/b` 接口批量检测多个B服务实例的状态:```bash用法: ./check_b_instances.sh <ip1> <ip2> ....qoder/skills/microservice-troubleshooter/scripts/check_b_instances.sh 10.192.168.34 10.192.168.35# 实例IP可从 /root/nacos/naming/ 目录获取
状态说明:
[存活-正常] - 服务正常响应
[存活-有错误] - 服务存活但返回5xx错误(业务异常)
[不可达] - 服务无法连接
>存储到<project-path>/.qoder/skills/microservice-troubleshooter/scripts/check_b_instances.sh>```markdown#!/bin/bash## B服务多实例健康检查脚本# 通过 /b 接口判断服务状态# 用法: ./check_b_instances.sh <ip1> <ip2> <ip3> ...# 示例: ./check_b_instances.sh 10.192.168.34 10.192.168.35 10.192.168.36#PORT=20002TIMEOUT=3# 颜色定义RED='\033[0;31m'GREEN='\033[0;32m'YELLOW='\033[1;33m'NC='\033[0m' # No Colorif [ $# -eq 0 ]; thenecho "用法: $0 <ip1> <ip2> <ip3> ..."echo "示例: $0 10.192.168.34 10.192.168.35"exit 1fiecho "========================================"echo " B服务多实例健康检查 (/b接口)"echo "========================================"echo ""total=0alive=0dead=0has_error=0for ip in "$@"; dototal=$((total + 1))echo -n "检查 B实例 [$ip:$PORT] ... "# 通过 /b 接口检查response=$(curl -s -w "\n%{http_code}" --connect-timeout $TIMEOUT "http://$ip:$PORT/b" 2>/dev/null)curl_status=$?if [ $curl_status -ne 0 ]; then# curl失败,服务不可达echo -e "${RED}[不可达]${NC}"echo " └─ 原因: 连接超时或拒绝"dead=$((dead + 1))else# 解析响应体和状态码http_code=$(echo "$response" | tail -1)body=$(echo "$response" | sed '$d')if [ "$http_code" -ge 200 ] && [ "$http_code" -lt 300 ]; then# 2xx 正常echo -e "${GREEN}[存活-正常]${NC}"alive=$((alive + 1))elif [ "$http_code" -ge 500 ]; then# 5xx 服务存活但有错误echo -e "${YELLOW}[存活-有错误]${NC}"echo " └─ HTTP $http_code: $body"alive=$((alive + 1))has_error=$((has_error + 1))else# 其他状态码echo -e "${YELLOW}[存活-HTTP $http_code]${NC}"alive=$((alive + 1))fifiecho ""doneecho "========================================"echo " 检查结果汇总"echo "========================================"echo "总实例数: $total"echo -e "存活实例: ${GREEN}$alive${NC}"echo -e "不可达: ${RED}$dead${NC}"echo -e "业务错误: ${YELLOW}$has_error${NC}"echo ""if [ $dead -gt 0 ]; thenecho -e "${RED}警告: 存在 $dead 个不可达的实例${NC}"exit 2elif [ $has_error -gt 0 ]; thenecho -e "${YELLOW}警告: 存在 $has_error 个有业务错误的实例${NC}"exit 1elseecho -e "${GREEN}所有实例正常${NC}"exit 0fi
02 常用Skill分享
Web应用页面优化
场景
使用AI帮助生成一个SaaS的落地页面
做一个 SaaS 产品落地页,暗色科技风。需要元素丰富(导航、卡片、按钮)使用Anthropic提供的frontend-design skill来优化页面
使用frontend-design skill优化这个页面Skill 内容
存储到
---name: frontend-designdescription: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.license: Complete terms in LICENSE.txt---This skill guides creation of distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics. Implement real working code with exceptional attention to aesthetic details and creative choices.The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints.## Design ThinkingBefore coding, understand the context and commit to a BOLD aesthetic direction:- **Purpose**: What problem does this interface solve? Who uses it?- **Tone**: Pick an extreme: brutally minimal, maximalist chaos, retro-futuristic, organic/natural, luxury/refined, playful/toy-like, editorial/magazine, brutalist/raw, art deco/geometric, soft/pastel, industrial/utilitarian, etc. There are so many flavors to choose from. Use these for inspiration but design one that is true to the aesthetic direction.- **Constraints**: Technical requirements (framework, performance, accessibility).- **Differentiation**: What makes this UNFORGETTABLE? What's the one thing someone will remember?**CRITICAL**: Choose a clear conceptual direction and execute it with precision. Bold maximalism and refined minimalism both work - the key is intentionality, not intensity.Then implement working code (HTML/CSS/JS, React, Vue, etc.) that is:- Production-grade and functional- Visually striking and memorable- Cohesive with a clear aesthetic point-of-view- Meticulously refined in every detail## Frontend Aesthetics GuidelinesFocus on:- **Typography**: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics; unexpected, characterful font choices. Pair a distinctive display font with a refined body font.- **Color & Theme**: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes.- **Motion**: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions. Use scroll-triggering and hover states that surprise.- **Spatial Composition**: Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.- **Backgrounds & Visual Details**: Create atmosphere and depth rather than defaulting to solid colors. Add contextual effects and textures that match the overall aesthetic. Apply creative forms like gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, decorative borders, custom cursors, and grain overlays.NEVER use generic AI-generated aesthetics like overused font families (Inter, Roboto, Arial, system fonts), cliched color schemes (particularly purple gradients on white backgrounds), predictable layouts and component patterns, and cookie-cutter design that lacks context-specific character.Interpret creatively and make unexpected choices that feel genuinely designed for the context. No design should be the same. Vary between light and dark themes, different fonts, different aesthetics. NEVER converge on common choices (Space Grotesk, for example) across generations.**IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
用 Skill 创建 Skill
Anthropic 官方提供了一个 skill-creator Skill,用于帮助你创建新的 Skill。
01 skill-creator 的核心原则
官方 skill-creator 遵循这些原则:
简洁至上
"AI 已经很聪明,只补充它不知道的。"
每一段内容都要问:这个信息 AI 真的不知道吗?值得占用 Token 吗?
明确触发条件
description 是最重要的部分,决定了 Skill 何时被使用。
渐进式加载
Layer 1: name + description → 始终存在(~100词)Layer 2: SKILL.md 正文 → 触发时加载(<5000词)Layer 3: scripts/references/ → 按需加载(无限制)
02 skill-creator 用法演示
将skill-creator这个skill包copy到工程目录对应的skills存放目录
让AI帮我们研究、梳理下目标Skill的能力,将研究到的内容落到文档中
帮我调研和梳理一套现在通用、完整且详细的微服务问题排查流程,将这个调研内容落到markdown文件中使用skill-creator这个skill,让它根据我们刚调研到的内容生成一个Skill
skill-creator 根据调研文档帮我生成对应的微服务排查SKILLSkill 推荐
Anthropic 官方提供了多个高质量 Skill:
获取方式:https://github.com/anthropics/skills
Skills 仓库:https://github.com/anthropics/skills
社区精选 Skills:https://github.com/travisvn/awesome-claude-skills
Skill 设计最佳实践:https://www.anthropic.com/engineering/equipping-Agents-for-the-real-world-with-agent-skills
关注我,掌握Qoder最新动态
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费POC验证,效果达标后再合作。零风险落地应用大模型,已交付160+中大型企业
2026-01-29
Claude Skills 如何在 90 天内成为 AI 最重要的标准
2026-01-29
从“能用”到“会用”|如何写好一个 Skill
2026-01-29
Cursor 的 5 种指令方法比较:AGENTS.md、规则(Rules)、命令(Commands)、技能(Skills)、子代理(Subagents)
2026-01-29
我不允许谁还不清楚function call在AI-Agent领域中流砥柱的地位
2026-01-26
Agent Skills实战:27个脚本不进上下文,一句话完成RAG入库前文档扫描
2026-01-25
“Skill 不就是长一点的提示词吗?”
2026-01-24
技能杀!ClaudeCode Skills 通用agent生成接口测试用例实录
2026-01-24
告别复制粘贴:将 OpenAI Prompt 转化为 Claude Code Skills
2025-11-20
2026-01-04
2025-11-15
2026-01-13
2025-11-15
2025-12-02
2025-11-12
2025-11-15
2025-11-03
2025-11-16
2026-01-23
2026-01-19
2026-01-19
2026-01-15
2026-01-05
2025-12-30
2025-12-26
2025-12-15