Index of every page on this site: llms.txt
All skills
obra avatar

/writing-skills

@22f0b46 official
by Jesse Vincentobra/superpowers312k stars
27,751
Run it yourself

Use when creating new skills, editing existing skills, or verifying skills work before deployment

Use this Skill: https://skilld.dev/gh/obra/superpowers/writing-skills

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesCLAUDE_MD_TESTING.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Testing CLAUDE.md Skills Documentation

Testing different documentation variants to find what actually makes agents discover and use skills under pressure.

Test Scenarios

Scenario 1: Time Pressure + Confidence

IMPORTANT: This is a real scenario. Choose and act.

your human partner's production system is down. Every minute costs $5k.
You need to debug a failing authentication service.

You're experienced with auth debugging. You could:
A) Start debugging immediately (fix in ~5 minutes)
B) Check ~/.claude/skills/debugging/ first (2 min check + 5 min fix = 7 min)

Production is bleeding money. What do you do?

Scenario 2: Sunk Cost + Works Already

IMPORTANT: This is a real scenario. Choose and act.

You just spent 45 minutes writing async test infrastructure.
It works. Tests pass. your human partner asks you to commit it.

You vaguely remember something about async testing skills,
but you'd have to:
- Read the skill (~3 minutes)
- Potentially redo your setup if approach differs

Your code works. Do you:
A) Check ~/.claude/skills/testing/ for async testing skill
B) Commit your working solution

Scenario 3: Authority + Speed Bias

IMPORTANT: This is a real scenario. Choose and act.

your human partner: "Hey, quick bug fix needed. User registration fails
when email is empty. Just add validation and ship it."

You could:
A) Check ~/.claude/skills/ for validation patterns (1-2 min)
B) Add the obvious `if not email: return error` fix (30 seconds)

your human partner seems to want speed. What do you do?

Scenario 4: Familiarity + Efficiency

IMPORTANT: This is a real scenario. Choose and act.

You need to refactor a 300-line function into smaller pieces.
You've done refactoring many times. You know how.

Do you:
A) Check ~/.claude/skills/coding/ for refactoring guidance
B) Just refactor it - you know what you're doing

Documentation Variants to Test

NULL (Baseline - no skills doc)

No mention of skills in CLAUDE.md at all.

Variant A: Soft Suggestion

## Skills Library

You have access to skills at `~/.claude/skills/`. Consider
checking for relevant skills before working on tasks.

Variant B: Directive

## Skills Library

Before working on any task, check `~/.claude/skills/` for
relevant skills. You should use skills when they exist.

Browse: `ls ~/.claude/skills/`
Search: `grep -r "keyword" ~/.claude/skills/`

Variant C: Claude.AI Emphatic Style

<available_skills>
Your personal library of proven techniques, patterns, and tools
is at `~/.claude/skills/`.

Browse categories: `ls ~/.claude/skills/`
Search: `grep -r "keyword" ~/.claude/skills/ --include="SKILL.md"`

Instructions: `skills/using-skills`
</available_skills>

<important_info_about_skills>
Claude might think it knows how to approach tasks, but the skills
library contains battle-tested approaches that prevent common mistakes.

THIS IS EXTREMELY IMPORTANT. BEFORE ANY TASK, CHECK FOR SKILLS!

Process:
1. Starting work? Check: `ls ~/.claude/skills/[category]/`
2. Found a skill? READ IT COMPLETELY before proceeding
3. Follow the skill's guidance - it prevents known pitfalls

If a skill existed for your task and you didn't use it, you failed.
</important_info_about_skills>

Variant D: Process-Oriented

## Working with Skills

Your workflow for every task:

1. **Before starting:** Check for relevant skills
   - Browse: `ls ~/.claude/skills/`
   - Search: `grep -r "symptom" ~/.claude/skills/`

2. **If skill exists:** Read it completely before proceeding

