| 598 | } |
| 599 | |
| 600 | const 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 | |
| 619 | export type AgentCommand = { |
| 620 | command: string |