config-schema-migrator

Generate automated migration scripts for evolving Pydantic configuration schemas.

Updated Dec 14, 2025
One-click install
npx skills add https://github.com/Raudbjorn/cognitive-construct --skill config-schema-migrator-raudbjorn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: config-schema-migrator
Source: https://github.com/Raudbjorn/cognitive-construct/tree/main/rhetoric/scripts/ai-counsel/.claude/skills/config-schema-migrator
Command: npx skills add https://github.com/Raudbjorn/cognitive-construct --skill config-schema-migrator-raudbjorn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Evolving configuration schemas in a live application often leads to breaking changes, requiring users to manually update their config files. This Skill provides patterns and scripts to automate schema migrations, ensuring backward compatibility and a smooth user experience.

Core Features & Use Cases

  • Backward Compatibility: Implement strategies to support both old and new config formats simultaneously, with deprecation warnings.
  • Automated Migration Scripts: Generate idempotent Python scripts that automatically transform old config files to the new schema, including backups.
  • Environment Variable Substitution: Securely inject secrets and dynamic values into config fields using ${VAR_NAME} syntax.
  • Pydantic Validation: Leverage Pydantic's powerful validation features to ensure config integrity and catch errors at load time.
  • Use Case: You've refactored your application's configuration from a flat cli_tools section to a more structured adapters section with type discrimination. Use this skill to create a migration script that automatically updates existing config.yaml files, preventing user disruption.

Quick Start

To automatically update your config.yaml to the latest schema, run the migration script: python scripts/migrate_config.py

Frequently Asked Questions about config-schema-migrator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically migrate my Pydantic configuration schema to a new version without breaking existing config files?

Schema migration automates updates to Pydantic config files while maintaining backward compatibility. This Skill generates idempotent Python scripts that transform old config formats to new schemas, applying field additions, type changes, and structural reorganizations with automatic backups and clear error messaging.

Can I evolve my YAML configuration schema while keeping old configs working?

Yes. Backward compatibility strategies let you support both old and new config formats simultaneously, emit deprecation warnings for outdated fields, and automatically migrate users' YAML files without manual intervention or service disruption.

How do I handle environment variable substitution securely in Pydantic config files?

Environment variable substitution injects secrets and dynamic values into config fields using `${VAR_NAME}` syntax, integrated with Pydantic validation to ensure type safety and catch errors at load time before runtime exposure.

What's the best way to restructure configuration sections and maintain user compatibility?

Automated migration scripts transform flat config structures into hierarchical sections—like converting `cli_tools` to `adapters`—while generating discriminated unions for type discrimination and preserving user data through the refactoring.

Do I need to write custom migration code for each Pydantic schema change?

No. This Skill generates automated migration scripts that handle schema evolution patterns, deprecation warnings, and validation rules through Pydantic's built-in features, eliminating manual migration logic for common refactoring scenarios.