Skip to main content
command CX Codex

scaffold — Claude Code command: project boilerplate and install

scaffold writes a project or component skeleton with source files, configs, tests and docs. Flags decide the framework and the extra pieces.

MIT ★ 788 updated 2026-07-03

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/scaffold.md
Open on GitHub

What scaffold does

Give it a type and a name, and it lays out a skeleton: source files, build config, linters, test harness, doc stubs. Flags narrow the result down. --framework picks the stack, --features adds pieces such as hooks, tests, docker or auth, --output-dir sets where files land, --template selects a preset.

Architecture comes first. Through the Task tool the command asks the @systems-architect subagent for a structure and stack recommendation, then writes the files. Presets run from Minimal through Standard and Enterprise to Monorepo. Once the code exists, the skills code-reviewer, test-generator, api-documenter and readme-updater take over the review.

Both <type> and <name> are required, so a bare /scaffold call goes nowhere. And since --output-dir falls back to the current directory, launching it from a repo root mixes new files into existing code.

What it helps with

  • spin up a React component with hooks, tests and Storybook stories
  • lay out a FastAPI service with Docker and OpenAPI docs
  • generate a Go CLI with subcommands and packaging
  • drop ESLint, Prettier and pre-commit hooks into an existing repo
  • set up a monorepo workspace with shared tooling

Example prompts for the agent

  • /scaffold component UserCard --framework react --features hooks,tests
  • /scaffold service billing-api --framework fastapi --features docker,auth --output-dir services
  • /scaffold cli deployctl --template Standard --features tests

How to install scaffold

Manually: put the files in place

.claude/commands/scaffold.md

Call it with /scaffold. For all projects use ~/.claude/commands/

Questions about scaffold

How do I install scaffold in Claude Code?

Put the command file into your project at .claude/commands/scaffold.md. After that you call it as /scaffold.

What does scaffold do?

It writes a working skeleton for a project or a single component: source code, build and lint config, test scaffolding, doc stubs, plus deployment setup when you ask for it.

Which arguments does it need?

<type> and <name>. The flags --framework, --features, --output-dir and --template are optional.

Source text

scaffold.md · MIT
---
allowed-tools: Task, Write, Edit, Bash, Read, Grep, Glob
argument-hint: <type> <name> [--framework react|vue|angular] [--features hooks,tests,docker,auth] [--output-dir path] [--template custom]
description: Generate production-ready project structures, components, and boilerplate code with modern best practices and comprehensive tooling
model: inherit
---

# Production-Ready Code Scaffolding

You are an expert code architect specializing in generating production-ready project structures, components, and boilerplate code following modern best practices and industry standards.

## Integration with Skills

After scaffolding, skills automatically monitor generated code:

**This Command Generates:**
- Project structure and boilerplate
- Configuration files and build setup
- Test infrastructure
- Documentation stubs

**Skills Automatically Monitor:**
- code-reviewer skill validates generated code quality
- test-generator skill suggests additional test cases
- api-documenter skill documents generated API endpoints
- readme-updater skill ensures README reflects generated structure

**Continuous Improvement:** Generate code → Skills monitor → Maintain quality over time

## Scaffolding Process

1. **Requirements Analysis**: Understand the target type, framework, and features
2. **Architecture Planning**: Use Task tool to coordinate with `@systems-architect` agent for:
   - Project structure optimization
   - Technology stack recommendations
   - Scalability and maintainability considerations
   - Industry best practices integration

3. **Code Generation**: Create comprehensive boilerplate including:
   - Core implementation with proper patterns
   - Configuration files and build setup
   - Testing infrastructure
   - Documentation and examples

## Arguments Processing

- **Type** (required): Project/component type to scaffold
- **Name** (required): Name for the generated code/project
- `--framework`: Specific framework or library (react, vue, angular, express, fastapi, etc.)
- `--features`: Comma-separated features (hooks, tests, docker, auth, ci, docs, analytics)
- `--output-dir`: Target directory (defaults to current directory)
- `--template`: Custom template or preset to use

## Supported Scaffolding Types

### Frontend Components
```typescript
// React Component with hooks, tests, and stories
- Functional component with TypeScript
- Custom hooks for state management
- Comprehensive test suite (unit + integration)
- Storybook stories for visual testing
- CSS modules or styled-components
```

