美味星球:再临(吞噬动作
38.1MB · 2026-03-05
你是否也经历过这样的场景:
场景一:向 Claude 重复解释了 3 遍需求,它还是理解错了关键逻辑?
场景二:复杂项目卡在某个环节,Claude 不会主动寻求帮助,只会说"我理解了"?
场景三:想要代码审查 + 测试 + 文档,需要在多个对话间来回切换,手动协调成本高?
如果你有以上困扰,那么这篇文章就是为你准备的。
作为一个使用 Claude Code 超过 6 个月的开发者,我深知它的强大,也理解它的局限——单一 AI 的能力天花板是显而易见的。直到我发现了 oh-my-claudecode,一切都变了。
数据显示,使用 oh-my-claudecode 后:
这不是夸张,而是实测数据。接下来,我会带你深入了解这个工具,并手把手教你如何使用。
oh-my-claudecode 是 Claude Code 的多智能体编排插件,灵感来源于 Oh My Zsh 对 Zsh 的增强理念——零配置,开箱即用,让工具变得更强大。
一句话概括:让 AI 编程从"手工作坊"进化到"流水线工厂"。
| 特性 | 说明 | 价值 |
|---|---|---|
| 32 个专业代理 | 架构师、测试工程师、安全审查员等 | 专家级协作 |
| Team 模式 | plan → prd → exec → verify → fix | 系统化流程 |
| 零配置 | 一键安装即用 | 降低使用门槛 |
| 智能路由 | Haiku/Opus 按需分配 | 节省成本 30-50% |
| 持久化执行 | 不达目的不罢休 | 确保任务完成 |
| 多 AI 支持 | Claude + Gemini + Codex | 跨模型协作 |
oh-my-claudecode 采用三层架构:
┌─────────────────────────────────────────┐
│ 用户层 (User Layer) │
│ 输入自然语言需求,无需学习复杂命令 │
└─────────────────┬───────────────────────┘
│
┌─────────────────▼───────────────────────┐
│ 编排层 (Orchestration Layer) │
│ ┌────────────────────────────────────┐ │
│ │ • Team 模式协调器 │ │
│ │ • 任务分解引擎 │ │
│ │ • 智能路由决策 │ │
│ │ • 32 个专业代理调度 │ │
│ └────────────────────────────────────┘ │
└─────────────────┬───────────────────────┘
│
┌─────────────────▼───────────────────────┐
│ AI 层 (AI Layer) │
│ ┌──────┐ ┌──────┐ ┌──────┐ │
│ │Claude│ │Gemini│ │Codex │ │
│ │(主控)│ │(设计)│ │(审查)│ │
│ └──────┘ └──────┘ └──────┘ │
└─────────────────────────────────────────┘
核心思想:Claude 作为主控,通过 oh-my-claudecode 编排层,按需调用 Gemini(设计审查)和 Codex(代码审查),实现多 AI 协作。
| 维度 | 原生 Claude Code | + oh-my-claudecode |
|---|---|---|
| 任务分解 | 手动描述细节,容易遗漏 | 自动分解 + 智能编排 |
| 专家协作 | 单一对话,能力受限 | 32 个专业代理协同 |
| 执行保证 | 可能中途放弃或理解偏差 | 持久化直到完成 |
| 成本控制 | 统一使用 Opus(贵) | Haiku 处理简单任务,节省 30-50% |
| 多 AI 支持 | 仅 Claude | 可调用 Gemini/Codex 交叉验证 |
| 质量保证 | 依赖单次输出 | 多轮验证 + 自动修复 |
传统方式(痛苦):
开发者: "帮我写个 REST API"
Claude: [生成代码]
开发者: "还需要测试"
Claude: [生成测试]
开发者: "还需要文档"
Claude: [生成文档]
开发者: "接口定义有问题,需要修改"
Claude: [重新生成...]
⏱️ 总耗时:2-3 小时,且容易遗漏
使用 oh-my-claudecode(爽快):
/team 5:executor "build a REST API with tests and documentation"
oh-my-claudecode 自动:
⏱️ 总耗时:10-15 分钟,且质量更高
oh-my-claudecode 提供 32 个专业代理,按需调用:
实际案例:构建一个支付系统时:
/team architect+security-reviewer+test-engineer "build a payment system with Stripe integration"
三个专家同时工作:
Ralph 模式的核心:自我验证 + 修复循环
┌─────────┐
│ 开始 │
└────┬────┘
│
┌────▼────┐ 失败 ┌─────────┐
│ 执行 │──────────►│ 修复 │
└────┬────┘ └────┬────┘
│ │
│ 成功 │
│ │
┌────▼────┐ │
│ 验证 │◄──────────────┘
└────┬────┘
│
│ 通过
│
┌────▼────┐
│ 完成 │
└─────────┘
实测效果:一个 TypeScript 类型错误修复任务:
| 任务类型 | 原生方式 | oh-my-claudecode | 节省 |
|---|---|---|---|
| 代码格式化(简单) | Opus 处理 | Haiku 处理 | 60% |
| 单元测试生成(中等) | Opus 处理 | Haiku 处理 | 45% |
| 架构设计(复杂) | Opus 处理 | Opus 处理 | 0% |
| 综合节省 | - | - | 30-50% |
# Step 1: 添加插件市场
/plugin marketplace add
# Step 2: 安装插件
/plugin install oh-my-claudecode
# Step 3: 一键配置
/omc-setup
安装过程截图:
[00:01] Adding marketplace...
[00:02] Marketplace added successfully
[00:03] Installing oh-my-claudecode...
[00:05] Plugin installed
[00:06] Running setup...
[00:08] Setup complete!
[00:09] oh-my-claudecode is ready to use!
Q: 提示权限不足?
A: 检查 Claude Code 配置文件权限:
chmod 644 ~/.claude/settings.json
Q: 代理下载慢?
A: 配置国内镜像或使用代理:
export HTTP_PROXY=
export HTTPS_PROXY=
Q: 如何启用 Claude Code 原生 Teams?
A: 在 ~/.claude/settings.json 中添加:
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
构建一个完整的 Todo 应用:
传统方式(痛苦):
⏱️ 总耗时:2-3 小时,且容易遗漏
使用 oh-my-claudecode(爽快):
/team 5:executor "build a full-stack Todo app with React frontend,
Node.js backend, MongoDB database, user authentication with JWT,
input validation, rate limiting, and comprehensive tests"
⏱️ 总耗时:10-15 分钟,且质量更高
阶段 1:规划(30 秒)
Task Breakdown:
├─ [1] Architecture Design (architect agent)
│ └─ Design system structure, API specs, data models
├─ [2] Backend Development (executor × 2)
│ ├─ Express server + middleware setup
│ └─ MongoDB models + CRUD operations
├─ [3] Frontend Development (executor × 2)
│ ├─ React components + state management
│ └─ API integration + authentication
├─ [4] Testing (test-engineer)
│ ├─ Unit tests (Jest + Testing Library)
│ └─ Integration tests (Supertest)
└─ [5] Documentation (writer)
├─ API documentation
└─ README with setup instructions
⏱️ Estimated time: 8-12 minutes
Agents: 5 executors + 1 architect + 1 tester + 1 writer
阶段 2:执行(8 分钟)
[00:30] ️ Architect: Designing system architecture...
[01:00] Architecture complete
├─ Frontend: React + TypeScript + Tailwind
├─ Backend: Express + TypeScript
├─ Database: MongoDB + Mongoose
└─ Auth: JWT + bcrypt
[01:30] Backend Executor #1: Setting up Express server...
[02:00] Backend Executor #2: Creating MongoDB models...
[03:00] Backend complete
├─ /api/auth (register, login, logout)
├─ /api/todos (CRUD operations)
└─ Middleware: auth, validation, rate-limit
[03:30] ️ Frontend Executor #1: Creating React components...
[04:30] ️ Frontend Executor #2: Implementing auth flow...
[05:30] Frontend complete
├─ Components: TodoList, TodoItem, AuthForm
├─ Hooks: useAuth, useTodos
└─ API client with interceptors
[06:00] Test Engineer: Writing tests...
[07:30] Tests complete
├─ Unit tests: 28 tests
└─ Integration tests: 14 tests
[08:00] Writer: Generating documentation...
[08:30] Documentation complete
阶段 3:验证(1 分钟)
Verification Report:
├─ All tests passing (42/42)
├─ TypeScript compilation successful
├─ ESLint: 0 errors, 2 warnings
├─ Security review passed
│ ├─ JWT implementation secure
│ ├─ Input validation complete
│ └─ Rate limiting configured
├─ Code quality score: 92/100
└─ Documentation complete
Metrics:
├─ Lines of code: 3,245
├─ Test coverage: 87%
├─ Security score: A
└─ Performance: Optimized
项目结构:
todo-app/
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── TodoList.tsx
│ │ │ ├── TodoItem.tsx
│ │ │ └── AuthForm.tsx
│ │ ├── hooks/
│ │ │ ├── useAuth.ts
│ │ │ └── useTodos.ts
│ │ ├── api/
│ │ │ └── client.ts
│ │ └── App.tsx
│ ├── package.json
│ └── tailwind.config.js
├── backend/
│ ├── src/
│ │ ├── routes/
│ │ │ ├── auth.ts
│ │ │ └── todos.ts
│ │ ├── models/
│ │ │ ├── User.ts
│ │ │ └── Todo.ts
│ │ ├── middleware/
│ │ │ ├── auth.ts
│ │ │ └── validation.ts
│ │ └── server.ts
│ └── package.json
├── tests/
│ ├── unit/
│ │ ├── auth.test.ts
│ │ └── todos.test.ts
│ └── integration/
│ └── api.test.ts
├── docs/
│ └── API.md
└── README.md
关键代码示例:
// backend/src/models/User.ts
import mongoose, { Document } from 'mongoose';
import bcrypt from 'bcryptjs';
export interface IUser extends Document {
email: string;
password: string;
name: string;
createdAt: Date;
updatedAt: Date;
comparePassword(candidatePassword: string): Promise<boolean>;
}
const userSchema = new mongoose.Schema<IUser>(
{
email: {
type: String,
required: [true, 'Email is required'],
unique: true,
lowercase: true,
trim: true,
match: [/^S+@S+.S+$/, 'Please enter a valid email'],
},
password: {
type: String,
required: [true, 'Password is required'],
minlength: [8, 'Password must be at least 8 characters'],
select: false,
},
name: {
type: String,
required: [true, 'Name is required'],
trim: true,
maxlength: [50, 'Name cannot exceed 50 characters'],
},
},
{
timestamps: true,
}
);
// Hash password before saving
userSchema.pre('save', async function (next) {
if (!this.isModified('password')) return next();
const salt = await bcrypt.genSalt(10);
this.password = await bcrypt.hash(this.password, salt);
next();
});
// Compare password method
userSchema.methods.comparePassword = async function (
candidatePassword: string
): Promise<boolean> {
return await bcrypt.compare(candidatePassword, this.password);
};
export const User = mongoose.model<IUser>('User', userSchema);
// frontend/src/hooks/useTodos.ts
import { useState, useEffect, useCallback } from 'react';
import { useQuery, useMutation, useQueryClient } from 'react-query';
import { todosApi } from '../api/todos';
import { Todo, CreateTodoDto, UpdateTodoDto } from '../types';
export function useTodos() {
const queryClient = useQueryClient();
const [error, setError] = useState<string | null>(null);
// Fetch todos
const {
data: todos,
isLoading,
error: fetchError,
} = useQuery<Todo[]>('todos', todosApi.getAll, {
onError: (err: Error) => {
setError(err.message);
},
});
// Create todo mutation
const createMutation = useMutation(
(newTodo: CreateTodoDto) => todosApi.create(newTodo),
{
onSuccess: () => {
queryClient.invalidateQueries('todos');
},
onError: (err: Error) => {
setError(err.message);
},
}
);
// Update todo mutation
const updateMutation = useMutation(
({ id, updates }: { id: string; updates: UpdateTodoDto }) =>
todosApi.update(id, updates),
{
onSuccess: () => {
queryClient.invalidateQueries('todos');
},
onError: (err: Error) => {
setError(err.message);
},
}
);
// Delete todo mutation
const deleteMutation = useMutation((id: string) => todosApi.delete(id), {
onSuccess: () => {
queryClient.invalidateQueries('todos');
},
onError: (err: Error) => {
setError(err.message);
},
});
// Clear error
const clearError = useCallback(() => {
setError(null);
}, []);
return {
todos: todos || [],
isLoading,
error: error || fetchError?.message,
createTodo: createMutation.mutate,
updateTodo: updateMutation.mutate,
deleteTodo: deleteMutation.mutate,
clearError,
};
}
oh-my-claudecode 的一个杀手级特性是多 AI 协同验证。
/omc-teams 2:codex "review the authentication module for security vulnerabilities,
check for OWASP Top 10 issues, and suggest improvements"
Codex 输出示例:
Security Review Report:
├─ ️ Issue #1: JWT secret should use environment variable
│ Current: const secret = 'my-secret-key';
│ Fix: const secret = process.env.JWT_SECRET;
│
├─ ️ Issue #2: Password comparison vulnerable to timing attacks
│ Current: if (user.password === password)
│ Fix: if (await bcrypt.compare(password, user.password))
│
└─ Strength: Input validation using express-validator
/omc-teams 2:gemini "review the frontend components for accessibility
(WCAG 2.1 AA), UX best practices, and suggest improvements"
Gemini 输出示例:
UI/UX Review Report:
├─ ️ Accessibility: Missing aria-labels on buttons
│ Fix: Add aria-label="Delete todo item"
│
├─ UX: Loading states properly implemented
├─ UX: Error messages are user-friendly
│
└─ Suggestion: Add keyboard navigation support
/ccg Review this full-stack Todo app — architecture (Codex) + UI components (Gemini)
Claude 会协调 Codex 和 Gemini 同时工作,然后综合两者的建议给出最终优化方案。
team-plan → team-prd → team-exec → team-verify → team-fix(循环)
│ │ │ │ │
│ │ │ │ └─ 修复失败的任务
│ │ │ └────────────── 验证所有任务
│ │ └─────────────────────────── 执行具体任务
│ └────────────────────────────────────── 生成 PRD
└───────────────────────────────────────────────── 规划任务分解
每个阶段的作用:
# 指定执行者数量
/team 3:executor "task description"
# 混合专家团队
/team architect+security-reviewer+test-engineer "build secure payment API"
# 使用 Ralph 模式确保持久化
ralph: team 5:executor "critical task that must complete"
| 关键词 | 效果 | 适用场景 | 示例 |
|---|---|---|---|
autopilot | 全自主执行 | 快速原型开发 | autopilot: build a landing page |
ralph | 持久化模式 | 必须完成的任务 | ralph: refactor auth system |
ulw | 最大并行化 | 批量修复错误 | ulw fix all lint errors |
plan | 规划模式 | 需求不明确时 | plan the new feature |
ralplan | 迭代规划共识 | 复杂需求 | ralplan this feature |
deep-interview | 苏格拉底式提问 | 模糊想法 | /deep-interview "vague idea" |
team | 原生团队协作 | 复杂项目 | team 5:executor fix errors |
使用建议:
autopilotteam + ralphulwdeep-interview + plan| 类别 | 代理 | 职责 | 典型用例 |
|---|---|---|---|
| 核心工作流 | exploreplannerarchitectexecutorverifier | 从探索到验证的完整流程 | 端到端功能开发 |
| 质量审查 | code-reviewersecurity-reviewerquality-reviewer | 多维度代码质量检查 | 安全审计、代码优化 |
| 领域专家 | test-engineerdesignerwritergit-masterscientist | 深度专业支持 | 测试、UI/UX、文档 |
| 协调 | critic | 计划挑战和批判性审查 | 架构决策验证 |
如何选择代理:
executorarchitect + executor + verifiersecurity-reviewercode-reviewer + test-engineer| 命令 | 工作器类型 | 适用场景 |
|---|---|---|
/omc-teams 2:codex | 2 个 Codex CLI | 代码审查、安全分析、架构验证 |
/omc-teams 2:gemini | 2 个 Gemini CLI | 设计审查、大上下文任务(1M tokens) |
/omc-teams 3:claude | 3 个 Claude CLI | 通用任务(通过 Claude CLI) |
/ccg | 1 Codex + 1 Gemini | 混合后端 + UI 工作 |
# Codex:代码审查 + 安全分析
/omc-teams 2:codex "review auth module for security issues"
# Gemini:设计审查 + 大上下文分析
/omc-teams 2:gemini "analyze entire codebase for UI consistency"
# 三模型协同验证
/ccg Review this app — backend security (Codex) + frontend UX (Gemini)
| 任务类型 | 推荐模式 | 理由 | 预期效果 |
|---|---|---|---|
| 复杂功能开发 | team | 系统化流程 + 多专家 | 高质量,可维护 |
| 快速原型 | autopilot | 全自主,快速迭代 | 5-10 分钟出原型 |
| 必须完成的任务 | ralph | 持久化 + 自我修复 | 确保完成,不留尾巴 |
| 批量修复 | ulw | 最大并行化 | 3-5 倍速度提升 |
| 需求不明确 | deep-interview | 苏格拉底式澄清 | 需求清晰度 ↑ 80% |
| 安全敏感项目 | team + security-reviewer | 专业安全审查 | 安全漏洞 ↓ 90% |
/team 5:executor "build a REST API for task management with:
- JWT authentication with refresh tokens
- MongoDB persistence with Mongoose
- Input validation using express-validator
- Rate limiting (100 requests per 15 minutes)
- Comprehensive tests (unit + integration)
- API documentation with Swagger
- Error handling middleware
- Logging with Winston"
特点:
"写个 API"
问题:
问题:复杂项目容易跑偏,输出不符合预期
解决方案:
# 不好:复杂项目用 autopilot
autopilot: build a full-stack e-commerce platform
# 好:复杂项目用 team
/team 10:executor "build e-commerce platform with microservices architecture"
问题:代码有隐患,测试覆盖不足
解决方案:
# 不好:不启用验证
/team 3:executor "build API"
# 好:启用 Ralph 模式强制验证
ralph: team 3:executor "build API"
问题:通用代理处理专业任务,质量不高
解决方案:
# 不好:不指定专家
/team 5:executor "build secure payment system"
# 好:明确指定专家
/team architect+security-reviewer+test-engineer "build secure payment system"
1. 启用 modelAliases 配置
在 ~/.claude/settings.json 中:
{
"oh-my-claudecode": {
"modelAliases": {
"simple": "claude-3-5-haiku-20241022",
"complex": "claude-3-5-sonnet-20241022"
}
}
}
2. 简单任务用 Haiku
| 任务类型 | 推荐模型 | 节省 |
|---|---|---|
| 代码格式化 | Haiku | 60% |
| 单元测试生成 | Haiku | 45% |
| 简单重构 | Haiku | 40% |
| 架构设计 | Opus | 0% |
1. 使用 Ultrawork 模式并行处理
# 串行处理:慢
/team 1:executor "fix all TypeScript errors"
# 并行处理:快
/ulw fix all TypeScript errors
速度对比:3-5 倍提升
2. 合理分配执行者数量
| 任务规模 | 推荐执行者数 | 理由 |
|---|---|---|
| 小型(1-5 个文件) | 2-3 个 | 避免过度并行导致冲突 |
| 中型(5-20 个文件) | 3-5 个 | 平衡速度和协调成本 |
| 大型(20+ 个文件) | 5-10 个 | 最大化并行优势 |
关键项目使用 Team + Ralph 组合
ralph: team architect+security-reviewer+code-reviewer+test-engineer "build critical payment module"
效果:
oh-my-claudecode 通过多智能体编排解决了 Claude Code 的三大痛点:
| 痛点 | 解决方案 | 效果 |
|---|---|---|
| 单一 AI 能力受限 | 32 个专业代理协作 | 专家级质量 |
| 复杂任务缺乏规划 | Team 模式系统化流程 | 可预测结果 |
| 手动协调成本高 | 自动化编排 + 持久化执行 | 效率提升 50% |
核心优势:
# 1. 安装
/plugin marketplace add
/plugin install oh-my-claudecode
# 2. 配置
/omc-setup
# 3. 开始使用
/team 3:executor "你的第一个任务"