apps/docs/skills/reasoning-strategy-selection/SKILL.md
Select and configure the right reasoning strategy, native FC behavior, and output quality pipeline for any task type.
npx skillsauth add tylerjrbuell/reactive-agents-ts reasoning-strategy-selectionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce a .withReasoning() call with the correct strategy, iteration budget, and tool gates for the task — with output quality pipeline active when format matters.
.withReasoning() for any non-trivial agent// Default — adaptive works for most unknown workloads
const agent = await ReactiveAgents.create()
.withProvider("anthropic")
.withReasoning({
defaultStrategy: "adaptive",
maxIterations: 12,
})
.withTools()
.withVerification() // runtime output quality check
.withCostTracking({ perRequest: 0.30 })
.build();
| Task type | Strategy | Why |
|-----------|----------|-----|
| Simple Q&A, classification, extraction | "reactive" | Single-pass, minimal tokens |
| Multi-step with knowable plan upfront | "plan-execute-reflect" | Structured decomposition + reflection |
| Open-ended research, exploration | "adaptive" | Auto-escalates when stuck |
| Ambiguous problems needing exploration | "tree-of-thought" | Branch multiple paths, prune weak ones |
| Quality-critical iterative refinement | "reflexion" | Self-critique loop improves output |
| Unknown complexity | "adaptive" | Best safe default |
// NOTE: strategy name is "plan-execute-reflect" — NOT "plan-execute"
.withReasoning({ defaultStrategy: "plan-execute-reflect", maxIterations: 15 })
// Auto-switch strategy when agent gets stuck (loop detected)
.withReasoning({
defaultStrategy: "adaptive",
enableStrategySwitching: true,
maxStrategySwitches: 2,
fallbackStrategy: "plan-execute-reflect", // deterministic fallback (no LLM call)
})
Forces the agent to call specific tools before the final answer is accepted:
.withTools()
.withRequiredTools({
tools: ["web-search"], // must be called at least once
maxRetries: 3, // retry if model skips
})
// Adaptive mode — framework infers which tools are required from task phrasing
.withRequiredTools({ adaptive: true })
The framework automatically extracts task intent (regex-based, no LLM call) and validates the output format. Supported OutputFormat values: "markdown", "json", "csv", "html", "code", "list", "prose".
Hint the desired format in the task prompt and the pipeline validates + repairs if needed:
// "return as JSON" → framework detects json format, validates output, repairs if needed
await agent.run("Analyse the data and return the results as JSON with keys: summary, score, flags");
The FinalizedOutput shape: { output, formatValidated, synthesized, source, validationReason? } — available in result.metadata.
Subscribe to EventBus events to track strategy decisions:
agent.on("StrategySwitchEvaluated", (e) => console.log("Evaluating switch:", e));
agent.on("StrategySwitched", (e) => console.log("Switched to:", e.newStrategy));
| Method | Key params | Default |
|--------|-----------|---------|
| .withReasoning(opts?) | { defaultStrategy?, maxIterations?, enableStrategySwitching?, maxStrategySwitches?, fallbackStrategy? } | adaptive, 10 |
| .withRequiredTools(cfg) | { tools?: string[], adaptive?: boolean, maxRetries?: number } | — |
| .withMaxIterations(n) | number | 10 |
| .withVerification(opts?) | { hallucinationDetection?, passThreshold?, useLLMTier? } | — |
"plan-execute" throws StrategyNotFoundError — the correct name is "plan-execute-reflect""reflexion" is expensive — each iteration runs a self-critique LLM call; cap maxIterations at 6–8"tree-of-thought" spawns multiple branches — multiply expected token cost by branch factorenableStrategySwitching: true without maxStrategySwitches defaults to 2 — agent may not switch enough for complex taskswithRequiredTools without withTools does nothing — tools must be enabled firstmaxIterations without .withCostTracking() can produce runaway costs on stuck agentsdevelopment
Orient to the Reactive Agents framework, understand the builder API shape, and select the right capability skills for your task.
testing
Enable output verification (hallucination detection, semantic entropy, self-consistency), add post-run verification steps, and run LLM-scored evals across 5 quality dimensions.
data-ai
Configure per-provider behavior, understand streaming quirks, and use the 7-hook adapter system for optimal performance across LLM providers.
data-ai
Configure the 4-layer memory system with SQLite/FTS5/vec storage for persistent agent knowledge that survives sessions.