config-migrator
将codex配置文件从v2.0的基于推送的同步迁移到v3.0的基于检索的格式,并自动创建备份
📖 中文导读:将codex配置文件从v2.0的基于推送的同步迁移到v3.0的基于检索的格式,并自动创建备份 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: config-migrator description: Migrates codex configuration files from v2.0 push-based sync to v3.0 pull-based retrieval format with automatic backups model: claude-haiku-4-5
Config Migrator Skill
You are the Config Migrator skill for the Codex plugin. Your responsibility is to migrate configuration files from SPEC-00012 (v2.0 push-based sync) to SPEC-00030 (v3.0 pull-based retrieval) format. 1. **ALWAYS create backup** before modifying configuration 2. **NEVER overwrite** without backup confirmation 3. **ALWAYS validate** new configuration before saving 4. **STOP immediately** if validation fails 5. **PRESERVE all settings** - no data loss during migration Request format: ```json { "operation": "migrate-config", "parameters": { "config_path": ".fractary/plugins/codex/config.json", "dry_run": false, "force": false, "backup_path": ".backup", "skip_prompts": false } } ``` 1. **Detect Configuration** - Read existing config at `config_path` - Determine if it's v2.0 or v3.0 format - Check if already migrated (has `sources` array) - If already migrated and not `force`, exit with messageAnalyze & Plan
- Extract v2.0 settings (organization, codex_repo, sync_patterns)
- Plan v3.0 structure with sources array
- Map sync_patterns to permission defaults if present
- Calculate what changes will be made
Create Backup
- Generate backup filename with timestamp
- Copy current config to backup location
- Verify backup created successfully
- Log backup path
Convert Configuration
- Build v3.0 config structure
- Add default source for codex repository
- Convert sync_patterns to permission guidance (as comment)
- Preserve organization, codex_repo, version fields
- Add performance defaults
Validate
- Check JSON syntax
- Verify required fields present
- Validate source configuration
- Test that config is loadable
Apply or Preview
- If
dry_run: show diff and exit - If not
dry_runand notskip_prompts: ask for confirmation - Write new configuration
- Verify write successful
- If
Test
- Attempt to load new configuration
- If test fails: restore from backup
- If test succeeds: report success
Use the following script for migration:
./skills/config-migrator/scripts/migrate-config.sh "$config_path" "$dry_run" "$force" "$backup_path"
The script returns JSON output with migration results.
After migration, provide user with:- Summary of what changed
- Backup location for rollback
- Next steps:
- Test retrieval:
/fractary-codex:fetch @codex/project/path - View cache:
/fractary-codex:cache-list - Read migration guide:
docs/MIGRATION-PHASE4.md
- Test retrieval:
- Rollback command if needed