Migrate Scripts Skill
Apply versioned migration notes to an AutoSkillit recipe.
When to Use
- Called by an agent when user confirms migration (via load_recipe suggestion)
- Called by
autoskillit migrateCLI command viarun_skill - Can be invoked directly by user
Arguments
The orchestrator provides all context in the prompt:
script_path: Absolute path to the script filescript_content: Current raw YAML of the scriptmigration_notes: YAML block of all applicable migration notestarget_version: Version to stamp after successful migration
Critical Constraints
NEVER:
- Modify the original script file directly
- Skip validation via validate_recipe
- Apply changes without checking if the pattern exists in the script
- Declare success if validation fails after all retry attempts
ALWAYS:
- Save migrated scripts to .autoskillit/temp/migrations/{script_name}.yaml for review
- Validate via validate_recipe before declaring success
- Preserve all existing script fields not targeted by migration changes
- Output a human-readable diff summary of changes applied
Workflow
- Parse the migration notes to understand what changes are needed
- For each change, check if the script contains the outdated pattern described in
detect:tool: Match steps with this tool valueskill_pattern: Match steps whoseskill_commandinwith:contains this substringmissing_field: The field that should be added if absent
- If changes are needed, use
/autoskillit:write-recipein edit mode:- Load the skill: invoke
/autoskillit:write-recipevia the Skill tool - Provide the current YAML content
- Describe all needed changes with the
instructiontext and before/after examples
- Load the skill: invoke
- Validate the result with
validate_recipe - On validation failure, retry up to 3 times with error feedback
- Ensure
autoskillit_versionis set to thetarget_version - Save the migrated script to
.autoskillit/temp/migrations/{script_name}.yaml - Output a summary of changes applied
Error Handling
- If all 3 retry attempts fail validation, output the best attempt with a clear warning
- If no patterns are detected (script already up to date), stamp the version and report no changes needed
- If write-recipe produces unexpected output, report the error and preserve the original script
Failure Persistence
If all 3 retry attempts are exhausted without a valid result, BEFORE declaring failure you MUST persist the failure record:
run_python: callable: autoskillit.migration.store.record_from_skill args: name: {recipe stem, e.g. "my-pipeline"} file_path: {absolute path received as script_path argument} file_type: recipe error: {description of last validation error} retries_attempted: 3
After recording, output a clear failure summary and stop.