tanstack-start-best-practices — скилл для Claude Code: установка
Свод правил и паттернов для full-stack приложений на TanStack Start. Помогает настраивать серверные функции, сессии и потоковый SSR.
npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-start-best-practices -a claude-code
npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-start -a claude-codeЧто делает tanstack-start-best-practices
Набор рекомендаций для full-stack приложений на React с библиотекой TanStack Start. Скилл помогает писать серверные функции через createServerFn и защищать маршруты с помощью хука beforeLoad. Ошибки гидратации скилл тоже разбирает.
Каждое правило содержит описание проблемы и примеры кода с частыми антипаттернами. Каталог разбит по приоритетам: от безопасности и валидации схем до структуры файлов с суффиксом .functions.ts и настройки адаптеров развёртывания.
Скилл рассчитан строго на архитектуру TanStack Start, поэтому в обычном клиентском React-приложении эти правила будут избыточными.
Какие задачи решает
- настроить серверные функции с валидацией аргументов через
createServerFn - защитить маршруты и сессии с помощью middleware и хука
beforeLoad - предотвратить ошибки гидратации и настроить потоковый SSR
- разделить клиентский и серверный код по паттерну
.functions.ts
Примеры запросов агенту
- Проверь серверную функцию на соответствие правилам TanStack Start и добавь валидацию схемы
- Помоги настроить middleware для проверки авторизации перед загрузкой маршрута
- Как правильно организовать потоковый SSR в TanStack Start без ошибок гидратации?
Как установить tanstack-start-best-practices
1Через Skills CLI (Vercel)
npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-start-best-practices -a claude-codenpx skills add DeckardGer/tanstack-agent-skills --skill tanstack-start -a claude-code2Вручную: положить файлы
~/.claude/skills/tanstack-start/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/tanstack-start/
1Через Skills CLI (Vercel)
npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-start -a codex2Вручную: положить файлы
.agents/skills/tanstack-start/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-start -a cursor2Вручную: положить файлы
.cursor/skills/tanstack-start/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install DeckardGer/tanstack-agent-skills tanstack-start2Вручную: положить файлы
.github/skills/tanstack-start/SKILL.md1Через Skills CLI (Vercel)
npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-start -a gemini-cli2Командой платформы
gemini skills install https://github.com/DeckardGer/tanstack-agent-skills --path skills/tanstack-startВручную: положить файлы
.devin/skills/tanstack-start/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-start -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о tanstack-start-best-practices
Как установить tanstack-start-best-practices в Claude Code?
Выполните команду npx skills add DeckardGer/tanstack-agent-skills --skill tanstack-start-best-practices -a claude-code в терминале.
Что делает скилл tanstack-start-best-practices?
Он даёт агенту инструкции по созданию серверных функций, middleware, защите маршрутов и настройке SSR в проектах на TanStack Start.
Как скилл предлагает организовать код серверных функций?
Правила рекомендуют изолировать логику сервера от компонентов интерфейса и выносить её в файлы с расширением .functions.ts.
Исходный текст
SKILL.md · MIT
--- name: tanstack-start-best-practices description: TanStack Start best practices for full-stack React applications. Server functions, middleware, SSR, authentication, and deployment patterns. Activate when building full-stack apps with TanStack Start. --- # TanStack Start Best Practices Comprehensive guidelines for implementing TanStack Start patterns in full-stack React applications. These rules cover server functions, middleware, SSR, authentication, and deployment. ## When to Apply - Creating server functions for data mutations - Setting up middleware for auth/logging - Configuring SSR and hydration - Implementing authentication flows - Handling errors across client/server boundary - Organizing full-stack code - Deploying to various platforms ## Rule Categories by Priority | Priority | Category | Rules | Impact | |----------|----------|-------|--------| | CRITICAL | Server Functions | 5 rules | Core data mutation patterns | | CRITICAL | Security | 4 rules | Prevents vulnerabilities | | HIGH | Middleware | 4 rules | Request/response handling | | HIGH | Authentication | 4 rules | Secure user sessions | | MEDIUM | API Routes | 1 rule | External endpoint patterns | | MEDIUM | SSR | 5 rules | Server rendering patterns | | MEDIUM | Error Handling | 3 rules | Graceful failure handling | | MEDIUM | Environment | 1 rule | Configuration management | | LOW | File Organization | 3 rules | Maintainable code structure | | LOW | Deployment | 2 rules | Production readiness | ## Quick Reference ### Server Functions (Prefix: `sf-`) - `sf-create-server-fn` — Use createServerFn for server-side logic - `sf-input-validation` — Always validate server function inputs - `sf-method-selection` — Choose appropriate HTTP method - `sf-error-handling` — Handle errors in server functions - `sf-response-headers` — Customize response headers when needed ### Security (Prefix: `sec-`) - `sec-validate-inputs` — Validate all user inputs with schemas - `sec-auth-middleware` — Protect routes with auth middleware - `sec-sensitive-data` — Keep secrets server-side only - `sec-csrf-protection` — Implement CSRF protection for mutations ### Middleware (Prefix: `mw-`) - `mw-request-middleware` — Use request middleware for cross-cutting concerns - `mw-function-middleware` — Use function middleware for server functions - `mw-context-flow` — Properly pass context through middleware - `mw-composability` — Compose middleware effectively ### Authentication (Prefix: `auth-`) - `auth-session-management` — Implement secure session handling - `auth-route-protection` — Protect routes with beforeLoad - `auth-server-functions` — Verify auth in server functions - `auth-cookie-security` — Configure secure cookie settings ### API Routes (Prefix: `api-`) - `api-routes` — Create API routes for external consumers ### SSR (Prefix: `ssr-`) - `ssr-data-loading` — Load data appropriately for SSR - `ssr-hydration-safety` — Prevent hydration mismatches - `ssr-streaming` — Implement streaming SSR for faster TTFB - `ssr-selective` — Apply selective SSR when beneficial - `ssr-prerender` — Configure static prerendering and ISR ### Environment (Prefix: `env-`) - `env-functions` — Use environment functions for configuration ### Error Handling (Prefix: `err-`) - `err-server-errors` — Handle server function errors - `err-redirects` — Use redirects appropriately - `err-not-found` — Handle not-found scenarios ### File Organization (Prefix: `file-`) - `file-separation` — Separate server and client code - `file-functions-file` — Use .functions.ts pattern - `file-shared-validation` — Share validation schemas ### Deployment (Prefix: `deploy-`) - `deploy-env-config` — Configure environment variables - `deploy-adapters` — Choose appropriate deployment adapter ## How to Use Each rule file in the `rules/` directory contains: 1. **Explanation** — Why this pattern matters 2. **Bad Example** — Anti-pattern to avoid 3. **Good Example** — Recommended implementation 4. **Context** — When to apply or skip this rule ## Full Reference See individual rule files in `rules/` directory for detailed guidance and code examples.
© DeckardGer · MIT · DeckardGer/tanstack-agent-skills