build-fix
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBuild Fix Skill
构建修复Skill
Fix build and compilation errors quickly with minimal code changes. Get the build green without refactoring.
通过最少的代码修改快速修复构建与编译错误,无需重构即可让构建恢复正常。
When to Use
使用场景
This skill activates when:
- User says "fix the build", "build is broken"
- TypeScript compilation fails
- the build command or type checker reports errors
- User requests "minimal fixes" for errors
当出现以下情况时,该Skill会激活:
- 用户说“修复构建”、“构建失败了”
- TypeScript编译失败
- 构建命令或类型检查器报告错误
- 用户请求对错误进行“最小化修复”
What It Does
功能说明
Delegates to the agent (Sonnet model) to:
build-fixer-
Collect Errors
- Run the project's type check command (e.g., ,
tsc --noEmit,mypy,cargo check)go vet - Or run the project's build command to get build failures
- Categorize errors by type and severity
- Run the project's type check command (e.g.,
-
Fix Strategically
- Add type annotations where missing
- Add null checks where needed
- Fix import/export statements
- Resolve module resolution issues
- Fix linter errors blocking build
-
Minimal Diff Strategy
- NO refactoring of unrelated code
- NO architectural changes
- NO performance optimizations
- ONLY what's needed to make build pass
-
Verify
- Run the project's type check command after each fix
- Ensure no new errors introduced
- Stop when build passes
将任务委托给 Agent(基于Sonnet模型)来执行以下操作:
build-fixer-
收集错误信息
- 运行项目的类型检查命令(如、
tsc --noEmit、mypy、cargo check)go vet - 或运行项目的构建命令以获取构建失败信息
- 按错误类型和严重程度分类
- 运行项目的类型检查命令(如
-
策略性修复
- 为缺失的地方添加类型注解
- 在需要的地方添加空值检查
- 修复导入/导出语句
- 解决模块解析问题
- 修复阻碍构建的代码检查器错误
-
最小化差异策略
- 不重构无关代码
- 不进行架构变更
- 不做性能优化
- 仅进行让构建通过所需的修改
-
验证修复
- 每次修复后运行项目的类型检查命令
- 确保不会引入新错误
- 构建通过后停止操作
Agent Delegation
Agent委托
Task(
subagent_type="oh-my-claudecode:build-fixer",
model="sonnet",
prompt="BUILD FIX TASK
Fix all build and TypeScript errors with minimal changes.
Requirements:
- Run tsc/build to collect errors
- Fix errors one at a time
- Verify each fix doesn't introduce new errors
- NO refactoring, NO architectural changes
- Stop when build passes
Output: Build error resolution report with:
- List of errors fixed
- Lines changed per fix
- Final build status"
)Task(
subagent_type="oh-my-claudecode:build-fixer",
model="sonnet",
prompt="BUILD FIX TASK
Fix all build and TypeScript errors with minimal changes.
Requirements:
- Run tsc/build to collect errors
- Fix errors one at a time
- Verify each fix doesn't introduce new errors
- NO refactoring, NO architectural changes
- Stop when build passes
Output: Build error resolution report with:
- List of errors fixed
- Lines changed per fix
- Final build status"
)Stop Conditions
停止条件
The build-fixer agent stops when:
- Type check command exits with code 0
- Build command completes successfully
- No new errors introduced
当满足以下任一条件时,build-fixer Agent会停止操作:
- 类型检查命令退出码为0
- 构建命令执行成功
- 未引入新错误
Output Format
输出格式
BUILD FIX REPORT
================
Errors Fixed: 12
Files Modified: 8
Lines Changed: 47
Fixes Applied:
1. src/utils/validation.ts:15 - Added return type annotation
2. src/components/Header.tsx:42 - Added null check for props.user
3. src/api/client.ts:89 - Fixed import path for axios
...
Final Build Status: ✓ PASSING
Verification: [type check command] (exit code 0)BUILD FIX REPORT
================
Errors Fixed: 12
Files Modified: 8
Lines Changed: 47
Fixes Applied:
1. src/utils/validation.ts:15 - Added return type annotation
2. src/components/Header.tsx:42 - Added null check for props.user
3. src/api/client.ts:89 - Fixed import path for axios
...
Final Build Status: ✓ PASSING
Verification: [type check command] (exit code 0)Best Practices
最佳实践
- One fix at a time - Easier to verify and debug
- Minimal changes - Don't refactor while fixing
- Document why - Comment non-obvious fixes
- Test after - Ensure tests still pass
- 逐个修复错误 - 更易于验证和调试
- 最小化修改 - 修复时不要进行重构
- 记录原因 - 为非显而易见的修复添加注释
- 修复后测试 - 确保测试仍然通过
Use with Other Skills
与其他Skill结合使用
Combine with other skills for comprehensive fixing:
With Ultrawork:
/ultrawork fix all build errorsSpawns multiple build-fixer agents in parallel for different files.
With Ralph:
/ralph fix the buildKeeps trying until build passes, even if it takes multiple iterations.
With Pipeline:
/pipeline debug "build is failing"Uses: explore → architect → build-fixer workflow.
可与其他Skill结合以实现全面修复:
与Ultrawork结合:
/ultrawork fix all build errors并行生成多个build-fixer Agent处理不同文件。
与Ralph结合:
/ralph fix the build持续尝试直到构建通过,即使需要多次迭代。
与Pipeline结合:
/pipeline debug "build is failing"采用:探索 → 架构设计 → build-fixer的工作流程。