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/github.js

View on GitHub
const https = require('https');
const { getCredential } = require('../../../../scripts/lib/credentials.js');

function httpsGet(url, headers = {}, redirects = 0) {
  return new Promise((resolve, reject) => {
    if (redirects > 5) return reject(new Error('Too many redirects'));
    const currentUrl = new URL(url);
    const opts = { headers: { 'User-Agent': 'pro-workflow/wiki-research-loop', Accept: 'application/vnd.github+json', ...headers } };
    const req = https.get(currentUrl, opts, res => {
      if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
        res.resume();
        let nextUrl;
        try {
          nextUrl = new URL(res.headers.location, currentUrl);
        } catch (error) {
          return reject(error);
        }
        if (nextUrl.origin !== currentUrl.origin) return reject(new Error('Cross-origin GitHub redirect blocked'));
        return httpsGet(nextUrl, headers, 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('github fetch timeout')));
    req.on('error', reject);
  });
}

function authHeader() {
  const tok = getCredential('GITHUB_TOKEN');
  return tok ? { Authorization: `Bearer ${tok}` } : {};
}

module.exports = {
  name: 'github',
  match: () => true,
  estimateCost: () => ({ usd: 0, tokens: 0 }),
  async fetch(query, opts = {}) {
    const limit = opts.limit ?? 3;
    const url = `https://api.github.com/search/repositories?q=${encodeURIComponent(query)}&sort=stars&per_page=${limit}`;
    try {
      const res = await httpsGet(url, authHeader());
      if (res.status !== 200) return [];
      const json = JSON.parse(res.body);
      const items = json.items || [];
      return items.map(r => {
        const desc = r.description || '';
        const stars = r.stargazers_count || 0;
        return {
          title: r.full_name,
          content: `${desc} (${stars}★, ${r.language || 'unknown'})`,
          url: r.html_url,
          fetched_at: new Date().toISOString(),
        };
      });
    } 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