AGENT SKILL

build-fix

Diagnose and minimally fix build, type, or dependency failures in TypeScript/JavaScript, Rust, Go, C++, Java, or Kotlin. Do not refactor or redesign.

License 许可
MIT
所属仓库
xiaden/SkyScow
最近更新
2026-09-30
Stars
★ 1
Forks
0

01 前言 Front Matter

name
build-fix
description
Diagnose and minimally fix build, type, or dependency failures in TypeScript/JavaScript, Rust, Go, C++, Java, or Kotlin. Do not refactor or redesign.

02 资源文件 6

03 SKILL.md 正文

Build Error Resolution

Purpose: Diagnose and fix build errors with minimal, surgical changes. No refactoring. No architectural modifications. Get the build passing and move on.

When to Use This Skill

Trigger conditions:

  • npm run build / npx tsc --noEmit fails with TypeScript/JavaScript errors
  • cargo build / cargo check fails with Rust compilation errors
  • go build ./... fails with Go compilation errors
  • cmake --build build fails with C++ errors
  • ./mvnw compile / ./gradlew build fails with Java errors
  • ./gradlew build fails with Kotlin errors
  • Dependency resolution errors, module not found, import/export issues
  • Type errors blocking development

Do NOT use this skill for:

  • Code refactoring or style improvements
  • Architectural changes or redesign
  • Adding new features
  • Fixing failing tests (unless build failure is the root cause)
  • Security issues

Language Dispatch Table

Choose the reference file matching the file extension of the failing source:

File Extension(s) Language Reference
.ts, .tsx, .js, .jsx TypeScript / JavaScript [references/ts-js.md](file:///home/opencode/.config/opencode/skills/build-fix/references/ts-js.md)
.rs Rust [references/rust.md](file:///home/opencode/.config/opencode/skills/build-fix/references/rust.md)
.go Go [references/go.md](file:///home/opencode/.config/opencode/skills/build-fix/references/go.md)
.cpp, .hpp, .cc, .hh, .cxx, .hxx, .c, .h C++ / C [references/cpp.md](file:///home/opencode/.config/opencode/skills/build-fix/references/cpp.md)
.java Java [references/java.md](file:///home/opencode/.config/opencode/skills/build-fix/references/java.md)
.kt, .kts Kotlin [references/kotlin.md](file:///home/opencode/.config/opencode/skills/build-fix/references/kotlin.md)

Workflow

  1. Identify the language — determine which build tool and language are failing
  2. Load the matching reference — use the dispatch table above to find the correct reference file
  3. Collect and categorize errors — run diagnostic commands from the reference, capture all errors, and categorize by type (type errors, import/export, configuration, dependency). Prioritize: fix blocking build errors first, then type errors, then warnings.
  4. Apply minimal fixes — fix one error at a time, verify after each change. For each error: understand the root cause → find the minimal fix → verify it doesn't break other code → iterate.
  5. Verify the build passes — re-run the repository's build command after all fixes, then run the repository's test command for the changed surface when one exists; do not assume a test suite such as npm test exists (see /home/opencode/.config/opencode/instructions/validation-mandate.md)

Core Principles

  • Surgical fixes only — change only what's needed to fix the error
  • No refactoring — don't reorganize, rename, or restructure unrelated code
  • No architecture changes — don't redesign data models or control flow
  • Fix root cause — don't suppress symptoms with type assertions, any, @SuppressWarnings, #[allow(...)], or //nolint
  • Verify after each fix — re-run the build to confirm the error is resolved and no new errors were introduced
  • Stop after 3 failed attempts — if the same error persists, report and escalate

Output Format

After each fix — report the change:

[FIXED] src/components/MarketCard.tsx:45
Error: Parameter 'market' implicitly has an 'any' type
Fix: Added type annotation `market: Market`
Remaining errors: 3

Final summary — after all errors are resolved:

Build Status: PASSING / FAILING
Language: [TypeScript | Rust | Go | C++ | Java | Kotlin]
Errors Fixed: N
Files Modified: [list]
Remaining Issues: [list or "none"]

Validation Checklist

Before reporting completion, verify:

  • [ ] Build command runs cleanly with zero errors
  • [ ] No suppression comments added (@ts-ignore, @ts-expect-error, #[allow(...)], @SuppressWarnings, # noqa, //nolint) without explicit approval
  • [ ] Each fix is minimal — only lines directly related to the error were changed
  • [ ] No refactoring or restructuring of unrelated code
  • [ ] Targeted verification passes for the changed surface (run the repository's test command when one exists; if none exists, report that instead of assuming a suite)
  • [ ] Output format is followed for each fix reported

References

  • This skill's reference files:
    • [references/ts-js.md](file:///home/opencode/.config/opencode/skills/build-fix/references/ts-js.md) — TypeScript/JavaScript build errors, type errors, ESLint violations
    • [references/rust.md](file:///home/opencode/.config/opencode/skills/build-fix/references/rust.md) — Rust compilation, borrow-checker, and clippy errors
    • [references/go.md](file:///home/opencode/.config/opencode/skills/build-fix/references/go.md) — Go build errors, vet issues, and staticcheck violations
    • [references/cpp.md](file:///home/opencode/.config/opencode/skills/build-fix/references/cpp.md) — C++ compilation, CMake issues, and linker errors
    • [references/java.md](file:///home/opencode/.config/opencode/skills/build-fix/references/java.md) — Java Maven/Gradle build errors and dependency issues
    • [references/kotlin.md](file:///home/opencode/.config/opencode/skills/build-fix/references/kotlin.md) — Kotlin Gradle build errors and detekt violations
  • Related skills: support-debugger for root cause analysis when fixes keep failing

04 同仓库更多 Skills