Kvmzen 博客
← 返回技术实践

2026最新 Claude Code Skills 模板大全(100+ 免费示例)

AIDevelopment ·约 30 分钟阅读

2026最新 Claude Code Skills 模板大全(100+ 免费示例)- Kvmzen

2026 年,AI 编程助手已经从「聊天补全」进化到「可编排的 Agent 工作流」。Claude Code Skills(Anthropic 终端 Agent)与 Cursor Agent Skills(IDE 内置 Agent)共享同一套 SKILL.md 规范——用 Markdown 文件教会 AI「在特定场景下该怎么做」。

如果你还在每次对话里重复粘贴「请按我们团队的 PR 审查标准检查代码」,是时候把这段话写进 Skill,一劳永逸了。本文提供 120+ 即用 Skill 名称与触发场景,外加 8 套可复制模板,覆盖从代码审查到 DevOps 的完整开发链路。

120+
分类整理的 Skill 示例
8 套
可复制 SKILL.md 骨架
12 类
代码审查 · 测试 · DevOps · 安全…

Skills 是什么?和 Rules / MCP 怎么分工?

机制 存放位置 触发方式 适合场景
Rules .cursor/rules/ 或项目根 AGENTS.md 始终在上下文中 编码风格、命名规范、禁止事项
Skills ~/.cursor/skills/.cursor/skills/ Agent 按 description 语义匹配后加载 多步骤工作流、领域专业知识
MCP 外部服务连接 Agent 调用工具 API 数据库查询、浏览器、CI 系统

一句话总结:Rules 定底线,Skills 教方法,MCP 接工具。

Claude Code 的 Skills 目录通常为 ~/.claude/skills/(个人)或项目内 .claude/skills/;Cursor 对应 ~/.cursor/skills/.cursor/skills/。两边格式互通,本文模板均可直接复用。

2026 年重要变化
Cursor 在 2026 年初将 Agent Skills 从实验功能升级为正式能力,支持项目级与个人级 Skills 并存;Claude Code 同步采纳相同的 YAML frontmatter 规范。两套工具现在可以共享同一套 Skill 仓库。

SKILL.md 标准结构

每个 Skill 是一个目录,核心文件为 SKILL.md

my-skill/
├── SKILL.md          # 必需:主指令 + YAML frontmatter
├── reference.md      # 可选:详细参考文档
├── examples.md       # 可选:输入输出示例
└── scripts/          # 可选:可执行脚本
    └── validate.sh

最小可用模板

---
name: my-skill-name
description: 用第三人称写清楚「做什么」和「何时触发」。包含关键词以便 Agent 发现。
---

# My Skill Name

## 步骤
1. 第一步具体操作
2. 第二步具体操作

## 输出格式
描述期望的输出结构。

frontmatter 必填字段

字段 要求 说明
name ≤64 字符,小写字母/数字/连字符 唯一标识符
description ≤1024 字符,第三人称 Agent 靠它决定是否加载此 Skill

写作原则(2026 最佳实践)

  1. 简洁优先:Agent 已经很聪明,只写它不知道的信息
  2. description 是关键:写清 WHAT + WHEN,包含触发关键词
  3. 主文件 ≤500 行:详细内容拆到 reference.md
  4. 可执行步骤:用编号列表,不用模糊描述
  5. 禁止创建在 ~/.cursor/skills-cursor/:该目录为 Cursor 内置 Skill 保留

120+ Skill 示例速查表

以下按 12 个分类列出 120 个即用 Skill 名称、触发场景与建议 description 关键词。复制名称创建目录即可开始定制。

1. 代码审查与质量(10)

