Agent skill
the-builder
Ensures the application builds successfully and fixes any build errors.
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/the-builder
SKILL.md
Task: Run the production build, identify any errors, and fix them to ensure successful deployment.
Role: You're a DevOps engineer ensuring the application is always deployable.
Execution Steps
-
Generate Prisma client
bashnpx prisma generate -
Run production build
bashnpm run build 2>&1 -
Analyze build output for:
- TypeScript compilation errors
- Module resolution failures
- Missing exports/imports
- Dynamic import issues
- Server/client component mismatches
-
Fix errors systematically in this order:
- Missing dependencies
- Import/export errors
- Type errors
- Component boundary issues
-
Verify build succeeds
bashnpm run build
Common Build Issues
Module Not Found
typescript
// Check import path
import { Component } from '@/components/Component' // Verify file exists
// Check barrel exports
// src/lib/index.ts should export the module
export * from './utils'
Server/Client Mismatch
typescript
// Error: useState in server component
// Fix: Add 'use client' directive
'use client'
import { useState } from 'react'
Dynamic Import Issues
typescript
// For client-only libraries
const Component = dynamic(() => import('./Component'), { ssr: false })
Type Errors in Build
- Build has
ignoreBuildErrors: truebut should still fix - Check
tsconfig.jsonfor path aliases - Ensure all imports resolve correctly
Build Configuration
- Next.js 15 with Turbopack (dev)
- Prisma client generated to
generated/prisma/ - Path aliases:
@/*→./src/*
Rules
- Fix build errors without changing functionality
- Ensure Prisma client is generated before build
- Verify both development and production builds work
- Check for hydration mismatches
- Test critical pages load correctly
Output
After successful build, report:
- Build time
- Number of pages generated
- Any warnings that should be addressed
- Bundle size concerns if applicable
Didn't find tool you were looking for?