$npx -y skills add Dianel555/DSkills --skill sequential-thinkMulti-step reasoning engine for complex analysis and systematic problem solving. Use when: (1) Complex debugging scenarios with multiple layers, (2) Architectural analysis and system design, (3) Problems requiring hypothesis testing and validation, (4) Multi-component failure inv
| 1 | # Sequential Think |
| 2 | |
| 3 | Structured iterative thinking for complex problem-solving. Standalone CLI only (no MCP dependency). |
| 4 | |
| 5 | ## Execution Methods |
| 6 | |
| 7 | Run `scripts/sequential_think_cli.py` via Bash: |
| 8 | |
| 9 | ```bash |
| 10 | # Process a thought |
| 11 | python scripts/sequential_think_cli.py think \ |
| 12 | --thought "First, let me analyze the problem structure..." \ |
| 13 | --thought-number 1 \ |
| 14 | --total-thoughts 5 |
| 15 | |
| 16 | # Continue thinking chain |
| 17 | python scripts/sequential_think_cli.py think \ |
| 18 | --thought "Based on step 1, I hypothesize that..." \ |
| 19 | --thought-number 2 \ |
| 20 | --total-thoughts 5 |
| 21 | |
| 22 | # Revise a previous thought |
| 23 | python scripts/sequential_think_cli.py think \ |
| 24 | --thought "Reconsidering step 1, I realize..." \ |
| 25 | --thought-number 3 \ |
| 26 | --total-thoughts 5 \ |
| 27 | --is-revision \ |
| 28 | --revises-thought 1 |
| 29 | |
| 30 | # Branch into alternative path |
| 31 | python scripts/sequential_think_cli.py think \ |
| 32 | --thought "Alternative approach: what if we..." \ |
| 33 | --thought-number 4 \ |
| 34 | --total-thoughts 6 \ |
| 35 | --branch-from 2 \ |
| 36 | --branch-id "alt-approach" |
| 37 | |
| 38 | # Final thought (complete chain) |
| 39 | python scripts/sequential_think_cli.py think \ |
| 40 | --thought "Conclusion: the solution is..." \ |
| 41 | --thought-number 5 \ |
| 42 | --total-thoughts 5 \ |
| 43 | --no-next |
| 44 | |
| 45 | # View thought history |
| 46 | python scripts/sequential_think_cli.py history [--format json|text] |
| 47 | |
| 48 | # Clear thought history |
| 49 | python scripts/sequential_think_cli.py clear |
| 50 | ``` |
| 51 | |
| 52 | ## Core Principles |
| 53 | |
| 54 | ### Iterative Thinking Process |
| 55 | - Each tool call = one "thought" in the chain |
| 56 | - Build upon, question, or revise previous thoughts |
| 57 | - Express uncertainty when it exists |
| 58 | |
| 59 | ### Dynamic Thought Count |
| 60 | - Start with initial estimate of `totalThoughts` |
| 61 | - Adjust up/down as understanding evolves |
| 62 | - Add more thoughts even after reaching initial end |
| 63 | |
| 64 | ### Hypothesis-Driven Approach |
| 65 | 1. Generate hypotheses as potential solutions emerge |
| 66 | 2. Verify hypotheses based on chain-of-thought steps |
| 67 | 3. Repeat until satisfied with solution |
| 68 | |
| 69 | ### Completion Criteria |
| 70 | - Only set `nextThoughtNeeded: false` when truly finished |
| 71 | - Must have satisfactory, verified answer |
| 72 | - Don't rush to conclusion |
| 73 | |
| 74 | ## When to Use |
| 75 | |
| 76 | | Scenario | Use Sequential Think | |
| 77 | |----------|---------------------| |
| 78 | | Complex debugging (3+ layers) | ✅ Yes | |
| 79 | | Architectural analysis | ✅ Yes | |
| 80 | | Multi-component investigation | ✅ Yes | |
| 81 | | Performance bottleneck analysis | ✅ Yes | |
| 82 | | Root cause analysis | ✅ Yes | |
| 83 | | Simple explanation | ❌ No | |
| 84 | | Single-file change | ❌ No | |
| 85 | | Straightforward fix | ❌ No | |
| 86 | |
| 87 | ## Parameters |
| 88 | |
| 89 | | Parameter | Type | Required | Description | |
| 90 | |-----------|------|----------|-------------| |
| 91 | | `thought` | string | Yes | Current thinking step content | |
| 92 | | `thoughtNumber` | int | Yes | Current position in sequence (1-based) | |
| 93 | | `totalThoughts` | int | Yes | Estimated total thoughts needed | |
| 94 | | `nextThoughtNeeded` | bool | No | Whether more thinking needed (default: true) | |
| 95 | | `isRevision` | bool | No | Whether this revises previous thinking | |
| 96 | | `revisesThought` | int | No | Which thought number is being reconsidered | |
| 97 | | `branchFromThought` | int | No | Branching point thought number | |
| 98 | | `branchId` | string | No | Identifier for current branch | |
| 99 | | `needsMoreThoughts` | bool | No | Signal that more thoughts needed beyond estimate | |
| 100 | |
| 101 | ## Output Format |
| 102 | |
| 103 | ```json |
| 104 | { |
| 105 | "thoughtNumber": 3, |
| 106 | "totalThoughts": 5, |
| 107 | "nextThoughtNeeded": true, |
| 108 | "branches": ["alt-approach"], |
| 109 | "thoughtHistoryLength": 3 |
| 110 | } |
| 111 | ``` |
| 112 | |
| 113 | ## Workflow Pattern |
| 114 | |
| 115 | ### Phase 1: Problem Decomposition |
| 116 | ``` |
| 117 | Thought 1: Identify problem scope and constraints |
| 118 | Thought 2: Break into sub-problems |
| 119 | Thought 3: Identify dependencies between sub-problems |
| 120 | ``` |
| 121 | |
| 122 | ### Phase 2: Hypothesis Generation |
| 123 | ``` |
| 124 | Thought 4: Generate initial hypothesis |
| 125 | Thought 5: Identify evidence needed to verify |
| 126 | ``` |
| 127 | |
| 128 | ### Phase 3: Verification & Iteration |
| 129 | ``` |
| 130 | Thought 6: Test hypothesis against evidence |
| 131 | Thought 7: Revise if needed (isRevision=true) |
| 132 | Thought 8: Branch if alternative path promising |
| 133 | ``` |
| 134 | |
| 135 | ### Phase 4: Conclusion |
| 136 | ``` |
| 137 | Final Thought: Synthesize findings, provide answer (nextThoughtNeeded=false) |
| 138 | ``` |
| 139 | |
| 140 | ## Best Practices |
| 141 | |
| 142 | 1. **Start with estimate, adjust as needed** |
| 143 | - Initial `totalThoughts` is just a guess |
| 144 | - Increase if problem more complex than expected |
| 145 | - Decrease if solution found early |
| 146 | |
| 147 | 2. **Use revisions for course correction** |
| 148 | - Mark `isRevision=true` when reconsidering |
| 149 | - Reference `revisesThought` for clarity |
| 150 | |
| 151 | 3. **Branch for alternative approaches** |
| 152 | - Use `branchFromThought` to explore alternatives |
| 153 | - Give meaningful `branchId` names |
| 154 | |
| 155 | 4. **Filter irrelev |