Skillpedia
التحليل وجداول البيانات18k · #10729

usage

ما الذي تفعله

تُرشد هذه المهارة الإجابة عن أسئلة البيانات باستخدام سطر أوامر Wren، بما في ذلك جمع سياق المخطط، وكتابة SQL عبر الطبقة الدلالية، وتشغيله. وهي للمحللين ومستخدمي الأعمال الذين يطرحون أسئلة مثل كم، أو أعلى عشرة، أو الاتجاه.

متى تستخدمها

  • ✓عندما تسأل كم طلبًا أو عميلًا أو دولارًا حققه شيء ما خلال فترة معينة.
  • ✓عندما تطلب قائمة أعلى النتائج أو تفصيلًا أو اتجاهًا في بيانات عملك.
  • ✓عندما تريد تقريرًا أو تحليلًا لمقياس أعمال من قاعدة البيانات المتصلة.

رابط المهارة

https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/usage/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/usage/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“كم عميلًا جديدًا حصلنا عليه في الربع الأخير، وكيف يقارن ذلك بالربع الذي سبقه؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يتحقق وكيلك من التثبيت، ويقرأ مخطط المشروع واستعلامات سابقة، ويكتب SQL عبر النموذج الدلالي، ثم يشغّله ويعرض النتائج.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من 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.,
الأسئلة الشائعة

هل أحتاج إلى كتابة SQL بنفسي؟

لا. يكتب وكيلك SQL عبر الطبقة الدلالية، مستخدمًا تعريفات المشروع.

هل يتعلم من الأسئلة السابقة؟

نعم. تذكر المهارة استرجاع الاستعلامات السابقة والتعلم من النتائج المؤكدة.

ماذا لو كانت الأداة غير موجودة في البيئة؟

تتحقق المهارة من سطر أوامر Wren أولًا، وتعرض تثبيته إذا لم يكن متاحًا.

التفاصيل

الوصف الأصلي من المؤلف

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

الشعبية

نجوم GitHub
18k
الترتيب
#10729
الترخيص
—
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة