mit einem Klick
build-deployment
Verify production builds pass all quality checks, analyze bundle impact, and ensure readiness for Vercel deployment with zero errors
Menü
Verify production builds pass all quality checks, analyze bundle impact, and ensure readiness for Vercel deployment with zero errors
| name | Build & Deployment |
| description | Verify production builds pass all quality checks, analyze bundle impact, and ensure readiness for Vercel deployment with zero errors |
This skill ensures your Next.js application builds successfully with zero errors and is ready for production deployment to Vercel. It validates TypeScript, runs linters, executes tests, analyzes bundle size, and provides pre-deployment verification.
Claude will automatically invoke this skill when:
Before deployment, this skill verifies:
✅ Pre-Deployment Verification
├── TypeScript Type Safety
│ ├── No TypeScript compilation errors
│ ├── Strict mode enabled
│ └── Full type coverage
├── Code Quality
│ ├── ESLint passes with zero errors
│ ├── No warnings in strict mode
│ └── Code style consistent
├── Test Suite
│ ├── All tests passing
│ ├── No test failures
│ └── Coverage maintained
├── Build Process
│ ├── Production build succeeds
│ ├── No build warnings
│ ├── All assets optimized
│ └── Output size acceptable
├── Bundle Analysis
│ ├── Bundle size tracked
│ ├── No bloated dependencies
│ ├── Code splitting effective
│ └── Performance metrics
└── Production Readiness
├── Environment variables configured
├── API endpoints correct
├── Analytics integrated
└── Error tracking ready
# Check for TypeScript errors
npx tsc --noEmit
What it checks:
strict: true)any types (unless explicitly allowed)Common TypeScript Errors:
error TS2304: Cannot find name 'X'
error TS2339: Property 'X' does not exist on type 'Y'
error TS2345: Argument of type 'X' is not assignable to parameter of type 'Y'
Fix Command:
npm run ts-fix # Automatically fix fixable TS errors
# Run ESLint
npm run lint
What it checks:
Common ESLint Issues:
warning 'variable' is assigned a value but never used no-unused-vars
warning Unexpected console statement no-console
error 'image' is missing the required 'alt' prop jsx-a11y/alt-text
Fix Command:
npm run lint -- --fix # Auto-fix linting issues
# Run all tests in CI mode (no watch)
npm run test:ci
What it checks:
Expected Output:
PASS src/components/ui/__tests__/Button.test.tsx
PASS src/components/examples/__tests__/AdaptiveInterfacesExample.test.tsx
...
Test Suites: 24 passed, 24 total
Tests: 481 passed, 481 total
Coverage: 48.28% statements, 36.19% branches
If Tests Fail:
npm run test:watch # Debug in watch mode
npm test -- --no-coverage # Faster feedback
# Create optimized production build
npm run build:production
What happens:
Expected Output:
▲ Next.js 15.4.6
○ Checking validity of types
✓ Types checked
✓ Compiled client and server successfully
✓ Exported 24 pages
✓ Generated robots.txt
...
Route (pages) Size Files
┌ ○ / XX KB XX KB
├ ○ /patterns XX KB XX KB
├ ○ /patterns/[slug] XX KB XX KB
...
○ (Static) prerendered as static HTML + JSON
If Build Fails:
npm run build:local # Analyze build issues locally
npm run build:analyze # Detailed analysis
# Analyze bundle with detailed report
npm run build:analyze
Output includes:
Expected Bundle Sizes:
Total JavaScript: ~150-200 KB (gzipped)
Main bundle: ~60-80 KB
Patterns page: ~40-60 KB
Individual pattern: ~30-40 KB
If Bundle Too Large:
# Identify large dependencies
npm ls --depth=0
# Check package sizes
npx webpack-bundle-analyzer
# Implement code splitting
# See Build Optimization section below
Check that production environment is configured:
# Verify .env variables exist
cat .env.example # See what's required
# Check for required vars in .env
NEXT_PUBLIC_API_URL=https://api.example.com
NEXT_PUBLIC_ANALYTICS_ID=...
DATABASE_URL=...
Required Variables:
NEXT_PUBLIC_API_URL - API endpointNEXT_PUBLIC_ANALYTICS_ID - Vercel AnalyticsDATABASE_URL - Prisma databaseRESEND_API_KEY - Newsletter serviceNODE_ENV=production - Production mode✅ TypeScript: Zero errors (npx tsc --noEmit)
✅ ESLint: Zero errors (npm run lint)
✅ Tests: All passing (npm run test:ci)
✅ Build: Successful (npm run build:production)
✅ Bundle: Acceptable size (~150-200 KB gzipped)
✅ Environment: All variables configured
✅ Git: No uncommitted changes (git status)
✅ Branch: On main branch
✅ Remote: Pushed to GitHub (git push)
Run all checks at once:
npm run fix-all
This automatically:
--fixOutput:
=== TypeScript Errors ===
0 errors found ✅
=== ESLint Errors ===
Fixed 2 warnings
=== Test Status ===
All 481 tests passing ✅
=== Build Ready ===
✅ Ready for deployment!
For large pages, implement route-based code splitting:
// components/examples/HeavyComponent.tsx - lazy load
import dynamic from 'next/dynamic'
const HeavyDemoComponent = dynamic(
() => import('@/components/examples/HeavyExample'),
{ loading: () => <Skeleton /> }
)
Images are automatically optimized:
# Optimize all images before commit
npm run optimize-images
# Convert GIFs to WebM/MP4
npm run convert-gifs
# Check for unused packages
npm prune
# Check for vulnerabilities
npm audit
# Fix security issues
npm audit fix
Track bundle size over time:
# Generate build metrics
npm run build:analyze
# Track in build-metrics.json
cat build-metrics.json
# Vercel auto-deploys on push to main
git push origin main
# Monitor deployment
# https://vercel.com/dashboard
Vercel Configuration:
npm run buildnpm startBefore pushing to main:
After deployment:
# Check live site health
curl https://aiuxdesign.guide/api/health
# Monitor analytics
# https://vercel.com/analytics
# Check error tracking
# https://sentry.io (if configured)
# Monitor performance
# https://vercel.com/speed-insights
npm run ts-fix # Auto-fix
# or manually review and fix
npx tsc --noEmit
npm run lint -- --fix # Auto-fix most issues
# Review remaining manual fixes
npm run test:watch # Debug in watch mode
# Fix failing tests
# Verify snapshots are intentional
npm test -- -u # Update snapshots if needed
npm run build:analyze # Identify large files
# Remove unused dependencies
# Implement code splitting
# Optimize imports
# Type checking
npx tsc --noEmit # Check types
npm run ts-fix # Fix types
# Linting
npm run lint # Check lint
npm run lint -- --fix # Fix lint
# Testing
npm test # Run tests
npm run test:ci # CI mode
npm run test:coverage # With coverage
# Building
npm run build # Dev build analysis
npm run build:production # Prod build
npm run build:analyze # Bundle analysis
npm run build:local # Local optimization
# Image optimization
npm run optimize-images # Optimize all
npm run convert-gifs # Convert GIFs
# All-in-one
npm run fix-all # TypeScript + ESLint + Tests
After deployment, monitor:
Core Web Vitals:
Vercel Speed Insights:
Build Metrics:
# View historical build metrics
cat build-metrics.json
Deployment is successful when:
✅ Build Status: Green (all checks pass) ✅ Test Coverage: Maintained at 48%+ (targeting 70%) ✅ Bundle Size: ~150-200 KB gzipped ✅ Performance: LCP < 2.5s, FID < 100ms, CLS < 0.1 ✅ Errors: Zero TypeScript, ESLint, and test failures ✅ Analytics: Tracking page views and web vitals ✅ Uptime: 99.9% availability
Goal: Maintain high code quality standards with automated pre-deployment verification, ensuring every production release is stable, performant, and error-free.
Show AI design patterns project health, track completion status, coordinate agent activities, and suggest intelligent next priority actions
Project-specific entrypoint for analyzing Google Search Console exports for aiuxdesign.guide. Auto-triggers on SEO-review phrases. Standardizes the CSV diff analysis, flags known patterns (CTR problems, near-page-1 opportunities, regressions, breakouts), cross-references LHCI perf issues, and points Claude at CLAUDE.md's SEO troubleshooting section before interpretation. Use when the user mentions "check GSC", "SEO review", "GSC export", "search console data", "any SEO improvements", "GSC performance", or pastes a path to a GSC export folder.
Project-specific performance investigation entrypoint for aiuxdesign.guide. Auto-triggers on perf-related phrases and points Claude at CLAUDE.md's documented incidents and the LHCI workflow before delegating to generic perf skills. Use when the user mentions "site is slow", "performance regression", "LCP", "CLS", "INP", "Core Web Vitals", "lighthouse score", "clarity numbers", or "speed insights".
Auto-scaffold Designer Guides learning paths by analyzing existing guides (Claude Code, Cursor) and generating new guides for other tools
Guide through updating AI design patterns with comprehensive checklist completion, code examples, images, documentation, and interactive demos
Enforce code standards, validate against project patterns, review code quality, and maintain consistent TypeScript strict mode compliance across all components