Skip to content
Skillpedia
Analysis & spreadsheets18k Β· #10729

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.md

Copy 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

Use this skill to help me: https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/usage/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

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 wren CLI (wren skills get usage), so it always matches your installed wrenai version. Pull the deeper reference docs with wren 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)

Step 2 β€” Check if the wren CLI is installed

Run wren --version. If the command is not found or errors:

  1. Tell the user that the wren CLI is not installed.

  2. Ask if you should help install it.

  3. 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.yml up to the repository root). If found, read the active profile with cat ~/.wren/profiles.yml or 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.

  4. 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]"
    
  5. 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.json via wren 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:

  1. 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

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills