Install
openclaw skills install writing-better-skillsUse when creating or improving a skill for an AI agent, especially when the skill needs strong trigger wording, project-local context, references, scripts, t...
openclaw skills install writing-better-skillsCreate better skills for agents.
A skill helps an agent do work. It is reusable operational guidance plus optional references, scripts, tests, and narrow remediation. It is not something that "turns an agent into a skill."
This skill is the control plane for authoring other skills:
Use this when authoring or revising a skill and you need to decide:
SKILL.mdreferences/NO PROJECT-SPECIFIC CONTEXT IN THE GLOBAL SKILL
If a path, command, constraint, or convention belongs to one repository, it goes in project.skill.md, not in the reusable skill.
NO SKILL IS COMPLETE UNTIL A FRESH AGENT COULD USE IT WITHOUT GUESSING CRITICAL FACTS
If another agent would have to invent project-local commands, output paths, trigger conditions, or completion criteria, the skill is incomplete.
Violating the letter of these laws is violating the spirit of the skill.
The global skill must stay reusable.
Before doing substantial work with a skill in a repository:
project.skill.md in the project root.project.skill.template.md.project.skill.md, not in the global skill.project.skill.md as overriding generic guidance in SKILL.md when local details differ.Read references/project-skill-context.md before defining or revising that contract.
SKILL.md = the routerSKILL.md is the main behavioral document. It should tell the agent:
references/ = deep guidanceReferences hold heavier, conditional, or decision-specific material.
Use references for:
scripts/ = deterministic helpersUse scripts for repeated deterministic work the agent should not keep re-deriving.
tests/ = proofUse tests to prove shipped scripts or promised behaviors work.
self-healing/ = narrow remediationUse self-healing only for safe, local, repeatable fixes.
Choose the smallest structure that reliably supports the work.
my-skill/
└── SKILL.md
my-skill/
├── SKILL.md
├── project.skill.template.md
└── references/
my-skill/
├── SKILL.md
├── project.skill.template.md
├── references/
├── scripts/
└── tests/
my-skill/
├── SKILL.md
├── project.skill.template.md
├── references/
├── scripts/
├── tests/
└── self-healing/
Read references/skill-architecture-levels.md before deciding how much structure to add.
You must complete each phase before moving on.
Decide:
If local commands, paths, outputs, or constraints vary by project, plan for project.skill.template.md.
Write the frontmatter and top of SKILL.md.
Requirements:
SKILL.md routes the agent to project.skill.md early when local context mattersSKILL.md tells the agent which references/scripts matter at which stepRead references/description-writing.md before finalizing the description.
Add references, scripts, tests, and self-healing only when earned.
Use these references:
references/script-test-conventions.md before shipping scriptsreferences/self-healing-rules.md before adding self-healingreferences/skill-testing.md before deciding what to validateBefore calling the skill complete, test whether a fresh agent could:
Read references/behavioral-validation-checklist.md.
Do not claim the skill is complete until it passes the completion gate.
Read references/completion-gate.md.
Use this map while authoring:
references/project-skill-context.mdreferences/skill-architecture-levels.mdreferences/description-writing.mdreferences/script-test-conventions.mdreferences/self-healing-rules.mdreferences/behavioral-validation-checklist.mdreferences/completion-gate.mdreferences/workflows.md, references/output-patterns.mdUse the shipped scripts when they reduce repeated, deterministic work:
scripts/quick_validate.py — fast validation of frontmatter and core structural promisesIf you find yourself manually re-checking the same structural conditions repeatedly, prefer strengthening this validator rather than rewriting the checks ad hoc.
See reference-skills/release-notes-generator/ for a canonical reference skill authored using this framework.
Use it as a model implementation of:
project.skill.template.mdSKILL.mdIt is a specimen of the framework, not a substitute for the framework.
Stop and correct course if you are thinking:
All of these usually mean you are about to violate one of the iron laws.
| Excuse | Reality |
|---|---|
| "It’s faster to put the path in SKILL.md" | That contaminates the global skill with local assumptions. Use project.skill.md. |
| "Agents can infer the local commands" | Guessing local commands is exactly what project-local context is for. |
| "This script is simple, it doesn’t need a test" | If it is worth shipping, it is usually worth validating. |
| "Self-healing can just fix a bunch of stuff" | Broad auto-fixes are risk, not resilience. |
| "The worked example will show the pattern" | The skill itself must be usable without depending on an example. |
| "The structure looks right, so the skill is done" | Organization alone does not prove fresh-agent usability. |
Before claiming a skill is complete, verify all of these:
SKILL.md routes the agent to project.skill.md early when local context mattersSKILL.mdA better skill is not just more elaborate.
A better skill:
project.skill.md