Detects build system, runs build to identify errors, then iteratively fixes build and type errors with minimal safe changes, verifying each fix and summarizing results.
How this command is triggered — by the user, by Claude, or both
Slash command
/everything-claude-code:build-fixThe summary Claude sees in its command listing — used to decide when to auto-load this command
# 构建与修复 (Build and Fix) 通过最小化、安全的改动,逐步修复构建(Build)和类型(Type)错误。 ## 第 1 步:检测构建系统 (Detect Build System) 识别项目的构建工具并运行构建: | 标识物 | 构建命令 (Build Command) | |-----------|---------------| | 带有 `build` 脚本的 `package.json` | `npm run build` 或 `pnpm build` | | `tsconfig.json` (仅限 TypeScript) | `npx tsc --noEmit` | | `Cargo.toml` | `cargo build 2>&1` | | `pom.xml` | `mvn compile` | | `build.gradle` | `./gradlew compileJava` | | `go.mod` | `go build ./...` | | `pyproject.toml` | `python -m py_compile` 或 `mypy .` | ## 第 2 步:解析并分组错误 (Parse and Group Errors) 1. 运行构建命令并捕获标准错误输出(stderr) 2. 按文件路径对错误进行分组 3. ...
通过最小化、安全的改动,逐步修复构建(Build)和类型(Type)错误。
识别项目的构建工具并运行构建:
| 标识物 | 构建命令 (Build Command) |
|---|---|
带有 build 脚本的 package.json | npm run build 或 pnpm build |
tsconfig.json (仅限 TypeScript) | npx tsc --noEmit |
Cargo.toml | cargo build 2>&1 |
pom.xml | mvn compile |
build.gradle | ./gradlew compileJava |
go.mod | go build ./... |
pyproject.toml | python -m py_compile 或 mypy . |
对于每个错误:
在以下情况停止操作并询问用户:
npm install、cargo add 等)显示结果:
| 场景 | 行动 |
|---|---|
| 缺少模块/导入 (Missing module/import) | 检查包是否已安装;建议安装命令 |
| 类型不匹配 (Type mismatch) | 读取两个类型的定义;修复更窄的类型 |
| 循环依赖 (Circular dependency) | 通过导入图识别循环;建议提取公共部分 |
| 版本冲突 (Version conflict) | 检查 package.json / Cargo.toml 中的版本约束 |
| 构建工具配置错误 (Build tool misconfiguration) | 读取配置文件;与正常工作的默认配置进行对比 |
为了安全起见,请逐一修复错误。优先选择最小化的差异(diffs)而非重构。
npx claudepluginhub xu-xiang/everything-claude-code-zh/build-fixDetects the project's build system and incrementally fixes build and type errors one at a time with minimal safe changes.
/build-fixDetects the project's build system and incrementally fixes build and type errors one at a time with minimal safe changes.
/build-fixFixes TypeScript and build errors by iteratively running the build, parsing output, explaining and applying one fix at a time, and re-running to verify. Shows a summary of fixed, remaining, and new errors.
/build-fixAutomatically fixes build errors (compilation, type, unresolved dependencies) by analyzing output, applying targeted fixes, and retrying up to 3 times.
/fix-buildDiagnoses and fixes build, typecheck, dependency, and configuration errors using a multi-agent recovery team. Restores green build state with minimum diff.