AgentSkillsCN

analyze-git-repo

深入分析任意Git仓库——理解架构、跨仓库边界调试、审查API、规划迁移、评估库文件。精准呈现真实函数签名、参数类型、返回值,以及带精确文件路径与行号的源码引用。通过将智能体锚定于实际代码库,有效避免“幻觉”API的出现。由Instagit提供技术支持。可在以下场景下触发:(1) 查询或分析远程Git仓库;(2) 从源码中理解库的API或架构;(3) 跨仓库边界进行调试;(4) 评估或比较库文件;(5) 规划版本间的迁移;(6) 部署Instagit MCP服务器。

SKILL.md
--- frontmatter
name: analyze-git-repo
description: "Analyze any Git repository in depth — understand architecture, debug across repo boundaries, review APIs, plan migrations, and evaluate libraries. Surfaces real function signatures, parameter types, return values, and source citations with exact file paths and line numbers. Eliminates hallucinated APIs by grounding agents in the actual codebase. Powered by Instagit. Triggers when: (1) querying or analyzing a remote Git repository, (2) understanding library APIs or architecture from source, (3) debugging across repository boundaries, (4) evaluating or comparing libraries, (5) planning migrations between versions, (6) setting up the Instagit MCP server."

Analyze Git Repo

Analyze any Git repository in depth — understand architecture, surface real APIs, debug across repo boundaries, and get source citations with exact file paths and line numbers. Powered by Instagit.

Quick Start

Add to MCP client configuration:

json
{
  "mcpServers": {
    "instagit": {
      "command": "npx",
      "args": ["-y", "instagit@latest"]
    }
  }
}

No API key required — auto-registers anonymous token on first use. Requires Node.js 18+.

For higher rate limits, sign up at instagit.com and add an API key:

json
{
  "mcpServers": {
    "instagit": {
      "command": "npx",
      "args": ["-y", "instagit@latest"],
      "env": {
        "INSTAGIT_API_KEY": "ig_your_api_key_here"
      }
    }
  }
}

Works with Claude Code, Claude Desktop, Cursor, VS Code, and any MCP-compatible client.

Tool: ask_repo

Analyze any Git repository with AI.

ParameterTypeRequiredDescription
repostringyesRepository URL, shorthand (owner/repo), or any public Git URL
promptstringyesWhat to analyze or ask about the codebase
refstringnoBranch, commit SHA, or tag (default: repo's default branch)

Prompting Examples

For detailed examples across architecture, integration, debugging, migration, security, and code quality — see references/examples.md.

Key patterns:

code
repo: "nginx/nginx"
prompt: "How does nginx handle thousands of concurrent connections with its event-driven architecture? Walk through the event loop, worker process model, and connection state transitions."
code
repo: "hashicorp/terraform"
prompt: "How do I implement a custom Terraform provider from scratch? What interfaces does the SDK expose, how are CRUD operations mapped to the resource lifecycle, and how does schema definition work?"
code
repo: "ggml-org/llama.cpp"
prompt: "How does llama.cpp's KV cache work during autoregressive generation? How are past key-value pairs stored, reused across tokens, and evicted when the context window fills up?"

Configuration

VariableDescriptionDefault
INSTAGIT_API_KEYAPI key from instagit.comAuto-registers anonymous token
INSTAGIT_API_URLCustom API endpointProduction API

Anonymous tokens stored in ~/.instagit/token.json.

Pricing

  • FREE: $0 forever — 2M tokens/mo, standard speed, public repos (up to 2 GB)
  • PRO: $20/mo — 20M tokens/mo, fast mode, all public repos, unlimited repo size
  • MAX: $200/mo — 40M tokens/mo, fast mode, reasoning model, all features
  • Enterprise: Custom limits, dedicated support, SSO, SLA, private deployment