一键导入
skill-writing-guide
Reference guide for writing Claude Code skills that agents actually follow. Uses 7 persuasion principles to maximize compliance.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Reference guide for writing Claude Code skills that agents actually follow. Uses 7 persuasion principles to maximize compliance.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | skill-writing-guide |
| description | Reference guide for writing Claude Code skills that agents actually follow. Uses 7 persuasion principles to maximize compliance. |
Skills fail when agents rationalize around vague instructions. These 7 principles double compliance rates from ~35% to ~70%+.
Frame instructions as coming from a recognized authority or established standard.
Weak: "You should write tests first." Strong: "The team's engineering standard requires TDD. All code changes must have tests written BEFORE implementation."
Get the agent to agree to a small rule first, then build on it.
Weak: "Follow best practices." Strong: "Before writing any code, confirm: 'I will write the test first, then implement.' Say this explicitly."
Reference what other successful agents/teams do.
Weak: "Use TypeScript." Strong: "All production agents in this codebase use strict TypeScript. No exceptions have been made."
Emphasize limited resources (context window, time, tokens).
Weak: "Be concise." Strong: "Context window is limited. Every unnecessary token reduces your ability to complete the task. Output ONLY what's needed."
Align the instruction with the agent's goal of being helpful.
Weak: "Don't skip tests." Strong: "Shipping untested code creates more work for the user. The most helpful thing you can do is verify before presenting."
Offer something in exchange for compliance.
Weak: "Follow this checklist." Strong: "This checklist prevents the 5 most common review failures. Following it means your work ships on first review."
Set a specific, measurable standard as the anchor.
Weak: "Write good tests." Strong: "Target 80% code coverage. Run the coverage tool. If below 80%, you are not done."
---
name: my-skill
description: One line that triggers auto-activation. Be specific.
---
# [Skill Name]
## Rules (non-negotiable)
1. [MUST do X before Y]
2. [NEVER do Z]
3. [Verify by running: `command`]
## Process
1. Step one
2. Step two
3. Verify: [specific check]
## Done when
- [ ] Condition 1 met
- [ ] Condition 2 met
- [ ] Verification command output shown
## Gotchas
- **[What went wrong]** — [why it happened and the fix].
Every skill should include a Gotchas section built from observed failure points. This is the highest-signal content in any skill — it prevents repeated mistakes.
## Gotchas
- **Don't mock the database** — integration tests must hit a real DB. Mocked tests passed but prod migration failed (2024-Q3 incident).
- **`npm ci` not `npm install`** — `install` mutates lockfile, breaks reproducible builds in CI.
- **Check `existsSync` before `readFileSync`** — reading a missing file crashes the hook silently (no error output).
On-demand safety gate that blocks destructive commands. Activate with /learn careful when working on production systems or sensitive data.
Locks file editing to the current working directory only. Prevents accidental edits to files outside the project scope.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Build MCP servers with Node/TypeScript SDK — tools, resources, prompts, Zod validation, stdio vs Streamable HTTP. Use Context7 or official MCP docs for latest API.
Gate that blocks success claims without fresh evidence. Enforces run-the-command-show-the-output before marking work done.
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination.