mcpField
T
tanstack-start-architecture

tanstack-start-architecture

github.com/dobroslavradosavljevicDevelopment339 installsUpdated 2d ago
Repository

About tanstack-start-architecture

A standalone architecture skill for structuring TanStack Start applications, aimed at developers scaffolding, extending, or reviewing app code. It defines file placement, naming, and ownership conventions without covering framework APIs or deployment.

Key features

  1. 01Page and route folder conventions
  2. 02Placement rules for UI and hooks
  3. 03Guidance on reusable modules
  4. 04Scaffold, apply, and review modes
  5. 05Optional stack-specific extensions

Use cases

  1. 01Scaffolding a new page or layout
  2. 02Placing route-specific helpers and UI
  3. 03Reviewing an app against architecture rules

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dobroslavradosavljevic/skills --skill tanstack-start-architecture

After installing, type/tanstack-start-architecturein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents/
openai.yaml
references/
checklist.md
examples.md
rules.md
tree.md
with-better-auth-client.md
with-client-authorization.md
with-effect.md
with-env.md
with-generated-api-client.md
with-route-gates.md
with-tanstack-form.md
with-tanstack-query.md
with-ui-package.md
with-vitest.md

Details

From the project README

TanStack Start Architecture

Portable house style for TanStack Start (@tanstack/react-start) apps. Use this skill alone — it does not depend on other skills.

Job: where UI, hooks, and feature code live; folder/file naming; ownership.

Not this skill: Start/Router API quirks, SSR adapters, deployment, or latest framework docs. Prefer current TanStack Start / Router docs for those. Official Start docs still describe the framework as a Release Candidate (API considered stable; not bug-free). Prefer npm latest of @tanstack/react-start + @tanstack/react-router over stale “alpha” labels elsewhere.

If the target repo already documents architecture (e.g. AGENTS.md) and it conflicts, repo wins unless the user asks to migrate toward this skill.

Stack defaults (core)

PieceDefault
FrameworkTanStack Start + file-based TanStack Router (Vite or Rsbuild)
Entrypointssrc/router.tsx (getRouter), routes/__root.tsx, generated routeTree.gen.ts; optional start.ts / server.ts
PagesFolder + index.tsx per page (no flat page leaves)
Route-only codeHyphen-prefixed colocated folders (-components, -hooks, -lib)
Reusable featuressrc/modules/<feature>/ after a reuse gate
App-wide UIsrc/components/
Non-feature infrasrc/lib/
Ignore prefixRouter routeFileIgnorePrefix default -

Load matching with-* extensions when those stacks are present (see below).

Modes

  1. Scaffold — new page/layout/feature from checklist.md + tree.md.
  2. Apply — place new UI/hooks/helpers in the canonical spots.
  3. Review — compare to rules.md; propose moves; do not invent a parallel layout.

Hard rules (core)

  1. Every page is segment/index.tsx. Do not add flat page leaves (billing.tsx as the page component file). Prefer billing/index.tsx.
  2. Route-only modules use a - prefix (or the app’s configured ignore prefix). Unprefixed files under src/routes become URLs.
  3. Default new page UI to routes/…/-components. Same for page-only hooks (-hooks) and helpers (-lib).
  4. Reuse gate for src/modules/<feature>/: promote when a second consumer appears, or for clearly shared clients/schemas used across routes. Do not pre-create empty module trees.
  5. Modules must not import from src/routes. Routes may import modules.
  6. No module barrel index.ts by default. Import concrete paths (@/modules/billing/hooks/use-checkout).
  7. App-wide toolkit → src/components/; non-feature infra → src/lib/. Do not dump random shared UI into routes/.
  8. Pathless layouts use _name/ (or _name.tsx) when wrapping a section without changing the URL.
  9. Naming: folder = noun/route segment; leaf = short aspect (billing-page.tsx, use-checkout.ts). Do not repeat parent path noise in every filename when the folder already carries it.
  10. One job per route folder: that segment’s page/layout and its colocated private code only.

Details: rules.md, tree.md, examples.md.

Progressive disclosure

NeedRead
Canonical trees + tokensreferences/tree.md
Enforce rules + anti-patternsreferences/rules.md
Scaffold / review checklistsreferences/checklist.md
Good vs bad layoutsreferences/examples.md
Optional stack overlaysExtensions below

Extensions

Load an extension only when the matching stack is present (or the user asks). Extensions add rules; they do not replace the core tree.

WhenExtension
Generated OpenAPI / Hey-style clientwith-generated-api-client.md
Better Auth (or session) client modulewith-better-auth-client.md
TanStack Query + loaders / queryClient.querywith-tanstack-query.md
Pathless auth / onboarding / org gateswith-route-gates.md
TanStack Form + module/route schemaswith-tanstack-form.md
T3 Env / VITE_ client keyswith-env.md
Pure authz package + client adapterswith-client-authorization.md
Workspace UI package + Storybook/tokenswith-ui-package.md
Effect Schema / server-only Effectwith-effect.md
Vitest — libs/schemas/gates focuswith-vitest.md

Comments

Markdown supported