Install
openclaw skills install @akdira/skill-optimizerSystematically analyze, score, and optimize OpenClaw skill documents (SKILL.md files). Adapted from Microsoft SkillOpt research — treats skill docs as trainable state with validation-gated edits. Use when improving skill quality, auditing skills, onboarding new skills, or batch-optimizing workspace skills.
openclaw skills install @akdira/skill-optimizerSystematic skill document optimization for OpenClaw, adapted from Microsoft SkillOpt research.
Core insight: Skills are the "weights" of a frozen agent. Optimize them with the same discipline as neural network training — rollout, reflect, aggregate, select, update, gate — but in text space, without retraining the model.
| SkillOpt Concept | Our Adaptation |
|---|---|
| Skill document = trainable state | SKILL.md is the "model" we optimize |
| Rollout | Execute skill with test scenarios, capture results |
| Reflect | Analyze execution patterns, identify weaknesses |
| Aggregate | Combine multiple improvement suggestions |
| Select (learning rate) | Limit edits per pass to prevent overfitting |
| Update | Apply bounded edits to SKILL.md |
| Validation gate | Only accept edits that demonstrably improve quality |
| Slow update | Gradual improvement across optimization passes |
| Meta skill | Cross-skill patterns extracted as reusable heuristics |
| best_skill.md | The optimized SKILL.md artifact |
Every skill is scored on 10 dimensions (1-5 each, max 50):
| # | Dimension | What to Check |
|---|---|---|
| 1 | Trigger Clarity | Are activation triggers specific and comprehensive? |
| 2 | Structure | Does it follow consistent sections (Overview → Steps → Examples)? |
| 3 | Step Completeness | Are all steps present, ordered, and actionable? |
| 4 | Error Handling | Does it handle edge cases, failures, and exceptions? |
| 5 | Input Validation | Does it validate inputs before execution? |
| 6 | Output Specification | Are expected outputs clearly defined? |
| 7 | Examples | Are there concrete before/after examples? |
| 8 | Tool References | Are tools/commands referenced correctly with versions? |
| 9 | Dependencies | Are prerequisites and dependencies documented? |
| 10 | Maintainability | Is it easy to update? Version controlled? |
Input: skill name or path to SKILL.md
Output: quality score + detailed analysis
Steps:
Command pattern:
Analyze skill: <skill-name>
Input: skill name or path to SKILL.md
Output: optimized SKILL.md + diff report
Steps:
SKILL.md.bakLearning Rate Control:
Command pattern:
Optimize skill: <skill-name>
Input: list of skills or "all"
Output: optimization report for all skills
Steps:
Command pattern:
Batch optimize skills [top N]
Input: skill name
Output: before/after comparison
Steps:
Command pattern:
Compare skill: <skill-name>
Problem: Skill is missing critical sections. Fix: Add missing sections based on template. Impact: High (foundational)
Problem: Triggers are too narrow, skill doesn't activate when needed. Fix: Expand trigger keywords based on common usage patterns. Impact: Medium-High
Problem: Skill only covers happy path. Fix: Add error handling, fallback paths, and troubleshooting. Impact: High
Problem: Abstract instructions without concrete examples. Fix: Add before/after examples for each major step. Impact: Medium
Problem: Prerequisites not documented, causes setup failures. Fix: Add clear dependency list with versions and install commands. Impact: Medium
Problem: Unclear what the skill should produce. Fix: Add explicit output format, file paths, success criteria. Impact: Medium
Problem: Steps are too large or vague. Fix: Break complex steps into smaller, atomic actions. Impact: Medium
Problem: Skill doesn't reference related skills or tools. Fix: Add links to related skills, tools, and documentation. Impact: Low-Medium
An edit is ONLY accepted when:
If the gate rejects an edit:
After optimizing 5+ skills, extract cross-skill patterns:
Store patterns in references/meta-skill-patterns.md.
Use patterns to improve the scoring rubric and optimization strategies.
# Skill Analysis: [skill-name]
## Score: [X]/50
### Dimension Scores
| Dimension | Score | Notes |
|-----------|-------|-------|
| Trigger Clarity | 3/5 | ... |
| ... | ... | ... |
### Weaknesses (Priority Order)
1. [HIGH] Missing error handling in Step 3
2. [MEDIUM] No examples for main workflow
3. [LOW] Triggers could be more specific
### Strengths
- Clear step-by-step structure
- Good tool references
### Recommended Edits
1. Add error handling section after Step 5
2. Add example for common use case
3. Expand trigger keywords
# Optimization Report: [skill-name]
## Before → After
- Score: [X]/50 → [Y]/50 (+[Z])
- Edits applied: [N]
- Edits rejected: [M]
## Changes Made
### Edit 1: [Type] [Section]
- Before: [original text]
- After: [new text]
- Reason: [why this improves the skill]
## Validation
- [✅/❌] Score improved
- [✅/❌] No functionality removed
- [✅/❌] Edits bounded
- [✅/❌] No contradictions
- [✅/❌] Style consistent
After optimizing a skill: