opensrc

Fetch and cache dependency source code from npm, PyPI, and crates.io for inspection.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/falentio/cimi --skill opensrc-falentio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opensrc
Source: https://github.com/falentio/cimi/tree/main/.agents/skills/skills/opensrc
Command: npx skills add https://github.com/falentio/cimi --skill opensrc-falentio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents often only see type definitions and documentation for dependencies, which hides how a library actually behaves internally. This Skill fetches the real source code of npm, PyPI, and crates.io packages at the correct version so agents can read implementations, debug unexpected behavior, and verify edge-case handling. ## Core Features & Use Cases - Version-Aware Fetching: Clones repositories at the correct version tag, auto-detecting installed npm versions from lockfiles like package-lock.json, pnpm-lock.yaml, and yarn.lock. - Global Source Cache: Stores fetched sources at ~/.opensrc/ so repeated lookups are instant, with commands to list, remove, and clean cached entries. - Multi-Registry Support: Resolves packages from npm, PyPI, crates.io, or arbitrary GitHub repos with branch, tag, or commit pinning. - Use Case: When a zod validation behaves unexpectedly, run opensrc path zod to get the cached source path, then grep and read the actual parsing implementation instead of guessing from types. ## Quick Start Ask the agent to fetch the source code of a dependency, for example: fetch the source for zod and show me how its parse function handles invalid input.

Frequently Asked Questions about opensrc

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

FAQPage Schema
How do I read the source code of an npm package?

Run opensrc path zod to fetch and print the absolute path to the cached source, then use grep or cat on that directory. The tool clones the repository at the correct version tag and caches it globally at ~/.opensrc/.

How do I fetch a specific version of a package's source code?

Append the version to the package name, such as opensrc path [email protected] or opensrc path pypi:[email protected]. For GitHub repos, use owner/[email protected] or owner/repo#main to pin a tag, branch, or commit.

Does opensrc support PyPI and crates.io packages?

Yes, prefix the package name with pypi: or crates:, for example opensrc path pypi:requests or opensrc path crates:serde. For these registries, explicit versions or the latest release are used since there is no lockfile detection.

How does opensrc detect which package version to fetch?

For npm packages, opensrc auto-detects the installed version from lockfiles including package-lock.json, pnpm-lock.yaml, and yarn.lock. Use the --cwd flag to resolve versions from a different project directory.

Where is fetched source code cached and how do I clear it?

Source is cached globally at ~/.opensrc/, overridable with the OPENSRC_HOME environment variable. Use opensrc list to view cached entries, opensrc remove for a single package, or opensrc clean with flags like --npm or --repos to clear selectively.

When should I not fetch dependency source code?

Skip fetching source for simple API usage questions that documentation or type definitions can answer. Fetching is worthwhile when you need internal behavior details, debugging insight, or edge-case verification that types cannot reveal.