Skill Tracer
Skills › Superpowers › writing-skills › discovery.md

discovery.md

201 lines · skills/writing-skills/references/discovery.md at 2ce8aa1

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Writing SKILL.md for Discovery
2
3Part of superpowers:writing-skills: the SKILL.md template and how to name,
4describe and size a skill so agents find it and read it.
5

Writing SKILL.md for Discovery

Part of superpowers:writing-skills: the SKILL.md template and how to name, describe and size a skill so agents find it and read it.

Raw lines 1 to 5
6## SKILL.md Structure
7
8**Frontmatter (YAML):**
9- Two required fields: `name` and `description` (see [agentskills.io/specification](https://agentskills.io/specification) for all supported fields)
10- Max 1024 characters total
11- `name`: Use letters, numbers, and hyphens only (no parentheses, special chars)
12- `description`: Third-person, describes ONLY when to use (NOT what it does)
13 - Start with "Use when..." to focus on triggering conditions
14 - Include specific symptoms, situations, and contexts
15 - **NEVER summarize the skill's process or workflow** (see Skill Discovery Optimization below for why)
16 - Keep under 500 characters if possible
18```markdown
19---
20name: Skill-Name-With-Hyphens
21description: Use when [specific triggering conditions and symptoms]
22---
24# Skill Name
26## Overview
27What is this? Core principle in 1-2 sentences.
29## When to Use
30[Small inline flowchart IF decision non-obvious]
32Bullet list with SYMPTOMS and use cases
33When NOT to use
35## Core Pattern (for techniques/patterns)
36Before/after code comparison
38## Quick Reference
39Table or bullets for scanning common operations
41## Implementation
42Inline code for simple patterns
43Link to file for heavy reference or reusable tools
45## Common Mistakes
46What goes wrong + fixes
48## Real-World Impact (optional)
49Concrete results
50```

SKILL.md Structure

Frontmatter (YAML):

  • Two required fields: name and description (see agentskills.io/specification for all supported fields)
  • Max 1024 characters total
  • name: Use letters, numbers, and hyphens only (no parentheses, special chars)
  • description: Third-person, describes ONLY when to use (NOT what it does)
  • Start with "Use when..." to focus on triggering conditions
  • Include specific symptoms, situations, and contexts
  • NEVER summarize the skill's process or workflow (see Skill Discovery Optimization below for why)
  • Keep under 500 characters if possible
---
name: Skill-Name-With-Hyphens
description: Use when [specific triggering conditions and symptoms]
---

# Skill Name

## Overview
What is this? Core principle in 1-2 sentences.

## When to Use
[Small inline flowchart IF decision non-obvious]

Bullet list with SYMPTOMS and use cases
When NOT to use

## Core Pattern (for techniques/patterns)
Before/after code comparison

## Quick Reference
Table or bullets for scanning common operations

## Implementation
Inline code for simple patterns
Link to file for heavy reference or reusable tools

## Common Mistakes
What goes wrong + fixes

## Real-World Impact (optional)
Concrete results
Raw lines 6 to 52
53## Skill Discovery Optimization (SDO)
55**Critical for discovery:** Future agents need to FIND your skill

Skill Discovery Optimization (SDO)

Critical for discovery: Future agents need to FIND your skill

Raw lines 53 to 56
57### 1. Rich Description Field
59**Purpose:** Your agent reads the description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"
61**Format:** Start with "Use when..." to focus on triggering conditions
63**CRITICAL: Description = When to Use, NOT What the Skill Does**
65The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description.
67**Why this matters:** Testing revealed that when a description summarizes the skill's workflow, an agent may follow the description instead of reading the full skill content. A description saying "code review between tasks" caused an agent to do ONE review, even though the skill's flowchart clearly showed TWO reviews (spec compliance then code quality).
69When the description was changed to just "Use when executing implementation plans with independent tasks" (no workflow summary), the agent correctly read the flowchart and followed the two-stage review process.
71**The trap:** Descriptions that summarize workflow create a shortcut agents will take. The skill body becomes documentation agents skip.
73```yaml
74# ❌ BAD: Summarizes workflow - agents may follow this instead of reading skill
75description: Use when executing plans - dispatches subagent per task with code review between tasks
77# ❌ BAD: Too much process detail
78description: Use for TDD - write test first, watch it fail, write minimal code, refactor
80# ✅ GOOD: Just triggering conditions, no workflow summary
81description: Use when executing implementation plans with independent tasks in the current session
83# ✅ GOOD: Triggering conditions only
84description: Use when implementing any feature or bugfix, before writing implementation code
85```
87**Content:**
88- Use concrete triggers, symptoms, and situations that signal this skill applies
89- Describe the *problem* (race conditions, inconsistent behavior) not *language-specific symptoms* (setTimeout, sleep)
90- Keep triggers technology-agnostic unless the skill itself is technology-specific
91- If skill is technology-specific, make that explicit in the trigger
92- Write in third person (injected into system prompt)
93- **NEVER summarize the skill's process or workflow**
95```yaml
96# ❌ BAD: Too abstract, vague, doesn't include when to use
97description: For async testing
99# ❌ BAD: First person
100description: I can help you with async tests when they're flaky
102# ❌ BAD: Mentions technology but skill isn't specific to it
103description: Use when tests use setTimeout/sleep and are flaky
105# ✅ GOOD: Starts with "Use when", describes problem, no workflow
106description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently
108# ✅ GOOD: Technology-specific skill with explicit trigger
109description: Use when using React Router and handling authentication redirects
110```

1. Rich Description Field

Purpose: Your agent reads the description to decide which skills to load for a given task. Make it answer: "Should I read this skill right now?"

Format: Start with "Use when..." to focus on triggering conditions

CRITICAL: Description = When to Use, NOT What the Skill Does

The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow in the description.

Why this matters: Testing revealed that when a description summarizes the skill's workflow, an agent may follow the description instead of reading the full skill content. A description saying "code review between tasks" caused an agent to do ONE review, even though the skill's flowchart clearly showed TWO reviews (spec compliance then code quality).

When the description was changed to just "Use when executing implementation plans with independent tasks" (no workflow summary), the agent correctly read the flowchart and followed the two-stage review process.

The trap: Descriptions that summarize workflow create a shortcut agents will take. The skill body becomes documentation agents skip.

# ❌ BAD: Summarizes workflow - agents may follow this instead of reading skill
description: Use when executing plans - dispatches subagent per task with code review between tasks

# ❌ BAD: Too much process detail
description: Use for TDD - write test first, watch it fail, write minimal code, refactor

# ✅ GOOD: Just triggering conditions, no workflow summary
description: Use when executing implementation plans with independent tasks in the current session

# ✅ GOOD: Triggering conditions only
description: Use when implementing any feature or bugfix, before writing implementation code

Content:

  • Use concrete triggers, symptoms, and situations that signal this skill applies
  • Describe the problem (race conditions, inconsistent behavior) not language-specific symptoms (setTimeout, sleep)
  • Keep triggers technology-agnostic unless the skill itself is technology-specific
  • If skill is technology-specific, make that explicit in the trigger
  • Write in third person (injected into system prompt)
  • NEVER summarize the skill's process or workflow
# ❌ BAD: Too abstract, vague, doesn't include when to use
description: For async testing

# ❌ BAD: First person
description: I can help you with async tests when they're flaky

# ❌ BAD: Mentions technology but skill isn't specific to it
description: Use when tests use setTimeout/sleep and are flaky

# ✅ GOOD: Starts with "Use when", describes problem, no workflow
description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently

# ✅ GOOD: Technology-specific skill with explicit trigger
description: Use when using React Router and handling authentication redirects
Raw lines 57 to 111
Names a skill subagent-driven-development :69
Starts an agent dispatches :75
Starts an agent subagent :75
112### 2. Keyword Coverage
114Use words an agent would search for:
115- Error messages: "Hook timed out", "ENOTEMPTY", "race condition"
116- Symptoms: "flaky", "hanging", "zombie", "pollution"
117- Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach"
118- Tools: Actual commands, library names, file types

2. Keyword Coverage

Use words an agent would search for:

  • Error messages: "Hook timed out", "ENOTEMPTY", "race condition"
  • Symptoms: "flaky", "hanging", "zombie", "pollution"
  • Synonyms: "timeout/hang/freeze", "cleanup/teardown/afterEach"
  • Tools: Actual commands, library names, file types
Raw lines 112 to 119
120### 3. Descriptive Naming
122**Use active voice, verb-first:**
123- ✅ `creating-skills` not `skill-creation`
124- ✅ `condition-based-waiting` not `async-test-helpers`

3. Descriptive Naming

Use active voice, verb-first:

  • ✅ creating-skills not skill-creation
  • ✅ condition-based-waiting not async-test-helpers
Raw lines 120 to 125
126### 4. Token Efficiency (Critical)
128**Problem:** getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.
130**Target word counts:**
131- getting-started workflows: <150 words each
132- Frequently-loaded skills: <200 words total
133- Other skills: <500 words (still be concise)
135**Techniques:**
137**Move details to tool help:**
138```bash
139# ❌ BAD: Document all flags in SKILL.md
140search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
142# ✅ GOOD: Reference --help
143search-conversations supports multiple modes and filters. Run --help for details.
144```
146**Use cross-references:**
147```markdown
148# ❌ BAD: Repeat workflow details
149When searching, dispatch subagent with template...
150[20 lines of repeated instructions]
152# ✅ GOOD: Reference other skill
153Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
154```
156**Compress examples:**
157```markdown
158# ❌ BAD: Verbose example (42 words)
159your human partner: "How did we handle authentication errors in React Router before?"
160You: I'll search past conversations for React Router authentication patterns.
161[Dispatch subagent with search query: "React Router authentication error handling 401"]
163# ✅ GOOD: Minimal example (20 words)
164Partner: "How did we handle auth errors in React Router?"
165You: Searching...
166[Dispatch subagent → synthesis]
167```
169**Eliminate redundancy:**
170- Don't repeat what's in cross-referenced skills
171- Don't explain what's obvious from command
172- Don't include multiple examples of same pattern
174**Verification:**
175```bash
176wc -w skills/path/SKILL.md
177# getting-started workflows: aim for <150 each
178# Other frequently-loaded: aim for <200 total
179```
181**Name by what you DO or core insight:**
182- ✅ `condition-based-waiting` > `async-test-helpers`
183- ✅ `using-skills` not `skill-usage`
184- ✅ `flatten-with-flags` > `data-structure-refactoring`
185- ✅ `root-cause-tracing` > `debugging-techniques`
187**Gerunds (-ing) work well for processes:**
188- `creating-skills`, `testing-skills`, `debugging-with-logs`
189- Active, describes the action you're taking

4. Token Efficiency (Critical)

Problem: getting-started and frequently-referenced skills load into EVERY conversation. Every token counts.

Target word counts:

  • getting-started workflows: <150 words each
  • Frequently-loaded skills: <200 words total
  • Other skills: <500 words (still be concise)

Techniques:

Move details to tool help:

# ❌ BAD: Document all flags in SKILL.md
search-conversations supports --text, --both, --after DATE, --before DATE, --limit N

# ✅ GOOD: Reference --help
search-conversations supports multiple modes and filters. Run --help for details.

Use cross-references:

# ❌ BAD: Repeat workflow details
When searching, dispatch subagent with template...
[20 lines of repeated instructions]

# ✅ GOOD: Reference other skill
Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.

Compress examples:

# ❌ BAD: Verbose example (42 words)
your human partner: "How did we handle authentication errors in React Router before?"
You: I'll search past conversations for React Router authentication patterns.
[Dispatch subagent with search query: "React Router authentication error handling 401"]

# ✅ GOOD: Minimal example (20 words)
Partner: "How did we handle auth errors in React Router?"
You: Searching...
[Dispatch subagent → synthesis]

Eliminate redundancy:

  • Don't repeat what's in cross-referenced skills
  • Don't explain what's obvious from command
  • Don't include multiple examples of same pattern

Verification:

wc -w skills/path/SKILL.md
# getting-started workflows: aim for <150 each
# Other frequently-loaded: aim for <200 total

Name by what you DO or core insight:

  • ✅ condition-based-waiting > async-test-helpers
  • ✅ using-skills not skill-usage
  • ✅ flatten-with-flags > data-structure-refactoring
  • ✅ root-cause-tracing > debugging-techniques

Gerunds (-ing) work well for processes:

  • creating-skills, testing-skills, debugging-with-logs
  • Active, describes the action you're taking
Raw lines 126 to 190
Starts an agent dispatch :149
Starts an agent subagent :149
Starts an agent subagents :153
Starts an agent Dispatch :161
191### 5. Cross-Referencing Other Skills
193**When writing documentation that references other skills:**
195Use skill name only, with explicit requirement markers:
196- ✅ Good: `**REQUIRED SUB-SKILL:** Use superpowers:test-driven-development`
197- ✅ Good: `**REQUIRED BACKGROUND:** You MUST understand superpowers:systematic-debugging`
198- ❌ Bad: `See skills/testing/test-driven-development` (unclear if required)
199- ❌ Bad: `@skills/testing/test-driven-development/SKILL.md` (force-loads, burns context)
201**Why no @ links:** `@` syntax force-loads files immediately, consuming 200k+ context before you need them.

5. Cross-Referencing Other Skills

When writing documentation that references other skills:

Use skill name only, with explicit requirement markers:

  • ✅ Good: **REQUIRED SUB-SKILL:** Use superpowers:test-driven-development
  • ✅ Good: **REQUIRED BACKGROUND:** You MUST understand superpowers:systematic-debugging
  • ❌ Bad: See skills/testing/test-driven-development (unclear if required)
  • ❌ Bad: @skills/testing/test-driven-development/SKILL.md (force-loads, burns context)

Why no @ links: @ syntax force-loads files immediately, consuming 200k+ context before you need them.

Raw lines 191 to 201
Names a skill test-driven-development :196
Names a skill systematic-debugging :197