Templates and Skills
Concept

Manage Skill versions

Delete a custom lineage only when unreferenced by Agents, Templates, Overrides, or forks. Delete a non-final unreferenced version safely; built-in aai_cli lineages stay protected and Agents mount exact pins.

For
Skill authors, Agent operators, and Organization administrators
On this page
  1. Before you begin
  2. Use the current versioning model
  3. Distinguish drafts and versions
  4. 1. Publish an immutable snapshot
  5. Understand latest-version display
  6. 2. Pin an exact version to an Agent
  7. Pin exact versions in Templates and Overrides
  8. 3. Recover an affected Agent safely
  9. Inspect immutable version history
  10. Protect referenced versions
  11. Distinguish version and lineage deletion
  12. Apply safe cleanup rules
  13. Use the correct scoped version route
  14. Troubleshooting
  15. Recommended practices
  16. Next steps
  • Templates and Skills
  • 12–15 minutes

Skill Versions are immutable release artifacts. Drafts hold the next proposed snapshot; Agents, Templates, and Agent Template Overrides retain exact published-version pins until someone changes them deliberately.

Before you begin

  • Platform Skill versions are managed by Platform Administrators.
  • Organization Skill reads require skill.read; draft, publish, and deletion actions require skill.manage.
  • Agent-private Skill operations require access to the owning Agent and the matching Agent permission.
  • Use Agent Configuration to explicitly repin an Agent when adoption or recovery requires it.

A visible Platform Skill remains read-only from an Organization or Agent scope unless it is forked into that scope. Another Agent’s private history is never visible.

Use the current versioning model

Skill lifecycle
Create lineage
     ↓
Initial unpublished draft
     ↓
Publish
     ↓
Immutable version 1
     ↓
Start another draft from latest
     ↓
Publish
     ↓
Immutable version 2
What the lineage owns
Skill lineage
├── stable identity and display name
├── immutable slug and stable mount directory
├── scope and ownership
├── at most one mutable draft
└── zero or more immutable published versions

A newly created Skill has a stable lineage and an initial unpublished draft, not version 1. The first successful publish creates version 1; a later draft for a published Skill is seeded from the latest published version.

Distinguish a draft from a published version

DraftPublished version
MutableImmutable
At most one per lineageMultiple snapshots per lineage
May exist without a published versionHas an assigned version number
Not mounted by AgentsCan be pinned and mounted
Can be saved or discardedCan only be viewed or safely deleted
Holds staged files and metadataHolds an exact file and metadata snapshot
Cleared after publishingRetained in version history

Saving a draft does not affect published consumers. Discarding a draft leaves every published version unchanged. Historical content is never edited in place: make changes through a new draft, then publish another version.

Publish a complete immutable snapshot

  1. Validate the complete draft file set.
  2. Require exactly one root SKILL.md.
  3. Snapshot draft files, description, provider requirements, and source provenance.
  4. Create the next immutable published version.
  5. Apply published metadata to the lineage’s current summary.
  6. Delete the mutable draft.

Each published version contains its number, creator metadata, publication time, description, required providers, source Skill ID and version when applicable, complete UTF-8 file tree, and one root SKILL.md. Supporting paths are relative to the Skill root.

Representative version snapshot
Skill version 3
├── SKILL.md
└── references/
    ├── setup.md
    └── commands.md

Understand latest-version display

The latest published version is the highest currently published version number for the lineage. There is no mutable “current version” pointer that rewrites older snapshots. When the UI opens a Skill without a selected historical version, it displays that latest published snapshot; display behavior never changes an Agent or Template pin.

Pin an exact version to an Agent

Agent assignment
Agent assignment
├── skill_id
└── pinned_version
  • An Agent may select a specific published version.
  • If a version is omitted, Agent Barn resolves and persists the latest published version at apply time.
  • Publishing another version never moves existing pins; two Agents can intentionally use different versions.
  • An unpublished draft cannot be mounted.
  • Runtime start mounts the exact version persisted on the Agent assignment.

The Skills section of Agent Configuration exposes the version selector. Re-pinning is explicit and does not alter other Agents.

Pin exact versions in Templates and Overrides

Templates and Agent Template Overrides preserve the exact Skill Version selected when they are created:

Requirement
skill_id + skill_version

Publishing another Skill Version does not mutate existing Template Versions or Override requirements. Template and Override drafts that reference a Skill Version protect it from deletion. Adopting a newer Skill requires an explicit Template, Override, or Agent change.

Recover an affected Agent safely

There is no Restore Version or Restore as Draft workflow. Recovery from a problematic version is a per-Agent decision:

  1. Select an earlier published version for the affected Agent.
  2. Apply the new exact pin.
  3. Restart or apply the Agent configuration through the normal Agent workflow when required.
  4. Leave other Agents on their current versions unless they also need recovery.

