Evolve skills safely from real session feedback by persisting structured learnings (`evolution.json`) and stitching an idempotent 'Learned' section into `SKILL.md`. Supports updating both PKB_PATH canonical skills and any local installed skill copies (best-effort) without installing for all agents.
This skill helps you continuously improve skills based on real sessions, without losing fixes when skills are updated.
It does this by:
evolution.json, andSKILL.md (idempotent re-apply).This is adapted from KKKKhazix/Khazix-Skills (MIT) and made pkbllm-compatible.
bootstrap/, common/, human/, knowledge/, productivity/.skills/ is generated. Never edit it by hand..agents/skills or ~/.codex/skills) are not canonical and are often gitignored.If you evolve canonical skills, regenerate mirrors:
python bootstrap/scripts/update_skills_mirror.py all
skills/ by hand: only update canonical + regenerate.evolution.json)Each evolved skill keeps a sibling file:
<skill_dir>/
├── SKILL.md
└── evolution.json
Schema (see assets/evolution.schema.json):
preferences: user preferences / defaultsfixes: concrete fixes (platform quirks, known issues)pitfalls: common mistakes to avoidverification: commands/checks to run before claiming successexamples: short “worked examples” (command + expected snippet)For each invoked skill:
Produce a JSON object matching the schema. Keep each item short, specific, and testable when possible.
Apply to a single skill name:
python scripts/apply_evolution.py --skill-name uv-hands-on-learning --scope both --json '{"pitfalls":["Always keep raw logs under results/ (gitignored) and copy only small excerpts into evidence/."], "verification":["Confirm no tracked files under any hands_on/**/results/." ]}'
Scopes:
pkb: update canonical skill under PKB_PATH (or inferred repo root)local: update locally installed copies (default: project scope + ~/.codex/skills)both: do bothWhen skills are updated/refactored, re-stitch to re-apply the learned section:
python scripts/align_all.py --scope pkb
python scripts/align_all.py --scope local
Before saying “evolution applied”:
SKILL.md contains a single Learned section bounded by markers.evolution.json is valid JSON and contains only schema fields.python bootstrap/scripts/update_skills_mirror.py all.Checklist: references/review.md
skills/ directly instead of canonical.Expanded list: references/pitfalls.md
scripts/apply_evolution.py: apply a JSON delta to pkb, local, or both scopes.scripts/merge_evolution.py: merge JSON delta into evolution.json (dedupe, stable).scripts/smart_stitch.py: update/insert the bounded Learned section in SKILL.md.scripts/align_all.py: re-stitch all skills that have an evolution.json.assets/evolution.schema.jsonassets/evolution.example.jsonassets/learned_section_template.md