#Skill 名称触发场景description 关键词
1code-reviewPR / diff 审查pull request, code review, diff
2security-review安全漏洞扫描security, vulnerability, OWASP
3performance-review性能热点分析performance, bottleneck, profiling
4refactor-suggest重构建议refactor, clean code, smell
5api-design-reviewAPI 设计评审REST, API design, endpoint
6typescript-strictTS 类型安全审查TypeScript, type safety, strict
7react-patternsReact 组件审查React, hooks, component
8go-idiomsGo 惯用法检查Go, idioms, error handling
9python-pep8Python 风格审查Python, PEP8, lint
10accessibility-audita11y 无障碍审查accessibility, WCAG, a11y

2. Git 与版本控制(10)

#Skill 名称触发场景description 关键词
11commit-message生成规范 commitcommit message, conventional commits
12changelog-writer写 CHANGELOGchangelog, release notes
13branch-naming分支命名建议branch, git flow
14merge-conflict解决合并冲突merge conflict, rebase
15git-blame-analysis追溯代码变更原因git blame, history
16pr-description写 PR 描述pull request description
17squash-commits整理提交历史squash, interactive rebase
18git-hooks-setup配置 pre-commitgit hooks, pre-commit, husky
19monorepo-workflowMonorepo 分支策略monorepo, turborepo, nx
20release-tagging语义化版本打 tagsemver, release, tagging

3. 测试(10)

#Skill 名称触发场景description 关键词
21unit-test-writer生成单元测试unit test, jest, pytest
22integration-test集成测试骨架integration test, e2e setup
23test-coverage覆盖率分析与补全coverage, untested paths
24mock-factory生成 mock 数据mock, fixture, factory
25snapshot-test快照测试维护snapshot, visual regression
26playwright-e2ePlaywright E2E 脚本Playwright, browser test
27api-contract-testAPI 契约测试contract test, OpenAPI
28load-test-k6k6 压测脚本load test, k6, performance
29mutation-test变异测试分析mutation testing, stryker
30test-flaky-debug排查不稳定测试flaky test, intermittent failure

4. DevOps 与 CI/CD(10)

#Skill 名称触发场景description 关键词
31dockerfile-optimize优化 DockerfileDockerfile, multi-stage, image size
32github-actions写 GitHub Actions workflowGitHub Actions, CI pipeline
33gitlab-ciGitLab CI 配置GitLab CI, .gitlab-ci.yml
34kubernetes-manifestK8s YAML 生成Kubernetes, deployment, helm
35terraform-moduleTerraform 模块编写Terraform, IaC, HCL
36ansible-playbookAnsible playbookAnsible, provisioning
37nginx-configNginx 反向代理配置nginx, reverse proxy, SSL
38monitoring-setupPrometheus/Grafana 配置monitoring, Prometheus, alerting
39log-analysis日志模式分析logs, ELK, structured logging
40rollback-runbook回滚操作手册rollback, incident, runbook

5. 安全(10)

#Skill 名称触发场景description 关键词
41owasp-top10OWASP Top 10 检查OWASP, injection, XSS
42secrets-scan密钥泄露扫描secrets, API key, credential
43dependency-audit依赖漏洞审计npm audit, CVE, Snyk
44auth-review认证授权审查OAuth, JWT, RBAC
45sql-injectionSQL 注入检测SQL injection, parameterized query
46cors-csp-configCORS/CSP 头配置CORS, CSP, security headers
47pen-test-report渗透测试报告模板penetration test, finding
48gdpr-complianceGDPR 合规检查GDPR, privacy, PII
49ssl-tls-configTLS 配置审查TLS, certificate, HTTPS
50sbom-generator软件物料清单SBOM, supply chain

6. 文档与技术写作(10)

#Skill 名称触发场景description 关键词
51readme-writer生成 READMEREADME, project documentation
52api-docs-openapiOpenAPI 文档生成OpenAPI, Swagger, API docs
53adr-writer架构决策记录ADR, architecture decision
54inline-comments补充代码注释code comments, docstring
55migration-guide版本迁移指南migration, upgrade guide
56onboarding-doc新人 onboarding 文档onboarding, getting started
57runbook-writer运维手册编写runbook, SOP, operations
58tech-blog-post技术博客撰写blog post, technical writing
59mermaid-diagram架构图 Mermaid 生成Mermaid, diagram, flowchart
60javadoc-jsdocAPI 注释生成JSDoc, JavaDoc, Sphinx

