본문으로 건너뛰기
cccskills
무료GitHub에 공개

mk:build-fix

Build error triage: detect language, load fix patterns, auto-retry. Use for 'build failed', 'fix compilation', 'type error'. Chains into mk:verify. NOT for runtime errors (see mk:fix); NOT for architectural debugging (see mk:investigate).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(4)

  • SKILL.md6.2 KB
  • references/general-errors.md4.2 KB
  • references/python-errors.md3.5 KB
  • references/typescript-errors.md4.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Build Fix — Universal Build Error Resolver

Detects language from error output, loads the appropriate reference, classifies the error by fixability, applies the fix, and chains into mk:verify to confirm the build is green.

When to Use

  • Build command fails (npm run build, tsc, go build, python -m build, cargo build)
  • Type check errors (TypeScript TS\d{4}, mypy)
  • Compilation errors in any language
  • Triggers: "build failed", "fix build", "compilation error", "type error"

Phase Anchor

Phase: 3 (Build GREEN) Handoff: If mk:verify passes → proceed to Phase 4 (Review). If 3 attempts exhausted → escalate to user.

Process

Step 1: Capture Error Output

Run the failing build command and capture full output. If error output was passed as input, use that directly.

Step 2: Detect Language

Match error patterns in order (first match wins):

PatternLanguageReference
error TS\d{4}:TypeScriptreferences/typescript-errors.md
SyntaxError: or ModuleNotFoundError: or IndentationError:Pythonreferences/python-errors.md
cannot find package or undefined: or syntax error near (Go)Goreferences/general-errors.md
error[E\d{4}] (Rust)Rustreferences/general-errors.md
Any other patternUnknownreferences/general-errors.md

Load the matched reference file before proceeding to Step 3.

Step 3: Classify Error Fixability

After loading the reference, classify the error:

ClassDescriptionAction
auto-fixableSyntax errors, missing imports, simple type mismatchesApply fix immediately
suggest-with-confidenceWrong argument types, missing interface propertiesPropose fix, apply after brief explanation
report-onlyRuntime errors, architectural issues, circular dependenciesDescribe the problem and root cause; do not auto-fix

Auto-fixable examples: TS1005 Expected semicolon, TS2307 Cannot find module (missing import) Suggest-with-confidence examples: TS2322 type mismatch, TS2345 argument type mismatch Report-only examples: Circular dependency, architectural type mismatch requiring refactor

Step 4: Apply Fix

For auto-fixable and suggest-with-confidence:

  • Apply the minimal change that resolves the error
  • Do not refactor beyond what the error requires (YAGNI)
  • Follow security-rules.md — do NOT use any type as a fix

For report-only:

  • Describe what needs to change and why
  • Stop — do not modify files
  • Return the diagnosis to the developer

Step 5: Verify Fix

Run mk:verify (or the project's build command directly if verify not available).

Step 6: Iterate (Max 3 Attempts)

If the build still fails after applying a fix:

  • Attempt 2: re-classify with updated error output, try different approach
  • Attempt 3: re-classify one final time with a different approach

After 3 failed attempts, escalate to user with:

  • All 3 error outputs
  • All 3 attempted fixes and why each failed
  • Suspected root cause
  • Suggested next steps (architectural review, dependency update, etc.)

Attempt Counter

Track attempts in the session. Reset counter when switching to a different error. Per tdd-rules.md Rule 4: max 3 self-healing attempts, then escalate.

Reference Files

  • references/typescript-errors.md — TS error codes with fix patterns
  • references/python-errors.md — Python exception types with fix patterns
  • references/general-errors.md — Framework-agnostic build error patterns

Security Constraint

NEVER use TypeScript any as a fix for type errors. Always use unknown + type guards or fix the actual type mismatch. See security-rules.md — any type is a blocked pattern.

Gotchas

  • Stale .tsbuildinfo hides real errors on warm incremental builds — tsc --incremental skips files it thinks are unchanged; a corrupt or out-of-date .tsbuildinfo causes TS to report 0 errors while the actual output is broken; delete .tsbuildinfo and rerun tsc --noEmit before declaring the build clean.
  • Platform-specific native binaries fail silently after npm ci on a different OS — packages like esbuild, sharp, @swc/core ship OS-specific binaries; a node_modules/ copied from macOS to Linux (or via Docker volume mount) silently uses wrong binaries until a cryptic "invalid ELF header" or "exec format error" appears at runtime; always run npm ci fresh inside the container, never share node_modules across platforms.
  • Peer dependency warnings mask fatal version mismatches — npm install prints peer dep warnings as non-fatal by default; a eslint@8 peer warning can hide the real problem that @typescript-eslint/parser@6 requires eslint@8 but 9 is installed, causing TypeError: eslint.linter is not a constructor at runtime; always resolve peer warnings before treating the build as clean.
  • Different error output on cold vs warm cache means fixing the wrong error — a first clean build often surfaces errors that incremental builds skip; fix errors only after a full clean build (rm -rf dist .tsbuildinfo && tsc) to ensure you're seeing the complete error set, not just the delta from last run.
  • Circular dependencies aren't caught by tsc but break bundlers at runtime — TypeScript compiles circular imports without error; Vite/webpack may emit a broken bundle where one module resolves to {} because the other hadn't initialized yet; run madge --circular src/ to detect cycles as part of build triage.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use this skill to generate well-branded interfaces and assets for MeowKit (AI Agent Toolkit for Claude Code), either for production or throwaway prototypes/mocks/etc. Contains essential design guidelines, colors, type, fonts, assets, and UI kit components for prototyping.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

mk-advise

무료

Turn a raw idea into ONE honest recommendation: interview one question at a time until confirmed, then give a verdict with trade-offs and a checklist. Not for options or debate.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

Browser automation CLI for agents: navigate, click/fill, screenshot, extract data, test apps, Electron/Slack, cloud browsers. NOT for the user's real Chrome profile/cookies (mk:chrome-profile).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

Detects the right agent and complexity tier at Phase 0 orient; runs first in every workflow. NOT for runtime agent routing inside a single skill.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

Angular v20+ patterns: components, signals, services, forms, routing, HTTP, testing, SSR. Auto-activates on .ts files in Angular projects (angular.json detected).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

Design and review durable REST, GraphQL, RPC, or event API contracts: shape, compatibility, pagination, error semantics. Discovers existing consumers first. Not implementation, schema, or release.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ngocsangyem/MeowKit152026년 7월 28일 업데이트

ngocsangyem의 스킬 모두 보기

이 스킬의 문제 신고