brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Claude Code
$ npx -y skills add obra/superpowers --skill writing-skills --agent claude-code
Codex
$ npx skills add obra/superpowers --skill writing-skills -a codex -y
Cursor
$ npx skills add obra/superpowers --skill writing-skills -a cursor -y
Gemini CLI
$ npx skills add obra/superpowers --skill writing-skills -a gemini-cli -y
GitHub Copilot
$ npx skills add obra/superpowers --skill writing-skills -a github-copilot -y
OpenCode
$ npx skills add obra/superpowers --skill writing-skills -a opencode -y
Windsurf
$ npx skills add obra/superpowers --skill writing-skills -a windsurf -y
name: writing-skills description: Use when creating new skills, editing existing skills, or verifying skills work before deployment
**Writing skills IS Test-Driven Development applied to process documentation.**
**Personal skills live in your runtime's skills directory** (`~/.claude/skills/` on Claude Code) — see [codex-tools.md](../using-superpowers/references/codex-tools.md) or [gemini-tools.md](../using-superpowers/references/gemini-tools.md) for the path on those runtimes. Codex, Copilot CLI, and Gemini CLI all also recognize `~/.agents/skills/` as a cross-runtime alias.
You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
**Core principle:** If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.
**REQUIRED BACKGROUND:** You MUST understand superpowers:test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
**Official guidance:** For Anthropic's official skill authoring best practices, see references/anthropic-best-practices.md. This document provides additional patterns and guidelines that complement the TDD-focused approach in this skill.
A **skill** is a reference guide for proven techniques, patterns, or tools. Skills help future agents find and apply effective approaches.
**Skills are:** Reusable techniques, patterns, tools, reference guides
**Skills are NOT:** Narratives about how you solved a problem once
| TDD Concept | Skill Creation | |-------------|----------------| | **Test case** | Pressure scenario with subagent | | **Production code** | Skill document (SKILL.md) | | **Test fails (RED)** | Agent violates rule without skill (baseline) | | **Test passes (GREEN)** | Agent complies with skill present | | **Refactor** | Close loopholes while maintaining compliance | | **Write test first** | Run baseline scenario BEFORE writing skill | | **Watch it fail** | Document exact rationalizations agent uses | | **Minimal code** | Write skill addressing those specific violations | | **Watch it pass** | Verify agent now complies | | **Refactor cycle** | Find new rationalizations → plug → re-verify |
The entire skill creation process follows RED-GREEN-REFACTOR.
**Create when:**
**Don't create for:**
Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)
Way of thinking about problems (flatten-with-flags, test-invariants)
API docs, syntax guides, tool documentation (office docs)
skills/
skill-name/
SKILL.md # Main reference (required)
supporting-file.* # Only if needed**Flat namespace** - all skills in one searchable namespace
**Separate files for:** 1. **Heavy reference** (100+ lines) - API docs, comprehensive syntax 2. **Reusable tools** - Scripts, utilities, templates
**Keep inline:**
A skill's `description` says only when to use it: triggering conditions and symptoms, starting with "Use when...". It never summarizes the skill's workflow, because an agent that reads a workflow summary follows it instead of reading the skill.
When you write or change a skill's frontmatter, name or description, or need to cut its size, read [references/discovery.md](references/discovery.md): the SKILL.md template, description and keyword guidance, naming, token budgets, and cross-referencing other skills.
When you add or change a flowchart in a skill, read [references/flowcharts.md](references/flowcharts.md) first: when a flowchart earns its place, the graphviz conventions, and how to render one.
**One excellent example beats many mediocre ones**
Choose most relevant language:
**Good example:**
**Don't:**
You're good at porting - one great example is enough.
defense-in-depth/ SKILL.md # Everything inline
When: All content fits, no heavy reference needed
condition-based-waiting/ SKILL.md # Overview + patterns example.ts # Working helpers to adapt
When: Tool is reusable code, not just narrative
pptx/ SKILL.md # Overview + workflows pptxgenjs.md # 600 lines API reference ooxml.md # 500 lines XML structure scripts/ # Executable tools
When: Reference material too large for inline
Invoke bundled scripts through their interpreter in the prose (`bash scripts/tool.sh`, `node scripts/tool.js`), never by bare path: some harness plugin packagers strip executable bits, and a bare `scripts/tool.sh` fails there with `Permission denied`.
NO SKILL WITHOUT A FAILING TEST FIRST
This applies to NEW skills AND EDITS to existing skills.
Write skill before testing? Delete it. Start over.
Superpowers is a complete software development methodology for your coding agents, built on top of a set of composable skills and some initial instructions that make sure your agent uses them.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor…
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline…
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically…
Ask which skill or flow fits your situation. A router over the skills in this repo.
Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit…