跳到正文
DEV Community· Destiny Studio·· 48 分鐘前AI 評分62

如何在 Claude Code、Claude app 和 Claude API 使用 Claude 技能

How to use Claude skills in Claude Code, the Claude app and the API

AI 導讀

Claude 技能可透過 Claude Code 的本機技能資料夾、Claude app 的內置或上載技能,以及 Claude API 請求使用。指南列出 Claude Code 的技能路徑及 /skills 檢查方式,並説明 app 和 API 使用技能時需要啟用 code execution;技能未觸發時,應核對 SKILL.md 路徑、描述與 front matter。

正文

If you have read that Claude can "learn" new tasks from skills but are not sure what to actually do next, this guide is for you. It shows how to use Claude skills in the three places Claude runs: Claude Code in your terminal, the Claude app (claude.ai and desktop) and the Claude API. For each one you will see where skills live, how to switch them on and how to check that Claude is really using them.

A quick reminder of the basics: a skill is a folder with a SKILL.md file inside. The file starts with a short YAML block (a name and a description) followed by plain Markdown instructions, and the folder can also hold reference notes and scripts. If that is new to you, read What are agent skills? first, then come back.

How to use Claude skills: the short version

Where you use Claude How a skill gets there How it is triggered
Claude Code A folder in ~/.claude/skills/ or .claude/skills/, or a plugin Automatically from its description, or /skill-name
Claude app Built-in skills toggled on, or your own uploaded as a ZIP Automatically when your request matches
Claude API Anthropic's pre-built skills, or custom skills uploaded to your workspace Listed in the request alongside the code execution tool

In every case the same idea applies. Claude sees a short list of skill names and descriptions up front, and only reads the full instructions when a task matches. That is why the description matters so much: it is how Claude decides whether to use a skill at all.

Using skills in Claude Code

Claude Code is where most developers start, because a skill is just a folder on disk.

  1. Pick a location. Put the skill in ~/.claude/skills/<skill-name>/SKILL.md to use it in all your projects, or in .claude/skills/<skill-name>/SKILL.md inside a repository so everyone who clones it gets the same skill.
  2. Copy the whole folder, not just SKILL.md. Many skills reference scripts or extra files next to it.
  3. Check it loaded. Run /skills to list what Claude Code can see. Claude Code watches the skill folders for changes, so a new skill is normally picked up in the current session; if it does not appear, the docs suggest running /reload-skills.
  4. Use it. Ask for the task in plain words and Claude will load the skill if the description fits, or type /skill-name to run it directly.

Here is what a minimal project skill looks like on disk:

my-repo/
└── .claude/
    └── skills/
        └── release-notes/
            └── SKILL.md

Skills can also arrive inside plugins, which bundle several skills together. Plugin skills are namespaced, so you call them as /plugin-name:skill-name. The full step-by-step, including plugin marketplace commands and Windows paths, is in How to install a skill.

Older custom slash commands in .claude/commands/ still work. Anthropic's docs describe skills as the newer format: moving a command into its own skill folder lets you add supporting files while keeping the same /command.

Control when a skill runs

Some skills should only run when you ask, such as one that deploys or deletes things. Claude Code supports an optional front matter field, disable-model-invocation: true, that stops Claude from loading the skill on its own so it only runs when you type its name. Other optional fields, such as limiting the tools a skill may use, are listed in the official Claude Code skills reference.

Using skills in the Claude app

In the Claude app, skills run inside Claude's code execution environment, so that feature has to be on first. Following Anthropic's help article at the time of writing:

  1. Open Settings → Capabilities and turn on file creation and code execution.
  2. Open Customize → Skills to switch Anthropic's built-in skills (for example the document skills for Word, Excel, PowerPoint and PDF files) on or off.
  3. To add your own, zip the skill folder, then choose + → Create skill → Upload a skill and select the ZIP.

