mcpField
S
sequential-thinking

sequential-thinking

github.com/secondskyAgent 工作流240439 次安装5 周前更新
代码仓库

关于 sequential-thinking

sequential-thinking 是用于分步骤处理复杂问题的结构化推理技能。它支持修订和分支探索,使分析能随理解的深入而调整方向。

主要功能

  1. 01逐步进行迭代推理
  2. 02动态调整思考范围
  3. 03修订先前结论
  4. 04探索替代推理分支
  5. 05保持推理步骤间的上下文

适用场景

  1. 01处理相互关联的复杂问题
  2. 02根据新发现修订方案
  3. 03比较不同的解决路径

MCP 相关

该技能使用 MCP 工具 `mcp__reasoning__sequentialthinking` 进行顺序推理,并通过参数支持思考步骤、修订和分支。

安装

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

$npx skills add https://github.com/secondsky/claude-skills --skill sequential-thinking

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

详细介绍

顺序思考

通过迭代推理、修订和分支功能,实现结构化的问题解决。

核心能力

  • 迭代推理:将复杂问题拆解为一系列思考步骤
  • 动态范围:随着理解的深入调整思考步骤总数
  • 修订追踪:重新审视并修改先前的结论
  • 分支探索:从任意节点探索其他推理路径
  • 上下文维护:在整个分析过程中跟踪推理链

适用场景

在以下情况下使用 mcp__reasoning__sequentialthinking:

  • 问题需要多个相互关联的推理步骤
  • 初始范围或方法尚不确定
  • 需要梳理复杂内容以找出核心问题
  • 可能需要回溯或修订先前的结论
  • 希望探索其他解决方案路径

不适用于:简单查询、直接事实或单步任务。

基本用法

MCP 工具 mcp__reasoning__sequentialthinking 接受以下参数:

必需参数
  • thought(字符串):当前推理步骤
  • nextThoughtNeeded(布尔值):是否需要继续推理
  • thoughtNumber(整数):当前步骤编号(从 1 开始)
  • totalThoughts(整数):预计所需的总步骤数
可选参数
  • isRevision(布尔值):表示这是对先前思考的修订
  • revisesThought(整数):正在重新审视的思考步骤编号
  • branchFromThought(整数):要从哪个思考步骤分支
  • branchId(字符串):此推理分支的标识符

工作流模式

1. Start with initial thought (thoughtNumber: 1)
2. For each step:
   - Express current reasoning in `thought`
   - Estimate remaining work via `totalThoughts` (adjust dynamically)
   - Set `nextThoughtNeeded: true` to continue
3. When reaching conclusion, set `nextThoughtNeeded: false`

简单示例

// First thought
{
  thought: "Problem involves optimizing database queries. Need to identify bottlenecks first.",
  thoughtNumber: 1,
  totalThoughts: 5,
  nextThoughtNeeded: true
}

// Second thought
{
  thought: "Analyzing query patterns reveals N+1 problem in user fetches.",
  thoughtNumber: 2,
  totalThoughts: 6, // Adjusted scope
  nextThoughtNeeded: true
}

// ... continue until done

高级功能

修订模式

当你发现先前的结论有误时:

{
  thought: "Reconsidering thought #2: The N+1 problem isn't the main bottleneck - missing index is.",
  thoughtNumber: 5,
  totalThoughts: 8,
  nextThoughtNeeded: true,
  isRevision: true,
  revisesThought: 2
}
分支模式

探索其他方法时:

{
  thought: "Branch A: What if we solve this with caching instead of query optimization?",
  thoughtNumber: 6,
  totalThoughts: 10,
  nextThoughtNeeded: true,
  branchFromThought: 3,
  branchId: "caching-approach"
}

提示

  • 先粗略估计 totalThoughts,并随着进展进行调整
  • 假设被证明不正确时,使用修订
  • 有多种可行方法时,使用分支
  • 在思考过程中明确表达不确定性
  • 可自由调整范围——准确性不如清晰呈现进展重要

评论

支持 Markdown