You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(skill): align generation template with skill-creator best practices
- Constrain skill name to 2-4 word kebab-case
- Limit frontmatter to name + description only
- Add rule against creating extra documentation files
- Add 'assume agent is smart' principle
- Strengthen trigger condition requirements in description
- Clarify metadata as optional OpenClaw extension
Fixes#1423
Copy file name to clipboardExpand all lines: apps/memos-local-openclaw/src/skill/generator.ts
+18-4Lines changed: 18 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -24,17 +24,24 @@ This Skill is special: it comes from real execution experience — every step wa
24
24
25
25
## Core principles (follow strictly but do NOT include these in output)
26
26
27
+
### Assume the agent is smart
28
+
The agent consuming this skill is an LLM — it already knows how to use git, write code, read docs, and run commands.
29
+
- Only write what the agent CANNOT derive from the codebase or general knowledge: project-specific gotchas, non-obvious config, verified flags/versions, and real pitfalls encountered.
30
+
- Do NOT explain basic concepts, standard tool usage, or things any competent developer already knows.
31
+
27
32
### Progressive disclosure
28
33
- The frontmatter description (~100 words) is ALWAYS in the agent's context — it must be self-sufficient for deciding whether to use this skill.
29
34
- The SKILL.md body loads when triggered — keep it under 400 lines, focused, no fluff.
30
35
- If the task involved large configs/scripts, mention them but DON'T inline everything — just reference that scripts/ or references/ may contain them.
36
+
- If the skill covers multiple variants (e.g. different OS targets, different cloud providers), put variant-specific details in references/ files. The main SKILL.md should cover the common workflow only.
31
37
32
38
### Description as trigger mechanism
33
-
The description field decides whether the agent activates this skill. Write it "proactively":
39
+
The description field is the SOLE input the agent uses to decide whether to activate this skill. If the description doesn't match, the body is never read — so put maximum effort here.
34
40
- Don't just say what it does — list the situations, keywords, and phrasings that should trigger it.
35
41
- Claude/agents tend to under-trigger skills. Counter this by being explicit about when to use it.
42
+
- Include indirect phrasings: users often describe the goal ("make it run anywhere") rather than the tool ("Docker").
36
43
- Bad: "How to deploy Node.js to Docker"
37
-
- Good: "How to containerize and deploy a Node.js application using Docker. Use when the user mentions Docker deployment, Dockerfile writing, container builds, multi-stage builds, port mapping, .dockerignore, image optimization, CI/CD container pipelines, or any task involving packaging a Node/JS backend into a container — even if they don't say 'Docker' explicitly but describe wanting to 'package the app for production' or 'run it anywhere'."
44
+
- Good: "How to containerize and deploy a Node.js application using Docker. TRIGGER when: user mentions Docker deployment, Dockerfile writing, container builds, multi-stage builds, port mapping, .dockerignore, image optimization, CI/CD container pipelines, or any task involving packaging a Node/JS backend into a container — even if they don't say 'Docker' explicitly but describe wanting to 'package the app for production' or 'run it anywhere'."
38
45
39
46
### Writing style
40
47
- Use imperative form
@@ -43,6 +50,9 @@ The description field decides whether the agent activates this skill. Write it "
43
50
- Generalize from the specific task so the skill works for similar future scenarios, don't over-fit to this exact project
44
51
- Keep real commands/code/config from the task record — these are verified to work
45
52
53
+
### No extra files
54
+
- Output ONLY the SKILL.md content. Do NOT create or reference README.md, CHANGELOG.md, INSTALLATION_GUIDE.md, CONTRIBUTING.md, or similar boilerplate files. All information belongs in SKILL.md, scripts/, or references/.
55
+
46
56
### Language matching (CRITICAL)
47
57
You MUST write the ENTIRE skill in the SAME language as the user's messages in the task record.
48
58
- If the user wrote in Chinese → the skill title, description, all prose sections MUST be in Chinese
@@ -57,12 +67,16 @@ DO NOT default to English. Look at the task record below and match its language.
57
67
58
68
Output ONLY the complete SKILL.md content. No extra text before or after.
59
69
70
+
The frontmatter contains ONLY name and description. Nothing else.
71
+
(OpenClaw metadata such as emoji is optional — if desired, add it as a \`<!-- metadata: {{"openclaw": {{"emoji": "..."}}}}} -->\` HTML comment at the very end of the file body, NOT in the frontmatter.)
72
+
60
73
---
61
74
name: "{NAME}"
62
-
description: "{A natural, proactive description. 60-120 words. Cover what it does + multiple phrasings/scenarios that should trigger it. Be pushy about triggering — list keywords, alternative descriptions, edge-case phrasings.}"
description: "{A natural, proactive description. 60-120 words. Cover what it does + multiple phrasings/scenarios that should trigger it. Include a TRIGGER line listing keywords and indirect phrasings. Be pushy about triggering.}"
64
76
---
65
77
78
+
Name rules: 2-4 English words, kebab-case, lowercase (e.g. "docker-node-deploy", "aws-s3-backup"). This is a machine identifier.
79
+
66
80
# {Title — clear, action-oriented}
67
81
68
82
{One sentence: what this skill helps you do and why it's valuable}
0 commit comments