Update skill
update_skill · Tools · Knowledge
Change a skill by patch, or rename it
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
description | string | No | A new routing hint of at most 12 words. |
patch | string | No | Hunks to apply to the text, each opened by a line starting @@. |
skill | string | Yes | The skill's slug or id. |
title | string | No | A new title. The slug stays the same. |
Update Skill Tool#
update_skill changes a skill by patch instead of rewriting it, and renames or redescribes it.
When to Use#
The agent uses it to change part of a skill it loaded with load_skill. Built-in skills cannot be changed: the agent asks the user to copy one in Settings → Skills first, and the copy then replaces it in the workspace.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
skill |
string | Yes | The skill's slug or id |
patch |
string | No | Hunks to apply to the text |
title |
string | No | A new title; the slug stays the same |
description |
string | No | A new routing hint |
At least one of patch, title and description is given.
A patch is hunks. A hunk starts with a line beginning @@; anything after the @@ is ignored. Then come the lines around the change prefixed with a space, removed lines with -, and added lines with +. Unchanged and removed lines are copied exactly from the text load_skill returned. A hunk of only + lines appends to the end.
@@
## Review checklist
-- Tests pass
+- Tests pass, and each new test fails without the change
- Names say what the thing is
Every hunk must match exactly one place in the text, trailing whitespace aside. If any hunk does not, nothing changes.
Returns#
| Field | Type | Description |
|---|---|---|
slug |
string | The skill's slug |
revision |
integer | Its new revision |
landed |
array | For each hunk: hunk (its number), lines (where it landed now, such as 3-4, 7, or removed before line 5) and preview (those lines, numbered) |
landed is empty when only the title or description changed. The agent can send its next patch from the preview without loading the skill again.
Example Scenario#
{
"skill": "code-review",
"patch": "@@\n ## Tone\n+- Findings first; praise only when it is specific.\n"
}
Notes#
- A hunk that matches nothing is refused with the lines it expected and the closest current lines, numbered, under
Patch not applied; the skill is unchanged. - A hunk that matches more than one place is refused with the lines it matches: add unchanged lines above or below it until it matches one
- A patch that leaves the text as it was is refused
- A built-in skill is refused:
"`<slug>` is a built-in skill. Ask the user to copy it in Settings → Skills; the copy then replaces it here and can be updated." - The write carries no revision: a patch anchors on the text, so one made from a stale read fails to match rather than overwriting. A write another write beat is tried again on the current text, up to three times
- Risk: write