Generate project structures, components, and boilerplate code with industry best practices and modern tooling.
The /scaffold command automates the creation of project structures, components, and boilerplate code across multiple frameworks and languages. It follows best practices, includes proper testing setups, and generates clean, maintainable code.
/scaffold <type> <name> [options]type- Type of scaffold to generate (see Supported Types)name- Name of the project/component to create
--framework- Specific framework version or variant--features- Comma-separated list of features to include--output-dir- Custom output directory (default: current directory)--template- Use a specific template variant
# React Components
/scaffold react-component UserProfile --hooks --tests --stories
/scaffold react-hook useUserData --tests
/scaffold react-context AuthContext --provider
# Vue Components
/scaffold vue-component UserCard --composition-api --tests
/scaffold vue-composable useAuth --tests
# Angular Components
/scaffold angular-component user-profile --standalone --tests
/scaffold angular-service user.service --tests# Next.js Applications
/scaffold next-app ecommerce-site --typescript --tailwind --auth
/scaffold next-app blog --app-router --mdx --cms
# Express.js APIs
/scaffold express-api user-service --typescript --auth --docker
/scaffold express-api graphql-api --apollo --prisma --tests
# Node.js CLI Tools
/scaffold node-cli task-manager --typescript --commander --tests# Go Services
/scaffold go-service user-api --gin --gorm --docker
/scaffold go-cli file-processor --cobra --tests
# Python Packages
/scaffold python-package data-processor --fastapi --pydantic --tests
/scaffold python-cli image-optimizer --click --poetry
# Rust Applications
/scaffold rust-cli json-parser --clap --serde --tests
/scaffold rust-service web-api --axum --tokio--tests- Generate comprehensive test suites--lint- Include linting configuration (ESLint, Prettier, etc.)--ci- Add CI/CD pipeline configuration--git- Initialize git repository with proper .gitignore
--typescript- Use TypeScript instead of JavaScript--docker- Include Docker configuration--docs- Generate documentation templates--examples- Include usage examples
--hooks- Use React hooks (functional components)--stories- Generate Storybook stories--auth- Include authentication setup--db- Include database configuration--api- Include API integration setup
/scaffold react-component UserProfile --hooks --tests --stories
# Generated structure:
src/components/UserProfile/
├── UserProfile.tsx
├── UserProfile.test.tsx
├── UserProfile.stories.tsx
├── UserProfile.module.css
└── index.ts/scaffold react-hook useUserData --tests
# Generated structure:
src/hooks/useUserData/
├── useUserData.ts
├── useUserData.test.ts
└── index.ts/scaffold express-api task-service --typescript --auth --docker --tests
# Generated structure:
task-service/
├── src/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ └── services/
├── tests/
├── docker-compose.yml
├── Dockerfile
├── package.json
└── tsconfig.json/scaffold express-api user-graphql --apollo --prisma --tests
# Generated structure:
user-graphql/
├── src/
│ ├── resolvers/
│ ├── schema/
│ ├── datasources/
│ └── types/
├── prisma/
├── tests/
└── apollo.config.js/scaffold next-app portfolio --typescript --tailwind --auth --cms
# Generated structure:
portfolio/
├── src/
│ ├── app/
│ ├── components/
│ ├── lib/
│ └── types/
├── prisma/
├── public/
├── tailwind.config.js
└── next.config.jsminimal- Basic structure with essential files onlystandard- Includes common development tools and configurationscomplete- Full-featured setup with all best practicesenterprise- Enterprise-ready with advanced tooling and patterns
# Use a specific template
/scaffold react-component Button --template minimal
/scaffold next-app dashboard --template enterpriseCreate a .scaffoldrc file in your project root:
{
"defaultTemplate": "standard",
"outputDir": "src",
"features": {
"typescript": true,
"tests": true,
"lint": true
},
"frameworks": {
"react": "18.x",
"next": "14.x",
"express": "4.x"
}
}# Create custom templates in .scaffold/templates/
.scaffold/
└── templates/
├── my-component/
└── my-api/- ESLint + Prettier configuration
- TypeScript strict mode enabled
- Import organization and path mapping
- Consistent naming conventions
- Unit tests with Jest/Vitest
- Integration tests for APIs
- Component testing with Testing Library
- E2E tests setup with Playwright/Cypress
- Hot reloading configuration
- Environment variables setup
- Build optimization configuration
- Source maps for debugging
Template not found
Error: Template 'custom' not found
Available templates: minimal, standard, complete, enterpriseInvalid type
Error: Type 'invalid-type' is not supported
Run '/scaffold --list-types' to see available typesDirectory already exists
Warning: Directory 'UserProfile' already exists
Use --overwrite to replace existing files# Create multiple components at once
/scaffold batch --config scaffold-config.json
# scaffold-config.json:
{
"components": [
{
"type": "react-component",
"name": "Header",
"features": ["hooks", "tests"]
},
{
"type": "react-component",
"name": "Footer",
"features": ["hooks", "tests"]
}
]
}# Start interactive scaffolding
/scaffold --interactive
# Prompts:
# ? What type of scaffold? (react-component)
# ? Component name? UserProfile
# ? Include tests? (Y/n)
# ? Include Storybook stories? (Y/n)# Add custom hooks to generated code
/scaffold react-component UserCard --hooks pre-commit,code-genTrack scaffolding patterns and optimize templates:
- Most used types: React components, Express APIs, Next.js apps
- Popular features: TypeScript, tests, Docker
- Template preferences: Standard (60%), Complete (30%), Minimal (10%)
Want to add new scaffold types or improve existing ones?
- Add new templates in
templates/directory - Update configuration in
command.json - Add documentation with examples
- Include tests for template validation
templates/new-type/
├── template.json # Template configuration
├── files/ # Template files
│ ├── {{name}}.template # Templated files
│ └── static/ # Static files
└── hooks/ # Generation hooks
├── pre-generate.js
└── post-generate.js
Ready to scaffold your next project? 🚀
Use /scaffold --help for quick reference or explore the examples above to get started!