Autoresearch Skill Optimizer
by @ngmeyer
Auto-improve any OpenClaw skill using Karpathy's autoresearch loop. Runs skill repeatedly against test inputs, scores against a yes/no checklist, makes one t...
clawhub install autoresearch-skill-optimizerπ About This Skill
name: skill-optimizer description: Auto-improve any OpenClaw skill using Karpathy's autoresearch loop. Runs skill repeatedly against test inputs, scores against a yes/no checklist, makes one targeted change, keeps if better, reverts if worse. Also audits skill structure against Anthropic's best practices (progressive disclosure, gotchas section, trigger-phrase description). Use when asked to "optimize this skill", "improve my skill", "run autoresearch on", "audit this skill", or before running any skill at scale (e.g., cold outreach). Based on Ole Lehmann's autoresearch method + Anthropic internal skill patterns (@trq212).
Skill Optimizer (Autoresearch Loop + Anthropic Structure Audit)
Two-phase improvement system: (1) structural audit against Anthropic best practices, (2) iterative output quality loop.
Phase 1: Structure Audit (run first, always)
Before optimizing output quality, audit the skill's architecture. Score against these 5 structural checks:
Structural Checklist:
1. Gotchas section β Does SKILL.md have a ## Gotchas section with at least one real failure case? (Highest-signal content per Anthropic)
2. Trigger-phrase description β Does the YAML description field say *when* to use the skill, not just *what* it does? Must include "Use when..." or equivalent trigger condition.
3. Progressive disclosure β Does the skill use the file system (references/, scripts/, assets/, config.json) instead of inline-dumping everything into SKILL.md?
4. Single focus β Does the skill fit cleanly into one type (Library Reference, Verification, Automation, Scaffolding, Runbook, etc.) without straddling multiple?
5. No railroading β Does the skill give Claude information + flexibility, rather than over-specifying *how* it must execute?
Score each: β pass | β fail | β οΈ partial
For each failure: propose a concrete fix and apply if approved.
Quick wins to apply immediately:
## Gotchas\n- [Placeholder: add real failures here as they're discovered]references/ folder structurePhase 2: Output Quality Loop (autoresearch)
After structure audit, run the iterative improvement loop on the skill's actual outputs.
Setup
1. Which skill? β User specifies, or infer from context. 2. Test inputs β Get 2-3 representative inputs. If the user doesn't provide them: - Check the skill's own docs for example usage - Use recent real invocations from memory/session history - For extraction skills: use known-good URLs/files. For generation skills: use the skill's own example prompts. 3. Scoring checklist β Build 3-6 scoring items. Start from the examples below, then customize: - What's the #1 thing that makes this skill's output *bad*? (That's checklist item 1) - What would make a user say "that's exactly what I wanted"? (That's the positive framing) - Add 1-2 items from the "Universal structural quality" list belowScoring Checklist Examples
Seereferences/checklist-examples.md for starter checklists by skill type (cold outreach, content, research, extraction, process/meta-skills).Scoring Modes
Binary mode (default for simple skills): Yes/no per checklist item. Pass rate = total yes / (items Γ runs).
Dimensional mode (use for complex skills or when binary plateaus): Score each dimension 0-10. Identify the weakest dimension (lowest average across runs). Target that dimension for revision β do NOT rewrite everything.
Use dimensional mode when:
The Loop
Round N:
1. Run skill against each test input
2. Score each output (binary: 1 per yes | dimensional: 0-10 per dimension)
3. Calculate score:
- Binary: pass rate = (total yes) / (items Γ runs)
- Dimensional: avg score per dimension across runs
4. Identify the weakest item/dimension (most failures or lowest avg score)
5. Make ONE targeted change to SKILL.md addressing ONLY that weakness
6. Re-run and re-score
7. If new score > old score: KEEP. Else: REVERT.
8. Log: score before/after, change made, dimension targeted, kept/reverted
Stop when: binary β₯ 95% (3 consecutive rounds) OR dimensional weakest β₯ 8/10 (3 consecutive) OR 20 rounds reached.
Output Files
skills/{skill-name}/SKILL-optimized.md β improved version (original untouched)skills/{skill-name}/optimization-changelog.md β full round logChangelog Format
## Structural Audit
Gotchas section: β β Added placeholder
Description: β β Rewritten as trigger condition
Progressive disclosure: β οΈ β Noted, deferred Round 1 (binary mode)
Score: 4/10 (40%)
Weakest item: "Does it mention business name?"
Change: Added rule "Always open with [Business Name],"
New score: 7/10 (70%)
Decision: KEPT Round 2 (dimensional mode)
Scores: Accuracy 8/10 | Tone 5/10 | Brevity 9/10 | Relevance 7/10
Weakest dimension: Tone (5/10)
Change: Added "Match prospect's industry language, not generic sales speak"
New scores: Accuracy 8/10 | Tone 7/10 | Brevity 9/10 | Relevance 7/10
Decision: KEPT (Tone +2)
Optimizing Meta-Skills (Process Skills)
Some skills don't produce text β they drive a process (e.g., this skill itself, planning workflows, research pipelines). For these:
What to score: Score the *experience of following the process*, not a text artifact.
How to test: Run the skill on 2-3 real tasks (not hypothetical). Score after each real use. The test inputs ARE the tasks you're applying the skill to.
Dimensional scoring for process skills:
Checklist Sweet Spot
When to Use
When to Run Which Phase
Gotchas
β‘ When to Use
βοΈ Configuration
1. Which skill? β User specifies, or infer from context. 2. Test inputs β Get 2-3 representative inputs. If the user doesn't provide them: - Check the skill's own docs for example usage - Use recent real invocations from memory/session history - For extraction skills: use known-good URLs/files. For generation skills: use the skill's own example prompts. 3. Scoring checklist β Build 3-6 scoring items. Start from the examples below, then customize: - What's the #1 thing that makes this skill's output *bad*? (That's checklist item 1) - What would make a user say "that's exactly what I wanted"? (That's the positive framing) - Add 1-2 items from the "Universal structural quality" list below
Scoring Checklist Examples
Seereferences/checklist-examples.md for starter checklists by skill type (cold outreach, content, research, extraction, process/meta-skills).Scoring Modes
Binary mode (default for simple skills): Yes/no per checklist item. Pass rate = total yes / (items Γ runs).
Dimensional mode (use for complex skills or when binary plateaus): Score each dimension 0-10. Identify the weakest dimension (lowest average across runs). Target that dimension for revision β do NOT rewrite everything.
Use dimensional mode when:
The Loop
Round N:
1. Run skill against each test input
2. Score each output (binary: 1 per yes | dimensional: 0-10 per dimension)
3. Calculate score:
- Binary: pass rate = (total yes) / (items Γ runs)
- Dimensional: avg score per dimension across runs
4. Identify the weakest item/dimension (most failures or lowest avg score)
5. Make ONE targeted change to SKILL.md addressing ONLY that weakness
6. Re-run and re-score
7. If new score > old score: KEEP. Else: REVERT.
8. Log: score before/after, change made, dimension targeted, kept/reverted
Stop when: binary β₯ 95% (3 consecutive rounds) OR dimensional weakest β₯ 8/10 (3 consecutive) OR 20 rounds reached.
Output Files
skills/{skill-name}/SKILL-optimized.md β improved version (original untouched)skills/{skill-name}/optimization-changelog.md β full round log