extract-code-units
БесплатноБез исполняемых скриптовНе проверенExtract DDL and source code from a connected source database using scai CLI. Pulls tables, views, procedures, functions, and other objects. Triggers: extract…
от sfc-gh-dflippo★ 35 звёзд на GitHubОб этом скилле
Code Extraction
On Entry
Tell the user:
Extracting from source database.
Here's what I'll do:
- Connect to your source database using the configured connection.
- Run read-only queries to enumerate the objects in scope.
- Extract the DDL and code for each one, and save them under
source/.
Prerequisites
- Migration project initialized (
scai init) configure()called at session start — validates the source connection and, for Oracle/Teradata, seeds the driver cache via../../connection/references/driver-bootstrap.md- Network access to source database
Workflow
Step 1: Ask What to Extract
Ask the user what they want to extract. Present the available object types for their source dialect:
- SqlServer: TABLE, VIEW, FUNCTION, PROCEDURE, SEQUENCE, TABLE_TYPE, TRIGGER
- Redshift: TABLE, VIEW, MATERIALIZED_VIEW, FUNCTION, PROCEDURE
- Oracle: TABLE, VIEW, MATERIALIZED_VIEW, FUNCTION, PROCEDURE, PACKAGE, PACKAGE_BODY, TRIGGER, SEQUENCE, TYPE, TYPE_BODY, SYNONYM
- Teradata: TABLE, VIEW, FUNCTION, PROCEDURE
- Postgresql: TABLE, VIEW, MATERIALIZED_VIEW, FUNCTION, PROCEDURE
Ask the user via ask_user_question (multiSelect = false):
"What would you like to extract? You can choose:"
- All objects - Extract everything from the source database
- Specific object types - e.g. just tables and views, or just procedures
- Specific schemas - Limit to one or more schemas
- Name filter - Exact object name, or a wildcard with
*(e.g.EmployeesorGet*Data)
Allow combining options (e.g. specific types within a specific schema).
If the source server hosts several databases and the user wants more than the connection's own, also ask which databases — see the multi-database flow in Step 2.
Name matching:
-n/--nameis an exact case-insensitive match unless the pattern contains*. Do not pass a bare prefix expecting substring match — that used to pull sibling objects (e.g.FOOmatchingFOO_SWTCH). For partial matches use wildcards:FOO*,*Employee*. When the user lists specific table names, pass each exact name or extract by schema/type and let them confirm the catalog count.
Step 2: Run Extraction
Build the scai code extract command based on user selections:
# Base command
scai code extract -s <CONNECTION_NAME> --json
# Add flags based on user choices:
# -d, --database <DATABASE> extract from a specific database on the server,
# overriding the connection's own database
# --schema <SCHEMA> filter by schema
# -t TYPE1,TYPE2 filter by object type
# -n "Name" exact name (case-insensitive); use * for wildcards
# --driver-path <PATH> path to driver .nupkg (Oracle only, first use)
Multiple databases on one server (SqlServer, AzureSynapse, Redshift, Postgresql, Teradata).
A source connection points at one database, but its server may host several. To migrate more
than one, pass a comma-separated list with -d — the CLI loops internally, continues past a
single database's failure, and returns one JSON envelope with per-database counts plus the
aggregate. Do not re-run without -d; that only re-pulls the connection's own database.
(Oracle and BigQuery don't bind a swappable database in the connection, so -d is rejected there —
use the connection's own database / schemas.)
- List the databases on the connection's server with
query_source(dialect-specific):- SqlServer / AzureSynapse:
SELECT name FROM sys.databases WHERE database_id > 4(excludes themaster/tempdb/model/msdbsystem databases). - Redshift / Postgresql:
SELECT datname FROM pg_database WHERE datistemplate = false. - Teradata:
SELECT DatabaseName FROM DBC.DatabasesV WHERE DBKind = 'D'.
- SqlServer / AzureSynapse:
- Ask which to extract via
ask_user_question(multiSelect = true), defaulting to the connection's own database. - Run one extraction with every selected database:
scai code extract -s <CONNECTION_NAME> -d Sales,Inventory --json
Output nests each under source/<database>/…, and the Code Unit Registry is regenerated once
after the run (the command re-scans the whole source/ tree), so all coexist in one project.
Omit -d when the connection's own database is the only target.
Driver note (Oracle / Teradata): configure() seeds the driver cache, so --driver-path is normally not needed here. If the cache was missed for any reason, pass --driver-path <PATH_TO_NUPKG> on first use; SCAI persists the path machine-wide and reuses it across projects.
Examples:
# All objects
scai code extract -s <CONNECTION_NAME> --json
# All objects from a specific database on the server
scai code extract -s <CONNECTION_NAME> --database Sales --json
# Only tables and views in the dbo schema
scai code extract -s <CON
Установить extract-code-units в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл extract-code-units?
Extract DDL and source code from a connected source database using scai CLI. Pulls tables, views, procedures, functions, and other objects. Triggers: extract, pull ddl, extract code, get source code.
Как установить скилл extract-code-units?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл extract-code-units запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic