Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

wren-usage鹪鹩的用法

Agent Skill

wren-usage 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

371

周安装

15

GitHub Stars

656

下载量

116
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:wren-usage(鹪鹩的用法)
来源仓库:https://github.com/canner/wren-engine
仓库路径:skills/wren-usage
安装命令:
npx skills add https://github.com/canner/wren-engine --skill wren-usage
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/canner/wren-engine --skill wren-usage

简介

该技能用于 wren 引擎用法相关的信息检索与筛选。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中基于关键词的快速定位。
  • 支持根据任务场景或来源线索过滤候选结果。wren-usage 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 通过 GitHub 仓库安装,注意权限与维护状态。
  • 建议查阅原始文档了解具体功能与使用方式。

SKILL.md

Wren Engine CLI — Agent Workflow Guide

Version check

Silently fetch https://raw.githubusercontent.com/Canner/wren-engine/main/skills/versions.json. Compare the wren-usage key with this skill's version (from the frontmatter above). If the remote version is newer, notify the user before proceeding:

A newer version of the wren-usage skill is available. Update with: `` npx skills add Canner/wren-engine --skill wren-usage ` The CLI auto-detects your installed agent. To target a specific one, add --agent <name> (e.g., claude-code, cursor, windsurf, cline`).

Then continue with the workflow below regardless of update status.


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 wren-engine 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, 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 "wren-engine" # Other datasources pip install "wren-engine[<datasource>]" To also enable semantic memory, interactive prompts, and web UI (recommended): pip install "wren-engine[<datasource>,main]" # or for DuckDB: pip install "wren-engine[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 references/memory.md. For SQL syntax, CTE-based modeling, and error diagnosis, see references/wren-sql.md. For project structure, MDL field definitions, and CLI workflow details, see the documentation.


Workflow 1: Answering a data question

Step 1 — Gather context

SituationCommand
Defaultwren memory fetch -q "<question>"
Need specific model's columnswren memory fetch -q "..." --model <name> --threshold 0
Memory not installedRead 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., "total subscribers at start" + "subscribers who cancelled" → churn rate)
  2. For each sub-question:

- wren memory recall -q "<sub-question>" — check if a similar pattern exists - Write and execute a simple SQL - Note the result

  1. Combine sub-results to answer the original question

When NOT to decompose:

  • Single-table aggregation with GROUP BY — just write the SQL
  • Simple JOINs that the MDL relationships already define
  • Questions where memory recall returns a near-exact match

This is a judgment call, not a rigid rule. If you're confident in a single query, go ahead. Decompose when the SQL would be hard to debug if it fails.

Step 3 — Write, verify, and execute SQL

For simple queries (single table or simple MDL-defined JOINs, straightforward aggregation): Execute directly:

wren --sql 'SELECT c_name, SUM(o_totalprice) FROM orders
JOIN customer ON orders.o_custkey = customer.c_custkey
GROUP BY 1 ORDER BY 2 DESC LIMIT 5'

For complex queries (non-trivial JOINs not covered by MDL relationships, subqueries, multi-step logic): Verify first with dry-plan:

wren dry-plan --sql 'SELECT ...'

Check the expanded SQL output:

  • Are the correct models and columns referenced?
  • Do the JOINs match expected relationships?
  • Are CTEs expanded correctly?

If the expanded SQL looks wrong, fix before executing. If it looks correct, proceed:

wren --sql 'SELECT ...'

SQL rules:

  • Target MDL model names, not database tables
  • Write dialect-neutral SQL — the engine translates

Step 4 — Store and continue

After successful execution, store the query by default:

wren memory store --nl "<user's original question>" --sql "<the SQL>"

Skip storing only when:

  • The query failed or returned an error
  • The user said the result is wrong
  • The query is exploratory (SELECT *... LIMIT N without analytical clauses)
  • There is no natural language question — just raw SQL
  • The user explicitly asked not to store

The CLI auto-detects exploratory queries — if you see no store hint after execution, the query was classified as exploratory.

OutcomeAction
User confirms correctStore
User continues with follow-upStore, then handle follow-up
User says nothing (but question had clear NL description)Store
User says wrongDo NOT store — fix the SQL
Query errorSee Error recovery below

Workflow 2: Error recovery

