Docs guide

From fivetaku/gptaku-plugins-codex · View interactive version

Docs guide is an AI agent skill from the GitHub repository fivetaku/gptaku-plugins-codex. Fetch and explain official documentation for any library, framework, API, or service using an llms.txt-first strategy — triggers on "How do I…", "What is…", "How does X work", "Best practice for…" about React, Next.js, Vue, Django, FastAPI, Stripe, Supabase, LangChain and any other library; on expli

How to use this skill

Skill file

docs-guide for Codex

Read these first:

Load on demand (spec-level or fetch-prompt workflow questions):


Scope

Any library, framework, API, or service with official documentation — including LLM provider APIs (OpenAI, Anthropic, Google Gemini, etc.) via their llms.txt indexes listed in references/llms-txt-sites.md.

Trigger on:

When a question spans several tools or skills (e.g., "How to use Stripe inside my agent runtime"), this skill owns the external-documentation part only.


Arguments

When invoked as docs-guide [library] [question], parse the leading token(s) as the library and the rest as the topic:


Clarification — docs-guide is minimal-interview

This plugin mostly needs just two facts: library and topic.

Per shared/questioning-policy.md §2c — if the user already named the library and topic, proceed immediately without asking anything.

If the library OR topic is genuinely ambiguous (e.g., "Router" with no project context), ask exactly ONE question per §A below (question tool first, numbered block only as fallback), then proceed. With request_user_input_async, end the turn after the call and continue when the answer message arrives.

Async call shape: {"questions":[{"title":"Header — question","options":["Recommended (Recommended) — why","Alternative — trade-off"]}]}. Each question has only title and options (array of strings). question, header, id belong to Plan-mode request_user_input only and make the async call fail to parse. Do not add an "Other / type your own" option; free text is added automatically.

§A — Ask with the question tool (numbered block is the fallback)

Ask with the §A question tool: request_user_input_async (default mode; write one short line after the call and end the turn), or request_user_input (Plan mode). Recommended option first; no "Other" option (free text is added automatically). Only if neither tool exists, output this numbered chat block (fallback shape):

질문: <한 줄 질문>
1. <추천안> — 무엇인지, 왜 이걸 추천하는지
2. <대안> — 무엇인지, 트레이드오프
3. 직접 입력 (문장으로 말씀해 주세요)

Step 0 — Project Context Detection

Before fetching, quickly scan local dependency files to detect library version:

package.json, requirements.txt, pyproject.toml, go.mod, Cargo.toml, pom.xml, build.gradle

Use this for:

Skip this step if the question already names a specific library and version.


Intent Classification (Smart Broad)

FETCH (external lookup needed)

SKIP (answer from knowledge)

DISAMBIGUATE

When unsure between FETCH and SKIP, answer from knowledge first, then offer: "공식 문서도 확인해볼까요?"


Version Awareness

  1. Project context first — check Step 0
  2. User mention — "React 19", "Django 5.0"
  3. Normalize — react 18, React v18, @18, ^18.2.0 → all mean React 18.x
  4. Version-specific URLs — Next.js /docs/14/, Django /en/5.0/, Python /3.12/library/
  5. Default — latest stable; note which version was used

Common pitfalls:

| Situation | Risk | Action |

|-----------|------|--------|

| "React" without version | React 18 vs 19 differ significantly | Check package.json first |

| Library has LTS and current | User may need LTS-specific docs | Ask if unclear |

| Pre-release/canary docs | May contain unstable APIs | Warn user |

| Archived docs (e.g., CRA) | Deprecated project | Note it |


Documentation Retrieval Strategy

Step 1 — Check known llms.txt sites

Load references/llms-txt-sites.md. If the library is listed, use that URL directly.

Step 2 — Try llms.txt on the official site

If not in the known list:

  1. If you know the official docs domain → try llms.txt directly
  2. If unsure → search for {library name} official site to find the domain
  3. Try in order:

If llms.txt exists:

Step 3 — Fallback strategies (no llms.txt)

Load references/fallback-strategies.md and try in order:

