Agent skill
scaffold
Detect project stack, apply architecture patterns, wire quality gates, and scaffold features. Use when bootstrapping a project, adding a vertical slice, wiring CI/CD, adding Docker compose, or setting up quality gates.
Install this agent skill to your Project
npx add-skill https://github.com/BerryKuipers/claude-code-toolkit/tree/main/.claude/skills/scaffold
SKILL.md
Scaffold
Detect the current project's stack and apply toolkit architecture patterns, quality gates, and scaffolding.
When to Apply
- Scaffolding a new vertical slice or feature module
- Wiring or updating CI/CD pipelines
- Adding or modifying Docker Compose services
- Refactoring shared utilities or extracting common code
- Setting up or running quality gates (lint, type-check, test, build)
- Applying layered architecture (routes -> services -> repositories)
- Reviewing code against SOLID and clean-code principles
- Bootstrapping a new project with toolkit standards
Step 1: Detect Project Context
Before making any changes, inspect the current repository:
- Read
package.json,*.csproj,Cargo.toml,go.mod, or equivalent to determine language and framework - Check for existing
CLAUDE.md,.claude/rules/,.claude/settings.json - Scan for
docker-compose*.yml,Dockerfile,.github/workflows/ - Identify the package manager (
npm,yarn,pnpm,bun) - Identify the test runner (
jest,vitest,pytest,go test) - Check for monorepo indicators (
workspaces,turbo.json,nx.json,lerna.json)
Summarize findings before proceeding.
Step 2: Apply Architectural Patterns
Based on project type, enforce these layered architecture rules:
Backend (Node.js / TypeScript)
- HTTP layer (routes/controllers): thin adapters only, no business logic, no direct DB access
- Service layer: business logic, orchestration, validation
- Repository layer: data access, ORM encapsulation, query building
- Dependency direction: routes -> services -> repositories (never reverse)
Frontend (React / TypeScript)
- Components: presentational, no direct API calls in render
- Hooks: data fetching, state management, side effects
- Services: API client wrappers, data transformation
- State: colocate state; lift only when shared
General
- TypeScript strict mode, explicit return types on public APIs
- ES modules everywhere (never CommonJS)
- Named exports preferred over default exports
- Error types over generic throws
Step 3: Quality Gate Checklist
Run these checks in order (fast-fail):
1. [ ] TypeScript / type-check passes (npx tsc --noEmit OR equivalent)
2. [ ] Linting passes (npm run lint OR equivalent)
3. [ ] Tests pass (npm test OR equivalent)
4. [ ] Build succeeds (npm run build OR equivalent)
5. [ ] No new lint warnings introduced
6. [ ] Coverage >= project threshold
If any check fails, stop and fix before proceeding.
Step 4: Verify and Report
After completing changes:
- Re-run the quality gate checklist
- Summarize what was changed and why
- List any remaining TODOs or follow-up items
- If creating a PR, ensure title is concise (<70 chars) and body includes a test plan
Available Toolkit Skills
The toolkit provides specialized skills for common tasks. Invoke them when relevant:
- quality-gate: Full quality validation (tests + lint + types + build + audit)
- validate-build: Build-only validation
- validate-typescript: Type-checking only
- validate-lint: Lint-only validation
- run-comprehensive-tests: Test execution with coverage
- commit-with-validation: Git commit with pre-flight checks
- create-pull-request: PR creation with template
- audit-dependencies: Security audit of dependencies
- infrastructure: Deployment orchestration (DNS, VPS, Docker)
Adaptation Notes
This skill adapts to any project. If the project uses:
- Python: substitute
mypyfor tsc,ruff/blackfor eslint,pytestfor jest - Go: substitute
go vetfor tsc,golangci-lintfor eslint,go testfor jest - Rust: substitute
cargo checkfor tsc,cargo clippyfor eslint,cargo testfor jest - Other: detect and adapt tooling from project config files
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
validate-typescript
Run TypeScript compiler type-checking (tsc --noEmit) to validate type safety and catch type errors. Returns structured output with error counts, categories (type/syntax/import errors), and affected files. Used for quality gates and pre-commit validation.
validate-coverage-threshold
Validate test coverage meets minimum thresholds (default 80% overall, 80% statements, 75% branches, 80% functions). Parses coverage reports from coverage/coverage-summary.json or test output. Returns pass/fail status with detailed metrics and identifies uncovered files.
quality-gate
Comprehensive quality validation for TypeScript/JavaScript projects - runs TypeScript checks, tests, coverage analysis, build validation, and linting with structured JSON results
run-comprehensive-tests
Execute comprehensive test suite (Vitest/Jest) with coverage reporting and failure analysis. Returns structured output with test counts (total/passed/failed), coverage percentage, duration, and detailed failure information. Used for quality gates and CI/CD validation.
validate-build
Run production build validation (npm run build, vite build, tsc) to ensure code compiles and builds successfully. Returns structured output with build status, duration, size metrics, and error details. Used for quality gates and deployment readiness checks.
validate-lint
Run ESLint and Prettier validation to check code style, formatting, and best practices. Returns structured output with error/warning counts, rule violations, and affected files. Used for code quality gates and pre-commit validation.
Didn't find tool you were looking for?