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

  1. Generate Prisma client

    bash
    npx prisma generate
    
  2. Run production build

    bash
    npm run build 2>&1
    
  3. Analyze build output for:

    • TypeScript compilation errors
    • Module resolution failures
    • Missing exports/imports
    • Dynamic import issues
    • Server/client component mismatches
  4. Fix errors systematically in this order:

    • Missing dependencies
    • Import/export errors
    • Type errors
    • Component boundary issues
  5. Verify build succeeds

    bash
    npm 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: true but should still fix
  • Check tsconfig.json for 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?

Be as detailed as possible for better results