/thought-based-reasoning
Use when tackling complex reasoning tasks requiring step-by-step logic, multi-step arithmetic, commonsense reasoning, symbolic manipulation, or problems where simple prompting fails - provides comprehensive guide to Chain-of-Thought and related prompting techniques (Zero-shot
Claude Code
$ npx -y skills add NeoLabHQ/context-engineering-kit --skill thought-based-reasoning --agent claude-code
Codex
$ npx skills add NeoLabHQ/context-engineering-kit --skill thought-based-reasoning -a codex -y
Cursor
$ npx skills add NeoLabHQ/context-engineering-kit --skill thought-based-reasoning -a cursor -y
Gemini CLI
$ npx skills add NeoLabHQ/context-engineering-kit --skill thought-based-reasoning -a gemini-cli -y
GitHub Copilot
$ npx skills add NeoLabHQ/context-engineering-kit --skill thought-based-reasoning -a github-copilot -y
OpenCode
$ npx skills add NeoLabHQ/context-engineering-kit --skill thought-based-reasoning -a opencode -y
Windsurf
$ npx skills add NeoLabHQ/context-engineering-kit --skill thought-based-reasoning -a windsurf -y
SKILL.md
thought-based-reasoning.SKILL.mdname: thought-based-reasoning
description: Use when tackling complex reasoning tasks requiring step-by-step logic, multi-step arithmetic, commonsense reasoning, symbolic manipulation, or problems where simple prompting fails - provides comprehensive guide to Chain-of-Thought and related prompting techniques (Zero-shot CoT, Self-Consistency, Tree of Thoughts, Least-to-Most, ReAct, PAL, Reflexion) with templates, decision matrices, and research-backed patterns
Thought-Based Reasoning Techniques for LLMs
Overview
Chain-of-Thought (CoT) prompting and its variants encourage LLMs to generate intermediate reasoning steps before arriving at a final answer, significantly improving performance on complex reasoning tasks. These techniques transform how models approach problems by making implicit reasoning explicit.
Quick Reference
| Technique | When to Use | Complexity | Accuracy Gain | |-----------|-------------|------------|---------------| | Zero-shot CoT | Quick reasoning, no examples available | Low | +20-60% | | Few-shot CoT | Have good examples, consistent format needed | Medium | +30-70% | | Self-Consistency | High-stakes decisions, need confidence | Medium | +10-20% over CoT | | Tree of Thoughts | Complex problems requiring exploration | High | +50-70% on hard tasks | | Least-to-Most | Multi-step problems with subproblems | Medium | +30-80% | | ReAct | Tasks requiring external information | Medium | +15-35% | | PAL | Mathematical/computational problems | Medium | +10-15% | | Reflexion | Iterative improvement, learning from errors | High | +10-20% |
---
Core Techniques
1. Chain-of-Thought (CoT) Prompting
**Paper**: "Chain of Thought Prompting Elicits Reasoning in Large Language Models" (Wei et al., 2022) **Citations**: 14,255+
When to Use
- Multi-step arithmetic or math word problems
- Commonsense reasoning requiring logical deduction
- Symbolic reasoning tasks
- When you have good exemplars showing reasoning
How It Works
Provide few-shot examples that include intermediate reasoning steps, not just question-answer pairs. The model learns to generate similar step-by-step reasoning.
Prompt Template
Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now?
A: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. 5 + 6 = 11. The answer is 11.
Q: The cafeteria had 23 apples. If they used 20 to make lunch and bought 6 more, how many apples do they have?
A: The cafeteria had 23 apples originally. They used 20 to make lunch. So they had 23 - 20 = 3. They bought 6 more apples, so they have 3 + 6 = 9. The answer is 9.
Q: [YOUR QUESTION HERE]
A:
Strengths
- Significant accuracy improvements on reasoning tasks
- Interpretable intermediate steps
- Works well with large models (>100B parameters)
Limitations
- Requires crafting good exemplars
- Less effective on smaller models
- Can still make calculation errors
---
2. Zero-shot Chain-of-Thought
**Paper**: "Large Language Models are Zero-Shot Reasoners" (Kojima et al., 2022) **Citations**: 5,985+
When to Use
- No exemplars available
- Quick reasoning needed
- General-purpose reasoning across task types
- Prototyping before creating few-shot examples
How It Works
Simply append "Let's think step by step" (or similar phrase) to the prompt. This triggers the model to generate reasoning steps without any examples.
Prompt Template
Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there?
Let's think step by step.
**Alternative trigger phrases**:
- "Let's work this out step by step to be sure we have the right answer."
- "Let's break this down."
- "Let's approach this systematically."
- "First, let me understand the problem..."
Two-Stage Approach (More Robust)
**Stage 1 - Reasoning Extraction**:
Q: [QUESTION]
A: Let's think step by step.
**Stage 2 - Answer Extraction**:
[REASONING FROM STAGE 1]
Therefore, the answer is
Strengths
- No exemplar crafting required
- Generalizes across task types
- Simple to implement
Limitations
- Less effective than few-shot CoT
- Can produce verbose or irrelevant reasoning
- Sensitive to exact phrasing
---
3. Self-Consistency
**Paper**: "Self-Consistency Improves Chain of Thought Reasoning in Language Models" (Wang et al., 2022) **Citations**: 5,379+
When to Use
- High-stakes decisions requiring confidence
- Problems with multiple valid reasoning paths
- When you need to reduce variance in outputs
- Verification of reasoning correctness
How It Works
Sample multiple diverse reasoning paths, then select the most consistent answer via majority voting. The intuition: correct answers can be reached through multiple reasoning paths.
Prompt Template
[Use any CoT prompt - zero-shot or few-shot]
[Generate N samples with temperature > 0]
[Extract final answers from each sample]
[Return the most frequent answer (majority vote)]
Implementation Example
def self_consistency(prompt, n_samples=5, temperature=0.7):
answers = []
for _ in range(n_samples):
response = llm.generate(prompt, temperature=temperature)
answer = extract_answer(response)
answers.append(answer)
# Majority vote
return Counter(answers).most_common(1)[0][0]Strengths
- Significant accuracy boost over single-path CoT
- Provides confidence measure (agreement level)
- Task-agnostic improvement
Limitations
- Higher computational cost (N times more generations)
- Requires extractable discrete answers
- Diminishing returns beyond ~10-20 samples
---
4. Tree of Thoughts (ToT)
**Paper**: "Tree of Thoughts: Deliberate Problem Solving with Large Language Models" (Yao et al., 2023) **Citations**: 3,026+
When to Use
- Complex problems requiring ex
Read more
name: thought-based-reasoning description: Use when tackling complex reasoning tasks requiring step-by-step logic, multi-step arithmetic, commonsense reasoning, symbolic manipulation, or problems where simple prompting fails - provides comprehensive guide to Chain-of-Thought and related prompting techniques (Zero-shot CoT, Self-Consistency, Tree of Thoughts, Least-to-Most, ReAct, PAL, Reflexion) with templates, decision matrices, and research-backed patterns
Thought-Based Reasoning Techniques for LLMs
Overview
Chain-of-Thought (CoT) prompting and its variants encourage LLMs to generate intermediate reasoning steps before arriving at a final answer, significantly improving performance on complex reasoning tasks. These techniques transform how models approach problems by making implicit reasoning explicit.
Quick Reference
| Technique | When to Use | Complexity | Accuracy Gain | |-----------|-------------|------------|---------------| | Zero-shot CoT | Quick reasoning, no examples available | Low | +20-60% | | Few-shot CoT | Have good examples, consistent format needed | Medium | +30-70% | | Self-Consistency | High-stakes decisions, need confidence | Medium | +10-20% over CoT | | Tree of Thoughts | Complex problems requiring exploration | High | +50-70% on hard tasks | | Least-to-Most | Multi-step problems with subproblems | Medium | +30-80% | | ReAct | Tasks requiring external information | Medium | +15-35% | | PAL | Mathematical/computational problems | Medium | +10-15% | | Reflexion | Iterative improvement, learning from errors | High | +10-20% |
---
Core Techniques
1. Chain-of-Thought (CoT) Prompting
**Paper**: "Chain of Thought Prompting Elicits Reasoning in Large Language Models" (Wei et al., 2022) **Citations**: 14,255+
When to Use
- Multi-step arithmetic or math word problems
- Commonsense reasoning requiring logical deduction
- Symbolic reasoning tasks
- When you have good exemplars showing reasoning
How It Works
Provide few-shot examples that include intermediate reasoning steps, not just question-answer pairs. The model learns to generate similar step-by-step reasoning.
Prompt Template
Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now? A: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. 5 + 6 = 11. The answer is 11. Q: The cafeteria had 23 apples. If they used 20 to make lunch and bought 6 more, how many apples do they have? A: The cafeteria had 23 apples originally. They used 20 to make lunch. So they had 23 - 20 = 3. They bought 6 more apples, so they have 3 + 6 = 9. The answer is 9. Q: [YOUR QUESTION HERE] A:
Strengths
- Significant accuracy improvements on reasoning tasks
- Interpretable intermediate steps
- Works well with large models (>100B parameters)
Limitations
- Requires crafting good exemplars
- Less effective on smaller models
- Can still make calculation errors
---
2. Zero-shot Chain-of-Thought
**Paper**: "Large Language Models are Zero-Shot Reasoners" (Kojima et al., 2022) **Citations**: 5,985+
When to Use
- No exemplars available
- Quick reasoning needed
- General-purpose reasoning across task types
- Prototyping before creating few-shot examples
How It Works
Simply append "Let's think step by step" (or similar phrase) to the prompt. This triggers the model to generate reasoning steps without any examples.
Prompt Template
Q: A juggler can juggle 16 balls. Half of the balls are golf balls, and half of the golf balls are blue. How many blue golf balls are there? Let's think step by step.
**Alternative trigger phrases**:
- "Let's work this out step by step to be sure we have the right answer."
- "Let's break this down."
- "Let's approach this systematically."
- "First, let me understand the problem..."
Two-Stage Approach (More Robust)
**Stage 1 - Reasoning Extraction**:
Q: [QUESTION] A: Let's think step by step.
**Stage 2 - Answer Extraction**:
[REASONING FROM STAGE 1] Therefore, the answer is
Strengths
- No exemplar crafting required
- Generalizes across task types
- Simple to implement
Limitations
- Less effective than few-shot CoT
- Can produce verbose or irrelevant reasoning
- Sensitive to exact phrasing
---
3. Self-Consistency
**Paper**: "Self-Consistency Improves Chain of Thought Reasoning in Language Models" (Wang et al., 2022) **Citations**: 5,379+
When to Use
- High-stakes decisions requiring confidence
- Problems with multiple valid reasoning paths
- When you need to reduce variance in outputs
- Verification of reasoning correctness
How It Works
Sample multiple diverse reasoning paths, then select the most consistent answer via majority voting. The intuition: correct answers can be reached through multiple reasoning paths.
Prompt Template
[Use any CoT prompt - zero-shot or few-shot] [Generate N samples with temperature > 0] [Extract final answers from each sample] [Return the most frequent answer (majority vote)]
Implementation Example
def self_consistency(prompt, n_samples=5, temperature=0.7):
answers = []
for _ in range(n_samples):
response = llm.generate(prompt, temperature=temperature)
answer = extract_answer(response)
answers.append(answer)
# Majority vote
return Counter(answers).most_common(1)[0][0]Strengths
- Significant accuracy boost over single-path CoT
- Provides confidence measure (agreement level)
- Task-agnostic improvement
Limitations
- Higher computational cost (N times more generations)
- Requires extractable discrete answers
- Diminishing returns beyond ~10-20 samples
---
4. Tree of Thoughts (ToT)
**Paper**: "Tree of Thoughts: Deliberate Problem Solving with Large Language Models" (Yao et al., 2023) **Citations**: 3,026+
When to Use
- Complex problems requiring ex
A hand-crafted collection of advanced context engineering techniques and patterns with minimal token footprint, focused on improving agent result quality and predictability.
Other skills on context-engineering-kit.
add-task
creates draft task file in .specs/tasks/draft/ with original user intent
agent-evaluation
Evaluate and improve Claude Code commands, skills, and agents. Use when testing prompt effectiveness, validating context…
analyse-problem
Comprehensive A3 one-page problem analysis with root cause and action plan
analyse
Auto-selects best Kaizen method (Gemba Walk, Value Stream, or Muda) for target
analyze-issue
Analyze a GitHub issue and create a detailed technical specification
More skills from other plugins.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
ask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
Questions about thought-based-reasoning.
- Which coding agents can use thought-based-reasoning?
- thought-based-reasoning installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

