Quick Start
How It Works
Frontmatter Fields
Five fields are added toSKILL.md frontmatter when agent_created=True is passed to create_skill, or set manually. The parser accepts both hyphen (agent-created) and underscore (agent_created) forms.
| Field | Frontmatter Key | Type | Default | Written When |
|---|---|---|---|---|
agent_created | agent-created | bool | False | create_skill(agent_created=True) |
created_at | created-at | str (ISO 8601) | None | create_skill() call timestamp |
use_count | use-count | int | 0 | Incremented on each invoke() / get_instructions() |
last_used | last-used | str (ISO 8601) | None | Set on each invoke() / get_instructions() |
patch_count | patch-count | int | 0 | Incremented on each edit_skill() / patch_skill() |
None values.
Telemetry only counts successful activations. If get_instructions() returns None because the skill failed to activate, use-count and last-used are not updated. A broken skill stays at use-count: 0, keeping telemetry trustworthy.
idle_days Helper
SkillProperties.idle_days returns the number of days since the skill was last meaningfully active.
idle_days exposes the data for lifecycle decisions. The policy (what “stale” threshold to apply, when to auto-archive) lives in plugin code, not in core.
Archive / Restore
Directory Layout
<first_skill_dir>/../skills_archive/).
Collision Behaviour
If a skill with the same name already exists inskills_archive/ when archiving, a UTC timestamp suffix is appended: <name>.<YYYYMMDDHHMMSS>. This prevents overwriting a previously archived version.
In-Memory State
archive_skill() removes the skill from the in-memory index immediately. After restore_skill(), call discover() or use the returned path to add it back manually if needed in the same session.
Rollback
rollback_skill() is a single-step undo of the most recent edit_skill() or patch_skill() call.
What saves a snapshot:
edit_skill(name, content)— always saves priorSKILL.mdpatch_skill(name, old, new)whenfile_pathisNoneor"SKILL.md"— saves priorSKILL.md
patch_skill(name, old, new, file_path="scripts/helper.py")— modifying a non-SKILL.md file does not create a.skill.bak
Common Patterns
Self-Improving Agent Loop
Safe Edit-with-Rollback Wrapper
Inspect Telemetry from a Curator Script
Best Practices
Trust the Recoverable Default
Trust the Recoverable Default
delete_skill() archives by default. Only pass hard=True when you mean it. The archive store lets you recover skills that were accidentally retired.Don't Chain Edits Expecting Multi-Step Undo
Don't Chain Edits Expecting Multi-Step Undo
Each
edit_skill or patch_skill overwrites .skill.bak. If you need to preserve multiple prior versions, copy SKILL.md externally before each edit, or use a version control system for the skills directory.Telemetry Counts Successful Activations Only
Telemetry Counts Successful Activations Only
get_instructions() returns None when a skill fails to activate, and in that case use-count and last-used are not updated. A skill that is broken will not appear to be active in your telemetry — safe to archive without inflating its apparent usage.Curator Policy Belongs in Plugins
Curator Policy Belongs in Plugins
idle_days and the provenance fields expose the data needed to make lifecycle decisions. The policy — what idle threshold triggers archiving, whether agent-created skills get different treatment — belongs in plugin code or your own scripts, not in application code. This keeps core behaviour predictable.Verify After Restore
Verify After Restore
After
restore_skill(), call mgr.discover() (or mgr.add_skill(path)) to re-index the skill in the current session. restore_skill() moves the directory but does not automatically re-add it to the in-memory index.Related
Skill Manage
Create, edit, patch, archive, and delete skills — full action reference
Skills (Concepts)
What skills are and how they work