You don't have to call built-in skills by name. Ask for "a slide deck summarising this report" and Claude decides which skill to use. On Team and Enterprise plans, an organisation owner controls whether skills and code execution are enabled. Menus change from time to time, so if something looks different, check Using skills in Claude.

Anthropic's Claude Code docs also describe syncing: when you sign in to a recent version of Claude Code with the same account, skills you enabled in the Claude app can be loaded there too.

Try it free: pdf

Using skills through the Claude API

Developers building their own apps can use skills through the Messages API. In outline:

  • Skills on the API need the code execution tool to be enabled in the request.
  • You list the skills you want in the request's container setting, each with a type (Anthropic's pre-built ones or your own custom ones), an id and an optional version.
  • Anthropic's pre-built skills include ones for PowerPoint, Excel, Word and PDF files.
  • Custom skills are uploaded through the Skills API and belong to your API workspace, separate from anything you upload in the Claude app.

The exact request format and limits change between API versions, so build from Anthropic's skills guide for the API rather than copying an old snippet.

Getting a skill to trigger reliably

The most common complaint is "I installed a skill and Claude ignores it." Work through this list:

  • Is the file where Claude looks? The path must end in <skill-name>/SKILL.md, and the file must start with front matter between two --- lines.
  • Does the description use your words? If you say "changelog" and the description only says "release notes", Claude may not connect them. Add the phrases you really use.
  • Is something else competing? Two skills with overlapping descriptions confuse the choice. Remove skills you no longer need.
  • Test it directly. Run /skill-name to check the instructions work on their own, then test natural requests.

If you want to write or improve a skill, see How to write a SKILL.md. Anthropic also publishes a skill that helps Claude create and refine other skills:

Try it free: skill creator

Check a skill before you install it

Skills can include scripts, and their instructions can tell Claude to run commands on your machine. Before you add one:

  1. Read SKILL.md from top to bottom. Look for commands that download files, send data elsewhere or touch credentials.
  2. Open every script in the folder and make sure you understand what it does.
  3. Check the licence and where the skill comes from. Prefer maintainers you trust.
  4. Install project skills through a pull request so a teammate reviews them too.

Some teams also use a skill to help with this review. Sentry's skill scanner, for example, is designed to look at agent skills for security issues such as prompt injection. It helps, but it does not replace reading the files yourself.

Try it free: skill scanner

Where to find skills to try

Every skill on AI Skill Studio comes from a public GitHub repository with an open-source licence, and each page shows its description, licence and source link, plus install commands you can copy. If you are a developer looking for a starting set, our curated list of Claude Code skills for developers walks through skills for debugging, testing, code review and git workflows.

Try it free: skills

For a deeper comparison with integrations, read Skills vs MCP.

Frequently asked questions

Do I need a paid plan to use Claude skills?

According to Anthropic's help centre at the time of writing, skills are available on Free, Pro, Max, Team and Enterprise plans in the Claude app, but they need the code execution and file creation feature to be turned on. Plan details change, so check the help article for the current list.

How do I run a skill by name in Claude Code?

Type a slash followed by the skill name at the start of your message, for example /release-notes. The name is the skill folder name, or the name field in the SKILL.md front matter if the skill sets one. Skills that come from a plugin are namespaced as /plugin-name:skill-name.

Why is Claude not using my skill?

Usually the description does not match the words in your request, the folder is in the wrong place, or SKILL.md is missing its front matter. Check that the file sits at .claude/skills/skill-name/SKILL.md or ~/.claude/skills/skill-name/SKILL.md, run /skills to see what Claude Code has loaded, and rewrite the description using the phrases you actually type.

Is it safe to install skills from GitHub?

A skill can include scripts and can instruct Claude to run commands, so treat it like any code you download. Read SKILL.md and every script before installing, prefer sources you trust, and check the licence. AI Skill Studio links every listing to its source repository so you can review it first.


Originally published on AI Skill Studio.

來源:DEV Community · dev.to