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

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

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.

agentmods
npx agentmods add agents/byeongminlee/nextjs-claude-code/lead-engineer-autofix
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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00000 $0.00360
Opus 5 $0.00000 $0.00180
Sonnet 5 $0.00000 $0.00072
Haiku 4.5 $0.00000 $0.00036

Measured 3d ago against content hash 2c7a9c174fcc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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. 3d 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 5mo 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.