Token导航 LogoToken导航

Agent Skill · 研究检索

wren-generate-mdl(wren 生成 mdl)

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

wren-generate-mdl 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 61,129。

总安装 356周安装 15GitHub Stars 656下载 125核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

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

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

该技能提供 wren 引擎下 MDL 生成的相关信息检索。适用于 Codex、Claude、Cursor、Gemini CLI 中基于关键词的任务匹配。支持快速定位候选结果并过滤无关内容。wren-generate-mdl 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

通过 GitHub 仓库安装,注意权限与维护状态。建议结合原始 README 确认具体功能与适用场景。

来源仓库内路径:skills/wren-generate-mdl

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/canner/wren-engine --skill wren-generate-mdl;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

wren-generate-mdl 怎么安装?

在终端执行 npx skills add https://github.com/canner/wren-engine --skill wren-generate-mdl。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

wren-generate-mdl 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

wren-generate-mdl 需要什么权限?

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

wren-generate-mdl 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

wren-generate-mdl 用的人多吗?

公开数据是累计安装 356 次,近一周安装 15 次,下载 125 次,GitHub 656 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

wren-generate-mdl 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
wren-generate-mdl

wren 生成 mdl · 本页

356656需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Generate Wren MDL — CLI Agent Workflow

Version check

Silently fetch https://raw.githubusercontent.com/Canner/wren-engine/main/skills/versions.json. Compare the wren-generate-mdl 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-generate-mdl skill is available. Update with: `` npx skills add Canner/wren-engine --skill wren-generate-mdl ` 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.


Builds an MDL project by discovering database schema and converting it into Wren's YAML project format. The agent uses whatever database tools are available in its environment for introspection; the wren CLI handles type normalization, validation, and build.

For memory and query workflows after setup, see the wren-usage skill.


Prerequisites

  • wren CLI installed (pip install wren-engine[<datasource>])
  • A working database connection (credentials available to the agent)
  • A wren profile configured (wren profile add) or connection info ready

Phase 0 — Detect existing project

Goal: If the current directory is already inside a wren project, let the user decide how to proceed.

Check whether wren_project.yml exists in the current working directory (or any parent up to the repository root). If found:

  1. Tell the user that an existing wren project was detected and show its path.
  2. Ask:

- Reset — wipe the existing project (models/, views/, relationships.yml, instructions.md, and rebuild wren_project.yml) and regenerate from scratch in the same directory. - New path — keep the existing project untouched and choose a different directory for the new project. Ask the user for the new path, then wren context init --path <new_path> and continue from Phase 1 using that path.

If no existing project is detected, proceed directly to Phase 1.


Phase 1 — Establish connection and scope

Goal: Confirm the agent can reach the database and agree on scope with the user.

  1. Verify connectivity using whichever tool is available:

- If SQLAlchemy: engine.connect() test - If database driver: simple query like SELECT 1 - If wren profile exists: wren profile debug to check config - If raw SQL via wren: wren --sql "SELECT 1" (requires profile or connection file)

  1. Ask the user:

- Which schema(s) or dataset(s) to include (skip if only one exists) - Whether to include all tables or a subset - The datasource type for wren (e.g., postgres, bigquery, snowflake) — needed for type normalization dialect


Phase 2 — Discover schema

Goal: Collect table names, column names, column types, and constraints.

Use whatever introspection method is available. Here are common approaches ranked by convenience:

Option A: SQLAlchemy (recommended if available)

from sqlalchemy import create_engine, inspect

engine = create_engine(connection_url)
inspector = inspect(engine)

tables = inspector.get_table_names(schema="public")

for table in tables:
    columns = inspector.get_columns(table, schema="public")
    # columns → [{"name": "id", "type": INTEGER(), "nullable": False, ...}]

    pk = inspector.get_pk_constraint(table, schema="public")
    # pk → {"constrained_columns": ["id"], "name": "orders_pkey"}

    fks = inspector.get_foreign_keys(table, schema="public")
    # fks → [{"constrained_columns": ["customer_id"],
    #          "referred_table": "customers",
    #          "referred_columns": ["id"]}]

Option B: Database-specific driver

  • psycopg / asyncpg (Postgres): Query information_schema.columns and information_schema.table_constraints
  • google-cloud-bigquery: client.list_tables(), client.get_table() → table.schema
  • snowflake-connector-python: SHOW COLUMNS IN TABLE, SHOW PRIMARY KEYS IN TABLE
  • clickhouse-driver: DESCRIBE TABLE, system.tables

Option C: Raw SQL via wren

If no driver is available but a wren profile is configured, query information_schema through wren itself:

wren --sql "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'" -o json
wren --sql "SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'orders'" -o json

Note: this goes through the MDL layer, so it only works if you already have a minimal MDL or if the database supports information_schema as regular tables. For bootstrapping from zero, Option A or B is preferred.


Phase 3 — Normalize types

Goal: Convert raw database types to wren-core-compatible types.

Python import (recommended for batch processing)

from wren.type_mapping import parse_type, parse_types

# Single type
normalized = parse_type("character varying(255)", "postgres")  # → "VARCHAR(255)"