7. 数据库(10)

#Skill 名称触发场景description 关键词
61sql-optimizeSQL 查询优化SQL, query plan, index
62migration-sql数据库迁移脚本migration, ALTER TABLE, Flyway
63schema-design表结构设计schema, normalization, ER diagram
64postgres-tuningPostgreSQL 调优PostgreSQL, vacuum, EXPLAIN
65redis-patternsRedis 使用模式Redis, cache, pub/sub
66mongodb-schemaMongoDB 文档设计MongoDB, document model
67prisma-schemaPrisma schema 编写Prisma, ORM, schema.prisma
68data-seed种子数据生成seed data, fixture, faker
69backup-restore备份恢复脚本backup, restore, pg_dump
70etl-pipelineETL 管道设计ETL, data pipeline, dbt

8. 前端开发(10)

#Skill 名称触发场景description 关键词
71react-componentReact 组件脚手架React component, JSX
72vue-composableVue Composable 编写Vue 3, composable, Pinia
73tailwind-stylingTailwind CSS 样式Tailwind, utility CSS
74css-responsive响应式布局responsive, mobile-first, media query
75state-management状态管理方案选型Redux, Zustand, state
76nextjs-app-routerNext.js App RouterNext.js, RSC, app router
77i18n-setup国际化配置i18n, localization, react-intl
78storybook-storyStorybook 故事编写Storybook, component story
79bundle-optimize打包体积优化bundle size, tree shaking, code split
80form-validation表单校验逻辑form, validation, zod, yup

9. 后端与 API(10)

#Skill 名称触发场景description 关键词
81rest-api-designRESTful API 设计REST, endpoint, HTTP methods
82graphql-schemaGraphQL schema 定义GraphQL, resolver, schema
83grpc-protobufgRPC / ProtobufgRPC, protobuf, service definition
84express-middlewareExpress 中间件Express, middleware, Node.js
85fastapi-endpointFastAPI 路由FastAPI, Python, Pydantic
86error-handling统一错误处理error handling, exception, status code
87rate-limiting限流策略实现rate limit, throttle, token bucket
88webhook-handlerWebhook 接收处理webhook, event, signature verify
89background-job后台任务队列queue, Celery, BullMQ, Sidekiq
90microservice-split微服务拆分建议microservice, bounded context, DDD

10. AI / LLM 集成(10)

#Skill 名称触发场景description 关键词
91prompt-engineeringPrompt 优化prompt, LLM, few-shot
92rag-pipelineRAG 管道搭建RAG, embedding, vector store
93agent-orchestration多 Agent 编排agent, orchestration, tool use
94mcp-serverMCP Server 开发MCP, model context protocol
95llm-evalLLM 输出评估evaluation, benchmark, LLM judge
96token-optimizeToken 用量优化token, context window, cost
97fine-tune-guide微调流程指导fine-tune, LoRA, training data
98embedding-search语义搜索实现embedding, semantic search, FAISS
99guardrailsAI 输出护栏guardrails, content filter, safety
100function-callingFunction Calling 实现function calling, tool use, OpenAI

11. 移动与跨平台(10)

#Skill 名称触发场景description 关键词
101swiftui-viewSwiftUI 视图编写SwiftUI, iOS, view
102kotlin-composeJetpack Compose UICompose, Android, Kotlin
103react-native-screenRN 页面开发React Native, mobile screen
104flutter-widgetFlutter WidgetFlutter, Dart, widget
105app-store-submitApp Store 提交流程App Store, TestFlight, submission
106push-notification推送通知集成push notification, APNs, FCM
107deep-linkingDeep Link 配置deep link, universal link
108offline-first离线优先架构offline, sync, local storage
109app-perf-profile移动端性能分析Instruments, Android Profiler
110ci-mobile-build移动端 CI 构建Fastlane, Xcode Cloud, mobile CI

