本文へ移動
cccskills
無料GitHub で公開

flyway-consolidate

Analyze and consolidate Flyway SQL migrations into clean, domain-grouped CREATE TABLE migrations for pre-production projects. Use when consolidating database migrations, refactoring Flyway schemas, simplifying migration history, grouping tables by domain, or when user mentions "consolidate migrations", "merge migrations", "clean up Flyway", "refactor schema", "baseline migrations".

インストール方法を見る

含まれるファイル(4)

  • SKILL.md4.4 KB
  • EXAMPLES.md9.7 KB
  • TROUBLESHOOTING.md2.9 KB
  • WORKFLOW.md10.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Flyway Migration Consolidation

Analyze incremental Flyway migrations and generate consolidated, domain-grouped CREATE TABLE migrations for pre-production projects where the database can be reset from scratch.

When to Use

ScenarioApply?
Pre-production project with migration sprawlYes
Database can be reset from scratchYes
Many incremental ALTER TABLE migrationsYes
Want domain-based organization before releaseYes
Production database existsNo
Migration history must be preservedNo

Consolidation Workflow

  1. Discover — Find all V*__*.sql files using Glob
  2. Analyze — Read each migration, identify CREATE/ALTER/INSERT operations and affected tables
  3. Infer final schema — Apply all changes in order to determine the intended final state
  4. Group by domain — Organize tables into logical business domains
  5. Resolve dependencies — Topological sort by FK relationships
  6. Generate — Produce clean CREATE TABLE migrations when user confirms

See WORKFLOW.md for detailed step-by-step process.

Output Structure

Produce these deliverables in order:

1. Analysis Report

  • Total migration count and breakdown by type (CREATE, ALTER, INSERT)
  • Per-migration summary: what it does, which tables it affects
  • Final table count and column inventory

2. Domain Grouping

  • Tables organized by inferred business domain
  • Migration-to-domain mapping showing which originals feed into each group

3. Proposed Structure

  • New migration file list (e.g., V1–V6) with table assignments
  • Dependency order rationale
  • Reduction metrics (file count, estimated line savings)

4. Consolidated SQL (on request)

  • Clean CREATE TABLE statements with final-form columns and constraints
  • Separate migration for idempotent seed data
  • Optional separate migration for performance indexes

Domain Grouping Heuristics

SignalAssignment
Table prefix (user_*, order_*)Prefix-based domain
Foreign key clusterRelated tables share domain
Join tables (user_roles)Domain of primary entity
Audit tables (*_audit, *_history)Same domain as parent
Config/settings tablesInfrastructure domain
Explicit schema namespacesSchema name as domain

Present ambiguous cases to the user for decision.

Critical Constraints

  1. Preserve the final schema exactly — no tables, columns, constraints, or relationships lost
  2. Idempotent seed data — use ON CONFLICT DO NOTHING or equivalent for INSERT statements
  3. Dependency order — referenced tables created before foreign keys that point to them
  4. Prefer CREATE over ALTER — final-form table definitions, not incremental changes
  5. History rewriting allowed — pre-production only, database will be reset
  6. Document assumptions — call out any ambiguities in the original migrations explicitly

Tools

  • Glob **/V*__*.sql and **/R*__*.sql to find versioned and repeatable migrations
  • Read each migration file to parse SQL content
  • Grep CREATE TABLE, ALTER TABLE, FOREIGN KEY, INSERT INTO to search across migrations

Examples

See EXAMPLES.md for complete before/after consolidation scenarios and TROUBLESHOOTING.md for common issues:

  • Column evolution chains collapsed into single CREATE TABLE
  • Multi-domain consolidation (40 migrations to 6)
  • FK dependency resolution across domains
  • Seed data made idempotent

Reminders

  1. Always present the analysis report and proposed structure before generating SQL
  2. Wait for user confirmation of domain groupings before generating consolidated files
  3. Handle circular FK dependencies by deferring constraint creation with ALTER TABLE
  4. Self-referential FKs: create table first, add FK in same migration via ALTER
  5. Compare final column/constraint inventory against originals as a verification step

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

adr

無料

Create, review, and manage Architecture Decision Records (ADRs) with auto-numbering, template detection, quality review, and index maintenance. Use when user mentions "ADR", "architecture decision", "document this decision", "create ADR", "review ADR", editing ADR files (docs/adr/, doc/adr/, .adr/), or discussing architectural choices and tradeoffs.

日本語の概要は準備中です。原文の説明を表示しています。

joaquimscosta/arkhe-claude-plugins212026年8月14日 更新

architect

無料

Analyze system architecture, module structure, API contracts, data models, and code patterns. Use when designing systems, reviewing module boundaries, evaluating API designs, analyzing data models, checking pattern conformance, tracing decisions, or reviewing frontend architecture. Triggers: "architecture", "module design", "API design", "data model", "boundaries", "patterns", "decisions", "frontend architecture".

日本語の概要は準備中です。原文の説明を表示しています。

joaquimscosta/arkhe-claude-plugins212026年8月14日 更新

Converts natural-language descriptions or UI spec files into optimized Google Stitch prompts. Use when creating, refining, or validating design directives for Google Stitch. Use when user says "create a Stitch prompt", "optimize this for Stitch", "convert this spec to a Stitch prompt", "write a UI prompt", or mentions Google Stitch prompt authoring. Follows Stitch best practices with short, directive prompts focused on screens, structure, and visual hierarchy.

日本語の概要は準備中です。原文の説明を表示しています。

joaquimscosta/arkhe-claude-plugins212026年8月14日 更新

Zero-dependency live-preview server providing an agent↔browser bidirectional companion. Watches a content directory, wraps HTML fragments in a frame template, broadcasts live-reload over WebSocket, and captures browser-side click events to a JSONL file. Use when an agent needs to show HTML to the user in a browser and react to clicks — mockups, design exploration, gallery browsing, multi-select choices, prototype iteration. Triggered by "live preview", "browser companion", "preview server", "browser mockup", "show in browser", "arkhe-preview", or any skill that wants to write HTML fragments and have the user see them reload in real time.

日本語の概要は準備中です。原文の説明を表示しています。

joaquimscosta/arkhe-claude-plugins212026年8月14日 更新

Deletes merged git branches (local and remote) and flags stale unmerged branches for manual review. Use when user mentions "cleanup branches", "delete merged branches", "prune old branches", "remove stale branches", "branch cleanup", or runs /cleanup-branches command.

日本語の概要は準備中です。原文の説明を表示しています。

joaquimscosta/arkhe-claude-plugins212026年8月14日 更新

Interactive Claude Code environment setup wizard. Detects existing configuration, guides through best-practice setup for Global CLAUDE.md, project scaffolding, MCP servers, hooks, custom agents, keybindings, and settings. Use when user runs /devtools:code-env-setup, mentions "setup claude code", "configure claude", "claude code setup", "environment setup", or "initialize claude code".

日本語の概要は準備中です。原文の説明を表示しています。

joaquimscosta/arkhe-claude-plugins212026年8月14日 更新

joaquimscosta のスキルをすべて見る

このスキルの問題を報告する