Agent skill · laurigates
docs-fetch-fallbacks
WebFetch 404/403/timeout/empty-SPA fallback ladder: strip query, raw.githubusercontent, `gh api`, docs-source-at-a-pinned-tag, context7/WebSearch. Use when a doc or GitHub URL fetch fails or returns a page with no content.
What it needs
About 4k tokens when loaded.
What this skill does
/docs:fetch-fallbacks A failed WebFetch is not a signal to retry the same URL. Re-issuing an identical request costs a round trip and returns the identical failure — the path is wrong, the resource is gated, or the host is slow, and none of those change between attempts. Read the failure signature, apply the fallback that matches it, and stop at two attempts. Execution Step 1: Read the failure signature Note the status and the URL shape before acting — the same status means different things depending on where it lands: Observed What it actually means --- --- 404 on a URL carrying ?ref=, ?v=, or tracking params The path is fine; the query is not 404 on github.com/<owner>/<repo>/blob/<ref>/<path> An HTML view URL, not a content URL 404 on a repo path with no host problem The content is reachable through the API, not the web UI 403 with an empty body on a public docs page Bot/UA gating, not authorization 403 on a github.com URL The resource needs authentication A timeout with no status at all Host slow or unreachable — needs a different source, not a retry No status at all, and the answer says the page had no content ("I don't have access to the content", "you've only provided the heading") The fetch succeeded. The page is client-rendered and the served HTML is an empty shell — see Step 4 Step 2: Apply the matching fallback Failure Try --- --- 404 on a docs page with ?ref=… Strip query string 404 on a GitHub blob URL Switch to raw.githubusercontent.com URL 404 on a repo path gh api repos/<owner>/<repo>/contents/<path> 403 on a public docs page Try once with a different UA or a search engine 403 on a GitHub URL Use gh api (authenticated) Timeout One retry, then fall back to context7 / WebSearch 200 with an empty shell (SPA) Fetch the docs source from the project's repo at a pinned tag (Step 4) If two attempts both fail, surface the failure in the response — do not loop. Step 3: Worked example — a GitHub blob URL WebFetch returns 404 on: Two things are wrong at once. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills laurigates/docs-fetch-fallbacks