12. 项目管理与协作(10)

#Skill 名称触发场景description 关键词
111sprint-planningSprint 计划辅助sprint, planning, estimation
112ticket-breakdown需求拆分为 ticketticket, user story, breakdown
113retro-facilitator回顾会议引导retrospective, retro, team
114incident-postmortem事故复盘报告postmortem, incident, RCA
115tech-debt-audit技术债盘点tech debt, prioritization
116rfc-reviewRFC 设计评审RFC, design proposal, review
117estimation-poker故事点估算estimation, story points, planning poker
118standup-summary站会摘要生成standup, daily sync, summary
119okr-alignmentOKR 对齐检查OKR, goal alignment
120handoff-checklist项目交接清单handoff, knowledge transfer

8 套可复制 SKILL.md 模板

以下模板可直接复制到 .cursor/skills/<name>/SKILL.md~/.claude/skills/<name>/SKILL.md,按需修改。

模板 1:代码审查

---
name: code-review
description: Review code changes for quality, security, and best practices. Use when reviewing pull requests, diffs, or when the user asks for a code review.
---

# Code Review

## Checklist
1. Read the full diff before commenting
2. Check for security issues (injection, XSS, secrets)
3. Verify error handling on all external calls
4. Confirm tests cover new logic
5. Flag breaking API changes

## Output Format
- **Critical**: must fix before merge
- **Suggestion**: optional improvement
- **Praise**: well-done patterns worth keeping

模板 2:Commit Message

---
name: commit-message
description: Generate descriptive commit messages following Conventional Commits. Use when the user asks to write commit messages or review staged changes.
---

# Commit Message Generator

## Format
`<type>(<scope>): <subject>`

Types: feat, fix, docs, style, refactor, test, chore

## Rules
- Subject ≤ 72 characters, imperative mood
- Body explains WHY, not WHAT
- Reference issue numbers when applicable

模板 3:单元测试

---
name: unit-test-writer
description: Write unit tests for given code using the project's existing test framework. Use when the user asks to add tests, improve coverage, or test a function.
---

# Unit Test Writer

## Steps
1. Identify the project's test framework (Jest, pytest, Go test, etc.)
2. Read existing test files for patterns and conventions
3. Cover: happy path, edge cases, error paths
4. Use descriptive test names: `should_<expected>_when_<condition>`
5. Mock external dependencies, not the unit under test

模板 4:Dockerfile 优化

---
name: dockerfile-optimize
description: Optimize Dockerfiles for smaller image size, faster builds, and security. Use when working with Docker, containerization, or image optimization.
---

# Dockerfile Optimizer

## Checklist
- Use multi-stage builds
- Pin base image versions (no `latest`)
- Run as non-root user
- Combine RUN layers, clean package caches
- Use .dockerignore
- Scan for known CVEs in base image

模板 5:安全审查

---
name: security-review
description: Review code for security vulnerabilities following OWASP guidelines. Use when the user asks for security review, vulnerability scan, or before deploying to production.
---

# Security Review

## OWASP Top 10 Check
1. Injection (SQL, command, LDAP)
2. Broken authentication
3. Sensitive data exposure
4. XXE / deserialization
5. Broken access control
6. Security misconfiguration
7. XSS
8. Insecure deserialization
9. Known vulnerable components
10. Insufficient logging

## Output
Severity: Critical / High / Medium / Low / Info
Include: location, impact, remediation

模板 6:API 文档

---
name: api-docs-openapi
description: Generate or update OpenAPI/Swagger documentation from code. Use when documenting REST APIs, generating API specs, or working with OpenAPI files.
---

# API Documentation

