Skill self-improvement discipline
You can improve the skills loaded into this session with the skill_manage
tool. This skill is the long-form version of the injected standing rules; the
short block in your system prompt wins on conflicts.
Default: patch by exception
Most tasks end with no skill write. A write is warranted only when all of these hold:
- The skill itself was part of the task (you read or followed it).
- The gap is a reusable procedure, not a one-off task detail.
- The fix addresses the skill's root cause — a wrong or missing rule — not a symptom you happened to hit.
If any answer is no, note the gap to the user and move on. One-off task details, environment quirks, and always-on facts belong in memory (evolve/munin), never in skills.
Patching (skill_manage patch)
- Same turn. Patch the moment the gap surfaces, while the exact wording is still in context. Do not defer to "later".
- Read first. Patches are refused unless the file was read this session
(
skill_manage reador thereadtool). If the file changed on disk since that read, the patch is refused (hash mismatch) — re-read and re-apply against the current content instead of forcing. - Smallest unique edit.
old_stringmust occur exactly once — include just enough surrounding text to disambiguate. Never rewrite a whole skill file; if you're tempted to, the change is probably not a patch. - Keep the frontmatter honest. The
descriptionis the load gate: if the patch changes what the skill does or when it applies, patch the description in the same pass. First ~57 chars must stand alone as a trigger: "Use when X. One-line behavior." - Nothing is lost. Every patch snapshots the original to the backup dir;
restorereverts if a patch turned out wrong.
Extend, don't fork (skill_manage write)
Content that doesn't fit the SKILL.md body goes into bundled files: write
with file: "references/<topic>.md" (also scripts/, assets/), then patch
the body to point at it. Wrap dependent changes in one operations[] batch —
it validates everything first and commits together, so a half-applied state is
impossible. Extend an existing references file by topic before creating a
sibling skill.
Deleting (skill_manage delete)
Dedup needs lifecycle closure. Delete dead bundled files (with file:) or
whole dead skills (omit file:) — every deletion is fully snapshotted and
restorable. Read the skill first; deletion refuses on a stale read.
Creating (skill_manage create)
Judgment, not counting. Create only when the knowledge is:
- Procedural — steps/rules someone would follow again.
- Non-trivial to rederive — it cost real debugging or a correction loop.
- Plausibly recurring — a different future task would plausibly hit it.
Over-eager creation is a rot vector: redundant skills dilute routing for the
real ones. Names are lowercase-hyphen, 1–64 chars. Body is imperative — one
rule per lesson, no incident narration, never secrets.
Lifecycle
- New skills auto-load next session;
skill_manage createreturns the path — read it immediately to apply the new skill in the current session. listmarks each skill patchable or read-only. Package and node_modules skills are read-only, as are project skills in untrusted projects.- Writable roots:
<agentDir>/skills,<cwd>/.pi/skills(trusted projects), plus theselfskills.skillsDiroverride. Everything else is refused.