Skip to content
Development
Skill

/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

From plugin
context-engineering-kit
1.8k68 skills21 agents1 command

Claude Code

$ npx -y skills add NeoLabHQ/context-engineering-kit --skill tree-of-thoughts --agent claude-code

SKILL.md

tree-of-thoughts.SKILL.md
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

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 Solution

Process

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: Map the solution space**
Identify the major dimensions along which
Read more
@neolabhq
Ships withcontext-engineering-kit

A hand-crafted collection of advanced context engineering techniques and patterns with minimal token footprint, focused on improving agent result quality and predictability.

1.8k68 skills21 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.8k
Star history of NeoLabHQ/context-engineering-kit on GitHub, a chart by star-history.com

Other skills on context-engineering-kit.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react3d252k
@facebook@facebookInstall Skill

Questions about tree-of-thoughts.

Which coding agents can use tree-of-thoughts?
tree-of-thoughts 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.