Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

build-repo-context

БесплатноБез исполняемых скриптовНе проверен

Crawl repository PRs, issues, and review comments to distill institutional knowledge into a shared knowledge base. Run periodically by "context agents" to…

UKGovernmentBEISот UKGovernmentBEIS★ 763 звезды на GitHub

Об этом скилле

Build Repo Context

Crawl GitHub history (PRs, issues, review comments) and distill institutional knowledge into agent_artefacts/repo_context/REPO_CONTEXT.md. This document helps worker agents understand repo conventions, common mistakes, and known tech debt before making changes.

Workflow

1. Setup

  1. Create agent_artefacts/repo_context/ if it doesn't exist
  2. Read existing agent_artefacts/repo_context/REPO_CONTEXT.md if present (will be updated, not replaced)

2. Identify What's New

Use the header of REPO_CONTEXT.md to determine what to process. The header contains the last-updated date and PR range (e.g., PRs processed: #965-#1050).

  • First run (no REPO_CONTEXT.md): Fetch the most recent 50 merged PRs + all open issues
  • Incremental runs: Fetch PRs merged after the highest PR number in the header, and issues updated since the last-updated date

Use the gh CLI to list candidates:

# First run: recent merged PRs
gh pr list --state merged --limit 50 --json number,title,labels,additions,deletions,reviewDecision,mergedAt

# Incremental: PRs merged since last crawl
gh pr list --state merged --search "merged:>YYYY-MM-DD" --limit 50 --json number,title,labels,additions,deletions,reviewDecision,mergedAt

# Open issues
gh issue list --state open --limit 100 --json number,title,labels,createdAt,updatedAt

3. Triage

Fast pass over PR titles and metadata. Skip these categories (they rarely contain design insights):

  • Dependency bumps (titles matching bump, update dependencies, renovate, dependabot)
  • Changelog-only updates (titles matching changelog, scriv)
  • Bot-generated PRs with no review comments
  • PRs with fewer than 5 lines changed and no review comments

Prioritize PRs that have:

  • Review comments (especially multiple rounds — that's where design discussion lives)
  • Changes touching shared utilities (src/inspect_evals/utils/, CONTRIBUTING.md, BEST_PRACTICES.md, AGENTS.md)

Cap at 50 PRs per run to keep execution time reasonable.

4. Extract

For each selected PR, fetch:

# PR body and metadata
gh pr view <N> --json body,title,labels,files,reviewDecision,comments,reviews

# Review comments (inline code review feedback)
gh api repos/{owner}/{repo}/pulls/<N>/comments --paginate

# Issue comments (general discussion)
gh api repos/{owner}/{repo}/issues/<N>/comments --paginate

For open issues, fetch body and comments similarly.

Link traversal: If a comment references another PR/issue (e.g., "see #123" or "fixed in #456"), continue to crawl recursively up to 3 hops in total. Do not recurse to an existing PR/issue in the chain to prevent loops.

5. Distill

This is the core intellectual work. For each PR/issue, extract actionable insights in these categories:

  • Design decisions: What architectural choice was made and why? What alternatives were rejected?
  • Reviewer corrections: What mistakes did reviewers catch? These reveal common pitfalls.
  • Established conventions: What patterns were deliberately chosen that future contributors should follow?
  • Tech debt acknowledged: What shortcuts were taken intentionally? What should NOT be "fixed" without discussion?
  • Common agent mistakes: If review comments mention agent-generated code issues, capture the pattern.

Quality requirements for each insight:

  • Must cite source PR/issue number (e.g., "Per PR #973...")
  • Must be actionable ("Do X" / "Don't do Y"), not descriptive ("PR #123 added X")
  • Must add nuance beyond what CONTRIBUTING.md and BEST_PRACTICES.md already state
  • Must be relevant to future contributors, not just historically interesting
  • Must be broadly applicable beyond a single issue or evaluation. If the context is excessively narrow, leave it out.
  • Must reflect team convention, not a single maintainer's code style or proposal. If in doubt, leave it out.

Skip:

  • Bot comments (dependabot, renovate, CI status checks)
  • Feature announcements without design implications
  • Trivial PRs (typo fixes, version bumps) unless they reveal a convention
  • Duplicate insights already captured in REPO_CONTEXT.md

6. Merge Into REPO_CONTEXT.md

Integrate new insights into the existing document structure. Do not just append — place each insight in the appropriate section and deduplicate:

  • If a new insight updates or supersedes an existing one, replace it
  • If a section is getting too long, distill further (combine related insights)
  • Update the header metadata (last updated date, PR watermark)
  • Keep total document size between 500-1000 lines (aggressive distillation if over)

Each insight appears in exactly one section — do not repeat the same rule across multiple sections with different framing (see step 7).

7. Deduplicate & Consolidate

After merging, review the full document for cross-section duplication. This is critical — incremental runs naturally introduce duplication because the same convention su

Полный SKILL.md на GitHub

Установить build-repo-context в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл build-repo-context?

Crawl repository PRs, issues, and review comments to distill institutional knowledge into a shared knowledge base. Run periodically by "context agents" to maintain agent_artefacts/repo_context/REPO_CONTEXT.md. Trigger only on specific request.

Как установить скилл build-repo-context?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл build-repo-context запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить build-repo-context с