Sequential thinking
Skill dengshu2/sequential-thinking-skill/skills/sequential-thinking
Structured step-by-step reasoning with a persistent, file-backed thought chain. Use for complex problems that need multi-step decomposition, mid-course revision of earlier assumptions, or exploring alternative solution branches — especially in long sessions where the reasoning chain should survive context compaction. Triggers include "think step by step", "sequential thinking", "顺序思考", "分步推理", "逐步分析", revising earlier reasoning, or replaying how a conclusion was reached.From its SKILL.md
npx -y skills add dengshu2/sequential-thinking-skill --skill sequential-thinkingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.1 KB, 918 tokens by cl100k_base, as published. Nobody here has run it
Sequential Thinking
Record your reasoning as an explicit, numbered chain of thoughts in a state
file, one CLI call per thought. This replaces the sequential-thinking MCP
server: same call → ack → next-thought rhythm, but the chain lives on disk,
so it survives context compaction and can be replayed later.
The script is at scripts/think.py inside this skill's directory. The
working directory at runtime is the user's project, so always invoke it by
absolute path (you know this skill's location from where you read this file):
python3 <this-skill-dir>/scripts/think.py <command> ...
Workflow
-
Start a chain — one line stating the problem, plus a step estimate:
think.py new "为什么 X 指标在 3 月下跌" --total 5 -
Record every thinking step as you produce it. Do the thinking in the argument itself — the thought text should carry real analysis, not a label:
think.py add "候选原因有 A/B/C,其中 B 与时间线吻合……" -
Revise instead of forcing. When an earlier step turns out wrong, don't bend later reasoning around it — mark the correction explicitly:
think.py add "第 2 步的假设不成立,因为……" --revises 2 -
Branch to explore alternatives when two solution paths both look viable:
think.py add "换个思路:如果从需求侧看……" --branch-from 3 --branch-id demand-side -
Adjust the estimate freely with
--total Non anyadd— it is an estimate, not a budget. Add more thoughts after the "last" one if needed. -
Finish only when a hypothesis has been generated and verified against the chain, and you are satisfied with the answer:
think.py add "结论:……,已对照第 1/3/5 步验证" --done -
Replay at any time with
think.py show(orshow --json). Use this to recover the full reasoning chain after context compaction, or to review the chain before writing the final answer.
Principles
- One thought per call; keep the ack rhythm. Each call returns
{thoughtNumber, nextThoughtNeeded, ...}— whilenextThoughtNeededis true, keep thinking. - Question earlier decisions; express uncertainty when it exists.
- Filter out irrelevant information rather than carrying it forward.
- Generate a solution hypothesis, then verify it against the chain of thought
before
--done. If verification fails, keep adding thoughts.
State file
Resolution order — pick the most session-scoped option available:
- Preferred: if your harness gives you a session-specific scratchpad or
temp directory, pass
--file <scratchpad>/thoughts.jsonon every call. This isolates concurrent sessions that share a working directory, and the chain still survives context compaction within the session. - Fallback: with no
--file, state goes to${XDG_STATE_HOME:-~/.local/state}/think/<cwd-hash>/thoughts.json— one chain per working directory, nothing written into the user's project. Caveat: two concurrent sessions in the same directory would interleave into (and garble) one chain, so prefer option 1 whenever you can.
Rules either way:
- Always begin a task with
think.py new— neveraddonto a chain you did not start. If anaddack contains awarningfield (chain idle for hours), treat it as a stale leftover: runnew. - Thoughts are written to disk in plain text and outlive the session; do not put secrets (keys, credentials, private data) into thought text.
newclears the previous chain;resetdeletes the file;whereprints the path.
What ships with it: 1 file
7.3 KB alongside SKILL.md, 1 of them executable
scripts/
- think.pyruns7.3 KB