Agent skill

sequential-thinking

Dynamic problem-solving through structured sequential thoughts. Use when breaking down complex problems, planning multi-step solutions, analyzing ambiguous requirements, debugging intricate issues, exploring design alternatives, or tackling problems where the full scope is unclear. Enables thought revision, branching, and iterative refinement.

Stars 5
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/huynguyen03dev/opencode-setup/tree/main/skills/sequential-thinking

SKILL.md

Sequential Thinking

Overview

This skill provides structured sequential thinking for complex problem-solving through a dynamic, reflective thought process. Each thought can build on, question, or revise previous insights as understanding deepens.

When to Use

  • Breaking down complex problems into manageable steps
  • Planning and design with room for revision
  • Analysis that might need course correction
  • Problems where full scope is unclear initially
  • Multi-step solutions requiring maintained context
  • Filtering irrelevant information from complex scenarios
  • Debugging intricate issues requiring systematic exploration

Script Location

The script is located at: ~/.config/opencode/skills/sequential-thinking/scripts/sequential-thinking.ts

Use $SKILL_DIR or the full path when invoking from any directory.

Core Workflow

1. Initialize Thinking

Start a thinking sequence by estimating total thoughts needed:

bash
bun ~/.config/opencode/skills/sequential-thinking/scripts/sequential-thinking.ts sequentialthinking \
  --thought "Initial analysis of the problem..." \
  --thought-number 1 \
  --total-thoughts 5 \
  --next-thought-needed true

2. Continue Sequence

Build on previous thoughts, adjusting estimates as needed:

bash
bun ~/.config/opencode/skills/sequential-thinking/scripts/sequential-thinking.ts sequentialthinking \
  --thought "Building on insight from step 1..." \
  --thought-number 2 \
  --total-thoughts 5 \
  --next-thought-needed true

3. Revise Previous Thinking

When reconsidering earlier conclusions:

bash
bun ~/.config/opencode/skills/sequential-thinking/scripts/sequential-thinking.ts sequentialthinking \
  --thought "Reconsidering step 2, I realize..." \
  --thought-number 4 \
  --total-thoughts 6 \
  --is-revision true \
  --revises-thought 2 \
  --next-thought-needed true

4. Branch Exploration

Explore alternative approaches:

bash
bun ~/.config/opencode/skills/sequential-thinking/scripts/sequential-thinking.ts sequentialthinking \
  --thought "Alternative approach from step 3..." \
  --thought-number 5 \
  --total-thoughts 7 \
  --branch-from-thought 3 \
  --branch-id "alternative-approach" \
  --next-thought-needed true

5. Complete Thinking

Conclude when solution is verified:

bash
bun ~/.config/opencode/skills/sequential-thinking/scripts/sequential-thinking.ts sequentialthinking \
  --thought "Final verified conclusion..." \
  --thought-number 6 \
  --total-thoughts 6 \
  --next-thought-needed false

Key Features

  • Adjustable estimates: Modify totalThoughts up/down as understanding evolves
  • Thought revision: Mark thoughts as revisions with --is-revision and --revises-thought
  • Branching: Explore alternatives with --branch-from-thought and --branch-id
  • Non-linear thinking: Branch or backtrack as needed
  • Hypothesis verification: Generate and verify solution hypotheses iteratively

Parameters Reference

Parameter Required Description
--thought Yes Current thinking step content
--thought-number Yes Current position in sequence (1-based)
--total-thoughts Yes Estimated total thoughts (adjustable)
--next-thought-needed Yes true to continue, false to conclude
--is-revision No true if revising previous thinking
--revises-thought No Which thought number being revised
--branch-from-thought No Branching point thought number
--branch-id No Identifier for the branch
--needs-more-thoughts No Signal more thoughts needed

Output Formats

Control output with --output flag:

  • text (default): Human-readable text
  • json: Structured JSON
  • markdown: Markdown formatted
  • raw: Raw response data

Resources

scripts/

  • sequential-thinking.ts - MCP server wrapper for sequential thinking (requires Bun runtime)

references/

  • thinking-patterns.md - Common thinking patterns and examples for various problem types

Expand your agent's capabilities with these related and highly-rated skills.

huynguyen03dev/opencode-setup

context7

Fetch up-to-date documentation and code examples for any library or framework. Use when needing API references, code examples, library documentation, or framework guides. Supports React, Next.js, MongoDB, Supabase, and thousands of other libraries.

5 0
Explore
huynguyen03dev/opencode-setup

github

Interact with GitHub repositories, issues, pull requests, and code via the GitHub MCP server. This skill should be used when managing repositories, creating/updating files, working with issues and PRs, searching code/repos/users, creating branches, and performing code reviews. Supports all major GitHub API operations.

5 0
Explore
huynguyen03dev/opencode-setup

code-review

Use when receiving code review feedback (especially if unclear or technically questionable), when completing tasks or major features requiring review before proceeding, or before making any completion/success claims. Covers three practices - receiving feedback with technical rigor over performative agreement, requesting reviews via code-reviewer subagent, and verification gates requiring evidence before any status claims. Essential for subagent-driven development, pull requests, and preventing false completion claims.

5 0
Explore
huynguyen03dev/opencode-setup

gh-grep

Search real-world code examples across millions of GitHub repositories using grep.app. This skill should be used when looking for implementation patterns, API usage examples, library integration patterns, or production code references. Supports literal code search, regex patterns, and filtering by language/repo/path.

5 0
Explore
huynguyen03dev/opencode-setup

deep-wiki

Access AI-generated documentation and insights for GitHub repositories via DeepWiki. This skill should be used when exploring unfamiliar codebases, understanding repository architecture, finding implementation patterns, or asking questions about how a GitHub project works. Supports any public GitHub repository.

5 0
Explore
huynguyen03dev/opencode-setup

gkg

Global Knowledge Graph for codebase analysis. This skill should be used when searching for code definitions (functions, classes, methods), finding references to symbols, understanding code structure, analyzing import usage, generating repository maps, or performing impact analysis before refactoring. Supports TypeScript, JavaScript, Python, Java, and more.

5 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results