Skip to content
Back to skills

Examples

ASecurity

Rapidly fix build failures, type errors, and lint issues with minimal diffs. Apply when builds fail, TypeScript reports errors, or CI/CD pipelines break. Focuses on getting the build green fast.

  • 201 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 7, 2026
ai-agentstypescriptgobashnextjsrefactoringgitapici/cd

Works with

  • claude code
  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 21 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add ThamJiaHe/claude-code-handbook --skill examples --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Examples?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Examples
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/thamjiahe-examples-6979ada1/badge)](https://www.skillsdirectory.com/skills/thamjiahe-examples-6979ada1)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "Build Error Resolver"
description: "Rapidly fix build failures, type errors, and lint issues with minimal diffs. Apply when builds fail, TypeScript reports errors, or CI/CD pipelines break. Focuses on getting the build green fast."
allowed-tools: Read, Write, Edit, Bash, Grep, Glob
version: 2.1.0
compatibility: Claude Opus 4.6, Sonnet 4.6, Claude Code v2.1.x
updated: 2026-03-26
---

# Build Error Resolver

Get the build green fast with minimal, targeted fixes. No architectural changes — just fix what's broken.

## Overview

This skill is a **surgical fix tool**, not a refactoring tool. It:

1. Reads the exact error output
2. Identifies the root cause
3. Makes the minimum change to fix it
4. Verifies the fix works
5. Moves to the next error

## When to Use

- `pnpm build` fails with TypeScript errors
- `pnpm lint` reports violations
- CI/CD pipeline fails on type checking
- Import resolution errors after dependency changes
- Type mismatches after schema or API changes
- Build fails after merging branches

## Workflow

### Step 1: Get the Error

```bash
# TypeScript build
pnpm tsc --noEmit 2>&1 | head -50

# Next.js build
pnpm build 2>&1 | tail -50

# Lint
pnpm lint 2>&1 | head -30
```

### Step 2: Classify the Error

| Error Pattern | Category | Typical Fix |
|---------------|----------|-------------|
| `TS2304: Cannot find name 'X'` | Missing import | Add import statement |
| `TS2322: Type 'X' is not assignable to 'Y'` | Type mismatch | Cast, narrow, or fix type |
| `TS2339: Property 'X' does not exist on type 'Y'` | Missing property | Add to interface or fix access |
| `TS2345: Argument of type 'X' not assignable to 'Y'` | Wrong argument type | Fix the argument or parameter type |
| `TS7006: Parameter 'X' implicitly has 'any' type` | Missing type annotation | Add type annotation |
| `TS2307: Cannot find module 'X'` | Missing dependency | `pnpm add X` or fix import path |
| `TS18047: 'X' is possibly 'null'` | Null safety | Add null check or assertion |
| `Module not found` | Import path wrong | Fix relative/absolute path |
| `ESLint: 'X' is defined but never used` | Unused code | Remove or prefix with `_` |

### Step 3: Fix with Minimal Diff

**Rule:** Change the fewest lines possible. Don't refactor surrounding code.

```typescript
// ERROR: TS2322: Type 'string | undefined' is not assignable to type 'string'
// FIX: Add nullish coalescing (1 character change)
const name = user.name ?? '';

// ERROR: TS2339: Property 'email' does not exist on type 'User'
// FIX: Add to interface (1 line)
interface User {
  id: string;
  name: string;
  email: string; // Added
}

// ERROR: TS2345: Argument of type 'number' not assignable to 'string'
// FIX: Convert type (minimal change)
const id = String(numericId);
```

### Step 4: Verify

```bash
# Re-run the same command that failed
pnpm tsc --noEmit

# If clean, run tests to ensure no regressions
pnpm test -- --run
```

### Step 5: Repeat for Remaining Errors

Process errors **one at a time**, top to bottom. Earlier fixes often resolve later errors.

## Common Patterns

### After Prisma Schema Change

```bash
# Error: Types don't match after schema update
# Fix: Regenerate Prisma client
pnpm prisma generate
```

### After Dependency Update

```bash
# Error: Breaking API changes
# Fix: Check migration guide
pnpm outdated  # See what changed
# Then read the changelog for the updated package
```

### After Branch Merge

```bash
# Error: Conflicting types from merged code
# Fix: Run type check, resolve type conflicts
pnpm tsc --noEmit 2>&1 | grep "error TS"
# Fix each error, prioritizing shared types/interfaces first
```

### Circular Dependency

```bash
# Error: Cannot access 'X' before initialization
# Fix: Extract shared types to a separate file
# Move shared interfaces to types.ts, import from there
```

## What NOT to Do

- Don't refactor surrounding code while fixing builds
- Don't change architecture to fix a type error
- Don't add `// @ts-ignore` or `any` casts (fix the actual type)
- Don't update unrelated code in the same commit
- Don't add new features while fixing builds

## Sources

- [Everything Claude Code — Build Error Resolver](https://github.com/anthropics/everything-claude-code)
- [TypeScript Error Reference](https://www.typescriptlang.org/docs/handbook/2/narrowing.html)

Files in this skill

  • accessibility-ux.md9.9 KB
  • api-development-skill.md10.1 KB
  • api-security-hardening-skill.md6.9 KB
  • aws-cloud-infrastructure-skill.md9.8 KB
  • build-error-resolver-skill.md4.2 KB
  • code-review.md9.4 KB
  • cybersecurity-threat-modeling-skill.md8.2 KB
  • database-migrations.md10.1 KB
  • docker-containerization-skill.md3.7 KB
  • example-feedback-analyzer.md10.1 KB
  • git-workflow-skill.md9.6 KB
  • google-cloud-platform-skill.md12.3 KB
  • incident-response-skill.md5.1 KB
  • monitoring-logging-skill.md11.6 KB
  • neon-serverless-skill.md9.8 KB
  • nextauth-authentication-skill.md11.7 KB
  • nextjs-app-router-skill.md12.3 KB
  • owasp-security-audit-skill.md12 KB
  • penetration-testing-skill.md7.5 KB
  • performance-optimization-skill.md9.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.