Skip to content

docs: LLM-friendly documentation - #375

Merged
ilyabo merged 23 commits into
mainfrom
cursor/llm-friendly-documentation-d7cb
Feb 24, 2026
Merged

ilyabo merged 23 commits into
mainfrom
cursor/llm-friendly-documentation-d7cb

Conversation

@ilyabo

@ilyabo ilyabo commented Feb 23, 2026 •

Copy link
Copy Markdown
Collaborator

Improve LLM-friendly guidance and refresh package READMEs to enhance discoverability and accuracy.

The goal is to make the documentation more accessible and useful for Large Language Models, increasing the likelihood of SQLRooms being suggested for data analytics applications, and ensuring package-level READMEs are up-to-date with current APIs and practical examples.


Open in Web Open in Cursor 

Summary by CodeRabbit

  • Documentation

    • Extensive README rewrites and expanded guides across many packages; clearer quickstarts, recipes, and updated llms.txt guidance with new template variables; removed the custom-slice guide and a commented sidebar example.
  • Chores

    • Docs build split into typedoc + site phases; preview workflow simplified.
  • Defaults

    • Example/default AI models and sample sessions updated to gpt-5.2.
  • Style

    • Minor UI component and formatting tweaks (Button usage and small layout refinements).

@cursor

cursor Bot commented Feb 23, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai

coderabbitai Bot commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Updates example AI model defaults to the GPT‑5 series, restructures the docs build pipeline, removes a legacy custom-slice doc, and performs large README rewrites across many packages to emphasize store-centric patterns and adjusted public API surfaces; also adds llmstxt plugin options and minor UI and gitignore tweaks.

Changes

Cohort / File(s) Summary
AI Model Version Updates
examples/ai-agent/src/agents/WeatherAgent.ts, examples/ai-agent/src/config.ts, examples/ai-core/src/config.ts, examples/ai-nextjs/config.ts, examples/ai-rag/src/config.ts, examples/ai/src/config.ts, examples/ai/src/example-sessions.json, examples/app-builder/src/config.ts, examples/canvas-sync/src/store.ts, examples/canvas/src/store.ts
Replaces GPT‑4.x/GPT‑4o variants with GPT‑5 series (gpt-5.2, gpt-5) as default models across examples and session presets.
Documentation Build & llmstxt Plugin
package.json, docs/.vitepress/config.ts
Introduces two‑phase docs build scripts (typedoc → vitepress), updates docs:build/preview semantics, and adds domain, ignoreFiles, customLLMsTxtTemplate, and customTemplateVariables options to the llms.txt plugin config; removes a commented sidebar example.
Main Documentation (llms)
docs/llms.md
Rewrites llms doc into a narrative guide with usage patterns, canonical package recipes, assistant prompts, and updated machine-readable /llms.txt and /llms-full.txt blocks.
Removed Legacy Doc
docs/custom-slice.md
Deletes legacy custom-slice documentation describing slice + panel packaging.
Core & Feature README Rewrites
packages/ai/README.md, packages/ai-core/README.md, packages/ai-config/README.md, packages/room-shell/README.md, packages/room-store/README.md, packages/cosmos/README.md, packages/canvas/README.md, packages/discuss/README.md, packages/layout/README.md, packages/duckdb/README.md, packages/kepler/README.md, packages/vega/README.md, packages/schema-tree/README.md, packages/sql-editor/README.md, packages/sql-editor-config/README.md, packages/kepler-config/README.md, packages/duckdb-config/README.md, packages/room-config/README.md, packages/motherduck/README.md, packages/recharts/README.md, packages/utils/README.md, packages/ai-settings/README.md, packages/ai-core/README.md
Extensive README rewrites to emphasize store‑centric patterns, expose new/clarified public exports and primitives (e.g., createRoomStore, slice factories, Chat/UI surfaces), provide quickstarts, Zod schema usage, and streamlined examples. Mostly documentation edits; some READMEs document newly exposed exports or adjusted signatures.
UI Component Minor Edits
packages/ui/src/components/dialog.tsx
Formatting and class‑ordering changes to dialog component markup; no behavioral changes.
Example MainView Store Access
examples/.../src/components/MainView.tsx (multiple examples)
Replaces useStoreWithAiSettings hook usage with direct useRoomStore selection for aiSettings.updateProvider in several example MainView components.
Button Component Replacements in Docs/Examples
packages/ai-rag/docs/EXAMPLE.md, packages/duckdb-core/README.md, packages/s3-browser/README.md, python/sqlrooms-rag/examples/SUMMARY.md
Replaces native <button> examples with Button from @sqlrooms/ui in multiple README/example code blocks.
Python gitignore
python/.gitignore
Adds output/ to ignore patterns.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • ilyabo

Poem

🐰 I hopped through docs and models tonight,
From four to five‑point‑two I took flight.
I rewrote READMEs, cleaned the shell,
Pruned a slice, tuned llms.txt as well.
A rabbit's nibble — tidy, light, and bright. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: LLM-friendly documentation' accurately summarizes the main objective of this PR, which is to improve documentation for Large Language Models.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/llm-friendly-documentation-d7cb

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ilyabo ilyabo changed the title LLM-friendly documentation docs: LLM-friendly documentation Feb 23, 2026
@ilyabo
ilyabo marked this pull request as ready for review February 23, 2026 12:16

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/duckdb/README.md (2)

278-308: ⚠️ Potential issue | 🟡 Minor

connector may be null/undefined at first render — null guard missing

state.db.connector accessed synchronously via useRoomStore can be uninitialised when the component first renders, making connector.loadFile(...) and connector.loadArrow(...) throw a TypeError in users' code copied from this example.

Additionally, the DataLoader section above uses the safer getConnector() async pattern while this section uses a direct, unguarded sync reference — the inconsistency is likely to confuse readers.

