# Git Diff Test Scope — Offline API & Test Impact Planner

> Zero-dependency offline Git diff analyzer extracting affected HTTP routes (Spring/FastAPI/Flask/Express/NestJS), DB tables, blind spots, and P0/P1/P2 test scopes.

Git Diff Test Scope — Offline API & Test Impact Planner is a free AI agent skill on Agensi by SunQi, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [SunQi](https://www.agensi.io/creators/sunqi)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Version: 1.0
- Last updated: 2026-11-25
- Security: scan passed (2026-11-25); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/git-diff-test-scope-offline-api-test-impact-planner
- Tags: testing, python, git, api, code-review, qa, api-testing, regression-testing

## About this skill

Before a release or hotfix, QA teams often choose between slow full regression or risky guesswork. Git Diff Test Scope analyzes unified diffs or local commit ranges completely offline using Python 3.9+ standard library only (scripts/diff_scope.py):
- Multi-Framework Route Extraction: Detects affected endpoints in Spring Boot (@RequestMapping + method annotations), FastAPI, Flask, Express, and NestJS.
- Database & Migration Detection: Extracts touched tables from .sql, *Mapper.xml, and migration files.
- P0 / P1 / P2 Risk Prioritization: Automatically elevates auth/RBAC/middleware, DB schema, and API route edits to P0; services/configs to P1; docs/tests to P2.
- Blind-Spot Honesty & Fail-Closed: Flags dynamic reflection (Class.forName, Method.invoke), dynamic Python imports, and gateway rewrite rules for manual QA review; fails closed on empty/invalid diffs.

Open Source (MIT License, Free) — Full source code, sample PR diff, unit tests, and CI available in repository sunqi-2025/git-diff-test-scope on GitHub.

## Requires

- Git
- Python

## Known limitations

Static analysis only; ignores runtime reflection and third-party binaries. Requires unified diff format. Does not execute code or migrations.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Git Diff Test Scope — Offline API & Test Impact Planner skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill help me reduce testing time for large pull requests?

This skill analyzes Git diffs to identify specifically impacted API routes and database tables, then generates a prioritized P0/P1/P2 testing plan so you don't have to guess which areas require manual or automated regression testing.

### Which frameworks and technical environments is this skill compatible with?

It supports major web frameworks including Spring Boot, FastAPI, Flask, Express, and NestJS, and requires Python 3.9+ along with a standard Git binary for repository-level analysis.

### Why should I use this skill instead of just pasting my code into a standard AI chat?

Unlike generic LLM prompts that may hallucinate code paths, this skill uses a deterministic logic approach to map routes and schema changes, ensuring your test scope is based on actual code rather than probabilistic guesses.

### What exactly is included in the 'Git Diff Test Scope' package?

Your purchase includes the Python-based CLI tool, the deterministic analysis logic for route and database mapping, and the Markdown reporting module for generating prioritized test plans.

### Are there any specific code patterns or limitations the analysis might miss?

While it excels at static analysis of decorators and schema files, it cannot detect changes triggered by dynamic runtime reflection or binary bytecode, and it is intended to supplement rather than replace your automated test execution.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
