Skip to content

perf(agents): slim Skill Workshop prompt section to its routing contract#100481

Merged
steipete merged 1 commit into
mainfrom
feat/workshop-prompt-slim-65fd03
Jul 6, 2026
Merged

perf(agents): slim Skill Workshop prompt section to its routing contract#100481
steipete merged 1 commit into
mainfrom
feat/workshop-prompt-slim-65fd03

Conversation

@steipete

@steipete steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Whenever the skill_workshop tool is available, every conversation carries a 13-line system-prompt section that restates the manual-write prohibition three times and embeds per-action mechanics (create/update/revise selection, proposal_id resolution, the 160-byte description limit, list/inspect rules) that only matter mid-tool-use. That is recurring token cost on every API call, and community feedback on the tone has been blunt — the workaround being shared is disabling the skill_workshop tool entirely, which silently kills proposal review.

Closes #100449.

Why This Change Was Made

  • src/agents/skill-workshop-prompt.ts: the section body is now two lines — route durable skill work through skill_workshop / never write proposal or skill files directly, and proposals stay pending unless the user explicitly asks to apply/reject/quarantine. The injection gate (section present only when the tool is available) is unchanged.
  • src/agents/tools/skill-workshop-tool.ts: action-selection semantics, name-based proposal resolution, and the description limit now live in the tool's parameter descriptions — the surface the model reads at tool-use time — compressed so the schema grew only marginally.
  • Net effect (UTF-8 prompt text + compact JSON schema): prompt section 2,128 → 319 bytes; tool schema 2,273 → 2,298 bytes; combined −1,784 bytes per request for affected sessions.
  • The routing contract itself is intentionally preserved: durable skill writes still go through the reviewable proposal flow. This PR changes how much prompt real estate that contract occupies, not what it enforces.

User Impact

Evidence

  • Prompt snapshots regenerated: byte-identical, no fixture drift (pnpm prompt:snapshots:check passed — snapshot fixtures do not enable the workshop tool).
  • Focused tests updated to behavior contracts (section ≤4 lines, routing + pending-by-default rules present; schema describes action selection and discovery) and passing on Blacksmith Testbox: src/agents/system-prompt.test.ts, src/agents/tools/skill-workshop-tool.test.ts.
  • Structured second-model review (Codex, gpt-5.5): no actionable findings.
  • Release-note context: user-facing perf/fix — Skill Workshop system-prompt section slimmed to its routing contract (~1.8KB/request saved); action mechanics moved into the tool schema.

…act (#100449)

Prompt section drops from 13 lines to 2 (2128 -> 319 bytes); action
mechanics move into the skill_workshop tool schema (+25 bytes), for a
net -1784 bytes per request on affected sessions. Routing contract and
approval flow unchanged.
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Jul 5, 2026
@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 6:47 PM ET / 22:47 UTC.

Summary
The branch shortens the Skill Workshop system-prompt section, moves action-selection details into the skill_workshop tool schema descriptions, and updates focused prompt/tool tests.

PR surface: Source -10, Tests -1. Total -11 across 4 files.

Reproducibility: yes. Source inspection reproduces the current prompt-cost issue: current main and v2026.6.11 still emit the long Skill Workshop section, while the PR head shortens it and moves mechanics into schema descriptions.

Review metrics: 1 noteworthy metric.

  • Prompt/schema size claim: prompt -1,809 bytes, schema +25 bytes, combined -1,784 bytes claimed. The size reduction is the main benefit, so maintainers should see it verified by real prompt/schema output before merge.

Stored data model
Persistent data-model change detected: serialized state: src/agents/tools/skill-workshop-tool.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #100449
Summary: This PR is the direct candidate implementation for the linked Skill Workshop prompt/schema split issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add a redacted terminal transcript or copied live output dumping the generated Skill Workshop prompt section and skill_workshop schema from this head.
  • Include the before/after byte count command output or artifact so the claimed prompt-token saving is independently visible.
  • Get maintainer confirmation that the shortened wording is the intended Skill Workshop routing contract.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body provides byte counts plus snapshot/focused-test evidence, but no live prompt/schema output or redacted agent transcript showing the changed behavior after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] This is model-facing policy text for a governed skill-write path; CI can check strings, but it cannot prove the slimmer wording preserves agent behavior in real sessions.
  • [P1] The PR body cites byte counts and tests, but it does not include a redacted terminal transcript, prompt dump, or agent-run artifact showing the changed prompt/schema in a real setup.

Maintainer options:

  1. Require real prompt/schema proof (recommended)
    Before merge, require a redacted prompt/schema dump or agent transcript from this head showing the slimmer text and preserved skill_workshop routing contract.
  2. Accept wording risk
    Maintainers may intentionally merge the smaller wording based on code review and CI, accepting that real-session model compliance is not directly proven.
  3. Pause for wording redesign
    Pause this PR if maintainers want a different prompt contract or a broader Skill Workshop UX direction before changing the system prompt.

Next step before merge

  • [P1] No automated code repair is identified; the remaining blockers are maintainer wording approval and contributor-provided real behavior proof.

Maintainer decision needed

  • Question: Should OpenClaw accept this slimmer Skill Workshop prompt/schema wording as sufficient to preserve the governed proposal-routing contract?
  • Rationale: The code change is small, but the tradeoff is product and safety wording: less repeated prompt text versus less redundancy around a reviewable skill-write boundary.
  • Likely owner: steipete — Peter opened the protected linked request and is the strongest current routing candidate for the prompt wording decision.
  • Options:
    • Approve after proof (recommended): Accept the slim prompt/schema split once the PR includes a real prompt/schema dump or transcript showing the updated model-facing surface.
    • Tighten wording first: Ask for one extra sentence that explicitly says lifecycle changes also go through skill_workshop, then re-review the smaller wording change.
    • Keep verbose guardrails: Leave the current repeated instructions in place if maintainers prefer redundancy over prompt-token savings for this boundary.

