writing-skills
Methodology for creating effective skills using TDD principles. Use when creating new skills, editing existing skills, or authoring plugin components. Triggers on: 'create skill', 'write skill', 'new skill', 'skill authoring'.
What this skill does
# Writing Skills Skill
TDD applied to process documentation.
## Core Principle
Writing skills IS TDD applied to process documentation. If you can't test it breaks without the skill, the skill isn't needed.
## When to Apply
- Creating new skills
- Editing existing skills
- Reviewing skill quality
- Authoring plugin components
## TDD Mapping
| TDD Concept | Skill Equivalent |
|-------------|------------------|
| Test case | Pressure scenario (situation where agent fails without skill) |
| Production code | SKILL.md content |
| Failing test | Agent demonstrably fails the scenario |
| Passing test | Agent handles scenario correctly with skill loaded |
| Refactor | Trim to minimum effective content |
## RED-GREEN-REFACTOR for Skills
### RED: Identify Failure Scenarios
Identify 3+ pressure scenarios where the agent fails without this skill. Document the failure mode. This is your test suite. If you can't find 3 scenarios, the skill probably isn't needed.
### GREEN: Write Minimum Effective Content
Write SKILL.md that addresses every identified failure. Minimum content to pass -- no extras, no nice-to-haves, no "comprehensive guides." Every section must map to at least one pressure scenario.
### REFACTOR: Trim Aggressively
Remove anything that doesn't directly address a pressure scenario. Target ~120 lines. If removing a line doesn't weaken any pressure scenario, remove it.
## SKILL.md Structure Template
```
---
name: {short-name}
description: "{Role sentence}. Use when {triggers}. Triggers on: {keywords}."
---
# {Name} Skill
{Tagline}
## When to Apply
## Core Pattern / Framework
## Anti-Rationalization Table (if methodology skill)
## Common Mistakes
## The Bottom Line
```
## Claude Search Optimization (CSO)
The description field determines when Claude loads your skill. Get it wrong and the skill never fires.
- Description = "Use when..." triggers ONLY
- NEVER summarize the workflow in the description
- Include trigger keywords that match how users/agents naturally phrase the need
**Good:** `"Use when receiving review comments from code-reviewer agent, PR reviews, or external feedback. Triggers on: 'review feedback', 'address review', 'fix review comments'."`
**Bad:** `"A comprehensive guide to handling code review feedback through a structured process"`
The bad example describes what the skill contains. The good example describes when to load it.
## Skill Types
| Type | Purpose | Example | Line Target |
|------|---------|---------|-------------|
| Technique | How to do X | debugger | ~120 lines |
| Pattern | When to use X | receiving-code-review | ~120 lines |
| Methodology | Discipline for X | tdd, verification | ~130 lines |
| Meta | How to create X | writing-skills | ~140 lines |
## Anti-Rationalization for Skipping Tests
| Excuse | Counter |
|--------|---------|
| "The skill is obviously clear" | If it's obvious, you can write 3 failure scenarios in 2 minutes |
| "It's just a reference doc" | Reference docs that don't address failures are shelf-ware |
| "Testing documentation is overkill" | Testing docs IS identifying what problems they solve |
| "I'll test it in practice" | Without defined scenarios, you won't notice when it fails |
## When NOT to Create a Skill
Not everything deserves a skill:
- Information easily found in docs (link to docs instead)
- One-time procedures (just do them)
- Tool-specific configuration (use CLAUDE.md)
- Content under 30 lines (too simple -- put it in CLAUDE.md)
## Token Efficiency
Every line must earn its place:
- Technique/pattern skills: ~120 lines
- Methodology skills: ~130 lines
- Meta skills: ~140 lines
The test: "If removing this line doesn't weaken any pressure scenario, remove it."
Avoid:
- Repetitive examples that demonstrate the same point
- "Nice to know" sections that don't prevent failures
- Long prose when a table communicates faster
- Headers with only 1-2 lines of content (merge them)
## Frontmatter Rules
Skills use ONLY `name` and `description` in frontmatter:
```yaml
---
name: my-skill
description: "What it does. Use when X. Triggers on: 'keyword1', 'keyword2'."
---
```
No `model`, `tools`, or `permissionMode`. These are not agent definitions.
## Common Mistakes
| Mistake | Why It's Wrong | Do This Instead |
|---------|---------------|-----------------|
| Writing without pressure scenarios | No way to verify the skill works | RED phase first -- always |
| Summarizing workflow in description | Claude can't match it to triggers | Use "Use when..." pattern |
| Including everything you know | Bloats context, dilutes signal | Only what prevents identified failures |
| Skipping refactor phase | Skills grow stale and verbose | Trim after every edit |
| Copying another skill's structure | Different types need different shapes | Match structure to skill type |
## The Bottom Line
A skill without tested pressure scenarios is documentation. Documentation without a problem to solve is noise.
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.