skills/yao-2022-react/SKILL.md
Prompting paradigm combining reasoning traces with actions for LLM agents to interact with external tools
npx skillsauth add curiositech/windags-skills yao-2022-reactInstall 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.
Load this skill when addressing agent architecture design, debugging agent failures, designing information retrieval strategies, or making agent decision-making interpretable to humans.
IF agent expresses uncertainty (hedges, "I'm not sure", "might be")
→ THEN trigger external action (search, API call, retrieval)
IF agent states facts with high confidence AND domain is within training
→ THEN allow internal reasoning to continue
IF previous action returned "not found" or empty results
→ THEN reason about query reformulation strategy
IF factual accuracy is mission-critical (medical, legal, financial)
→ THEN default to external grounding regardless of confidence
IF task requires strategic planning or goal decomposition
→ THEN insert sparse, high-level thoughts at decision points
IF simple execution with known action sequence
→ THEN skip reasoning, execute actions directly
IF debugging failure or exception handling needed
→ THEN add reasoning trace to expose decision logic
IF token budget is constrained
→ THEN limit thoughts to: goal decomposition, search reformulation, exception handling
IF action returns unexpected result or error
→ THEN add thought analyzing what went wrong + corrective strategy
IF agent enters repetitive loop (same action 3+ times)
→ THEN force reasoning step: "Why am I stuck? What should I try instead?"
IF search returns empty/irrelevant results
→ THEN reason about query reformulation before next search
IF hallucinated information detected
→ THEN immediately insert retrieval action to verify facts
IF complex task with 4+ subtasks
→ THEN start with thought decomposing into subgoals
IF current subtask complete
→ THEN add thought tracking progress: "Done with X, now need Y"
IF environment state changed unexpectedly
→ THEN reason about how this affects remaining plan
IF stuck on subtask for 3+ actions
→ THEN reason about alternative approaches or skipping
Symptoms: Agent confidently states facts, builds elaborate reasoning chains, but information is fabricated Detection Rule: IF reasoning contains specific facts not verifiable through actions AND no recent external grounding Fix: Insert retrieval actions at uncertainty points; verify facts before building on them
Symptoms: Thought at every step describing obvious actions or restating observations Detection Rule: IF >60% of tokens are reasoning AND thoughts don't contain strategic decisions Fix: Limit thoughts to: goal decomposition, search reformulation, exception handling, progress tracking
Symptoms: Agent immediately starts acting without decomposing complex tasks, gets stuck or inefficient Detection Rule: IF complex multi-step task AND first action is attempted execution (not planning) Fix: Force initial thought decomposing goal into subgoals and strategy
Symptoms: Same action repeated 3+ times with same failure result, no learning from feedback Detection Rule: IF identical action-observation pair occurs 3 consecutive times Fix: Insert reasoning step analyzing why approach isn't working + alternative strategy
Symptoms: Empty search results followed by identical or minimally different queries Detection Rule: IF search returns "not found" AND next search query has >80% word overlap Fix: Add explicit reasoning about why search failed + systematic query reformulation strategy
Task: "What is the elevation of the birthplace of the director of the movie 'Inception'?"
Expert Trajectory:
Thought 1: This requires finding: (1) director of Inception, (2) director's birthplace, (3) elevation of that place. Let me start with the director.
Action 1: Search[Inception movie director]
Observation 1: Christopher Nolan directed Inception (2010)...
Thought 2: Got it - Christopher Nolan. Now I need his birthplace.
Action 2: Search[Christopher Nolan birthplace]
Observation 2: Christopher Nolan was born in Westminster, London, England
Thought 3: Now I need the elevation of Westminster, London. This might be tricky since it's a district.
Action 3: Search[Westminster London elevation above sea level]
Observation 3: Westminster, London is approximately 24 meters (79 feet) above sea level
Thought 4: Found it. The elevation is 24 meters or 79 feet.
Novice Mistakes: Would search "Inception director birthplace elevation" immediately, get confused results mixing multiple concepts. Expert decomposes systematically and verifies each fact before building on it.
Task: "Put a clean knife in the countertop" (ALFWorld navigation)
Expert Recovery Trajectory:
Action 1: take knife 1
Observation 1: You pick up the knife 1
Action 2: clean knife 1 with sinkbasin 1
Observation 2: Nothing happens.
Thought 1: Cleaning failed. I'm probably not at the right location. I need to navigate to the sinkbasin first, then clean the knife.
Action 3: go to sinkbasin 1
Observation 3: On the sinkbasin 1, you see a dishsponge 1, and a lettuce 1.
Action 4: clean knife 1 with sinkbasin 1
Observation 4: You clean the knife 1 using the sinkbasin 1.
Thought 2: Great! Now I have a clean knife. I need to find a countertop to place it on.
Key Decision: Expert recognizes failed action immediately, reasons about spatial requirements, adjusts strategy. Shows how external feedback corrects internal assumptions.
Task: "Were Scott Derrickson and Ed Wood of the same nationality?"
Expert Trajectory:
Thought 1: I need to find the nationality of both Scott Derrickson and Ed Wood, then compare them.
Action 1: Search[Scott Derrickson nationality]
Observation 1: Scott Derrickson is an American film director and screenwriter...
Thought 2: Scott Derrickson is American. Now I need Ed Wood's nationality.
Action 2: Search[Ed Wood nationality filmmaker]
Observation 2: Edward Davis Wood Jr. was an American filmmaker...
Thought 3: Ed Wood was also American. Both are American, so yes, they were the same nationality.
Confidence Signal: Expert searches for both facts despite potentially "knowing" Ed Wood is American, ensuring verification rather than risking hallucination.
Do NOT use ReAct for:
Delegate to other skills when:
mathematical-reasoning-strategieschain-of-thought-reasoningcode-generation-workflowscreative-generation-techniquesdata-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.