repo-conventions

Documents spa-velocity codebase conventions for architecture, state, routing, forms, styling, and testing.

1|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/TierOne-Studio/spa-velocity --skill repo-conventions-tierone-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: repo-conventions
Source: https://github.com/TierOne-Studio/spa-velocity/tree/main/.ruler/skills/repo-conventions
Command: npx skills add https://github.com/TierOne-Studio/spa-velocity --skill repo-conventions-tierone-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When implementing, reviewing, or refactoring code in the spa-velocity React frontend, generic React advice can conflict with the repository's binding decisions. This Skill grounds every code change in the actual conventions of this codebase so contributions stay consistent with its architecture and ADRs. ## Core Features & Use Cases - Feature-folder layout rules: Defines the src/ structure, feature module shape, and public-surface imports via index.ts so new code lands in the right place. - State and data conventions: Codifies the 4-layer state model (local, lifted, Zustand global store, TanStack Query cache) with query-key namespacing and mutation patterns. - Stack-specific standards: Covers React Router 7 protected routes, RHF + Zod forms with the <Field> compound, Tailwind 4 + Radix + CVA styling, better-auth token handling, and Vitest/Playwright testing. - Use Case: When adding a new admin settings page, follow this Skill to place components in features/Admin/, wire data through a TanStack Query hook with namespaced keys, guard the route with <AdminRoute>, and test it with Testing Library plus a Playwright e2e module. ## Quick Start Ask the assistant to implement a new feature or refactor existing code in spa-velocity while following the repo-conventions skill.

Frequently Asked Questions about repo-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a new feature in a React feature-folder architecture?

Create a folder under src/features/ with components, hooks, views, services, and types subdirectories, plus an index.ts public surface. Other features import only from that index, never from internal sub-paths.

When should I use Zustand versus TanStack Query for state?

Use TanStack Query for all server state fetched from the API, and Zustand only for truly app-wide client state like theme. Local useState remains the default for component-only state, with lifting for shared sibling state.

How do I protect routes with role-based access in React Router 7?

Wrap routes in the shared <ProtectedRoute> for authentication or <AdminRoute requiredPermission="..."> for RBAC checks. Never reimplement permission logic inside individual route components.

Does this convention set apply to generic React projects?

No, it is specific to the spa-velocity codebase and its ADR-backed decisions. For framework-agnostic React guidance, use the generic react-patterns, react-state-management, or react-testing skills instead.

Why should TanStack Query keys be namespaced per feature?

Namespaced hierarchical keys like ['chat', 'conversations', userId] let you invalidate an entire feature's cache with one call without collateral damage to other features. The pattern is [<feature>, <resource>, <id?>, <params?>].