"table not found"

  1. Verify model name: wren memory fetch -q "<name>" --type model --threshold 0
  2. Check MDL exists: ls target/mdl.json (or wren context show)
  3. Verify column: wren memory fetch -q "<column>" --model <name> --threshold 0

Connection error

  1. Check active profile: wren profile debug
  2. Verify datasource and connection fields are correct
  3. Test: wren --sql "SELECT 1"
  4. Valid datasource values: postgres, mysql, bigquery, snowflake, clickhouse, trino, mssql, databricks, redshift, spark, athena, oracle, duckdb
  5. If no profile exists, create one: wren profile add --ui (or --interactive / --from-file)

SQL syntax / planning error (enhanced)

Layer 1: Identify the failure point

wren dry-plan --sql "<failed SQL>"
dry-plan resultFailure layerNext step
dry-plan failsMDL / semantic→ Layer 2A
dry-plan succeeds, execution failsDB / dialect→ Layer 2B

Layer 2A: MDL-level diagnosis (dry-plan failed)

The dry-plan error message tells you exactly what's wrong:

Error patternDiagnosisFix
column 'X' not found in model 'Y'Wrong column namewren memory fetch -q "X" --model Y --threshold 0 to find correct name
model 'X' not foundWrong model namewren memory fetch -q "X" --type model --threshold 0
ambiguous column 'X'Column exists in multiple modelsQualify with model name: ModelName.column
Planning error with JOINRelationship not defined in MDLCheck available relationships in context

Key principle: Fix ONE issue at a time. Re-run dry-plan after each fix to see if new errors surface.

Layer 2B: DB-level diagnosis (dry-plan OK, execution failed)

The DB error + dry-plan output together pinpoint the issue:

  1. Read the dry-plan expanded SQL — this is what actually runs on the DB
  2. Compare with the DB error message:
Error patternDiagnosisFix
Type mismatchColumn type differs from assumedCheck column type in context, add explicit CAST
Function not supportedDialect-specific functionUse dialect-neutral alternative
Permission deniedTable/schema accessCheck connection credentials
TimeoutQuery too expensiveSimplify: reduce JOINs, add filters, LIMIT

For small models: If the error message is unclear, try simplifying the query to the smallest failing fragment. Execute subqueries independently to isolate which part fails.

For the CTE rewrite pipeline and additional error patterns, see references/wren-sql.md.


Workflow 3: Connecting a new data source

  1. Add a profile: wren profile add --ui (or --interactive / --from-file)
  2. Test connection: wren profile debug
  3. Test query: wren --sql "SELECT 1"
  4. Initialize project: wren context init
  5. Build manifest: wren context build
  6. Index: wren memory index
  7. Verify: wren --sql "SELECT * FROM <model> LIMIT 5"

Workflow 4: After MDL changes

When model YAML files are updated, rebuild and re-index:

# 1. Validate changes
wren context validate

# 2. Rebuild manifest
wren context build

# 3. Re-index schema memory
wren memory index

# 4. Verify
wren --sql "SELECT * FROM <changed_model> LIMIT 1"

Command decision tree

Get data back           → wren --sql "..."
See translated SQL only → wren dry-plan --sql "..." (accepts -d <datasource> if no active profile)
Validate against DB     → wren dry-run --sql "..."
Schema context          → wren memory fetch -q "..."
Filter by type/model    → wren memory fetch -q "..." --type T --model M --threshold 0
Store confirmed query   → wren memory store --nl "..." --sql "..."
Few-shot examples       → wren memory recall -q "..."
Index stats             → wren memory status
Re-index after MDL change → wren memory index
Show project context    → wren context show
Rebuild manifest        → wren context build
Check profile           → wren profile debug
Switch profile          → wren profile switch <name>

Things to avoid

  • Do not guess model or column names — check context first
  • Do not store failed queries or queries the user said are wrong
  • Do not skip storing successful queries with a clear NL question — default is to store
  • Do not re-index before every query — once per MDL change
  • Do not pass passwords via --connection-info if shell history is shared — use profiles (wren profile add) or --connection-file

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.78%
按下载量换算40

Claude

27.08%
按下载量换算31

Cursor

20.2%
按下载量换算23

Gemini CLI

10.14%
按下载量换算12

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills