Skip to content

Commit d0acc77

Browse files
committed
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
1 parent 06d73e7 commit d0acc77

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

apps/memos-local-openclaw/src/skill/generator.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,24 @@ This Skill is special: it comes from real execution experience — every step wa
2424
2525
## Core principles (follow strictly but do NOT include these in output)
2626
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+
2732
### Progressive disclosure
2833
- The frontmatter description (~100 words) is ALWAYS in the agent's context — it must be self-sufficient for deciding whether to use this skill.
2934
- The SKILL.md body loads when triggered — keep it under 400 lines, focused, no fluff.
3035
- 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.
3137
3238
### 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.
3440
- Don't just say what it does — list the situations, keywords, and phrasings that should trigger it.
3541
- 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").
3643
- 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'."
3845
3946
### Writing style
4047
- Use imperative form
@@ -43,6 +50,9 @@ The description field decides whether the agent activates this skill. Write it "
4350
- Generalize from the specific task so the skill works for similar future scenarios, don't over-fit to this exact project
4451
- Keep real commands/code/config from the task record — these are verified to work
4552
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+
4656
### Language matching (CRITICAL)
4757
You MUST write the ENTIRE skill in the SAME language as the user's messages in the task record.
4858
- 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.
5767
5868
Output ONLY the complete SKILL.md content. No extra text before or after.
5969
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+
6073
---
6174
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.}"
63-
metadata: {{ "openclaw": {{ "emoji": "{emoji}" }} }}
75+
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.}"
6476
---
6577
78+
Name rules: 2-4 English words, kebab-case, lowercase (e.g. "docker-node-deploy", "aws-s3-backup"). This is a machine identifier.
79+
6680
# {Title — clear, action-oriented}
6781
6882
{One sentence: what this skill helps you do and why it's valuable}

0 commit comments

Comments
 (0)