sequential-thinking

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Sequential 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
scripts/think.ts
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.
当激活此Skill时,请将
scripts/think.ts
作为主要推理机制
。不要用散文形式推理——通过脚本进行推理。分析的每一步都应通过脚本提交为一个思考条目,让推理链清晰可追踪。

Workflow

工作流程

  1. Reset state at the start of every new thinking session
  2. Loop: Submit thoughts one at a time via the script, incrementing
    thoughtNumber
    each time
  3. Adapt: Revise earlier thoughts, branch into alternatives, or extend depth as needed
  4. Terminate: Set
    nextThoughtNeeded false
    only when you have a confident final answer
  5. 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.
  1. 重置:在每个新思考会话开始时重置状态
  2. 循环:通过脚本逐个提交思考条目,每次递增
    thoughtNumber
  3. 调整:根据需要修订之前的思考、分支到替代方案或扩展深度
  4. 终止:仅当你有确定的最终答案时,设置
    nextThoughtNeeded false
  5. 响应:完成最终思考后,向用户提供答案
每个思考条目都应为单个Bash工具调用。在思考条目中进行思考,而非外部。

Script Location

脚本位置

scripts/think.ts
Run via
bun
from the skill's base directory.
scripts/think.ts
从Skill的基础目录通过
bun
运行。

Commands

命令

Reset (required before every new session)

重置(每个新会话前必须执行)

bash
bun scripts/think.ts --reset
bash
bun scripts/think.ts --reset

Submit a Thought

提交思考条目

Required flags:
--thought
,
--thoughtNumber
,
--totalThoughts
,
--nextThoughtNeeded
bash
bun scripts/think.ts \
  --thought "Your analysis for this step" \
  --thoughtNumber 1 \
  --totalThoughts 5 \
  --nextThoughtNeeded true
必填参数:
--thought
--thoughtNumber
--totalThoughts
--nextThoughtNeeded
bash
bun scripts/think.ts \
  --thought "此步骤的分析内容" \
  --thoughtNumber 1 \
  --totalThoughts 5 \
  --nextThoughtNeeded true

Submit a Revision

提交修订条目

Revises a previous thought. The original stays in history; the revision is appended as a new entry. Requires
--isRevision
and
--revisesThought
.
bash
bun scripts/think.ts \
  --thought "Corrected analysis" \
  --thoughtNumber 3 \
  --totalThoughts 5 \
  --nextThoughtNeeded true \
  --isRevision --revisesThought 1
修订之前的思考条目。原始条目保留在历史记录中;修订内容作为新条目追加。需要
--isRevision
--revisesThought
参数。
bash
bun scripts/think.ts \
  --thought "修正后的分析内容" \
  --thoughtNumber 3 \
  --totalThoughts 5 \
  --nextThoughtNeeded true \
  --isRevision --revisesThought 1

Submit a Branch

提交分支条目

Explores an alternative path from a prior thought. Requires both
--branchFromThought
and
--branchId
.
bash
bun scripts/think.ts \
  --thought "Alternative approach" \
  --thoughtNumber 4 \
  --totalThoughts 7 \
  --nextThoughtNeeded true \
  --branchFromThought 2 --branchId alt-approach
探索从之前某个思考条目出发的替代路径。需要同时使用
--branchFromThought
--branchId
参数。
bash
bun scripts/think.ts \
  --thought "替代方法" \
  --thoughtNumber 4 \
  --totalThoughts 7 \
  --nextThoughtNeeded true \
  --branchFromThought 2 --branchId alt-approach

Extend 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 \
  --needsMoreThoughts

Inspect Full State

查看完整状态

bash
bun scripts/think.ts --status
Returns JSON with
fullHistory
and
branchDetails
.
bash
bun scripts/think.ts --status
返回包含
fullHistory
branchDetails
的JSON数据。

Output 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=true
Revision and branch thoughts use
🔄 Revision
and
🌿 Branch
headers respectively.
每次思考调用会将思考内容打印到stderr,并将简洁的状态行打印到stdout:
💭 Thought 3/7
分析表明...
[3/7] history=3 next=true
修订和分支思考条目分别使用
🔄 Revision
🌿 Branch
标题。

Parameters (Full MCP Parity)

参数(与MCP完全对等)

