快乐可以表演 孤独却无法伪装
“代码不会骗人,但你的 LLM 可能会编个故事——除非你给它一本《技能手册》。”
——某位深夜调试成功的 Go 工程师
🌪️ 世界变化太快,IDE 也要练“内功”
还记得几年前,我们还在手动补全括号、用 console.log 当调试器,而现在——
👉 你的编辑器不仅能写代码,还能 帮你写周报、画架构图、甚至劝你少喝咖啡 。
欢迎来到 Agentic 编程时代 ,一个连 git commit 都要先问 Copilot “这 message 够不够文艺”的新纪元。
而今天,我们要聊的主角,正是这个新世界的“武功秘籍”
📜 Agent Skills :不是魔法,是标准化的“说明书”
它是什么?
🧠 Skills = 一套结构化知识包
包含:
SKILL.md(技能说明书)
脚本、示例、测试用例、运维手册……
甚至可能是你上次加班时口述的“应急锦囊.zip”
最初由 Anthropic 提出(Claude 的老家),如今它已开源 ——就像当年 JSON 干掉了 XML,Agent Skills 正在试图终结“LLM 自由发挥式瞎编”时代 。
🍵 类比一下:
没有 Skill 的 Agent = 一个喝了 5 杯美式、刚被产品经理夸了的实习生
有 Skill 的 Agent = 同一个实习生 + 一本《公司编码规范 v3.7 + 事故复盘记录 2025》
🛠️ 实战:在 VS Code 里,给 Copilot “装个技能包”
🧪 环境准备: VS Code Insiders (不是“内部人士”,是“尝鲜人士”)
Step 1️⃣:下载 VS Code Insiders
👉 https://code.visualstudio.com/insiders
安装后打开,界面和普通 VS Code 几乎一样
Step 2️⃣:打开“技能开关”
- 点击左下角 ⚙️ Settings 齿轮
- 搜索
Agent Skills - ✅ 勾选 Use Agent Skills
🤓 此刻,Copilot 的脑内弹幕已从:
“用户好像想查日志……要不我编个 kubectl 命令?”
→ 升级为:
“检测到 .github/skills/istio-observability——加载技能「Istio 瞪眼术 v1.0」!”
🧪 实战:手搓一个「Istio 观测力」技能
💡 技能存放路径有两个主流选择:
.claude/skills/→ Anthropic 遗产区(还能用,但略显怀旧)
.github/skills/→ ✅ 推荐!开源技能的标准栖息地
📂 创建技能骨架
1mkdir-p .github/skills/istio-observability
2touch .github/skills/istio-observability/SKILL.md
🧠 召唤 Copilot,注入灵魂
在 VS Code 里唤出 Copilot Chat,输入:
📝
Create me a SKILL.md (put the skill into the SKILL.md file that already exists) for an Istio Observability Helper/Skill
片刻后——叮!你的 SKILL.md 已从“空文件”进化为:
1# Istio Observability Helper
2
3## Purpose
4Help engineers quickly diagnose traffic issues, latency spikes, and circuit breaker trips in Istio service mesh.
5
6## Capabilities
7- Fetch active virtual services & gateways
8- Extract Prometheus queries for:
9- Request volume (`istio\_requests\_total`)
10- P99 latency (`istio\_request\_duration\_milliseconds\_bucket`)
11- Error rate (`istio\_requests\_total{response\_code=~"5.."}`)
12- Generate Kiali dashboard links
13- Suggest envoy filter tweaks for outlier detection
🧙♂️ 看, 知识开始结构化,幻觉开始退散 。
🚀 进阶:让技能“有血有肉”
再丢一句 prompt 给 Copilot:
1Create me three things:
2- A One-page incident runbook based on the skill
3- A script file that has all of the Prometheus queries that would be needed for this skill
4- an `examples` directory that has examples for this skill
几分钟后,你的技能包膨胀为:
.github/skills/istio-observability/
├── SKILL.md # 📘 技能说明书
├── runbook.md # 🆘 “服务挂了?先别 panic!”
├── queries.sh # 📊 Prometheus 查询全家桶
└── examples/
├── slow-service.yaml # 🐢 示例:如何定位一个“优雅地卡住”的服务
└── 5xx-spike.md # 💥 示例:5xx 暴增时的 5 分钟自救指南
🌿 此刻,你的 Agent 不再是“知道很多但总差一口气”的学霸,
而是 带工具箱上岗的 SRE 老兵 。
🌌 一点哲思:我们是在“教 AI”,还是在“整理自己”?
写 Skill 的过程,本质上是一场知识反刍 :
- 你把零散的经验,变成可执行的步骤
- 你把口头禅“我记得上次是改了 envoy filter……”,变成
examples/5xx-spike.md - 你把“玄学调参”,沉淀为
queries.sh里的一行精准 PromQL
🔮 未来最贵的工程师,也许不是写最多代码的人,
而是能把“怎么做”写成“让 AI 也能做”的人。
✅ 小结:三步开启你的“技能化编程”之旅
|
步骤
|
动作
|
哲学意义
|
| --- | --- | --- |
|
1️⃣
|
装 VS Code Insiders + 启用 Agent Skills
| 承认世界在变 |
|
2️⃣
|
创建
.github/skills/
SKILL.md
| 给混沌赋予结构 |
|
3️⃣
|
用 Copilot 填充 runbook、脚本、示例
| 把经验封装成可传承的资产 |
