feat(skills): wren-usage memory-aware rewrite + new wren-enrich-context#2262
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR adds a new ChangesSkill registration and documentation updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@core/wren/src/wren/context.py`:
- Around line 398-415: The function save_project_config assumes `config` is a
dict and will raise obscure errors if it isn't; add an explicit input validation
at the top of save_project_config that checks isinstance(config, dict) and
raises a clear TypeError (e.g. "config must be a dict") when not, so subsequent
usage of _PROJECT_FIELD_ORDER and membership checks like `if key in config` are
safe; keep the rest of the logic (building `ordered` and writing PROJECT_FILE
with yaml.safe_dump) unchanged.
In `@skills/wren-grill-context/SKILL.md`:
- Around line 22-24: Update the fenced code blocks in SKILL.md by adding
language identifiers and remove the extra space after blockquote markers: for
the block containing "npx skills add Canner/wren-engine --skill
wren-grill-context" add a language tag (e.g., bash) to the opening fence; for
the example containing "Wren Grill Context — session summary" change the opening
fence to include a language tag (e.g., text) and eliminate the leading space
after each ">" in the quoted lines so blockquote markers are directly followed
by text; apply the same fixes to the other occurrences noted (the blocks around
the same example at lines ~61–63 and ~253).
- Line 205: The table entry allowing "Append / edit directly" for
"instructions.md" conflicts with the hard rule "Only add, never modify existing"
— change the table cell for the "Default filter / implicit rule / business
convention / naming convention" row referencing `instructions.md` to explicitly
enforce "Append only / do not modify existing" (or similar wording like "Append
only / never edit existing content") and ensure any guidance text referencing
`instructions.md` elsewhere (the hard rule) is consistent with that wording so
the writeback contract is unambiguous.
In `@skills/wren-usage/SKILL.md`:
- Around line 364-366: The two fallback links in the onboarding section of
SKILL.md are pointing to docs/get_started/... and will 404; update the URLs to
the correct paths under docs/core/get_started (replace
docs/get_started/installation.md and docs/get_started/connect.md with
docs/core/get_started/installation.md and docs/core/get_started/connect.md) so
the `wren-onboarding` fallback points to the updated installation and connect
docs; verify both links render correctly after change.
- Around line 99-101: The fenced code block in SKILL.md that contains the pip
install command is missing a language tag (MD040); update the block that
currently starts with ``` to include a language identifier (e.g., ```bash) so
the block reads as a bash snippet containing pip install "wren-engine[memory]".
This change targets the fenced block around the pip command in SKILL.md.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a6125ba9-69e0-4109-8576-8996c852b46e
📒 Files selected for processing (18)
core/wren/src/wren/cli.pycore/wren/src/wren/context.pycore/wren/src/wren/context_cli.pycore/wren/src/wren/profile.pycore/wren/tests/test_profile.pycore/wren/tests/unit/test_cli_profile_resolve.pycore/wren/tests/unit/test_context_cli.pydocs/core/get_started/connect.mddocs/core/get_started/installation.mddocs/core/get_started/quickstart.mdskills/SKILLS.mdskills/index.jsonskills/install.shskills/versions.jsonskills/wren-grill-context/SKILL.mdskills/wren-onboarding/SKILL.mdskills/wren-usage/SKILL.mdskills/wren-usage/references/memory.md
7a67a25 to
8b5ed98
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (3)
skills/wren-usage/SKILL.md (2)
99-101:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd a language tag to the fenced command block.
Line 99 still opens a fenced block without a language identifier (MD040).
Suggested fix
-> ``` +> ```bash > pip install "wren-engine[memory]" > ```🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@skills/wren-usage/SKILL.md` around lines 99 - 101, The fenced code block containing the pip command (the block that starts with ``` and contains pip install "wren-engine[memory]") is missing a language tag; update the opening fence to include a language identifier (e.g., change the opening ``` to ```bash) so the block becomes a bash code block in SKILL.md around the pip install "wren-engine[memory]" line.
365-366:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFix onboarding fallback links to the current docs path.
Line 365 and Line 366 still point to
docs/get_started/...; these should usedocs/core/get_started/...to avoid stale links.Suggested fix
-- [`docs/get_started/installation.md`](https://github.com/Canner/wren-engine/blob/main/docs/get_started/installation.md) -- [`docs/get_started/connect.md`](https://github.com/Canner/wren-engine/blob/main/docs/get_started/connect.md) +- [`docs/core/get_started/installation.md`](https://github.com/Canner/wren-engine/blob/main/docs/core/get_started/installation.md) +- [`docs/core/get_started/connect.md`](https://github.com/Canner/wren-engine/blob/main/docs/core/get_started/connect.md)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@skills/wren-usage/SKILL.md` around lines 365 - 366, Update the two onboarding links in SKILL.md that currently point to docs/get_started/... so they use the new docs/core/get_started/... path; specifically replace the link targets for `docs/get_started/installation.md` and `docs/get_started/connect.md` with `docs/core/get_started/installation.md` and `docs/core/get_started/connect.md` respectively to avoid stale links.skills/wren-grill-context/SKILL.md (1)
205-205:⚠️ Potential issue | 🟠 Major | ⚡ Quick winResolve conflict with additive-only rule for
instructions.mdwrites.Line 205 allows "Append / edit directly", which contradicts the hard rule at Line 35 ("Only add, never modify existing") and Line 275 ("only append / add"). Change "edit directly" to "Append only" or "Append new entries only" to clarify that existing instructions.md content must not be modified.
Suggested patch
-| Default filter / implicit rule / business convention / naming convention | **`instructions.md`** | Append / edit directly | +| Default filter / implicit rule / business convention / naming convention | **`instructions.md`** | Append new entries only (do not modify existing text) |🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@skills/wren-grill-context/SKILL.md` at line 205, The table entry that currently reads "Append / edit directly" for **`instructions.md`** conflicts with the repository's additive-only policy ("Only add, never modify existing" and "only append / add"); update that cell (the one under "Default filter / implicit rule / business convention / naming convention" referencing `instructions.md`) to "Append only" or "Append new entries only" so it clearly prohibits editing existing `instructions.md` content and enforces append-only behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@skills/wren-grill-context/SKILL.md`:
- Line 205: The table entry that currently reads "Append / edit directly" for
**`instructions.md`** conflicts with the repository's additive-only policy
("Only add, never modify existing" and "only append / add"); update that cell
(the one under "Default filter / implicit rule / business convention / naming
convention" referencing `instructions.md`) to "Append only" or "Append new
entries only" so it clearly prohibits editing existing `instructions.md` content
and enforces append-only behavior.
In `@skills/wren-usage/SKILL.md`:
- Around line 99-101: The fenced code block containing the pip command (the
block that starts with ``` and contains pip install "wren-engine[memory]") is
missing a language tag; update the opening fence to include a language
identifier (e.g., change the opening ``` to ```bash) so the block becomes a bash
code block in SKILL.md around the pip install "wren-engine[memory]" line.
- Around line 365-366: Update the two onboarding links in SKILL.md that
currently point to docs/get_started/... so they use the new
docs/core/get_started/... path; specifically replace the link targets for
`docs/get_started/installation.md` and `docs/get_started/connect.md` with
`docs/core/get_started/installation.md` and `docs/core/get_started/connect.md`
respectively to avoid stale links.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 35d219aa-c89c-4e19-a13d-5f3ad6ab3362
📒 Files selected for processing (7)
skills/SKILLS.mdskills/index.jsonskills/install.shskills/versions.jsonskills/wren-grill-context/SKILL.mdskills/wren-usage/SKILL.mdskills/wren-usage/references/memory.md
✅ Files skipped from review due to trivial changes (3)
- skills/versions.json
- skills/wren-usage/references/memory.md
- skills/SKILLS.md
🚧 Files skipped from review as they are similar to previous changes (1)
- skills/install.sh
4c3160a to
a85b00d
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
skills/wren-enrich-context/SKILL.md (1)
91-93: ⚡ Quick winFix blockquote spacing to satisfy markdownlint (MD027).
Line 91–93 uses multiple spaces after
>, which triggers MD027. Use a single space after the blockquote marker.💡 Proposed fix
-> 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 +> 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🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@skills/wren-enrich-context/SKILL.md` around lines 91 - 93, The blockquote lines in SKILL.md (the three lines beginning with "> a) `$PWD`", "> b) `<path from ~/.wren/config.yml>`", and "> c) something else — paste the absolute path") use multiple spaces after the ">" which triggers MD027; update each blockquote to use a single space after ">" (e.g., change "> a) ..." to "> a) ...") so each quoted line follows Markdown blockquote spacing rules.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@skills/wren-enrich-context/SKILL.md`:
- Around line 91-93: The blockquote lines in SKILL.md (the three lines beginning
with "> a) `$PWD`", "> b) `<path from ~/.wren/config.yml>`", and "> c)
something else — paste the absolute path") use multiple spaces after the ">"
which triggers MD027; update each blockquote to use a single space after ">"
(e.g., change "> a) ..." to "> a) ...") so each quoted line follows Markdown
blockquote spacing rules.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 5386e839-0395-4620-afbd-f09777b0ecbd
📒 Files selected for processing (5)
skills/SKILLS.mdskills/index.jsonskills/install.shskills/versions.jsonskills/wren-enrich-context/SKILL.md
a85b00d to
f8613da
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@skills/wren-enrich-context/SKILL.md`:
- Around line 91-93: The blockquote in SKILL.md uses multiple spaces after '>'
which violates markdownlint MD027; update each quoted line (the lines starting
with "> a) `$PWD`...", "> b) `<path from ~/.wren/config.yml>`...", and ">
c) something else — paste the absolute path") to use a single space after '>'
(e.g., change "> " to "> ") so the blockquote spacing is normalized.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 71a47ffe-4ad9-4c72-9b55-bd9ec4db01b3
📒 Files selected for processing (7)
skills/SKILLS.mdskills/index.jsonskills/install.shskills/versions.jsonskills/wren-enrich-context/SKILL.mdskills/wren-usage/SKILL.mdskills/wren-usage/references/memory.md
✅ Files skipped from review due to trivial changes (4)
- skills/install.sh
- skills/versions.json
- skills/SKILLS.md
- skills/wren-usage/references/memory.md
🚧 Files skipped from review as they are similar to previous changes (1)
- skills/wren-usage/SKILL.md
f8613da to
33e2c99
Compare
…s context Adds a new skill that drives an agent through reading <project>/raw/ (PDFs, glossaries, handbooks, code, data dictionaries) and resolving gaps in the current MDL / instructions.md / queries.yml / memory pairs. The skill opens by asking the user to pick a mode for the session: - grill mode — one question at a time, agent drafts and the user accepts / edits / skips (mattpocock-style relentless interview). - auto-pilot mode — agent reads context and applies best inferences directly, escalates to grill only for (1) raw vs MDL conflicts and (2) high-blast-radius additions like new metrics, views, or relationships. The session ends with a confidence-tagged audit list and validation log for the user to review. Both modes share universal hard rules: only add (never modify existing), every MDL edit must pass `wren context validate` or be reverted, and the session is locked to one user-chosen project (no mid-session switch). Findings route to four sinks: MDL YAML, instructions.md, queries.yml, and (when wren-engine[memory] is installed) direct `wren memory store`. The skill is standalone — invoked by the user with /wren-enrich-context against a chosen project — and is registered in skills/SKILLS.md, skills/index.json, skills/versions.json, and the install.sh ALL_SKILLS list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… cube proposals Three capabilities the v1.0 skill was missing for full agent-side knowledge enrichment: - references/gap_catalog.md (10 categories): enum value semantics, units (USD vs cents, ms vs sec), NULL semantics, soft-delete / active filters, magic sentinels, business synonyms, time / TZ conventions, cross-system IDs, currency rules, canonical-table preferences. Each with triggers, default sink, and a prose-first `[tag]` write format that survives re-enrichment audits via grep. Lane 1 now sweeps the catalog mechanically; Lane 2 / 3 use it for routing. - Step 4.5 ground-truth probe (grill-mode default; auto-pilot opt-out): when a column is description-silent and low-cardinality, sample LIMIT 30 to discover enum / sentinel / time-grain values before drafting the `[tag]` line. Auto-pilot stays purely read-only. - references/cube_proposals.md: cube-first decision tree for any aggregation metric raw defines or Lane 3 infers (cube > view fallback > calculated column; old MDL `metrics:` deprecated, never proposed). Includes YAML template, snake_case naming policy with `_v2` collision fallback, duplication guard via `wren cube list` + `describe`, and dual validation (`wren context validate` + `wren cube query --cube X --sql-only`). Universal Rule 7(b) extended so new cubes always escalate to grill, matching cube's visibility in `wren cube list` as a public artifact. Frontmatter description in SKILL.md and index.json tightened with the new trigger phrases (enum / unit / NULL / magic / time / ARR / churn / DAU / "USD or cents") so users searching for those specifics hit the skill. Version stays at 1.0 since the skill is unreleased. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
068e92d to
f5e055d
Compare
The skill was live but docs still described it as "coming soon / in active development". Reference and guide pages now reflect reality: - reference/skills.md: add wren-enrich-context to the available-skills table, a full section (two modes, ten-category gap catalog, cube proposals, trigger phrases, reference files), and the skill-structure directory tree. - guides/refine.md: convert the "Coming soon" block into an available-now section, and point the day-to-day refinement loop at the skill for deeper backfills. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Two skill changes:
wren-usagev2.2 → v2.3 — makes the skill memory-aware (probesMEMORY_AVAILABLEonce per session, branches every workflow on it, gives a no-memory path viawren context show), explicit about CLI exploration (<command> --helpbefore guessing a flag), and fixes correctness bugs in the previous version — most notably that the stderr "store this query" hint prints even without memory installed (so the agent must ignore it, not retry). Also splits Workflow 4 re-index into its own code block and correctswren memory forget --idto require--forcefor non-interactive use.New
wren-enrich-contextskill (v1.0) — drives an agent through filling the business-context gap that DB schema cannot carry. The session opens by asking the user to pick one of two modes:<project>/raw/+ current context and applies best inferences directly. Escalates to grill only for raw-vs-MDL conflicts and high-blast-radius additions (new metrics / views / relationships). Ends with a confidence-tagged audit list and validation log for the user to review.Both modes share universal hard rules: only add (never modify existing), every MDL edit must pass
wren context validateor be reverted, and the session is locked to one user-chosen project. Findings route to four sinks: MDL YAML,instructions.md,queries.yml, and (when memory extra installed) directwren memory store.Both skills are registered in
skills/SKILLS.md,skills/index.json,skills/versions.json, andskills/install.sh. Nocore/code changes.Test plan
/wren-usagewithoutwren-engine[memory]installed — verify Preflight Step 3a detectsMEMORY_AVAILABLE = false, offers install once, and every workflow falls back towren context show/target/mdl.json./wren-usagewithwren-engine[memory]installed — verify fetch / recall / store flow still works; verify the agent does not echo the stderr store hint back as a tool call./wren-enrich-contextand pick grill mode in a project with araw/folder containing a markdown glossary — verify the agent asks which project first, locks the project, reads context, grills one gap at a time, runswren context validateafter every MDL edit (and reverts on failure), and produces a "please fix manually" list for conflicts./wren-enrich-contextand pick auto-pilot mode with the same setup — verify the agent auto-applies Lane 1 / clear Lane 2 / low-impact Lane 3 findings, but escalates to grill for Lane 2 conflicts and new-metric/view/relationship proposals; verify the Step 9 audit summary lists every inference with confidence tag + source./wren-enrich-contextwith noraw/folder — verify Preflight Step 3 creates it and prompts the user to drop files.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Chores