lead-engineer-autofix

lead-engineer-autofix is an agent for Claude Code from ByeongminLee/nextjs-claude-code. It costs 0 tokens per session (360 once invoked), scanned A, original, MIT.

A troubleshooting guide for fixing TypeScript and build errors with small, targeted changes. TypeScript is a language tool that checks whether code uses the right values, files, and types before it runs.

In plain words
What is it for?
Use it when a project fails to build or type-check, especially for missing modules, invalid values, unsafe undefined data, and circular imports.
Why use it?
It helps collect related errors, find the underlying problem, and avoid making a chain of unnecessary edits. After three unsuccessful fix attempts, it reports the exact remaining error for review.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

Part of the nextjs-claude-code plugin — 9 skills, 49 agents shipped together

Good fit Use it when a project fails to build or type-check, especially for missing modules, invalid values, unsafe undefined data, and circular imports.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/byeongminlee/nextjs-claude-code/lead-engineer-autofix
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/ByeongminLee/nextjs-claude-code

Made for: Claude Code.

Or install nextjs-claude-code, the plugin that ships this one along with the rest of its 9 skills, 49 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lead-engineer-autofix

README.md
[![agentmods](https://agentmods.dev/badge/agents/byeongminlee/nextjs-claude-code/lead-engineer-autofix/github.svg)](https://agentmods.dev/agents/byeongminlee/nextjs-claude-code/lead-engineer-autofix)
Your own site
<a href="https://agentmods.dev/agents/byeongminlee/nextjs-claude-code/lead-engineer-autofix"><img src="https://agentmods.dev/badge/agents/byeongminlee/nextjs-claude-code/lead-engineer-autofix/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lead-engineer-autofix

Your own site · 80×15
<a href="https://agentmods.dev/agents/byeongminlee/nextjs-claude-code/lead-engineer-autofix"><img src="https://agentmods.dev/badge/agents/byeongminlee/nextjs-claude-code/lead-engineer-autofix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 360 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00360
Opus 5.5 $0.00000 $0.00144
Sonnet 5.5 $0.00000 $0.00072
Haiku 4.5 $0.00000 $0.00036

Measured 1mo ago against content hash 2c7a9c174fcc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lead-engineer-autofix scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

template/.claude/agents/lead-engineer-autofix.md · 41 lines

What it actually says

Lead Engineer — Auto-fix & Build Error Resolution

Read when a build or type error occurs.

Diagnostic Process

Step 1 — Collect all errors

npx tsc --noEmit 2>&1 | head -50

Collect the full error list before fixing anything.

Step 2 — Categorize errors

TypeScript error Minimal fix
Property does not exist on type Add type annotation or null check
Cannot find module Fix import path or add missing file
Type 'X' is not assignable to 'Y' Fix type annotation or assertion
Object is possibly 'undefined' Add optional chaining (?.) or null check
Argument of type mismatch Fix call site or update type signature
Circular dependency detected Reorder imports (minimum change only)

Step 3 — Apply minimal fixes in order of impact

Budget tracking:

Attempt 1/3: Analyze all errors -> targeted fix for root cause
Attempt 2/3: Different approach for remaining errors
Attempt 3/3: Last minimal change
Exceeded:   STOP. Report to user:
            [Escalation] Cannot resolve error after 3 attempts.
            Error: [exact error message]
            Please advise on how to proceed.

Hard rule: No refactoring, no architecture changes, no unrelated improvements. Fix only what prevents the build from passing.

Update PLAN.md after each attempt: Auto-fix Budget: Max retries: 3 / Used: N Update STATE.md with blocker info (e.g., Auto-fix: 2/3 used).

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 41 lines · 0 tokens per session scan A 2c7a9c174fcc

Subscribe to this mod's changes

lead-engineer-autofix is an agent published in the GitHub repository ByeongminLee/nextjs-claude-code (3 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 360 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

build-error-resolver

Build and TypeScript error resolution specialist. Use PROACTIVELY when build fails or type errors occur. Fixes build/type errors only with minimal diffs, no architectural edits. Focuses on getting the build green quickly.

galyarderlabs/galyarder-framework · 50 tokens

bun-migration-assistant

Use this agent when the user wants to migrate from Node.js/npm to Bun, convert Jest tests to Bun tests, or upgrade between Bun versions. Examples.

secondsky/claude-skills · 0 tokens

fec-typescript-reviewer

TypeScript/JavaScript special review: type safety, async correctness, Node/Web safety, idioms. Run the project typecheck/eslint first and then read the diff; it only reports and does not change the code directly. Suitable for .ts/.tsx/.js/.jsx changes or PR-level TS/JS reviews. Division of labor with…

bovinphang/frontend-craft · 101 tokens

typescript-reviewer

Read-only TypeScript/JavaScript review: type safety, async, ESM/CJS, runtime boundaries, security. Use when a diff touches .ts, .tsx, .js or .mjs code.

KevinZai/commander · 47 tokens

typescript-reviewer

TypeScript-specific code reviewer focusing on type safety, async patterns, and frontend best practices. Use after implementing TypeScript code to catch TypeScript-specific issues.

DmitriyYukhanov/claude-plugins · 35 tokens

ahj

Programming language designer for four decades. Lead architect of Turbo Pascal (Borland, 1980s), Delphi (Borland, 1990s), C# (Microsoft, 2000s), and TypeScript (Microsoft, 2012–). Pragmatic, prolific, and rare among language designers in shipping multiple successful languages used by millions of working developers.

punt-labs/prfaq · 77 tokens