How to add a skill
This guide shows how to give the agent a new markdown procedure that the model can load with read_skill. It assumes you know what task the procedure should cover.
Steps
-
Create the skill in the skills directory (
skills/by default, seeskillsDir), in either layout: a flat fileskills/<name>.md, or a directory per skillskills/<name>/SKILL.md(the layout of the shipped examples). The two can be mixed; any other file in a skill's directory is ignored.cat > skills/go-test.md <<'EOF2' --- name: go-test description: run the Go tests of the current module and report failures --- # Run the Go tests Run `go test ./...` with your `bash` tool, then report the failing packages, if any. EOF2 -
Give it a
name:and a one-linedescription:in the front matter. The description is what the model reads in theread_skilltool description to pick a skill; without one it chooses blindly. -
Restart
mm. The catalogue is built once at start-up. The banner'sskills: Ncounter goes up by one, andread_skillappears in thetools:list if it was absent. -
Ask for the task in the terminal. The system prompt in
agent.yamltells the model to callread_skillfirst for any request that matches the catalogue; a📖 read_skill: go-testline confirms it did.
Variants
- Another directory. Set
skillsDirin the YAML. In the terminal a relative path is resolved from the directory you startmmin, so an installedmmrun inside a project loads that project's skills; in ACP mode with a config file it is resolved next to that file. The banner prints[warning: no skills found in <absolute path> …]when the resolved directory yields nothing. - No skills at all. Leave the directory empty or absent:
read_skillis then not declared, and the model never sees it. - The shipped examples. The repository ships
skills/greetings/SKILL.md,skills/vulcan-salute/SKILL.mdandskills/what-time-is-it/SKILL.md. Startmmfrom the repository root and the banner showsskills: 3.
See also
- The fields the front matter accepts: skill file format
- What
read_skillreturns to the model: built-in tools
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|