Skip to content

improve(skills): learned skills keep repeatable procedures, not facts or codebase knowledge - #167404

Merged
obviyus merged 1 commit into
mainfrom
feat/skill-workshop-prompt-scope
Oct 8, 2026
Merged

obviyus merged 1 commit into
mainfrom
feat/skill-workshop-prompt-scope

Conversation

@obviyus

@obviyus obviyus commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

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: #167404 (comment)

Workshop, skill_workshop tool 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.

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@obviyus

obviyus commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

Skill Workshop prompt scope: real-model /learn before/after

Change under test: prompt text only. src/skills/workshop/skill-authoring-standards.ts (shared authoring standard plus the do-not-capture list, used by the skill_workshop tool description, background review, and /learn) and src/agents/skill-workshop-prompt.ts (system-prompt section). The rule: learned skills are procedures for tasks this user repeats. They are not memory, and they are not knowledge about one codebase, which belongs in that repo's docs/AGENTS.md.

  • Baseline: ff9e8818527 (merge base with origin/main)
  • Candidate: 61c79cafcf4 (feat/skill-workshop-prompt-scope)
  • Model: openai/gpt-6-astra. Every turn's terminal receipt reported effective provider openai, model gpt-6-astra, with no reroute.
  • Entry point: each trial starts a fresh isolated loopback Gateway built from that tree. Scripted user turns go through chat.send, the Control UI/WebChat path that runs the slash-command dispatcher. Each turn is awaited with agent.wait, then /learn is sent as a plain message. I checked that /learn went through the real command path: every trial's runtime transcript contains the server-built instruction ("The user asked you to learn a skill. … Learning request: "Save the reusable workflow from what we just did as a skill.""), not the literal /learn. The candidate-only prompt lines show up in every candidate trial and in no baseline trial.
  • Isolation: every trial got fresh HOME, OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATH, and workspace. Autonomous background review was off (skills.workshop.autonomous.mode: "off"), so a skill change could only come from the foreground turns or /learn.
  • Result: I read <state>/agents/main/agent/workshop-skills/*/SKILL.md and diffed it after each turn, and also collected openclaw skills workshop list --json and changes --json.

Summary: trials with a learned skill after /learn (out of 3)

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 build

Per 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 --json

Scripted user turns (identical on both sides)

  • A / A2 (workspace: tiny git repo ledgerlite; formatCents(1234) returns "$12", but the test expects "$12.34"; npm test is a stub; scripts/check.mjs refuses to run unless LEDGER_TZ=UTC):
    1. "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 test is only a stub here), and any new helper function must be named with the ll prefix, like llPad. Run the tests to confirm."
    2. /learn
  • B (workspace: 7 receipt .txt files, September 2026):
    1. "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."
    2. "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."
    3. /learn
  • C (empty workspace):
    1. "Just so you know: my partner Maya's birthday is 14 March and she loves lilies."
    2. /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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: XS labels Oct 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 2:50 PM ET / 18:50 UTC.

ClawSweeper review

What this changes

The 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

  • Before: The baseline saves ledgerlite-test-fixes containing LEDGER_TZ=UTC node scripts/check.mjs and the ll naming convention.
  • After: The candidate saves no skill and explains that the command and naming convention belong in repository docs or AGENTS.md.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, owner-backed correction with repeated real Gateway proof, useful control scenarios, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The complete exact-head report exercises the changed learning prompts through real isolated Gateways, chat.send, and /learn, with per-trial replies and saved-skill observations showing the intended before/after split. Background review was disabled in these trials, but its consumption of the same guidance is verified in source. No stored format or migration changes occur.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: The agent saves repository conventions and personal facts as learned skills that can clutter unrelated future sessions.
Reason: The demonstrated behavior undermines Workshop's existing purpose of preserving reusable procedures. A prior merged area contributor supplies the scope rationale, and the control trials show useful personal and general procedures remain learnable.

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
Reviewed head: 61c79cafcf48775e0fd46da9395cef41d6e8c175

Before merge

None.

Findings

None.

Agent review details

How this fits together

Skill 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]
Loading

Technical review

Best 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

Testing

Proof path: shipped entry point. Added test files: 0.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit cfee851 adds src/skills/workshop/skill-authoring-standards.ts:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cfee851150c5; files: src/skills/workshop/skill-authoring-standards.ts)
  • Peter Steinberger: Raw commit 970b2d2 adds src/skills/workshop/skill-authoring-standards.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 970b2d257b47; files: src/skills/workshop/skill-authoring-standards.ts)

PR surface

Source +1, Docs +7. Total +8 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 3 2 +1
Tests 0 0 0 0
Docs 2 10 3 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 13 5 +8

Labels

Label changes:

  • add P2: This improves learned-skill relevance across sessions without changing configuration, storage, or transport behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This improves learned-skill relevance across sessions without changing configuration, storage, or transport behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

@obviyus
obviyus merged commit dd0ecdd into main Oct 8, 2026
139 of 142 checks passed
@obviyus
obviyus deleted the feat/skill-workshop-prompt-scope branch October 8, 2026 18:59
@obviyus

obviyus commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

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.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant