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-techniquestools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.