home / skills / secondsky / claude-skills / sequential-thinking

This skill enables structured, iterative reasoning with revision and branching to tackle complex problems and multi-step analyses.

npx playbooks add skill secondsky/claude-skills --skill sequential-thinking

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.4 KB
---
name: sequential-thinking
description: Systematic step-by-step reasoning with revision and branching. Use for complex problems, multi-stage analysis, design planning, problem decomposition, or encountering unclear scope, alternative approaches needed, revision requirements.
license: MIT
---

# Sequential Thinking

Enables structured problem-solving through iterative reasoning with revision and branching capabilities.

## Core Capabilities

- **Iterative reasoning**: Break complex problems into sequential thought steps
- **Dynamic scope**: Adjust total thought count as understanding evolves
- **Revision tracking**: Reconsider and modify previous conclusions
- **Branch exploration**: Explore alternative reasoning paths from any point
- **Maintained context**: Keep track of reasoning chain throughout analysis

## When to Use

Use `mcp__reasoning__sequentialthinking` when:
- Problem requires multiple interconnected reasoning steps
- Initial scope or approach is uncertain
- Need to filter through complexity to find core issues
- May need to backtrack or revise earlier conclusions
- Want to explore alternative solution paths

**Don't use for**: Simple queries, direct facts, or single-step tasks.

## Basic Usage

The MCP tool `mcp__reasoning__sequentialthinking` accepts these parameters:

### Required Parameters

- `thought` (string): Current reasoning step
- `nextThoughtNeeded` (boolean): Whether more reasoning is needed
- `thoughtNumber` (integer): Current step number (starts at 1)
- `totalThoughts` (integer): Estimated total steps needed

### Optional Parameters

- `isRevision` (boolean): Indicates this revises previous thinking
- `revisesThought` (integer): Which thought number is being reconsidered
- `branchFromThought` (integer): Thought number to branch from
- `branchId` (string): Identifier for this reasoning branch

## Workflow Pattern

```
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`
```

## Simple Example

```typescript
// 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
```

## Advanced Features

### Revision Pattern

When you realize an earlier conclusion was wrong:

```typescript
{
  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
}
```

### Branching Pattern

When exploring alternative approaches:

```typescript
{
  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"
}
```

## Tips

- Start with rough estimate for `totalThoughts`, refine as you progress
- Use revision when assumptions prove incorrect
- Branch when multiple approaches seem viable
- Express uncertainty explicitly in thoughts
- Adjust scope freely - accuracy matters less than progress visibility

Overview

This skill enables systematic step-by-step reasoning with built-in revision and branching. It is designed for complex, multi-stage analysis where the problem evolves and alternative approaches must be explored. The skill keeps a clear chain of thought so you can track, revise, or fork reasoning paths as the solution develops.

How this skill works

You provide a current reasoning step and control flags that indicate whether more steps are needed, whether this step revises a prior thought, or whether it starts a branch from an earlier point. The skill maintains step numbers, an adjustable estimate of total steps, and optional branch IDs so multiple lines of reasoning are preserved and comparable. Use iterations to refine scope, correct earlier conclusions, or explore different solution strategies.

When to use it

  • Solving complex problems that require multiple sequential decisions
  • Decomposing multi-stage design, architecture, or planning tasks
  • When the initial scope or approach is unclear and may change
  • Needing to backtrack and revise earlier conclusions based on new evidence
  • Exploring multiple alternative solutions in parallel

Best practices

  • Start with a rough totalThoughts estimate and update it as understanding improves
  • Record each discrete inference as a single thought with explicit uncertainty when needed
  • Use isRevision and revisesThought to track corrections instead of overwriting past steps
  • Create branchId and branchFromThought for alternative strategies to compare outcomes
  • Keep thoughtNumber consistent and incremental so the chain of reasoning is easy to follow

Example use cases

  • Performance debugging: iterate through profiling, hypothesis, and remediation steps, revising as new data appears
  • Design planning: decompose a system into stages, branch alternative architectures, and converge on a final plan
  • Complex decision analysis: weigh trade-offs across multiple criteria and revise rankings when constraints change
  • Algorithm development: stepwise refine approach, backtrack when a path fails, and explore different algorithmic branches
  • Project scoping: progressively refine requirements and task breakdowns while tracking changes

FAQ

How do I indicate that a thought corrects an earlier step?

Set isRevision to true and include revisesThought with the previous step number; keep thoughtNumber and totalThoughts consistent with the current sequence.

When should I create a branch instead of revising?

Branch when you want to preserve the original line of reasoning and explore an alternative approach in parallel; use branchFromThought and a unique branchId.