refactor(agents): standardize import paths and remove obsolete tool references
This commit is contained in:
parent
80288a1c46
commit
792b784066
|
|
@ -1,5 +1,5 @@
|
||||||
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
||||||
import type { BuiltInAgentDefinition } from '../../loadAgentsDir.js'
|
import type { BuiltInAgentDefinition } from 'src/tools/AgentTool/loadAgentsDir.js'
|
||||||
|
|
||||||
function getDesignAgentSystemPrompt(): string {
|
function getDesignAgentSystemPrompt(): string {
|
||||||
return `你是 DesignAgent,一名专业软件开发团队中的资深软件架构师。
|
return `你是 DesignAgent,一名专业软件开发团队中的资深软件架构师。
|
||||||
|
|
@ -8,7 +8,7 @@ function getDesignAgentSystemPrompt(): string {
|
||||||
1. 根据需求文档内容,按 C4 Model 四个层次逐步完成架构建模
|
1. 根据需求文档内容,按 C4 Model 四个层次逐步完成架构建模
|
||||||
2. 输出系统上下文图、容器图、组件图等架构图(Mermaid / PlantUML 格式)
|
2. 输出系统上下文图、容器图、组件图等架构图(Mermaid / PlantUML 格式)
|
||||||
3. 记录关键架构决策(ADR)
|
3. 记录关键架构决策(ADR)
|
||||||
4. 输出总体设计文档 \`!tool{spec-manage}(mode=techpath,path=./)\`,目录已经创建,只需要在该目录下写入tech.md
|
4. 输出总体设计文档,目录已经创建,只需要在该目录下写入tech.md
|
||||||
|
|
||||||
## 工作原则
|
## 工作原则
|
||||||
|
|
||||||
|
|
@ -160,19 +160,7 @@ C4Component
|
||||||
### 阶段5:关键决策记录(ADR)
|
### 阶段5:关键决策记录(ADR)
|
||||||
- 输出架构决策记录(Architecture Decision Record)
|
- 输出架构决策记录(Architecture Decision Record)
|
||||||
- 格式:决策背景 → 可选方案 → 选择方案 → 原因与权衡
|
- 格式:决策背景 → 可选方案 → 选择方案 → 原因与权衡
|
||||||
|
`
|
||||||
### 需求文档内容
|
|
||||||
|
|
||||||
\`\`\`markdown
|
|
||||||
!tool{spec-manage}(mode=readspec,path=./)
|
|
||||||
\`\`\`
|
|
||||||
|
|
||||||
### 设计文档存放位置
|
|
||||||
\`!tool{spec-manage}(mode=techpath,path=./)\`,目录已经创建,只需要在该目录下写入tech.md
|
|
||||||
|
|
||||||
### 当前工程.cospec/spec目录下文件状态
|
|
||||||
|
|
||||||
!tool{spec-manage}(mode=spec,path=./)`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DESIGN_AGENT: BuiltInAgentDefinition = {
|
export const DESIGN_AGENT: BuiltInAgentDefinition = {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
||||||
import { FILE_EDIT_TOOL_NAME } from 'src/tools/FileEditTool/constants.js'
|
|
||||||
import { FILE_WRITE_TOOL_NAME } from 'src/tools/FileWriteTool/prompt.js'
|
|
||||||
import { NOTEBOOK_EDIT_TOOL_NAME } from 'src/tools/NotebookEditTool/constants.js'
|
import { NOTEBOOK_EDIT_TOOL_NAME } from 'src/tools/NotebookEditTool/constants.js'
|
||||||
import type { BuiltInAgentDefinition } from '../../tools/AgentTool/loadAgentsDir.js'
|
import type { BuiltInAgentDefinition } from 'src/tools/AgentTool/loadAgentsDir.js'
|
||||||
|
|
||||||
function getPlanApplySystemPrompt(): string {
|
function getPlanApplySystemPrompt(): string {
|
||||||
return `你是 CodingAgent,软件开发团队的项目管理者和技术架构师。
|
return `你是 CodingAgent,软件开发团队的项目管理者和技术架构师。
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
||||||
import type { BuiltInAgentDefinition } from '../../loadAgentsDir.js'
|
import type { BuiltInAgentDefinition } from 'src/tools/AgentTool/loadAgentsDir.js'
|
||||||
|
|
||||||
function getPlanManagerSystemPrompt(): string {
|
function getPlanManagerSystemPrompt(): string {
|
||||||
return `# PlanManager - 开发任务管理与协调
|
return `# PlanManager - 开发任务管理与协调
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
||||||
import type { BuiltInAgentDefinition } from '../../loadAgentsDir.js'
|
import type { BuiltInAgentDefinition } from 'src/tools/AgentTool/loadAgentsDir.js'
|
||||||
|
|
||||||
function getRequirementSystemPrompt(): string {
|
function getRequirementSystemPrompt(): string {
|
||||||
return `# 角色
|
return `# 角色
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
||||||
import { FILE_EDIT_TOOL_NAME } from 'src/tools/FileEditTool/constants.js'
|
|
||||||
import { FILE_WRITE_TOOL_NAME } from 'src/tools/FileWriteTool/prompt.js'
|
|
||||||
import { NOTEBOOK_EDIT_TOOL_NAME } from 'src/tools/NotebookEditTool/constants.js'
|
import { NOTEBOOK_EDIT_TOOL_NAME } from 'src/tools/NotebookEditTool/constants.js'
|
||||||
import { AGENT_TOOL_NAME } from '../../tools/AgentTool/constants.js'
|
import type { BuiltInAgentDefinition } from 'src/tools/AgentTool/loadAgentsDir.js'
|
||||||
import type { BuiltInAgentDefinition } from '../../tools/AgentTool/loadAgentsDir.js'
|
|
||||||
|
|
||||||
function getReviewAndFixSystemPrompt(): string {
|
function getReviewAndFixSystemPrompt(): string {
|
||||||
return `你是ReviewAndFix Agent,一名专业软件开发团队中的代码审查与修复专家。
|
return `你是ReviewAndFix Agent,一名专业软件开发团队中的代码审查与修复专家。
|
||||||
|
|
@ -102,7 +99,6 @@ export const REVIEW_AND_FIX_AGENT: BuiltInAgentDefinition = {
|
||||||
whenToUse:
|
whenToUse:
|
||||||
'专门用于审查和修复代码问题的代理。能够发现问题、理解问题、实施修复,并管理修复过程。Use this when you need to review and fix code issues based on user feedback or code review findings.',
|
'专门用于审查和修复代码问题的代理。能够发现问题、理解问题、实施修复,并管理修复过程。Use this when you need to review and fix code issues based on user feedback or code review findings.',
|
||||||
disallowedTools: [
|
disallowedTools: [
|
||||||
AGENT_TOOL_NAME,
|
|
||||||
EXIT_PLAN_MODE_TOOL_NAME,
|
EXIT_PLAN_MODE_TOOL_NAME,
|
||||||
NOTEBOOK_EDIT_TOOL_NAME,
|
NOTEBOOK_EDIT_TOOL_NAME,
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,7 @@
|
||||||
import { BASH_TOOL_NAME } from 'src/tools/BashTool/toolName.js'
|
|
||||||
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
||||||
import { FILE_EDIT_TOOL_NAME } from 'src/tools/FileEditTool/constants.js'
|
import type { BuiltInAgentDefinition } from 'src/tools/AgentTool/loadAgentsDir.js'
|
||||||
import { FILE_READ_TOOL_NAME } from 'src/tools/FileReadTool/prompt.js'
|
|
||||||
import { FILE_WRITE_TOOL_NAME } from 'src/tools/FileWriteTool/prompt.js'
|
|
||||||
import { GLOB_TOOL_NAME } from 'src/tools/GlobTool/prompt.js'
|
|
||||||
import { GREP_TOOL_NAME } from 'src/tools/GrepTool/prompt.js'
|
|
||||||
import { hasEmbeddedSearchTools } from 'src/utils/embeddedTools.js'
|
|
||||||
import type { BuiltInAgentDefinition } from '../../loadAgentsDir.js'
|
|
||||||
|
|
||||||
function getSpecPlanSystemPrompt(): string {
|
function getSpecPlanSystemPrompt(): string {
|
||||||
// Ant-native builds alias find/grep to embedded bfs/ugrep and remove the
|
|
||||||
// dedicated Glob/Grep tools, so point at find/grep via Bash instead.
|
|
||||||
const embedded = hasEmbeddedSearchTools()
|
|
||||||
const globGuidance = embedded
|
|
||||||
? `- Use \`find\` via ${BASH_TOOL_NAME} for broad file pattern matching`
|
|
||||||
: `- Use ${GLOB_TOOL_NAME} for broad file pattern matching`
|
|
||||||
const grepGuidance = embedded
|
|
||||||
? `- Use \`grep\` via ${BASH_TOOL_NAME} for searching file contents with regex`
|
|
||||||
: `- Use ${GREP_TOOL_NAME} for searching file contents with regex`
|
|
||||||
|
|
||||||
return `你是一个专门为软件项目创建结构化需求提案的 PlanAgent。
|
return `你是一个专门为软件项目创建结构化需求提案的 PlanAgent。
|
||||||
你的核心职责是:遵循"**理解用户需求→探索项目→需求澄清→创建提案→实施提案**"的严格工作流。
|
你的核心职责是:遵循"**理解用户需求→探索项目→需求澄清→创建提案→实施提案**"的严格工作流。
|
||||||
|
|
@ -179,14 +163,7 @@ c. 查看\`TaskCheck\`返回的总结报告,了解修复情况
|
||||||
- 优先使用动词引导前缀:\`add-\`, \`update-\`, \`remove-\`, \`refactor-\`
|
- 优先使用动词引导前缀:\`add-\`, \`update-\`, \`remove-\`, \`refactor-\`
|
||||||
- 确保唯一性;如果已被占用,附加 \`-2\`, \`-3\` 等
|
- 确保唯一性;如果已被占用,附加 \`-2\`, \`-3\` 等
|
||||||
|
|
||||||
工具使用指南:
|
`
|
||||||
${globGuidance}
|
|
||||||
${grepGuidance}
|
|
||||||
- Use ${FILE_READ_TOOL_NAME} when you know the specific file path you need to read
|
|
||||||
- Use ${BASH_TOOL_NAME} ONLY for read-only operations (ls, git status, git log, git diff, find${embedded ? ', grep' : ''}, cat, head, tail)
|
|
||||||
- NEVER use ${BASH_TOOL_NAME} for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification
|
|
||||||
- Use ${FILE_WRITE_TOOL_NAME} to create new files
|
|
||||||
- Use ${FILE_EDIT_TOOL_NAME} to modify existing files`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SPEC_PLAN_AGENT: BuiltInAgentDefinition = {
|
export const SPEC_PLAN_AGENT: BuiltInAgentDefinition = {
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,6 @@ export const STRICT_PLAN_AGENT: BuiltInAgentDefinition = {
|
||||||
"Read",
|
"Read",
|
||||||
"Write",
|
"Write",
|
||||||
"Edit",
|
"Edit",
|
||||||
"TaskCreate",
|
|
||||||
],
|
],
|
||||||
source: 'built-in',
|
source: 'built-in',
|
||||||
baseDir: 'built-in',
|
baseDir: 'built-in',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
|
||||||
import { FILE_EDIT_TOOL_NAME } from 'src/tools/FileEditTool/constants.js'
|
|
||||||
import { FILE_WRITE_TOOL_NAME } from 'src/tools/FileWriteTool/prompt.js'
|
|
||||||
import { NOTEBOOK_EDIT_TOOL_NAME } from 'src/tools/NotebookEditTool/constants.js'
|
import { NOTEBOOK_EDIT_TOOL_NAME } from 'src/tools/NotebookEditTool/constants.js'
|
||||||
import { AGENT_TOOL_NAME } from '../../tools/AgentTool/constants.js'
|
import { AGENT_TOOL_NAME } from '../../tools/AgentTool/constants.js'
|
||||||
import type { BuiltInAgentDefinition } from '../../tools/AgentTool/loadAgentsDir.js'
|
import type { BuiltInAgentDefinition } from '../../tools/AgentTool/loadAgentsDir.js'
|
||||||
|
|
|
||||||
|
|
@ -165,26 +165,7 @@ function getTaskPlanSystemPrompt(): string {
|
||||||
- ❌ 在plan.md中添加说明性文字、模板提示等非执行内容
|
- ❌ 在plan.md中添加说明性文字、模板提示等非执行内容
|
||||||
- ❌ 忽略前置检查直接开始任务规划,导致输入文档缺失
|
- ❌ 忽略前置检查直接开始任务规划,导致输入文档缺失
|
||||||
- ❌ 需求引用格式不正确
|
- ❌ 需求引用格式不正确
|
||||||
|
`
|
||||||
### 需求文档内容
|
|
||||||
|
|
||||||
\`\`\`markdown
|
|
||||||
!tool{spec-manage}(mode=readspec,path=./)
|
|
||||||
\`\`\`
|
|
||||||
|
|
||||||
### 技术设计文档内容
|
|
||||||
|
|
||||||
\`\`\`markdown
|
|
||||||
!tool{spec-manage}(mode=readtech,path=./)
|
|
||||||
\`\`\`
|
|
||||||
|
|
||||||
### 任务计划文档存放位置
|
|
||||||
\`!tool{spec-manage}(mode=planpath,path=./)\`,目录已经创建,注意该目录为当前路径隐藏目录,只需要在该目录下写入plan.md
|
|
||||||
注意:使用write工具适合传入相对路径,如.cospec/spec,而不是/.cospec/spec
|
|
||||||
|
|
||||||
### 当前工程.cospec/spec目录下文件状态
|
|
||||||
|
|
||||||
!tool{spec-manage}(mode=spec,path=./)`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TASK_PLAN_AGENT: BuiltInAgentDefinition = {
|
export const TASK_PLAN_AGENT: BuiltInAgentDefinition = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user