Migrate component schema to current version and apply best practices
Updates component schemas to current version and applies best practices with validation and rollback support.
/plugin marketplace add C0ntr0lledCha0s/claude-code-plugin-automations/plugin install agent-builder@claude-code-plugin-automations[type] [name|--all]claude-sonnet-4-5Migrate Claude Code components to current schema version and apply best practices.
Arguments:
$1 (required): Component type - agent, skill, command, hook$2 (optional): Component name OR --all to migrate all of typeFull arguments: $ARGUMENTS
/agent-builder:migrate agent old-agent
↓
Task → agent-builder
↓
Detect version → Apply migrations → Validate
/agent-builder:migrate command --all
↓
Task → command-builder
↓
Find all commands → Migrate each → Report
| From | To | Changes |
|---|---|---|
| pre-1.0 | 1.0 | Add YAML frontmatter |
| 0.x | current | Fix schema, optimize tools |
| 1.0 | current | Apply best practices |
| From | To | Changes |
|---|---|---|
| Any | current | Remove model field (critical) |
| 0.x | current | Add directory structure |
| From | To | Changes |
|---|---|---|
| Any | current | Fix model format (critical) |
| - | - | haiku → claude-haiku-4-5 |
| - | - | sonnet → claude-sonnet-4-5 |
| From | To | Changes |
|---|---|---|
| 0.x | current | Update event schema |
| Any | current | Security hardening |
/agent-builder:migrate agent old-reviewer
/agent-builder:migrate command --all
/agent-builder:migrate skill --all
/agent-builder:migrate hook validate-bash
# Before (invalid)
---
name: my-skill
model: sonnet # ❌ Not supported
---
# After (valid)
---
name: my-skill
# model field removed
---
# Before (API error)
---
description: Fast command
model: haiku # ❌ Short alias fails
---
# After (works)
---
description: Fast command
model: claude-haiku-4-5 # ✅ Version alias
---
## Migration Report: [component-name]
**Schema Version**: pre-1.0 → current
**Status**: ✅ Migrated successfully
### Changes Applied
1. [Change 1]
2. [Change 2]
3. [Change 3]
### Diff Preview
```diff
- model: haiku
+ model: claude-haiku-4-5
To rollback: mv [backup] [original]
## Safety Features
1. **Backup Creation**: Automatic backup before migration
2. **Diff Preview**: See changes before applying
3. **Validation**: Pre and post validation
4. **Rollback Instructions**: Easy recovery
## Execution
When invoked:
1. Parse type and target from arguments
2. Delegate via Task to appropriate builder
3. Builder detects version and applies migrations
4. Return migration report with diff and validation