build-repo-context

Distills GitHub PRs, issues, and review comments into a repository knowledge base.

657|419|Updated Oct 2, 2024
One-click install
npx skills add https://github.com/UKGovernmentBEIS/inspect_evals --skill build-repo-context
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-repo-context
Source: https://github.com/UKGovernmentBEIS/inspect_evals/tree/main/.claude/skills/build-repo-context
Command: npx skills add https://github.com/UKGovernmentBEIS/inspect_evals --skill build-repo-context

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Engineering teams lose institutional knowledge buried in GitHub PR discussions and issue threads, causing contributors and AI agents to repeat mistakes and miss established conventions.

Core Features & Use Cases

  • Incremental Crawling: Uses the GitHub CLI to fetch only new merged PRs and updated issues since the last run, capped at 50 PRs per execution.
  • Insight Distillation: Extracts actionable design decisions, reviewer corrections, conventions, and acknowledged tech debt, each cited to its source PR or issue.
  • Deduplication & Merging: Consolidates overlapping insights into a single structured REPO_CONTEXT.md document kept between 500-1000 lines.
  • Use Case: A maintainer runs this periodically so that AI coding agents working on the repository read REPO_CONTEXT.md first and avoid repeating mistakes that reviewers previously corrected.

Quick Start

Ask the agent to run the build-repo-context workflow to crawl recent GitHub PRs and issues and update agent_artefacts/repo_context/REPO_CONTEXT.md with distilled repository conventions.

Frequently Asked Questions about build-repo-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract institutional knowledge from GitHub PRs and issues?

Use the GitHub CLI to list merged PRs and open issues, fetch their bodies and review comments, then distill actionable insights such as design decisions and reviewer corrections into a structured markdown document. Each insight should cite its source PR or issue number.

How to run incremental updates on a repository knowledge base?

Store the last-updated date and highest processed PR number in the document header, then fetch only PRs merged after that watermark using gh pr list with a merged date filter. This avoids reprocessing already-crawled items on subsequent runs.

What GitHub CLI commands fetch PR review comments?

Use gh pr view with the --json flag for PR bodies and reviews, and gh api repos/{owner}/{repo}/pulls/<N>/comments --paginate for inline review comments. Issue comments are fetched via the issues endpoint similarly.

What are the limits when crawling repository history with this workflow?

Each run processes at most 50 PRs and 100 issues, traverses linked references up to 3 hops, and keeps the output document between 500 and 1000 lines. Bot comments, dependency bumps, and trivial PRs are skipped.

Why does duplicate content appear across sections of the knowledge base?

Incremental runs naturally surface the same convention in multiple PR reviews, causing overlap between sections like rules and testing recipes. The workflow includes a deduplication pass that keeps each insight in exactly one section, preferring the most specific location.