Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/skills / migration

migration

migrate-frontmatter — idempotent rewrite helper that migrates legacy graphorin-* frontmatter fields onto their upstream equivalents per the deprecate-graphorin-prefix mappings recorded in the bundled spec snapshot.

The function is dry-run by default — callers must opt in to persisting the rewritten bytes. The CLI binary in Phase 15 wraps this surface; the library is exposed here so other tooling can reuse it.

Interfaces

InterfaceDescription
MigrateFrontmatterOptionsOptions accepted by migrateFrontmatter.
MigrationResultResult of a single SKILL.md migration.
MigrationRewriteA single rewrite the migrator applied (or would apply in a dry-run).

Functions

FunctionDescription
migrateFrontmatterMigrate the bundled deprecate-graphorin-prefix mappings on a single SKILL.md. The function is idempotent: re-running it on an already-migrated SKILL.md returns changed: false and an empty rewrites array.
sortKeysAnthropicFirstStable key ordering: Anthropic-base fields first (in their snapshot insertion order), then the metadata bucket, then the graphorin-* fields, then anything else. The migrator emits in this order so re-running the migrator on the same input yields identical bytes (idempotence).