Agent skill
the-builder
Ensures the application builds successfully and fixes any build errors.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/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
// 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
// Error: useState in server component
// Fix: Add 'use client' directive
'use client'
import { useState } from 'react'
Dynamic Import Issues
// 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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?