OpenParable
Skip to content
← Back to skills

Config Migration Generator

Development
config-migration-generator

Config Migration Generator is an Agent Skill for development published in the a5c-ai/babysitter repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Generate configuration file migration utilities for version upgrades.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/a5c-ai/babysitter/blob/HEAD/library/specializations/cli-mcp-development/skills/config-migration-generator/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/config-migration-generator, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Config Migration Generator

Generate config file migration utilities.

Generated Patterns

interface Migration {
  version: string;
  up: (config: any) => any;
  down: (config: any) => any;
}

const migrations: Migration[] = [
  {
    version: '2.0.0',
    up: (config) => ({
      ...config,
      server: { host: config.host, port: config.port },
      version: '2.0.0',
    }),
    down: (config) => ({
      host: config.server?.host,
      port: config.server?.port,
      version: '1.0.0',
    }),
  },
];

export function migrateConfig(config: any, targetVersion: string): any {
  let current = config;
  for (const migration of migrations) {
    if (semver.gt(migration.version, config.version) && semver.lte(migration.version, targetVersion)) {
      current = migration.up(current);
    }
  }
  return current;
}

Target Processes

  • configuration-management-system
  • cli-update-mechanism