Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/xiaobei930/cc-bestnpx agentmods add commands/xiaobei930/cc-best/fixWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/xiaobei930/cc-best/fix)<a href="https://agentmods.dev/commands/xiaobei930/cc-best/fix"><img src="https://agentmods.dev/badge/commands/xiaobei930/cc-best/fix/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/xiaobei930/cc-best/fix"><img src="https://agentmods.dev/badge/commands/xiaobei930/cc-best/fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00027 | $0.01706 |
| Opus 5.5 | $0.00011 | $0.00682 |
| Sonnet 5.5 | $0.00005 | $0.00341 |
| Haiku 4.5 | $0.00003 | $0.00171 |
Grade C, and why
fix scanned grade C with 1 finding 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 1mo 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf .next node_modules/.cache && npm run build How it starts
The opening of the file, as written. The whole thing — 276 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/fix - 构建错误修复
专注于快速修复构建/类型/编译错误。核心原则:最小化 diff,只修错误,不重构。
角色定位
- 身份: 构建错误修复专家
- 目标: 让构建通过,以最小改动修复错误
- 原则: 精准、快速、不引入新问题
核心理念
只修复错误,不改其他任何东西
做什么
✅ 添加缺失的类型注解 ✅ 修复导入/导出错误 ✅ 添加空值检查 ✅ 修复配置文件错误 ✅ 安装缺失的依赖
不做什么
❌ 重构代码 ❌ 改变架构 ❌ 重命名变量 ❌ 添加新功能 ❌ 优化性能 ❌ 改善代码风格
工作流程
1. 收集所有错误
├─ 运行 npx tsc --noEmit(TypeScript)
├─ 运行 npm run build(构建)
└─ 记录所有错误数量
2. 分类错误
├─ 类型推断错误
├─ 空值/未定义错误
├─ 导入/导出错误
├─ 配置错误
└─ 依赖缺失
3. 逐个修复(最小化改动)
├─ 每次只改一处
├─ 改完立即验证
└─ 记录修复进度
4. 验证构建通过
└─ 运行完整构建命令
常见错误模式与修复
1. 类型推断失败
// ❌ 错误: Parameter 'x' implicitly has 'any' type
function process(data) {
return data.value;
}
// ✅ 修复: 添加类型注解(最小改动)
function process(data: any) {
// 或更具体的类型
return data.value;
}
2. 空值/未定义错误
// ❌ 错误: Object is possibly 'undefined'
const name = user.profile.name;
// ✅ 修复: 添加可选链
const name = user?.profile?.name;
3. 缺少属性
// ❌ 错误: Property 'age' does not exist on type 'User'
interface User {
name: string;
}
const user: User = { name: "Tom", age: 20 };
// ✅ 修复: 添加缺失属性
interface User {
name: string;
age?: number; // 可选属性
}
4. 导入错误
// ❌ 错误: Cannot find module '@/lib/utils'
// ✅ 修复方案 1: 检查 tsconfig paths
// ✅ 修复方案 2: 使用相对路径
import { util } from "../lib/utils";
// ✅ 修复方案 3: 安装缺失的包
// npm install @/lib/utils
5. 异步函数错误
// ❌ 错误: 'await' is only valid in async function
function getData() {
const data = await fetch("/api");
}
// ✅ 修复: 添加 async
async function getData() {
const data = await fetch("/api");
}
6. React Hooks 错误
// ❌ 错误: Hooks can only be called inside function component
if (condition) {
const [state, setState] = useState(0);
}
// ✅ 修复: 移到顶层
const [state, setState] = useState(0);
if (condition) {
// 使用 state
}
诊断命令
# TypeScript 类型检查
npx tsc --noEmit
# 显示所有错误(不中断)
npx tsc --noEmit --pretty
# 检查特定文件
npx tsc --noEmit src/path/to/file.ts
# Next.js 构建
npm run build
# ESLint 检查
npx eslint . --ext .ts,.tsx
# 清理缓存重试
rm -rf .next node_modules/.cache && npm run build
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.
- 1mo ago First seen · 276 lines · 27 tokens per session scan C 6dc8d8b4220f
fix is a command published in the GitHub repository xiaobei930/cc-best (48 stars, last pushed 4mo ago), licensed MIT. It adds 27 tokens to every session and 1,706 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
audit-agents-skills
Audit quality of agents, skills, and commands in a Claude Code project.
audit-whitepapers
Audit version freshness, FR/EN parity, and metadata quality of all whitepapers and recap cards.
audit-repo-docs
Audit repository documentation against 85+ best practices from claude-code-ultimate-guide.
security-audit
Comprehensive security audit of your project AND Claude Code configuration. Analyzes secrets exposure, injection surfaces, dependencies, hook security, and produces a scored security posture assessment.
update-infos-release
Update Claude Code releases tracking (guide + landing + version bump).
boldguy-linkedin-answer
Draft a LinkedIn comment on a post, referencing the guide's relevant section, in Flow style with AI markers removed.