usage
What it does
This skill guides answering data questions with the Wren command line, including gathering schema context, writing SQL through the semantic layer and running it. It is for analysts and business users who ask questions such as how many, top ten or trend.
When to use it
- βWhen you ask how many orders, customers or dollars something was over a period.
- βWhen you ask for a top list, a breakdown or a trend in your business data.
- βWhen you want a report or analysis of a business metric from your connected database.
Skill link
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/usage/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βHow many new customers did we get last quarter, and how does that compare with the quarter before?β
5 new skills a week. 1 minute to read.
How it works
The skill has your agent check the installation, read the project's schema and past queries, write SQL through the semantic model, run it and show the results.
Technical content (original SKILL.md)
Original text by the author, straight from 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.,
FAQ
Do I need to write SQL myself?
No. Your agent writes the SQL through the semantic layer, using the project's definitions.
Does it learn from past questions?
Yes. The skill mentions recalling past queries and learning from confirmed results.
What if the environment is missing the tool?
The skill checks the Wren command line first and offers to install it if it is not available.
Details
Original description by the author
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
Popularity
- GitHub stars
- 18k
- Ranking position
- #10729
- License
- β
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
dlt-connector
18kHelps your agent load data from SaaS tools such as HubSpot or Stripe into a local DuckDB file, ready for Wren SQL analysis.
enrich-context
18kHelps your agent add business meaning to a Wren data project, such as units, enum values, synonyms and standard metrics.
genbi
18kHelps your agent turn a Wren data project into a shareable browser dashboard and deploy it to the user's own hosting account.
generate-mdl
18kHelps your agent create a Wren semantic project by exploring a database schema, normalizing types and generating the YAML files.
Similar skills
gitcrawl
394kLets your agent search a saved archive of GitHub issues and pull requests, group duplicates, and check their current status on GitHub.
slacrawl
394kLets your agent search and count messages in a local Slack archive, check how fresh that archive is, and refresh it when needed.
goplaces
394kHelps your agent search for places, get their details and reviews, and resolve place names using Google Places, with JSON output for scripts.