📝 Suggested fix
 function AdvancedDataLoader() {
-  const connector = useRoomStore((state) => state.db.connector);
+  const getConnector = useRoomStore((state) => state.db.getConnector);

   const handleFileUpload = async (file: File) => {
-    // Load file directly using the connector
-    await connector.loadFile(file, 'uploaded_data', {
+    const connector = await getConnector();
+    await connector.loadFile(file, 'uploaded_data', {
       method: 'auto',
       replace: true,
       temp: false,
     });
   };

-  const handleLoadArrowTable = async (arrowTable: arrow.Table) => {
-    // Load Arrow table directly
-    await connector.loadArrow(arrowTable, 'arrow_data');
+  const handleLoadArrowTable = async (arrowTable: arrow.Table) => {
+    const connector = await getConnector();
+    await connector.loadArrow(arrowTable, 'arrow_data');
   };

Based on learnings, direct connector access (state.db.connector) is not recommended in React contexts; prefer custom Zustand selectors like useDuckDb() or the getConnector() async accessor over raw store state access.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/duckdb/README.md` around lines 278 - 308, The example accesses
useRoomStore((state) => state.db.connector) synchronously which can be
null/undefined on first render; update the AdvancedDataLoader to guard against a
missing connector or, better, switch to the async accessor pattern used
elsewhere (getConnector) or the safer custom selector (useDuckDb). Specifically,
replace direct uses of connector.loadFile and connector.loadArrow with logic
that awaits getConnector() (or fetches via useDuckDb()) and only calls
loadFile/loadArrow when the returned connector is non-null, and ensure the file
input handler handles the async call and any errors.

206-222: ⚠️ Potential issue | 🟡 Minor

Incomplete snippet — createTableFromQuery, dropTable, and checkTableExists lack a source

The snippet calls three functions (createTableFromQuery, dropTable, checkTableExists) that are never imported or obtained from the store, leaving readers with no way to reproduce the example. These are accessed from the store in the DatabaseManager component above; the qualified-name example should either reuse that component's pattern or show a minimal store access setup.

📝 Suggested fix
 import {makeQualifiedTableName} from '@sqlrooms/duckdb';
+import {useRoomStore} from './store';

 // Support for database.schema.table naming
 const qualifiedTable = makeQualifiedTableName({
   database: 'mydb',
   schema: 'public',
   table: 'users',
 });

-// Use with table operations
-await createTableFromQuery(qualifiedTable, 'SELECT * FROM source_table');
-await dropTable(qualifiedTable);
-const tableExists = await checkTableExists(qualifiedTable);
+// Obtain methods from the store
+const {createTableFromQuery, dropTable, checkTableExists} =
+  useRoomStore.getState().db;
+
+await createTableFromQuery(qualifiedTable, 'SELECT * FROM source_table');
+await dropTable(qualifiedTable);
+const tableExists = await checkTableExists(qualifiedTable);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/duckdb/README.md` around lines 206 - 222, The example using
makeQualifiedTableName is incomplete because createTableFromQuery, dropTable,
and checkTableExists are not imported or obtained from the store; update the
snippet to show how to get these functions (e.g., from the same
store/DatabaseManager pattern used above) or add explicit imports/initialization
before calling them. Specifically, reference the makeQualifiedTableName usage
and show obtaining createTableFromQuery, dropTable, and checkTableExists from
the store (or demonstrate DatabaseManager instantiation/usage) so the example is
runnable and self-contained.
🧹 Nitpick comments (8)
packages/ai-core/README.md (1)

9-9: Consider clarifying why @sqlrooms/ui is a direct install requirement.

Neither code example imports from @sqlrooms/ui directly — Chat components come from @sqlrooms/ai-core. If it's a required peer dependency for the Chat UI to render correctly, a brief parenthetical note (e.g., # peer dep for Chat UI) would help readers understand why it's listed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ai-core/README.md` at line 9, Clarify why `@sqlrooms/ui` is listed in
the install command by adding a short parenthetical note after it explaining its
role (for example: "(peer dependency required for Chat UI rendering)"), and
mention that Chat components are exported from `@sqlrooms/ai-core` so readers know
they typically import from `@sqlrooms/ai-core` while `@sqlrooms/ui` must be
installed for styling/visual components to work; update the README line with
this concise explanation referencing the package names `@sqlrooms/ai-core` and
`@sqlrooms/ui`.
packages/kepler-config/README.md (1)

9-12: Add usage context for KeplerMapSchema export.

KeplerMapSchema is listed in Exports but has no accompanying example explaining when or how to use it. A brief note clarifying that it defines the schema for individual map objects within KeplerSliceConfig would improve discoverability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/kepler-config/README.md` around lines 9 - 12, Add a short usage note
under the Exports section explaining that KeplerMapSchema describes the schema
for individual map objects used inside KeplerSliceConfig and when to use it;
mention that KeplerSliceConfig is the container for multiple KeplerMapSchema
entries and that KeplerMapSchema should be used when constructing or validating
each map object (e.g., defining layers, datasource, and viewport) to improve
discoverability for users.
packages/recharts/README.md (1)

65-81: The second code block is missing the RevenueChart import, which could produce incomplete LLM-generated code.

RevenueChart is used on line 79 but not imported in this snippet. Since the README goal is LLM discoverability, each code block should be independently usable or include a clear import reference.

📝 Suggested fix
 import {useSql} from '@sqlrooms/duckdb';
+import {RevenueChart} from './RevenueChart'; // defined in the Basic usage example above
 
 function RevenueChartFromSql() {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/recharts/README.md` around lines 65 - 81, The snippet for
RevenueChartFromSql uses RevenueChart but doesn't import it; update the example
to include an explicit import for RevenueChart so the block is independently
usable—e.g., add an import line referencing RevenueChart (the component used by
RevenueChartFromSql) at the top of the snippet alongside the existing useSql
import so readers/LLMs can run or copy the example without missing symbols.
packages/layout-config/README.md (2)

44-53: Add an import comment noting the origin of createRoomShellSlice.

The snippet references createRoomShellSlice, DataPanel, and MainPanel without context. For a "Typical integration" example, at least a comment noting the source package prevents readers from searching unnecessarily.

📝 Proposed addition
+// createRoomShellSlice is from '@sqlrooms/room-shell'
+// DataPanel / MainPanel are your own React components
 createRoomShellSlice({
   layout: {
     config: twoPaneLayout,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/layout-config/README.md` around lines 44 - 53, Add a brief import
comment above the example indicating where createRoomShellSlice (and the example
components DataPanel and MainPanel) come from—e.g., note that
createRoomShellSlice is exported by the layout-config package (or the actual
module name) and that DataPanel/MainPanel are example components—so readers know
which package/module to import from when using the "Typical integration" snippet
referencing createRoomShellSlice, DataPanel, and MainPanel.

27-27: minimalLayout is declared but never used in the example.

The variable is assigned but plays no role in the rest of the snippet, making it dead code in the docs. Either use it (e.g., show it being passed to LayoutConfig.parse) or remove it along with the createDefaultMosaicLayout import.

📝 Option A — remove unused variable
-import {
-  LayoutConfig,
-  MAIN_VIEW,
-  MosaicLayoutConfig,
-  createDefaultMosaicLayout,
-} from '@sqlrooms/layout-config';
-
-const minimalLayout = createDefaultMosaicLayout();
+import {
+  LayoutConfig,
+  MAIN_VIEW,
+  MosaicLayoutConfig,
+} from '@sqlrooms/layout-config';
📝 Option B — demonstrate the minimal layout too
 const minimalLayout = createDefaultMosaicLayout();
+const validatedMinimal: LayoutConfig = LayoutConfig.parse(minimalLayout);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/layout-config/README.md` at line 27, The README shows minimalLayout
= createDefaultMosaicLayout() but never uses it; either remove the declaration
and the createDefaultMosaicLayout import, or demonstrate its use by passing
minimalLayout into LayoutConfig.parse (e.g., call
LayoutConfig.parse(minimalLayout) or include it in the example flow) so the
example is not dead code; update the example to reference the minimalLayout
variable and/or remove the unused import and variable accordingly.
packages/discuss/README.md (2)

40-47: Consider documenting the required room.initialize() call.

The README covers store creation but omits the mandatory room.initialize() invocation at component mount. Readers who follow only this README would skip slice lifecycle initialization.

A minimal addition to the store-setup section (or a separate "Initialization" snippet) would be:

import {useEffect} from 'react';
import {roomStore} from './store';

function App() {
  useEffect(() => {
    roomStore.getState().room.initialize();
  }, []);
  // ...
}

Based on learnings: always call room.initialize() during component mount to orchestrate automatic slice initialization with lifecycle hooks.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/discuss/README.md` around lines 40 - 47, Add documentation and an
example showing that room.initialize() must be called after creating the store
so slices run their lifecycle hooks; update the README around the store setup
where createRoomShellSlice and createDiscussSlice are shown to include a short
"Initialization" note and a minimal snippet that calls
roomStore.getState().room.initialize() on component mount (e.g., inside
useEffect) so readers know to invoke room.initialize() after store creation.

92-94: The second argument to addDiscussion is opaque without a comment.

'airport-LAX' is used as an anchor ID, which is the core linking mechanism described in the package intro, but it reads like an accidental leftover from a real demo. A brief inline comment (e.g. // anchor/data-point ID) or a more generic placeholder like 'data-point-id' would make the intent immediately clear to readers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/discuss/README.md` around lines 92 - 94, The literal string
'airport-LAX' passed as the second argument to addDiscussion is opaque; update
the example in the README where addDiscussion('Initial note', 'airport-LAX') is
used to make intent clear by either replacing 'airport-LAX' with a generic
placeholder like 'data-point-id' or adding an inline comment after the argument
(e.g., // anchor/data-point ID) so readers know this parameter is the
anchor/data-point ID used for linking; refer to the addDiscussion call site to
apply the change.
package.json (1)

34-36: LGTM — clean two-phase docs build.

The split lets each phase be run independently for faster iteration. One minor note: docs:build:typedoc invokes pnpm --filter "@sqlrooms/*" typedoc directly instead of turbo typedoc, which bypasses turborepo's dependency-graph ordering and remote cache. This is fine for a purely source-reading typedoc pass, but aligns less with how typedoc:watch is wired (turbo typedoc --concurrency=100). If any cross-package typedoc references are added later, the turbo-based invocation would be safer.

🔧 Optional: keep turbo for consistency with typedoc:watch
-    "docs:build:typedoc": "pnpm --filter \"@sqlrooms/*\" typedoc",
+    "docs:build:typedoc": "turbo typedoc --filter=\"@sqlrooms/*\"",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 34 - 36, The docs build currently runs typedoc
directly via the "docs:build:typedoc" npm script which bypasses Turborepo's
dependency graph and remote cache; update the "docs:build:typedoc" script to
invoke Turbo (e.g., use "turbo typedoc" — optionally with the same flag used by
watch like "--concurrency=100") so that "docs:build:typedoc" and the combined
"docs:build" benefit from Turborepo ordering and caching.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ai-core/README.md`:
- Line 9: The README's npm install snippet is missing the zod dependency
required by the import "z" used elsewhere; update the install command shown (the
line containing "npm install `@sqlrooms/ai-core` `@sqlrooms/room-store`
`@sqlrooms/ui`") to also include "zod" so consumers won't get a module-not-found
error when importing z from 'zod'.

In `@packages/ai/README.md`:
- Around line 126-136: The remote-endpoint example uses createAiSlice({...}) but
fails to invoke the returned slice factory with (set, get, store); update the
snippet so the result of createAiSlice (with tools, getInstructions,
chatEndPoint, chatHeaders) is called with (set, get, store) and its returned
state is spread where other examples do so — locate createAiSlice,
createDefaultAiTools, createDefaultAiInstructions, chatEndPoint and chatHeaders
in the snippet and replace the dangling factory reference with a proper
invocation: call the factory with (set, get, store) and spread its result into
the final state object.

In `@packages/canvas/README.md`:
- Around line 57-62: The README example still sets defaultModel to the retired
'gpt-4.1-mini'; update the example in the createCanvasSlice call to use a
currently supported model (e.g., 'gpt-5.2-mini' or your project's recommended
small model). Locate the createCanvasSlice({ ai: { getApiKey: ..., defaultModel:
... } })(set, get, store) snippet and replace the defaultModel value with the
chosen current model string, and optionally add a brief inline note indicating
it should match the project's configured recommended model.

In `@packages/cosmos/README.md`:
- Around line 34-36: Replace the deprecated dependency
`@cosmograph/cosmos`@2.0.0-beta.26 in the `@sqlrooms/cosmos` package.json with the
maintained package `@cosmos.gl/graph`, and update the README import line that
currently reads import {GraphConfigInterface} from '@cosmograph/cosmos' to
import {GraphConfigInterface} from '@cosmos.gl/graph'; ensure package.json lists
`@cosmos.gl/graph` as a regular dependency and the README example matches that new
package name.

In `@packages/discuss/README.md`:
- Around line 7-9: The README's install command omits the `@sqlrooms/utils`
package even though the example imports formatTimeRelative from `@sqlrooms/utils`;
update the npm install line to include `@sqlrooms/utils` so users won't get a
missing-module error, and ensure any example import of formatTimeRelative
matches the packages listed in the install snippet.

In `@packages/duckdb-config/README.md`:
- Line 1: The README is missing the top-level package name heading; add a H1
heading line "# `@sqlrooms/duckdb-config`" at the very top of
packages/duckdb-config/README.md so the file begins with the package name
(followed by the existing Status line), ensuring LLMs and registries can
identify the package; keep the rest of the content unchanged.

In `@packages/kepler/README.md`:
- Around line 53-77: MapPanel currently passes mapId (possibly undefined) to
KeplerMapContainer which expects a string; update MapPanel to guard render until
mapId is defined by checking mapId before returning the container (e.g., if
(!mapId) return null or a loading placeholder) so KeplerMapContainer always
receives a string, leaving the existing useEffect (which already guards on
mapId) unchanged; locate the check and return in the MapPanel function where
mapId is read from useRoomStore and adjust the render to only return
<KeplerMapContainer mapId={mapId} /> when mapId is a string.

In `@packages/recharts/README.md`:
- Line 51: The README's BarChart example omits the accessibilityLayer prop, so
update the example that renders <BarChart data={rows}> to include
accessibilityLayer (e.g., accessibilityLayer={true}) on the <BarChart> element
to enable keyboard and screen-reader support; change the example usage of
BarChart in the README (the <BarChart data={rows}> snippet) to include this prop
so generated code is accessible by default.
- Around line 42-44: The README example uses a fixed height class on
ChartContainer which prevents responsive behavior; update the ChartContainer
usage (look for the ChartContainer component and its className prop) to replace
the fixed "h-64" with a minimum-height utility like "min-h-[VALUE]" (e.g.,
min-h-[16rem] or another appropriate VALUE) while keeping "w-full" so the chart
is responsive in flexible layouts.

In `@packages/utils/README.md`:
- Around line 29-30: Update the examples for formatDate and formatDateTime to
show concrete output values instead of format descriptors: replace
formatDate(new Date()); // "YYYY-MM-DD" with a real example like formatDate(new
Date()); // "2026-02-23" and replace formatDateTime(new Date()); // "Wed
YYYY-MM-DD HH:MM AM/PM" with a real example like formatDateTime(new Date()); //
"Wed 2026-02-23 02:15 PM" (or another realistic date/time) so the README
demonstrates actual returned strings for the formatDate and formatDateTime
functions.

In `@packages/vega/README.md`:
- Around line 51-62: The compound component JSX is a bare expression and should
be wrapped in a functional component so it can be copied and used; create an
exported function (e.g., export function CompoundVegaChart() or similar) that
returns the <VegaLiteChart.Container ...>…</VegaLiteChart.Container> JSX, remove
the trailing semicolon after the closing tag, and ensure the example mentions
any necessary imports (e.g., VegaLiteChart) so readers can paste the snippet
directly into a file; reference the Container, Actions, Chart, SpecEditor and
SqlEditor symbols when locating the snippet to wrap.
- Around line 88-92: The README currently conflates createVegaChartTool
constructor options (e.g., editable, editorMode) with the runtime Zod schema
fields the LLM provides; update the documentation to separate those concerns:
keep the existing constructor/options heading for createVegaChartTool and its
args (editable, editorMode), and add a distinct “LLM invocation / Zod schema
fields” subsection that explicitly states sqlQuery, vegaLiteSpec, and reasoning
are fields supplied at runtime by the tool’s Zod schema (not parameters to pass
into createVegaChartTool), referencing createVegaChartTool, sqlQuery,
vegaLiteSpec, reasoning, and the Zod schema to make the distinction unambiguous.

---

Outside diff comments:
In `@packages/duckdb/README.md`:
- Around line 278-308: The example accesses useRoomStore((state) =>
state.db.connector) synchronously which can be null/undefined on first render;
update the AdvancedDataLoader to guard against a missing connector or, better,
switch to the async accessor pattern used elsewhere (getConnector) or the safer
custom selector (useDuckDb). Specifically, replace direct uses of
connector.loadFile and connector.loadArrow with logic that awaits getConnector()
(or fetches via useDuckDb()) and only calls loadFile/loadArrow when the returned
connector is non-null, and ensure the file input handler handles the async call
and any errors.
- Around line 206-222: The example using makeQualifiedTableName is incomplete
because createTableFromQuery, dropTable, and checkTableExists are not imported
or obtained from the store; update the snippet to show how to get these
functions (e.g., from the same store/DatabaseManager pattern used above) or add
explicit imports/initialization before calling them. Specifically, reference the
makeQualifiedTableName usage and show obtaining createTableFromQuery, dropTable,
and checkTableExists from the store (or demonstrate DatabaseManager
instantiation/usage) so the example is runnable and self-contained.

---

Nitpick comments:
In `@package.json`:
- Around line 34-36: The docs build currently runs typedoc directly via the
"docs:build:typedoc" npm script which bypasses Turborepo's dependency graph and
remote cache; update the "docs:build:typedoc" script to invoke Turbo (e.g., use
"turbo typedoc" — optionally with the same flag used by watch like
"--concurrency=100") so that "docs:build:typedoc" and the combined "docs:build"
benefit from Turborepo ordering and caching.

In `@packages/ai-core/README.md`:
- Line 9: Clarify why `@sqlrooms/ui` is listed in the install command by adding a
short parenthetical note after it explaining its role (for example: "(peer
dependency required for Chat UI rendering)"), and mention that Chat components
are exported from `@sqlrooms/ai-core` so readers know they typically import from
`@sqlrooms/ai-core` while `@sqlrooms/ui` must be installed for styling/visual
components to work; update the README line with this concise explanation
referencing the package names `@sqlrooms/ai-core` and `@sqlrooms/ui`.

In `@packages/discuss/README.md`:
- Around line 40-47: Add documentation and an example showing that
room.initialize() must be called after creating the store so slices run their
lifecycle hooks; update the README around the store setup where
createRoomShellSlice and createDiscussSlice are shown to include a short
"Initialization" note and a minimal snippet that calls
roomStore.getState().room.initialize() on component mount (e.g., inside
useEffect) so readers know to invoke room.initialize() after store creation.
- Around line 92-94: The literal string 'airport-LAX' passed as the second
argument to addDiscussion is opaque; update the example in the README where
addDiscussion('Initial note', 'airport-LAX') is used to make intent clear by
either replacing 'airport-LAX' with a generic placeholder like 'data-point-id'
or adding an inline comment after the argument (e.g., // anchor/data-point ID)
so readers know this parameter is the anchor/data-point ID used for linking;
refer to the addDiscussion call site to apply the change.

In `@packages/kepler-config/README.md`:
- Around line 9-12: Add a short usage note under the Exports section explaining
that KeplerMapSchema describes the schema for individual map objects used inside
KeplerSliceConfig and when to use it; mention that KeplerSliceConfig is the
container for multiple KeplerMapSchema entries and that KeplerMapSchema should
be used when constructing or validating each map object (e.g., defining layers,
datasource, and viewport) to improve discoverability for users.

In `@packages/layout-config/README.md`:
- Around line 44-53: Add a brief import comment above the example indicating
where createRoomShellSlice (and the example components DataPanel and MainPanel)
come from—e.g., note that createRoomShellSlice is exported by the layout-config
package (or the actual module name) and that DataPanel/MainPanel are example
components—so readers know which package/module to import from when using the
"Typical integration" snippet referencing createRoomShellSlice, DataPanel, and
MainPanel.
- Line 27: The README shows minimalLayout = createDefaultMosaicLayout() but
never uses it; either remove the declaration and the createDefaultMosaicLayout
import, or demonstrate its use by passing minimalLayout into LayoutConfig.parse
(e.g., call LayoutConfig.parse(minimalLayout) or include it in the example flow)
so the example is not dead code; update the example to reference the
minimalLayout variable and/or remove the unused import and variable accordingly.

In `@packages/recharts/README.md`:
- Around line 65-81: The snippet for RevenueChartFromSql uses RevenueChart but
doesn't import it; update the example to include an explicit import for
RevenueChart so the block is independently usable—e.g., add an import line
referencing RevenueChart (the component used by RevenueChartFromSql) at the top
of the snippet alongside the existing useSql import so readers/LLMs can run or
copy the example without missing symbols.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87a478e and 044b12a.

📒 Files selected for processing (40)
  • docs/.vitepress/config.ts
  • docs/custom-slice.md
  • docs/llms.md
  • examples/ai-agent/src/agents/WeatherAgent.ts
  • examples/ai-agent/src/config.ts
  • examples/ai-core/src/config.ts
  • examples/ai-nextjs/config.ts
  • examples/ai-rag/src/config.ts
  • examples/ai/src/config.ts
  • examples/ai/src/example-sessions.json
  • examples/app-builder/src/config.ts
  • examples/canvas-sync/src/store.ts
  • examples/canvas/src/store.ts
  • package.json
  • packages/ai-config/README.md
  • packages/ai-core/README.md
  • packages/ai-core/src/chatTransport.ts
  • packages/ai-settings/README.md
  • packages/ai/README.md
  • packages/canvas/README.md
  • packages/cosmos/README.md
  • packages/crdt/README.md
  • packages/discuss/README.md
  • packages/duckdb-config/README.md
  • packages/duckdb/README.md
  • packages/kepler-config/README.md
  • packages/kepler/README.md
  • packages/layout-config/README.md
  • packages/layout/README.md
  • packages/motherduck/README.md
  • packages/recharts/README.md
  • packages/room-config/README.md
  • packages/room-shell/README.md
  • packages/room-store/README.md
  • packages/schema-tree/README.md
  • packages/sql-editor-config/README.md
  • packages/sql-editor/README.md
  • packages/utils/README.md
  • packages/vega/README.md
  • python/.gitignore
💤 Files with no reviewable changes (2)
  • docs/custom-slice.md
  • packages/crdt/README.md

Comment thread packages/ai-core/README.md Outdated
Comment thread packages/ai/README.md Outdated
Comment thread packages/canvas/README.md
Comment thread packages/cosmos/README.md
Comment on lines +34 to +36
import {CosmosGraph, CosmosGraphControls, CosmosSimulationControls} from '@sqlrooms/cosmos';
import {GraphConfigInterface} from '@cosmograph/cosmos';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

find . -name package.json -path "*/cosmos/*" | head -20

Repository: sqlrooms/sqlrooms

Length of output: 122


🏁 Script executed:

cat ./packages/cosmos/package.json

Repository: sqlrooms/sqlrooms

Length of output: 946


🌐 Web query:

@cosmos.gl/graph @cosmograph/cosmos package migration rename

💡 Result:

@cosmograph/cosmos has been deprecated and moved to @cosmos.gl/graph. The npm deprecation notice for @cosmograph/cosmos explicitly says it was moved to @cosmos.gl/graph. [1]

Migration / rename

  1. Replace the dependency

    • Remove: @cosmograph/cosmos
    • Add: @cosmos.gl/graph [2]
  2. Update imports

    // before
    import { Graph } from '@cosmograph/cosmos'
    
    // after
    import { Graph } from '@cosmos.gl/graph'

    (The Graph entry point is shown in the @cosmos.gl/graph quick start.) [2]

  3. If you’re also upgrading across v2 changes
    @cosmos.gl/graph v2+ highlights API changes like using setPointPositions() / setLinks() instead of older data-setting patterns; their README points to a “Migration Guide” for details. [2]
    The project docs/wiki also distinguish latest (2.x) vs legacy (1.x) and include a migration guide section. [3]

Sources: npm package pages and project wiki. [1] [2] [3]


🏁 Script executed:

sed -n '1,50p' ./packages/cosmos/README.md

Repository: sqlrooms/sqlrooms

Length of output: 1293


Update @sqlrooms/cosmos to use the non-deprecated @cosmos.gl/graph package.

@cosmograph/cosmos has been deprecated and moved to @cosmos.gl/graph. The @sqlrooms/cosmos package.json currently lists @cosmograph/[email protected] as a regular dependency. This should be updated to @cosmos.gl/graph to use the maintained package going forward, and the README example should then import from @cosmos.gl/graph instead:

import {GraphConfigInterface} from '@cosmos.gl/graph';

The install command on line 6 is correct as-is; regular dependencies like @cosmograph/cosmos are automatically installed when users install @sqlrooms/cosmos.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cosmos/README.md` around lines 34 - 36, Replace the deprecated
dependency `@cosmograph/cosmos`@2.0.0-beta.26 in the `@sqlrooms/cosmos` package.json
with the maintained package `@cosmos.gl/graph`, and update the README import line
that currently reads import {GraphConfigInterface} from '@cosmograph/cosmos' to
import {GraphConfigInterface} from '@cosmos.gl/graph'; ensure package.json lists
`@cosmos.gl/graph` as a regular dependency and the README example matches that new
package name.

Comment thread packages/discuss/README.md
Comment thread packages/recharts/README.md
Comment thread packages/recharts/README.md Outdated
Comment thread packages/utils/README.md Outdated
Comment thread packages/vega/README.md Outdated
Comment thread packages/vega/README.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/duckdb/README.md (2)

394-397: ⚠️ Potential issue | 🟡 Minor

useRoomStore is used but never imported in this code block.

Every other useRoomStore example in the file begins with import {useRoomStore} from './store';. This block is the only one missing it.

🐛 Proposed fix
+import {useRoomStore} from './store';
+
 function AdvancedOperations() {
   const executeSql = useRoomStore((s) => s.db.executeSql);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/duckdb/README.md` around lines 394 - 397, The AdvancedOperations
example uses useRoomStore but doesn't import it; add the missing import for
useRoomStore (the same as other examples) at the top of the snippet so
AdvancedOperations can call useRoomStore to get executeSql, sqlSelectToJson and
checkTableExists; specifically, insert the import { useRoomStore } from
'./store'; line so the useRoomStore references in AdvancedOperations resolve.

278-280: ⚠️ Potential issue | 🟡 Minor

Floating promise — missing void unlike the AdvancedDataLoader example below.

handleLoadCSV is async; calling it without void drops the promise and is inconsistent with lines 324–326 which correctly write void handleFileUpload(...).

🐛 Proposed fix
-        if (e.target.files?.[0]) handleLoadCSV(e.target.files[0]);
+        if (e.target.files?.[0]) void handleLoadCSV(e.target.files[0]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/duckdb/README.md` around lines 278 - 280, The onChange handler is
calling the async function handleLoadCSV without awaiting or prefixing with
void, creating a floating promise; update the handler so the call is prefixed
with void (i.e., void handleLoadCSV(e.target.files[0])) to mirror the
AdvancedDataLoader pattern and intentionally ignore the returned promise,
keeping handleLoadCSV as the invoked async function and preserving the existing
null-check (e.target.files?.[0]).
♻️ Duplicate comments (6)
packages/kepler/README.md (1)

53-71: mapId guard is now in place — LGTM.

The if (!mapId) return null; check at line 68 ensures KeplerMapContainer always receives a string, resolving the previously flagged type mismatch.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/kepler/README.md` around lines 53 - 71, MapPanel previously risked
passing an undefined mapId into KeplerMapContainer; ensure the guard is present
by checking mapId before rendering (as in the current MapPanel implementation)
so KeplerMapContainer always receives a string; confirm the early return "if
(!mapId) return null;" remains in the MapPanel function and that dependencies
(mapId, isTableReady, addTableToMap) are used in the useEffect that calls
addTableToMap.
packages/vega/README.md (2)

92-105: ✅ Past issue resolved — constructor options and LLM schema fields are now clearly separated.

The "### LLM invocation / Zod schema fields" sub-heading at line 97 makes the distinction explicit. No further action needed here.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vega/README.md` around lines 92 - 105, The README correctly
separates constructor options for createVegaChartTool from the runtime
LLM-invoked Zod schema fields; no code changes are required—verify that the
createVegaChartTool documentation (editable, editorMode) remains distinct from
the LLM payload section (sqlQuery, vegaLiteSpec, reasoning) and keep the "LLM
invocation / Zod schema fields" heading intact to prevent future regressions.

51-66: ✅ Past issue resolved — compound component is now properly wrapped.

The previous bare JSX expression has been replaced with a valid exported function component CompoundVegaChart. The trailing semicolon is also gone. No further action needed here.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vega/README.md` around lines 51 - 66, The diff shows the JSX was
wrapped into a proper exported React function component CompoundVegaChart that
returns VegaLiteChart.Container with child components (VegaLiteChart.Actions,
VegaLiteChart.Chart, VegaLiteChart.SpecEditor, VegaLiteChart.SqlEditor); no
further code changes are required—keep the exported function CompoundVegaChart
as-is and ensure the referenced symbols (VegaLiteChart.Container, initialSpec,
and the onSpecChange/onSqlChange handlers) remain defined and imported elsewhere
in the module.
packages/ai-core/README.md (1)

9-9: zod install command is now correct.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ai-core/README.md` at line 9, The npm install line "npm install
`@sqlrooms/ai-core` `@sqlrooms/room-store` `@sqlrooms/ui` zod" in the README is
correct; do not change it—ensure the README.md maintains this exact install
command so that zod is included with `@sqlrooms/ai-core`, `@sqlrooms/room-store`,
and `@sqlrooms/ui`.
packages/cosmos/README.md (1)

1-104: LGTM — README is accurate and well-structured.

The @cosmos.gl/graph import (line 35) is consistent with the updated dependency. The Zustand selector pattern in lines 84–88 follows the recommended memoized per-field selector approach, and the store composition in lines 22–28 correctly uses the createRoomStore spread pattern. This addresses the prior review's concern about the deprecated package reference.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cosmos/README.md` around lines 1 - 104, The review comment is a
duplicate approval (contains both [approve_code_changes] and
[duplicate_comment]) and does not require code changes to
packages/cosmos/README.md; remove the duplicate/extra reviewer tag and keep a
single approval comment (or delete the duplicate comment) so the PR history is
clean, referencing the README (packages/cosmos/README.md) as the file approved.
packages/cosmos/package.json (1)

22-22: LGTM — correct migration away from the deprecated beta package.

@cosmograph/cosmos has been officially deprecated and moved to @cosmos.gl/graph, and the switch from the old beta pin (2.0.0-beta.26) to a stable release range (^2.6.4) is the right move. This resolves the concern raised in the prior review.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cosmos/package.json` at line 22, Replace the deprecated dependency
"@cosmograph/cosmos" with the new package "@cosmos.gl/graph" and ensure the
version is set to "^2.6.4" in package.json (the dependency entry for
"@cosmos.gl/graph"), then run your package manager (npm/yarn/pnpm) to update the
lockfile and node_modules so the lockfile reflects the new package and remove
any references to the old beta package from package.json and lockfiles.
🧹 Nitpick comments (3)
packages/vega/README.md (1)

1-1: Consider adding a top-level # heading.

The file opens with plain prose rather than a Markdown heading. Without a title heading, the file won't render a proper title on npm or GitHub, and LLM context windows that chunk by heading will miss a title anchor.

📝 Proposed fix
-Vega-Lite chart components and AI chart tool integration for SQLRooms.
+# `@sqlrooms/vega`
+
+Vega-Lite chart components and AI chart tool integration for SQLRooms.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vega/README.md` at line 1, The README lacks a top-level Markdown
heading; add a clear title line at the top (e.g., "# Vega" or "# Vega-Lite chart
components and AI chart tool integration for SQLRooms") so the README renders
with a proper title and can be used as a heading anchor for LLM chunking; update
the first line of packages/vega/README.md to be that single-line H1 heading and
keep the existing prose below it.
packages/ai-core/README.md (1)

24-28: Consider using import type for the type-only import BaseRoomStoreState.

BaseRoomStoreState is used only in a type position. Combining it with value imports without the type modifier can cause issues under isolatedModules / verbatimModuleSyntax when readers copy this snippet into a TypeScript project.

📝 Proposed fix
 import {
-  BaseRoomStoreState,
   createBaseRoomSlice,
   createRoomStore,
 } from '@sqlrooms/room-store';
+import type {BaseRoomStoreState} from '@sqlrooms/room-store';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ai-core/README.md` around lines 24 - 28, The import combines a
type-only symbol with value imports; change the import so BaseRoomStoreState is
imported using the type modifier (e.g., import type { BaseRoomStoreState } ... )
while leaving createBaseRoomSlice and createRoomStore as regular imports to
avoid isolatedModules/verbatimModuleSyntax issues and make clear that
BaseRoomStoreState is type-only.
packages/duckdb/README.md (1)

401-404: Double-await pattern needs a clarifying comment.

The inline comment says "await handle directly" but doesn't explain why executeSql returns a QueryHandle rather than the final result, making this pattern look like a mistake to a first-time reader. A brief note on the return type of executeSql (e.g., Promise<QueryHandle | undefined>) would remove the ambiguity.

📝 Suggested clarification
-    // Cached execution with deduplication
-    const query = await executeSql('SELECT * FROM users LIMIT 10');
-    if (query) {
-      const rows = await query; // await handle directly
-      console.log('Query result:', rows);
-    }
+    // executeSql returns Promise<QueryHandle | undefined>; undefined when already running.
+    const handle = await executeSql('SELECT * FROM users LIMIT 10');
+    if (handle) {
+      const rows = await handle; // QueryHandle is thenable – resolves to Arrow Table
+      console.log('Query result:', rows);
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/duckdb/README.md` around lines 401 - 404, The README example's
"await handle directly" comment is ambiguous; update the text around the example
to explicitly state that executeSql returns a Promise<QueryHandle | undefined>
and that QueryHandle itself resolves to the final rows (so you first await the
handle, then await the handle to get rows), and replace the inline comment on
the line with `const rows = await query;` with a short clarifying note like
"QueryHandle is a thenable that resolves to row results — first await executeSql
for the handle, then await the handle for rows." Reference executeSql and
QueryHandle in the explanation so readers understand the double-await pattern is
intentional.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ai/README.md`:
- Around line 100-118: The snippet incorrectly omits the object spread and uses
a semicolon terminator when integrating the AI slice: instead of discarding the
slice, spread the result of createAiSlice(...) into the enclosing tools object
and replace the terminating semicolon with a comma so the object literal remains
valid; specifically, update the place where createAiSlice({ tools: {
...createDefaultAiTools(store), echo: { ... }, }, getInstructions: ... })(set,
get, store) is used to apply "...createAiSlice(...)(set, get, store)" into the
tools object and ensure the trailing delimiter is a comma.

In `@packages/vega/README.md`:
- Line 95: Update the README's editorMode enum description to match the
TypeScript definition: replace the documented value 'vega' with 'spec' so the
list reads 'none' | 'sql' | 'spec' | 'both' to align with the type declared for
editorMode in packages/vega/src/editor/types.ts (the editorMode type).

---

Outside diff comments:
In `@packages/duckdb/README.md`:
- Around line 394-397: The AdvancedOperations example uses useRoomStore but
doesn't import it; add the missing import for useRoomStore (the same as other
examples) at the top of the snippet so AdvancedOperations can call useRoomStore
to get executeSql, sqlSelectToJson and checkTableExists; specifically, insert
the import { useRoomStore } from './store'; line so the useRoomStore references
in AdvancedOperations resolve.
- Around line 278-280: The onChange handler is calling the async function
handleLoadCSV without awaiting or prefixing with void, creating a floating
promise; update the handler so the call is prefixed with void (i.e., void
handleLoadCSV(e.target.files[0])) to mirror the AdvancedDataLoader pattern and
intentionally ignore the returned promise, keeping handleLoadCSV as the invoked
async function and preserving the existing null-check (e.target.files?.[0]).

---

Duplicate comments:
In `@packages/ai-core/README.md`:
- Line 9: The npm install line "npm install `@sqlrooms/ai-core`
`@sqlrooms/room-store` `@sqlrooms/ui` zod" in the README is correct; do not change
it—ensure the README.md maintains this exact install command so that zod is
included with `@sqlrooms/ai-core`, `@sqlrooms/room-store`, and `@sqlrooms/ui`.

In `@packages/cosmos/package.json`:
- Line 22: Replace the deprecated dependency "@cosmograph/cosmos" with the new
package "@cosmos.gl/graph" and ensure the version is set to "^2.6.4" in
package.json (the dependency entry for "@cosmos.gl/graph"), then run your
package manager (npm/yarn/pnpm) to update the lockfile and node_modules so the
lockfile reflects the new package and remove any references to the old beta
package from package.json and lockfiles.

In `@packages/cosmos/README.md`:
- Around line 1-104: The review comment is a duplicate approval (contains both
[approve_code_changes] and [duplicate_comment]) and does not require code
changes to packages/cosmos/README.md; remove the duplicate/extra reviewer tag
and keep a single approval comment (or delete the duplicate comment) so the PR
history is clean, referencing the README (packages/cosmos/README.md) as the file
approved.

In `@packages/kepler/README.md`:
- Around line 53-71: MapPanel previously risked passing an undefined mapId into
KeplerMapContainer; ensure the guard is present by checking mapId before
rendering (as in the current MapPanel implementation) so KeplerMapContainer
always receives a string; confirm the early return "if (!mapId) return null;"
remains in the MapPanel function and that dependencies (mapId, isTableReady,
addTableToMap) are used in the useEffect that calls addTableToMap.

In `@packages/vega/README.md`:
- Around line 92-105: The README correctly separates constructor options for
createVegaChartTool from the runtime LLM-invoked Zod schema fields; no code
changes are required—verify that the createVegaChartTool documentation
(editable, editorMode) remains distinct from the LLM payload section (sqlQuery,
vegaLiteSpec, reasoning) and keep the "LLM invocation / Zod schema fields"
heading intact to prevent future regressions.
- Around line 51-66: The diff shows the JSX was wrapped into a proper exported
React function component CompoundVegaChart that returns VegaLiteChart.Container
with child components (VegaLiteChart.Actions, VegaLiteChart.Chart,
VegaLiteChart.SpecEditor, VegaLiteChart.SqlEditor); no further code changes are
required—keep the exported function CompoundVegaChart as-is and ensure the
referenced symbols (VegaLiteChart.Container, initialSpec, and the
onSpecChange/onSqlChange handlers) remain defined and imported elsewhere in the
module.

---

Nitpick comments:
In `@packages/ai-core/README.md`:
- Around line 24-28: The import combines a type-only symbol with value imports;
change the import so BaseRoomStoreState is imported using the type modifier
(e.g., import type { BaseRoomStoreState } ... ) while leaving
createBaseRoomSlice and createRoomStore as regular imports to avoid
isolatedModules/verbatimModuleSyntax issues and make clear that
BaseRoomStoreState is type-only.

In `@packages/duckdb/README.md`:
- Around line 401-404: The README example's "await handle directly" comment is
ambiguous; update the text around the example to explicitly state that
executeSql returns a Promise<QueryHandle | undefined> and that QueryHandle
itself resolves to the final rows (so you first await the handle, then await the
handle to get rows), and replace the inline comment on the line with `const rows
= await query;` with a short clarifying note like "QueryHandle is a thenable
that resolves to row results — first await executeSql for the handle, then await
the handle for rows." Reference executeSql and QueryHandle in the explanation so
readers understand the double-await pattern is intentional.

In `@packages/vega/README.md`:
- Line 1: The README lacks a top-level Markdown heading; add a clear title line
at the top (e.g., "# Vega" or "# Vega-Lite chart components and AI chart tool
integration for SQLRooms") so the README renders with a proper title and can be
used as a heading anchor for LLM chunking; update the first line of
packages/vega/README.md to be that single-line H1 heading and keep the existing
prose below it.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 044b12a and 8937f7f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • package.json
  • packages/ai-core/README.md
  • packages/ai/README.md
  • packages/canvas/README.md
  • packages/cosmos/README.md
  • packages/cosmos/package.json
  • packages/cosmos/src/CosmosGraph.tsx
  • packages/cosmos/src/CosmosSlice.ts
  • packages/cosmos/src/CosmosSliceConfig.ts
  • packages/cosmos/src/hooks/useHoverState.ts
  • packages/discuss/README.md
  • packages/duckdb/README.md
  • packages/kepler-config/README.md
  • packages/kepler/README.md
  • packages/layout-config/README.md
  • packages/recharts/README.md
  • packages/utils/README.md
  • packages/vega/README.md
✅ Files skipped from review due to trivial changes (1)
  • packages/cosmos/src/CosmosSlice.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/layout-config/README.md
  • packages/utils/README.md
  • packages/canvas/README.md

Comment thread packages/ai/README.md
Comment on lines +100 to +118
createAiSlice({
tools: {
...createDefaultAiTools(store),
echo: {
name: 'echo',
description: 'Return user text back to the chat',
parameters: z.object({
text: z.string(),
}),
execute: async ({text}) => ({
llmResult: {
success: true,
details: `Echo: ${text}`,
},
}),
},
},
getInstructions: () => createDefaultAiInstructions(store),
})(set, get, store);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing ... spread operator and wrong terminator in the custom tools snippet.

The snippet calls createAiSlice({...})(set, get, store) without spreading the result into the enclosing object literal, which means all AI slice state is silently discarded. It also uses a semicolon instead of a comma, making it invalid inside the object passed to createRoomStore. Both the Quick Start (line 53) and the remote-endpoint snippet (line 127) correctly use ... and a trailing comma.

🐛 Proposed fix
-createAiSlice({
+...createAiSlice({
   tools: {
     ...createDefaultAiTools(store),
     echo: {
       name: 'echo',
       description: 'Return user text back to the chat',
       parameters: z.object({
         text: z.string(),
       }),
       execute: async ({text}) => ({
         llmResult: {
           success: true,
           details: `Echo: ${text}`,
         },
       }),
     },
   },
   getInstructions: () => createDefaultAiInstructions(store),
-})(set, get, store);
+})(set, get, store),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
createAiSlice({
tools: {
...createDefaultAiTools(store),
echo: {
name: 'echo',
description: 'Return user text back to the chat',
parameters: z.object({
text: z.string(),
}),
execute: async ({text}) => ({
llmResult: {
success: true,
details: `Echo: ${text}`,
},
}),
},
},
getInstructions: () => createDefaultAiInstructions(store),
})(set, get, store);
...createAiSlice({
tools: {
...createDefaultAiTools(store),
echo: {
name: 'echo',
description: 'Return user text back to the chat',
parameters: z.object({
text: z.string(),
}),
execute: async ({text}) => ({
llmResult: {
success: true,
details: `Echo: ${text}`,
},
}),
},
},
getInstructions: () => createDefaultAiInstructions(store),
})(set, get, store),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ai/README.md` around lines 100 - 118, The snippet incorrectly omits
the object spread and uses a semicolon terminator when integrating the AI slice:
instead of discarding the slice, spread the result of createAiSlice(...) into
the enclosing tools object and replace the terminating semicolon with a comma so
the object literal remains valid; specifically, update the place where
createAiSlice({ tools: { ...createDefaultAiTools(store), echo: { ... }, },
getInstructions: ... })(set, get, store) is used to apply
"...createAiSlice(...)(set, get, store)" into the tools object and ensure the
trailing delimiter is a comma.

Comment thread packages/vega/README.md
helps identify which product categories are driving the most revenue for your business.
```
- `editable`: whether users can edit SQL/spec in the chart UI
- `editorMode`: which editors to render (`'none' | 'sql' | 'vega' | 'both'`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

rg -n "editorMode" --type ts -C 3

Repository: sqlrooms/sqlrooms

Length of output: 5883


🏁 Script executed:

rg -n "type EditorMode|interface EditorMode" --type ts -A 5

Repository: sqlrooms/sqlrooms

Length of output: 454


Update README editorMode value from 'vega' to 'spec'

The README documents 'none' | 'sql' | 'vega' | 'both', but the actual TypeScript type definition in packages/vega/src/editor/types.ts is 'spec' | 'sql' | 'both' | 'none'. Change 'vega' to 'spec' to match the implementation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vega/README.md` at line 95, Update the README's editorMode enum
description to match the TypeScript definition: replace the documented value
'vega' with 'spec' so the list reads 'none' | 'sql' | 'spec' | 'both' to align
with the type declared for editorMode in packages/vega/src/editor/types.ts (the
editorMode type).

@cursor
cursor Bot force-pushed the cursor/llm-friendly-documentation-d7cb branch from 085bb8b to 8937f7f Compare February 23, 2026 13:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
packages/ai/README.md (1)

98-117: ⚠️ Potential issue | 🟡 Minor

Fix the custom tools snippet to spread the slice result (and keep the object literal valid).
If this snippet is meant to sit inside the createRoomStore state object, it needs ... and a trailing comma like the other examples; otherwise it reads as a dangling factory call.

📝 Proposed doc fix
-// inside createRoomStore(...):
-createAiSlice({
+// inside createRoomStore(...):
+...createAiSlice({
   tools: {
     ...createDefaultAiTools(store),
     echo: {
       name: 'echo',
       description: 'Return user text back to the chat',
       parameters: z.object({
         text: z.string(),
       }),
       execute: async ({text}) => ({
         llmResult: {
           success: true,
           details: `Echo: ${text}`,
         },
       }),
     },
   },
   getInstructions: () => createDefaultAiInstructions(store),
-})(set, get, store);
+})(set, get, store),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ai/README.md` around lines 98 - 117, The snippet currently calls
createAiSlice(...) as a dangling factory instead of merging its returned slice
into the room store; update the createRoomStore state to spread the slice result
into the object (use ...createAiSlice({...})(set, get, store)) and include a
trailing comma like other examples so the object literal remains valid; locate
the createAiSlice call that builds tools (including createDefaultAiTools and the
echo tool) and replace the standalone call with the spread expression and
trailing comma.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/ai/README.md`:
- Around line 98-117: The snippet currently calls createAiSlice(...) as a
dangling factory instead of merging its returned slice into the room store;
update the createRoomStore state to spread the slice result into the object (use
...createAiSlice({...})(set, get, store)) and include a trailing comma like
other examples so the object literal remains valid; locate the createAiSlice
call that builds tools (including createDefaultAiTools and the echo tool) and
replace the standalone call with the spread expression and trailing comma.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6fcb7eb and 480e154.

📒 Files selected for processing (6)
  • examples/ai-agent/src/components/MainView.tsx
  • examples/ai-core/src/components/MainView.tsx
  • examples/ai-rag/src/components/MainView.tsx
  • examples/ai/src/components/MainView.tsx
  • packages/ai-settings/README.md
  • packages/ai/README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (3)
packages/discuss/README.md (1)

7-9: @sqlrooms/utils inclusion — previous issue resolved.

The install command now includes @sqlrooms/utils.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/discuss/README.md` around lines 7 - 9, The README install command
should include `@sqlrooms/utils` as shown; verify the npm install line in the
README (the code block with the install command) contains "@sqlrooms/utils"
alongside "@sqlrooms/discuss", "@sqlrooms/room-shell" and "@sqlrooms/ui", and
remove any duplicated review-note text so the README only contains the single
corrected install command line.
packages/cosmos/README.md (2)

34-35: @cosmograph/cosmos → @cosmos.gl/graph migration is already applied.

The past review comment flagging the deprecated @cosmograph/cosmos import has been resolved — line 35 now correctly imports from @cosmos.gl/graph.

Verify that GraphConfigInterface is still the correct export name and that the config properties used (simulationGravity, simulationRepulsion, simulationLinkSpring, simulationLinkDistance) are present on that type, and that all three components imported on line 34 (CosmosGraph, CosmosGraphControls, CosmosSimulationControls) are actually exported from @sqlrooms/cosmos.

#!/bin/bash
# Verify exported symbols from `@sqlrooms/cosmos` package
echo "=== `@sqlrooms/cosmos` exports ==="
fd "index" packages/cosmos/src --type f | head -10 | xargs cat 2>/dev/null

echo "=== CosmosGraph, CosmosGraphControls, CosmosSimulationControls presence ==="
rg -n "CosmosGraphControls|CosmosSimulationControls|CosmosGraph" packages/cosmos/src/ --type ts --type tsx -l 2>/dev/null || rg -n "CosmosGraphControls|CosmosSimulationControls|CosmosGraph" packages/cosmos/src/

echo "=== GraphConfigInterface in `@cosmos.gl/graph` or `@cosmograph/cosmos` ==="
rg -n "GraphConfigInterface" packages/cosmos/src/ -A2 -B2
GraphConfigInterface `@cosmos.gl/graph` exported type properties simulationGravity simulationRepulsion simulationLinkSpring simulationLinkDistance
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cosmos/README.md` around lines 34 - 35, Ensure the migration is
correct by confirming the type and exports: verify that GraphConfigInterface
(and its properties simulationGravity, simulationRepulsion,
simulationLinkSpring, simulationLinkDistance) is actually exported from
`@cosmos.gl/graph` and update the import if the exported name differs; also
confirm that CosmosGraph, CosmosGraphControls, and CosmosSimulationControls are
exported from `@sqlrooms/cosmos` and, if any are missing or renamed, update the
imports or re-export them from the package so the module names CosmosGraph,
CosmosGraphControls, CosmosSimulationControls resolve correctly where used.

34-35: @cosmograph/cosmos → @cosmos.gl/graph migration already applied.

The prior review concern about the deprecated @cosmograph/cosmos import has been addressed. simulationGravity, simulationRepulsion, simulationLinkSpring, and simulationLinkDistance are all valid properties on GraphConfigInterface, and @cosmograph/cosmos has been moved to @cosmos.gl/graph — the import on line 35 now correctly reflects this.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cosmos/README.md` around lines 34 - 35, The README still imports
CosmosGraph, CosmosGraphControls, and CosmosSimulationControls from
'@sqlrooms/cosmos' while the migration moved exports to '@cosmos.gl/graph';
update the import so all Cosmos-related symbols (CosmosGraph,
CosmosGraphControls, CosmosSimulationControls) are imported from
'@cosmos.gl/graph' (or remove the '@sqlrooms/cosmos' import and consolidate to
the single '@cosmos.gl/graph' import) so the README reflects the completed
migration.
🧹 Nitpick comments (1)
packages/room-store/README.md (1)

22-60: Consider using type-only import for BaseRoomStoreState in the doc example.
While this won't error in the repo's current TS config, using type BaseRoomStoreState follows best practices and matches the pattern used for StateCreator in the same import statement.

🔧 Suggested doc tweak
 import {
-  BaseRoomStoreState,
+  type BaseRoomStoreState,
   createBaseRoomSlice,
   createRoomStore,
   createSlice,
   type StateCreator,
 } from '@sqlrooms/room-store';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/room-store/README.md` around lines 22 - 60, Update the import to use
a type-only import for BaseRoomStoreState: change the import that brings in
BaseRoomStoreState to use the TypeScript `type` modifier (matching how
`StateCreator` is imported) so it becomes a type-only import; adjust the `import
{ BaseRoomStoreState, ... } from '@sqlrooms/room-store'` line to import
`BaseRoomStoreState` as a type to keep consistency and follow best practices
with the `createRoomStore`/`createBaseRoomSlice` example.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/duckdb-core/README.md`:
- Around line 150-151: The DatabaseManager example's import only includes Button
but the example calls useRoomStore in multiple places; update the import
statement to also import useRoomStore (e.g., add useRoomStore to the named
imports alongside Button) so the DatabaseManager example compiles and matches
the duckdb README; ensure both example blocks (the one around lines 153–161 and
the similar block at 188–191) import useRoomStore as well.

In `@packages/layout/README.md`:
- Around line 61-72: The example panel definitions under panels (entries named
data and main) are missing the required icon property; update the example so
each panel object includes an icon field alongside title, component and
placement (e.g., add an appropriate icon identifier for the data panel and main
panel), ensuring the DataPanel and MainPanel entries show the four required
properties: title, icon, component, and placement.

In `@packages/room-shell/README.md`:
- Around line 82-90: The Quick Start App example omits the required
room.initialize() call; update the App component example so that when mounting
it calls roomStore.room.initialize() (or room.initialize() on the store's room
instance) — e.g., invoke room.initialize() inside a mount effect in the App that
uses the provided roomStore, ensuring initialization runs and lifecycle hooks
for slices execute while keeping the existing RoomShell usage (RoomShell,
RoomShell.Sidebar, RoomShell.LayoutComposer, RoomShell.LoadingProgress).

In `@packages/sql-editor/README.md`:
- Around line 82-88: The example is ambiguous about why both createQueryTab and
parseAndRunQuery are called with the same SQL; update the README example to
either add a short inline comment clarifying their roles (createQueryTab
initializes a persistent UI tab with the given SQL, parseAndRunQuery executes
the provided SQL and stores results for the currently selected tab) or split
into two examples showing (A) creating a tab with createQueryTab('...') and (B)
executing a query with parseAndRunQuery('...'), and mention that
parseAndRunQuery runs the string passed (not necessarily the tab content) so
callers should keep them in sync when intended.

---

Duplicate comments:
In `@packages/cosmos/README.md`:
- Around line 34-35: Ensure the migration is correct by confirming the type and
exports: verify that GraphConfigInterface (and its properties simulationGravity,
simulationRepulsion, simulationLinkSpring, simulationLinkDistance) is actually
exported from `@cosmos.gl/graph` and update the import if the exported name
differs; also confirm that CosmosGraph, CosmosGraphControls, and
CosmosSimulationControls are exported from `@sqlrooms/cosmos` and, if any are
missing or renamed, update the imports or re-export them from the package so the
module names CosmosGraph, CosmosGraphControls, CosmosSimulationControls resolve
correctly where used.
- Around line 34-35: The README still imports CosmosGraph, CosmosGraphControls,
and CosmosSimulationControls from '@sqlrooms/cosmos' while the migration moved
exports to '@cosmos.gl/graph'; update the import so all Cosmos-related symbols
(CosmosGraph, CosmosGraphControls, CosmosSimulationControls) are imported from
'@cosmos.gl/graph' (or remove the '@sqlrooms/cosmos' import and consolidate to
the single '@cosmos.gl/graph' import) so the README reflects the completed
migration.

In `@packages/discuss/README.md`:
- Around line 7-9: The README install command should include `@sqlrooms/utils` as
shown; verify the npm install line in the README (the code block with the
install command) contains "@sqlrooms/utils" alongside "@sqlrooms/discuss",
"@sqlrooms/room-shell" and "@sqlrooms/ui", and remove any duplicated review-note
text so the README only contains the single corrected install command line.

---

Nitpick comments:
In `@packages/room-store/README.md`:
- Around line 22-60: Update the import to use a type-only import for
BaseRoomStoreState: change the import that brings in BaseRoomStoreState to use
the TypeScript `type` modifier (matching how `StateCreator` is imported) so it
becomes a type-only import; adjust the `import { BaseRoomStoreState, ... } from
'@sqlrooms/room-store'` line to import `BaseRoomStoreState` as a type to keep
consistency and follow best practices with the
`createRoomStore`/`createBaseRoomSlice` example.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 480e154 and df2436a.

📒 Files selected for processing (13)
  • packages/ai-rag/docs/EXAMPLE.md
  • packages/ai-settings/README.md
  • packages/canvas/README.md
  • packages/cosmos/README.md
  • packages/discuss/README.md
  • packages/duckdb-core/README.md
  • packages/duckdb/README.md
  • packages/layout/README.md
  • packages/room-shell/README.md
  • packages/room-store/README.md
  • packages/s3-browser/README.md
  • packages/sql-editor/README.md
  • python/sqlrooms-rag/examples/SUMMARY.md
✅ Files skipped from review due to trivial changes (2)
  • packages/ai-settings/README.md
  • packages/canvas/README.md

Comment on lines +150 to +151
import {Button} from '@sqlrooms/ui';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

useRoomStore is missing from the import statement in the DatabaseManager example.

The code block uses useRoomStore across five call-sites (lines 153–161) but only Button is imported. The companion packages/duckdb/README.md already adds import {useRoomStore} from './store'; alongside Button in the equivalent block — duckdb-core/README.md should match.

📝 Proposed fix
+import {useRoomStore} from './store';
 import {Button} from '@sqlrooms/ui';

Also applies to: 188-191

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/duckdb-core/README.md` around lines 150 - 151, The DatabaseManager
example's import only includes Button but the example calls useRoomStore in
multiple places; update the import statement to also import useRoomStore (e.g.,
add useRoomStore to the named imports alongside Button) so the DatabaseManager
example compiles and matches the duckdb README; ensure both example blocks (the
one around lines 153–161 and the similar block at 188–191) import useRoomStore
as well.

Comment thread packages/layout/README.md
Comment on lines +61 to +72
panels: {
data: {
title: 'Data',
component: DataPanel,
placement: 'sidebar',
},
main: {
title: 'Main',
component: MainPanel,
placement: 'main',
},
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Panel definitions are missing the required icon property.

Per the project conventions, panel definitions require four properties: title, icon, component, and placement. Both data and main panel definitions in the example omit icon, which could mislead users into creating panels without it.

📝 Proposed fix
      panels: {
        data: {
          title: 'Data',
+         icon: SomeDataIcon,
          component: DataPanel,
          placement: 'sidebar',
        },
        main: {
          title: 'Main',
+         icon: SomeMainIcon,
          component: MainPanel,
          placement: 'main',
        },
      },

Based on learnings: "Structure panel definitions with required properties: title, icon, component, and placement."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/layout/README.md` around lines 61 - 72, The example panel
definitions under panels (entries named data and main) are missing the required
icon property; update the example so each panel object includes an icon field
alongside title, component and placement (e.g., add an appropriate icon
identifier for the data panel and main panel), ensuring the DataPanel and
MainPanel entries show the four required properties: title, icon, component, and
placement.

Comment on lines +82 to 90
export function App() {
return (
<div>
<h2>My Items ({myFeatureData.length})</h2>
<button onClick={() => addItem({id: Date.now(), name: 'New Item'})}>
Add Item
</button>
{/* Render items */}
</div>
<RoomShell roomStore={roomStore} className="h-screen">
<RoomShell.Sidebar />
<RoomShell.LayoutComposer />
<RoomShell.LoadingProgress />
</RoomShell>
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing room.initialize() call in the Quick Start App example

Per codebase conventions, room.initialize() must be called during component mount to orchestrate automatic slice initialization. Omitting it from the Quick Start will leave developers with a store that never runs its lifecycle hooks.

📝 Suggested addition to the App example
+import {useEffect} from 'react';

 export function App() {
+  useEffect(() => {
+    void roomStore.getState().room.initialize();
+  }, []);
+
   return (
     <RoomShell roomStore={roomStore} className="h-screen">
       <RoomShell.Sidebar />
       <RoomShell.LayoutComposer />
       <RoomShell.LoadingProgress />
     </RoomShell>
   );
 }

Based on learnings, always call room.initialize() during component mount to orchestrate automatic slice initialization with lifecycle hooks.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function App() {
return (
<div>
<h2>My Items ({myFeatureData.length})</h2>
<button onClick={() => addItem({id: Date.now(), name: 'New Item'})}>
Add Item
</button>
{/* Render items */}
</div>
<RoomShell roomStore={roomStore} className="h-screen">
<RoomShell.Sidebar />
<RoomShell.LayoutComposer />
<RoomShell.LoadingProgress />
</RoomShell>
);
}
import {useEffect} from 'react';
export function App() {
useEffect(() => {
void roomStore.getState().room.initialize();
}, []);
return (
<RoomShell roomStore={roomStore} className="h-screen">
<RoomShell.Sidebar />
<RoomShell.LayoutComposer />
<RoomShell.LoadingProgress />
</RoomShell>
);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/room-shell/README.md` around lines 82 - 90, The Quick Start App
example omits the required room.initialize() call; update the App component
example so that when mounting it calls roomStore.room.initialize() (or
room.initialize() on the store's room instance) — e.g., invoke room.initialize()
inside a mount effect in the App that uses the provided roomStore, ensuring
initialization runs and lifecycle hooks for slices execute while keeping the
existing RoomShell usage (RoomShell, RoomShell.Sidebar,
RoomShell.LayoutComposer, RoomShell.LoadingProgress).

Comment on lines +82 to 88
const parseAndRunQuery = useRoomStore((state) => state.sqlEditor.parseAndRunQuery);
const createQueryTab = useRoomStore((state) => state.sqlEditor.createQueryTab);

// Use actions
const handleExecute = () => {
runQuery('SELECT * FROM users LIMIT 10');
runQuery('SELECT * FROM users LIMIT 10');
const run = async () => {
createQueryTab('SELECT COUNT(*) AS total FROM earthquakes');
await parseAndRunQuery('SELECT COUNT(*) AS total FROM earthquakes');
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's find the store implementation for SqlEditorSliceState
fd -t ts -t tsx "store" packages/sql-editor/src/ | head -20

Repository: sqlrooms/sqlrooms

Length of output: 230


🏁 Script executed:

#!/bin/bash
# Search for parseAndRunQuery and createQueryTab definitions
rg -n "parseAndRunQuery|createQueryTab" packages/sql-editor/src/ -A 3 -B 1

Repository: sqlrooms/sqlrooms

Length of output: 3778


🏁 Script executed:

#!/bin/bash
# Look for the SqlEditorSliceState or similar store definition
fd -t ts "slice\|store" packages/sql-editor/src/ --exec head -5 {}

Repository: sqlrooms/sqlrooms

Length of output: 230


🏁 Script executed:

#!/bin/bash
# Read the parseAndRunQuery implementation to understand how it uses the query parameter
sed -n '422,460p' packages/sql-editor/src/SqlEditorSlice.tsx

Repository: sqlrooms/sqlrooms

Length of output: 1470


🏁 Script executed:

#!/bin/bash
# Also read the full createQueryTab implementation
sed -n '209,240p' packages/sql-editor/src/SqlEditorSlice.tsx

Repository: sqlrooms/sqlrooms

Length of output: 1103


Clarify the intent and relationship between createQueryTab and parseAndRunQuery.

The example calls both createQueryTab(sql) and parseAndRunQuery(sql) with identical SQL. While both calls are needed together, their purpose and interaction is unclear from the snippet:

  • createQueryTab creates a persistent tab in the UI with the initial query content
  • parseAndRunQuery executes the passed query parameter and stores results for the currently selected tab

Since parseAndRunQuery executes the query it receives (not the tab's stored query), passing identical strings is correct but fragile—if they diverged, the tab would show different SQL than what was executed.

Add a brief explanatory comment in the example to clarify that createQueryTab initializes the tab and parseAndRunQuery executes the query, or restructure into separate examples for clarity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/sql-editor/README.md` around lines 82 - 88, The example is ambiguous
about why both createQueryTab and parseAndRunQuery are called with the same SQL;
update the README example to either add a short inline comment clarifying their
roles (createQueryTab initializes a persistent UI tab with the given SQL,
parseAndRunQuery executes the provided SQL and stores results for the currently
selected tab) or split into two examples showing (A) creating a tab with
createQueryTab('...') and (B) executing a query with parseAndRunQuery('...'),
and mention that parseAndRunQuery runs the string passed (not necessarily the
tab content) so callers should keep them in sync when intended.

Signed-off-by: Ilya Boyandin <[email protected]>
Signed-off-by: Ilya Boyandin <[email protected]>
@ilyabo
ilyabo merged commit 0ebbb4e into main Feb 24, 2026
5 checks passed
@ilyabo
ilyabo deleted the cursor/llm-friendly-documentation-d7cb branch February 24, 2026 09:24
cursor Bot pushed a commit that referenced this pull request Feb 24, 2026
Signed-off-by: Ilya Boyandin <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants