enrich-context
它能做什么
这个技能指导为 Wren 语义项目添加业务上下文,涵盖数据库结构本身不会显示的内容,例如单位、哨兵值、默认筛选条件和指标定义。适合希望 AI 正确回答业务问题的分析师。
适用场景
- ✓当 AI 因为单位(例如分或秒)不清楚而给出错误答案时。
- ✓当需要向项目说明代码或哨兵值(例如负一)的含义时。
- ✓当 ARR、流失率或日活跃用户等标准指标需要为所有人统一定义时。
技能链接
https://github.com/Canner/WrenAI/blob/main/core/wren/src/wren/skills_content/enrich-context/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请告诉 Wren 项目:我们的收入列以分为单位,状态代码负一表示未知,并且默认应排除已删除的行。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能会阅读业务文档和现有项目文件,起草补充内容,用验证检查每次更改,并且只在现有内容之上添加,而不是编辑它。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Wren Enrich Context — Fill the Business-Context Gap
This skill exists because most business context never lives in a DB schema — it lives in handbooks, glossaries, finance reports, support playbooks, code comments, Slack rules-of-thumb. The agent reads those raw artifacts, finds what's missing from the Wren project, and either grills the user one question at a time (grill mode) or applies its best inferences directly and hands over an audit (auto-pilot mode) before writing back. The output lands in the sinks each project already has — MDL, cubes/, knowledge/rules/, and knowledge/sql/ — no new artifact, no new tooling.
Hard rules — READ FIRST
Universal (apply to both modes)
- Only add, never modify existing. If you find an existing MDL description / relationship / rule that looks wrong, do not edit it. Surface it on the "please fix manually" list shown in Step 9.
- Every MDL edit must validate. Right after any MDL YAML change, run
wren context validate. If it fails, revert that single change and feed the error back. Never leave a project in an invalid state. - Pre-draft every proposal. Whether you're showing the draft to the user (grill) or applying it directly (auto-pilot), generate the concrete content — never lazy-ask "what should the description say?".
- Be explicit about confidence. In grill mode, open Lane 3 inference questions with "I'm guessing — ". In auto-pilot, tag every Lane 3 inference and partial Lane 2 match in the Step 9 audit with confidence (high / med / low) and source.
Grill mode only
- One question at a time. Grill relentlessly. Walk every gap top-down, resolve one decision before moving to the next. Provide a recommended answer for every question.
- Skip is final for this session. No pending queue, no nagging next round. If the user wants to revisit, they re-run the skill.
Auto-pilot mode only
Drop into grill for three cases. Always interrupt auto-pilot and ask the user when:
- (a) Lane 2 conflict — raw and current MDL disagree.
- (b) High-blast-radius proposal (any lane) — new cube, new view, new relationship, or new MDL metric/calculated column. These become public artifacts visible to every future agent session, so blast radius doesn't depend on whether the trigger was raw evidence (Lane 2) or inference (Lane 3).
- (c) Lane 2 routing ambiguity — you can't confidently pick a sink (MDL /
knowledge/rules//knowledge/sql//cubes/).
Everything else: apply directly and log to the audit list.
Step 0 — Mode selection (before anything else)
Before touching the project or reading any file, ask the user which mode to run in. Lock the choice for the whole session — no mid-session switching; the user re-runs to change.
Two modes for this session:
a) Grill mode — I walk every gap with you, one question at a time, proposing a draft and waiting for your accept / edit / skip. You stay in the driver's seat. Best when the raw material is sensitive, when you want to learn what I don't know about your project, or when you'd rather review than re-do.
b) Auto-pilot mode — I read raw + current context, make my best inferences, and apply them. I'll only stop to grill you on (1) conflicts between raw and existing MDL and (2) high-blast-radius additions like new metrics, views, or relationships. The session ends with a full diff + confidence-tagged inference list for you to audit.
Which? (a / b)
Remember the choice as MODE = grill | autopilot and use it to branch Steps 6 and 9.
Preflight
Step 1 — Choose the Wren project
Always ask the user which project to enrich before doing anything else — never assume cwd. A user can have several Wren projects and an ambient ~/.wren profile that doesn't match the one they want to augment.
Offer concrete hints in the question so the user can answer in one round-trip:
# Hint 1 — does cwd look like a project?
test -f wren_project.yml && pwd
# Hint 2 — does ~/.wren/config.yml point at a default project?
grep -E '^project_path:' ~/.wren/config.yml 2>/dev/null
Then ask:
Which Wren project do you want me to augment? a)
$PWD(current directory) ← if Hint 1 matched b)<path from ~/.wren/config.yml>← if Hint 2 matched c) something else — paste the absolute path
After the user answers, lock the path in for the whole session:
cd <chosen-path>
test -f wren_project.yml || {
echo "Err
常见问题
它会更改我现有的定义吗?
不会。该技能说明它只添加新内容,并列出疑似问题,供你手动修复。
每次更改都会被检查吗?
会。该技能在每次更改后验证项目,并撤销任何未通过验证的更改。
它能提出业务指标吗?
能。该技能可以把 ARR、流失率、DAU 和 WAU 等命名指标提出为立方体,供审阅。
详情
作者的原始描述
Augment a Wren project with business context that DB schema cannot carry — enum value meanings, units (USD vs cents, ms vs sec), NULL semantics, magic sentinels (-1 = unknown), soft-delete default filters, business synonyms, time-grain / TZ conventions, cross-system identifiers, currency rules, canonical-table preferences, AND named aggregation metrics (ARR, churn, DAU, WAU, NRR) proposed as cubes. Runs in one of two modes selected at session start: `grill` (one question at a time, user-driven) or `auto-pilot` (agent infers and applies, escalates only on conflicts and high-blast-radius additio
repo: Canner/WrenAI
热度
- GitHub 星标
- 18k
- 排名
- #10725
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
dlt-connector
18k帮你的智能体把 HubSpot、Stripe 等 SaaS 工具的数据加载到本地 DuckDB 文件中,以便用 Wren SQL 进行分析。
genbi
18k帮你的智能体把 Wren 数据项目转化为可分享的浏览器仪表板,并部署到用户自己的托管账户。
generate-mdl
18k帮你的智能体通过探索数据库结构、规范化类型并生成 YAML 文件,来创建 Wren 语义项目。
onboarding
18k帮你的智能体从零开始设置 Wren Engine:检查环境、创建项目、连接数据库并运行第一条查询。