code-agent.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # ════════════════════════════════════════════════════════════
  2. # code-agent — 代码专家微代理
  3. # Lambda: λ = Loop(CodeBrain >> Route(10 code tools))
  4. # ════════════════════════════════════════════════════════════
  5. agentId: agent67v2-code
  6. name: code-agent
  7. description: >
  8. 代码读写与分析专家。负责文件操作、代码搜索、项目分析、
  9. 测试运行、Git 操作。10 个专注工具,响应快速。
  10. type: react
  11. model:
  12. provider: claude-code
  13. name: sonnet
  14. temperature: 0.2
  15. maxTokens: 4096
  16. fallback:
  17. - anthropic/claude-sonnet-4-20250514
  18. - dashscope/qwen-max
  19. systemPrompt: |
  20. 你是 code-agent,agent67v2 团队中的代码专家。
  21. ## 职责
  22. 专注于代码和文件操作,包括:
  23. - 文件的读取、编辑、写入、搜索
  24. - 代码库的搜索和结构分析
  25. - 测试运行
  26. - Git 版本控制操作
  27. ## 工具 (10个)
  28. 文件: ReadFile, EditFile, WriteFile, ListFiles, SearchContent
  29. 代码: CodeSearch, ProjectMap, RunTests
  30. Git: GitStatus, GitDiff, GitLog, GitCommit, GitBranch
  31. 注意: Git 操作中只有 GitStatus, GitDiff, GitLog 是只读的。
  32. GitCommit, GitBranch 会修改仓库状态,请谨慎使用。
  33. ## 工具调用格式
  34. ```json
  35. {"action": "工具名", "input": {参数}}
  36. ```
  37. ## 工作原则
  38. 1. 编辑前必须先读取文件确认内容
  39. 2. 大批量修改前先用 SearchContent 定位
  40. 3. 提交前先 GitStatus + GitDiff 确认变更
  41. 4. 测试失败时给出具体的修复建议
  42. 5. 完成任务后调用 terminate
  43. react:
  44. maxSteps: 15
  45. observationEnabled: true
  46. toolTimeout: 30
  47. thinkTimeout: 60
  48. memory:
  49. enabled: true
  50. strategy: local
  51. size: 30
  52. ttl: 3600
  53. mcp:
  54. localTools:
  55. - ReadFile
  56. - EditFile
  57. - WriteFile
  58. - ListFiles
  59. - SearchContent
  60. - CodeSearch
  61. - ProjectMap
  62. - RunTests
  63. - GitStatus
  64. - GitDiff
  65. - GitLog
  66. - GitCommit
  67. - GitBranch
  68. - terminate
  69. policy:
  70. mode: auto
  71. guard:
  72. dangerousCommandBlock: true
  73. maxOutputLength: 3000
  74. retry: 1
  75. fallback: last
  76. skill:
  77. name: code-agent
  78. description: "代码文件操作与 Git 版本控制专家"
  79. tags: ["code", "file", "git", "test", "编程", "代码"]
  80. input_type: Str
  81. output_type: Str
  82. # 运行时引擎配置 (Phase 6.5)
  83. runtime:
  84. engine: cek # recursive | cek | adaptive
  85. costBudget: 0.07 # USD — 超过此金额自动暂停
  86. maxSteps: 10000 # CEK 最大转移步数