librarian

Clone and refresh remote Git repositories into a stable local cache for source analysis.

2|Updated Sep 14, 2026
One-click install
npx skills add https://github.com/kwanpham2195/agent-stuff --skill librarian-kwanpham2195
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: librarian
Source: https://github.com/kwanpham2195/agent-stuff/tree/main/skills/librarian
Command: npx skills add https://github.com/kwanpham2195/agent-stuff --skill librarian-kwanpham2195

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When you need to read or analyze the source code of a remote Git repository, repeatedly cloning it wastes time and bandwidth, and ad-hoc clones end up scattered across your filesystem. This Skill maintains a single predictable local checkout per repository and keeps it current with throttled fetches and safe fast-forward updates. ## Core Features & Use Cases - Flexible repo reference parsing: Accepts GitHub/GitLab/Bitbucket HTTPS URLs, SSH URLs (git@...), ssh:// URLs, host-prefixed paths, and owner/repo shorthand (defaulting to github.com), including deep links like /tree/ or /pull/. - Stable cached checkouts: Stores repositories at ~/.cache/checkouts/<host>/<org>/<repo> using partial clones (--filter=blob:none) to avoid repeated full downloads. - Throttled refresh with safe updates: Fetches from origin at most once per configurable interval (default 300 seconds) and fast-forwards only when the checkout is clean and has an upstream. - Use Case: You ask the agent to inspect how mitsuhiko/minijinja implements template escaping. The Skill resolves the repo to a cached local path, refreshes it if stale, and hands back the path for searching and reading. ## Quick Start Ask the agent to check out the GitHub repository mitsuhiko/minijinja locally and show you its source code.

Frequently Asked Questions about librarian

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

FAQPage Schema
How do I clone a GitHub repository locally for source code analysis?▼

Run checkout.sh with the repository reference, such as `bash checkout.sh mitsuhiko/minijinja --path-only`. It clones the repo into ~/.cache/checkouts/<host>/<org>/<repo> using a partial clone and prints the local path for reading and searching.

How do I keep a local git clone up to date automatically?▼

Re-run checkout.sh with the same repository reference. It fetches from origin when the checkout is older than the update interval (default 300 seconds) and fast-forwards the branch only if the working tree is clean and has an upstream.

What repository URL formats does checkout.sh accept?▼

It accepts HTTPS URLs, SSH URLs like git@github.com:org/repo.git, ssh:// URLs, host-prefixed paths like github.com/org/repo, and owner/repo shorthand which defaults to github.com. Deep links such as /tree/, /pull/, or /issues/ are reduced to the base repository.

Can I force an immediate git fetch instead of waiting for the interval?▼

Yes, pass the --force-update flag to bypass the throttle and fetch from origin immediately. You can also change the default interval with --update-interval <seconds> or the LIBRARIAN_UPDATE_INTERVAL environment variable.

Why does checkout.sh skip the fast-forward merge sometimes?▼

Fast-forward is skipped when the checkout has uncommitted changes, when the branch has no upstream configured, or when the merge cannot be done as a fast-forward. The script reports the reason as skipped-dirty, skipped-no-upstream, or skipped-non-ff.

When should I not use a cached repository checkout?▼

Avoid it when official documentation is sufficient and you do not need source internals. Also avoid editing files directly in the shared cache; create a separate worktree or copy for task-specific modifications.