Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add shipshitdev/library --skill "fullstack-workspace-init"
Install specific skill from multi-skill repository
# Description
Scaffold a production-ready full-stack monorepo with working MVP features, tests, and CI/CD. Generates complete CRUD functionality, Clerk authentication, and quality gates that run immediately with `bun dev`.
# SKILL.md
name: fullstack-workspace-init
description: Scaffold a production-ready full-stack monorepo with working MVP features, tests, and CI/CD. Generates complete CRUD functionality, Clerk authentication, and quality gates that run immediately with bun dev.
Full Stack Workspace Init
Create a production-ready monorepo with working MVP features:
- Frontend: NextJS 16 + React 19 + TypeScript + Tailwind + @agenticindiedev/ui
- Backend: NestJS 11 + MongoDB + Clerk Auth + Swagger
- Mobile: React Native + Expo (optional)
- Quality: Vitest (80% coverage) + Biome + Husky + GitHub Actions CI/CD
- Package Manager: bun
What Makes This Different
This skill generates working applications, not empty scaffolds:
- Complete CRUD operations for your main entities
- Clerk authentication configured and working
- Tests with 80% coverage threshold
- GitHub Actions CI/CD pipeline
- Runs immediately with
bun dev
Workflow
Phase 1: PRD Brief Intake
Ask the user for a 1-2 paragraph product description, then extract and confirm:
I'll help you build [Project Name]. Based on your description, I understand:
**Entities:**
- [Entity1]: [fields]
- [Entity2]: [fields]
**Features:**
- [Feature 1]
- [Feature 2]
**Routes:**
- / - Home/Dashboard
- /[entity] - List view
- /[entity]/[id] - Detail view
**API Endpoints:**
- GET/POST /api/[entity]
- GET/PATCH/DELETE /api/[entity]/:id
Is this correct? Any adjustments?
Phase 2: Auth Setup (Always Included)
Generate Clerk authentication:
Backend:
auth/guards/clerk-auth.guard.ts- Token verification guardauth/decorators/current-user.decorator.ts- User extraction decorator
Frontend:
providers/clerk-provider.tsx- ClerkProvider wrapperapp/sign-in/[[...sign-in]]/page.tsx- Sign in pageapp/sign-up/[[...sign-up]]/page.tsx- Sign up pagemiddleware.ts- Protected route middleware
Environment:
.env.examplewith all required variables
Phase 3: Entity Generation
For each extracted entity, generate complete CRUD with tests:
Backend (NestJS):
api/apps/api/src/collections/{entity}/
βββ {entity}.module.ts
βββ {entity}.controller.ts # Full CRUD + Swagger + ClerkAuthGuard
βββ {entity}.controller.spec.ts # Controller unit tests
βββ {entity}.service.ts # Business logic
βββ {entity}.service.spec.ts # Service unit tests
βββ schemas/
β βββ {entity}.schema.ts # Mongoose schema with userId
βββ dto/
βββ create-{entity}.dto.ts # class-validator decorators
βββ update-{entity}.dto.ts # PartialType of create
api/apps/api/test/
βββ {entity}.e2e-spec.ts # E2E tests with supertest
βββ setup.ts # Test setup with MongoDB Memory Server
Frontend (NextJS):
frontend/apps/dashboard/
βββ app/{entity}/
β βββ page.tsx # List view (protected)
β βββ [id]/page.tsx # Detail view (protected)
βββ src/test/
β βββ setup.ts # Test setup with Clerk mocks
βββ vitest.config.ts # Frontend test config (jsdom)
frontend/packages/components/
βββ {entity}-list.tsx
βββ {entity}-list.spec.tsx # Component tests
βββ {entity}-form.tsx
βββ {entity}-form.spec.tsx # Component tests
βββ {entity}-item.tsx
frontend/packages/hooks/
βββ use-{entities}.ts # React hook for state management
βββ use-{entities}.spec.ts # Hook tests
frontend/packages/services/
βββ {entity}.service.ts # API client with auth headers
Phase 4: Quality Setup
Vitest Configuration:
vitest.config.tsin each project- 80% coverage threshold for lines, functions, branches
@vitest/coverage-v8provider
GitHub Actions:
.github/workflows/ci.yml- Runs on push to main and PRs
- Steps: install β lint β test β build
Husky Hooks:
- Pre-commit:
lint-staged(Biome check) - Pre-push:
bun run typecheck
Biome:
biome.jsonin each project- 100 character line width
- Double quotes, semicolons
Phase 5: Verification
Run quality gate and report results:
β
Generation complete!
Quality Report:
- bun install: β succeeded
- bun run lint: β 0 errors
- bun run test: β 24 tests passed
- Coverage: 82% (threshold: 80%)
Ready to run:
cd [project]
bun dev
Usage
# Create workspace with PRD-style prompt
python3 ~/.claude/skills/fullstack-workspace-init/scripts/init-workspace.py \
--root ~/www/myproject \
--name "My Project" \
--brief "A task management app where users can create tasks with titles and due dates, organize them into projects, and mark them complete."
# Or interactive mode (prompts for brief)
python3 ~/.claude/skills/fullstack-workspace-init/scripts/init-workspace.py \
--root ~/www/myproject \
--name "My Project" \
--interactive
Generated Structure
myproject/
βββ .github/
β βββ workflows/
β βββ ci.yml # GitHub Actions CI/CD
βββ .husky/
β βββ pre-commit # Lint staged files
β βββ pre-push # Type check
βββ .agent/ # AI documentation
βββ package.json # Workspace root
βββ biome.json # Root linting config
β
βββ api/ # NestJS backend
β βββ apps/api/src/
β β βββ main.ts
β β βββ app.module.ts
β β βββ auth/
β β β βββ guards/clerk-auth.guard.ts
β β β βββ guards/clerk-auth.guard.spec.ts # Auth guard tests
β β β βββ decorators/current-user.decorator.ts
β β βββ collections/
β β βββ {entity}/
β β βββ {entity}.controller.ts
β β βββ {entity}.controller.spec.ts # Controller tests
β β βββ {entity}.service.ts
β β βββ {entity}.service.spec.ts # Service tests
β βββ apps/api/test/
β β βββ {entity}.e2e-spec.ts # E2E tests
β β βββ setup.ts # E2E test setup
β βββ vitest.config.ts
β βββ package.json
β βββ .env.example
β
βββ frontend/ # NextJS apps
β βββ apps/dashboard/
β β βββ app/
β β β βββ layout.tsx
β β β βββ page.tsx
β β β βββ sign-in/[[...sign-in]]/page.tsx
β β β βββ sign-up/[[...sign-up]]/page.tsx
β β β βββ {entity}/ # Generated per entity
β β βββ src/test/
β β β βββ setup.ts # Test setup with Clerk mocks
β β βββ middleware.ts # Clerk route protection
β β βββ providers/
β β βββ clerk-provider.tsx
β βββ packages/
β β βββ components/
β β β βββ {entity}-list.tsx
β β β βββ {entity}-list.spec.tsx # Component tests
β β β βββ {entity}-form.tsx
β β β βββ {entity}-form.spec.tsx # Component tests
β β βββ hooks/
β β β βββ use-{entities}.ts
β β β βββ use-{entities}.spec.ts # Hook tests
β β βββ services/ # API clients
β β βββ interfaces/
β βββ vitest.config.ts # Frontend test config (jsdom)
β βββ package.json
β
βββ mobile/ # React Native + Expo (optional)
β βββ ...
β
βββ packages/ # Shared packages
βββ packages/
βββ common/
β βββ interfaces/
β βββ enums/
βββ helpers/
Key Patterns
Backend Controller Pattern
@ApiTags('tasks')
@ApiBearerAuth()
@UseGuards(ClerkAuthGuard)
@Controller('tasks')
export class TasksController {
constructor(private readonly tasksService: TasksService) {}
@Post()
@ApiOperation({ summary: 'Create a new task' })
create(
@Body() createTaskDto: CreateTaskDto,
@CurrentUser() user: { userId: string },
) {
return this.tasksService.create(createTaskDto, user.userId);
}
// ... full CRUD
}
Backend Service Pattern
@Injectable()
export class TasksService {
constructor(
@InjectModel(Task.name) private taskModel: Model<TaskDocument>,
) {}
async create(createTaskDto: CreateTaskDto, userId: string): Promise<Task> {
const task = new this.taskModel({ ...createTaskDto, userId });
return task.save();
}
// ... full CRUD with userId filtering
}
Frontend Component Pattern
'use client';
import { useEffect, useState } from 'react';
import { TaskService } from '@services/task.service';
import { Task } from '@interfaces/task.interface';
export function TaskList() {
const [tasks, setTasks] = useState<Task[]>([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
const controller = new AbortController();
TaskService.getAll({ signal: controller.signal })
.then(setTasks)
.finally(() => setLoading(false));
return () => controller.abort();
}, []);
// ... render
}
Additional Scripts
# Add a new entity to existing project
python3 ~/.claude/skills/fullstack-workspace-init/scripts/add-entity.py \
--root ~/www/myproject \
--name "comment" \
--fields "content:string,taskId:string"
# Add a new frontend app
python3 ~/.claude/skills/fullstack-workspace-init/scripts/add-frontend-app.py \
--root ~/www/myproject/frontend \
--name admin
Development Commands
After scaffolding:
cd myproject
# Install all dependencies
bun install
# Start all services (backend + frontend)
bun dev
# Or start individually
bun run dev:api # Backend on :3001
bun run dev:frontend # Frontend on :3000
bun run dev:mobile # Mobile via Expo
# Quality commands
bun run lint # Check code style
bun run test # Run tests
bun run test:coverage # Run with coverage
bun run typecheck # Type checking
Environment Variables
Create .env files based on .env.example:
API (.env):
PORT=3001
MONGODB_URI=mongodb://localhost:27017/myproject
CLERK_SECRET_KEY=sk_test_...
Frontend (.env.local):
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
NEXT_PUBLIC_API_URL=http://localhost:3001
References
references/templates/- Code generation templatesservice.spec.template.ts- NestJS service unit test templatecontroller.spec.template.ts- NestJS controller unit test templatee2e.spec.template.ts- E2E test template with supertest + MongoDB Memory Servercomponent.spec.template.tsx- React component test templatehook.spec.template.ts- React hook test templatetest-setup.template.ts- Frontend test setup with Clerk mocksreferences/vitest.config.ts- Backend Vitest configuration (80% coverage)references/vitest.config.frontend.ts- Frontend Vitest configuration (jsdom)references/github-actions/ci.yml- CI/CD workflowreferences/architecture-guide.md- Architectural decisionsreferences/coding-standards.md- Coding rules
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.