Tool Authoring Playbook【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skillsUse this playbook when adding or modifying a repository tool underagent/scripts/. Keep tools small, deterministic, and easy to validate.GoalBuild a tool that:solves one recurring problem cleanlyhas a narrow interfaceis easy to test from the command lineis summarized inagent/scripts/tools_summary.md1. Confirm the tool belongs inagent/scripts/A repository tool is a good fit when it:performs repeated estimation or analysisprovides deterministic helper logicis useful across multiple kernel tasksshould be runnable without loading a huge amount of prose contextIf the work is only explanatory, prefer documentation instead of a new tool.Before modifying a tool, check:agent/references/examples/tool-catalog.md2. Define the exact job and interfaceBefore coding, write down:what the tool computes or checksrequired inputsoptional inputsoutput formatwhether it is analysis-only or mutates filesPrefer a narrow API over a giant kitchen-sink script.3. Keep the implementation deterministicRepository preference:tools should be small and directavoid hidden environment requirements unless truly neededavoid unnecessary side effectsIf a script must make a repository decision repeatedly, encode that decision clearly instead of forcing the agent to rediscover it in prose.4. Keep command-line usage obviousA good tool should be runnable quickly from the repository root. If it has multiple modes, keep the mode names explicit. If output is tabular or numeric, make the result readable enough for direct inspection.5. Validate with a representative sampleActually run the tool. Do not assume the script is correct because it is short. If there are several modes, test a representative subset.For estimators or analyzers, validate:a normal casean edge or failure caseat least one case that exercises an option or mode switch6. Update the tool summaryWhen adding or editing files underagent/scripts/, update:agent/scripts/tools_summary.mdUpdate the summary itself. Do not turn it into a change log.7. Refresh owner docs when doneAfter the tool work is complete and there are no scripts left to run, refresh the owner docs that actually describe the changed area:agent/scripts/tools_summary.mdagent/references/code-paths.mdif the implementation-path lookup changedagent/references/repo-map.mdordoc/11_architecture_for_contributors.mdif the repository structure or ownership changed8. Keep Python style compactRepository formatting preference:keep signatures and call sites compactdo not force one argument per line unless readability really needs itkeep the script easy to scanFallback referencesRead these if more detail is needed:agent/scripts/tools_summary.mdagent/references/code-paths.mddoc/11_architecture_for_contributors.mdREADME.md【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skills创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考