search-fail-pivot
What it does
This skill gives the AI agent a simple rule for when to stop searching the web and move on. It is for people who want tasks finished rather than stuck on repeated search errors.
When to use it
- βWhen the search tool returns unknown errors twice in a row on the same or similar queries.
- βWhen search results are empty or access is denied after repeated attempts.
- βWhen you need a document made and fresh web data is not coming through.
Skill link
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/search-fail-pivot/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSearch for the latest rules on dog daycare licensing. If the search keeps failing, go ahead with what you know and say so.β
5 new skills a week. 1 minute to read.
How it works
The agent counts consecutive search failures. After two failures on similar queries, it stops searching, notes what it tried to find, and continues the task with its own knowledge.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Search Tool Failure Detection and Pivot Strategy
Purpose
When using search_web or similar external data retrieval tools, repeated failures waste iterations. This skill provides a diagnostic heuristic to recognize when to abandon search attempts and proceed with existing domain knowledge.
Core Heuristic
If search_web fails 2+ consecutive times with 'unknown error' or similar non-recoverable errors, pivot to domain knowledge + run_shell for document generation.
Do not attempt more than 2 retries on the same or similar queries before pivoting.
Step-by-Step Instructions
Step 1: Track Search Failures
Monitor search_web outcomes during your task:
- Count consecutive failures (empty results, 'unknown error', timeout, access denied)
- Note the error type - distinguish between:
- Recoverable: Rate limiting, temporary timeout (retry 1-2 times)
- Non-recoverable: 'unknown error', persistent empty results, access denied
Step 2: Apply the 2-Failure Rule
IF search_web failures >= 2 (same or similar queries)
THEN:
1. Stop attempting search_web
2. Document what information you attempted to retrieve
3. Proceed with existing domain knowledge
Step 3: Pivot to Domain Knowledge
When pivoting:
- Acknowledge the limitation: Note that external verification was attempted but unavailable
- Use established knowledge: Draw on training data for well-known facts, laws, cases, standards
- Generate with run_shell: Create documents using Python/bash scripts rather than waiting for external data
Example pivot workflow:
# Instead of continuing search_web attempts:
# 1. Compile known information from domain knowledge
known_facts = {
"law": "COPPA requirements for children's data",
"precedent": "FTC v. Google/YouTube settlement patterns",
"jurisdiction": "California privacy law framework"
}
# 2. Generate document directly
# Use run_shell with Python to create PDF/DOC
Step 4: Document Generation Pattern
When generating documents after pivoting:
# Use run_shell to execute document generation
# Example: Create legal memo with Python + reportlab
python << 'EOF'
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
# Generate document with domain knowledge
c = canvas.Canvas("memo.pdf", pagesize=letter)
c.drawString(100, 750, "Legal Analysis based on established precedents")
# ... continue with known information
c.save()
EOF
When This Applies
This heuristic is particularly useful for:
| Task Type | Why It Applies |
|---|---|
| Legal research | Case law and statutes are well-documented in training |
| Technical documentation | Standards and best practices are established knowledge |
| Historical analysis | Past events and data are in training corpus |
| Regulatory compliance | Major regulations (GDPR, COPPA, HIPAA) are well-known |
When NOT to Pivot
Do NOT apply this heuristic when:
- You need current/time-sensitive data (stock prices, weather, news < 24hrs)
- The task explicitly requires external verification
- You have not yet attempted the search (first attempt should complete)
- Errors are clearly recoverable (rate limit with retry-after header)
Example Decision Flow
Attempt search_web β Success? β Yes β Use results
β
No
β
Is this failure #1? β Yes β Retry once with modified query
β
No (failure #2+)
β
Pivot to domain knowledge + run_shell document generation
Benefits
- Saves iterations: Avoids wasting 3-4 attempts on unavailable data
- Maintains progress: Task continues instead of stalling on search
- Leverages training: Uses the substantial knowledge already available
- Clear handoff: Explicitly documents the pivot decision for transparency
Anti-Patterns to Avoid
β Continuing search_web attempts beyond 2 failures
β Not documenting why you pivoted from search
β Applying this to tasks requiring real-time data
β Abandoning search on first failure without retry
β
Apply 2-failure rule consistently
β
Document the pivot decision in your output
β
Use run_shell efficiently after pivoting
β
Distinguish recoverable vs non-recoverable errors
FAQ
What counts as a recoverable error?
The skill treats rate limits and short timeouts as recoverable, so the agent may retry once or twice.
Will the agent tell me it did not search?
Yes, the skill asks the agent to acknowledge that external checks were unavailable.
Is the pivot a final decision?
The skill sets two failures as the limit, after which the agent proceeds without search.
Details
Original description by the author
Heuristic for detecting search tool failures and pivoting to domain knowledge for document generation
repo: HKUDS/AgentPilot
Popularity
- GitHub stars
- 7.8k
- Ranking position
- #12994
- License
- MIT
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
agentpilot
7.8kHelps your agent improve a project step by step by preparing a task and running the AgentPilot loop that proposes, tests and scores changes.
openspace
7.8kHelps your agent set up OpenSpace, a tool that stores and fetches agent skills, and connect it to your AI app through MCP.
rsi-arena
7.8kHelps your agent set up and run standard AI benchmark tests, such as AIME and Terminal-Bench, to compare different improvement methods.
experiment-guide
7.8kHelps your agent plan small experiments, read their results and record findings while it investigates how to improve a program.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.