Skip to content
Development
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

From plugin
claude-plugin-marketplace
265 skills18 agents14 commands
Install
$ npx -y skills add DennisLiuCk/claude-plugin-marketplace --skill sql-to-osc --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/sql-to-osc

Context preview

The summary Claude sees to decide when to auto-load this skill.

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

SKILL.md

sql-to-osc.SKILL.md
name: sql-to-osc
description: |
  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.

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

1. **Read source SQL** from `src/main/resources/db/migration/` 2. **Parse statements**: Extract database, table, operations 3. **Transform**:

  • Remove `USE` and `ALTER TABLE` wrappers
  • Convert `NULL` → `DEFAULT NULL`
  • Convert `CREATE INDEX...ON table` → `ADD INDEX...`
  • Uppercase data types

4. **Format output**: `{db}\t{table}\t{op1},{op2},...;` 5. **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}
Read more
Ships withclaude-plugin-marketplace

專為繁體中文使用者設計的 Claude Code 插件集合,提供開發、生產力、安全與學習等工具。

Get the whole plugin

Other skills on claude-plugin-marketplace.

skill-creator
Skill

skill-creator

建立新技能、修改和改進現有技能、衡量技能效能。當使用者想要從零開始建立技能、編輯或優化現有技能、執行評估測試、進行基準測試效能分析、或優化技能描述以提升觸發準確度時使用此技能。請確保在使用者提到建立技能、撰寫 skill、skill 開發、技能測試、技能優化、或想要將工作流程轉換為可重複使用的技能時啟用此技能。