
Business Context for Data
Adds units, enum meanings and metric definitions that a database schema cannot hold.
Install
npx skills add Canner/WrenAI --skill enrich-context -g -a claude-code -y- Repository
- Canner/WrenAI18k
- Category
- Data and ML
- Updated
- 5d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
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 additions like new cubes / views / relationships). Reads everything under <project>/raw/ (PDFs, glossaries, handbooks, code, data dictionaries) and optionally samples low-cardinality columns from the live DB (grill mode), compares against the current MDL / cubes / knowledge (rules + NL→SQL pairs), then fills gaps via the ten-category gap catalog and the cube proposal flow. Confirmed findings are written back to the right sink. Use when: user says 'enrich context', 'augment my project', 'grill me on this project', 'auto-fill my context', 'agent doesn't understand our docs / enum values / units / null meanings', 'business context is missing', 'what does status=A mean', 'is this amount in USD or cents', 'we keep getting wrong aggregations', 'add cubes for ARR / DAU / churn', 'we have a handbook / glossary / data dictionary the agent should know'; or after generating an MDL and noticing the agent l
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.
