sequential-thinking
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSequential Thinking
Sequential Thinking
A tool for dynamic, reflective problem-solving through a chain of numbered thoughts. Full parity with the Sequential Thinking MCP server — same parameters, same state management, same behavioral contract.
一种通过一系列编号思考实现动态、反思性问题解决的工具。与Sequential Thinking MCP服务器完全对等——相同的参数、相同的状态管理、相同的行为约定。
How to Use This Skill
如何使用该Skill
When this skill is activated, use as your primary reasoning mechanism. Do not reason in prose — reason through the script. Every step of your analysis should be a thought submitted via the script, making your reasoning chain explicit and trackable.
scripts/think.ts当激活此Skill时,请将作为主要推理机制。不要用散文形式推理——通过脚本进行推理。分析的每一步都应通过脚本提交为一个思考条目,让推理链清晰可追踪。
scripts/think.tsWorkflow
工作流程
- Reset state at the start of every new thinking session
- Loop: Submit thoughts one at a time via the script, incrementing each time
thoughtNumber - Adapt: Revise earlier thoughts, branch into alternatives, or extend depth as needed
- Terminate: Set only when you have a confident final answer
nextThoughtNeeded false - Respond: After the final thought, provide the answer to the user
Each thought should be a single Bash tool call. Think in the thought, not outside it.
- 重置:在每个新思考会话开始时重置状态
- 循环:通过脚本逐个提交思考条目,每次递增
thoughtNumber - 调整:根据需要修订之前的思考、分支到替代方案或扩展深度
- 终止:仅当你有确定的最终答案时,设置
nextThoughtNeeded false - 响应:完成最终思考后,向用户提供答案
每个思考条目都应为单个Bash工具调用。在思考条目中进行思考,而非外部。
Script Location
脚本位置
scripts/think.tsRun via from the skill's base directory.
bunscripts/think.ts从Skill的基础目录通过运行。
bunCommands
命令
Reset (required before every new session)
重置(每个新会话前必须执行)
bash
bun scripts/think.ts --resetbash
bun scripts/think.ts --resetSubmit a Thought
提交思考条目
Required flags: , , ,
--thought--thoughtNumber--totalThoughts--nextThoughtNeededbash
bun scripts/think.ts \
--thought "Your analysis for this step" \
--thoughtNumber 1 \
--totalThoughts 5 \
--nextThoughtNeeded true必填参数:、、、
--thought--thoughtNumber--totalThoughts--nextThoughtNeededbash
bun scripts/think.ts \
--thought "此步骤的分析内容" \
--thoughtNumber 1 \
--totalThoughts 5 \
--nextThoughtNeeded trueSubmit a Revision
提交修订条目
Revises a previous thought. The original stays in history; the revision is appended as a new entry. Requires and .
--isRevision--revisesThoughtbash
bun scripts/think.ts \
--thought "Corrected analysis" \
--thoughtNumber 3 \
--totalThoughts 5 \
--nextThoughtNeeded true \
--isRevision --revisesThought 1修订之前的思考条目。原始条目保留在历史记录中;修订内容作为新条目追加。需要和参数。
--isRevision--revisesThoughtbash
bun scripts/think.ts \
--thought "修正后的分析内容" \
--thoughtNumber 3 \
--totalThoughts 5 \
--nextThoughtNeeded true \
--isRevision --revisesThought 1Submit a Branch
提交分支条目
Explores an alternative path from a prior thought. Requires both and .
--branchFromThought--branchIdbash
bun scripts/think.ts \
--thought "Alternative approach" \
--thoughtNumber 4 \
--totalThoughts 7 \
--nextThoughtNeeded true \
--branchFromThought 2 --branchId alt-approach探索从之前某个思考条目出发的替代路径。需要同时使用和参数。
--branchFromThought--branchIdbash
bun scripts/think.ts \
--thought "替代方法" \
--thoughtNumber 4 \
--totalThoughts 7 \
--nextThoughtNeeded true \
--branchFromThought 2 --branchId alt-approachExtend Depth
扩展深度
Signal that more thoughts are needed beyond the original estimate.
bash
bun scripts/think.ts \
--thought "Scope is larger than expected" \
--thoughtNumber 6 \
--totalThoughts 8 \
--nextThoughtNeeded true \
--needsMoreThoughts表明需要超出最初预估的更多思考条目。
bash
bun scripts/think.ts \
--thought "范围比预期更大" \
--thoughtNumber 6 \
--totalThoughts 8 \
--nextThoughtNeeded true \
--needsMoreThoughtsInspect Full State
查看完整状态
bash
bun scripts/think.ts --statusReturns JSON with and .
fullHistorybranchDetailsbash
bun scripts/think.ts --status返回包含和的JSON数据。
fullHistorybranchDetailsOutput Format
输出格式
Each thought invocation prints the thought to stderr and a compact status line to stdout:
💭 Thought 3/7
The analysis shows that...
[3/7] history=3 next=trueRevision and branch thoughts use and headers respectively.
🔄 Revision🌿 Branch每次思考调用会将思考内容打印到stderr,并将简洁的状态行打印到stdout:
💭 Thought 3/7
分析表明...
[3/7] history=3 next=true修订和分支思考条目分别使用和标题。
🔄 Revision🌿 BranchParameters (Full MCP Parity)
参数(与MCP完全对等)
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | yes | The content of this thinking step |
| int >= 1 | yes | Current thought number in the sequence |
| int >= 1 | yes | Estimated total thoughts needed (adjustable) |
| bool | yes | |
| flag | no | Marks this thought as revising a previous one |
| int >= 1 | no | Which thought number is being revised (required with |
| int >= 1 | no | Create a branch starting from this thought number |
| string | no | Label for the branch (required with |
| flag | no | Signal that |
| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 此思考步骤的内容 |
| int >= 1 | 是 | 序列中的当前思考编号 |
| int >= 1 | 是 | 预估所需的总思考条目数(可调整) |
| bool | 是 | |
| 标志 | 否 | 将此思考标记为对之前条目的修订 |
| int >= 1 | 否 | 被修订的思考编号(与 |
| int >= 1 | 否 | 创建从该思考编号开始的分支 |
| string | 否 | 分支的标签(与 |
| 标志 | 否 | 表示需要扩展 |
Behavioral Rules
行为规则
These match the MCP server's tool description exactly:
- Start with an initial estimate of , but adjust freely as understanding deepens
totalThoughts - Auto-adjust: If exceeds
thoughtNumber, the script raisestotalThoughtsto matchtotalThoughts - Revise previous thoughts when you realize an earlier step was wrong or incomplete — set and
--isRevision. The original stays in history; the revision is appended--revisesThought N - Branch to explore alternative reasoning paths — set both and
--branchFromThought N. This does not abandon the main line--branchId label - Extend beyond the initial estimate at any time with and an increased
--needsMoreThoughts--totalThoughts - Express uncertainty — not every thought needs confidence. Questioning and exploring is encouraged
- Filter noise — ignore information irrelevant to the current step
- Generate hypotheses when you have enough evidence, then verify them against prior thoughts in the chain
- Iterate hypothesis-verification cycles until satisfied with the answer
- Terminate only when you have a satisfactory answer — set
--nextThoughtNeeded false - Non-linear paths are first-class — branching, backtracking, and revision are features, not failures
这些规则与MCP服务器的工具描述完全一致:
- 开始时预估,但可随着理解加深自由调整
totalThoughts - 自动调整:如果超过
thoughtNumber,脚本会将totalThoughts提升至匹配值totalThoughts - 修订:当你意识到之前的步骤有误或不完整时,修订之前的思考条目——设置和
--isRevision。原始条目保留在历史记录中;修订内容追加到记录中--revisesThought N - 分支:探索替代推理路径——同时设置和
--branchFromThought N。这不会放弃主线思考--branchId label - 扩展:随时使用并增加
--needsMoreThoughts,超出最初预估--totalThoughts - 表达不确定性——并非每个思考条目都需要有信心。鼓励提出疑问和探索
- 过滤干扰——忽略与当前步骤无关的信息
- 生成假设:当你有足够证据时生成假设,然后对照推理链中的之前条目进行验证
- 迭代:进行假设-验证循环,直到对答案满意为止
- 终止:仅当你得到满意答案时终止——设置
--nextThoughtNeeded false - 非线性路径是一等公民——分支、回溯和修订是功能,而非失败
State Management
状态管理
- State is persisted to between invocations
scripts/.think_state.json - is append-only — thoughts are never deleted
thoughtHistory[] - maps branch IDs to their thought arrays
branches{} - clears all state for a fresh session
--reset - dumps the full state as JSON for inspection
--status
- 状态在调用之间持久化到
scripts/.think_state.json - 是仅追加的——思考条目永远不会被删除
thoughtHistory[] - 将分支ID映射到对应的思考数组
branches{} - 清除所有状态以开始新会话
--reset - 以JSON格式导出完整状态供查看
--status
Example Session
示例会话
See references/example-session.md for a complete worked example demonstrating normal thoughts, revisions, branches, and dynamic depth adjustment.
查看references/example-session.md获取完整的示例会话,展示常规思考、修订、分支和动态深度调整的使用。