MCPcopy Create free account
hub / github.com/arktypeio/arktype / buildMigrationPrompt

Function buildMigrationPrompt

ark/type/cli.ts:600–617  ·  view source on GitHub ↗
(
	source: MigrationSource | undefined,
	skillDir: string
)

Source from the content-addressed store, hash-verified

598}
599
600const buildMigrationPrompt = (
601 source: MigrationSource | undefined,
602 skillDir: string
603): string => {
604 const skillFile = join(skillDir, "SKILL.md")
605 if (source === "v2") {
606 return [
607 "Migrate this codebase from ArkType 2.x to ArkType 3.",
608 `Read the "Upgrading from ArkType 2" section of ${skillFile} and https://arktype.io/docs/upgrading.md first, then upgrade schemas, types, and error handling incrementally while keeping typecheck and tests green.`
609 ].join("\n")
610 }
611 const fromLabel = source ?? "the existing validation library"
612 const migratingFile = join(skillDir, "references", "migrating.md")
613 return [
614 `Migrate this codebase from ${fromLabel} to ArkType 3.`,
615 `Read ${skillFile} and ${migratingFile} first, then convert schemas, types, and error handling incrementally while keeping typecheck and tests green.`
616 ].join("\n")
617}
618
619export type AgentCommand = {
620 command: string

Callers 1

runMigrateFunction · 0.85

Calls 1

joinFunction · 0.85

Tested by

no test coverage detected