Skip to content

feat: TanStack Start cursorrules#250

Open
usm4nhafeez wants to merge 1 commit intoPatrickJS:mainfrom
usm4nhafeez:add/tanstack-start-cursorrules
Open

feat: TanStack Start cursorrules#250
usm4nhafeez wants to merge 1 commit intoPatrickJS:mainfrom
usm4nhafeez:add/tanstack-start-cursorrules

Conversation

@usm4nhafeez
Copy link
Copy Markdown

@usm4nhafeez usm4nhafeez commented Apr 13, 2026

Adds TanStack Start rules - a new full-stack React framework (Router + Vinxi/Nitro) not yet in the repo. Covers server functions, API routes, SSR, streaming, and deployment targets.

Summary by CodeRabbit

Documentation

  • Added comprehensive TanStack Start development guidelines including server function patterns with validation, API route configuration, streaming and deferred data patterns, SSR setup, authentication handling, TanStack Query integration, and multi-platform deployment support (Vercel, Netlify, Cloudflare, Bun, Node).

Copilot AI review requested due to automatic review settings April 13, 2026 08:16
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

Introduces comprehensive documentation and rules for TanStack Start development, including a new cursor rules set, markdown documentation files, and an updated README index entry. The addition covers full-stack React patterns, server functions, routing, streaming, and multi-platform deployment guidance.

Changes

Cohort / File(s) Summary
Documentation Index Update
README.md
Added new entry for TanStack Start rules linking to the cursor rules file.
TanStack Start Rules & Documentation
rules/tanstack-start-cursorrules-prompt-file/.cursorrules, rules/tanstack-start-cursorrules-prompt-file/README.md, rules/tanstack-start-cursorrules-prompt-file/tanstack-start.mdc
Comprehensive cursor rules and documentation covering TanStack Start configuration, server functions with validation, routing patterns, API routes, streaming with defer() and Suspense, authentication, environment variables, TanStack Query integration, and multi-platform deployment presets.
Alternative Rules Documentation
rules-new/tanstack-start.mdc
Markdown documentation file describing TanStack Start conventions and implementation patterns.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • PatrickJS

Poem

🐰 A fluffy guide hops into view,
TanStack Start, both old and new,
Server functions, routes so fine,
Streaming data down the line,
Full-stack wisdom, documented with care!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: TanStack Start cursorrules' directly describes the main change: adding a new set of cursor rules for TanStack Start, a full-stack React framework.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
rules-new/tanstack-start.mdc (1)

1-124: Consider consolidating duplicate TanStack Start .mdc docs.

This file duplicates the rule content already added under rules/tanstack-start-cursorrules-prompt-file/tanstack-start.mdc. Keeping both will likely drift over time; prefer one canonical file and reference it.

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

