AgentSkillsCN

gitingest

当用户希望获取并梳理GitHub仓库,以备日后查阅时,可选用此功能。

SKILL.md
--- frontmatter
name: gitingest
description: Use when the user wants to fetch and contextualize a GitHub repository for future reference.
argument-hint: [url | user/repo | repo-name] [filters...]
allowed-tools:
  - Bash(mkdir docs/reference)
  - Bash(gitingest:*)
  - Read

Fetch GitHub Repository Context

Arguments

code
$ARGUMENTS

Instructions

1. Parse Input

  • Full URL: use directly
  • user/repo: construct https://github.com/{user/repo}
  • Single name: infer canonical repo (e.g., "rails" → "rails/rails"); if ambiguous, ask

2. Parse Filters

Natural language filters map to options:

  • "only Python files" → -i "*.py"
  • "exclude tests" → -e "test/*" -e "*_test.py"
  • "branch develop" → -b develop

3. Build Command

bash
mkdir -p docs/reference/
gitingest [OPTIONS] -o docs/reference/<user>-<repo>.txt <url>

Options:

FlagPurpose
-o PATHOutput file (required)
-i PATTERNInclude pattern (repeatable)
-e PATTERNExclude pattern (repeatable)
-b NAMEBranch
-s BYTESMax file size
--include-gitignoredInclude .gitignore'd files
--include-submodulesInclude submodules
-t TOKENGitHub PAT for private repos

4. Execute & Confirm

  1. Run the command
  2. Read generated file to understand repo
  3. Report: repo name, purpose, file location, filters applied

Examples

code
/gitingest rails                    → rails/rails to docs/reference/rails-rails.txt
/gitingest jdx/mise only rust       → -i "*.rs" filter
/gitingest user/repo exclude tests  → -e "test/*" -e "*_test.py"
/gitingest https://github.com/x/y branch main