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
mypy for tsc, ruff/black for eslint, pytest for jest
- Go: substitute
go vet for tsc, golangci-lint for eslint, go test for jest
- Rust: substitute
cargo check for tsc, cargo clippy for eslint, cargo test for jest
- Other: detect and adapt tooling from project config files
1---2name: scaffold-63description: 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.4---5
6# Scaffold
7
8Detect the current project's stack and apply toolkit architecture patterns, quality gates, and scaffolding.
9
10## When to Apply
11
12- Scaffolding a new vertical slice or feature module
13- Wiring or updating CI/CD pipelines
14- Adding or modifying Docker Compose services
15- Refactoring shared utilities or extracting common code
16- Setting up or running quality gates (lint, type-check, test, build)
17- Applying layered architecture (routes -> services -> repositories)
18- Reviewing code against SOLID and clean-code principles
19- Bootstrapping a new project with toolkit standards
20
21## Step 1: Detect Project Context
22
23Before making any changes, inspect the current repository:
24
251. Read `package.json`, `*.csproj`, `Cargo.toml`, `go.mod`, or equivalent to determine language and framework
262. Check for existing `CLAUDE.md`, `.claude/rules/`, `.claude/settings.json`
273. Scan for `docker-compose*.yml`, `Dockerfile`, `.github/workflows/`
284. Identify the package manager (`npm`, `yarn`, `pnpm`, `bun`)
295. Identify the test runner (`jest`, `vitest`, `pytest`, `go test`)
306. Check for monorepo indicators (`workspaces`, `turbo.json`, `nx.json`, `lerna.json`)
31
32Summarize findings before proceeding.
33
34## Step 2: Apply Architectural Patterns
35
36Based on project type, enforce these layered architecture rules:
37
38### Backend (Node.js / TypeScript)
39- **HTTP layer** (routes/controllers): thin adapters only, no business logic, no direct DB access
40- **Service layer**: business logic, orchestration, validation
41- **Repository layer**: data access, ORM encapsulation, query building
42- **Dependency direction**: routes -> services -> repositories (never reverse)
43
44### Frontend (React / TypeScript)
45- **Components**: presentational, no direct API calls in render
46- **Hooks**: data fetching, state management, side effects
47- **Services**: API client wrappers, data transformation
48- **State**: colocate state; lift only when shared
49
50### General
51- TypeScript strict mode, explicit return types on public APIs
52- ES modules everywhere (never CommonJS)
53- Named exports preferred over default exports
54- Error types over generic throws
55
56## Step 3: Quality Gate Checklist
57
58Run these checks in order (fast-fail):
59
60```
611. [ ] TypeScript / type-check passes (npx tsc --noEmit OR equivalent)
622. [ ] Linting passes (npm run lint OR equivalent)
633. [ ] Tests pass (npm test OR equivalent)
644. [ ] Build succeeds (npm run build OR equivalent)
655. [ ] No new lint warnings introduced
666. [ ] Coverage >= project threshold
67```
68
69If any check fails, stop and fix before proceeding.
70
71## Step 4: Verify and Report
72
73After completing changes:
74
751. Re-run the quality gate checklist
762. Summarize what was changed and why
773. List any remaining TODOs or follow-up items
784. If creating a PR, ensure title is concise (<70 chars) and body includes a test plan
79
80## Available Toolkit Skills
81
82The toolkit provides specialized skills for common tasks. Invoke them when relevant:
83
84- **quality-gate**: Full quality validation (tests + lint + types + build + audit)
85- **validate-build**: Build-only validation
86- **validate-typescript**: Type-checking only
87- **validate-lint**: Lint-only validation
88- **run-comprehensive-tests**: Test execution with coverage
89- **commit-with-validation**: Git commit with pre-flight checks
90- **create-pull-request**: PR creation with template
91- **audit-dependencies**: Security audit of dependencies
92- **infrastructure**: Deployment orchestration (DNS, VPS, Docker)
93
94## Adaptation Notes
95
96This skill adapts to any project. If the project uses:
97- **Python**: substitute `mypy` for tsc, `ruff`/`black` for eslint, `pytest` for jest
98- **Go**: substitute `go vet` for tsc, `golangci-lint` for eslint, `go test` for jest
99- **Rust**: substitute `cargo check` for tsc, `cargo clippy` for eslint, `cargo test` for jest
100- **Other**: detect and adapt tooling from project config files