SOP & Workflow memory skill
by @zhangyuqi98
Use when the user wants OpenClaw or Codex to remember their way of working as reusable SOPs, workflows, queues, or "how I do things". Best for repeated multi...
clawhub install workflowhubπ About This Skill
name: work-style-memory description: Use when the user wants OpenClaw or Codex to remember their way of working as reusable SOPs, workflows, queues, or "how I do things". Best for repeated multi-step tasks where the agent should proactively check saved workflows before starting, ask whether to reuse an existing SOP when there is a strong match, and ask whether to save or update a workflow after the task.
Work Style Memory
Overview
This skill treats the user's repeated ways of working as a local workflow library instead of burying them inside a one-off prompt. The workflow file is the source of truth; the agent uses it to match similar requests, generate an execution brief, and ask whether the run should be saved back into the library.
Use this skill when the user says things like:
Do not use this skill for truly one-off tasks or very small requests that do not benefit from storing a reusable process.
Operating Model
The skill works in four phases:
1. Match the current request against saved workflows. 2. If there is a strong match, ask whether to use the existing workflow. 3. Compile the workflow into an execution brief and perform the task. 4. At the end, ask whether to save a new workflow or update the matched one.
The workflow library should be editable outside the skill. The recommended storage layout is:
.openclaw/workflows/*.json$CODEX_HOME/work-style-memory/workflows/*.jsonPrefer project-local workflows when the process is tied to a repository, team, or codebase. Prefer the global store when the process reflects the user's personal way of working across contexts.
When this skill is active during a normal chat task, the workflow check should happen as part of the agent's task handling flow, not only in the local UI.
Matching Rules
When this skill is active, build a candidate list by comparing the current request with saved workflows using:
Behavior rules:
Running A Workflow
A workflow is not the final prompt. It is structured memory that gets compiled into a short execution brief.
When executing a matched workflow:
1. Load the workflow file. 2. Convert the workflow into an execution brief that includes: - goal - trigger keywords - ordered steps - preferred tools 3. Execute the task using that brief rather than pasting the raw JSON to the model.
Use render_workflow_prompt.py to generate a deterministic draft brief when helpful. Use match_workflows.py when you want a deterministic similarity check against the saved workflow library. Read runtime-behavior.md for the expected preflight behavior during normal chat tasks.
Capturing A New Workflow
After completing a task, ask whether to save it if any of these are true:
When saving or updating a workflow, record:
Use workflow-template.json as the starting shape. Use new_workflow.py to scaffold a file quickly. Use capture_workflow.py when you want to turn a real task description into a draft workflow quickly. Use save_workflow.py when the user confirms that the task should be saved or used to update an existing workflow.
Editing And UI Expectations
This skill assumes the workflow library is user-editable. The local UI should edit the same files that the skill reads.
The minimum useful UI has:
This skill bundle includes a runnable MVP UI at ui/server.py, which serves a local editor for the workflow JSON files. The local UI can also:
See local-ui-spec.md for the recommended interface model.
Workflow File Shape
Use JSON for the initial implementation so the files are easy to render, diff, validate, and edit from scripts or a local UI. The schema and field guidance are in workflow-schema.md.
Important conventions:
Example Interaction Pattern
When a similar request arrives:
1. Check the workflow library before starting the task.
2. Detect likely workflow match.
3. Ask: "I found your pr-review workflow for this. Do you want me to use that SOP?"
4. If yes, run using the compiled brief.
5. After the run, ask whether today's differences should update the workflow.
When no workflow matches:
1. Complete the task normally. 2. Summarize the process in a compact way. 3. Ask: "Want me to save this as a reusable workflow for next time?"