Skip to main content
Agent-created skills carry provenance metadata and usage telemetry that lets you track, archive, restore, and roll back skills across their entire lifetime.
The user teaches a workflow; lifecycle tools track creation, usage, archive, and rollback.

Quick Start

1

Create a Skill with Provenance

The resulting SKILL.md frontmatter is automatically stamped:
2

Telemetry Updates on Use

3

Recoverable Delete and Restore

4

Rollback a Broken Edit


How It Works


Frontmatter Fields

Five fields are added to SKILL.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. Backward-compatible: Skills without these fields parse fine — all fields default to their zero/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

The archive store is always the sibling directory of the first active skills directory (e.g., <first_skill_dir>/../skills_archive/).

Collision Behaviour

If a skill with the same name already exists in skills_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 prior SKILL.md
  • patch_skill(name, old, new) when file_path is None or "SKILL.md" — saves prior SKILL.md
What does NOT save a snapshot:
  • patch_skill(name, old, new, file_path="scripts/helper.py") — modifying a non-SKILL.md file does not create a .skill.bak
Error when no snapshot exists:
Each new edit_skill or patch_skill overwrites the previous .skill.bak. Rollback is single-step only — you cannot roll back through multiple prior versions.

Common Patterns

Self-Improving Agent Loop

Safe Edit-with-Rollback Wrapper

Inspect Telemetry from a Curator Script


Best Practices

delete_skill() archives by default. Only pass hard=True when you mean it. The archive store lets you recover skills that were accidentally retired.
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.
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.
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.
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.

Skill Manage

Create, edit, patch, archive, and delete skills — full action reference

Agent Skills

Load specialised knowledge from SKILL.md files