agentleFS
DancinGhostDancinGhost/agent-metaskills/skills/skill-distill/SKILL.md

skill-distill

Skill1 starsChanged 3 days agoMITView on GitHub

Turns the workflow just completed in the current session into a reusable Agent Skill, capturing the steps that worked, the dead ends, the user's corrections and the verification into a new SKILL.md with supporting scripts. Use when the user says to save this as a skill, make a skill from this, remember how to do this next time or turn this into a reusable workflow, or after finishing a hard-won multi-step task that is likely to recur.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If it fails the test, say so and suggest the better home:

    line 32
  2. Distinctive:

    User corrections: Every time the user redirected the work.

    line 44
  3. Distinctive:

    If the session was compacted or the early part is no longer visible, say what is missing and ask the user to fill the gap.

    line 55
  4. Distinctive:

    Keep specifics that are true of the environment and not of the task, such as the test command for this repository.

    line 62
  5. Distinctive:

    Leave out anything a capable agent already knows.

    line 64
  6. Distinctive:

    Do not ship a script that was never run.

    line 79
  7. Distinctive:

    Start from assets/SKILL.template.md.

    line 88
  8. Very specific:

    If the skill-lint skill is installed, run it with --strict and fix what it reports.

    line 105
  9. Distinctive:

    Read the skill as an agent with no memory of this session.

    line 107
  10. Distinctive:

    If subagents are available, give one only the skill and a fresh instance of the task, and watch where it stalls.

    line 110

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

Skill distill

The most valuable skill content is what this session learned the hard way: the approach that failed, the flag that mattered, the correction the user had to make. That knowledge is in the conversation now and gone when it ends. This skill extracts it while it is still available.

1. Decide whether it should be a skill

A skill earns its place when all three hold:

  • It will recur. The same kind of task is likely to come up again.
  • It is not obvious. A capable agent starting cold would get it wrong, or get it right only after the same detours.
  • It is a procedure. There are steps, a decision or a check, not one fact.

If it fails the test, say so and suggest the better home:

What was learnedBetter home
One fact or preference ("use pnpm here")The project's agent instruction file, or memory
A rule that must hold every time, mechanicallyA hook, linter rule or CI check
A one-offNothing

2. Mine the session

Go back through the conversation and collect, in this order of value:

  1. User corrections. Every time the user redirected the work. Each is a mistake a future agent will repeat unless the skill prevents it.
  2. Dead ends. What was tried and abandoned, and the reason. Record as "do not do X, because Y; do Z".
  3. The path that worked. The steps in their final order, not the order they were discovered in.
  4. Exact commands and values that were fragile: a flag, a version, an order of operations, a path that had to be exactly so.
  5. How success was verified. The command or observation that proved it.
  6. Preconditions. Tools, access, state that had to be true first.

If the session was compacted or the early part is no longer visible, say what is missing and ask the user to fill the gap. Do not invent steps.

3. Generalise, carefully

  • Replace this session's specifics (file names, ticket numbers, branch names) with a description of the input.
  • Keep specifics that are true of the environment and not of the task, such as the test command for this repository.
  • Leave out anything a capable agent already knows. The skill holds what is particular to this workflow.
  • Match strictness to fragility. Where any reasonable approach works, state the goal. Where one exact sequence works and the others fail, give the exact sequence and say why.
  • Give the reason with each rule. An agent that knows why can handle the case the rule did not foresee.

4. Extract scripts

Anything that was run the same way more than once, or that must be run exactly right, becomes a script in the skill's scripts/ directory. The agent then runs it and does not retype it. A script must take its inputs as arguments, fail with a clear message and need no editing before use.

Do not ship a script that was never run. Run it once on the real case first.

5. Write the skill

Choose where it goes. A skill tied to one repository belongs in that repository's skills directory so the team gets it. A skill for the user's own habits belongs at user level. If the session does not make the choice clear, ask.

Start from assets/SKILL.template.md. Fill it in; delete sections that have nothing real to say.

For the description, which decides whether the skill is ever loaded:

  • First sentence: what it does, with a concrete verb and object.
  • Then "Use when ..." with the situations and the words a user would type. Take those words from how the user actually phrased the request in this session.
  • Third person. No summary of the steps; an agent that reads the steps in the description may follow that summary and skip the body.

Name: lowercase words joined by hyphens, the same as the directory, saying what it does (release-notes, not helper).

6. Check it

  1. If the skill-lint skill is installed, run it with --strict and fix what it reports.
  2. Read the skill as an agent with no memory of this session. For each step, ask: could it be done from the page alone? Every "it knows what I mean" is a gap.
  3. If subagents are available, give one only the skill and a fresh instance of the task, and watch where it stalls. That is the strongest test. Otherwise offer the user the choice to try it in a new session.

7. Hand over

Tell the user where the skill was written, what triggers it, what was left out on purpose, and what was not tested. If writing it revealed that an existing skill already covers part of this, say so and offer to extend that one.

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.