智能编程助手
name: smart-coding-assistant
by davidme6 · published 2026-03-22
$ claw add gh:davidme6/davidme6-smart-coding-assistant---
name: smart-coding-assistant
description: 智能多模型编程助手,根据任务类型自动选择最优代码大模型。支持代码生成、审查、调试、重构、测试等场景。使用场景:编写代码、代码审查、Bug 调试、性能优化、技术栈迁移、单元测试生成等编程任务。
version: 1.0.0
---
# 智能编程助手
核心能力
🧠 智能模型路由
根据编程任务类型自动选择最优模型:
| 任务类型 | 推荐模型 | 理由 |
|---------|---------|------|
| 代码生成 | qwen-coder-plus / deepseek-coder | 代码生成能力强,上下文理解好 |
| 代码审查 | qwen-max / claude-sonnet | 逻辑严谨,善于发现问题 |
| Bug 调试 | qwen-plus / glm-4 | 推理能力强,定位准确 |
| 性能优化 | qwen-coder-plus | 熟悉算法优化和最佳实践 |
| 重构 | claude-sonnet / qwen-max | 代码结构理解深刻 |
| 单元测试 | qwen-coder / deepseek-coder | 测试用例生成质量高 |
| 技术问答 | qwen-plus / glm-4 | 知识覆盖面广 |
| 文档生成 | qwen-turbo / qwen-plus | 速度快,表达清晰 |
🔄 多模型协作模式
**复杂任务拆分流程:**
1. 任务分析 → qwen-plus(理解需求)
2. 架构设计 → qwen-max(系统设计)
3. 核心代码 → qwen-coder-plus(实现)
4. 代码审查 → claude-sonnet(质量检查)
5. 测试生成 → deepseek-coder(单元测试)
6. 文档编写 → qwen-turbo(快速生成)📊 模型能力画像
详见 [references/model-profiles.md](references/model-profiles.md)
快速开始
基础用法
# 单模型模式 - 直接指定
smart-coding-assistant --model qwen-coder-plus "生成一个快速排序"
# 自动路由模式 - 让技能选择最优模型
smart-coding-assistant "帮我优化这个算法的性能"
# 多模型协作模式 - 复杂任务
smart-coding-assistant --collab "重构这个模块并添加测试"编程任务分类
**代码生成类:**
**代码审查类:**
**调试类:**
**优化类:**
**测试类:**
工作流程
1. 任务接收与分析
# 使用 model_router.py 分析任务类型
python scripts/model_router.py --task "你的编程任务"2. 模型选择
根据任务类型查询 [references/model-profiles.md](references/model-profiles.md) 选择最优模型。
3. 代码生成/处理
调用选定的模型执行任务。
4. 质量检查(可选)
对于重要代码,使用第二模型进行审查。
5. 输出与反馈
输出结果并记录模型表现,更新能力画像。
模型选择策略
优先级规则
1. **代码密集型任务** → 优先选择代码专用模型(qwen-coder, deepseek-coder)
2. **逻辑推理任务** → 优先选择推理强的模型(qwen-max, glm-4)
3. **速度敏感任务** → 优先选择快速模型(qwen-turbo)
4. **质量敏感任务** → 优先选择高质量模型(claude-sonnet, qwen-max)
5. **复杂多步骤任务** → 启用多模型协作模式
成本优化
最佳实践
✅ 推荐做法
❌ 避免做法
配置说明
环境变量
# 模型 API 配置
export QWEN_API_KEY="your-key"
export DEEPSEEK_API_KEY="your-key"
export GLM_API_KEY="your-key"
# 路由策略
export CODING_MODEL_STRATEGY="auto" # auto | manual
export ENABLE_COLLAB="true" # 启用多模型协作配置文件
编辑 `~/.smart_coding_config.json`:
{
"default_model": "qwen-coder-plus",
"review_model": "claude-sonnet",
"enable_caching": true,
"max_collab_models": 3,
"cost_limit_per_task": 5.0
}故障排除
常见问题
**Q: 模型选择不准确?**
**Q: 多模型协作失败?**
**Q: 代码质量不佳?**
参考资料
更新日志
---
*最后更新:2026-03-18*
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...