跳转到内容

Day 5 · Coding Agent 工具集

本章目标:实现 Coding Agent 的 5 个核心工具。 产出:my-agent/coding_tools/ — read / write / edit / list_dir / bash。

你将学到

  • Coding Agent 的 5 阶段工作流(理解 → 定位 → 修改 → 验证 → 汇报)
  • 工具设计哲学:唯一性约束、安全闸门、友好报错
  • 每个工具的实现要点

内容结构

内容讲义Demo
24Coding Agent 工作流24-coding-agent-workflowdemo_24_five_stages.py
25工具设计哲学25-tool-designdemo_25_design_philosophy.py
端到端演示demo_26_end_to_end.py

运行 Demo

bash
cd 05-coding-agent-tools/lab
python demo_24_five_stages.py
python demo_25_design_philosophy.py
python demo_26_end_to_end.py

今日产出

补全 my-agent/coding_tools/ 下的 5 个工具文件,让测试通过:

bash
cd my-agent
python tests/test_coding_tools.py

配套练习

exercises/05-coding-agent-tools/ — 3 道代码填空题

Released under the MIT License.