Agent skill
sql-to-osc
SQL to OSC (Online Schema Change) conversion expert for Flyway migration scripts. Use when: (1) Converting SQL migration files to OSC format, (2) User mentions "OSC", "轉換 OSC", "osc.txt", or "Online Schema Change", (3) Working with Flyway ALTER TABLE/CREATE INDEX statements that need OSC conversion.
Install this agent skill to your Project
npx add-skill https://github.com/aiskillstore/marketplace/tree/main/skills/dennisliuck/sql-to-osc
SKILL.md
SQL to OSC Conversion Expert
Convert Flyway SQL migration scripts to OSC format following project conventions.
Quick Reference
OSC Format: {database}<TAB>{table}<TAB>{operations};
| SQL | OSC |
|---|---|
USE db; |
Remove (db in column 1) |
ALTER TABLE tbl |
Remove (tbl in column 2) |
NULL |
DEFAULT NULL |
CREATE INDEX idx ON tbl (col) |
ADD INDEX idx (col) |
varchar |
VARCHAR |
| Multiple operations | Comma-joined, no space |
Conversion Workflow
- Read source SQL from
src/main/resources/db/migration/ - Parse statements: Extract database, table, operations
- Transform:
- Remove
USEandALTER TABLEwrappers - Convert
NULL→DEFAULT NULL - Convert
CREATE INDEX...ON table→ADD INDEX... - Uppercase data types
- Remove
- Format output:
{db}\t{table}\t{op1},{op2},...; - Write to
src/main/resources/db/osc/osc-{YYYYMMDD}.txt(e.g.,osc-20251212.txt)
Output Requirements
- Encoding: UTF-8 (no BOM)
- Line ending: LF (
\n) - Separator: TAB (
\t) between columns - Operations: Comma (
,) joined, NO space after comma - Line ending: Semicolon (
;)
Example
Input (V1.0__alter_my_table.sql):
USE mydb;
ALTER TABLE MY_TABLE
ADD COLUMN NEW_COL bigint(20) NULL AFTER EXISTING_COL;
CREATE INDEX MY_TABLE_NEW_COL_IDX ON MY_TABLE (NEW_COL);
Output (osc-{YYYYMMDD}.txt):
mydb MY_TABLE ADD COLUMN NEW_COL BIGINT(20) DEFAULT NULL AFTER EXISTING_COL,ADD INDEX MY_TABLE_NEW_COL_IDX (NEW_COL);
Conversion Summary Template
✓ 轉換完成
來源: {source_file}
輸出: src/main/resources/db/osc/osc-{YYYYMMDD}.txt
影響資料表: {tables}
操作統計:
- ADD COLUMN: {count}
- ADD INDEX: {count}
- MODIFY COLUMN: {count}
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
perigon-backend
Perigon ASP.NET Core + EF Core + Aspire conventions
perigon-agent
Pointers for Copilot/agents to apply Perigon conventions
perigon-angular
Angular 21+ standalone/Material/signal conventions for Perigon WebApp
fastapi-mastery
Comprehensive FastAPI development skill covering REST API creation, routing, request/response handling, validation, authentication, database integration, middleware, and deployment. Use when working with FastAPI projects, building APIs, implementing CRUD operations, setting up authentication/authorization, integrating databases (SQL/NoSQL), adding middleware, handling WebSockets, or deploying FastAPI applications. Triggered by requests involving .py files with FastAPI code, API endpoint creation, Pydantic models, or FastAPI-specific features.
context7-efficient
Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.
browser-use
Browser automation using Playwright MCP. Navigate websites, fill forms, click elements, take screenshots, and extract data. Use when tasks require web browsing, form submission, web scraping, UI testing, or any browser interaction.
Didn't find tool you were looking for?