Skip to content
/scaffoldStable

Bootstraps new projects, features, or modules from templates with proper structure, types, tests, and configuration.

DevelopmentProductivityΒ· 3 min read

Quick import: Download the .md file and save it to .claude/commands/ (Claude Code), .cursorrules (Cursor), or paste as a system prompt in ChatGPT, Gemini, or any LLM API.

#What it does

The /scaffold skill generates boilerplate for new projects, features, and modules. It creates the full file structure -- source files, types, tests, configuration, and documentation -- following your project's existing conventions. Instead of copying from old code and removing the parts you do not need, scaffold gives you a clean starting point with everything wired up correctly.

#How to use

bash
/scaffold feature user-notifications
bash
/scaffold api-route POST /api/v1/invoices
bash
/scaffold component DataTable --with-tests --with-stories
bash
/scaffold project next-app my-saas-dashboard

#Scaffold types

#feature -- Full feature module

Creates the complete vertical slice: API route, service layer, repository, types, validation schema, and tests.

#api-route -- Single API endpoint

Creates route handler, request/response types, validation, error handling, and integration test.

#component -- React/UI component

Creates component file, types/props interface, test file, and optionally a Storybook story.

#project -- New project from template

Creates a full project with recommended directory structure, base configuration, linting, testing setup, and CI pipeline.

#module -- Standalone library module

Creates an isolated module with its own types, tests, barrel export, and README.

#Workflow

  1. Detect -- Read the existing project structure, identify conventions for file naming, directory layout, import patterns, and test organization
  2. Template -- Generate files that match the project's patterns exactly: same naming conventions, same export style, same test structure
  3. Wire -- Add barrel exports, route registrations, and navigation entries so the new code is connected to the existing application
  4. Stub -- Include placeholder implementations with TODO comments marking where custom logic goes
  5. Verify -- Ensure the scaffolded code compiles and placeholder tests pass

#Example

bash
> /scaffold feature billing
 
## Created 7 files:
 
src/features/billing/
  billing.service.ts       β€” Business logic with TODO stubs
  billing.repository.ts    β€” Database queries interface + implementation
  billing.types.ts         β€” Request/response types, domain models
  billing.validation.ts    β€” Zod schemas for input validation
  billing.route.ts         β€” API route handler wired to service
  __tests__/
    billing.service.test.ts  β€” Unit tests with happy path stubs
    billing.route.test.ts    β€” Integration test with supertest
 
## Wired up:
  + Added export to src/features/index.ts
  + Registered route in src/app/api/billing/route.ts

#Conventions

  • Reads your CLAUDE.md, tsconfig.json, and existing code to match conventions
  • Never overwrites existing files -- warns and skips if a file already exists
  • Uses your project's preferred import style (relative vs. path aliases)
  • Generates TypeScript strict-mode compatible code with no any types
Orel OhayonΒ·
View all skills