Get the FREE Ultimate OpenClaw Setup Guide →

writing-skills

npx machina-cli add skill ed3dai/ed3d-plugins/writing-skills --openclaw
Files (1)
SKILL.md
4.9 KB

Writing Skills

REQUIRED BACKGROUND: Read ed3d-extending-claude:writing-claude-directives for foundational guidance on token efficiency, discovery optimization, and compliance techniques. This skill focuses on TDD methodology specific to skill creation.

Core Principle

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

Write test cases (pressure scenarios), watch them fail (baseline behavior), write the skill, watch tests pass, refactor (close loopholes).

Iron Law: No skill without a failing test first. Same as TDD for code.

TDD Mapping

TDD ConceptSkill Creation
Test casePressure scenario with subagent
Production codeSKILL.md document
REDAgent violates rule without skill
GREENAgent complies with skill present
RefactorClose loopholes, re-test

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 documented elsewhere
  • Project-specific conventions (use CLAUDE.md)

Skill Types

Technique: Concrete method with steps (condition-based-waiting, root-cause-tracing)

Pattern: Mental model for problems (flatten-with-flags, test-invariants)

Reference: API docs, syntax guides, tool documentation

Directory Structure

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

Separate files for: Heavy reference (100+ lines), reusable tools/scripts

Keep inline: Principles, code patterns (<50 lines), everything else

SKILL.md Template

---
name: Skill-Name-With-Hyphens
description: Use when [triggers/symptoms] - [what it does, third person]
---

# Skill Name

## Overview
Core principle in 1-2 sentences.

## When to Use
Symptoms and use cases. When NOT to use.

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

## Quick Reference
Table or bullets for scanning.

## Common Mistakes
What goes wrong + fixes.

RED-GREEN-REFACTOR Cycle

RED: Baseline Test

Run pressure scenario WITHOUT skill:

  1. Create combined pressures (time + sunk cost + exhaustion)
  2. Document exact violations and rationalizations verbatim
  3. Identify failure patterns

GREEN: Write Minimal Skill

  1. Address specific baseline failures identified in RED
  2. Run scenarios WITH skill
  3. Verify compliance

REFACTOR: Close Loopholes

  1. Find NEW rationalizations from testing
  2. Add explicit counters
  3. Re-test until bulletproof

REQUIRED: Use ed3d-extending-claude:testing-skills-with-subagents for complete methodology.

Testing by Skill Type

TypeTest ApproachSuccess Criteria
DisciplinePressure scenarios, combined stressorsFollows rule under maximum pressure
TechniqueApplication scenarios, edge casesSuccessfully applies to new scenario
PatternRecognition + counter-examplesKnows when/how and when NOT to apply
ReferenceRetrieval + application testsFinds and correctly uses information

Common Rationalizations to Block

ExcuseReality
"Obviously clear"Clear to you ≠ clear to agents. Test.
"Just a reference"References have gaps. Test retrieval.
"Testing is overkill"Untested skills have issues. Always.
"Too simple"Simple things break. Test anyway.
"No time"Fixing broken skills wastes more time.

All mean: Test before deploying.

Anti-Patterns

  • Narrative example: "In session 2025-10-03, we found..." (too specific, not reusable)
  • Multi-language dilution: example-js.js, example-py.py (mediocre quality, maintenance burden)
  • Code in flowcharts: Can't copy-paste, hard to read
  • Generic labels: helper1, step3 (labels need semantic meaning)

Skill Creation Checklist

IMPORTANT: Use TaskCreate to track each item (or TodoWrite in older Claude Code versions).

RED Phase:

  • Create pressure scenarios (3+ combined pressures for discipline skills)
  • Run WITHOUT skill - document baseline failures verbatim
  • Identify rationalization patterns

GREEN Phase:

  • Name uses letters, numbers, hyphens only
  • Description starts with "Use when...", third person
  • Address specific baseline failures
  • One excellent example (not multi-language)
  • Run WITH skill - verify compliance

REFACTOR Phase:

  • Identify new rationalizations
  • Add explicit counters
  • Re-test until bulletproof

Deployment:

  • Commit and push
  • Consider contributing via PR

Source

git clone https://github.com/ed3dai/ed3d-plugins/blob/main/plugins/ed3d-extending-claude/skills/writing-skills/SKILL.mdView on GitHub

Overview

Writing Skills applies test-driven development to process documentation. It uses pressure scenarios and subagents to test before writing, iterating until all rationalizations are blocked. This discipline helps ensure new and updated skills deploy without hidden loopholes.

How This Skill Works

Start with a RED baseline test run without the skill to reveal violations. Then implement a minimal SKILL.md and run tests with subagents to confirm behavior. Finally, REFACTOR to close loopholes and re-test until bulletproof, following the RED-GREEN-REFACTOR cycle and the methodology in ed3d-extending-claude:testing-skills-with-subagents.

When to Use It

  • Creating a new skill from scratch
  • Editing or updating an existing skill
  • Verifying skill behavior before deployment
  • Testing skill resilience with subagents under pressure
  • Documenting process patterns and references for consistency

Quick Start

  1. Step 1: Define a pressure scenario and the expected compliant behavior
  2. Step 2: Run a RED baseline test without the skill to surface violations
  3. Step 3: Implement the minimal SKILL.md, run tests with subagents, then refactor until green

Best Practices

  • Define pressure scenarios before writing the skill
  • Run a baseline RED test without the skill to capture violations
  • Code or document the minimal skill to pass GREEN tests
  • Re-test across scenarios and close loopholes during REFACTOR
  • Keep SKILL.md concise and move heavy references to supporting files

Example Use Cases

  • Create a new skill for a CLAUDE extension by testing with subagents before writing the SKILL.md
  • Update an existing skill after uncovering a new rationalization and re-running tests
  • Document a process using the SKILL.md template to ensure consistency across teams
  • Conduct a RED baseline test to reveal where a skill would fail without implementation
  • Refactor after testing to close loopholes and re-test under multiple scenarios

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers