Anthropic 在 2025 年 10 月正式发布了 Claude Skills / Agent Skills 机制这是该概念首次以产品级形态出现并在随后2025 年 12 月进一步被推广为开放标准。Agent Skill 是一个“能力包”Capability Package本质上是一个文件夹里面包含SKILL.md告诉 Agent 何时使用这个技能、做什么可选脚本如 Python/JS 等可执行代码可选资源模板、参考文档等它的作用是让 AI Agent 在需要时自动加载技能让 Agent 学会稳定执行某类任务如 PDF 处理、做 PPT、调用 API…把能力从 prompt 中抽离出来变成可共享、可复用、可版本化的“工程制品”一句话总结Agent Skill 给 AI Agent 的“可安装技能包”能让它像软件一样获得新能力。这篇文章的目的只有一个真正理解Skill为以后快速上手构建一个 Skill做准备。— 1 SKILL.md 的构成— SKILL.md 是 Skill 中唯一必需的文件 每个 Skill 需要一个 SKILL.md 文件以 — 标记之间的 YAML 元数据开头必须包含 name 和 description后跟 Markdown 指令。 注意SKILL.md 是 Skill 中唯一必需的文件--- name: api-doc-generator description: Generate comprehensive API documentation from code. Use when creating API docs, documenting endpoints, or generating OpenAPI specs. --- # API Documentation Generator When generating API documentation: 1. Identify all API endpoints and routes 2. Document request/response formats 3. Include authentication requirements 4. Add example requests and responses 5. Generate OpenAPI/Swagger specification if needed简单的 Skill 只需要一个SKILL.md但复杂的任务可以包含脚本和参考资料。标准目录结构{skill-name}/ ├── SKILL.md # Required: main file ├── REFERENCE.md # Optional: reference ├── EXAMPLES.md # Optional: documentation examples ├── scripts/ # Optional: helper scripts │ └── helper.py └── templates/ # Optional: template files └── template.txt在SKILL.md 中引用辅助文件实现渐进式披露For better usage,see [REFERENCE.md]. For examples, see [EXAMPLES.md]. Run the helper script: python scripts/helper.py input.txtplaintext — 1 Skill 示例 — Skill 从简单到复杂 接下来用一个简单和复杂的Skill 示例对Skill做一个更加 清晰的讲解和梳理 示例 1单文件简单 Skill分析日志文件并诊断问题。 目录结构仅skill.md code-snippet__js --- name: log-analyzer description: Analyze log files to identify errors, patterns, and performance issues. Use when debugging logs, investigating errors, or monitoring application behavior. --- # Log Analyzer ## Instructions 1. Read the log file to understand its format 2. Identify and categorize issues: - Error patterns and stack traces - Warning messages - Performance bottlenecks - Unusual patterns or anomalies 3. Provide summary with: - Issue severity and frequency - Root cause analysis - Recommended solutions ## Analysis tips - Focus on recent critical errors first - Look for recurring patterns - Check timestamp correlations across entries plaintext plaintext 示例 2多文件 Skill 数据库迁移与版本管理工具目录结构 ### code-snippet__js database-migrator/ ├── SKILL.md ├── MIGRATION_GUIDE.md ├── ROLLBACK.md └── scripts/ ├── generate_migration.py ├── validate_schema.py └── backup_db.sh plaintext skill.md code-snippet__js --- name: database-migrator description: Generate and manage database migrations, schema changes, and data transformations. Use when creating migrations, modifying database schema, or managing database versions. Requires sqlalchemy and alembic packages. --- # Database Migrator ## Quick start Generate a new migration: bash python scripts/generate_migration.py --name add_user_table For detailed migration patterns, see [MIGRATION_GUIDE.md](MIGRATION_GUIDE.md). For rollback strategies, see [ROLLBACK.md](ROLLBACK.md). ## Workflow 1. **Analyze changes**: Compare current schema with desired state 2. **Generate migration**: Create migration file with up/down operations 3. **Validate**: Run python scripts/validate_schema.py to check syntax 4. **Backup**: Execute scripts/backup_db.sh before applying 5. **Apply**: Run migration in staging environment first 6. **Verify**: Check data integrity after migration ## Requirements Install required packages: bash pip install sqlalchemy alembic psycopg2-binarySafety checksAlways backup before migrationsTest rollback proceduresValidate data integrity after changesUse transactions for atomic operations针对这个案例我们会加入一些解释说明database-migrator 可以被视为是一个非常典型的生产级 Skill 范本。它展示了如何将一个复杂的运维任务数据库迁移拆解为 AI 可理解、可执行的结构化指令。我们可以从以下四个维度来拆解这个 Skill 的设计精妙之处作为案例分析语义锚点精准的元数据Metadata在 YAML 区块中description 扮演了“导航员”的角色。动作词驱动使用了 Generate、manage、modifying 等动词精准匹配用户的意图。上下文补全明确提到了 sqlalchemy 和 alembic。这不仅是信息更是给 AI 的提示——如果当前项目中没有这些库AI 会主动提醒你安装或者切换到对应的逻辑。渐进式披露主从文件结构注意到 MIGRATION_GUIDE.md 和 ROLLBACK.md 了吗这是高级 Skill 设计的核心技巧不要把所有东西都塞进一个文件。主文件SKILL.md负责定义流程Workflow。从文件负责存储长篇累牍的参考资料这种设计避免了 AI 在单次对话中因上下文过长而导致指令漂移Instruction Drift只有在需要时才引导 AI 去阅读细节。SOP 化闭环的工作流WorkflowSkill 的核心价值在于标准化。这里的 Workflow 是一个严格的 6 步 SOP分析Analyze → 生成Generate → 验证Validate → 备份Backup → 应用Apply → 验证Verify这种线性递进的设计能显著降低 AI 产生“幻觉”的概率。它强制 AI 在执行前先验证在应用前先备份将人类的高级工程经验固化成了 AI 的行为准则。自动化集成脚本与指令的结合这个 Skill 不只是文本它还关联了 scripts/ 目录下的 Python 和 Shell 脚本。它让 AI 知道它不仅仅能说话它还有“工具包”。通过这种方式Skill 将 LLM 的推理能力 与 传统程序的确定性 相结合。AI 负责决定什么时候迁移脚本负责如何执行操作。总结一个优秀的 Skill 应该像一份资深工程师给新员工写的技术手册告诉他的手册关于的是哪方面技能也就是目标是什么Metadata第一步该做什么Quick Start标准流程是什么Workflow以及绝对不能踩的红线在哪里Safety Checks)。学AI大模型的正确顺序千万不要搞错了2026年AI风口已来各行各业的AI渗透肉眼可见超多公司要么转型做AI相关产品要么高薪挖AI技术人才机遇直接摆在眼前有往AI方向发展或者本身有后端编程基础的朋友直接冲AI大模型应用开发转岗超合适就算暂时不打算转岗了解大模型、RAG、Prompt、Agent这些热门概念能上手做简单项目也绝对是求职加分王给大家整理了超全最新的AI大模型应用开发学习清单和资料手把手帮你快速入门学习路线:✅大模型基础认知—大模型核心原理、发展历程、主流模型GPT、文心一言等特点解析✅核心技术模块—RAG检索增强生成、Prompt工程实战、Agent智能体开发逻辑✅开发基础能力—Python进阶、API接口调用、大模型开发框架LangChain等实操✅应用场景开发—智能问答系统、企业知识库、AIGC内容生成工具、行业定制化大模型应用✅项目落地流程—需求拆解、技术选型、模型调优、测试上线、运维迭代✅面试求职冲刺—岗位JD解析、简历AI项目包装、高频面试题汇总、模拟面经以上6大模块看似清晰好上手实则每个部分都有扎实的核心内容需要吃透我把大模型的学习全流程已经整理好了抓住AI时代风口轻松解锁职业新可能希望大家都能把握机遇实现薪资/职业跃迁这份完整版的大模型 AI 学习资料已经上传CSDN朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费】