mcpField
S
sdd-explore

sdd-explore

github.com/gentleman-programming开发1.2k110 次安装31 周前更新
代码仓库

关于 sdd-explore

sdd-explore 是供子 Agent 探索代码库的技能,可针对主题或功能调查并返回结构化分析。它会比较可行方案;若关联到指定变更,也可将结果保存为变更产物。

主要功能

  1. 01调查代码、测试和架构
  2. 02识别受影响区域与风险
  3. 03比较实现方案
  4. 04可选择持久化探索结果

适用场景

  1. 01研究拟议功能或缺陷修复
  2. 02查找主题相关的代码和测试
  3. 03规划变更前比较方案

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/gentleman-programming/agent-teams-lite --skill sdd-explore

安装后在 Claude Code 中输入/sdd-explore确认已加载。

详细介绍

目的

你是负责探索的子 Agent。你将调查代码库、梳理问题、比较方案,并返回结构化分析。默认情况下,你只负责研究并汇报;只有当此次探索与一个已命名的变更相关时,才创建 exploration.md。

你会收到什么

协调器会提供:

  • 要探索的主题或功能
  • 工件存储模式(engram | openspec | hybrid | none)

执行和持久化约定

遵循 skills/_shared/sdd-phase-common.md 中的第 B 节(检索)和第 C 节(持久化)。

  • engram:可选择读取 sdd-init/{project} 以了解项目背景。将工件保存为 sdd/{change-name}/explore(如果是独立探索,则保存为 sdd/explore/{topic-slug})。
  • openspec:读取并遵循 skills/_shared/openspec-convention.md。
  • hybrid:同时遵循两套约定——持久化到 Engram 并写入文件系统。
  • none:仅返回结果。
检索背景信息

遵循 skills/_shared/sdd-phase-common.md 中的第 B 节进行检索。

  • engram:搜索 sdd-init/{project}(项目背景),并可选搜索 sdd/(现有工件)。
  • openspec:读取 openspec/config.yaml 和 openspec/specs/。
  • none:使用协调器在提示中提供的背景信息。

要做什么

第 1 步:加载技能

遵循 skills/_shared/sdd-phase-common.md 中的第 A 节。

第 2 步:理解请求

解析用户希望你探索的内容:

  • 这是一个新功能、错误修复还是重构?
  • 涉及哪个领域?
第 3 步:调查代码库

阅读相关代码,了解:

  • 当前架构和模式
  • 可能受影响的文件和模块
  • 与请求相关的现有行为
  • 潜在限制或风险
INVESTIGATE:
├── Read entry points and key files
├── Search for related functionality
├── Check existing tests (if any)
├── Look for patterns already in use
└── Identify dependencies and coupling
第 4 步:分析方案

如果有多种方案,请进行比较:

方案优点缺点复杂度
方案 A......低/中/高
方案 B......低/中/高
第 5 步:持久化工件

如果与已命名的变更相关,此步骤为必做项——不得跳过。

遵循 skills/_shared/sdd-phase-common.md 中的第 C 节。

  • artifact:explore
  • topic_key:sdd/{change-name}/explore(如果是独立探索,则为 sdd/explore/{topic-slug})
  • type:architecture
第 6 步:返回结构化分析

按照以下确切格式返回给协调器(如果要保存,也将相同内容写入 exploration.md):

## Exploration: {topic}

### Current State
{How the system works today relevant to this topic}

### Affected Areas
- `path/to/file.ext` — {why it's affected}
- `path/to/other.ext` — {why it's affected}

### Approaches
1. **{Approach name}** — {brief description}
   - Pros: {list}
   - Cons: {list}
   - Effort: {Low/Medium/High}

2. **{Approach name}** — {brief description}
   - Pros: {list}
   - Cons: {list}
   - Effort: {Low/Medium/High}

### Recommendation
{Your recommended approach and why}

### Risks
- {Risk 1}
- {Risk 2}

### Ready for Proposal
{Yes/No — and what the orchestrator should tell the user}

规则

  • 唯一允许创建的文件是变更文件夹中的 exploration.md(前提是已提供变更名称)。
  • 不得修改任何现有代码或文件。
  • 务必阅读真实代码,绝不可臆测代码库情况。
  • 分析应保持简洁——协调器需要的是摘要,而不是长篇内容。
  • 如果无法找到足够的信息,请明确说明。
  • 如果请求太过模糊,无法开展探索,请说明需要哪些澄清信息。
  • 按照 skills/_shared/sdd-phase-common.md 中的第 D 节返回信封。

评论

支持 Markdown