build

A project-building command that detects the programming language and runs the matching build or compile command, then reports problems.

In plain words
What is it for?
Use it to build a project, check compilation and type errors, review warnings, and receive suggested fixes.
Why use it?
It removes the need to remember different build commands for Python, JavaScript, Java, .NET, Go, Rust, and C++ projects.

Command

Part of the cc-best plugin — 3 skills, 44 commands, 8 agents, 20 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/xiaobei930/cc-best/build
Clone the repo
git clone --depth 1 https://github.com/xiaobei930/cc-best

Or install cc-best, the plugin that ships this one along with the rest of its 3 skills, 44 commands, 8 agents, 20 hooks.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 876 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.00876
Opus 5 $0.00009 $0.00438
Sonnet 5 $0.00003 $0.00175
Haiku 4.5 $0.00002 $0.00088

Measured 3d ago against content hash 7a3f3919c10f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

build scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/build.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/build - 构建项目

构建项目并检查错误。

自动检测

根据项目类型自动选择构建命令:

项目类型 检测文件 构建命令
Python pyproject.toml pip install -e .
Node.js package.json npm run build
TypeScript tsconfig.json tscnpm run build
Java Maven pom.xml mvn package
Java Gradle build.gradle gradle build
.NET *.csproj, *.sln dotnet build
Go go.mod go build ./...
Rust Cargo.toml cargo build
C++ CMakeLists.txt cmake --build build
C++ Makefile make

执行流程

1. 检测项目类型
   └─ 查找配置文件

2. 执行构建
   └─ 运行对应的构建命令

3. 检查结果
   └─ 编译错误
   └─ 类型错误
   └─ 警告信息

4. 报告问题
   └─ 列出所有错误
   └─ 提供修复建议

常用命令

Python

pip install -e .            # 开发模式安装
python -m py_compile *.py   # 语法检查
mypy src/                   # 类型检查

TypeScript/Node.js

npm run build               # 构建
tsc --noEmit                # 类型检查
npm run lint                # 代码检查

Java

mvn compile                 # 编译
mvn package                 # 打包
mvn package -DskipTests     # 跳过测试打包

.NET

dotnet build                # 构建
dotnet build --configuration Release  # Release 构建

C++

mkdir -p build && cd build
cmake ..
cmake --build .

错误处理

如果构建失败:

  1. 分析错误信息
  2. 定位问题文件和行号
  3. 调用 /cc-best:fix 修复构建错误
  4. 重新构建验证

Agent 集成

build-error-resolver - 构建错误分析

何时使用:

  • 错误数量较多(>5 个)
  • 错误根因不明确
  • 涉及跨文件的依赖问题

调用方式:

使用 Task 工具调用 build-error-resolver agent:
- subagent_type: "cc-best:build-error-resolver"
- prompt: "分析构建错误并提供最小化修复方案"

工作流:

/cc-best:build 执行构建
    ↓
  构建失败?
    ├─ 否 → 完成
    └─ 是 → 错误复杂?
              ├─ 否 → /cc-best:fix 快速修复
              └─ 是 → build-error-resolver agent
                        ↓
                     返回修复方案
                        ↓
              /cc-best:fix 执行修复

Read the full file on GitHub · 131 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 131 lines · 17 tokens per session scan A 7a3f3919c10f

Subscribe to this mod's changes

build is a command published in the GitHub repository xiaobei930/cc-best (50 stars, last pushed 2mo ago), licensed MIT. It adds 17 tokens to every session and 876 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.