writing-skills
Writes a new skill or changes an existing one in its folder (SKILL.md, references and scripts) and tests it.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 15
- Forks
- 4
01 前言 Front Matter
- name
- writing-skills
- description
- Writes a new skill or changes an existing one in its folder (SKILL.md, references and scripts) and tests it.
- compatibility
- [ "Python 3.11+ standard library" ]
02 资源文件 10
- 参考文档references/anthropic-best-practices.md4.5 KB
- 参考文档references/bulletproofing-skills.md3.8 KB
- 参考文档references/condition-skill-output-detailed.md1.8 KB
- 参考文档references/examples/CLAUDE_MD_TESTING.md2.6 KB
- 参考文档references/mermaid-conventions.md5.1 KB
- 参考文档references/persuasion-principles.md2.0 KB
- 参考文档references/review-loop.md1.2 KB
- 参考文档references/skill-testing-guide.md1.4 KB
- 参考文档references/testing-skills-with-subagents.md6.9 KB
- 参考文档references/trigger-eval.md2.2 KB
03 SKILL.md 正文
Writing Skills
The response model changes reusable skill guidance from observed behavior or a direct source-contract contradiction, then validates the package and the affected decision. Read test-driven-development for executable changes; an instruction-only contradiction can use preserved source evidence instead of an invented failed delegate run.
Baseline and scope
Before editing, identify the exact skill decision that is wrong or ambiguous. Retain the actual baseline outcome or source quotation and locator. A passing baseline stays a pass; a predicted failure is not an observed failure.
Write a reusable technique, pattern or reference when repeated work benefits from it. Keep one-off project rules in project instructions. Do not create a skill merely because a regular expression or existing automation can enforce the constraint.
Define the affected evaluation before editing. Include only cases whose outcomes can change the response model's judgment of an acceptance criterion or the next correction. For executable behavior, the response model follows test-driven-development for the code and test being changed.
Author the package
Use SKILL.md for core guidance, conditionally loaded references/ for detail, and scripts/ for executable support. At an operational handoff, write enough for a reader without prior conversation to act: identify the caller and trigger, the authoritative origin and required shape of transferred values, the exposed tool or actual API/CLI invocation, the result and its storage owner, and the conditional next action. Distinguish the response model's meaning judgment from code that authenticates its recorded judgment. Put a shared procedure in one owning reference and link callers to its section; do not repeat this field list in every sentence or replace an executable transfer with an actor label. Mark illustrative prompts, schemas and data as examples rather than ambient task authority.
The frontmatter must contain a directory-matching lowercase-hyphen name and a description that states what the skill does and when it is used. The description serves discovery, not execution: it contains no summary of the body and no procedure step, and no point appears twice in it. Keep descriptions within 1024 characters with the key use case first; state compatibility when the workflow depends on an environment.
In the body, state the workflow's purpose, applicability, procedure, output and failure modes. Use a quick-reference table when the reader looks up an entry by its condition. Prefer one complete relevant example over multiple shallow language variants. Long code and reference tables belong in supporting files; every reference in the package needs a clear loading condition.
Do not add hypothetical defenses or repeat a prohibition merely to increase emphasis. If a real evaluation shows rationalization, revise the instruction that allowed the wrong decision.
Validate and evaluate
- Preserve baseline evidence before changing the candidate.
- Edit the affected body, callers and references to remove the demonstrated contradiction.
- Run the affected pressure, application or source-contract check required by the task and record the actual outcome and limits.
- If an observation contradicts a requirement, follow the diagnostic procedure to select and apply the justified correction, then repeat only the affected checks.
- Distribute or commit only under the human user's existing authorization and after required validation succeeds.
Coordinated changes may span packages; each changed package still needs its own disposition.
Verification-before-completion defines useful-check selection, evidence reuse, original source and time, and completion claims. Systematic-debugging defines incident accounting and bounded continuation. Do not duplicate either policy in a skill under repair.
Failure modes
- Do not backdate missing baseline evidence or delete inconvenient results.
- Do not add a new report, hook or mandatory record when existing task context already preserves the evidence.
Conditional references
| Authoring uncertainty | Reference |
|---|---|
| Official skill design principles | anthropic-best-practices.md |
| Whether an observed output or rule-application failure warrants an instruction repair | bulletproofing-skills.md |
| Trigger, workflow and output separation | condition-skill-output-detailed.md |
| Flowchart notation | mermaid-conventions.md |
| Pressure dimensions for a case | persuasion-principles.md |
| A post-evaluation contradiction | review-loop.md |
| Test method by skill type | skill-testing-guide.md |
| Delegate evaluation that the human user authorized | testing-skills-with-subagents.md |
| Trigger precision and recall | trigger-eval.md |
| Discovery scenario example | CLAUDE_MD_TESTING.md |
04 同仓库更多 Skills
skill-evolution
Recommends skill changes from recorded tool-call patterns and conduct corrections asserted by the human user or observed by the response model, when the human user asks for such recommendations or their pending backlog, or authorizes that analysis.
session-intent-analyzer
Records the response model's new or changed interpretation of the input the response model is answering as its `interpreted-as` record before the first tool call of work, and reads that record when it can change the objective, constraints, work choice or whether earlier work continues.
necessity-gate
Judges whether proposed work is justified, needs a narrower scope or is unjustified, when the response model proposes new work or the human user asks whether to do it.
merge-companion
Reviews the installer's backups of external changes to installed skills and merges each into the new skill version, discards or defers it as the human user chooses, before a task changes or reinstalls an installed skill, or when the human user asks for that review.
compact-handoff
Writes a handoff of the task's objective, scope, evidence and next action when a long conversation, compaction or handover to another session or agent could lose them, and resumes the task from it afterwards.
writing-plans
Writes an implementation plan that breaks requirements the human user accepted into tasks a newcomer to the project can carry out, after the human user settles decisions only the human user can make and the response model settles technical choices within what the human user's instructions authorize, before implementation.