usage
Qué hace
Esta skill guía la respuesta a preguntas sobre datos con la CLI de Wren, incluyendo la recopilación del contexto del esquema, la escritura de SQL a través de la capa semántica y su ejecución. Está pensada para analistas y usuarios de negocio que hacen preguntas como cuántos, los diez primeros o una tendencia.
Cuándo usarla
- ✓Cuando preguntas cuántos pedidos, clientes o dólares hubo en un periodo.
- ✓Cuando pides una lista de los primeros, un desglose o una tendencia en tus datos de negocio.
- ✓Cuando quieres un informe o un análisis de una métrica de negocio de tu base de datos conectada.
Link de la skill
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/usage/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“¿Cuántos clientes nuevos tuvimos el último trimestre y cómo se compara con el trimestre anterior?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La skill hace que tu agente compruebe la instalación, lea el esquema del proyecto y las consultas anteriores, escriba SQL a través del modelo semántico, lo ejecute y muestre los resultados.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Wren Engine CLI — Agent Workflow Guide
This guide is served by the
wrenCLI (wren skills get usage), so it always matches your installed wrenai version. Pull the deeper reference docs withwren skills get usage --full.
Preflight — Verify environment and installation
Goal: Ensure the wren CLI is available before entering any workflow.
Step 1 — Check Python virtual environment
Run python -c "import sys; print(sys.prefix)" (or equivalent) to determine
whether a virtual environment is active.
- If no venv is active, warn the user and ask whether to:
- Create one (e.g.,
python -m venv .venv && source .venv/bin/activate) - Continue without a venv (not recommended — may pollute global packages)
- Create one (e.g.,
Step 2 — Check if the wren CLI is installed
Run wren --version. If the command is not found or errors:
Tell the user that the
wrenCLI is not installed.Ask if you should help install it.
If the user agrees, determine the datasource extra to install:
Auto-detect from project: Check whether the current directory is inside a wren project (look for
wren_project.ymlup to the repository root). If found, read the active profile withcat ~/.wren/profiles.ymlor look for a datasource hint in the project's profile configuration. Extract the datasource type from there.Ask the user: If no project is detected or no datasource can be inferred, ask the user which database they plan to connect to. Valid extras:
postgres(for Aurora Postgres),mysql(for Aurora MySQL),bigquery,snowflake,clickhouse,trino,mssql,databricks,redshift,spark,athena,oracle. DuckDB is included by default — no extra needed.Install with the detected or chosen extra:
# DuckDB (no extra needed) pip install "wrenai" # Other datasources pip install "wrenai[<datasource>]"To also enable semantic memory, interactive prompts, and web UI (recommended):
pip install "wrenai[<datasource>,main]" # or for DuckDB: pip install "wrenai[main]"Verify:
wren --version
If wren --version succeeds, proceed to the relevant workflow below.
The wren CLI queries databases through an MDL (Model Definition Language) semantic layer. You write SQL against model names, not raw tables. The engine translates to the target dialect.
Two things drive everything:
- Profile — database connection + datasource type, managed via
wren profile(stored in~/.wren/profiles.yml) - Project — MDL model definitions in YAML, compiled to
target/mdl.jsonviawren context build
The CLI reads the active profile for connection info and datasource. Use wren profile list to see which profile is active, wren profile switch <name> to change it. dry-plan also accepts --datasource / -d for transpile-only use without a profile.
For memory-specific decisions, see the memory reference (run wren skills get usage --full).
For SQL syntax, CTE-based modeling, and error diagnosis, see the wren-sql reference (run wren skills get usage --full).
For project structure, MDL field definitions, and CLI workflow details, see the documentation.
Workflow 1: Answering a data question
Step 1 — Gather context
| Situation | Command |
|---|---|
| Default | wren memory fetch -q "<question>" |
| Need specific model's columns | wren memory fetch -q "..." --model <name> --threshold 0 |
| Memory not installed | Read target/mdl.json in the project directory, or run wren context show |
If this is the first query in the conversation, also run:
wren context instructions
If it returns content, treat it as rules that override defaults — apply them to all subsequent queries in this session.
Step 2 — Recall past queries
wren memory recall -q "<question>" --limit 3
Use results as few-shot examples. Skip if empty.
Step 2.5 — Assess complexity (before writing SQL)
If the question involves any of the following, consider decomposing:
- Multiple metrics or aggregations (e.g., "churn rate AND expansion revenue")
- Multi-step calculations (e.g., "month-over-month growth rate")
- Comparisons across segments (e.g., "by plan tier, by region")
- Time-series analysis requiring baseline + change (e.g., "retention curve")
Decomposition strategy:
- Identify the sub-questions (e.g.,
Preguntas frecuentes
¿Necesito escribir el SQL yo mismo?
No. Tu agente escribe el SQL a través de la capa semántica, usando las definiciones del proyecto.
¿Aprende de las preguntas anteriores?
Sí. La skill menciona recordar consultas anteriores y aprender de los resultados confirmados.
¿Qué pasa si falta la herramienta en el entorno?
La skill comprueba primero la línea de comandos de Wren y ofrece instalarla si no está disponible.
Detalles
Descripción original del autor
Wren Engine CLI workflow guide for AI agents. Answer data questions end-to-end using the wren CLI: gather schema context, recall past queries, write SQL through the MDL semantic layer, execute, and learn from confirmed results. Use when: user asks a data question, requests a report or analysis, asks about metrics, revenue, customers, orders, trends, or any business data; user says 'how many', 'show me', 'what is the', 'top N', 'compare', 'trend', 'growth', 'breakdown'; user wants to explore, analyze, filter, aggregate, or summarize data from a database; agent needs to query data, connect a dat
repo: Canner/WrenAI
Popularidad
- Estrellas en GitHub
- 18 mil
- Posición en el ranking
- #10729
- Licencia
- —
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
dlt-connector
18 milAyuda a tu agente a cargar datos de herramientas SaaS como HubSpot o Stripe en un archivo DuckDB local, listo para el análisis SQL con Wren.
enrich-context
18 milAyuda a tu agente a añadir significado de negocio a un proyecto de datos de Wren, como unidades, valores enumerados, sinónimos y métricas estándar.
genbi
18 milAyuda a tu agente a convertir un proyecto de datos de Wren en un panel compartible en el navegador y publicarlo en el alojamiento propio del usuario.
generate-mdl
18 milAyuda a tu agente a crear un proyecto semántico de Wren explorando un esquema de base de datos, normalizando tipos y generando los archivos YAML.
Skills parecidas
gitcrawl
394 milPermite que tu agente busque en un archivo guardado de incidencias y pull requests de GitHub, agrupe duplicados y revise su estado actual en GitHub.
slacrawl
394 milPermite que tu agente busque y cuente mensajes en un archivo local de Slack, revise qué tan reciente es y lo actualice cuando haga falta.
goplaces
394 milAyuda a tu agente a buscar lugares, obtener sus detalles y reseñas, y resolver nombres de lugares usando Google Places, con salida JSON para scripts.