generate-mdl
O que ela faz
Esta skill orienta a criação de um projeto MDL do Wren a partir de um banco existente, incluindo a descoberta do esquema, a limpeza de tipos e a geração de YAML com a linha de comando wren. É para analistas que querem montar uma camada semântica sobre um banco que já usam.
Quando usar
- ✓Quando você quer montar um novo projeto Wren para um banco de dados que já existe.
- ✓Quando sua equipe já cataloga o banco no OpenMetadata e você quer importá-lo.
- ✓Quando você precisa criar a base de um projeto semântico a partir de tabelas existentes e dos seus relacionamentos.
Link da skill
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/generate-mdl/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Crie um projeto Wren a partir do nosso banco de vendas no Postgres, inferindo os relacionamentos entre as tabelas e verificando se o projeto compila.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A skill faz o agente ler o esquema com as suas ferramentas de banco, normalizar os tipos de dados, gerar os arquivos do projeto com a CLI do wren e validar a compilação.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
Generate Wren MDL — CLI Agent Workflow
Builds an MDL project by discovering database schema and converting it into Wren's YAML project format. The agent uses whatever database tools are available in its environment for introspection; the wren CLI handles type normalization, validation, and build.
For memory and query workflows after setup, run wren skills get usage.
Prerequisites
wrenCLI installed (pip install "wrenai[<datasource>]")- A working database connection (credentials available to the agent)
- A connection profile (set up via
wren profile add) or connection info ready
Alternative — import from an OpenMetadata catalog
If the user's team already catalogs this database in OpenMetadata, import
from the catalog instead of introspecting the live database. The import
carries curated table/column descriptions, tags, owners, and foreign-key
constraints (as relationships.yml), so the join-inference work in Phase 4
is mostly done:
wren context import openmetadata --host <om_url> --token <om_token> \
--service <om_service> --database <db> --schema <schema> --dry-run
wren context import openmetadata --host <om_url> --token <om_token> \
--service <om_service> --database <db> --schema <schema>
Ask the user for the OpenMetadata URL, a read-only bot or personal access
token, and the service name as it appears in OpenMetadata. --table
(repeatable) narrows the import. Without --force the command only adds
files that do not exist and lists the collisions it left untouched; --force
regenerates from OpenMetadata and discards local edits to generated files —
confirm with the user before using it. Relationships come from foreign keys
only; review whether additional joins are needed (Phase 4), then bind a
profile and finish with Phase 5 (wren context validate → wren context build).
Phase 0 — Detect existing project
Goal: If the current directory is already inside a wren project, let the user decide how to proceed.
Check whether wren_project.yml exists in the current working directory
(or any parent up to the repository root). If found:
- Tell the user that an existing wren project was detected and show its path.
- Ask:
- Reset — wipe the existing project (
models/,views/,relationships.yml,knowledge/, and rebuildwren_project.yml) and regenerate from scratch in the same directory. - New path — keep the existing project untouched and choose a
different directory for the new project. Ask the user for the new path,
then
wren context init --path <new_path>and continue from Phase 1 using that path.
- Reset — wipe the existing project (
If no existing project is detected, proceed directly to Phase 1.
Phase 1 — Establish connection and scope
Goal: Confirm the agent can reach the database and agree on scope with the user.
Verify connectivity using whichever tool is available:
- If SQLAlchemy:
engine.connect()test - If database driver: simple query like
SELECT 1 - If wren profile exists:
wren profile debugto check config - If raw SQL via wren:
wren --sql "SELECT 1"(requires profile or connection file)
- If SQLAlchemy:
Ask the user:
- Which schema(s) or dataset(s) to include (skip if only one exists)
- Whether to include all tables or a subset
- The datasource type for wren (e.g.,
postgres(including Aurora),mysql(including Aurora),bigquery,snowflake) — needed for type normalization dialect
Phase 2 — Discover schema
Goal: Collect table names, column names, column types, and constraints.
Use whatever introspection method is available. Here are common approaches ranked by convenience:
Option A: SQLAlchemy (recommended if available)
from sqlalchemy import create_engine, inspect
engine = create_engine(connection_url)
inspector = inspect(engine)
tables = inspector.get_table_names(schema="public")
for table in tables:
columns = inspector.get_columns(table, schema="public")
# columns → [{"name": "id", "type": INTEGER(), "nullable": False, ...}]
pk = inspector.get_pk_constraint(table, schema="public")
# pk → {"constrained_columns": ["id"], "name": "orders_pkey"}
fks = inspector.get_foreign_keys(table, schema="public")
# fks → [{"constrained_columns": ["customer_id"],
# "referred_table": "customers",
# "referred_columns": ["id"]}]
Option B: Database-specific driver
- psycopg / asyncpg (Postgres): Query `informatio
Perguntas frequentes
O que é o MDL?
É o formato de modelo semântico que o Wren usa para descrever tabelas, colunas e relacionamentos em YAML simples.
Pode importar de um catálogo de dados?
Sim. A skill descreve a importação do OpenMetadata, que traz descrições e chaves estrangeiras para o projeto.
Precisa de credenciais do banco?
Sim. O agente precisa de uma conexão funcional e de credenciais disponíveis no ambiente para ler o esquema.
Detalhes
Descrição original do autor
Generate a Wren MDL project by exploring a database with available tools (SQLAlchemy, database drivers, MCP connectors, or raw SQL). Guides agents through schema discovery, type normalization, and MDL YAML generation using the wren CLI. Use when: user wants to create or set up a new MDL, onboard a new data source, or scaffold a project from an existing database.
repo: Canner/WrenAI
Popularidade
- Estrelas no GitHub
- 18 mil
- Posição no ranking
- #10727
- Licença
- —
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
dlt-connector
18 milAjuda seu agente a carregar dados de ferramentas SaaS como HubSpot ou Stripe em um arquivo DuckDB local, prontos para análise SQL com o Wren.
enrich-context
18 milAjuda seu agente a acrescentar significado de negócio a um projeto de dados do Wren, como unidades, valores de enumeração, sinônimos e métricas padrão.
genbi
18 milAjuda seu agente a transformar um projeto de dados do Wren em um dashboard compartilhável no navegador e a publicá-lo na conta de hospedagem do próprio usuário.
onboarding
18 milAjuda seu agente a configurar o Wren Engine do zero: verificar o ambiente, criar um projeto, conectar um banco de dados e rodar a primeira consulta.
Skills parecidas
discrawl
394 milPermite que seu agente pesquise e resuma um arquivo local salvo de mensagens do Discord, verifique quão atualizado ele está e leia mensagens diretas.
clickhouse-io
280 milAjuda seu agente a otimizar consultas e esquemas no ClickHouse com boas práticas de alta performance. Use quando consultas analíticas forem lentas.
scientific-db-pubmed-database
280 milAjuda seu agente a buscar artigos científicos na área biomédica. É útil para pesquisas que precisam de informações médicas específicas.