feat(skills): capture reusable techniques from successful work (#105674)

* feat(skills): capture reusable experience safely

* feat(skills): review completed work for reusable learning

* docs(skills): explain self-learning

* docs: clarify self-learning runtime scope

* fix(skills): harden autonomous workshop reviews

* test(skills): align review prompt fixture
This commit is contained in:
Peter Steinberger
2026-07-13 00:22:06 -07:00
committed by GitHub
parent b2b87e956e
commit 32c84b0f41
37 changed files with 2209 additions and 297 deletions

View File

@@ -235,6 +235,10 @@
"source": "Skills Config",
"target": "Skills 配置"
},
{
"source": "Self-learning",
"target": "自我学习"
},
{
"source": "local loopback",
"target": "local loopback"

View File

@@ -1317,6 +1317,7 @@
"pages": [
"tools/skills",
"tools/skill-workshop",
"tools/self-learning",
"tools/creating-skills",
"tools/skills-config",
"tools/slash-commands",

View File

@@ -9877,6 +9877,23 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
- H2: Notes
- H2: Related
## tools/self-learning.md
- Route: /tools/self-learning
- Headings:
- H2: Enable self-learning
- H2: What OpenClaw can learn
- H2: When experience review runs
- H2: What the reviewer receives
- H2: Proposal safety
- H2: Review learned proposals
- H2: Configuration
- H2: Troubleshooting
- H3: No proposal appears after a long turn
- H3: Doctor reports that the Workshop tool is hidden
- H3: Too many low-value proposals appear
- H2: Related
## tools/show-widget.md
- Route: /tools/show-widget

View File

@@ -22,15 +22,15 @@ group membership, provider restrictions, and configuration fields, use
For most agents, start with the built-in tool categories, then adjust policy
only when the agent should see fewer tools or needs explicit host access.
| If you need to... | Use this first | Then read |
| ------------------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| Let an agent act with existing capabilities | [Built-in tools](#built-in-tool-categories) | [Tool categories](#built-in-tool-categories) |
| Control what an agent can call | [Tool policy](#configure-access-and-approvals) | [Tools and custom providers](/gateway/config-tools) |
| Teach an agent a workflow | [Skills](#choose-tools-skills-or-plugins) | [Skills](/tools/skills), [Creating skills](/tools/creating-skills), and [Skill Workshop](/tools/skill-workshop) |
| Add a new integration or runtime surface | [Plugins](#extend-capabilities) | [Plugins](/tools/plugin) and [Build plugins](/plugins/building-plugins) |
| Run work later or in the background | [Automation](/automation) | [Automation overview](/automation) |
| Coordinate multiple agents or harnesses | [Sub-agents](/tools/subagents) | [ACP agents](/tools/acp-agents) and [Agent send](/tools/agent-send) |
| Search a large OpenClaw tool catalog | [Tool Search](/tools/tool-search) | [Tool Search](/tools/tool-search) |
| If you need to... | Use this first | Then read |
| ------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Let an agent act with existing capabilities | [Built-in tools](#built-in-tool-categories) | [Tool categories](#built-in-tool-categories) |
| Control what an agent can call | [Tool policy](#configure-access-and-approvals) | [Tools and custom providers](/gateway/config-tools) |
| Teach an agent a workflow | [Skills](#choose-tools-skills-or-plugins) | [Skills](/tools/skills), [Creating skills](/tools/creating-skills), [Skill Workshop](/tools/skill-workshop), and [Self-learning](/tools/self-learning) |
| Add a new integration or runtime surface | [Plugins](#extend-capabilities) | [Plugins](/tools/plugin) and [Build plugins](/plugins/building-plugins) |
| Run work later or in the background | [Automation](/automation) | [Automation overview](/automation) |
| Coordinate multiple agents or harnesses | [Sub-agents](/tools/subagents) | [ACP agents](/tools/acp-agents) and [Agent send](/tools/agent-send) |
| Search a large OpenClaw tool catalog | [Tool Search](/tools/tool-search) | [Tool Search](/tools/tool-search) |
## Choose tools, skills, or plugins
@@ -57,7 +57,7 @@ only when the agent should see fewer tools or needs explicit host access.
Skills can live in a workspace, shared skill directory, managed OpenClaw
skill root, or plugin package.
[Skills](/tools/skills) | [Skill Workshop](/tools/skill-workshop) | [Creating skills](/tools/creating-skills) | [Skills config](/tools/skills-config)
[Skills](/tools/skills) | [Skill Workshop](/tools/skill-workshop) | [Self-learning](/tools/self-learning) | [Creating skills](/tools/creating-skills) | [Skills config](/tools/skills-config)
</Step>

225
docs/tools/self-learning.md Normal file
View File

@@ -0,0 +1,225 @@
---
summary: "Let OpenClaw propose reusable skills from corrections and substantial completed work"
read_when:
- You want OpenClaw to learn reusable procedures from completed conversations
- You are deciding whether to enable autonomous skill proposals
- You need to understand self-learning safety, cost, eligibility, or troubleshooting
title: "Self-learning"
sidebarTitle: "Self-learning"
---
Self-learning lets OpenClaw turn useful evidence from conversations into pending
[Skill Workshop](/tools/skill-workshop) proposals. It does not train model
weights, edit active skills, or silently change agent behavior. Every learned
procedure stays pending until an operator reviews and applies it.
Self-learning is **disabled by default**. Enable it only when an additional
background model run and transcript review are appropriate for your workspace.
## Enable self-learning
Use the CLI:
```bash
openclaw config set skills.workshop.autonomous.enabled true --strict-json
```
Or edit `~/.openclaw/openclaw.json`:
```json5
{
skills: {
workshop: {
autonomous: {
enabled: true,
},
},
},
}
```
Disable it again with:
```bash
openclaw config set skills.workshop.autonomous.enabled false --strict-json
```
User-requested skill creation, `/learn`, and manual Skill Workshop operations
continue to work while self-learning is disabled.
## What OpenClaw can learn
Self-learning has two conservative paths:
1. **Direct instructions and corrections.** OpenClaw detects durable language
such as “from now on,” “next time,” and corrections to a failed approach.
With self-learning enabled, it can turn those signals into pending proposals
without waiting for another prompt. This deterministic path can group related
instructions into up to three proposals, target a writable workspace skill,
or revise its own related pending proposal. It also runs after failed turns
because it captures the user's instructions rather than judging completion.
2. **Experience review.** After a successful, substantial foreground turn,
OpenClaw can review the completed work for a reusable recovery technique or
a stable procedure that would remove at least two future model or tool round
trips.
Good candidates include:
- a reliable recovery after repeated tool or model failures;
- a non-obvious ordering constraint that prevented a recurring error;
- a stable multi-step workflow that required repeated discovery; or
- a reusable preflight that would avoid multiple future calls.
The reviewer should abstain for routine successful work, one-off requests,
personal facts, simple preferences, transient environment failures, generic
advice, unsupported negative claims, and secrets.
## When experience review runs
Experience review is deliberately delayed and bounded:
- The foreground turn must finish successfully.
- The current turn must contain at least ten model iterations.
- Cron, heartbeat, memory, overflow, hook, subagent, and review sessions are
excluded.
- The foreground run must have resolved a provider and model and must actually
have had access to `skill_workshop`.
- OpenClaw waits 30 seconds after completion. A later foreground completion in
the same session restarts that quiet period.
- If any agent or reply run is still active, review waits another 30 seconds.
- Only one experience review runs at a time.
- Delayed review is process-local Gateway work. The Gateway must remain running
through the idle window; one-shot local and CLI-backed runtimes do not retain
enough trajectory and tool-availability context to schedule it.
The foreground answer is never delayed for learning. A failed or ineligible
turn does not start experience review, although direct user corrections can
still be offered as a suggestion when autonomy is disabled.
## What the reviewer receives
The background reviewer receives only the current turn, starting at its most
recent user message. The rendered trajectory is capped at 60,000 characters;
when necessary, OpenClaw keeps the first message and the newest evidence and
marks the omitted middle.
The reviewer reuses the resolved provider and model. It reuses the foreground
auth profile when that identity is available and disables model fallbacks. The
review therefore starts an additional model run on the configured provider.
That run can make more than one provider request when it inspects or drafts a
proposal. Provider pricing and data-handling terms apply just as they do to the
foreground turn.
Before starting, OpenClaw reloads current runtime configuration and rechecks the
effective sandbox and tool policy for the original conversation. If the run is
sandboxed, policy no longer permits `skill_workshop`, or required runtime facts
are missing, review fails closed and creates nothing.
<Warning>
Enabling self-learning permits eligible conversation content, including tool
inputs and results from the current turn, to be sent to the selected model
provider for one additional review. Do not enable it in a workspace where
that review would violate data-handling requirements.
</Warning>
## Proposal safety
The reviewer runs in an isolated session with a deliberately narrow tool
surface:
- It can only list or inspect Workshop proposals and create or revise one
pending proposal.
- It cannot update a live skill, apply a proposal, reject a proposal, quarantine
a proposal, send a message, or use general agent tools.
- One mutation budget is shared across model retries, so a review can create or
revise at most one proposal.
- The reviewed trajectory is treated as untrusted evidence, not as instructions
for the background agent.
- Skill Workshop scans proposal content and rejects recognized literal
credentials before proposal state is written.
Normal Workshop limits still apply, including `maxPending`, `maxSkillBytes`,
support-file restrictions, scanner checks, and workspace-only writes. The
`approvalPolicy: "auto"` setting does not grant the background reviewer access
to lifecycle actions.
## Review learned proposals
Self-learning produces the same pending proposals as manual Workshop use.
Inspect them before applying:
```bash
openclaw skills workshop list
openclaw skills workshop inspect <proposal-id>
openclaw skills workshop apply <proposal-id>
```
Revise, reject, or quarantine proposals that are useful but not ready:
```bash
openclaw skills workshop revise <proposal-id> --proposal ./PROPOSAL.md
openclaw skills workshop reject <proposal-id> --reason "Too specific"
openclaw skills workshop quarantine <proposal-id> --reason "Needs security review"
```
Applying is the only operation that writes an active `SKILL.md`. See
[Skill Workshop](/tools/skill-workshop) for the complete lifecycle and storage
model.
## Configuration
| Setting | Default | Self-learning effect |
| ------------------------------------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `skills.workshop.autonomous.enabled` | `false` | Enables direct correction capture and delayed experience review. |
| `skills.workshop.approvalPolicy` | `"pending"` | Controls approval prompts for normal agent-initiated lifecycle actions; it does not expand the background reviewer's permissions. |
| `skills.workshop.maxPending` | `50` | Caps pending and quarantined proposals per workspace. |
| `skills.workshop.maxSkillBytes` | `40000` | Caps proposal body size in bytes. |
| `skills.workshop.allowSymlinkTargetWrites` | `false` | Affects apply behavior only; self-learning itself writes proposal state, not live skill targets. |
For the exhaustive schema, ranges, and related skill settings, see
[Skills config](/tools/skills-config#workshop-skills-workshop).
## Troubleshooting
### No proposal appears after a long turn
Check all of the following:
1. `skills.workshop.autonomous.enabled` is `true` in the active Gateway config.
2. The turn succeeded and included at least ten model iterations after the most
recent user message.
3. The conversation was a normal foreground run, not a scheduled, memory,
hook, or subagent run.
4. The original run had access to `skill_workshop` and was not sandboxed.
5. The system remained idle long enough for the delayed review.
6. The long-running Gateway process stayed active through the idle window; a
one-shot local command does not wait for delayed review.
A qualifying review may still produce no proposal. Abstention is the expected
result when the evidence does not clear the reusable-procedure bar.
### Doctor reports that the Workshop tool is hidden
When self-learning is enabled, `openclaw doctor` checks whether the default
agent's effective tool policy permits `skill_workshop`. Follow the reported
`tools.allow` or `tools.alsoAllow` change, or disable self-learning.
### Too many low-value proposals appear
Disable self-learning and continue using `/learn` or explicit Workshop requests:
```bash
openclaw config set skills.workshop.autonomous.enabled false --strict-json
```
Pending proposals remain reviewable after the feature is disabled. Disabling
self-learning does not apply, reject, or delete them.
## Related
- [Skill Workshop](/tools/skill-workshop) for proposal review, approval, and
storage
- [Creating skills](/tools/creating-skills) for hand-authored skills and
`SKILL.md` structure
- [Skills config](/tools/skills-config) for all `skills.*` settings
- [Skills CLI](/cli/skills) for Workshop and curator commands

View File

@@ -4,6 +4,7 @@ read_when:
- You want the agent to create or update a skill from chat
- You need to review, apply, reject, or quarantine a generated skill draft
- You are configuring Skill Workshop approval, autonomy, storage, or limits
- You want to understand where self-learning proposals are reviewed
title: "Skill Workshop"
sidebarTitle: "Skill Workshop"
---
@@ -236,6 +237,14 @@ the most recent detected workflow through `skill_workshop`; the user decides whe
proposal. This built-in suggestion does not create or change a skill by itself. Enable
`skills.workshop.autonomous.enabled` to create pending proposals directly instead.
With autonomous capture enabled, OpenClaw can also perform a conservative review after successful,
substantial work and after the whole agent system becomes idle. That isolated review can create or
revise at most one pending proposal. It cannot update a live skill or apply, reject, or quarantine a
proposal, even when `approvalPolicy` is `"auto"`.
See [Self-learning](/tools/self-learning) for enablement, eligibility, privacy and cost details,
the proposal threshold, and troubleshooting.
## Approval and autonomy
```json5
@@ -256,7 +265,7 @@ proposal. This built-in suggestion does not create or change a skill by itself.
| Setting | Default | Effect |
| -------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `autonomous.enabled` | `false` | Creates pending proposals directly instead of offering the most recent detected workflow on the next turn. |
| `autonomous.enabled` | `false` | Creates pending proposals from explicit corrections and, after an idle delay, substantial completed work with reusable recovery or meaningful round-trip savings. |
| `allowSymlinkTargetWrites` | `false` | Lets apply write through workspace skill symlinks whose real target is listed in `skills.load.allowSymlinkTargets`. |
| `approvalPolicy` | `"pending"` | `"pending"` requires an approval prompt before agent-initiated `apply`, `reject`, or `quarantine`. `"auto"` skips the prompt (the agent still has to call the action). |
| `maxPending` | `50` | Caps pending and quarantined proposals per workspace (1-200). |
@@ -267,6 +276,17 @@ corrections (for example, “thats not what I asked”). It groups new instru
to three proposals per turn, routes vocabulary matches to existing writable workspace skills, and
revises its own pending proposal when another correction targets the same skill.
For successful substantial work without an explicit correction, an isolated run of the selected
model decides whether the completed trajectory clears the conservative proposal bar. The
foreground model is not prompted to learn before it replies. The background reviewer preserves the
foreground run as proposal provenance, cannot access general agent tools, and cannot make lifecycle
decisions. The review starts only when the foreground runtime reports both its exact resolved model
and that `skill_workshop` was actually available. Restrictive or unknown tool policy therefore
fails closed and creates no proposal.
See [Self-learning](/tools/self-learning) for the complete autonomous review behavior and safety
model.
Proposal descriptions are always capped at 160 bytes, independent of
`maxSkillBytes`.
@@ -351,6 +371,7 @@ Workshop is built in and prints the same policy hint when applicable.
## Related
- [Skills](/tools/skills) for load order, precedence, and visibility
- [Self-learning](/tools/self-learning) for conservative post-run skill proposals
- [Creating skills](/tools/creating-skills) for hand-written `SKILL.md`
basics
- [Skills config](/tools/skills-config) for the full `skills.workshop` schema

View File

@@ -342,11 +342,15 @@ different visible skill set per agent.
## Workshop (`skills.workshop`)
<ParamField path="skills.workshop.autonomous.enabled" type="boolean" default="false">
When `true`, agents can create pending proposals from durable conversation
signals after successful turns. User-prompted skill creation always goes
through Skill Workshop regardless of this setting.
When `true`, OpenClaw can create pending proposals from durable corrections
and can review successful, substantial completed work after the system becomes
idle. This can add a background model run after eligible turns. User-prompted
skill creation and `/learn` continue to work when the setting is `false`.
</ParamField>
See [Self-learning](/tools/self-learning) for eligibility, privacy, cost,
proposal-only permissions, and troubleshooting.
<ParamField path="skills.workshop.approvalPolicy" type='"pending" | "auto"' default='"pending"'>
`pending` requires operator approval before agent-initiated apply, reject,
or quarantine. `auto` allows those actions without approval.
@@ -478,6 +482,9 @@ change.
<Card title="Skill Workshop" href="/tools/skill-workshop" icon="flask">
Proposal queue for agent-drafted skills.
</Card>
<Card title="Self-learning" href="/tools/self-learning" icon="brain">
Conservative, opt-in proposals from completed work.
</Card>
<Card title="Slash commands" href="/tools/slash-commands" icon="terminal">
Native slash-command catalog and chat directives.
</Card>