agentleFS
LetermeFlorentLetermeFlorent/claude-skills/writing-skills/SKILL.md

writing-skills

Skill0 starsChanged 10 days agoMITView on GitHub

Use when a skill must be created, edited or reviewed, when the user types /write-skill, when a fail-then-success lesson should be kept as a skill, or when an existing skill does not trigger or gets skipped under pressure.

191 other projects use a version of this.

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 20 projects that use this

  • kntismSkill

    condition-based-waiting

    Use when tests have race conditions, timing dependencies, or inconsistent pass/fail behavior - replaces arbitrary timeouts with condition polling to wait for actual state changes, eliminating flaky tests from timing guesses

    Also in 3 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

  • frankxaiSkill

    defense-in-depth

    Use when invalid data causes failures deep in execution, requiring validation at multiple system layers - validates at every layer data passes through to make bugs structurally impossible

    Also in 3 projects that use this

  • +3 more from Leodorareluctant259

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 180 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No attribution to Claude or any AI tool anywhere in the folder, footer and front matter included.

    line 38
  2. Distinctive:

    Write the form that fits the failure, nothing for a case no run showed.

    line 81

“Common” is measured: kept by at least 6 in 10 of the 180 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

A skill is worth writing only for what an agent does wrong without it, so a baseline comes first: a fresh subagent runs a real task with no skill, and its exact choices and excuses are the material. If it already does the right thing there is no skill. If it fails, write the smallest text that answers that failure, rerun the same task with the skill, and close the loopholes the runs still show. A constraint a regex or a hook can enforce is a script or a hook, not a skill; the account of one session is not a skill.

Examples in <claude-skills> (the clone of this repository, ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/claude-skills): open the closest before writing.

Rules

These hold for a new skill, an edit, a remaster and a lesson alike.

  1. A baseline decides whether a skill exists. New skill: against no skill. Edit: against the current version, only when the edit changes what an agent does. A fail-then-success lesson from this session is its own baseline: write down the command, the output and the wrong belief word for word, then write the skill. A wrong path, name or command needs no baseline: run the thing it names. A draft written before the baseline is no evidence. A draft this run did not create is never deleted: ask.
  2. The description starts with "Use when" and lists triggers only: situations, symptoms, error text, the command (/name). Never steps: an agent that finds the procedure there follows the summary and skips the body. A skill that triggers too rarely gets more trigger words.
  3. "Tested" means a run happened in this session and you read its report. An optional ## What was tested section of README.md is written after the runs from what they did, failures and gaps included, never ahead of them. If the user asks to skip the tests: one sentence on what an untested skill costs, then AskUserQuestion with "Test before delivering (Recommended)" first; test until they answer. If they pick no tests, the section is ## Not tested yet.
  4. The skill name and the command the user will type are asked (recommended name first), even when the recommendation looks obvious: the user sees them in every list.
  5. A remaster, or a skill for the Desktop, goes to the folder the user names, ~/Desktop/SKILLS/<name>/ by default. The installed copy stays byte for byte, whatever a CONTRIBUTING file, template or reminder says.
  6. No attribution to Claude or any AI tool anywhere in the folder, footer and front matter included. Every file follows the strip-ai-traces skill, every script the clean-code skill.

Where it goes

The skillFolder
holds for one project only<repo>/.claude/skills/<name>/
holds for every project of the user~/.claude/skills/<name>/
is a remaster or a Desktop skillthe folder the user names
is one line of project conventionthat project's CLAUDE.md, no skill

Skills are not committed (.claude/ is tooling, which the clean-commits skill refuses) unless the user asks.

Folder

reference/format.md holds the skeletons, naming limits and script conventions.

  • SKILL.md in English: front matter (name = folder name, description), a # Title, then only what the skill needs. Aim for 150 lines, 500 is the limit.
  • README.md in English, for the user, in everyday words, never a translation of SKILL.md. It starts with a line pointing to INSTALL.md at the repository root, and may hold ## What was tested or ## Not tested yet.
  • commands/<command>.md only when the user starts the skill by hand: English, ASCII only, file name included. A lesson that fires on a situation has no command.
  • scripts/ with tests/test_pure.py, only where a script checks better than reading does (counts, formats, parsing, git state). Python 3 called with python -I, never crashing.
  • <role>-brief.md at the root when the skill sends subagents; reference/*.md for material that only some runs need, each named from SKILL.md with when to read it.

Procedure

One skill goes through the whole loop before the next one starts.

  1. Grill: say in one sentence how big the request reads, then ask only what the user alone decides, one question at a time (name and command, a real design choice).
  2. Classify: the folder, what the baseline runs against, the failures you expect. For an edit, find the current version first (~/.claude/skills/<name>/, $CLAUDE_CONFIG_DIR/skills/<name>/, the plugin cache); not found is a question for the user, never a baseline against nothing.
  3. Build the test material following reference/testing.md, on data already on disk and the current version's own examples (a sample made up by an agent who knows the traps passes for the wrong reason). Each scenario has a checklist of observable results with at least one line that splits old from new.
  4. Red: one fresh subagent per scenario, prompt from subject-brief.md, never a fork. Record what it chose and its excuses word for word. No failure on the real material: stop and tell the user, with the reports.
  5. Write the form that fits the failure, nothing for a case no run showed. A subject that breaks a rule under pressure: a prohibition that names the excuse. Right choices but wrong output shape: a recipe of the output and its parts. An element left out: a required slot in the template. Behaviour that depends on the case: a condition on something observable. Avoid "prefer" and "consider" for rules agents skip, and nuance clauses ("unless it matters"), which reopen the bargaining. Then python -I "<skill>/scripts/check_skill.py" <folder> until it refuses nothing.
  6. Green: the same scenarios with the skill; read each report against the checklist. Each new excuse is named and forbidden in the rule and its symptom added to the description. A subject that read the skill and still failed is asked why with the follow-up block of subject-brief.md. Repeat until nothing new comes up; a discipline skill ends on a pressure run.
  7. Close: write the tested section from the reports; run check_skill.py and the strip-ai-traces scan.py <folder> --no-git; with scripts, the unit tests and the clean-code measure. Delete the fixtures, check no subagent is left, and answer in the user's language: the folder, what the runs showed, what stays untested.

check_skill.py checks the front matter, description, size, local links, README.md, commands and the script rules. Its refused: lines must go, check: lines get a look.

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.