Skip to content

rohitg00/pro-workflow / skills/wiki-research-loop

wiki-research-loop

Verified

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.

FileKindSize
SKILL.mdskill md5.8 KB
scripts/research-loop.jsexecutablescript12.9 KB
scripts/source-fetchers/arxiv.jsscript2.0 KB
scripts/source-fetchers/github.jsscript2.2 KB
scripts/source-fetchers/web.jsscript3.1 KB

scripts/source-fetchers/arxiv.js

View on GitHub
const https = require('https');

function httpsGet(url, redirects = 0) {
  return new Promise((resolve, reject) => {
    if (redirects > 5) return reject(new Error('Too many redirects'));
    const req = https.get(url, { headers: { 'User-Agent': 'pro-workflow/wiki-research-loop' } }, res => {
      if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
        res.resume();
        return httpsGet(res.headers.location, redirects + 1).then(resolve, reject);
      }
      let data = '';
      res.on('data', c => { data += c; });
      res.on('end', () => resolve({ status: res.statusCode, body: data }));
    });
    req.setTimeout(15000, () => req.destroy(new Error('arxiv fetch timeout')));
    req.on('error', reject);
  });
}

function extractTag(xml, tag) {
  const re = new RegExp(`<${tag}[^>]*>([\\s\\S]*?)<\\/${tag}>`, 'g');
  const out = [];
  let m;
  while ((m = re.exec(xml)) !== null) out.push(m[1].trim());
  return out;
}

function parseEntries(xml) {
  const entries = extractTag(xml, 'entry');
  return entries.map(entry => {
    const title = (extractTag(entry, 'title')[0] || '').replace(/\s+/g, ' ').trim();
    const summary = (extractTag(entry, 'summary')[0] || '').replace(/\s+/g, ' ').trim();
    const idMatch = entry.match(/<id>([\s\S]*?)<\/id>/);
    const url = idMatch ? idMatch[1].trim() : null;
    const published = (entry.match(/<published>([\s\S]*?)<\/published>/) || [])[1] || null;
    return { title, content: summary, url, fetched_at: new Date().toISOString(), published };
  });
}

module.exports = {
  name: 'arxiv',
  match: () => true,
  estimateCost: () => ({ usd: 0, tokens: 0 }),
  async fetch(query, opts = {}) {
    const limit = opts.limit ?? 3;
    const q = encodeURIComponent(query);
    const url = `https://export.arxiv.org/api/query?search_query=all:${q}&start=0&max_results=${limit}`;
    try {
      const res = await httpsGet(url);
      if (res.status !== 200) return [];
      return parseEntries(res.body);
    } catch {
      return [];
    }
  }
};
add-product-e2e-evalpaperclipai/paperclipAdd or extend a Paperclip full-stack runner E2E workflow, fixture, matcher, or report evidence path for local or Daytona execution.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
add-runner-evalpaperclipai/paperclipAdd or extend a Paperclip Runner protocol evaluation definition, roster, assertion, or report fixture with provenance and narrow validation.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
diagnose-why-work-stoppedpaperclipai/paperclipCompatibility entry point for failed, stalled, looping, or over-recovered Paperclip work. Use fix-failed-paperclip-run for the full diagnosis, regression, repair, real verification, and green-PR workflow; honor an explicitly requested diagnosis-only scope.Stars: 115kUpdated Claude CodeCodexVerifiedInstall
fix-failed-paperclip-runpaperclipai/paperclipDiagnose and fix failed, stuck, slow, or incorrectly blocked Paperclip tasks and runs. Use with a task/run URL or failure report to trace the root cause, prove a regression red then green, check second-order effects, verify the real workflow, and deliver a PR with passing checks.Stars: 115kUpdated Claude CodeCodexVerifiedInstall