---
name: project-setup-fa033ac2dc15
description: Scaffold Express+Prisma API app in Turborepo. Express 5, Pino, Zod env, JWKS auth, rate-limit, res.success/error, tsup.
---

# Project Setup — 23 files

Load `references/templates.md` only after preflight passes.

## Preflight

| Check | Pass | Fail |
|---|---|---|
| `turbo.json` + `apps/` at root | ✅ | STOP: "Requires Turborepo monorepo." |
| `packages/typescript-config/base.json` has `"moduleResolution":"Bundler"` | ✅ | load `references/missing-packages.md` §A |
| `packages/biome-config/base.json` | ✅ Biome shared | — |
| Root `biome.json` `"root":true` only | ✅ Biome root-only | — |
| ESLint / no linter found | ⚠️ | load `references/missing-packages.md` §B |
| `packages/vitest-config/` base export | ✅ shared | use standalone `vitest.config.ts`, drop `{scope}/vitest-config` devDep |

**Variables**
- `{app}` — user input; if missing ask: *"App name? (e.g. api, server)"*
- `{scope}` — extract prefix from any `packages/*/package.json` `"name"`; if ambiguous ask: *"Workspace scope? (e.g. @repo)"*
- `{pkg}` = `{scope}/{app}`
- `{db-pkg}` — `prisma_client_import` from `references/project.config.md`; else `{scope}/db`
- `{ws}` = `workspace:*` (pnpm) | `*` (yarn/npm) — infer from root `package.json` or lockfile
- `apps/{app}/` exists → ask: *"Overwrite / skip existing / cancel?"*

**Confirm before generating:**
```
scope:{scope} app:{app} pkg:{pkg} db-pkg:{db-pkg} vitest:shared|standalone files:23 — Generate? [Y/n]
```

## File Generation

Load `references/templates.md`. Replace `{app}` `{pkg}` `{scope}` `{db-pkg}` `{ws}` throughout.

All paths are under `apps/{app}/`:
```
README.md · package.json · tsconfig.json · biome.json · vitest.config.ts · tsup.config.ts · .env.example
src/types/express.d.ts
src/config/env.ts · logger.ts · db.ts
src/utils/http-error.ts · http-error.test.ts
src/middlewares/response-formatter.ts · error-handler.ts · auth.middleware.ts · http-logger.ts · validate.ts · rate-limit.ts
src/routes/index.ts · src/app.ts · src/server.ts
```

**After all files created**, run:
```bash
pnpm --filter {pkg} add compression cors dotenv express helmet jose pino pino-http zod
pnpm --filter {pkg} add -D @types/compression @types/cors @types/express @types/node pino-pretty tsup tsx typescript vitest
```

Print:
```
✅ apps/{app}/ — 23 files, deps installed.
  1. cp apps/{app}/.env.example apps/{app}/.env
  2. pnpm --filter {pkg} dev
```

## Resume
"resume project setup for {app}" → check each file: exists → skip, missing → create.

## JS Mode
Strip `: Type` `import type` `z.infer<>` `satisfies` `as Type`. Omit `src/types/express.d.ts`. Rename `.ts`→`.js`.


---
Source attribution: raihansharifrimon
Original project: https://github.com/raihansharifrimon/ai-agent-dev-skills/blob/e7fdcdf5e5e2714b12600ae6e4186adcdec1d668/skills/turborepo-express-api/skills/project-setup/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 turborepo-express-api skill authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: raihansharifrimon
Original project: https://github.com/raihansharifrimon/ai-agent-dev-skills/blob/e7fdcdf5e5e2714b12600ae6e4186adcdec1d668/skills/turborepo-express-api/skills/project-setup/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Product Management, Project & Program Management
Roles: Backend Developer, DevOps / SRE, Full-Stack Developer, Product Manager, Project Manager
Specialties: Backend
Tools: Express, Prisma, Turborepo
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 52df064f85eefcbb95c3d743fe1e8fdc6fc3128816fc1d3a7e116989f1cd3277
