# Spin up a Web App

> Scaffold a fresh web app in /work, start the dev server, surface the live preview URL.

- **Kind**: Shell tool
- **Category**: engineering
- **Owner**: Sentinel (/sentinel)
- **Default model**: sonnet
- **Cost class**: standard (Sonnet-class model. Default for most skills.)
- **Turn budget**: 12
- **Execution**: synchronous (result lands in the same turn)
- **Canonical URL**: https://app.51ultron.com/docs/skills/spin-up-web-app

## What it does

End-to-end web-app bootstrap. Picks the right framework (Next.js, Vite, Astro, plain HTML) based on the user's hint, scaffolds into /work, installs deps, starts the dev server bound to 0.0.0.0:3000 via start-dev-server, then calls shell_preview_info so the Computer tab auto-flips to the live iframe. Reads dev-preview/SKILL.md inside the container for routing rules.

## When to use this

- user wants to start a new web app from scratch
- user says 'build me a Next.js dashboard' / 'spin up a Vite app' / 'scaffold an Astro site'
- user has a stack in mind and wants the live preview running fast
- user wants to iterate on a UI with hot reload in the Computer tab

## When NOT to use this

- user wants to clone an existing live site → use clone-website
- user wants to deploy something that already exists → use deploy-to-cloudflare
- user wants a non-web project (CLI, library) → use shell_exec directly

## Example prompts

- `spin up a Next.js dashboard with shadcn`
- `scaffold a Vite + React app for me`
- `make me an Astro blog template`
- `start a fresh Next.js project with Tailwind`

## Inputs

- **stack**: framework + UI lib hints (e.g. 'next + shadcn')
- **name**: optional /work subdirectory name

## Output

Live preview URL bound to 0.0.0.0:3000 + path inside /work where the project lives.

## Tools used

`shell_exec`, `shell_write`, `shell_preview_info`

## Execution template

Shell tools dispatch through `shell_exec` with the following command template:

```bash
cat /home/ultron/.claude/skills/dev-preview/SKILL.md; scaffold {{stack}} in /work/{{name}}, install deps; start-dev-server <cmd> (NEVER bare 'python3 -m http.server &' or 'npm run dev &' — start-dev-server uses setsid so the server survives shell_exec teardown); then preview-url; finally curl -sI the URL to PROVE it returns 200 before claiming the preview is up
```

## Tags

`engineering`, `build`, `preview`

## Keywords

scaffold, spin up, bootstrap, new app, next.js, vite, astro, dev server, preview