In `@rules-new/tanstack-start.mdc` around lines 1 - 124, The PR adds a duplicate
TanStack Start rules doc: rules-new/tanstack-start.mdc duplicates the canonical
rules/tanstack-start-cursorrules-prompt-file/tanstack-start.mdc; remove the
duplicate file (rules-new/tanstack-start.mdc) and keep the single source of
truth (rules/tanstack-start-cursorrules-prompt-file/tanstack-start.mdc), or
alternatively move any unique edits into the canonical file and delete the
duplicate, then update any tooling or references that pointed to
rules-new/tanstack-start.mdc to use the canonical filename so only one doc
remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@rules/tanstack-start-cursorrules-prompt-file/.cursorrules`:
- Around line 68-73: The client RootComponent currently checks
process.env.NODE_ENV to conditionally render TanStackRouterDevtools and
ReactQueryDevtools which contradicts the guideline to never access process.env
in client components; replace that check by using the Vite/TanStack-safe flag
import.meta.env.DEV in the RootComponent (the conditional around
TanStackRouterDevtools and ReactQueryDevtools) so dev-only rendering uses
import.meta.env.DEV instead of process.env.NODE_ENV.

---

Nitpick comments:
In `@rules-new/tanstack-start.mdc`:
- Around line 1-124: The PR adds a duplicate TanStack Start rules doc:
rules-new/tanstack-start.mdc duplicates the canonical
rules/tanstack-start-cursorrules-prompt-file/tanstack-start.mdc; remove the
duplicate file (rules-new/tanstack-start.mdc) and keep the single source of
truth (rules/tanstack-start-cursorrules-prompt-file/tanstack-start.mdc), or
alternatively move any unique edits into the canonical file and delete the
duplicate, then update any tooling or references that pointed to
rules-new/tanstack-start.mdc to use the canonical filename so only one doc
remains.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 276b3c7b-07b9-4c39-9897-3be9819ac2be

📥 Commits

Reviewing files that changed from the base of the PR and between fc2ce04 and e39853b.

📒 Files selected for processing (5)
  • README.md
  • rules-new/tanstack-start.mdc
  • rules/tanstack-start-cursorrules-prompt-file/.cursorrules
  • rules/tanstack-start-cursorrules-prompt-file/README.md
  • rules/tanstack-start-cursorrules-prompt-file/tanstack-start.mdc

Comment on lines +68 to +73
{process.env.NODE_ENV === 'development' && (
<>
<TanStackRouterDevtools />
<ReactQueryDevtools />
</>
)}
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

🌐 Web query:

In TanStack Start (Vite-based), what is the recommended way to gate dev-only UI inside route components: process.env.NODE_ENVorimport.meta.env.DEV?

💡 Result:

In TanStack Start (Vite-based), the recommended way to gate dev-only UI inside route components is import.meta.env.DEV.

Citations:


🏁 Script executed:

# First, find the .cursorrules file
find . -name ".cursorrules" -type f

Repository: PatrickJS/awesome-cursorrules

Length of output: 11792


🏁 Script executed:

# Read the relevant lines from the .cursorrules file
# Get lines around 68-73 and line 223
if [ -f "rules/tanstack-start-cursorrules-prompt-file/.cursorrules" ]; then
  echo "=== Lines 65-75 (context around line 68-73) ==="
  sed -n '65,75p' "rules/tanstack-start-cursorrules-prompt-file/.cursorrules" | cat -n
  echo ""
  echo "=== Lines 220-225 (context around line 223) ==="
  sed -n '220,225p' "rules/tanstack-start-cursorrules-prompt-file/.cursorrules" | cat -n
fi

Repository: PatrickJS/awesome-cursorrules

Length of output: 814


Fix contradictory env guidance in client-rendered example.

Line 223 states "Never access process.env in client components," but Lines 68-73 use process.env.NODE_ENV in the RootComponent. This violates the stated guideline. In TanStack Start (Vite-based), use import.meta.env.DEV for dev-only rendering checks.

Suggested doc fix
-        {process.env.NODE_ENV === 'development' && (
+        {import.meta.env.DEV && (
           <>
             <TanStackRouterDevtools />
             <ReactQueryDevtools />
           </>
         )}

Also applies to: 220-223

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

In `@rules/tanstack-start-cursorrules-prompt-file/.cursorrules` around lines 68 -
73, The client RootComponent currently checks process.env.NODE_ENV to
conditionally render TanStackRouterDevtools and ReactQueryDevtools which
contradicts the guideline to never access process.env in client components;
replace that check by using the Vite/TanStack-safe flag import.meta.env.DEV in
the RootComponent (the conditional around TanStackRouterDevtools and
ReactQueryDevtools) so dev-only rendering uses import.meta.env.DEV instead of
process.env.NODE_ENV.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds TanStack Start guidance to the repository’s Cursor rules collection, covering key full-stack patterns (server functions, file-based routing, API routes, and streaming) and linking it from the main README.

Changes:

  • Added TanStack Start .cursorrules guidance with examples for routing, server functions, streaming, auth, and deployment presets.
  • Added TanStack Start .mdc rule content (both under the rule’s folder and in rules-new/) for scoped application via globs.
  • Updated root README.md to include the new TanStack Start rules entry.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
rules/tanstack-start-cursorrules-prompt-file/tanstack-start.mdc Adds TanStack Start rule content + frontmatter for scoped application.
rules/tanstack-start-cursorrules-prompt-file/README.md Documents what the TanStack Start rules cover and credits the author.
rules/tanstack-start-cursorrules-prompt-file/.cursorrules Provides the primary Cursor rules content and examples for TanStack Start usage.
rules-new/tanstack-start.mdc Adds a rules-new/ variant of the TanStack Start .mdc rule.
README.md Links the new TanStack Start rule set from the main rules list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<Outlet />
<ScrollRestoration />
<Scripts />
{process.env.NODE_ENV === 'development' && (
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

In the Root Route example, process.env.NODE_ENV is used inside a route component. This conflicts with the later guidance in this same file (“Never access process.env in client components”) and can also fail in Vite-based client bundles where process isn’t defined. Prefer import.meta.env.DEV/import.meta.env.MODE, or gate devtools via a server-derived flag passed to the client.

Suggested change
{process.env.NODE_ENV === 'development' && (
{import.meta.env.DEV && (

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,124 @@
---
description: TanStack Start full-stack React framework using server functions, API routes, SSR, streaming with defer(), and multi-platform deployment via Vinxi/Nitro
globs: ["src/routes/**/*", "src/server/**/*", "app.config.ts"]
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

Frontmatter globs is expressed as a YAML inline array here, but other .mdc files in rules-new/ use a plain string/comma-separated pattern for globs (e.g. rules-new/nextjs.mdc). To avoid inconsistent parsing/ingestion, consider switching this to the same string format used elsewhere in the repo.

Suggested change
globs: ["src/routes/**/*", "src/server/**/*", "app.config.ts"]
globs: src/routes/**/*, src/server/**/*, app.config.ts

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,124 @@
---
description: TanStack Start full-stack React framework using server functions, API routes, SSR, streaming with defer(), and multi-platform deployment via Vinxi/Nitro
globs: ["src/routes/**/*", "src/server/**/*", "app.config.ts"]
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

Frontmatter globs is expressed as a YAML inline array here, but most existing rule .mdc files in this repo use a plain string/comma-separated pattern for globs. For consistency (and to reduce the risk of tooling expecting a string), consider switching to the established string format.

Suggested change
globs: ["src/routes/**/*", "src/server/**/*", "app.config.ts"]
globs: src/routes/**/*,src/server/**/*,app.config.ts

Copilot uses AI. Check for mistakes.
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