scaffold — команда для Claude Code: каркас проекта и установка
Команда scaffold генерирует каркас проекта или отдельного компонента: исходники, конфиги, тесты и документацию. Фреймворк и набор фич задаются флагами.
MIT ★ 788 обновлён 2026-07-03
.claude/commands/scaffold.mdЧто делает scaffold
Команда собирает каркас: исходники, конфиги сборки и линтеров, тестовую обвязку, заготовки документации. Первые два аргумента обязательны: <type> и <name>. Дальше идут необязательные флаги --framework, --features, --output-dir и --template.
Перед генерацией команда через инструмент Task зовёт субагента @systems-architect, чтобы тот предложил структуру и стек. Шаблоны на выбор: Minimal, Standard, Enterprise, Monorepo. Когда файлы записаны, за них берутся скиллы code-reviewer, test-generator, api-documenter и readme-updater.
--output-dir по умолчанию указывает на текущую директорию, поэтому запуск из корня репозитория разложит файлы прямо рядом с существующим кодом. А без <type> и <name> команда не стартует — оба аргумента обязательные.
Какие задачи решает
- поднять каркас React-компонента с хуками и тестами
- собрать структуру FastAPI-сервиса с Docker и OpenAPI
- сгенерировать CLI на Go с подкомандами и упаковкой
- добавить ESLint, Prettier и pre-commit хуки в существующий репозиторий
- разложить монорепозиторий по пакетам с общим тулингом
Примеры запросов агенту
/scaffold component UserCard --framework react --features hooks,tests/scaffold service billing-api --framework fastapi --features docker,auth --output-dir services- Сгенерируй каркас CLI
deployctlпо шаблону Standard с тестами
Как установить scaffold
Вручную: положить файлы
.claude/commands/scaffold.mdВызов — /scaffold. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/scaffold.mdВызов — /prompts:scaffold. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/scaffold.prompt.mdВручную: положить файлы
.gemini/commands/scaffold.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Вопросы о scaffold
Как установить scaffold в Claude Code?
Положите файл команды в проект по пути .claude/commands/scaffold.md. После этого она вызывается как /scaffold.
Что делает scaffold?
Создаёт рабочий каркас проекта или компонента: исходный код, конфиги сборки и линтеров, тесты, заготовки документации и настройку деплоя.
Что нужно указать при вызове?
Тип и имя, они обязательны. Флаги --framework, --features, --output-dir и --template можно не указывать.
Исходный текст
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