Writing skills

From oyi77/1ai-skills · View interactive version

Writing skills is an AI agent skill from the GitHub repository oyi77/1ai-skills. Use when creating new skills, editing existing skills, or verifying skills work before deployment

How to use this skill

Skill file

Writing Skills

Overview

Writing skills IS Test-Driven Development applied to process documentation.

Anti-Rationalization Table

| Rationalization | Reality |

|---|---|

| "I'll figure it out as I go" | A structured approach saves time and reduces errors. Follow the workflow in this skill rather than improvising. |

| "I already know this topic" | Familiarity breeds shortcuts. Use the checklist to verify you haven't missed critical steps. |

| "This doesn't apply to my situation" | The patterns here generalize across contexts. Adapt, don't skip — the underlying principles hold. |

| "One more tool will fix it" | Adding complexity rarely solves process gaps. Master the core workflow first. |

When to Use

Trigger phrases:

When NOT to Use

Quick Reference

TDD Cycle: RED → GREEN → REFACTOR

Common Mistakes

What is a Skill?

A skill is a reference guide for proven techniques, patterns, or tools.

Skills are: Reusable techniques, patterns, tools

Skills are NOT: Narratives about one-off solutions

TDD Mapping

| TDD | Skills |

|-----|--------|

| Test case | Pressure scenario |

| RED | Agent violates without skill |

| GREEN | Agent complies with skill |

| Refactor | Close loopholes |

SKILL.md Structure

Frontmatter:

---
name: skill-name
description: Use when [specific triggering conditions]
---

Required sections:

Common Mistakes

What goes wrong + fixes

Real-World Impact (optional)

Concrete results



## Claude Search Optimization (CSO)

**Critical for discovery:** Future Claude needs to FIND your skill

### 1. Rich Description Field

**Purpose:** Claude reads 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..." - trigger only, NOT workflow

**CRITICAL:** Description = When to Use, NOT What It Does

❌ BAD: Summarizes workflow

description: Use when executing plans - dispatches subagent with code review

✅ GOOD: Just triggering conditions

description: Use when executing implementation plans with independent tasks


**Content:**
- Use concrete triggers and situations
- Describe the problem, not language-specific symptoms
- Keep triggers technology-agnostic unless skill is tech-specific
- Write in third person (injected into system prompt)

**Name by what you DO:**
- ✅ `condition-based-waiting` > `async-test-helpers`
- ✅ `root-cause-tracing` > `debugging-techniques`

**Cross-reference skills explicitly:**
- ✅ `REQUIRED: Use superpowers:test-driven-development`
- ❌ Avoid @ links (force-loads, burns context)

Use flowcharts ONLY for:

Flowcharts & Examples

File Organization

The Iron Law

NO SKILL WITHOUT A FAILING TEST FIRST

Write skill before testing? Delete it. Start over.

Testing Skill Types

Discipline skills (TDD, verification):

Technique skills (how-to):

Pattern skills (mental models):

Reference skills (APIs):

Success criteria: Agent finds and correctly applies reference information

Common Rationalizations

| Excuse | Reality |

|--------|---------|

| "Obviously clear" | Clear to you ≠ clear to agents. Test it. |

| "Testing is overkill" | Untested skills have issues. Always. |

| "No time to test" | Untested wastes more time later. |

Bulletproofing Skills

Close every loophole explicitly:

This cuts off entire class of "I'm following the spirit" rationalizations.

Build Rationalization Table

Capture rationalizations from baseline testing:

| Excuse | Reality |

|--------|---------|

| "Too simple to test" | Simple code breaks |

| "I'll test after" | Tests passing proves nothing |

Red Flags List

## Red Flags - STOP
- Code before test
- "I already manually tested"
- "This is different because..."

RED-GREEN-REFACTOR for Skills

RED: Baseline

Run scenario WITHOUT skill. Document:

This is "watch the test fail" - you must see what agents naturally do before writing the skill.

GREEN: Write Minimal Skill

Write skill addressing those rationalizations. Run with skill - agent should comply.

REFACTOR: Close Loopholes

Agent found new rationalization? Add explicit counter. Re-test until bulletproof.

Anti-Patterns

Don't:

Skill Creation Checklist

RED Phase:

GREEN Phase:

REFACTOR Phase:

Red Flags

Verification

After completing this skill, confirm:

Process

  1. Analyze the task requirements
  2. Apply domain expertise
  3. Verify output quality
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.