用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Datus-ai/Datus-agent --skill gen-table命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Create or update custom Datus subagents by editing the loaded agent.yml. Use when a workflow needs persistent agentic_nodes scoped to already-built tables, metrics, or reference SQL.
Bootstrap project reference SQL and metrics from a BI dashboard through an installed plugin. Use when the user asks to initialize, import, extract, or build context, reference SQL, semantic models, or metrics from a dashboard or requests dashboard bootstrap.
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.
基于 SOC 职业分类
正在显示 SKILL.md
| 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="semantic_modeling", prompt="{table_name}"). For MetricFlow or OSI, explain that the project is query-only and must be migrated to Dosi before authoring.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.semantic_modeling for semantic authoring; in MetricFlow or OSI, give the query-only migration guidance instead.