Skip to content
Back to skills

Scaffold Fastify Ts

BSecurity

Scaffold production-ready Fastify + TypeScript backend with Prisma, Zod, and Vitest.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 14, 2026
databasestypescriptgobashsqlangularnodeexpressdockerawstesting

Security analysis

B84/100
  • mediumUses curl or wget to download content
  • criticalExfiltrates credentials via HTTP — exact pattern from Snyk ToxicSkills study

Pro scans all 3 files and shows the line behind each finding

Scanned November 14, 2026

npx -y skills add SebastianLuser/claude-code-arcane --skill scaffold-fastify-ts --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Scaffold Fastify Ts?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Scaffold Fastify Ts
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/sebastianluser-scaffold-fastify-ts/badge)](https://www.skillsdirectory.com/skills/sebastianluser-scaffold-fastify-ts)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: scaffold-fastify-ts
description: "Scaffold production-ready Fastify + TypeScript backend with Prisma, Zod, and Vitest."
category: "backend"
argument-hint: "[project-name]"
user-invocable: true
allowed-tools: Read, Glob, Grep, Bash, Write, Edit, Task
---
# scaffold-fastify-ts — Backend Scaffolder

## MANDATORY WORKFLOW

**Before generating any code, complete these steps in order.**

### Step 0: Gather Requirements

Clarify (or infer from context if already specified):

1. **Service name** (kebab-case)
2. **Database:** PostgreSQL / MySQL / SQLite
3. **ORM:** Prisma (default) / Drizzle
4. **Auth:** JWT / Session cookies / OAuth / none
5. **Deploy target:** Docker / AWS ECS / Railway / Vercel

If the user already specified these values, skip straight to Step 1.

### Step 1: Implement

Follow the sections of this document in order: Framework Decision → Stack Baseline → Project Structure.

### Step 2: Verify

Before declaring the scaffold complete:

```bash
npm run build        # tsc with no errors
docker compose up -d # Postgres up
npm run test         # vitest passes
curl http://localhost:3000/health  # responds 200
```

---

## Framework Decision

| Option | Use when |
|--------|----------|
| **Fastify** | Default. Schema-first with Zod, low overhead, fast |
| **NestJS** | Heavy DI needed, Angular-style conventions — ask first |
| **Express** | Legacy lib compatibility only |

## Stack Baseline

- Node.js 20+ LTS, Fastify 4+, TypeScript strict mode, `tsx` for dev
- **Validation:** Zod + fastify-type-provider-zod (inferred types from schemas)
- **ORM:** Prisma (PostgreSQL default) or Drizzle (SQL-first preference)
- **Auth:** @fastify/jwt, @fastify/cookie, @fastify/cors, @fastify/helmet
- **Logging:** pino (built-in Fastify) — never `console.log`
- **Docs:** @fastify/swagger + @fastify/swagger-ui
- **Testing:** Vitest + supertest, using `buildApp()` + `app.inject()`
- **Linting:** ESLint + Prettier + Husky + lint-staged
- **Infra:** Docker multi-stage + docker-compose (Postgres)

## Project Structure

- `src/server.ts` (entrypoint) + `src/app.ts` (Fastify builder, testable)
- `src/config/` — env.ts (Zod env validation), plugins.ts
- `src/modules/<feature>/` — routes.ts, service.ts, repository.ts, schema.ts, tests
- `src/lib/` — db.ts (Prisma singleton), errors.ts, logger.ts
- `src/middleware/` — auth.ts, error-handler.ts
- `prisma/` — schema.prisma + migrations
- `tests/` — setup.ts + integration/
- Root: Dockerfile, docker-compose.yml, tsconfig.json, vitest.config.ts, .env.example

> → Read references/key-decisions.md for organization patterns, plugin pattern, config management, TypeScript and error handling details

> → Read references/anti-patterns.md for common anti-patterns to avoid

Files in this skill

  • SKILL.md2.7 KB
  • references/anti-patterns.md496 B
  • references/key-decisions.md1.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in databases →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.