一键导入
build-fix
Use when build fails, TypeScript errors appear, or compilation breaks. Minimal diff fixes only — no refactoring, no architecture changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when build fails, TypeScript errors appear, or compilation breaks. Minimal diff fixes only — no refactoring, no architecture changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when orchestrating parallel Claude Code instances across tmux panes with git worktree isolation — managing multiple concurrent development tasks visually
Use when production incident occurs, alerts fire, service degradation detected, or on-call escalation needed - guides systematic organizational response before technical fixes
Use when conducting manual PR reviews - provides structured checklist covering security, performance, maintainability, and code quality dimensions with anti-sycophancy principles
Run local CI checks and ship changes — create branch, commit, push, and PR. Optionally link to a GitHub issue. Use when changes are ready to ship.
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Architecture guide using Next.js App Router's Parallel Routes for Widget-Slot pattern. Separates static layouts from dynamic widgets to achieve separation of concerns, fault isolation, and plug-and-play development.
| name | build-fix |
| description | Use when build fails, TypeScript errors appear, or compilation breaks. Minimal diff fixes only — no refactoring, no architecture changes. |
| user-invocable | true |
| allowed-tools | Read, Edit, Grep, Glob, Bash |
Build errors block everything. Fix them fast, fix them small, fix nothing else.
Core principle: Fix ONLY what is broken. A build fix is not an opportunity to refactor, add features, or improve architecture. Touch the minimum lines required to restore a passing build.
Violating the letter of this process is violating the spirit of build fixing.
MINIMAL DIFF, NO ARCHITECTURE CHANGES — FIX WHAT'S BROKEN, NOTHING MORE
If your diff touches lines unrelated to the error, you are not build-fixing. You are refactoring. Stop.
No exceptions:
Use for ANY build/compilation failure:
tsc --noEmit failures)Use this ESPECIALLY when:
Do NOT use when:
systematic-debuggingrefactoringbrainstorming + TDDerror-analysisFirst, classify the build error:
| Class | Symptoms | Typical Minimal Fix |
|---|---|---|
| TypeScript Error | TS2345, TS2339, TS7006, TS2532 | Add type annotation, null check, or correct type |
| Import Error | Cannot find module, has no exported member | Fix path, add missing export, correct import name |
| Dependency Error | Version mismatch, missing peer dep, lockfile conflict | Align version, install missing package |
| Config Error | tsconfig.json invalid, env var missing, wrong target | Fix config value, add missing variable |
| Syntax Error | Unexpected token, missing bracket | Fix syntax at reported location |
You MUST complete each phase before proceeding to the next.
BEFORE attempting ANY fix:
Read the FULL error output
TS2345)Classify the error (see table above)
Count the errors
Find the MINIMUM change needed:
Check recent changes
git diff HEAD~1 # What changed?
git log --oneline -5 # Recent commits
Trace the error to its source
package.json versions.Identify the scope
Apply the SMALLEST possible change:
One fix at a time
Common minimal fixes
// TypeScript: TS2345 - Type mismatch
// BAD: Rewrite the function with new types
// GOOD: Add the correct type annotation or assertion
const value = data as ExpectedType;
// TypeScript: TS2532 - Possibly undefined
// BAD: Refactor to eliminate the possibility
// GOOD: Add null check or optional chaining
const name = user?.name ?? 'default';
// Import: Cannot find module
// BAD: Restructure the module system
// GOOD: Fix the import path
import { Thing } from './correct/path';
// Dependency: Missing peer dependency
// BAD: Upgrade the entire dependency tree
// GOOD: Install the specific missing package
// $ yarn add missing-package@^required.version
What NOT to do
Confirm the build passes:
Run the build command
# Run the same command that failed
yarn build # or npm run build
tsc --noEmit # TypeScript check
Run tests to ensure no regressions
yarn test # or npm test
Check the diff
git diff
If build still fails
If you catch yourself thinking:
| Thought | Reality |
|---|---|
| "While I'm fixing this, I'll also..." | Build fix. Nothing else. |
| "This function should really be..." | File an issue. Fix the build. |
| "The types are all wrong, let me redesign..." | Fix the ONE type error. Not all types. |
| "I need to add a new abstraction..." | No new abstractions in a build fix. |
| "Let me upgrade this dependency to latest..." | Only change the version if it fixes the error. |
| "This code is messy, let me clean up..." | Messy code that compiles > clean code in a broken build. |
| "The architecture caused this, so I should..." | Architecture changes are not build fixes. |
ALL of these mean: STOP. You are no longer build-fixing.
| Excuse | Reality |
|---|---|
| "The refactor prevents future build errors" | Future prevention is a separate task. Fix now. |
| "It's just a small improvement" | Small improvements compound into large diffs. |
| "The code is already open in my editor" | Being convenient doesn't make it a build fix. |
| "No one will review a 1-line PR" | 1-line PRs are the BEST PRs. Ship it. |
| "I need to understand the whole module" | You need to understand the error. Not the module. |
| "The dependency is outdated anyway" | Outdated but compiling > updated and broken. |
Before committing, verify your changes pass the scope guard:
For EACH changed line, ask:
"Would the build fail without this specific change?"
YES → Keep it
NO → Revert it
If any changed line fails the scope guard, you have scope creep. Remove it.
| Phase | Key Activity | Success Criteria |
|---|---|---|
| 1. Read | Read full error, classify, count | Know WHAT is broken |
| 2. Identify | Check changes, trace source | Know WHERE and WHY |
| 3. Fix | Smallest possible change | Minimal diff applied |
| 4. Verify | Build passes, tests pass, diff is clean | Build green, no extras |
error-analysis — For classifying and understanding error messages (Phase 1)systematic-debugging — For runtime bugs, not compile-time errorsverification-before-completion — For confirming the fix before claiming successrefactoring — For when you actually WANT to improve structure (not during build fix)