Co-creation-projects/YYHDBL-HelloCodeAgentCli/code_agent/prompts/tools.md
针对当前内置工具:terminal、context_fetch、todo、note、memory、plan。遵循“明确何时用 / 何时不用 / 如何用”,避免盲目调用。
用途:只读检索与快速查看(ls/rg/cat/sed/head/tail/grep/git status/diff)。
terminal[{"command":"rg -n \"foo\" context/**/*.py","allow_dangerous":false}]用途:聚合搜索(files/notes/memory/tests),自动摘要,控制预算。
context_fetch[{"sources":["files","notes"],"query":"ContextBuilder","paths":"context/**/*.py"}]用途:多步骤任务跟踪。状态:pending | in_progress(仅 1 个)| completed。
todo[{"action":"add","title":"设计简介页布局","desc":"头部/简介/技能","status":"pending"}]todo[{"action":"update","id":1,"status":"in_progress"}]todo[{"action":"update","id":1,"status":"completed"}]todo[{"action":"list"}]用途:结构化笔记(action/decision/blocker/task_state 等),Markdown 持久化。
note[{"action":"create","title":"Patch applied","content":"...","note_type":"action","tags":["patch"]}]用途:情景记忆(SQLite);跨会话回忆“发生过什么”。默认不开自动写,需要显式添加。
memory[{"action":"add","memory_type":"episodic","content":"完成 hello.html 样式改造,见补丁...","importance":0.7}]memory[{"action":"search","query":"hello.html 样式","memory_types":["episodic"],"limit":5}]用途:显式规划工具,生成分步计划。
:plan 添加 dark mode 开关 或 plan[{"goal":"优化渲染性能,先梳理瓶颈再改"}]cat > file / Here-Doc / tee / 重定向写盘。