Repository navigation
improve(skills): learned skills keep repeatable procedures, not facts or codebase knowledge - #167404
Conversation
…not memory or codebase knowledge
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Skill Workshop prompt scope: real-model
|
| Scenario | Baseline | Candidate | Expected on candidate |
|---|---|---|---|
| A2: codebase knowledge (repo test command + env var + helper naming rule; one-line fix) | 3/3 (ledgerlite-test-fixes, all embed LEDGER_TZ=UTC node scripts/check.mjs and the ll prefix) |
0/3. All three replies say the command and naming rule belong in the repo's docs/AGENTS.md |
no skill ✅ |
A: same repo, but the runner also had a real Node 24 bug (node --test checks/ fails), so the agent had to debug it |
3/3 (ledgerlite-test-*, repo command/env/prefix embedded) |
3/3, but generic (node-test-fix, node-test-regression-repair, node-test-failure-repair), with 0/3 containing LEDGER_TZ, ledgerlite, or llPad. Each skill ends with "keep repository-specific commands … in repository documentation" |
see note |
| B: control: personal monthly receipt → expense CSV with a user correction | 3/3 (monthly-expense-csv) |
3/3 (monthly-expense-csv ×2, monthly-receipt-expenses) |
skill saved ✅ (no regression) |
| C: plain personal fact (partner's birthday, flowers) | 1/3 (remember-personal-details: a generic "save a memory" procedure) |
0/3. All three say facts belong in memory | no skill ✅ |
Note on A: I wrote A first. The seed runner used node --test checks/, which fails on Node v24.21.0, so the agent had to diagnose and fix test discovery too. That is a hard, transferable debugging step, not just repo knowledge. Under the candidate, the model kept that generic lesson and removed every repo-specific fact from the skill. That is consistent with the new standard, but the result is not "no skill". A2 is the scenario as specified (only the repo convention is non-obvious, and the runner works). It is otherwise byte-identical, with the same user turns, and there the candidate saved nothing 3/3.
Note on B: on both sides the foreground agent created the skill on the correction turn ("redo it the way I always want it … I do this every month"), following the system-prompt rule to save after hard work the user will repeat. /learn then patched it. Skill changes per turn were [0, 1, 1] in all 6 B trials.
Per-trial results
| Trial | Learned skill after /learn (name: description) |
Agent's final /learn reply (trimmed) |
|---|---|---|
| A2 / baseline / 1 | ledgerlite-test-fixes: When fixing failing LedgerLite tests, reproduce the failure, make a focused change, and verify with the repository runner. |
💾 Learned: Created ledgerlite-test-fixes with the reproduce–fix–verify workflow, LEDGER_TZ=UTC node scripts/check.mjs, and the ll helper-prefix convention. Skill validation passed. Say undo to revert. |
| A2 / baseline / 2 | ledgerlite-test-fixes: When fixing failing LedgerLite tests or changing money formatting, produce a minimal fix verified with the repository test runner. |
💾 Learned: Created and validated ledgerlite-test-fixes, covering the test-fix workflow, LEDGER_TZ=UTC node scripts/check.mjs, and the ll helper prefix. Say undo to remove this new skill. |
| A2 / baseline / 3 | ledgerlite-test-fixes: When fixing failing tests in LedgerLite, reproduce the failure, apply a focused fix, and verify with the repository test runner. |
💾 Learned: Created and validated ledgerlite-test-fixes, covering the reproduce–fix–verify workflow, LEDGER_TZ=UTC node scripts/check.mjs, and ll helper naming. Say undo to revert. |
| A2 / candidate / 1 | none | No skill created: this was a small, generic test fix. The test command and ll naming convention are repo-specific and belong in repository docs, not a learned skill. Memory recall was unavailable; I used the visible conversation. Nothing changed, so no undo is needed. |
| A2 / candidate / 2 | none | No skill changed: this was a one-line fix, and the durable details—the test command and helper naming rule—belong in this repository’s docs or AGENTS.md, not a learned skill. Memory recall was unavailable; I reviewed this conversation directly. |
| A2 / candidate / 3 | none | No skill saved. This was a one-line fix; the test command and helper-naming convention belong in this repo’s docs, not a reusable skill. Nothing changed. Memory recall was partial because index repair was requested; I reviewed this conversation directly. |
| A / baseline / 1 | ledgerlite-test-repair: When fixing failing tests in LedgerLite, reproduce the failure, apply a focused repair, and verify using the repo's UTC test runner. |
💾 Learned: created and validated ledgerlite-test-repair, covering the UTC test command, ll helper naming, focused repairs, and verification. Say undo to revert. |
| A / baseline / 2 | ledgerlite-test-fixes: When fixing LedgerLite test failures or changing money formatting, apply repo conventions and verify with the UTC test runner. |
💾 Learned: created and validated ledgerlite-test-fixes, covering the UTC test command, ll helper naming, and fix-verification workflow. Say undo to revert this skill creation. |
| A / baseline / 3 | ledgerlite-test-fixes: Fixing LedgerLite test failures or money formatting: reproduce the failure, apply a focused fix, and verify with the UTC test runner. |
💾 Learned ledgerlite-test-fixes: saved and validated the workflow, including the UTC test command, ll helper naming, and verification steps. Say undo to revert. |
| A / candidate / 1 | node-test-fix: Failing Node.js tests or test-runner discovery errors: produce a minimal fix verified through the repository's required test command. |
💾 Learned: created and validated node-test-fix for diagnosing test failures, fixing runner discovery, and verifying minimal fixes. Repository-specific conventions were excluded. Say undo to revert. |
| A / candidate / 2 | node-test-regression-repair: Failing Node.js tests; test-runner discovery failures: repair the implementation and verify with the repository's prescribed command. |
💾 Learned: created and validated node-test-regression-repair for diagnosing, fixing, and verifying Node.js test failures. Repo-specific conventions were excluded. Say undo to revert. |
| A / candidate / 3 | node-test-failure-repair: When fixing failing Node.js tests, inspect repository conventions, separate runner failures from assertion failures, and verify a focused repair. |
💾 Learned node-test-failure-repair: a validated workflow for diagnosing, fixing, and verifying Node.js test failures. Repo-specific conventions were excluded. Say undo to revert. |
| B / baseline / 1 | monthly-expense-csv: For monthly budget expenses or receipt-to-CSV tasks, create the user's date-sorted expense CSV with exact columns and a final total. |
💾 Updated monthly-expense-csv with the reusable workflow: your category mapping, exact columns, two-decimal amounts, ascending dates, final total row, and validation checks. Say undo to revert this skill update. |
| B / baseline / 2 | monthly-expense-csv: Monthly budget expenses from receipt text files; create a categorized, date-sorted CSV with the user's exact columns and total row. |
💾 Updated monthly-expense-csv with the reusable receipt-processing workflow, category mapping, and your exact monthly CSV format. Say undo to revert this skill update. |
| B / baseline / 3 | monthly-expense-csv: Monthly budget expense CSVs from receipt text files; apply the user's category mapping, exact columns, date ordering, and total row. |
💾 Updated monthly-expense-csv with the reusable receipt workflow, category mapping, exact column order, two-decimal amounts, date sorting, and final TOTAL row. Say undo to revert this skill update. |
| B / candidate / 1 | monthly-expense-csv: Convert receipt text files into a monthly budget expense CSV with the user's category mapping, exact columns, and final total row. |
💾 Updated monthly-expense-csv with explicit receipt-reading steps, preserving your category mapping, exact column order, two-decimal amounts, date sorting, and final TOTAL row. Say undo to revert this update. |
| B / candidate / 2 | monthly-expense-csv: When converting monthly receipt text files into a budget expense CSV, apply the user's category mapping, exact columns, and final total row. |
💾 Learned: Updated monthly-expense-csv with the reusable receipt workflow, category mapping, exact columns, two-decimal amounts, date sorting, and final TOTAL row. Say undo to revert this skill update. |
| B / candidate / 3 | monthly-receipt-expenses: Monthly budget receipt conversion; create an expense CSV from receipt text files with categorized rows and a final total. |
💾 Updated monthly-receipt-expenses with the reusable receipt-parsing workflow, category mapping, exact CSV format, sorting, and total validation. Say undo to revert this skill update. |
| C / baseline / 1 | none | No skill created: this exchange saved personal facts, not a reusable workflow. Maya’s birthday and flower preference remain in memory; no skills were changed. |
| C / baseline / 2 | remember-personal-details: When the user shares personal details to remember, save a concise durable memory and acknowledge it. |
💾 Learned remember-personal-details: a validated workflow for saving and verifying user-shared details in memory. Maya’s personal facts are excluded from the skill. Say undo to revert. |
| C / baseline / 3 | none | No skill created. This was a one-off personal-memory update, with no new reusable procedure to capture. Personal facts belong in memory, not skills. |
| C / candidate / 1 | none | No skill changed: we only saved personal facts, not a reusable workflow. Maya’s birthday and love of lilies remain saved in memory. |
| C / candidate / 2 | none | This was a one-off personal-memory update, not a reusable workflow. Maya’s birthday and flower preference belong in memory, so I left skills unchanged. |
| C / candidate / 3 | none | There’s no reusable workflow to save: we only recorded personal facts, which belong in memory, not a skill. Maya’s details remain saved; no skills were changed. |
Infrastructure note: the first batch ran 9 lanes in parallel. Three candidate trials (A/3, B/1, B/3) failed before any model call with Gateway not reachable … Opening handshake has timed out (load during Gateway startup). I reran them unchanged at lower concurrency, and the table shows the reruns. No trial was dropped or cherry-picked.
Exact commands
Build each tree once with isolated state:
wt switch --create sw-prompt-baseline --base ff9e8818527accde219a9e4da9c7e0ea25a2f04c --no-cd --no-hooks
# in each tree:
OPENCLAW_STATE_DIR=<build-state> OPENCLAW_CONFIG_PATH=<build-config> pnpm install --frozen-lockfile
OPENCLAW_STATE_DIR=<build-state> OPENCLAW_CONFIG_PATH=<build-config> pnpm buildPer trial (driver trial.py <side> <scenario> <n> <port>), with fresh <home>, <state>, <config>, <workspace>:
# config: gateway.mode=local, bind loopback, throwaway token auth;
# agents.defaults.model.primary="openai/gpt-6-astra"; agents.defaults.workspace=<workspace>;
# agents.defaults.skipBootstrap=true; skills.workshop.autonomous.mode="off".
# The provider key comes only from the environment (no key in config).
HOME=<home> OPENCLAW_STATE_DIR=<state> OPENCLAW_CONFIG_PATH=<config> OPENAI_API_KEY=$OPENAI_API_KEY \
node <tree>/openclaw.mjs gateway run --port <port> --bind loopback
# each scripted user turn, then "/learn":
HOME=<home> OPENCLAW_STATE_DIR=<state> OPENCLAW_CONFIG_PATH=<config> \
node <tree>/openclaw.mjs gateway call chat.send --port <port> --json \
--params '{"sessionKey":"agent:main:proof","message":"<turn>","deliver":false,"idempotencyKey":"<uuid>"}'
HOME=<home> OPENCLAW_STATE_DIR=<state> OPENCLAW_CONFIG_PATH=<config> \
node <tree>/openclaw.mjs gateway call agent.wait --port <port> --json --timeout 430000 \
--params '{"runId":"<runId>","timeoutMs":420000}'
# after the conversation:
node <tree>/openclaw.mjs gateway call chat.history --port <port> --json --params '{"sessionKey":"agent:main:proof","limit":200}'
node <tree>/openclaw.mjs skills workshop list --json
node <tree>/openclaw.mjs skills workshop changes --jsonScripted user turns (identical on both sides)
- A / A2 (workspace: tiny git repo
ledgerlite;formatCents(1234)returns"$12", but the test expects"$12.34";npm testis a stub;scripts/check.mjsrefuses to run unlessLEDGER_TZ=UTC):- "The formatCents test in this repo is failing. Please fix it. Repo conventions: run the tests with
LEDGER_TZ=UTC node scripts/check.mjs(npm testis only a stub here), and any new helper function must be named with thellprefix, likellPad. Run the tests to confirm." /learn
- "The formatCents test in this repo is failing. Please fix it. Repo conventions: run the tests with
- B (workspace: 7 receipt
.txtfiles, September 2026):- "Turn the receipt text files in ./receipts into my September expense CSV at ./expenses-2026-09.csv. Category mapping: grocery stores (Trader Joe's, Safeway) -> Groceries, fuel stations (Shell, Chevron) -> Transport, restaurants and cafes -> Dining, anything else -> Other."
- "Close, but redo it the way I always want it: columns in exactly this order: date,category,merchant,amount; amounts with two decimals and no currency symbol; rows sorted by date ascending; and a final row
TOTAL,,,<sum>. I do this every month for my budget." /learn
- C (empty workspace):
- "Just so you know: my partner Maya's birthday is 14 March and she loves lilies."
/learn
Takeaways
- Codebase knowledge (A2): baseline saved a repo-specific skill 3/3. Candidate saved 0/3 and pointed to the repo's docs/
AGENTS.md. - Mixed case (A): when the work also contained a real, transferable debugging step, the candidate still saved a skill. But it was generic, and all repo-specific commands, env vars, and naming rules were removed (0/3 vs 3/3 on baseline).
- Personal facts (C): baseline turned a fact into a "remember personal details" skill 1/3. Candidate did that 0/3.
- Control (B): personal repeatable procedures are still saved 3/3 on both sides. No regression.
|
Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 2:50 PM ET / 18:50 UTC. ClawSweeper reviewWhat this changesThe PR clarifies that learned skills capture repeatable procedures, while personal facts belong in memory and repository-specific knowledge belongs in repository documentation. Example: The user sends /learn after fixing a LedgerLite test
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful: current main lacks the clarified scope, and real Gateway before/after evidence supports the change. No blocking patch defects were found. Likely related people: obviyus and steipete, both high-confidence routing candidates from merged area history. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSkill Workshop saves procedures that an agent can reuse in later sessions. Shared instructions guide foreground learning, the /learn command, and background conversation reviews before the existing Workshop tool writes a skill. flowchart TD
A[Conversation and user corrections] --> B[Foreground learning or background review]
C[User sends learn command] --> B
B --> D[Shared skill authoring guidance]
D --> E{Repeatable procedure?}
E -->|Yes| F[Create or update learned skill]
E -->|Facts or repository knowledge| G[Explain memory or repository documentation destination]
Technical reviewBest possible solution: Keep learning decisions in the existing shared prompt owner, preserving general and personal procedures while directing facts to their established storage owners. Do we have a high-confidence way to reproduce the issue? Yes: the contributor provides repeated Gateway before/after trials with identical user turns and observed saved skills. The relevant baseline modules are unchanged on fetched main; this reviewer did not execute a current-main run. Is this the best way to solve the issue? Yes: clarifying the existing shared learning instructions addresses the demonstrated misclassification without adding heuristics, another writer, or configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1339b6fd3e73. Provenance checked
TestingProof path: shipped entry point. Added test files: 0. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Docs +7. Total +8 across 4 files. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment |
|
Landed in dd0ecdd. Learned skills now hold repeatable procedures. Facts go to memory, and one codebase's knowledge goes to its docs or AGENTS.md. Real-model before/after: codebase-knowledge skills dropped from 3/3 to 0/3, and personal procedures stayed at 3/3. |
… or codebase knowledge (openclaw#167404) ## What Problem This Solves Agents saved learned skills for things that are not procedures: facts about the user (a birthday) and knowledge about one codebase (its test command, env vars, naming rules). Facts belong in memory. Codebase knowledge belongs in that repository's docs or `AGENTS.md`, and as a learned skill it loads in every session of the agent, including unrelated projects. ## User Impact Learned skills now hold procedures for tasks the user repeats, so the agent does not work them out from scratch again. When asked to `/learn` codebase specifics or a plain fact, the agent says where that belongs instead of creating a skill. Personal procedures are still learned as before. No config or stored-data change. ## Why This Change Was Made Skill Workshop is designed for a personal claw: its skills are agent-wide, while a repository already has an owner for its own conventions. The prompts now say so in the places that decide what gets saved: - The shared authoring standard (used by the `skill_workshop` tool description, the background review, and `/learn`) opens with "a skill is a procedure, not memory": the method for one class of task this user repeats, so the next run starts from what worked. Facts with no method attached belong in memory. - The do-not-capture list (background review and `/learn`) adds knowledge about one codebase, which belongs in the repository's docs or `AGENTS.md`. - The always-on Skill Workshop system-prompt section carries both points in one clause each, so the foreground agent follows them too. The coding rule is scoped to one codebase's knowledge, not to all coding work, so personal procedures that happen to involve code (for example "how I publish my blog") are still learned. The docs describe the same scope. ## Evidence Real-model before/after with `openai/gpt-6-astra`. For each trial, a fresh isolated Gateway was built from either the merge base or this branch, scripted user turns were sent through the normal WebChat path (`chat.send`), and then `/learn` was sent. Every trial confirmed that the model received the server-built learn instruction. Background review was off, so any skill change came from the conversation or `/learn`. There were 3 trials per side, and the user turns were identical on both sides. | Scenario | Base: skill saved | This PR: skill saved | |---|---|---| | Codebase knowledge: fix a failing test that needs a repo-specific command, env var and naming rule | 3/3 (skill contains the repo's command and prefix) | 0/3 (each reply says it belongs in the repo's docs/`AGENTS.md`) | | Control: personal receipts-to-monthly-CSV procedure with one user correction | 3/3 | 3/3 | | Plain personal fact (a birthday and a preference) | 1/3 | 0/3 (replies point to memory) | A variant of the codebase scenario also required debugging a general Node test-runner issue. There, this branch kept a generic skill for that lesson with every repo-specific detail removed (no repo command, env var or naming rule). That is the intended split: general methods stay, and codebase facts go to the repository. Full report, with per-trial results, exact commands and scripted turns: openclaw#167404 (comment) Workshop, `skill_workshop` tool and agentsapi tests pass; no test pins this prompt text. No overlap with Pash/Sarah changes. **Merge danger:** two-way door. The change is prompt and docs text only, and a revert fully restores the previous wording. It writes no state and changes no config or published contract. The blast radius is what agents choose to save as learned skills. Existing skills are untouched, and sessions already running keep their current system prompt until the next session. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Agents saved learned skills for things that are not procedures: facts about the user (a birthday) and knowledge about one codebase (its test command, env vars, naming rules). Facts belong in memory. Codebase knowledge belongs in that repository's docs or
AGENTS.md, and as a learned skill it loads in every session of the agent, including unrelated projects.User Impact
Learned skills now hold procedures for tasks the user repeats, so the agent does not work them out from scratch again. When asked to
/learncodebase specifics or a plain fact, the agent says where that belongs instead of creating a skill. Personal procedures are still learned as before. No config or stored-data change.Why This Change Was Made
Skill Workshop is designed for a personal claw: its skills are agent-wide, while a repository already has an owner for its own conventions. The prompts now say so in the places that decide what gets saved:
skill_workshoptool description, the background review, and/learn) opens with "a skill is a procedure, not memory": the method for one class of task this user repeats, so the next run starts from what worked. Facts with no method attached belong in memory./learn) adds knowledge about one codebase, which belongs in the repository's docs orAGENTS.md.The coding rule is scoped to one codebase's knowledge, not to all coding work, so personal procedures that happen to involve code (for example "how I publish my blog") are still learned. The docs describe the same scope.
Evidence
Real-model before/after with
openai/gpt-6-astra. For each trial, a fresh isolated Gateway was built from either the merge base or this branch, scripted user turns were sent through the normal WebChat path (chat.send), and then/learnwas sent. Every trial confirmed that the model received the server-built learn instruction. Background review was off, so any skill change came from the conversation or/learn. There were 3 trials per side, and the user turns were identical on both sides.AGENTS.md)A variant of the codebase scenario also required debugging a general Node test-runner issue. There, this branch kept a generic skill for that lesson with every repo-specific detail removed (no repo command, env var or naming rule). That is the intended split: general methods stay, and codebase facts go to the repository.
Full report, with per-trial results, exact commands and scripted turns: #167404 (comment)
Workshop,
skill_workshoptool and agentsapi tests pass; no test pins this prompt text.Merge danger: two-way door. The change is prompt and docs text only, and a revert fully restores the previous wording. It writes no state and changes no config or published contract. The blast radius is what agents choose to save as learned skills. Existing skills are untouched, and sessions already running keep their current system prompt until the next session.