Get the FREE Ultimate OpenClaw Setup Guide →

writing-skills

npx machina-cli add skill oryanmoshe/agent-skills/writing-skills --openclaw
Files (1)
SKILL.md
4.3 KB

Writing Skills

Overview

A skill is a SKILL.md file that teaches an AI agent a specific technique, workflow, or discipline. This skill defines how to write them well — with proper naming, trigger-rich descriptions, tested content, and no bloat.

Skill Structure

skills/
  skill-name/
    SKILL.md              # Required — the skill itself
    supporting-file.md    # Optional — only for heavy reference (100+ lines)

Every skill is a single folder under skills/ containing a SKILL.md with YAML frontmatter.

SKILL.md Format

---
name: skill-name-in-gerund-form
description: [WHAT it does] + [WHEN to use it]. Be specific about triggers.
---

# Skill Title

## Overview
Core principle in 1-2 sentences.

## [Core content — rules, patterns, workflow]

## Red Flags — STOP
Table of rationalizations and correct actions.

## Anti-Patterns
Common mistakes to avoid.

Naming Rules

Use gerund form (verb + -ing) per Anthropic guidelines:

GoodBad
tracking-taskstask-tracker
reviewing-codecode-reviewer
exploring-in-parallelparallel-exploration
preserving-contextcontext-preservation
committing-codecommit-helper

Hard constraints:

  • Lowercase letters, numbers, and hyphens only
  • Maximum 64 characters
  • Cannot contain anthropic or claude
  • Folder name must match the name field

Writing the Description

The description field is the only thing Claude sees before deciding to load your skill. It must include:

  1. WHAT the skill does (third person): "Reviews code changes for bugs..."
  2. WHEN to use it: "Use when reviewing PRs, before committing..."
  3. Trigger keywords users would naturally say: "commit", "review", "fix comments"
# GOOD — specific triggers, clear purpose
description: Reviews code changes for bugs, performance issues, and security problems. Use when reviewing PRs, before committing, or when user asks to review or check code.

# BAD — vague, no triggers
description: Helps with code quality.

# BAD — describes workflow (Claude will shortcut the body)
description: Fetches PR, groups comments, presents summary, lets user select fixes.

Critical: Never summarize the skill's workflow in the description. Claude may follow the description shortcut instead of reading the full skill body.

What NOT to Include

  • No installation section — skills auto-discover via the description field
  • No "When to Use" body section — this belongs in the description (body loads AFTER triggering)
  • No README or changelog — keep it to SKILL.md and optional reference files
  • No hook setup — hooks are a separate system, not part of skills

Checklist Before Done

  1. Name is gerund form, hyphens only, matches folder name
  2. Description includes WHAT + WHEN + trigger keywords, under 1024 chars
  3. Content is self-contained, concise, actionable
  4. No installation section, no "When to Use" body section
  5. Tested with a clean subagent — does the agent understand and follow the skill correctly?
  6. Committed with gitmoji conventional commit (see committing-code skill — it handles README/AGENTS.md update checks)

Testing with a Subagent

Before marking a skill as done, launch a test subagent:

Task tool with subagent_type="general-purpose":
  "Read [skill path] and evaluate:
  1. Description quality (WHAT + WHEN + triggers, third person, <1024 chars)
  2. Naming (gerund form)
  3. No installation section
  4. Completeness — any gaps?
  5. Token efficiency — any redundancy?"

Use model=haiku for fast, cheap testing. Fix issues found, then commit.

Token Budget

Skills should be concise — every token counts when loaded into context:

  • Aim for under 300 lines for most skills
  • Use tables over prose for reference data
  • Cut redundancy between Red Flags and Anti-Patterns sections
  • Reference other skills by name instead of repeating their content

Source

git clone https://github.com/oryanmoshe/agent-skills/blob/main/skills/writing-skills/SKILL.mdView on GitHub

Overview

This skill teaches how to create and edit SKILL.md files following Anthropic best practices and repo conventions. It covers proper naming, trigger-rich descriptions, required sections, and quality checks to ensure consistent, high-quality skills across the repo.

How This Skill Works

It prescribes YAML frontmatter with name and description, a standard SKILL.md format, and sections such as Overview, core content, Red Flags, and Anti-Patterns. It emphasizes gerund forming for names, including WHAT and WHEN in the description with trigger keywords, and avoiding workflow summaries. It also guides testing with a subagent and following the skill checklist.

When to Use It

  • When creating a new skill from scratch to ensure proper structure
  • When editing an existing skill to improve clarity or quality
  • When porting a skill from another source to conform to naming and frontmatter rules
  • When reviewing skill quality to catch red flags and anti-patterns
  • When refactoring triggers or folder structure under skills to maintain consistency

Quick Start

  1. Step 1: Create YAML frontmatter with name and description that reflect WHAT, WHEN and triggers
  2. Step 2: Add required sections (Overview, Core content, Red Flags, Anti-Patterns) in the SKILL.md
  3. Step 3: Run the test subagent and complete the checklist before committing

Best Practices

  • Use gerund form for the skill name and ensure it matches the folder name
  • Write a clear description that states WHAT, WHEN, and includes trigger keywords
  • Keep frontmatter minimal and accurate; avoid installation or unrelated sections
  • Limit the SKILL.md content to self-contained sections: Overview, core content, Red Flags, Anti-Patterns
  • Validate with a subagent test and follow the checklist before committing

Example Use Cases

  • Create a new writing-skills SKILL.md with proper frontmatter and a precise description
  • Edit an existing skill to adjust triggers and readability of the description
  • Port a skill from another source while aligning naming and frontmatter to repo rules
  • Review a skill for Red Flags and Anti-Patterns to improve quality
  • Run the subagent test to verify that the agent understands and follows the skill

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers