Git-Fg

ingesting-git

"Transforms repositories into structured plain-text digests optimized for LLM consumption. Use when analyzing GitHub repositories, digesting codebases, or ingesting git repos for AI analysis."

Git-Fg 1 Updated 4mo ago

Resources

3
GitHub

Install

npx skillscat add git-fg/thecattoolkit/ingesting-git

Install via the SkillsCat registry.

SKILL.md

GitIngest Protocol

Quick Start

Execute via Script:

uv run --with gitingest scripts/ingest.py <url_or_path> [options]

Examples:

# Ingest remote repo
uv run --with gitingest scripts/ingest.py https://github.com/user/repo

# Ingest with filtering
uv run --with gitingest scripts/ingest.py . -i "*.py" -e "tests/*"

Output Format

GitIngest returns structured plain-text optimized for LLM consumption with three distinct sections:

Section 1: Repository Summary

Repository: owner/repo-name
Files analyzed: 42
Estimated tokens: 15.2k

Section 2: Directory Structure

Directory structure:
└── project-name/
    ├── src/
    │   ├── main.py
    │   └── utils.py
    ├── tests/
    │   └── test_main.py
    └── README.md

Section 3: File Contents

================================================
FILE: src/main.py
================================================
def hello_world():
    print("Hello, World!")

Configuration Options

Option Purpose Example
-i / --include-pattern Include files matching patterns -i "*.py" -i "*.js"
-e / --exclude-pattern Exclude files matching patterns -e "node_modules/*"
-s / --max-size Maximum file size in bytes -s 102400
-b / --branch Specify branch -b main
-t / --token GitHub access token -t $GITHUB_TOKEN
-o Output file (or - for stdout) -o digest.txt

Common Exclude Patterns

node_modules/*          # Dependencies
*.log                   # Log files
dist/*                  # Build outputs
build/*                 # Build directories
*.min.js                # Minified files
*.lock                  # Lock files

Implementation Protocol

When executing the gitingest skill:

  1. Assess Requirements

    • Determine if CLI or Python integration is needed
    • Identify repository size and scope
    • Plan filtering strategy (include/exclude patterns)
  2. Setup Environment

    • Verify gitingest installation
    • Check authentication for private repositories
    • Configure output destination
  3. Execute Ingestion

    • Run gitingest with appropriate parameters
    • Monitor for errors and timeouts
    • Apply filtering and size limits
  4. Process Results

    • Parse the three-section output format
    • Analyze summary, tree, and content
    • Generate insights and reports

Extended Documentation

For detailed integration examples, error handling patterns, and best practices:

  • Integration Examples: references/integration-examples.md

Integration with CatToolkit

Usage Examples:

# "Ingest this repository for AI analysis"
# → Uses gitingest to create structured digest

# "Analyze the codebase without dependencies"
# → Uses gitingest with exclude-patterns for node_modules, dist, etc.

# "Generate documentation from this repo"
# → Uses gitingest + filtering to extract docs and code structure

The gitingest skill integrates seamlessly with other CatToolkit skills:

  • deep-analysis: Process gitingest output for comprehensive insights
  • software-engineering: Analyze ingested code for quality and security
  • prompt-engineering: Use repository context to generate better prompts