Security
Cleared: No supply-chain, secrets, dependency, or code-execution regression was found; the model-facing routing-wording concern is tracked as merge risk.

Review details

Best possible solution:

Land the narrow prompt/schema split only after maintainer approval of the exact routing wording and after adding real prompt/schema proof that the proposal-first contract remains visible.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection reproduces the current prompt-cost issue: current main and v2026.6.11 still emit the long Skill Workshop section, while the PR head shortens it and moves mechanics into schema descriptions.

Is this the best way to solve the issue?

Mostly yes, pending maintainer wording approval and proof. Moving per-action mechanics from always-paid system prompt text into tool parameter descriptions is the narrowest maintainable shape for the requested cleanup.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a905eb42acda.

Label changes

Label changes:

  • add P2: This is a normal-priority prompt-cost and UX improvement for sessions where skill_workshop is available, not an emergency runtime break.
  • add merge-risk: 🚨 security-boundary: The PR changes model-facing instructions that protect the governed proposal path for generated skill writes, and CI cannot fully prove real-session compliance.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides byte counts plus snapshot/focused-test evidence, but no live prompt/schema output or redacted agent transcript showing the changed behavior after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a normal-priority prompt-cost and UX improvement for sessions where skill_workshop is available, not an emergency runtime break.
  • merge-risk: 🚨 security-boundary: The PR changes model-facing instructions that protect the governed proposal path for generated skill writes, and CI cannot fully prove real-session compliance.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides byte counts plus snapshot/focused-test evidence, but no live prompt/schema output or redacted agent transcript showing the changed behavior after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source -10, Tests -1. Total -11 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 5 15 -10
Tests 2 26 27 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 31 42 -11

What I checked:

  • Current main still has the verbose prompt section: Current main still emits the long Skill Workshop section with action mechanics, manual-write prohibitions, proposal discovery, and lifecycle guidance in the system prompt. (src/agents/skill-workshop-prompt.ts:11, a905eb42acda)
  • Prompt injection gate is unchanged on main: The Skill Workshop section is injected only when availableTools contains skill_workshop, so the requested change is scoped to the section contents. (src/agents/system-prompt.ts:969, a905eb42acda)
  • PR head preserves the routing contract in shortened text: The proposed prompt still tells the model to route durable skill work through skill_workshop and never write proposal or skill files directly. (src/agents/skill-workshop-prompt.ts:11, 47ce4522b6ed)
  • PR head moves mechanics into tool schema descriptions: The action, name, and description schema text now carries create/update/revise semantics, pending-proposal discovery, candidate resolution, and the 160-byte description note. (src/agents/tools/skill-workshop-tool.ts:58, 47ce4522b6ed)
  • Docs confirm Skill Workshop is the governed write path: The user-facing docs say generated skill work must use skill_workshop and must not create or change proposal files through file tools or shell operations. Public docs: docs/tools/skill-workshop.md. (docs/tools/skill-workshop.md:164, a905eb42acda)
  • Latest release has not shipped the slim prompt: The latest release tag still contains the long Skill Workshop prompt and current-style schema descriptions, so the linked issue remains unsolved until this or another PR lands. (src/agents/skill-workshop-prompt.ts:11, e085fa1a3ffd)

Likely related people:

  • steipete: Peter opened the protected linked issue and PR, and local history shows him as the dominant contributor across the affected system-prompt and tool-description files. (role: likely decision owner and prompt/tool surface contributor; confidence: high; commits: 3522224b25a7, 31f5463a1c5a, 1dc3da6edaf3; files: src/agents/system-prompt.ts, src/agents/system-prompt.test.ts, src/agents/tools/skill-workshop-tool.ts)
  • shakkernerd: Shakker authored the merged Skill Workshop feature PR that added the built-in tool, proposal service, routing boundary, docs, and tests. (role: feature introducer; confidence: high; commits: dcc329ac09ee, 3e7d869ef606; files: src/agents/tools/skill-workshop-tool.ts, src/agents/system-prompt.ts, src/skills/workshop/service.ts)
  • momothemage: Momo authored the merged cleanup that prevented skill-creator from bypassing the Skill Workshop proposal path, which is the same governed-write boundary this prompt protects. (role: adjacent boundary contributor; confidence: medium; commits: 8c5d1dca7822, 8eca1654472e; files: skills/skill-creator/SKILL.md, skills/skill-creator/scripts/init_skill.py)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 5, 2026
@steipete
steipete merged commit 1090d2a into main Jul 6, 2026
148 of 157 checks passed
@steipete
steipete deleted the feat/workshop-prompt-slim-65fd03 branch July 6, 2026 03:54
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
…act (openclaw#100449) (openclaw#100481)

Prompt section drops from 13 lines to 2 (2128 -> 319 bytes); action
mechanics move into the skill_workshop tool schema (+25 bytes), for a
net -1784 bytes per request on affected sessions. Routing contract and
approval flow unchanged.
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
…act (openclaw#100449) (openclaw#100481)

Prompt section drops from 13 lines to 2 (2128 -> 319 bytes); action
mechanics move into the skill_workshop tool schema (+25 bytes), for a
net -1784 bytes per request on affected sessions. Routing contract and
approval flow unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Slim the Skill Workshop system-prompt section; move mechanics into the tool schema

1 participant