<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Skills · AtomCode Docs</title>
<meta name="description" content="Write reusable user-defined skills that the model can invoke for multi-step workflows.">
<link rel="icon" type="image/png" href="https://cdn-static.gitcode.host/static/images/logo-favicon.png">
<link rel="stylesheet" href="../docs.css">
<script>(function(){try{var s=localStorage.getItem('atomcode_theme')||localStorage.getItem('atomcode-theme');if(s==='light'){document.documentElement.classList.add('light');document.documentElement.setAttribute('data-theme','light')}}catch(e){}})();</script>
</head>
<body data-page="skills">
<header class="dhdr" id="dhdr">
<a class="dhdr-logo" href="../../index.html">
<img src="https://cdn-news.gitcode.com/news/atomcode-icon1.png" alt="AtomCode">
<span>AtomCode</span>
<span class="dhdr-badge" data-i18n="badge.docs">DOCS</span>
<span class="dhdr-ver">v4.25.0</span>
</a>
<div class="dhdr-right">
<button class="search-trigger" data-open-search data-i18n-aria="aria.search" aria-label="搜索文档">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
<span data-i18n="search.trigger.text">搜索文档…</span>
<span class="kbd">⌘K</span>
</button>
<button class="icon-btn" id="themeBtn" data-i18n-aria="aria.theme" aria-label="切换主题"></button>
<button class="icon-btn" id="langBtn" data-i18n-aria="aria.lang" aria-label="切换语言">中</button>
<a class="dhdr-link" href="https://atomgit.com/atomgit_atomcode/atomcode" target="_blank" rel="noopener" data-i18n="hdr.repo">仓库 →</a>
<button class="icon-btn sb-toggle" id="sbToggle" data-i18n-aria="aria.sidebar" aria-label="目录">☰</button>
</div>
</header>
<div class="dlayout">
<aside class="dside" id="dside">
<div class="dside-group">
<div class="dside-group-t" data-i18n="side.g.overview">概览</div>
<a class="dside-link" href="./index.html" data-slug="index" data-i18n="side.index">文档首页</a>
</div>
<div class="dside-group">
<div class="dside-group-t" data-i18n="side.g.start">开始</div>
<a class="dside-link" href="./getting-started.html" data-slug="getting-started" data-i18n="side.getting-started">快速开始</a>
<a class="dside-link" href="./login.html" data-slug="login" data-i18n="side.login">登录方式</a>
<a class="dside-link" href="./configuration.html" data-slug="configuration" data-i18n="side.configuration">配置文件</a>
</div>
<div class="dside-group">
<div class="dside-group-t" data-i18n="side.g.usage">使用</div>
<a class="dside-link" href="./basic-usage.html" data-slug="basic-usage" data-i18n="side.basic-usage">基本使用</a>
<a class="dside-link" href="./slash-commands.html" data-slug="slash-commands" data-i18n="side.slash-commands">斜杠命令</a>
<a class="dside-link" href="./keybindings.html" data-slug="keybindings" data-i18n="side.keybindings">快捷键</a>
<a class="dside-link" href="./sessions.html" data-slug="sessions" data-i18n="side.sessions">会话与撤销</a>
</div>
<div class="dside-group">
<div class="dside-group-t" data-i18n="side.g.advanced">进阶</div>
<a class="dside-link" href="./tools.html" data-slug="tools" data-i18n="side.tools">内置工具</a>
<a class="dside-link" href="./approvals.html" data-slug="approvals" data-i18n="side.approvals">权限审批</a>
<a class="dside-link" href="./skills.html" data-slug="skills" data-i18n="side.skills">Skills 扩展</a>
<a class="dside-link" href="./mcp.html" data-slug="mcp" data-i18n="side.mcp">MCP 集成</a>
<a class="dside-link" href="./plugins.html" data-slug="plugins" data-i18n="side.plugins">Plugin 系统</a>
<a class="dside-link" href="./memory.html" data-slug="memory" data-i18n="side.memory">永久记忆</a>
<a class="dside-link" href="./project-instructions.html" data-slug="project-instructions" data-i18n="side.project-instructions">项目指令文件</a>
<a class="dside-link" href="./webui.html" data-slug="webui" data-i18n="side.webui">WebUI 界面</a>
<a class="dside-link" href="./webui-remote-access.html" data-slug="webui-remote-access" data-i18n="side.webui-remote-access">远程访问指南</a>
</div>
<div class="dside-group">
<div class="dside-group-t" data-i18n="side.g.ops">问题</div>
<a class="dside-link" href="./faq.html" data-slug="faq" data-i18n="side.faq">常见问题</a>
</div>
</aside>
<main class="dmain prose-docs">
<h1>Skills</h1>
<p class="lede">A skill is a user-defined, reusable command — basically a chunk of markdown with frontmatter telling the AI "here's how to handle this kind of task". Once you've written one, it shows up alongside the built-in slash commands in the menu, or can be invoked on-demand by the <code>use_skill</code> tool.</p>
<h2>What skills are good for</h2>
<ul>
<li>Codifying frequent workflows: <em>cutting a release, writing a changelog, running regression tests, generating weekly reports…</em></li>
<li>Wrapping complex tasks that need step-by-step guidance: <em>refactor playbooks, bug root-cause analysis, performance tuning</em></li>
<li>Making the model follow your defined steps and validation rules on a specific topic</li>
</ul>
<h2>Skill file layout</h2>
<p>A skill is usually a directory containing at least a <code>SKILL.md</code>:</p>
<pre><code>my-skills/
├── release/
│ └── SKILL.md
├── write-changelog/
│ └── SKILL.md
└── debug-flaky-test/
├── SKILL.md
└── references/
└── pattern-library.md</code></pre>
<p>A typical <code>SKILL.md</code>:</p>
<pre><code>---
name: release
description: Cut a new release tag, update the changelog, and publish
---
## When to use
When the user says "ship a new version", "cut a release", or "tag it".
## Steps
1. Inspect `git log` for changes since the last release.
2. Ask the user to confirm the semver bump (patch / minor / major).
3. Add the new entry to `CHANGELOG.md`.
4. Run `pnpm build` and ensure it passes.
5. Create the git tag `v<version>` with release notes.
6. Run `pnpm publish` (or the corresponding publish command).
## Rules
- Version numbers must follow semver.
- Never skip tests — fix any failure first.
- If publish fails, roll back the local tag and changelog edits.</code></pre>
<h2>Skill directories</h2>
<p>AtomCode loads skills from a few well-known locations:</p>
<ul>
<li><strong>Global</strong>: <code>~/.atomcode/skills/</code></li>
<li><strong>Project-level</strong>: <code>.atomcode/skills/</code> at the current working directory or any ancestor (if present)</li>
</ul>
<p>Project-level skills override same-named globals, so you can define the same name with different flows per project.</p>
<h2>Invocation</h2>
<h3>Via slash command</h3>
<p>Every successfully loaded skill appears in the slash-command completion menu:</p>
<pre><code>> /release
> /write-changelog
> /debug-flaky-test</code></pre>
<h3>Via the <code>$</code> menu</h3>
<p>Type a <code>$</code> at the start of the input box to pop up a skills menu (the same set of invocable skills that <code>/skills</code> lists); keep typing to filter, press <code>Tab</code> to complete the highlighted name, and submit <code>$<name> [args]</code> to invoke that skill. It's a parallel entry point to slash commands: <code>/</code> drives slash-command completion, while <code>$</code> is dedicated to picking a skill and can carry arguments inline, e.g. <code>$brainstorming help me design login</code>.</p>
<h3>Model-driven invocation</h3>
<p>The model can call the <code>use_skill</code> tool itself to run a relevant skill as a sub-flow. If you say "publish a new version", the model may pick this skill on its own without you typing <code>/release</code>.</p>
<h2>Tips for writing a good skill</h2>
<ul>
<li><strong>Be specific in the description</strong> — it's the menu's blurb, and the main signal the model uses to decide whether this skill applies.</li>
<li><strong>Order matters</strong> — the model reads top-to-bottom; put strong dependencies up front.</li>
<li><strong>Make branches explicit</strong> — "if build fails …; otherwise …" is far more reliable than letting the model guess.</li>
<li><strong>List red lines</strong> — put hard rules in a dedicated "Rules" section to maximise compliance.</li>
<li><strong>Use sub-docs when needed</strong> — park long references in <code>references/*.md</code> and leave a one-liner like "see … if needed" in <code>SKILL.md</code>.</li>
</ul>
<h2 id="与项目指令的分工">Versus project instructions</h2>
<table>
<thead>
<tr><th>Scenario</th><th>Where it belongs</th></tr>
</thead>
<tbody>
<tr><td>Always-on project conventions (tech stack, code style, commands)</td><td><a href="./project-instructions.html"><code>.atomcode.md</code></a></td></tr>
<tr><td>A specific workflow that needs to be triggered explicitly</td><td>Skill</td></tr>
<tr><td>A one-off ad-hoc requirement</td><td>Just write it in the prompt</td></tr>
</tbody>
</table>
<h2>Next steps</h2>
<ul>
<li><a href="./basic-usage.html">Basic Usage</a> — back to everyday workflows</li>
<li><a href="./faq.html">FAQ</a> — why isn't my skill showing up in the menu?</li>
</ul>
<footer class="dftr">
<span data-i18n="ftr.copy">© 2026 AtomCode · MIT</span>
<a href="https://atomgit.com/atomgit_atomcode/atomcode/issues" target="_blank" rel="noopener" data-i18n="ftr.issue">报告问题</a>
</footer>
</main>
</div>
<div class="search-modal" id="searchModal" role="dialog" data-i18n-aria="aria.search" aria-label="搜索文档">
<div class="search-modal-bg"></div>
<div class="search-modal-box">
<div class="search-input-wrap">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
<input id="searchInput" type="search" data-i18n-placeholder="search.placeholder" placeholder="搜索文档…" autocomplete="off">
<span class="search-esc">ESC</span>
</div>
<div class="search-results" id="searchResults"></div>
</div>
</div>
<script src="../docs.js"></script>
</body>
</html>