King Research — Topic Research Skill

SkillSearch

Build an open-web research corpus on a topic using the king-research pipeline (generate → search → chunk → enrich → export) and auto-index it for later search. Trigger when the user asks to research / pesquisar / build a corpus / find sources / survey state-of-the-art on a general topic (papers, blog posts, discussions, comparisons). Do NOT trigger when the user points to a specific product documentation site, use the scraper-workflow skill for that. Do NOT trigger when the user wants to query already-indexed content, use the king-context skill (`kctx search`) for that.

Available today. Use it from your connected AI after setup.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the King Research skill

What this skill tells your AI

The instructions your AI receives, as published by deandevz/king-context in .agents/skills/king-research/SKILL.md and read by ahel’s review.

Invoke king-research to build a research corpus on any topic. The user describes what they want; you extract the topic, pick the effort mode, and run the pipeline.


When to use this skill

User wants...Use
Sources on an open-web topic (papers, blog posts, discussions)king-research (this skill)
A specific product/API doc site scrapedscraper-workflow (king-scrape)
To query already-indexed contentking-context (kctx search)

If the user already mentions a URL or a specific product's docs, hand off to scraper-workflow.


Step 1: Extract the topic

Pull the topic from the user's message as a concise phrase (2–6 words).

Rules:

  • Strip filler: "please", "por favor", "pode fazer", "quero que", "me faça".
  • Keep semantic qualifiers: "for RAG pipelines", "in production", "2025".
  • Prefer the user's wording over paraphrase.
  • Quote multi-word topics when passing to the CLI.

If the topic is vague (e.g. "faz um research aí", "pesquise algo"), ask ONE clarifying question before running: "What topic?"


Step 2: Pick the effort mode

Explicit signals (override inference)

Signal in the user's messageMode
"rápido", "quick", "basic", "só uma ideia", "overview", "simples"--basic
(no qualifier)--medium (default)
"detalhado", "aprofundado", "profundo", "detailed", "in-depth", "completo"--high
"exaustivo", "estado da arte", "thorough", "comprehensive", "state of the art", "máximo", "tudo que tiver"--extrahigh

Inferred from complexity (when no explicit signal)

Topic shapeMode
Narrow, well-known (e.g. "httpx timeouts")--basic
Standard technical topic (e.g. "prompt caching strategies")--medium (default)
Broad or comparative (e.g. "RAG vs fine-tuning")--high
Bleeding-edge / multi-domain survey (e.g. "mixture of experts state of the art 2025")--extrahigh

Cost & time budget

ModeInitial queriesDeepening iterations~TimeAPI cost
--basic30~30sminimal
--medium51~2 minlow
--high82~5 minmedium
--extrahigh123~10 minhigh

For --high or --extrahigh, state the expected time before running so the user isn't surprised. No need to ask permission — just warn.


Step 3: Run the pipeline

.king-context/bin/king-research "<topic>" --<mode> --yes

Flags to remember:

  • --yes / -y — skip the enrichment cost prompt (default ON from this skill; the user invoked us to do the work, not to be interrupted).
  • --name <slug> — override the auto-generated slug (rarely needed; only if the user explicitly names it).
  • --no-auto-index — don't auto-index into .king-context/research/ (rarely; only if the user explicitly asks for JSON-only output).
  • --step <stage> / --stop-after <stage> — resume or partial-run (only for debugging; don't use proactively).

Pipeline stages (for reference when resuming): generate → search → chunk → enrich → export.


Step 4: Report + hand off to search

After the pipeline finishes, report concisely:

  1. The slug it was saved under (auto-indexed in .king-context/research/<slug>/).
  2. Section count.
  3. Example commands to search it.

Template:

Indexed "<slug>" — N sections. Try:
  kctx search "<keyword>" --doc <slug>
  kctx topics <slug>
  kctx list research

Don't dump the full topic tree or section titles — let the user drive the search.


Error handling

ErrorAction
EXA_API_KEY is not set"Set EXA_API_KEY in .king-context/.env or ./.env, then retry."
OPENROUTER_API_KEY missingSame — both are required (query generation + enrichment).
Zero results from ExaTopic may be too niche or mis-spelled. Suggest rephrasing or adding context.
Pipeline fails with "no chunks" or "no enriched sections"Report which stage; usually means the topic returned no fetchable pages. Try broadening the topic.
User hit a high/extrahigh run by mistakeRemind them Ctrl+C cancels; partial progress in .king-context/_temp/research/<slug>/ is kept for resume via --step.

Examples

Implicit mode (inferred from complexity)

User: "pesquise sobre chain of thought prompting"
→ Topic: "chain of thought prompting"
→ Standard technical topic → --medium
→ .king-context/bin/king-research "chain of thought prompting" --medium --yes
→ "Indexed chain-of-thought-prompting — 14 sections."

Explicit mode — quick

User: "faz um research rápido sobre retry backoff"
→ Topic: "retry backoff"
→ Signal "rápido" → --basic
→ .king-context/bin/king-research "retry backoff" --basic --yes

Explicit mode — exhaustive

User: "quero tudo sobre mixture of experts, estado da arte"
→ Topic: "mixture of experts"
→ Signal "estado da arte" → --extrahigh
→ Warn: "~10 minutes and higher API cost — proceeding"
→ .king-context/bin/king-research "mixture of experts" --extrahigh --yes

Comparative (inferred high)

User: "compare RAG vs fine-tuning for code assistants"
→ Topic: "RAG vs fine-tuning code assistants"
→ Comparative, broad → --high
→ .king-context/bin/king-research "RAG vs fine-tuning code assistants" --high --yes

Vague topic (ask first)

User: "faz um research aí"
→ Ask: "What topic?"
→ (wait for reply, then resume from Step 1)

User provides a URL — hand off

User: "research stripe docs"
→ This is a doc site, not an open-web topic.
→ Hand off to scraper-workflow: king-scrape https://docs.stripe.com

Signals

GitHub stars
55
Forks
11
Last commit
Jun 2026
Advanced
Item type
skill
Key
king-research
Source
github.com/deandevz/king-context