fullstack-vite-convex
Full-stack web development with Convex + Vite React. TDD-driven, strict TypeScript, fully autonomous. Covers scaffolding, schema design, backend functions, frontend components, testing, styling, and deployment. Use when building web apps, sites, or frontend tasks from scratch or adding features to Convex projects. Triggers on: 'build a web app', 'create a site', 'Convex app', 'React app', 'full-stack', 'frontend', 'build me an app', any request to create or modify a Convex + Vite React application.
What this skill does
# Full-Stack Web Development — Convex + Vite React
Build production-quality Convex + Vite React applications with **test-driven development** and **strict TypeScript**. Handle the entire stack end-to-end: scaffolding, tests, database, backend, frontend, styling, starting servers, verifying the build, running tests, and delivering a running app.
## Core Principles
### 1. Autonomy Is Non-Negotiable
- **NEVER** tell the user to run commands. YOU run them.
- **NEVER** say "you can now run..." or "please execute...". Just do it.
- Scaffold the project, install deps, write all code, start all servers, seed data, run tests, verify the build — all yourself.
- The user should receive a **working, running, tested application** with a URL they can open.
- If something fails, fix it yourself. Don't report errors without attempting resolution.
### 2. TDD By Default
- **Write tests BEFORE implementation.** Always.
- Backend: write Convex function tests before writing the functions.
- Frontend: write component tests before writing the components.
- Every feature gets a test. No exceptions.
- Tests must pass before moving to the next phase. Run them yourself and fix failures.
### 3. Strict TypeScript — Zero Tolerance
- All code uses strict TypeScript. No `any`. No `as unknown as X` hacks. No `@ts-ignore`.
- Enable all strict flags in `tsconfig.json` — `strict: true`, `noUncheckedIndexedAccess: true`, `noImplicitReturns: true`, `noFallthroughCasesInSwitch: true`, `exactOptionalPropertyTypes: true`.
- Every function has explicit return types. Every variable has a type or is inferable.
- Use `Id<"tableName">` for Convex IDs, never `string`.
- Use discriminated unions with `as const` for status/kind fields.
- `npx tsc --noEmit` must produce **0 errors** before you deliver. Run it and fix every error.
## Documentation Lookup
Always use Context7 MCP tools (`resolve-library-id` then `query-docs`) when you need library, API, or framework documentation. Do NOT ask the user. Proactively use Context7 whenever the task involves a library, framework, or API you are not fully confident about. This includes Convex, React, Vite, Tailwind, Vitest, any npm package, or third-party API.
---
## Workflow
### Phase 1: Scaffold & Setup (Local by Default)
Scaffold the project yourself — no Convex account or cloud needed:
```bash
npm create convex@latest -- -t react-vite my-app && cd my-app && npm install
```
Install ALL deps in one shot — testing, styling, utilities:
```bash
npm install lucide-react && npm install -D tailwindcss @tailwindcss/vite vitest @testing-library/react @testing-library/jest-dom @testing-library/user-event jsdom @types/node
```
Project structure:
```
my-app/
convex/ # Backend
_generated/ # Auto-generated (never edit)
schema.ts
tsconfig.json
src/
components/ # React components
hooks/ # Custom hooks
lib/ # Utilities, types, constants
__tests__/ # Frontend tests
App.tsx
main.tsx
tests/ # Backend/integration tests
package.json
tsconfig.json
vite.config.ts
vitest.config.ts
```
### Phase 2: Configure Strict TypeScript
Set up `tsconfig.json` with maximum strictness:
```json
{
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"module": "ESNext",
"moduleResolution": "Bundler",
"jsx": "react-jsx",
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"isolatedModules": true,
"resolveJsonModule": true,
"allowImportingTsExtensions": true,
"noEmit": true
},
"include": ["src/**/*", "tests/**/*", "vite.config.ts", "vitest.config.ts"],
"exclude": ["convex"]
}
```
Set up `vitest.config.ts`:
```typescript
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
test: {
environment: "jsdom",
globals: true,
setupFiles: ["./src/test-setup.ts"],
include: ["src/**/*.test.{ts,tsx}", "tests/**/*.test.ts"],
coverage: {
provider: "v8",
reporter: ["text", "lcov"],
},
},
});
```
Create `src/test-setup.ts`:
```typescript
import "@testing-library/jest-dom/vitest";
```
Add test scripts to `package.json`:
```json
{
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc --noEmit",
"lint": "tsc --noEmit && vitest run"
}
}
```
### Phase 3: Schema & Types
Define schema in `convex/schema.ts` and export shared types in `src/lib/types.ts`.
Define all data types, constants, and enums upfront. Use discriminated unions for status fields:
```typescript
// src/lib/types.ts
export const BOOKING_STATUS = {
pending: "pending",
confirmed: "confirmed",
cancelled: "cancelled",
} as const;
export type BookingStatus = (typeof BOOKING_STATUS)[keyof typeof BOOKING_STATUS];
```
### Phase 4: Write Tests First (TDD)
**Backend tests** — test Convex function logic (validators, edge cases):
```typescript
// tests/services.test.ts
import { describe, it, expect } from "vitest";
describe("services", () => {
it("should validate service has required fields", () => {
const service = {
name: "Consultation",
description: "1-on-1 session",
duration: 60,
price: 150,
category: "consulting",
available: true,
icon: "phone",
};
expect(service.name).toBeDefined();
expect(service.price).toBeGreaterThan(0);
expect(service.duration).toBeGreaterThan(0);
});
it("should reject invalid price", () => {
expect(() => {
if (-1 <= 0) throw new Error("Price must be positive");
}).toThrow("Price must be positive");
});
});
```
**Frontend component tests** — test rendering, user interactions:
```typescript
// src/__tests__/ServiceCard.test.tsx
import { describe, it, expect } from "vitest";
import { render, screen } from "@testing-library/react";
import { ServiceCard } from "../components/ServiceCard";
describe("ServiceCard", () => {
const mockService = {
_id: "test-id" as any,
_creationTime: Date.now(),
name: "Consultation",
description: "1-on-1 session",
duration: 60,
price: 150,
category: "consulting",
available: true,
icon: "phone",
};
it("renders service name and price", () => {
render(<ServiceCard service={mockService} onBook={() => {}} />);
expect(screen.getByText("Consultation")).toBeInTheDocument();
expect(screen.getByText(/\$150/)).toBeInTheDocument();
});
it("shows unavailable state when not available", () => {
render(<ServiceCard service={{ ...mockService, available: false }} onBook={() => {}} />);
expect(screen.getByText(/unavailable/i)).toBeInTheDocument();
});
});
```
**Run tests — they should fail (red phase):**
```bash
npx vitest run
```
### Phase 5: Implement Code (Green Phase)
Now write the implementation to make tests pass:
1. **Backend functions** — queries, mutations, actions, seed data in `convex/`
2. **Frontend components** — each in its own file with typed props interfaces
3. **Hooks** — custom hooks for shared logic
4. **Pages** — route-level components composing smaller pieces
**Run tests again — they must pass (green phase):**
```bash
npx vitest run
```
Fix any failures before proceeding.
### Phase 6: Refactor
With passing tests as a safety net, refactor:
- Extract shared logic into hooks/utilities
- Remove duplication
- Improve component composition
- Tighten types
**Run tests after every refactor to ensure nothing broke.**
### Phase 7: Start Servers & Verify
Start the **local** Convex backend:
```bash
npx convex dev --local &
```
Start the Vite dev servRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.