ParameterTypeRequiredDescription
--thought
stringyesThe content of this thinking step
--thoughtNumber
int >= 1yesCurrent thought number in the sequence
--totalThoughts
int >= 1yesEstimated total thoughts needed (adjustable)
--nextThoughtNeeded
boolyes
true
to continue,
false
to terminate
--isRevision
flagnoMarks this thought as revising a previous one
--revisesThought
int >= 1noWhich thought number is being revised (required with
--isRevision
)
--branchFromThought
int >= 1noCreate a branch starting from this thought number
--branchId
stringnoLabel for the branch (required with
--branchFromThought
)
--needsMoreThoughts
flagnoSignal that
totalThoughts
should be expanded
参数类型是否必填描述
--thought
string此思考步骤的内容
--thoughtNumber
int >= 1序列中的当前思考编号
--totalThoughts
int >= 1预估所需的总思考条目数(可调整)
--nextThoughtNeeded
bool
true
表示继续,
false
表示终止
--isRevision
标志将此思考标记为对之前条目的修订
--revisesThought
int >= 1被修订的思考编号(与
--isRevision
一起使用时必填)
--branchFromThought
int >= 1创建从该思考编号开始的分支
--branchId
string分支的标签(与
--branchFromThought
一起使用时必填)
--needsMoreThoughts
标志表示需要扩展
totalThoughts

Behavioral Rules

行为规则

These match the MCP server's tool description exactly:
  1. Start with an initial estimate of
    totalThoughts
    , but adjust freely as understanding deepens
  2. Auto-adjust: If
    thoughtNumber
    exceeds
    totalThoughts
    , the script raises
    totalThoughts
    to match
  3. Revise previous thoughts when you realize an earlier step was wrong or incomplete — set
    --isRevision
    and
    --revisesThought N
    . The original stays in history; the revision is appended
  4. Branch to explore alternative reasoning paths — set both
    --branchFromThought N
    and
    --branchId label
    . This does not abandon the main line
  5. Extend beyond the initial estimate at any time with
    --needsMoreThoughts
    and an increased
    --totalThoughts
  6. Express uncertainty — not every thought needs confidence. Questioning and exploring is encouraged
  7. Filter noise — ignore information irrelevant to the current step
  8. Generate hypotheses when you have enough evidence, then verify them against prior thoughts in the chain
  9. Iterate hypothesis-verification cycles until satisfied with the answer
  10. Terminate only when you have a satisfactory answer — set
    --nextThoughtNeeded false
  11. Non-linear paths are first-class — branching, backtracking, and revision are features, not failures
这些规则与MCP服务器的工具描述完全一致:
  1. 开始时预估
    totalThoughts
    ,但可随着理解加深自由调整
  2. 自动调整:如果
    thoughtNumber
    超过
    totalThoughts
    ,脚本会将
    totalThoughts
    提升至匹配值
  3. 修订:当你意识到之前的步骤有误或不完整时,修订之前的思考条目——设置
    --isRevision
    --revisesThought N
    。原始条目保留在历史记录中;修订内容追加到记录中
  4. 分支:探索替代推理路径——同时设置
    --branchFromThought N
    --branchId label
    。这不会放弃主线思考
  5. 扩展:随时使用
    --needsMoreThoughts
    并增加
    --totalThoughts
    ,超出最初预估
  6. 表达不确定性——并非每个思考条目都需要有信心。鼓励提出疑问和探索
  7. 过滤干扰——忽略与当前步骤无关的信息
  8. 生成假设:当你有足够证据时生成假设,然后对照推理链中的之前条目进行验证
  9. 迭代:进行假设-验证循环,直到对答案满意为止
  10. 终止:仅当你得到满意答案时终止——设置
    --nextThoughtNeeded false
  11. 非线性路径是一等公民——分支、回溯和修订是功能,而非失败

State Management

状态管理

  • State is persisted to
    scripts/.think_state.json
    between invocations
  • thoughtHistory[]
    is append-only — thoughts are never deleted
  • branches{}
    maps branch IDs to their thought arrays
  • --reset
    clears all state for a fresh session
  • --status
    dumps the full state as JSON for inspection
  • 状态在调用之间持久化到
    scripts/.think_state.json
  • thoughtHistory[]
    是仅追加的——思考条目永远不会被删除
  • branches{}
    将分支ID映射到对应的思考数组
  • --reset
    清除所有状态以开始新会话
  • --status
    以JSON格式导出完整状态供查看

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获取完整的示例会话,展示常规思考、修订、分支和动态深度调整的使用。