generate-mdl
하는 일
이 스킬은 이미 쓰고 있는 데이터베이스에서 Wren MDL 프로젝트를 만드는 방법을 안내합니다. 스키마 탐색, 타입 정리, wren 명령줄로 YAML 생성을 포함합니다. 이미 쓰는 데이터베이스 위에 시맨틱 계층을 만들려는 분석가를 위한 스킬입니다.
사용하는 경우
- ✓이미 가진 데이터베이스를 위해 새 Wren 프로젝트를 설정하고 싶을 때.
- ✓팀이 이미 OpenMetadata에 데이터베이스를 등록해 두었고 그것을 가져오고 싶을 때.
- ✓기존 테이블과 관계에서 시맨틱 프로젝트의 뼈대를 만들어야 할 때.
스킬 링크
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/generate-mdl/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 Postgres 판매 데이터베이스로 Wren 프로젝트를 만들어 주세요. 테이블 관계를 추론하고, 프로젝트가 빌드되는지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 에이전트가 데이터베이스 도구로 스키마를 읽고, 데이터 타입을 정리하고, wren CLI로 프로젝트 파일을 생성하고, 빌드를 검증하도록 안내합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
MDL이란 무엇인가요?
Wren이 테이블, 열, 관계를 평범한 YAML로 설명할 때 쓰는 시맨틱 모델 형식입니다.
데이터 카탈로그에서 가져올 수 있나요?
네. 스킬은 OpenMetadata에서 가져오는 방법을 설명하며, 설명과 외래 키가 프로젝트로 옮겨집니다.
데이터베이스 자격 증명이 필요한가요?
네. 에이전트가 스키마를 읽으려면 작동하는 연결과 환경에 있는 자격 증명이 필요합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 18k
- 순위
- #10727
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
dlt-connector
18k에이전트가 HubSpot이나 Stripe 같은 SaaS 데이터를 로컬 DuckDB 파일로 불러와 Wren SQL 분석에 쓸 수 있게 합니다.
enrich-context
18k에이전트가 단위, 열거형 값, 동의어, 표준 지표처럼 업무 의미를 Wren 데이터 프로젝트에 더하도록 돕습니다.
genbi
18k에이전트가 Wren 데이터 프로젝트를 공유 가능한 브라우저 대시보드로 바꾸고, 사용자의 호스팅 계정에 배포하도록 돕습니다.
onboarding
18k에이전트가 처음부터 Wren Engine을 설정하도록 돕습니다. 환경 확인, 프로젝트 생성, 데이터베이스 연결, 첫 쿼리 실행을 포함합니다.
비슷한 스킬
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
clickhouse-io
280k에이전트가 ClickHouse 데이터베이스의 쿼리와 스키마를 최적화하도록 돕습니다. 고성능 분석 작업의 모범 사례를 적용합니다. 분석 쿼리가 느릴 때 씁니다.
scientific-db-pubmed-database
280k생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.