---
name: liquibase-drawio-reviewer
description: Analyzes Liquibase changelogs, generates standard SQL DDL for draw.io imports, and conducts a schema architecture review.
compatibility: opencode
---

## What I do
- Read the project's Liquibase XML/YAML changelogs.
- Translate the changelogs into standard SQL DDL (`CREATE TABLE` statements).
- Output the DDL specifically formatted for draw.io.
- Act as a senior database architect to review the schema design.

## When to use me
Invoke this skill whenever a database diagram update is needed, or when reviewing the architecture of new Liquibase migrations.

## Instructions
1. Find and read the Liquibase changelog files (typically in `src/main/resources/db/changelog/`).
2. Synthesize the migrations to determine the current, final state of the database schema.
3. Generate a clean SQL DDL script representing this final state. Exclude `INSERT` statements or Liquibase metadata tables.
4. Present the SQL script in a `sql` code block, and briefly remind the user to paste it into draw.io via **Arrange > Insert > Advanced > SQL**.
5. Provide a critical architectural critique of the schema, checking for:
    - Missing indexes on foreign keys.
    - Normalization issues or redundant columns.
    - Naming convention consistency.
    - Alignment with Spring Boot Data JPA / Hibernate best practices.