A skill is a directory containing a SKILL.md file. M31A shows the skill's name and description to the model, then loads the full Markdown body only when the model calls activate_skill. This keeps routine tasks out of the system prompt until they are needed.
Prerequisites
- M31A installed and authenticated.
- Familiarity with the Skills guide.
1. Choose a scope
| Scope | Location | Use case |
|---|---|---|
| User | ~/.m31a/skills/<name>/SKILL.md | Personal workflows across projects. |
| Workspace | <project>/.m31a/skills/<name>/SKILL.md | Project-specific conventions. |
| Extension | <extension>/skills/<name>/SKILL.md | Distributed with other assets. |
Discovery precedence is built-in, extensions, user, workspace; later scopes can override earlier ones by name. Workspace skills are skipped when the folder is not trusted. This tutorial uses a workspace skill.
2. Write the skill
mkdir -p .m31a/skills/commit-styleCreate .m31a/skills/commit-style/SKILL.md:
---
name: commit-style
description: Write conventional commit messages for this repository, including scope and a short imperative summary.
---
# Commit style
Use this skill when asked to write or review a commit message.
1. Read the staged diff with read-only tools.
2. Produce a header of the form `type(scope): summary`.
3. Use one of: feat, fix, docs, refactor, test, chore, build, ci.
4. Keep the summary under 72 characters and in the imperative mood.
5. Add a body only when the *why* is not obvious from the header.
6. Never include secrets or generated lockfile noise.The description is the activation signal: it should say both what the skill does and when to use it. The body should contain the procedure, not restate the description.
Front matter rules
The bundled validator in packages/core/src/skills/builtin/skill-creator/scripts/validate_skill.cjs enforces:
- the file must start with
---and contain a closing---; namemust be hyphen-case (^[a-z0-9-]+$);descriptionmust be a single-line string, at most 1024 characters;- unresolved
TODO:markers produce a warning.
skillLoader.ts reads only name and description. Extra front matter fields are not used for activation.
3. Install and inspect
If you created the skill directly in .m31a/skills/, no install step is needed. For a skill stored elsewhere, link it:
m31a skills list --all
m31a skills link /path/to/commit-style
m31a skills enable commit-styleInside the TUI, use /skills list, /skills reload, and /skills enable|disable <name>.
skills.enabled defaults to true; skills.disabled is a list of names to skip, and admin.skills can restrict skills further. Check that your skill is not disabled:
{
"skills": {"enabled": true, "disabled": []}
}4. Verify activation
Start a session and ask a question that matches the description:
m31a -p "Stage nothing. Just propose a conventional commit message for the staged diff using your commit-style skill."To confirm the skill body was actually loaded, ask the agent to follow a detail that exists only in the body, for example:
Which commit types does the commit-style skill allow, and what is the summary length limit?The correct answer must mention the type list and 72 characters. If the agent guesses instead, refine the description so the activation signal is clearer.
Use /tools desc to confirm activate_skill is present in the session. If it is missing, check tools.exclude and tools.core.
5. Add bundled resources (optional)
A skill directory may include:
commit-style/
SKILL.md
scripts/ deterministic helpers
references/ docs loaded on demand
assets/ templates used in outputThe body can instruct the agent to run node scripts/check_message.cjs for deterministic validation. Scripts should print concise, LLM-friendly stdout and avoid stack traces. Treat every bundled script as executable code and review it before enabling the skill.
6. Validate before sharing
The built-in skill-creator skill ships the validator script:
node packages/core/src/skills/builtin/skill-creator/scripts/validate_skill.cjs \
.m31a/skills/commit-styleA valid skill exits successfully with a confirmation message. To distribute it, move the directory under an extension's skills/ folder; see Custom extension.
7. Troubleshooting
| Symptom | Cause and fix |
|---|---|
| Skill not listed | Check the directory path and m31a skills list --all. |
| Activation never happens | Make the description more specific about when to use it. |
| Body seems ignored | The model may not have called activate_skill; ask it explicitly. |
| Overridden by another skill | Later scopes win; check extension and workspace copies. |
| Disabled by policy | Check skills.disabled and admin.skills. |
Next steps
- Read Skills for all CLI commands.
- Read Extension model for discovery precedence.
- Add a custom hook to log when skills are activated.