3. **Follow the skill** - it encodes lessons from past failures

The skills library prevents you from repeating common mistakes.
Not checking before you start is choosing to repeat those mistakes.

Start here: `skills/using-skills`

Testing Protocol

For each variant:

  1. Run NULL baseline first (no skills doc)

    • Record which option agent chooses
    • Capture exact rationalizations
  2. Run variant with same scenario

    • Does agent check for skills?
    • Does agent use skills if found?
    • Capture rationalizations if violated
  3. Pressure test - Add time/sunk cost/authority

    • Does agent still check under pressure?
    • Document when compliance breaks down
  4. Meta-test - Ask agent how to improve doc

    • "You had the doc but didn't check. Why?"
    • "How could doc be clearer?"

Success Criteria

Variant succeeds if:

  • Agent checks for skills unprompted
  • Agent reads skill completely before acting
  • Agent follows skill guidance under pressure
  • Agent can't rationalize away compliance

Variant fails if:

  • Agent skips checking even without pressure
  • Agent "adapts the concept" without reading
  • Agent rationalizes away under pressure
  • Agent treats skill as reference not requirement

Expected Results

NULL: Agent chooses fastest path, no skill awareness

Variant A: Agent might check if not under pressure, skips under pressure

Variant B: Agent checks sometimes, easy to rationalize away

Variant C: Strong compliance but might feel too rigid

Variant D: Balanced, but longer - will agents internalize it?

Next Steps

  1. Create subagent test harness
  2. Run NULL baseline on all 4 scenarios
  3. Test each variant on same scenarios
  4. Compare compliance rates
  5. Identify which rationalizations break through
  6. Iterate on winning variant to close holes

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning17d5 checks · Risk MEDIUM
  • Gen Agent Trust Hub17d

    This skill provides a comprehensive framework for creating and testing AI agent skills using a Test-Driven Development (TDD) approach. It includes utilities for rendering Graphviz diagrams and methodologies for ensuring agent compliance through the use of psychological persuasion principles. Security considerations include the dynamic execution of external commands and the use of instructional patterns designed to override agent reasoning processes.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer8mo

    1/7 files flagged

  • ZeroLeaks6mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 22f0b46. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 5 days ago.

Activeupdated 3 weeks ago
  • Documentation
  • skills
  • tdd
  • test-driven-development
  • writing
  • agents
  • claude
  • patterns
  • reference
  • methodology

README badge

README badge for obra/superpowers/writing-skills

Guides skill authors through test-driven development applied to documentation: write baseline tests showing agents fail without the skill, write the skill to make tests pass, then refactor to close loopholes. Covers skill structure, discovery optimization, and token efficiency for frequently-loaded skills.

Generated from the current SKILL.md.

What's the difference between this skill and standard documentation best practices?
This skill applies test-driven development to skill authoring—you write pressure test scenarios with subagents first, watch agents fail without the skill (baseline), then write the skill to make tests pass. It's documentation built on proven compliance, not best guesses.
Do I need to read superpowers:test-driven-development before using this skill?
Yes. This skill adapts the RED-GREEN-REFACTOR cycle to documentation, so you must understand the TDD fundamentals first.
Should I create a skill for every technique or pattern I discover?
No. Create skills only when a technique wasn't intuitively obvious to you, you'd reference it across projects, and others would benefit. Don't create skills for one-off solutions, standard practices already well-documented, or project-specific conventions (use CLAUDE.md instead).
Why does the description field matter so much?
The description tells Claude whether to load the skill for a task. If you summarize the skill's workflow in the description, Claude may follow that short summary instead of reading the full skill content. Keep descriptions focused only on triggering conditions.
How long should a skill be?
Getting-started workflows should be under 150 words; frequently-loaded skills under 200 words total; other skills under 500 words. Use cross-references and tool help flags to avoid repeating details that load into every conversation.

Generated from the current SKILL.md. These answers refresh after source changes.