agentleFS
justincordovajustincordova/agents/skills/writing-skills/SKILL.md

writing-skills

Skill1 starsChanged 4 months agoMITView on GitHub

Use when creating new skills, editing existing skills, or improving skill quality

191 other projects use a version of this, 3 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Leodorareluctant259Skill

    chinese-code-review

    中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈

    Also in 8 projects that use this

  • Leodorareluctant259Skill

    chinese-commit-conventions

    中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化

    Also in 8 projects that use this

  • obraSkill

    diagnosing-superpowers

    Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

    Also in 22 projects that use this

  • aaddrickSkill

    writing-agents

    Use when creating new agents, editing existing agents, or defining specialized subagent roles for the Task tool

    Also in 3 projects that use this

  • AWSSkill

    condition-based-waiting

    Replace arbitrary sleeps in tests with polling for the ACTUAL condition — a waitFor(() => predicate, description, timeoutMs) helper that polls every 10 ms, calls the getter inside the loop (no stale cache), and throws a clear error on timeout. Use when a test uses setTimeout / sleep / time.sleep, is flaky (passes on fast machines, fails under load or in CI), times out when run in parallel, or waits for an async operation, event, state, count, or file to appear. Do NOT use when the test genuinely exercises timing behavior (debounce / throttle) — then wait for the triggering condition FIRST and comment WHY the timed wait is justified. Trigger on "flaky test", "race condition in tests", "why does this pass locally and fail in CI", or any `await new Promise(r => setTimeout(r, N))` in a test.

    Also in 3 projects that use this

  • MicrosoftSkill

    using-skills

    Describes how to use abilities. Read before any conversation.

    Also in 4 projects that use this

  • +3 more from Leodorareluctant259

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. 0 are common, 13 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 181 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep supporting files only for heavy reference (100+ lines) or reusable tools/scripts.

    line 37
  2. Distinctive:

    Start with "Use when..."

    line 75
  3. Distinctive:

    Write in third person

    line 77
  4. Very specific:

    Keep under 500 characters (hard limits: 1,024 in the Agent Skills spec.

    line 78
  5. Distinctive:

    Use cross-references instead of repeating content

    line 125
  6. Very specific:

    Keep SKILL.md under 500 lines.

    line 138
  7. Very specific:

    All reference files should link directly from SKILL.md.

    line 148
  8. Distinctive:

    Before writing guidance, name the failure you're fixing.

    line 156
  9. Distinctive:

    Before deploying a skill, verify it works:

    line 171
  10. Distinctive:

    Run a fresh-context sample with the realistic surrounding context (the full skill, not the line in isolation) and a task that tempts the …

    line 177
  11. Distinctive:

    Always run a no-guidance control.

    line 178
  12. Distinctive:

    Run 5+ reps per variant and read every result yourself.

    line 179
  13. Distinctive:

    Start a fresh session with the skill loaded

    line 182
  14. Distinctive:

    Create a scenario where following the skill is costly (time, effort, rework)

    line 187
  15. Distinctive:

    Add realistic pressures: deadlines, sunk cost, authority figures

    line 188
  16. Distinctive:

    If the session fails, the skill needs stronger language, explicit counters for the rationalizations you observed, or clearer structure.

    line 192
  17. Very specific:

    Create skills/<name>/SKILL.md, with name: equal to <name>.

    line 246
  18. Very specific:

    Add a | <name> | … | row to the Skills table in README.md — CI fails without it.

    line 247
  19. Very specific:

    Run ./scripts/validate.sh, then ./install.sh to link the new skill.

    line 249

“Common” is measured: kept by at least 6 in 10 of the 181 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Writing Skills

Overview

Skills are reference guides for proven techniques and patterns. They help future sessions find and apply effective approaches. Write them to be discovered, not just read.

Core principle: A skill is only useful if a future session can find it and follow it. Optimize for discovery first.

When to Create a Skill

Create when:

  • Technique wasn't intuitively obvious
  • You'd reference this across projects
  • Pattern applies broadly
  • Others would benefit

Don't create for:

  • One-off solutions
  • Standard practices well-documented elsewhere
  • Project-specific conventions (put in AGENTS.md)
  • Things enforceable by tooling (linters, compilers)

Directory Structure

skills/
  skill-name/
    SKILL.md              # Main reference (required)
    supporting-file.*     # Only if needed

Keep supporting files only for heavy reference (100+ lines) or reusable tools/scripts. Everything else stays inline.

SKILL.md Structure

---
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
Bullet list with symptoms and use cases.
When NOT to use.

## Core Pattern
Before/after comparison or key pattern.

## Quick Reference
Table or bullets for scanning common operations.

## Implementation
Inline code for simple patterns.
Link to file for heavy reference.

## Common Mistakes
What goes wrong + fixes.

Writing Good Descriptions

The description field is the most important part of your skill. It's what sessions use to decide whether to load your skill.

Rules:

  • Start with "Use when..."
  • Include specific triggers, symptoms, situations
  • Write in third person
  • Keep under 500 characters (hard limits: 1,024 in the Agent Skills spec; Claude Code truncates description + when_to_use at 1,536 in its listing)
  • Say what the skill covers and when to use it, but don't spell out its step-by-step process

Why no step-by-step in description: Testing showed that when descriptions summarize the workflow, sessions follow the description instead of reading the full skill. The description becomes a shortcut that skips the actual instructions. Naming the output ("produces a design doc") is fine; listing the steps that get there is not.

# BAD: Summarizes workflow
description: Use when executing plans - dispatches subagent per task with code review

# GOOD: Just triggering conditions
description: Use when executing implementation plans with independent tasks

# BAD: Too vague
description: Helps with async testing

# GOOD: Specific triggers
description: Use when tests have race conditions, timing dependencies, or pass/fail inconsistently

Naming Conventions

  • name must equal the directory name. OpenCode derives the skill ID from the path (name is only a display label), Claude Code uses it as the /command, and validate.sh enforces the match.
  • Lowercase kebab-case, 1–64 characters: ^[a-z0-9]+(-[a-z0-9]+)*$
  • Short and action-oriented: plan, code-review, condition-based-waiting — not async-helpers
  • Pick a unique name: a skill named like a built-in (plan, code-review) replaces that built-in in Claude Code

Frontmatter

Unknown fields are ignored by both tools, so tool-specific fields are safe to include.

FieldClaude CodeOpenCodeUse
name✓display labelRequired here; must match the directory
description✓✓Required — without it OpenCode doesn't advertise the skill
disable-model-invocation: true✓✓User-invoked only (e.g. /sync-docs); the model won't auto-load it
when_to_use✓—Extra trigger text, counted with description
allowed-tools✓—Pre-approved tools while the skill is active
argument-hint✓—Hint shown after /name

Content Guidelines

Be Concise

The context window is shared. Every token competes with conversation history.

  • Assume the model is smart — don't explain basics
  • One excellent example beats many mediocre ones
  • Use cross-references instead of repeating content
  • Challenge each paragraph: "Does this justify its token cost?"

Set Appropriate Freedom

Match specificity to the task's fragility:

  • High freedom (general direction): Multiple valid approaches, context-dependent decisions
  • Medium freedom (patterns with parameters): Preferred pattern exists, some variation OK
  • Low freedom (exact scripts): Fragile operations, consistency critical, specific sequence required

Progressive Disclosure

Keep SKILL.md under 500 lines. Split into separate files when approaching that limit.

skill-name/
  SKILL.md          # Overview + patterns (loaded when triggered)
  reference.md      # API docs (loaded as needed)
  examples.md       # Usage examples (loaded as needed)
  scripts/          # Executable tools (executed, not loaded)

All reference files should link directly from SKILL.md. Keep references one level deep — no chains of files referencing files.

For Longer Reference Files

Include a table of contents at the top so partial reads still reveal the full scope.

Match the Form to the Failure

Before writing guidance, name the failure you're fixing. The form that fixes one failure type backfires on another.

FailureRight formWrong form
Knows the rule, breaks it under pressureProhibition + the rationalizations to rejectSoft guidance ("prefer…", "consider…")
Complies, but the output has the wrong shapePositive recipe: state what the output IS — its parts, in orderProhibition list ("don't restate", "never narrate")
Omits a required elementA required slot in the template they fill inProse reminders near the template
Behavior should depend on a conditionConditional on something observable ("if a design doc exists, read it")Unconditional rule + exemption clauses

Whichever form you pick, avoid nuance clauses: "Don't X unless it matters" reopens the negotiation. Express a real exception as its own conditional. Exemption clauses ("this limit doesn't apply to code blocks") don't scope reliably — restructure so the rule can't reach the exempt part.

Adapted from obra/superpowers.

Testing Skills

Before deploying a skill, verify it works:

Micro-Test the Wording

For guidance meant to change behavior, test the wording before running full scenarios:

  1. Run a fresh-context sample with the realistic surrounding context (the full skill, not the line in isolation) and a task that tempts the failure.
  2. Always run a no-guidance control. If the control doesn't show the failure, there's nothing to fix — don't write the guidance.
  3. Run 5+ reps per variant and read every result yourself. When wording lands, reps converge on the same shape; five different interpretations means it isn't binding yet.

Quick Test

  1. Start a fresh session with the skill loaded
  2. Give it a realistic task that should trigger the skill
  3. Observe: Did it find the skill? Did it follow it correctly?

Pressure Test (for discipline-enforcing skills)

  1. Create a scenario where following the skill is costly (time, effort, rework)
  2. Add realistic pressures: deadlines, sunk cost, authority figures
  3. Force an explicit A/B/C choice
  4. Observe: Does the session follow the rule under pressure?

If the session fails, the skill needs stronger language, explicit counters for the rationalizations you observed, or clearer structure.

Iteration

  1. Observe real usage with the skill
  2. Note where sessions struggle or ignore instructions
  3. Refine based on observed behavior, not assumptions

Common Patterns

Workflow Pattern

Break complex operations into sequential steps. Use checklists that sessions can track.

## Workflow

Progress:
- [ ] Step 1: Analyze inputs
- [ ] Step 2: Create plan
- [ ] Step 3: Validate
- [ ] Step 4: Execute
- [ ] Step 5: Verify

Feedback Loop Pattern

For quality-critical tasks, run validator -> fix errors -> repeat.

## Process

1. Make changes
2. Validate: `python validate.py`
3. If errors: fix and go to step 2
4. Only proceed when validation passes

Template Pattern

Provide output templates. Match strictness to need — exact format for APIs, flexible guidance for analysis.

Anti-Patterns

Don'tWhy
Narrative storytellingNot reusable
Multi-language examplesMediocre quality, maintenance burden
Code in flowchartsCan't copy-paste, hard to read
Generic labels (step1, helper2)Labels should have meaning
Time-sensitive infoWill become outdated
Inconsistent terminologyConfusing
Deep reference chainsPartial reads miss information

In This Repo

Skills live in ~/agent (this config repo) and are symlinked into both tools:

  1. Create skills/<name>/SKILL.md, with name: equal to <name>.
  2. Add a | **<name>** | … | row to the Skills table in README.md — CI fails without it.
  3. Optional: add commands/<name>.md ("Load the <name> skill…") for an OpenCode slash command. Claude Code already exposes every skill as /<name>.
  4. Run ./scripts/validate.sh, then ./install.sh to link the new skill.
  5. Third-party skills are vendored, not hand-written: add them to scripts/update-vendored-skills.sh and THIRD_PARTY.md, and don't edit the copies.

Checklist

Before deploying:

  • Description starts with "Use when..." with specific triggers
  • Description in third person, no step-by-step summary
  • Name matches the directory, lowercase kebab-case
  • Guidance form matches the failure type
  • Overview is 1-2 sentences with core principle
  • One excellent example (not multi-language)
  • Common mistakes section
  • SKILL.md under 500 lines
  • Supporting files only for tools or heavy reference
  • References one level deep from SKILL.md
  • Tested with a realistic task

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.