3a. Per-technology strategy — 40+ technologies with best known URLs

3b. GitHub raw markdown (most reliable for OSS):

3c. sitemap.xml (universal fallback):

3d. Platform-specific signals (low reliability for Hugo — skip straight to sitemap/GitHub there):

3e. Search (last resort):


Spec-Level Drill-Down Requirement (v1.3.3)

For these question types, fetching only the index/overview page is INSUFFICIENT. You MUST fetch the per-item detail page.

Spec-level triggers

Drill-down protocol

Load references/webfetch-prompts.md before fetching spec-level pages.

  1. Fetch the index/overview page (llms.txt or root docs)
  2. If the question matches any spec-level trigger above, do NOT stop here
  3. From the index, extract actual href URLs for each relevant item
  1. Fetch each detail page (claim-type-bounded cap below)
  2. Cite the detail page URL in the answer, not just the index

Drill-down cap

| Question class | Index | Detail max |

|---|---|---|

| general how-to | 1 | 1-2 |

| spec single target | 1 | 3 |

| latest / current 질문 | 1 | 5 (overview + changelog + pricing/deprecation) |

| matrix / comparison | up to 8 total | 3 per provider |

| 30+ candidates | rank by exact token/title/href match → top 5-8 | only those needed for claim |

Stop condition: each exact claim in the answer (model ID, price, date, availability, schema) has at least one detail-page source.


Quality Gate

General questions

Spec-level questions

Self-reflection checklist (before sending answer for spec-level questions)

If any unchecked → backtrack to drill-down step or downgrade answer to "확인하지 못함".

Insufficient evidence fallback

"공식 문서에서 확인하지 못했습니다. 내부 지식 기반으로 답변합니다." / "Could not verify from official docs. Answering from knowledge."

User feedback handling


Disambiguation Patterns

When a query maps to multiple libraries:

By project context

Ecosystem conventions


Known Limitations

JS-rendered doc sites

Marketing llms.txt

Hugo sites

docs_map.md variant


Error Handling

| Situation | Action |

|-----------|--------|

| llms.txt returns 404 | Silently try next URL pattern, then fall back |

| llms.txt linked URL returns 404 | Strip .md extension and retry |

| Specific doc path 404 | Try parent path for table of contents |

| GitHub main branch 404 | Try master, then version-specific branches |

| Fetch returns empty/JS content | Try GitHub source or answer from knowledge |

| Fetch fails (network/timeout) | Try an alternative URL, then report |

| Content is not documentation (marketing, landing page) | Discard and try next strategy |

| Item in index but detail URL unknown | Re-fetch index with Template 1 from references/webfetch-prompts.md — never guess |

| 404 on guessed URL (spec-level) | STOP guessing. Re-fetch parent index, extract actual hrefs. If still no result → "확인하지 못함" |

| No documentation found | Inform user, answer from knowledge, suggest they provide the docs URL |


Retrieval Optimization

  1. Index first — always fetch llms.txt (index) before llms-full.txt
  2. Targeted fetch — from index, identify the single most relevant page URL
  3. Section extraction — extract only the relevant section; do not dump entire page
  4. Progressive depth — if user asks "더 자세히", fetch additional pages
  5. Multi-page max — 3 pages for broad topics; summarize connections

Response Rules

  1. Language — match the user's language (Korean → Korean, English → English)
  2. Source citation — ALWAYS include documentation URL(s) at the end with "Source:" label
  3. Method transparency — note retrieval method (llms.txt / GitHub / sitemap / web search)
  4. Code examples — include them when the official docs provide them
  5. Version note — note the version (e.g., "React 19 기준", "as of Next.js 15")
  6. Conciseness — answer the specific question; don't dump entire pages
  7. Token awareness — for large docs, fetch the index first, then only the specific page needed

Output Format

Default mode

[Explanation based on official documentation]

[Code examples if relevant]

---
Source: [URL(s) fetched]
(version: X.Y | method: llms.txt/GitHub/sitemap/search)

Code-only mode (when user asks for code)

[Code examples with minimal inline comments]

---
Source: [URL(s)]
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.