# Wiki Research Loop

Auto-grow a pro-workflow wiki by running a budget-capped BFS research loop over...

- Repository: https://github.com/rohitg00/pro-workflow (2940 stars)
- Category: Git and review
- License: see repository
- Last updated: 2026-09-29
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add rohitg00/pro-workflow --skill wiki-research-loop -g -a claude-code -y`
Codex: `npx skills add rohitg00/pro-workflow --skill wiki-research-loop -g -a codex -y`
Cursor: `npx skills add rohitg00/pro-workflow --skill wiki-research-loop -g -a cursor -y`
Gemini CLI: `npx skills add rohitg00/pro-workflow --skill wiki-research-loop -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add rohitg00/pro-workflow`

## Description

Auto-grow a pro-workflow wiki by running a budget-capped BFS research loop over pluggable source fetchers (web, arXiv, GitHub). Each iteration pops a seed from the queue, fetches sources, drafts a wiki page, dedupes claims against existing pages, enqueues follow-up seeds. Halts on budget cap, depth cap, or convergence. Use when the user says "research <topic>", "grow the <slug> wiki", "auto-research", or wants a knowledge base that builds itself overnight.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Wiki Research Loop

Driver that turns a wiki into an auto-grown knowledge base. Layers on top of `wiki-builder` and `wiki-query`.

## Loop semantics

```
seed-queue (pending) → next-seed
  → fetch sources via plugins (web | arxiv | github)
  → extract claims
  → dedupe vs index (FTS5; later vector via 3.3.2)
  → compile new page or amend existing
  → upsert page (auto-FTS-index)
  → enqueue follow-up seeds (max-depth gate)
  → mark seed done
  → if budget OR convergence OR kill-switch → halt
```

## Halt conditions (any one trips)

- `budget_usd` exceeded (loop tracks per-fetcher cost estimate)
- `max_pages_per_run` written
- `max_depth` reached on every active branch
- 3 consecutive pages add < 5 % new claims (convergence)
- File `~/.pro-workflow/STOP` exists (operator kill-switch)
- `wiki.config.md` `auto_research.enabled: false`
- Wiki `private: true` AND any non-local fetcher selected

## Commands

In a plugin session, call the `providers` MCP server's `run_provider_task` tool with `task: "research"` and the runner arguments below, for example `args: ["run", "agent-memory", "--fetchers", "github"]`. Its optional GitHub token comes from the plugin configuration dialog. The direct CLI uses `PRO_WORKFLOW_GITHUB_TOKEN` when explicitly supplied. Never retrieve tokens from existing machine credentials.

```
node $SKILL_ROOT/scripts/research-loop.js run <slug> [--max-pages N] [--max-depth N] [--budget-usd 0.50] [--fetchers web,arxiv,github]
node $SKILL_ROOT/scripts/research-loop.js seed <slug> "<query>" [--depth 0] [--parent-id N]
node $SKILL_ROOT/scripts/research-loop.js seeds <slug> [--status pending|active|done|failed]
node $SKILL_ROOT/scripts/research-loop.js cancel <slug>
node $SKILL_ROOT/scripts/research-loop.js status
```

CLI flags override `wiki.config.md` for one run only.

## Source fetchers

Pluggable. Each lives at `scripts/source-fetchers/<name>.js`. Interface:

The rest: https://github.com/rohitg00/pro-workflow/blob/HEAD/skills/wiki-research-loop/SKILL.md
