TrustLoop Skill Evolver
by @haocheng0126
Let OpenClaw capture reusable workflows as managed skill candidates, support review or revision, and evolve safely through manual, assisted, or autonomous mo...
clawhub install trustloop-skill-evolverπ About This Skill
name: skill-evolver description: Let OpenClaw capture reusable workflows as managed skill candidates, support review or revision, and evolve safely through manual, assisted, or autonomous modes inside the current workspace. user-invocable: true argument-hint: "[ACTION=
Manage a safe, mode-aware skill evolution loop inside the current workspace.
This skill is always on. Its job is to notice reusable workflows, turn them into managed skill candidates, support review and user suggestions, publish approved changes into ./skills/, and roll them back when needed.
Installation And Runtime Modes
This skill supports two install paths:
skills/ directory
- works without any plugin
- uses built-in file tools plus the policy files in this skill folder
skill_manage_managed tool
- preferred when available because candidate review, publish, rollback, and mode changes become safer and more reliableDo not fail just because the plugin is missing.
If skill_manage_managed is available, prefer it for lifecycle mutations such as:
create_candidatemerge_candidateget_modeset_modereview_candidatepublish_candidaterollback_skillIf that tool is not available, continue in pure skill mode using built-in file tools and the references/templates shipped with this skill.
Scope
Only manage skills in the current workspace, and only when one of these is true:
./skills/learned-/ SKILL.md frontmatter contains managed-by: skill-evolverRefuse to modify:
managed-by: skill-evolver markerBefore any publish or rollback action, read references/review-policy.md. For lifecycle details and state layout, read references/evolution-rules.md. For the native-tool path, read references/skill-manage-managed-tool.md.
State Layout
All runtime state lives in the workspace root:
./.skill-evolver/candidates/./.skill-evolver/backups/./.skill-evolver/audit/./.skill-evolver/registry.json./.skill-evolver/config.jsonPublished managed skills live only in:
./skills/learned-/SKILL.md Initialize missing state directories, registry.json, or config.json only when needed.
Autonomy Modes
The learning loop supports three modes:
manualassistedpatch_skill
- keep all publishing manual
autonomouspatch_skill updates to the managed skill directly
- auto-publish low-risk create_skill candidates as learned-*-canary
- keep medium- and high-risk changes in reviewTreat manual as the safe default unless the user explicitly changes mode.
User Experience Rules
Keep the learning loop helpful, quiet, and low-friction.
When To Create A Candidate
Create a candidate only when at least one of these is true:
Do not create a candidate for trivial one-step actions, one-off facts, or workflows that depend on unsafe behavior.
Candidate Workflow
When a reusable workflow should be learned:
1. Read templates/managed-skill-template.md and templates/candidate-record-template.md.
2. Check existing managed skills and open candidates before creating anything new.
3. Prefer patch_skill when the workflow materially overlaps an existing managed skill or pending candidate.
4. Use create_skill only when no safe existing target matches.
5. Use deprecate_skill only for already-managed skills that should stop being used.
6. Classify risk using references/review-policy.md.
7. Detect whether the native skill_manage_managed tool is available.
8. Read the current autonomy mode from ./.skill-evolver/config.json or from the native tool.
9. Render a single-file managed skill draft from the managed skill template.
10. If the native tool is available, prefer it for candidate creation, merge handling, registry updates, and audit writes.
11. If the native tool is not available, write the candidate record to ./.skill-evolver/candidates/.
12. If the native tool is not available, insert or update the registry record in ./.skill-evolver/registry.json.
13. If the native tool is not available, write a structured audit event into ./.skill-evolver/audit/.
14. If the current mode allows auto-approval or auto-publish for this low-risk candidate, explain the action briefly.
15. Otherwise reply with a short approval request such as: I found a reusable workflow and created candidate
Never auto-publish medium- or high-risk candidates.
When a candidate clearly duplicates another pending candidate, merge into the older candidate or patch the shared target skill instead of creating a new learned-* skill.
Keep the candidate-creation prompt short enough that the user can decide quickly without reading the whole draft.
Review Commands
Support these direct commands and close natural-language equivalents:
review skill candidatesapprove candidate reject candidate revise candidate with suggestions: publish candidate as rollback skill show skill-evolver modeset skill-evolver mode Behavior:
review: list pending or approved candidates with candidate_id, target_skill, change_type, risk_level, and a one-line summaryskill_manage_managed tool for lifecycle mutations when it is availableapprove: mark the candidate approved in registry.json, set approved_at if empty, and do not write into ./skills/reject: mark the candidate rejected and do not modify published skillsrevise: record the user's optimization suggestions, increment the candidate revision count, keep the candidate in review, and update the draft before asking againpublish: only allowed after approval, or after an unambiguous direct user reply to the publish promptrollback: restore the latest backup for a managed skill and update the registryshow mode: read ./.skill-evolver/config.json and explain the current mode in one short sentenceset mode: update ./.skill-evolver/config.json and confirm the new mode plus its publish behaviorSilence is never approval. When the user gives optimization feedback during review, treat it as a revision request rather than a rejection unless they explicitly reject the candidate. Accept natural-language review feedback when the intent is clear, even if the user does not use the exact command syntax.
Publish Rules
When publishing a candidate:
1. Confirm the target stays inside ./skills/.
2. If the target already exists, verify it is managed by skill-evolver.
3. Back up the current published skill into ./.skill-evolver/backups/.
4. Write the approved skill draft to ./skills/.
5. Ensure the published skill frontmatter includes:
- managed-by: skill-evolver
- managed-version:
- published-from-candidate:
6. Update the registry status to published and set published_version.
7. Record the publish channel as main or canary.
8. Write a publish audit event with the final diff summary, backup path, and publish result.
For v0, managed skills should stay single-file unless the user explicitly asks for richer supporting files later.
Autonomous mode may publish low-risk new skills as learned-*-canary, but that does not remove the need for human review on higher-risk changes.
Rollback Rules
When the user asks to roll back a skill:
1. Verify the skill is managed by skill-evolver.
2. Restore the latest backup into ./skills/.
3. Mark the latest published registry entry as rolled_back.
4. Set rollback_of to the restored backup identifier or path.
5. Write a rollback audit event.
If the skill is unmanaged or no backup exists, refuse and explain why.