Self-learning: harvest golden paths into skills
This skill turns something you just figured out the hard way into a reusable
Agent Skill, so the next session — yours or a teammate's — starts already
knowing the proven route instead of rediscovering it from scratch.
It is a meta-skill: it doesn't do the work, it captures how work got done.
It's tool-neutral — it works with any agent that reads the Agent Skills format
(e.g. Claude Code and Codex, which both load SKILL.md skills natively). Where a
step differs by tool, the generic version comes first and any tool-specific
detail is only an example.
Recognize the moment
Watch for these signals during normal work. Any one of them is a cue to harvest:
- A task only worked after several attempts, wrong turns, or a correction
from the user. The successful path is worth more than the failures around it. - You discovered project-specific facts the agent didn't know up front:
where creds/env vars live, which selector or backend talks to a service, a
non-obvious command, a required sequence, a gotcha that defies the obvious
assumption. - It's an operational workflow likely to recur: reach the dev/prod DB,
deploy, run migrations, seed data, verify a change live, run one specific
test path, rotate a key, tail the right logs. - The user signals it explicitly: "remember this", "save this as a skill",
"don't make me re-explain this next time".
Act on the cue immediately — don't ask for permission first, whether the
user requested it or you noticed it yourself. Harvest the skill, then tell the
user what you captured and where (step 5). They can always edit or delete it.
Skill, memory, or skip?
Not every lesson deserves a whole skill — triage first, so you don't bloat the
skills list with one-liners:
- A multi-step, reusable procedure or workflow (how to deploy, reach the DB,
run the migration dance, verify live) → harvest it as a skill using the
procedure below
(为兼容发布已截断)