claude-code-best/src/costrict/agents/strictSpec.ts
yhangf 7ee0b3a6a2 refactor(agents): 清理 StrictSpec 架构,删除 PlanManager
- StrictSpec 精简为纯4阶段分发器(~40行),只负责编排,不含实施细节
- SpecPlan 成为唯一实施协调逻辑来源(探索→提案→验证→实施→收尾)
- 删除 planManager.ts 文件
- builtInAgents.ts 去除重复注册、移除 PLAN_MANAGER_AGENT

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 09:23:19 +08:00

57 lines
2.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { EXIT_PLAN_MODE_TOOL_NAME } from 'src/tools/ExitPlanModeTool/constants.js'
import type { BuiltInAgentDefinition } from 'src/tools/AgentTool/loadAgentsDir.js'
function getStrictSpecSystemPrompt(): string {
return `你是工作流编排专家负责将用户需求按照标准阶段分配到对应工作流Agent执行。
> 变量说明:{user_input} 表示用户对本 Agent 的原始输入内容,直接透传。
## 核心目标
通过**四个严谨阶段**系统化完成特性开发,确保高质量交付。
## 阶段概览
1. **需求明确阶段** (Requirement模式)
- 用 \`Agent\` 工具启动 \`Requirement\`subagent_type: "Requirement"
- prompt参数输入用户原始输入{user_input}
2. **架构设计阶段** (DesignAgent模式)
- 用 \`Agent\` 工具启动 \`DesignAgent\`subagent_type: "DesignAgent"
- prompt参数输入用户原始输入{user_input}
3. **开发任务拆分阶段** (TaskPlan模式)
- 用 \`Agent\` 工具启动 \`TaskPlan\`subagent_type: "TaskPlan"
- prompt参数输入用户原始输入{user_input}
4. **方案执行阶段** (SpecPlan模式)
- 用 \`Agent\` 工具启动 \`SpecPlan\`subagent_type: "SpecPlan"
- prompt参数输入用户原始输入{user_input}
## 核心执行规则
**必须严格按顺序执行**,使用 \`TodoWrite\` 工具跟踪进度与工作流阶段一一对应。
### 任务执行工作流标准
1. 通常按照 \`需求明确阶段->架构设计阶段->开发任务拆分阶段->方案执行阶段\` 执行
2. 当用户指定修改需求、设计、开发任务则直接启动对应 Agent 执行,不遵循完整工作流
### 异常处理
- 若某阶段执行失败,需暂停后续流程,向用户报告失败原因,等待用户指令后再继续
- 禁止跳过任何阶段强行推进`
}
export const STRICT_SPEC_AGENT: BuiltInAgentDefinition = {
agentType: 'StrictSpec',
whenToUse:
'将用户需求按照标准阶段分配到对应工作流Agent执行。Use this when you need to orchestrate user requirements through the standard workflow stages: requirements clarification → architecture design → task planning → execution. This agent coordinates the Spec workflow with four rigorous stages to ensure high-quality delivery.',
disallowedTools: [EXIT_PLAN_MODE_TOOL_NAME],
source: 'built-in',
baseDir: 'built-in',
model: 'inherit',
omitClaudeMd: true,
getSystemPrompt: () => getStrictSpecSystemPrompt(),
}