AgentStack
SKILL verified Apache-2.0 Self-run

React

skill-aps08-fullstack-clean-architecture-react · by aps08

Guidelines for the React frontend, TanStack ecosystem, and React 19 standards. Use when modifying the UI.

No reviews yet
0 installs
6 views
0.0% view→install

Install

$ agentstack add skill-aps08-fullstack-clean-architecture-react

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of React? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

React & TypeScript Frontend Guide

Use this skill when modifying, extending, or refactoring the frontend codebase in web/.


1. Technical Stack

  • Core: React 19 (compatible with React Compiler) & TypeScript 6.
  • Routing: TanStack Router (Vite file-based routing plugin).
  • State & Query: TanStack Query (React Query) for API interactions.
  • Forms: TanStack Form + Zod validation.
  • Styling: Tailwind CSS v4 (configured via @tailwindcss/vite).
  • Notifications: Sonner (toast).
  • Icons: Lucide React.

2. React 19 & TypeScript Best Practices

  • Strict Typing: Always define TypeScript types/interfaces for component props, API request/response structures, and state.
  • Functional Components: Write pure functional components.
  • React Compiler: React Compiler is enabled. Avoid manual optimizations using useMemo or useCallback for simple variables or handlers unless explicitly required for stability of dependency arrays in deep custom hooks. Let the compiler optimize renders automatically.
  • File Structure:
  • src/components/: Shared UI components (like common/Button.tsx, common/Input.tsx).
  • src/features/: Complex feature-specific components (e.g., todo/TodoList.tsx).
  • src/hooks/: Reusable hooks.
  • src/routes/: Route definitions matching TanStack Router conventions.

3. TanStack Router & Routing

  • Route Definitions: Located under src/routes/. Defined via createFileRoute.
  • Navigation:
  • Use `` for declarative navigation to support type-safe routes.
  • Use useNavigate for programmatic navigation:

``typescript const navigate = useNavigate(); navigate({ to: "/todos" }); ``

  • Route Trees: The route tree is automatically generated under src/routeTree.gen.ts. Never edit this file manually.

4. Data Fetching & Mutations (TanStack Query)

  • Isolation: Keep query and mutation hooks separate from component logic.
  • Queries belong in src/hooks/queries/.
  • Mutations belong in src/hooks/mutations/.
  • Invalidation: Always invalidate the query cache on mutation success to keep the UI in sync:

``typescript const queryClient = useQueryClient(); return useMutation({ mutationFn: async (data) => { await client.post("/v2/todos/", data); }, onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["todos"] }); }, }); ``


5. Forms & Schema Validation (TanStack Form + Zod)

  • Setup: Use useForm from @tanstack/react-form combined with a Zod schema from src/models/.
  • Form Submission:

``typescript const form = useForm({ defaultValues: { title: "", description: "" }, onSubmit: async ({ value }) => { await createTodo(value); }, }); ``

  • Inputs & Fields: Bind fields using form.Field and display validation errors safely:

``tsx ( field.handleChange(e.target.value)} error={field.state.meta.errors.join(", ")} /> )} /> ``


6. Styling & UI Design

  • Tailwind CSS v4: Use standard utility classes. Customize styling themes through the global CSS variables.
  • Animations: Apply micro-interactions and transitions (e.g. transition-all, animate-fade-in-up, hover:shadow-lg) to improve visual feedback.
  • Toasts: Handle operational successes and failures uniformly using Sonner's toast.success and toast.error.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.