opensrc

Fetch source code for npm, PyPI, crates.io packages and GitHub/GitLab repos.

2|Updated Jun 23, 2022
One-click install
npx skills add https://github.com/magoz/.dotfiles --skill opensrc-magoz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opensrc
Source: https://github.com/magoz/.dotfiles/tree/main/opencode/.config/opencode/skill/opensrc
Command: npx skills add https://github.com/magoz/.dotfiles --skill opensrc-magoz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Fetch package sources to provide AI agents with deeper implementation context beyond types and docs, enabling understanding of library internals, debugging dependencies, and exploring implementations.

Core Features & Use Cases

  • Fetch source code for npm, PyPI, crates.io packages and GitHub/GitLab repos to provide full implementation context for AI agents.
  • Resolve versioned code by detecting installed versions or registry tag matching, support monorepos, and store sources locally for quick reference.
  • Use cases: When investigating how a library works internally, debugging dependency issues, or learning implementation patterns for a project.

Quick Start

Run opensrc with a package or repo spec to fetch its source code.

Frequently Asked Questions about opensrc

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

FAQPage Schema
How do I provide AI agents with source code context for npm or PyPI packages?

You can fetch source code for npm, PyPI, and crates.io packages to provide AI agents with implementation context beyond types and docs. This enables understanding of library internals, debugging dependencies, and exploring implementations during development.

Can I clone a specific version of a GitHub repo for AI context?

Yes, you can clone specific GitHub or GitLab repository versions. The tool detects installed versions or resolves registry tag matching to fetch exact sources, ensuring the AI agent analyzes the matching implementation.

Does fetching package sources work with monorepos?

Yes, fetching package sources supports monorepos for multi-package projects. It detects installed versions or resolves registry data to clone exact sources and stores them locally under a dedicated repos directory for quick lookup.

What is the best way to debug dependency issues using AI?

The best way to debug dependency issues using AI is to fetch the actual package source code. Providing full implementation context rather than just types enables the AI to understand library internals and investigate dependency problems.

Where are fetched package sources stored locally?

Fetched package sources are stored locally under the opensrc/repos directory. The tool maintains a settings index to reference the downloaded sources, enabling quick lookup and access for AI agent context.