# Batch — entire table at once
columns = [
    {"column": "id", "raw_type": "int8"},
    {"column": "name", "raw_type": "character varying"},
    {"column": "total", "raw_type": "numeric(10,2)"},
]
normalized_cols = parse_types(columns, dialect="postgres")
# Each dict now has a "type" key with the normalized value

CLI (if Python import not available)

Single type:

wren utils parse-type --type "character varying(255)" --dialect postgres
# → VARCHAR(255)

Batch (stdin JSON):

echo '[{"column":"id","raw_type":"int8"},{"column":"name","raw_type":"character varying"}]' \
  | wren utils parse-types --dialect postgres

Phase 4 — Scaffold and write MDL project

Goal: Create the YAML project structure.

Step 1 — Initialize project

wren context init --path /path/to/project

This creates:

project/
├── wren_project.yml
├── models/
├── views/
├── relationships.yml
└── instructions.md
IMPORTANT: catalog and schema in wren_project.yml These are Wren Engine's internal namespace — they are NOT the database's native catalog or schema. Keep the defaults (catalog: wren, schema: public) unless you are intentionally configuring a multi-project namespace. Your database's actual catalog/schema is specified per-model in table_reference (see Step 2). Do not copy database catalog/schema values into wren_project.yml.

Step 2 — Write model files

For each table, create a YAML file under models/. Use snake_case naming (the build step converts to camelCase automatically).

# models/orders/metadata.yml
name: orders
table_reference:
  catalog: ""           # database catalog (empty string if not applicable;
                        #   for DuckDB, use the DB file name without extension,
                        #   e.g. jaffle_shop.duckdb → catalog: jaffle_shop)
  schema: public        # database schema (this IS the DB schema)
  table: orders         # database table name
primary_key: order_id
columns:
  - name: order_id
    type: INTEGER
    not_null: true
  - name: customer_id
    type: INTEGER
  - name: total
    type: "DECIMAL(10, 2)"
  - name: status
    type: VARCHAR
    properties:
      description: "Order status: pending, shipped, delivered, cancelled"

Step 3 — Write relationships

From foreign key constraints discovered in Phase 2:

# relationships.yml
- name: orders_customers
  models:
    - orders
    - customers
  join_type: many_to_one
  condition: "orders.customer_id = customers.customer_id"

Join type mapping:

  • FK table → PK table: many_to_one
  • PK table → FK table: one_to_many
  • Unique FK: one_to_one
  • Junction table: many_to_many

If no foreign keys were found, infer from naming conventions:

  • Column <table>_id or <table_singular>_id → likely FK to <table>
  • Ask the user to confirm inferred relationships

Step 4 — Add descriptions (optional but valuable)

Ask the user to describe:

  • Each model (1-2 sentences about what the table represents)
  • Key columns (especially calculated fields or non-obvious names)

These descriptions are indexed by wren memory index and significantly improve LLM query accuracy.


Phase 5 — Validate and build

# Validate YAML structure and integrity
wren context validate --path /path/to/project

# If strict mode is desired:
wren context validate --path /path/to/project --strict

# Build JSON manifest
wren context build --path /path/to/project

# Verify against database
wren --sql "SELECT * FROM <model_name> LIMIT 1"

If validation fails, fix the reported issues and re-run. Common errors:

  • Duplicate model/column names
  • Missing primary key
  • Relationship referencing non-existent model
  • Invalid column type (try re-running through parse_type)

Phase 6 — Initialize memory

# Index schema (generates seed NL-SQL examples automatically)
wren memory index

# Verify
wren memory status

After this step, wren memory fetch and wren memory recall are operational. See the wren-usage skill for query workflows.


Phase 7 — Iterate with the user

The initial MDL is a starting point. Improve it by:

  • Adding calculated columns based on business logic
  • Adding views for common query patterns
  • Refining descriptions based on actual query usage
  • Adding access control (RLAC/CLAC) if needed

Each change follows: edit YAML → wren context validate → wren context build → wren memory index.


Quick reference

TaskCommand / Method
Discover tablesAgent's own tools (SQLAlchemy, driver, raw SQL)
Discover columns + typesAgent's own tools
Discover constraintsAgent's own tools
Normalize types (Python)from wren.type_mapping import parse_type
Normalize types (CLI)wren utils parse-type --type T --dialect D
Normalize types (batch)wren utils parse-types --dialect D < columns.json
Scaffold projectwren context init
Write modelsCreate models/<name>/metadata.yml
Write relationshipsEdit relationships.yml
Validatewren context validate
Build manifestwren context build
Test querywren --sql "SELECT * FROM <model> LIMIT 1"
Index memorywren memory index

Things to avoid

  • Do not hardcode database-specific type strings in MDL — always normalize via parse_type
  • Do not skip validation before build — invalid YAML produces broken manifests silently
  • Do not guess column types — introspect from the actual database
  • Do not write relationships without confirming join conditions — wrong conditions cause silent query errors
  • Do not skip wren memory index after build — stale indexes degrade recall quality

平台分布

Codex

32.98%
按下载量换算41

Claude

31.02%
按下载量换算39

Cursor

17.6%
按下载量换算22

Gemini CLI

9.52%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills