with one click
skill-authoring
// Author SKILL.md skills: frontmatter, validator limits, structure.
// Author SKILL.md skills: frontmatter, validator limits, structure.
| name | skill-authoring |
| description | Author SKILL.md skills: frontmatter, validator limits, structure. |
| version | 1.0.0 |
| tags | ["skills","authoring","skill-md","conventions","meta"] |
| author | ported |
A skill is a SKILL.md file โ YAML frontmatter plus a markdown body of reusable instructions. There are two places a SKILL.md can live, and they have different creation paths:
mateclaw-server/src/main/resources/skills/<name>/SKILL.md โ committed, shipped inside the server JAR. On every startup BuiltinSkillSeedService scans classpath*:skills/*/SKILL.md, parses each frontmatter, and upserts a row into mate_skill keyed by name. The SKILL.md is the single source of truth โ no SQL seed entry is required.skill_manage tool. Stored as a mate_skill row with skill_type=custom and exported to the workspace at ~/.mateclaw/skills/<name>/. Not committed; lives per-installation.This skill covers both. Note that skill_manage does NOT write into the in-repo skills/ tree โ builtin skills are authored by writing the file directly and restarting.
mateclaw-server/src/main/resources/skills/.skill_manage.Don't use for: recording a one-off tip discovered while using a skill (that belongs in record_lesson / a per-skill LESSONS.md) or cross-skill memory notes (remember). This skill is about writing the skill document itself.
The frontmatter is parsed by SkillFrontmatterParser: a regex (^---\s*\n(.*?)\n---\s*\n(.*)$) splits the fenced block, then SnakeYAML loads it as a mapping. Hard requirements:
--- as the first bytes โ no leading blank line, no BOM.--- line follows, then the body. The body must be non-empty.name is present โ it is the upsert key. BuiltinSkillSeedService skips any SKILL.md with no name.description is present โ a single line.If the frontmatter regex fails to match, the parser treats the whole file as body with an empty name, and a builtin skill is silently skipped at seed time. A loadable skill ALWAYS has well-formed frontmatter.
MAX_CONTENT_CHARS, ~25k tokens) โ enforced by skill_manage for custom skills. Builtin skills aren't hard-checked but should obey the same ceiling.^[a-z0-9][a-z0-9._-]{0,63}$ โ lowercase letters and digits plus - _ ., starting with a letter or digit, โค 64 chars. skill_manage lowercases the name before validating.resources/skills/ sit at 6-15k chars. Aim for that range; past ~20k, split detail into references/*.md.Every shipped skill follows this shape:
---
name: my-skill-name
description: 'One line: what it does and when it fires.'
version: 1.0.0
tags:
- short
- descriptive
- tags
author: ported
---
Fields BuiltinSkillSeedService projects onto the mate_skill row:
| Field | Effect | Default if absent |
|---|---|---|
name | upsert key, skill identity | โ (required) |
description | shown in skill lists | empty |
version | mate_skill.version | 1.0.0 |
icon | emoji, or a /skill-assets/... path | ๐ ๏ธ |
author | attribution | MateClaw |
tags | YAML list or CSV string | skill name |
nameZh / nameEn | bilingual display names | none |
optional: true | seeds the skill disabled โ user opts in from the Skills page | false (enabled) |
dependencies.tools | required tool ids โ config_json.requiredTools | none |
platforms | e.g. [linux, macos, windows] | none |
version / author / tags are not validator-enforced, but every peer carries them โ omitting makes the skill look half-finished. Use optional: true for heavyweight skills (paid CLI dependencies, external OAuth, niche integrations) so they ship dark and the user activates them deliberately.
Shipped skills follow roughly:
# <Title>
## Overview โ one or two paragraphs: what and why.
## When to Use โ bulleted triggers, plus a "Don't use for:" counter-trigger.
## <Topic sections> โ quick-reference tables, exact commands, concrete recipes
(mvn test, paths under mateclaw-server/, etc.).
## Common Pitfalls โ numbered mistakes paired with their fixes.
## Verification Checklist โ checkbox list of post-action checks.
Not every section is mandatory, but Overview + When to Use + an actionable body + Common Pitfalls is the minimum for the skill to read like a peer.
mateclaw-server/src/main/resources/skills/<skill-name>/SKILL.md
The skills/ tree is flat โ no category subdirectories. The seed glob classpath*:skills/*/SKILL.md matches exactly one level deep, so a skill nested under a category directory would never be scanned. The directory name SHOULD equal the frontmatter name. Supporting files go in references/ and scripts/ subdirectories (see below).
ls mateclaw-server/src/main/resources/skills/ and read 2-3 SKILL.md files close to your topic โ match tone and structure.skills/<name>/SKILL.md with the file tools.BuiltinSkillSeedService seeds the new row only at startup; a running server will not see it. The service also skips re-seeding when no SKILL.md's size/mtime changed, so rebuilding the JAR is what makes a change land.skills/<name>/ directory. No SQL seed change is needed โ the SKILL.md is the source of truth and obsoletes per-skill INSERT INTO mate_skill.Agents and users create runtime skills with the skill_manage tool โ actions create | edit | patch | delete:
create โ a new skill from full SKILL.md content. Rejects a duplicate name.edit โ a full-content rewrite of a custom skill.patch โ find-and-replace one section (oldText โ newText).delete โ uninstall (logical delete plus workspace archive).Notes:
SkillSecurityService) before saving โ dangerous patterns are rejected with the reason. Builtin SKILL.md files are NOT scanned; they are trusted committed source.edit / patch / delete refuse builtin skills ("cannot edit builtin skill"). To change a builtin skill, edit the resource file and restart.Beyond SKILL.md, a skill directory may carry:
references/*.md โ long-form material the body links to. Use this to keep SKILL.md under ~20k chars.scripts/* โ executable helpers a skill invokes.templates/, assets/ โ used by some bundled skills (HTML templates, images, etc.).SkillFileAccessPolicy only resolves runtime paths under references/ and scripts/, and rejects .. traversal or absolute paths โ keep runtime-read files in those two directories.
---. The frontmatter regex anchors on ^---; a blank line or BOM makes the whole file parse as body with an empty name, and a builtin skill is silently skipped.BuiltinSkillSeedService seeds only at startup. Restart โ or, for a quick iteration, create a custom skill via skill_manage, which is live immediately.skill_manage edit a builtin skill. It is refused. Builtin skills are committed source โ edit the file and restart.INSERT INTO mate_skill for a new builtin skill. Unnecessary and discouraged โ the SKILL.md is the source of truth and the seed service upserts by name.author: ported is the neutral attribution for an adapted skill.skill_manage rejects it outright; split detail into references/.name. The upsert keys on the frontmatter name, but a directory that disagrees confuses everyone reading the tree. Keep them equal.mateclaw-server/src/main/resources/skills/<name>/SKILL.md (builtin); the directory name equals the frontmatter name---, closes with a --- line, and the body is non-emptyname matches ^[a-z0-9][a-z0-9._-]{0,63}$; description is a single lineversion, tags, author present (peer-matched shape)references/ past ~20k)# Title โ ## Overview โ ## When to Use โ actionable body โ ## Common Pitfalls โ ## Verification ChecklistBuiltinSkillSeedService seeds the row; the new skills/<name>/ directory is committedskill_manage, security scan reported PASSEDๆ นๆฎไธๅฅไธๅก้ๆฑ๏ผ่ชๅจ่งๅๅนถๅๅปบไธ็ปๅๅทฅๆ็กฎ็ๆฐๅญๅๅทฅ๏ผAgent๏ผ๏ผๅๆไปไปฌ็ผๆๆไธๆกๅทฅไฝๆต๏ผๆ ้้ไธชๆๅทฅๅๅปบใ
Debug Node.js via --inspect + Chrome DevTools Protocol CLI.
Test fixture for SkillBundleMaterializer.
Dark-themed SVG architecture/cloud/infra diagrams as HTML.
Manage Apple Notes via memo CLI: create, search, edit.
Monitor blogs and RSS/Atom feeds via blogwatcher-cli tool.