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
What this skill does
# 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:
```bash
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:**
```markdown
<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 solutions can vary:
- Architecture patterns (e.g., monolithic vs distributed)
- Implementation strategies (e.g., eager vs lazy)
- Trade-off axes (e.g., performance vs simplicity)
**Step 3: Generate 6 distinct high-level approaches**
**Sampling guidance:**
Please sample approaches at random from the [full distribution / tails of the distribution]
- For first 3 approaches aim for high probability, over 0.80
- For last 3 approaches aim for diversity - explore different regions of the solution space, such that the probability of each response is less than 0.10
For each approach, provide:
- Name and one-sentence summary
- Detailed description (2-3 paragraphs)
- Key design decisions and rationale
- Trade-offs (what you gain vs what you sacrifice)
- Probability (0.0-1.0)
- Complexity estimate (low/medium/high)
- Potential risks and failure modes
**Step 4: Verify diversity**
Before finalizing, check:
- Are approaches genuinely different, not minor variations?
- Do they span different regions of the solution space?
- Have you covered both conventional and unconventional options?
CRITICAL:
- Do NOT implement full solutions yet - only high-level approaches
- Ensure approaches are genuinely different, not minor variations
```
### Phase 1.5: Dispatch Pruning Meta-Judge
**CRITICAL**: Launch the pruning meta-judge **in parallel with Phase 1 exploration agents**. The meta-judge does not need exploration output to generate pruning criteria — it only needs the original task description.
The pruning meta-judge generates an evaluation specification (rubrics, checklist, scoring criteria) tailored to evaluating high-level proposals for pruning.
**Prompt template for pruning meta-judge:**
```markdown
## Task
Generate an evaluation specification yaml for pruning high-level solution proposals. You will produce rubrics, checklists, and scoring criteria that judge agents will use to select the top 3 proposals for full development.
CLAUDE_PLUGIN_ROOT=`${CLAUDE_PLUGIN_ROOT}`
## User Prompt
{Original task description from user}
## Context
{Any relevant codebase context, file paths, constraints}
## Artifact Type
proposals (high-level approaches with probability estimates,Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.