원클릭으로
gen-table
Create database tables from SQL (CTAS) or natural language descriptions
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Create database tables from SQL (CTAS) or natural language descriptions
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | gen-table |
| description | Create database tables from SQL (CTAS) or natural language descriptions |
| tags | ["wide-table","CTAS","DDL","create-table","query-acceleration"] |
| version | 1.0.0 |
| user_invocable | false |
| disable_model_invocation | false |
| allowed_agents | ["gen_table","gen_job"] |
ask_user is available, use it for DDL confirmation and clarification.ask_user is not available (workflow, batch, or print mode), never call ask_user and never wait for user input. Treat the original request as authorization only for the specific non-destructive CREATE TABLE / CTAS it explicitly asks for.ask_user is unavailable, stop and report exactly what is missing.If the user selects "Cancel" at ANY point (any ask_user response), you MUST immediately stop ALL work. Do NOT:
Return immediately with:
{"table_name": "", "output": "Cancelled by user."}
Detect input mode:
The user's SQL already fully defines the output schema. Do NOT ask the user about table usage, purpose, or column selection — the SQL is the spec.
describe_table for each source table to understand column types.execute_sql with LIMIT 10 to validate the query output.wide_order_customer). If the user specified a name, use it.Natural language is ambiguous, so clarification may be needed before generating DDL.
describe_table for any referenced existing tables to infer column types.ask_user when available. If ask_user is unavailable, stop and report the missing fields instead of guessing.Generate the exact DDL SQL statement.
Generate CTAS: CREATE TABLE {schema}.{table_name} AS ({select_sql})
Generate: CREATE TABLE {schema}.{table_name} ({column_defs})
ask_user is available — DDL ConfirmationCall ask_user with the complete DDL embedded in the question:
ask_user(questions=[{
"question": "Generated DDL:\n\nCREATE TABLE {schema}.{table_name} AS (\n SELECT ...\n);\n\nConfirm execution?",
"options": ["Execute", "Modify", "Cancel"]
}])
Formatting rules for the question text:
\n for line breaks to keep the SQL readableBased on user response:
ask_user again with the updated DDL{"table_name": "", "output": "Cancelled by user."}. Do NOT continue.ask_user is unavailable — Workflow Authorizationask_user.DROP, ALTER, TRUNCATE, CREATE OR REPLACE, or any existing-object replacement, require explicit authorization in the original request. Otherwise stop and report the required authorization.execute_sql(sql) with the confirmed or workflow-authorized DDL statement.execute_sql("SELECT COUNT(*) FROM {schema}.{table_name}") to confirm row countdescribe_table("{schema}.{table_name}") to confirm schema matchesdescribe_table("{schema}.{table_name}") to confirm the created schema.If DDL fails:
ask_user is available, fix the SQL, show the updated DDL to the user via ask_user, and retry (up to 3 attempts)ask_user is unavailable, fix and retry directly up to 3 attempts when the intent remains the same and no new destructive action is introducedOutput a summary including:
task(type="gen_semantic_model", prompt="{table_name}")ask_user before executing DDL only when the tool is available.ask_user confirmation when interactive, or in the final output when workflow mode executes.gen_semantic_modelGenerate MetricFlow metrics from natural language business descriptions
Author MetricFlow semantic model YAML from database tables with validation and Knowledge Base publishing
Optional semantic-model profiling workflow that mines historical SQL and bounded column distributions before YAML authoring
Build the project's vector-indexed knowledge base from files plus database metadata — optionally scoped to specific files / tables / datasources / domains. Scan the in-scope material, classify it into business domains, explore each domain's tables and docs in parallel with explore subagents (the validated-query SQL corpus is enumerated directly, no explore needed), then (after the user confirms a generation manifest — or directly, in the same turn, when the user has waived confirmation) route every artifact to its store via storage-classify, generating semantic_models / metrics / reference_sql (and mining any extra knowledge), and refresh AGENTS.md's KB index. The lightweight /init handles the AGENTS.md inventory plus file-based knowledge/memory; this skill owns the heavy vector-store generation.
Create new Datus skills from scratch. Use when users want to build a new skill, scaffold a skill directory, or capture a workflow as a reusable skill. Trigger phrases include "create a skill", "make a skill for", "turn this into a skill", "new skill".
Activate when the gen_job agent detects that the source and target databases differ. Covers cross-database transfer lifecycle - type mapping via adapter Mixin hints, DDL generation, data transfer via transfer_query_result, and lightweight reconciliation.