/tree-of-thoughts
Execute tasks through systematic exploration, pruning, and expansion using Tree of Thoughts methodology with meta-judge evaluation specifications and multi-agent evaluation
$ npx -y skills add NeoLabHQ/context-engineering-kit --skill tree-of-thoughts --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/tree-of-thoughts
Context preview
The summary Claude sees to decide when to auto-load this skill.
Execute tasks through systematic exploration, pruning, and expansion using Tree of Thoughts methodology with meta-judge evaluation specifications and multi-agent evaluation
SKILL.md
tree-of-thoughts.SKILL.mdname: tree-of-thoughts
description: Execute tasks through systematic exploration, pruning, and expansion using Tree of Thoughts methodology with meta-judge evaluation specifications and multi-agent evaluation
argument-hint: Task description and optional output path/criteria
tree-of-thoughts
<task> Execute complex reasoning tasks through systematic exploration of solution space, pruning unpromising branches, expanding viable approaches, and synthesizing the best solution. </task>
<context> This command implements the Tree of Thoughts (ToT) pattern for tasks requiring exploration of multiple solution paths before committing to full implementation. It combines creative sampling, meta-judge-generated evaluation specifications, multi-perspective evaluation, adaptive strategy selection, and evidence-based synthesis to produce superior outcomes.
Key benefits:
- **Systematic exploration** - Multiple agents explore different regions of the solution space
- **Structured evaluation** - Meta-judges produce tailored rubrics and criteria before judging
- **Independent verification** - Judges apply meta-judge specifications mechanically, reducing bias
- **Adaptive strategy** - Clear winners get polished, split decisions get synthesized, failures get redesigned
</context>
Pattern: Tree of Thoughts (ToT)
This command implements an eight-phase systematic reasoning pattern with meta-judge evaluation and adaptive strategy selection:
Phase 1: Exploration (Propose Approaches)
┌─ Agent A → Proposals A1, A2 (with probabilities) ─┐
Task ───┼─ Agent B → Proposals B1, B2 (with probabilities) ─┼─┐
└─ Agent C → Proposals C1, C2 (with probabilities) ─┘ │
│
Phase 1.5: Pruning Meta-Judge (runs in parallel with Phase 1) │
Meta-Judge → Pruning Evaluation Specification YAML ───┤
│
Phase 2: Pruning (Vote for Best 3) │
┌─ Judge 1 → Votes + Rationale ─┐ │
├─ Judge 2 → Votes + Rationale ─┼─────────────────────┤
└─ Judge 3 → Votes + Rationale ─┘ │
│ │
├─→ Select Top 3 Proposals │
│ │
Phase 3: Expansion (Develop Full Solutions) │
┌─ Agent A → Solution A (from proposal X) ─┐ │
├─ Agent B → Solution B (from proposal Y) ─┼──────────┤
└─ Agent C → Solution C (from proposal Z) ─┘ │
│
Phase 3.5: Evaluation Meta-Judge (runs in parallel w/ Phase 3)│
Meta-Judge → Evaluation Specification YAML ───────────┤
│
Phase 4: Evaluation (Judge Full Solutions) │
┌─ Judge 1 → Report 1 ─┐ │
├─ Judge 2 → Report 2 ─┼──────────────────────────────┤
└─ Judge 3 → Report 3 ─┘ │
│
Phase 4.5: Adaptive Strategy Selection │
Analyze Consensus ────────────────────────────────────┤
├─ Clear Winner? → SELECT_AND_POLISH │
├─ All Flawed (<3.0)? → REDESIGN (Phase 3) │
└─ Split Decision? → FULL_SYNTHESIS │
│ │
Phase 5: Synthesis (Only if FULL_SYNTHESIS) │
Synthesizer ────────────────────┴──────────────────────┴─→ Final SolutionProcess
Setup: Create Directory Structure
Before starting, ensure the directory structure exists:
mkdir -p .specs/research .specs/reports
**Naming conventions:**
- Proposals: `.specs/research/{solution-name}-{YYYY-MM-DD}.proposals.[a|b|c].md`
- Pruning: `.specs/research/{solution-name}-{YYYY-MM-DD}.pruning.[1|2|3].md`
- Selection: `.specs/research/{solution-name}-{YYYY-MM-DD}.selection.md`
- Evaluation: `.specs/reports/{solution-name}-{YYYY-MM-DD}.[1|2|3].md`
Where:
- `{solution-name}` - Derived from output path (e.g., `users-api` from output `specs/api/users.md`)
- `{YYYY-MM-DD}` - Current date
**Note:** Solutions remain in their specified output locations; only research and evaluation files go to `.specs/`
Phase 1: Exploration (Propose Approaches)
Launch **3 independent agents in parallel** (recommended: Sonnet for speed):
1. Each agent receives **identical task description and context** 2. Each agent **generates 6 high-level approaches** (not full implementations) 3. For each approach, agent provides:
- **Approach description** (2-3 paragraphs)
- **Key design decisions** and trade-offs
- **Probability estimate** (0.0-1.0)
- **Estimated complexity** (low/medium/high)
- **Potential risks** and failure modes
4. Proposals saved to `.specs/research/{solution-name}-{date}.proposals.[a|b|c].md`
**Key principle:** Systematic exploration through probabilistic sampling from the full distribution of possible approaches.
**Prompt template for explorers:**
<task>
{task_description}
</task>
<constraints>
{constraints_if_any}
</constraints>
<context>
{relevant_context}
</context>
<output>
{.specs/research/{solution-name}-{date}.proposals.[a|b|c].md - each agent gets unique letter identifier}
</output>
Instructions:
Let's approach this systematically by first understanding what we're solving, then exploring the solution space.
**Step 1: Decompose the problem**
Before generating approaches, break down the task:
- What is the core problem being solved?
- What are the key constraints and requirements?
- What subproblems must any solution address?
- What are the evaluation criteria for success?
**Step 2:Read more
name: tree-of-thoughts description: Execute tasks through systematic exploration, pruning, and expansion using Tree of Thoughts methodology with meta-judge evaluation specifications and multi-agent evaluation argument-hint: Task description and optional output path/criteria
tree-of-thoughts
<task> Execute complex reasoning tasks through systematic exploration of solution space, pruning unpromising branches, expanding viable approaches, and synthesizing the best solution. </task>
<context> This command implements the Tree of Thoughts (ToT) pattern for tasks requiring exploration of multiple solution paths before committing to full implementation. It combines creative sampling, meta-judge-generated evaluation specifications, multi-perspective evaluation, adaptive strategy selection, and evidence-based synthesis to produce superior outcomes.
Key benefits:
- **Systematic exploration** - Multiple agents explore different regions of the solution space
- **Structured evaluation** - Meta-judges produce tailored rubrics and criteria before judging
- **Independent verification** - Judges apply meta-judge specifications mechanically, reducing bias
- **Adaptive strategy** - Clear winners get polished, split decisions get synthesized, failures get redesigned
</context>
Pattern: Tree of Thoughts (ToT)
This command implements an eight-phase systematic reasoning pattern with meta-judge evaluation and adaptive strategy selection:
Phase 1: Exploration (Propose Approaches)
┌─ Agent A → Proposals A1, A2 (with probabilities) ─┐
Task ───┼─ Agent B → Proposals B1, B2 (with probabilities) ─┼─┐
└─ Agent C → Proposals C1, C2 (with probabilities) ─┘ │
│
Phase 1.5: Pruning Meta-Judge (runs in parallel with Phase 1) │
Meta-Judge → Pruning Evaluation Specification YAML ───┤
│
Phase 2: Pruning (Vote for Best 3) │
┌─ Judge 1 → Votes + Rationale ─┐ │
├─ Judge 2 → Votes + Rationale ─┼─────────────────────┤
└─ Judge 3 → Votes + Rationale ─┘ │
│ │
├─→ Select Top 3 Proposals │
│ │
Phase 3: Expansion (Develop Full Solutions) │
┌─ Agent A → Solution A (from proposal X) ─┐ │
├─ Agent B → Solution B (from proposal Y) ─┼──────────┤
└─ Agent C → Solution C (from proposal Z) ─┘ │
│
Phase 3.5: Evaluation Meta-Judge (runs in parallel w/ Phase 3)│
Meta-Judge → Evaluation Specification YAML ───────────┤
│
Phase 4: Evaluation (Judge Full Solutions) │
┌─ Judge 1 → Report 1 ─┐ │
├─ Judge 2 → Report 2 ─┼──────────────────────────────┤
└─ Judge 3 → Report 3 ─┘ │
│
Phase 4.5: Adaptive Strategy Selection │
Analyze Consensus ────────────────────────────────────┤
├─ Clear Winner? → SELECT_AND_POLISH │
├─ All Flawed (<3.0)? → REDESIGN (Phase 3) │
└─ Split Decision? → FULL_SYNTHESIS │
│ │
Phase 5: Synthesis (Only if FULL_SYNTHESIS) │
Synthesizer ────────────────────┴──────────────────────┴─→ Final SolutionProcess
Setup: Create Directory Structure
Before starting, ensure the directory structure exists:
mkdir -p .specs/research .specs/reports
**Naming conventions:**
- Proposals: `.specs/research/{solution-name}-{YYYY-MM-DD}.proposals.[a|b|c].md`
- Pruning: `.specs/research/{solution-name}-{YYYY-MM-DD}.pruning.[1|2|3].md`
- Selection: `.specs/research/{solution-name}-{YYYY-MM-DD}.selection.md`
- Evaluation: `.specs/reports/{solution-name}-{YYYY-MM-DD}.[1|2|3].md`
Where:
- `{solution-name}` - Derived from output path (e.g., `users-api` from output `specs/api/users.md`)
- `{YYYY-MM-DD}` - Current date
**Note:** Solutions remain in their specified output locations; only research and evaluation files go to `.specs/`
Phase 1: Exploration (Propose Approaches)
Launch **3 independent agents in parallel** (recommended: Sonnet for speed):
1. Each agent receives **identical task description and context** 2. Each agent **generates 6 high-level approaches** (not full implementations) 3. For each approach, agent provides:
- **Approach description** (2-3 paragraphs)
- **Key design decisions** and trade-offs
- **Probability estimate** (0.0-1.0)
- **Estimated complexity** (low/medium/high)
- **Potential risks** and failure modes
4. Proposals saved to `.specs/research/{solution-name}-{date}.proposals.[a|b|c].md`
**Key principle:** Systematic exploration through probabilistic sampling from the full distribution of possible approaches.
**Prompt template for explorers:**
<task>
{task_description}
</task>
<constraints>
{constraints_if_any}
</constraints>
<context>
{relevant_context}
</context>
<output>
{.specs/research/{solution-name}-{date}.proposals.[a|b|c].md - each agent gets unique letter identifier}
</output>
Instructions:
Let's approach this systematically by first understanding what we're solving, then exploring the solution space.
**Step 1: Decompose the problem**
Before generating approaches, break down the task:
- What is the core problem being solved?
- What are the key constraints and requirements?
- What subproblems must any solution address?
- What are the evaluation criteria for success?
**Step 2:A hand-crafted collection of advanced context engineering techniques and patterns with minimal token footprint, focused on improving agent result quality and predictability.
Repo: NeoLabHQ/context-engineering-kit
Other skills on context-engineering-kit.
- /agent-evaluation
Evaluate and improve Claude Code commands, skills, and agents. Use when testing prompt effectiveness, validating context engineering choices, or measuring improvement quality.
Open skill - /apply-anthropic-skill-best-practices
Comprehensive guide for skill development based on Anthropic's official best practices - use for complex skills requiring detailed structure
Open skill - /context-engineering
Understand the components, mechanics, and constraints of context in agent systems. Use when writing, editing, or optimizing commands, skills, or sub-agents prompts.
Open skill - /create-agent
Comprehensive guide for creating Claude Code agents with proper structure, triggering conditions, system prompts, and validation - combines official Anthropic best practices with proven patterns
Open skill - /create-command
Interactive assistant for creating new Claude commands with proper structure, patterns, and MCP tool integration
Open skill - /create-hook
Create and configure git hooks with intelligent project analysis, suggestions, and automated testing
Open skill

