| name | cmd_evolve |
| description | Cluster MEMORY.md entries by theme and optionally generate SKILL.md drafts. |
| user-invocable | true |
| origin | openclaw-mas |
| argument-hint | <project-path> [--generate] |
Project Path
The first argument is the project path. Before doing anything else:
- Extract the project path from the first argument
- Verify the path exists
- Work within that directory for all file operations and shell commands
Evolve — Memory Clustering and Skill Generation
Reads MEMORY.md, groups related sections by theme, and identifies which clusters
are strong enough candidates to become reusable skills. With --generate, writes
SKILL.md drafts into the project's skills/ directory.
Usage
/skill cmd_evolve <project-path> # Analyze and suggest
/skill cmd_evolve <project-path> --generate # Analyze and write SKILL.md drafts
What to Do
Step 1: Read MEMORY.md
Read ~/.openclaw/workspace-main/MEMORY.md. Parse all ##-level sections —
each section has a heading and a content block.
If MEMORY.md is empty or has fewer than 3 sections, report:
"Not enough memory entries to cluster. Add more with /skill cmd_promote."
Stop here.
Step 2: Surface recent short-term recalls
openclaw memory search "pattern workflow behavior"
Include any surfaced recalls alongside MEMORY.md sections in the analysis pool.
Step 3: Cluster by theme
Group sections into thematic clusters using:
- Trigger similarity: sections that activate under similar conditions
- Domain overlap: sections touching the same technical area (testing, security, build, etc.)
- Sequential relationship: sections describing steps in a multi-step process
For each cluster, determine:
- Cluster name (descriptive theme)
- Member sections (list of
## headings)
- Section count
- Suggested output type:
- command — cluster describes a user-invoked, multi-step workflow
- skill — cluster describes an automatic, pattern-matched behavior
Single-section entries: note them but do not generate from them.
Step 4: Display analysis
============================================================
EVOLVE ANALYSIS
Source: ~/.openclaw/workspace-main/MEMORY.md
Total sections: <N>
Clusters identified: <K>
============================================================
## CLUSTER 1: "<theme name>"
Sections: <count>
Members:
- <heading 1>
- <heading 2>
Suggested type: <command | skill>
Rationale: <one sentence>
## CLUSTER 2: "<theme name>"
...
## SINGLE-SECTION ENTRIES (not enough to cluster)
- <heading>
## SUMMARY
Command candidates: <N>
Skill candidates: <N>
Single entries: <N>
Step 5: If --generate is NOT passed
Suggest next steps:
To generate SKILL.md drafts from these clusters:
/skill cmd_evolve <project-path> --generate
To promote more entries from short-term memory first:
/skill cmd_promote <project-path>
Stop here.
Step 6: If --generate IS passed
For each cluster with 2 or more sections:
-
Derive a skill name: lowercase, underscores only, max 32 chars
(e.g. "Adding Database Tables" → add_database_table)
-
Output path: <project-path>/skills/<skill-name>/SKILL.md
Create the directory if it does not exist.
-
Write the SKILL.md draft:
---
name: <skill-name>
description: "<one-line description derived from cluster theme>"
user-invocable: <true if command candidate, false if skill>
origin: openclaw-mas
argument-hint: "<project-path>"
evolved_from:
- <MEMORY.md heading 1>
- <MEMORY.md heading 2>
generated: <YYYY-MM-DD>
---
## Project Path
The first argument is the project path. Before doing anything else:
1. Extract the project path from the first argument
2. Verify the path exists
3. Work within that directory for all file operations and shell commands
# <Skill Title>
<Description synthesized from the cluster's memory sections>
## Context
This skill was generated by /skill cmd_evolve from the following MEMORY.md entries:
<list the source sections>
## Workflow
<Step-by-step workflow derived from the clustered memory sections>
## Notes
- Review and refine this draft — it was auto-generated from memory clusters
- Remove the evolved_from and generated frontmatter keys before publishing
-
After writing each draft:
Generated: <project-path>/skills/<skill-name>/SKILL.md
-
Final report:
Generated <N> SKILL.md drafts in <project-path>/skills/
Next steps:
- Review each draft and refine the workflow steps
- Remove evolved_from and generated frontmatter keys before deploying
- Install to ~/.openclaw/skills/ when ready
Notes
- Generated files are drafts — they capture the theme but need human review
- cmd_evolve is read-only except for --generate which writes to /skills/
- Single-section entries are shown in analysis but never generate a SKILL.md