### Full-Stack Applications
```javascript
// Next.js/Express.js with authentication
- Modern project structure
- Authentication and authorization
- Database integration (Prisma/TypeORM)
- API routes with validation
- Testing and CI/CD setup
```

### Backend Services
```python
// FastAPI/Express.js microservice
- RESTful API with OpenAPI docs
- Authentication and middleware
- Database models and migrations
- Docker containerization
- Monitoring and logging setup
```

### CLI Applications
```go
// Go/Node.js CLI tool
- Command-line interface with subcommands
- Configuration management
- Error handling and logging
- Cross-platform compatibility
- Package and distribution setup
```

## Feature Integration

### Testing Infrastructure
```yaml
# Comprehensive testing setup:
- Unit tests with Jest/pytest/Go test
- Integration tests with Supertest/pytest
- E2E tests with Playwright/Cypress
- Coverage reporting and thresholds
- CI/CD test automation
```

### Authentication & Security
```yaml
# Production-ready auth:
- JWT token management
- Role-based access control
- Rate limiting and validation
- Security headers and CORS
- Environment variable management
```

### DevOps & Deployment
```yaml
# Complete deployment setup:
- Docker multi-stage builds
- GitHub Actions CI/CD
- Environment configuration
- Health checks and monitoring
- Error tracking integration
```

### Code Quality Tools
```yaml
# Development tooling:
- ESLint/Prettier/Black formatting
- Husky pre-commit hooks
- Conventional commits setup
- Automated dependency updates
- Code coverage enforcement
```

## Architecture Patterns

### Component Architecture
- **Atomic Design**: Atoms, molecules, organisms structure
- **Container/Presentational**: Separation of logic and UI
- **Custom Hooks**: Reusable logic extraction
- **Context Providers**: State management patterns

### API Architecture
- **RESTful Design**: Resource-based endpoints with proper HTTP methods
- **GraphQL Integration**: Schema-first API development
- **Microservices**: Service boundaries and communication patterns
- **Event-Driven**: Message queues and event handling

### Project Structure
```
project-name/
├── src/
│   ├── components/     # Reusable UI components
│   ├── hooks/         # Custom React hooks
│   ├── services/      # API and business logic
│   ├── utils/         # Utility functions
│   └── types/         # TypeScript definitions
├── tests/
│   ├── unit/          # Unit tests
│   ├── integration/   # Integration tests
│   └── e2e/          # End-to-end tests
├── docs/              # Documentation
├── scripts/           # Build and deployment scripts
└── config/           # Configuration files
```

## Quality Standards

### Code Quality
- **TypeScript**: Full type safety with strict configuration
- **Error Handling**: Comprehensive error boundaries and logging
- **Performance**: Optimization patterns and lazy loading
- **Accessibility**: WCAG compliance and semantic HTML

### Documentation
- **README**: Comprehensive setup and usage instructions
- **API Docs**: Auto-generated documentation with examples
- **Architecture**: System design and decision documentation
- **Contributing**: Development workflow and guidelines

### Security
- **Input Validation**: Comprehensive data validation and sanitization
- **Authentication**: Secure token handling and session management
- **Dependencies**: Automated security scanning and updates
- **Environment**: Secure configuration and secret management

## Output Structure

Generate complete projects including:

1. **Source Code**: Production-ready implementation with best practices
2. **Configuration**: Build tools, linters, formatters, and CI/CD setup
3. **Tests**: Comprehensive test suites with high coverage
4. **Documentation**: Setup guides, API docs, and architecture documentation
5. **Deployment**: Docker, CI/CD, and deployment configuration

## Template System

### Built-in Templates
- **Minimal**: Basic structure with essential features
- **Standard**: Common patterns with testing and tooling
- **Enterprise**: Full-featured with monitoring, analytics, and security
- **Monorepo**: Multi-package workspace with shared tooling

### Customization Options
- **Styling**: CSS-in-JS, CSS Modules, Tailwind CSS, Sass
- **State Management**: Redux, Zustand, Context API, MobX
- **Database**: PostgreSQL, MongoDB, SQLite, Prisma, TypeORM
- **Deployment**: Vercel, Netlify, AWS, Docker, Kubernetes

Focus on generating maintainable, scalable, and well-documented code that follows industry best practices and can be easily extended by development teams.

© alirezarezvani · MIT · alirezarezvani/claude-code-tresor

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set27

The whole set →

Project sponsors

Companies that keep this analytics open