Case 02377
Distill successful multi-step OpenClaw sessions into reusable learned skills before compaction. Use when a task involved many tool calls, environment setup, debugging, file edits, browser research, or when the user asks to remember a workflow such as "记下这个流程" or "这招很有用".From its SKILL.md
npx -y skills add knownasnaffy/prompthound --skill case_02377Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.9 KB, 578 tokens by cl100k_base, as published. Nobody here has run it
Procedural Distiller
Use this skill after a task has succeeded and the session contains enough signal to preserve. The goal is to extract procedural knowledge, not to summarize the conversation.
Triggering Rules
Run the distillation flow when all of the following are true:
- The task is finished successfully.
- The session contains at least 5 relevant tool calls across
exec,read,write,edit, orbrowser. - At least one of these applies:
- The user explicitly asks to remember the workflow.
- The task involved environment setup, debugging, or a multi-step repair.
- Compaction risk is high and the trace contains concrete parameters worth preserving.
Do not run while the task is still active. Skip trivial sessions dominated by a single read or a one-line answer.
Distillation Workflow
- Read the recent trace and keep only relevant tool events.
- Separate successful steps from failed attempts.
- Preserve concrete commands, file paths, parameter values, and code snippets that materially contributed to the outcome.
- Convert the result into three sections:
Success PatternFailure TriggersSnippets
- Write a learned skill under
skills/learned/learned-<task-slug>/. - Persist a utility score and source metadata in
memory.json.
Read references/trace-format.md only if the incoming trace shape is unclear.
Execution Notes
- Favor exact commands over abstract summaries.
- Keep failed steps only when they teach a future agent what to avoid.
- Collapse repetitive probes into one representative line.
- If a write or edit step changed the final behavior, include the smallest useful snippet.
- If a trace already contains a user rating, store it. Otherwise default to
3and let a future caller updatememory.json.
Local CLI
Run the bundled script directly:
python distill_logic.py --trace /path/to/trace.json --task "repair build cache" --output-root /path/to/skills
Useful flags:
--utility-score 4--learned-root learned--min-tool-calls 5--max-events 20--force
Output Contract
The generated learned skill must contain:
SKILL.mdwith valid frontmatter (name,description) and procedural sectionsagents/openai.yamlfor UI metadatamemory.jsonwithutility_score, source task details, and generation metadata
Stop Conditions
Stop and do not emit a learned skill when:
- the trace is marked unsuccessful
- there are too few relevant tool calls
- the trace lacks enough detail to reconstruct a reusable procedure
What ships with it: 3 files
12.0 KB alongside SKILL.md, 1 of them executable
agents/
- openai.yaml314 B
references/
- trace-format.md690 B
- distill_logic.pyruns11.0 KB