## Steps
1. Scan route handlers for endpoints, methods, params
2. Generate OpenAPI 3.1 YAML with request/response schemas
3. Add examples for each endpoint
4. Document error responses (4xx, 5xx)
5. Include authentication requirements

模板 7:数据库迁移

---
name: migration-sql
description: Write database migration scripts with rollback support. Use when altering database schema, adding tables, or writing Flyway/Liquibase migrations.
---

# Database Migration

## Rules
- Every UP migration must have a DOWN (rollback)
- Never drop columns in production without deprecation period
- Add indexes CONCURRENTLY on PostgreSQL
- Test migration on a copy of production data
- Name: `V{version}__{description}.sql`

模板 8:MCP Server 开发

---
name: mcp-server
description: Build MCP (Model Context Protocol) servers for tool integration. Use when creating MCP servers, connecting external tools to AI agents, or working with the MCP SDK.
---

# MCP Server Builder

## Structure
- Define tools with JSON Schema input/output
- Implement handlers with proper error responses
- Add authentication if connecting to external APIs
- Test with `npx @modelcontextprotocol/inspector`
- Document each tool's purpose and parameters

安装与使用

Cursor

  1. 创建目录:.cursor/skills/my-skill/SKILL.md(项目级)或 ~/.cursor/skills/my-skill/SKILL.md(个人级)
  2. 在 Agent 对话中提及相关场景,Agent 会自动匹配 description 加载 Skill
  3. 也可显式调用:/my-skill-name 或在提示词中 @my-skill

Claude Code

  1. 创建目录:~/.claude/skills/my-skill/SKILL.md
  2. 启动 Claude Code 后,在终端对话中描述任务,Agent 自动匹配
  3. 项目级 Skill 放在 .claude/skills/ 并提交到 Git

团队共享最佳实践

  • .cursor/skills/ 纳入版本控制,全团队共享
  • README.md 中列出可用 Skills 及触发方式
  • 每个 Skill 附带 examples.md 展示期望输入输出
  • 定期审查 description 是否覆盖新成员的常用表述
进阶技巧
把多个相关 Skill 组合使用:先用 security-review 扫描,再用 unit-test-writer 补测试,最后用 commit-message 生成提交。Skills 链式调用是 2026 年重度 Agent 工作流的核心模式。

开发环境的底座同样重要

Skills 再强大,也需要在合适的硬件和操作系统上运行。iOS 开发相关的 Skills(如 swiftui-viewapp-store-submit)必须在 macOS + Xcode 环境下才能发挥价值;大型 monorepo 的 code-review Skill 也需要足够的内存和磁盘 I/O。

如果你需要在云端获得完整的 macOS 开发环境来配合 Claude Code 或 Cursor Agent,Kvmzen Mac 云租用 提供独享 Mac mini M4,按月计费,与本文所有 Skills 模板无缝配合。

延伸阅读

常见问题

Claude Code Skills 和 Cursor Rules 有什么区别?

Rules 是持久化的项目级约束(编码风格、命名规范),始终在上下文中生效;Skills 是按场景动态加载的专业工作流指令,只在相关任务时被 Agent 调用。两者互补:Rules 定底线,Skills 教方法。

Skills 应该放在个人目录还是项目目录?

个人 Skills(~/.cursor/skills/ 或 Claude Code 用户目录)适合跨项目通用能力,如 commit message 生成、PR 审查;项目 Skills(.cursor/skills/)适合团队共享的领域知识,如内部 API 规范、部署流程。团队项目优先放项目目录并纳入版本控制。

一个 SKILL.md 写多长合适?

主文件建议控制在 500 行以内。核心指令放 SKILL.md,详细参考文档拆到 reference.md 或 examples.md。Agent 的上下文窗口是共享资源,冗长的 Skill 会挤占对话空间,降低响应质量。

限时特惠

不只是一台 Mac,是你在云端的开发基地

独享算力 · 全球节点 · 按月订阅 · 无需购置硬件

返回首页
限时优惠 点击查看套餐