多智能体模式
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
一)开启:`./claude/setting.json`
{"env":{ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS":"1"}}
二)自定义模型必须要用 litellm 中转进行伪装,伪装成 `claude-opus-4-6`
三)什么情况下用多智能体:
最大的原则:多智能体任务可并行!3个场景最适合:
1. 最直接的场景就是旧代码库的迁移,库版本整体升级,以及原有代码的大规模的重构。
2. 可根据语言类型做明确分工的,比如分成前端、后端、数据库等,每个智能体写一个语言。用语言做职责划分。
3. 苦力型任务为主,而非创造性任务
总之做之前大脑可以完整推演整个流程,否则就不要用多 Agents,基本上100%失控
什么情况下不用多智能体:
1. 需要大量推理的新功能开发,特别是需要完整的回归测试的功能。
2. 单一技术栈通常不需要多智能体,除非多个智能体的边界完全通过文件夹分开。
三)提示词:
```
创建一个智能体团队来重构src里的js代码,目的是让代码结构更清晰,可读性更强,注意不要更改原有代码逻辑,只做可维护性的重构,把公用方法、参数、常量尽量抽象出来放在一处(或者文件顶部位置),并添加中文注释。智能体团队里的每个成员负责一个部分,比如成员A负责core,成员B负责entities,成员C负责workers,成员D负责world,services、ui和utils里的重构优先级可以暂时放缓。请注意,Team Lead 不参与代码修改,只指挥其他智能体修改代码,并且review其他智能体成员的改代码的正确性,确保不要改变原有代码逻辑。
```
四)授权:最好使用全授权模式:`claude --dangerously-skip-permissions`
五)状态监控:
如果是`In-process`模式,最好`shift+↑↓`调出智能体列表状态,可以看到忙闲状态。有时候team leader会空闲状态,警示灯是灰的,实际上其他智能体在干活,会误以为中断了,其实不需要人为干扰。
六)token 消耗太快,必须要把套餐开到顶,否则一定会限速
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by checking whether .claude/setting.json and the src JavaScript tree are present, then identify the repository's existing documentation entry point. Done means the multi-agent setup, use cases, prompt, authorization, monitoring, and token caveat are documented there without changing source behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100