home / skills / yugasun / skills / web

web skill

/skills/web

This skill scaffolds and maintains modern React web apps with Bun, Vite, Tailwind, and shadcn/ui to accelerate UI development.

npx playbooks add skill yugasun/skills --skill web

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
3.3 KB
---
name: dev-web
description: Create and manage modern React web applications using Bun, Vite, React 19, Tailwind CSS 4, and shadcn/ui. Use this skill when the user asks to build a frontend, a web app, or modify UI components.
metadata:
  author: Yuga Sun
  version: "2026.01.29"
---

# Web Development Skill

## Instructions

Use this skill to scaffold and maintain web frontend projects in the `web/` directory. Follow the stack preferences and configuration details below.

### Quick Start

1.  **Initialize**: Use `bun create vite web --template react-ts`.
2.  **Install**: `bun install`.
3.  **Styling**: Configure Tailwind CSS 4.
4.  **Components**: Initialize `shadcn/ui`.

## Core Stack preferences

### Package Manager & Runtime (Bun)

Use **Bun** as the primary package manager and runtime.

| Command | Description |
|---------|-------------|
| `bun install` | Install dependencies |
| `bun add <pkg>` | Add dependency |
| `bun add -d <pkg>` | Add dev dependency |
| `bun run dev` | Start development server |

### Project Location

The web frontend project should be initialized in the `web/` directory.

### Framework & Build (Vite + React 19)

Use **Vite** with **React 19** and **TypeScript 5**.

To create a new project:
```bash
bun create vite web --template react-ts
```

### Styling (Tailwind CSS 4)

Use **Tailwind CSS v4**.

-   Install using the Vite plugin: `@tailwindcss/vite` and `tailwindcss`.
-   Use the CSS-first configuration approach where possible (`@import "tailwindcss";`).

Installation:
```bash
bun add tailwindcss@next @tailwindcss/vite
```

### UI Library (shadcn/ui 3)

Use **shadcn/ui v3** for the component system.

-   Initialize with `bunx --bun shadcn@latest init`.
-   Configure `components.json` to resolve paths correctly (e.g., `@/components`, `@/lib/utils`).
-   Use `bunx --bun shadcn@latest add <component>` to add components.

### Data & Routing (TanStack)

Use the **TanStack** suite for complex app needs:

-   **@tanstack/react-query**: For async state management.
-   **@tanstack/react-router**: For type-safe routing.

Installation:
```bash
bun add @tanstack/react-query @tanstack/react-router
```

---

## Configuration Details

### TypeScript

Ensure `tsconfig.json` is set to strict mode.

```json
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "jsx": "react-jsx",
    "noEmit": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}
```

### Vite Configuration

Update `vite.config.ts` to include the Tailwind CSS 4 plugin and path aliases.

```ts
import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react'
import path from "node:path"
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    react(),
    tailwindcss(),
  ],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src"),
    },
  },
})
```

### Global CSS

In `src/index.css`:

```css
@import "tailwindcss";

/* Configuration for shadcn/ui CSS variables should be added here if not automatically handled by the CLI init */
```

---

## References

### Styling & Theming

| Topic | Description | Reference |
|-------|-------------|-----------|
| Theming System | CSS variables, Dark mode, and Tailwind v4 configuration | [theme](references/theme.md) |


Overview

This skill scaffolds and maintains modern React frontend projects using Bun, Vite, React 19, Tailwind CSS 4, and shadcn/ui. It standardizes project layout in a web/ directory, enforces TypeScript strict settings, and wires core plugins and aliases for a reliable developer experience.

How this skill works

The skill creates a Vite React TypeScript app with Bun as the package manager and runtime, then configures Tailwind v4 and shadcn/ui for design primitives. It updates vite.config.ts with the Tailwind plugin and path aliases, applies a strict tsconfig.json, and provides commands and dependencies for common features like TanStack React Query and React Router. Use provided CLI commands to add components and dev dependencies via Bun.

When to use it

  • Starting a new React TypeScript frontend that must use Bun and Vite
  • Adding or scaffolding UI components with shadcn/ui in an existing project
  • Standardizing a project layout in the web/ directory with consistent tooling
  • Configuring Tailwind CSS v4 and its Vite plugin for design system work
  • Integrating TanStack libraries for type-safe routing or async state

Best practices

  • Initialize the app in web/ with: bun create vite web --template react-ts
  • Use bun install, bun add, and bun run dev for dependency and runtime workflows
  • Set TypeScript strict mode and path aliases in tsconfig.json to avoid runtime surprises
  • Keep Tailwind config and global CSS centralized in src/index.css with @import "tailwindcss"
  • Manage shadcn/ui via bunx shadcn commands and ensure components.json paths resolve to @/components

Example use cases

  • Scaffold a new SPA that uses React 19, Tailwind v4, and shadcn/ui components out of the box
  • Add a design-system component (e.g., dialog or form) with bunx --bun shadcn add <component>
  • Migrate a small frontend to Bun as the package manager and switch to Vite + React 19
  • Integrate TanStack React Query and React Router for data fetching and type-safe routing
  • Set up global theming variables and dark-mode support using Tailwind v4 and shadcn UI tokens

FAQ

Which directory should the frontend live in?

Place the project in the web/ directory to follow the skill conventions and ensure path aliases resolve correctly.

How do I add shadcn/ui components?

Use bunx --bun shadcn@latest add <component> and keep components.json configured so imports resolve to your @/components path.