agentleFS
ychampionychampion/ystack/skills/agent-writing/SKILL.md

agent-writing

Skill4 starsChanged 2 days agoMITView on GitHub

Write instructions that agents actually follow: skills (name, description, trigger phrases, body), CLAUDE.md / AGENTS.md rule files, and briefs for subagents or other agents (objective, DONE criteria, verification, report shape). Covers what to cut, length budgets, examples over adjectives, and a pre-ship checklist. Use for a subagent or agent brief, a system prompt, trimming a rules file that has grown too long, or when an agent keeps ignoring an instruction. For the full style reference on writing skill and doc files, use `writing-for-agents`.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    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:

    Body: when it applies (and when to skip), the procedure as numbered steps, rules, output format.

    line 28
  2. Distinctive:

    Every line costs on every turn.

    line 35
  3. Distinctive:

    Put the exact command, path or pattern in the rule.

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Agent writing

An agent reads every word, every time, and acts on what is concrete. Vague text costs tokens on every run and still gets ignored. Write less, and make each line something the agent can do or check.

When it applies

  • Writing or editing a skill, a CLAUDE.md / AGENTS.md, a system prompt, or a brief for another agent.
  • An agent keeps skipping a rule: the wording is usually the bug.

Skills

  • Name: short, lowercase, hyphenated, a verb or a noun the user would say.
  • Description is the trigger. It is always loaded; the body loads only when it fires. Write what the skill does in one sentence, then "Use for/when" with the phrases a user really types and the situations that should fire it. One phrase per distinct case; drop synonyms.
  • Body: when it applies (and when to skip), the procedure as numbered steps, rules, output format. Each step ends on something checkable.
  • Budget: 40-150 lines. Push rare branches and long reference into a sibling file, named from the step that needs it ("for X, read ref/x.md").

Rule files (CLAUDE.md, AGENTS.md)

  • Every line costs on every turn. Keep only rules the agent would get wrong without them.
  • Each rule: the instruction, then a short why. The why lets the agent handle cases you didn't list.
  • Put the exact command, path or pattern in the rule. "Use bun" beats "prefer our package manager".
  • Move anything used rarely into a referenced file with a trigger line.

Briefs to another agent

The brief is all the agent knows. Include:

  1. Objective: one or two sentences, including why.
  2. Context: paths to read, what is already ruled out, constraints.
  3. DONE means: checkable criteria, e.g. "bun test passes and GET /x returns 200".
  4. Verification: the exact command to run and what to report from it.
  5. Limits: scope, files not to touch, iteration caps ("stop after 2 fix cycles and report").
  6. Report shape: outcome first, files changed, evidence, open items, assumptions made. Long output goes to a file; return the path.

Give the brief the facts, not your conclusion, when you want an independent view.

What to cut

  • Adjectives that ask for quality ("be thorough", "carefully", "high-quality"). Replace each with the check that would prove it.
  • Shouting (CAPS, "CRITICAL", "MUST") except for the one or two rules that really are hard limits.
  • Restating what the model already does by default.
  • Background and history the agent can't act on.
  • Duplicates: the same rule in two places drifts apart.

Examples over adjectives

One concrete example (a command, a filled-in template, a before/after) fixes behaviour better than a paragraph of description. Use a placeholder format like <path> so it isn't copied literally. Show a bad example only next to the good one.

Pre-ship checklist

  • Description says what it does and lists real trigger phrases.
  • Every step ends on something the agent can check.
  • Every "be X" adjective replaced by a check or an example.
  • No rule that the model would follow anyway.
  • Within the length budget; rare branches moved out.
  • Host-neutral if shared: "a subagent, if your host has them", no tool names from one product.
  • Tried once: give it to a fresh agent on a small real task, watch where it goes wrong, fix that line.

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.