To correct shared Skill content, start a new draft, make the correction, publish a new immutable version, explicitly repin affected Agents, update relevant Template or Override requirements, then delete the bad version only after all references are removed. Do not republish an old snapshot globally merely to recover one Agent.

Inspect immutable version history

Version history is listed newest first. Each entry can show the version number, publication information, required providers, source provenance, immutable files, whether an Agent pins it, and whether deletion is currently available.

Selecting historical content displays that exact metadata and file tree without edit mode. Starting a draft or publishing another version never mutates historical snapshots.

Protect referenced versions

A version can be deleted only when all of these are true:

  • The lineage has at least one other published version.
  • No Agent pins the version.
  • No Platform or Organization Template, including their drafts, requires it.
  • No Agent Template Override Version or draft requires it.
  • No Skill Draft references it as a source.
  • No published fork version references it as a source.

A protected deletion returns a conflict and leaves the version and all of its files unchanged. Remove or update each referencing resource before retrying; deletion never silently repins consumers.

What version deletion removes

It removes that immutable skill_version snapshot and its skill_file rows. It does not remove the lineage, other versions, the current draft, assignments to other versions, other Template requirements, or forks derived from another source version. An eligible historical-version deletion does not alter Runtime mounts because mounts use exact persisted pins.

Distinguish version deletion from lineage deletion

OperationResultMain constraints
Delete versionRemoves one immutable snapshot and its filesCannot be the only version or have any references
Delete SkillRemoves a complete custom lineage, draft, all versions, and all filesMust be custom, owned by the caller’s scope, and completely unused

Whole-lineage deletion is blocked by Agent assignments, Template requirements, Agent Template Override requirements, and published or draft fork provenance. Pins retained for soft-deleted Agents also block it. Built-in aai_cli lineages cannot be deleted.

Apply safe cleanup rules

Example
Skill: Incident response
Published versions: v1, v2, v3

Agent A pins v2
Agent B pins v3
A Template requires v2
  • v1 may be deleted only if it has no other references.
  • v2 cannot be deleted until Agent A and the Template stop referencing it.
  • v3 cannot be deleted while Agent B pins it.
  • The only remaining version can never be deleted.
  • Publishing v4 does not move Agent A or Agent B automatically.

Use the correct scoped version route

ScopeList versions
Platform/api/v1/platform/skills/{skill_id}/versions
Organization/api/v1/organizations/{organization_id}/skills/{skill_id}/versions
Agent-private/api/v1/organizations/{organization_id}/agents/{agent_id}/skills/{skill_id}/versions
Scoped version routes
Platform
GET    /api/v1/platform/skills/{skill_id}/versions
GET    /api/v1/platform/skills/{skill_id}/versions/{version}
DELETE /api/v1/platform/skills/{skill_id}/versions/{version}

Organization
GET    /api/v1/organizations/{organization_id}/skills/{skill_id}/versions
GET    /api/v1/organizations/{organization_id}/skills/{skill_id}/versions/{version}
DELETE /api/v1/organizations/{organization_id}/skills/{skill_id}/versions/{version}

Agent-private
GET    /api/v1/organizations/{organization_id}/agents/{agent_id}/skills/{skill_id}/versions
GET    /api/v1/organizations/{organization_id}/agents/{agent_id}/skills/{skill_id}/versions/{version}
DELETE /api/v1/organizations/{organization_id}/agents/{agent_id}/skills/{skill_id}/versions/{version}

The draft lifecycle beneath the appropriate prefix is:

Draft operations
GET    /{skill_id}/draft
POST   /{skill_id}/draft
PATCH  /{skill_id}/draft
DELETE /{skill_id}/draft
POST   /{skill_id}/draft/publish

Do not use an Organization mutation route for a Platform or Agent-private Skill. Authorization is evaluated before deletion checks, and management permission never bypasses reference protection.

Troubleshooting

A published version did not change an Agent

Expected exact pin

Publishing never moves an Agent pin. Select the required published version in Agent Configuration and apply the change explicitly.

A draft opened instead of a new editor

One draft per lineage

Only one mutable draft may exist. Review, save, discard, or publish the existing draft before continuing.

A version cannot be deleted

Reference protection

Check Agent pins, Platform and Organization Template versions and drafts, Override versions and drafts, Skill-draft provenance, and fork provenance. Remove the reference first; do not force-delete.

I need to correct shared content

Publish forward

Start a new draft, publish a corrected immutable version, and explicitly repin only the affected consumers. Historical versions stay read-only.

  • Treat each published version as a release artifact with a complete file snapshot.
  • Test a new pin with a non-production Agent before wider repinning.
  • Record exact Skill IDs and versions in incident and rollout notes.
  • Publish corrections forward, and prune only history with no remaining references.
  • Keep provider credentials, permissions, and Communication Connection credentials outside Skill Version files.

Next steps

Documentation