Scope creep detector

From ngophatneknha/ai-engineering-hub · View interactive version

Scope creep detector is an AI agent skill from the GitHub repository ngophatneknha/ai-engineering-hub. Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad pull requests, changes that grew beyond a fix, dependency additions, public API renames, config or CI edits, oversized hunks, and formatting-only files. Use when the user asks whether a change grew beyond the fi

How to use this skill

Skill file

Scope Creep Detector

A one-line fix should not require a reviewer to reverse-engineer fourteen files

across three subsystems. This skill compares a git diff with its stated intent,

surfaces scope signals, and turns them into keep, split, or justify decisions.

Everything runs locally. The script makes no network calls and does not change

the working tree, index, commits, or branches.

When to use

When not to use

Establish the intent

Use the user's one-line intent when available. Keep it concrete, such as

fix null dereference in parser or add retry limit to webhook delivery.

If no intent was given, the script falls back to the current branch name. If

that name is generic, detached, or unrelated to the work, ask for one line of

intent before treating relatedness as meaningful.

Run the classifier

Run from this skill directory and point --repo at the target repository.

Working tree diff:

python3 scripts/scope_creep.py --repo /path/to/repo \
  --intent "fix null dereference in parser" --json

Staged diff:

python3 scripts/scope_creep.py --repo /path/to/repo --staged \
  --intent "fix null dereference in parser" --json

Branch diff against a merge base:

python3 scripts/scope_creep.py --repo /path/to/repo --base main \
  --intent "fix null dereference in parser" --json

Saved diff or stdin:

python3 scripts/scope_creep.py --diff change.diff --intent "parser fix" --json
git diff --staged | python3 scripts/scope_creep.py --diff - \
  --intent "parser fix" --json

Use --hunk-threshold only when the repository has a documented reason to

change the default churn threshold. Do not tune the threshold merely to make a

warning disappear.

Interpret the JSON

Read references/scope-signals.md before making a

recommendation. Treat the classifier as triage evidence, not proof of authorial

intent.

Empty arrays are evidence too. Say that no signal was detected, not that the

diff is guaranteed to be in scope.

Recommend keep, split, or justify

Give every item in likely_creep one disposition:

  1. Keep when the path is necessary for the stated intent and the connection

is direct. Explain the connection in one sentence.

  1. Split when it can land independently, belongs to another subsystem, or

introduces a dependency, API rename, config edit, or large hunk that is not

required for the intent. Name the files or hunks for the follow-up change.

  1. Justify when a cross-cutting edit cannot be separated safely. State the

invariant or build constraint that requires it and call out reviewer risk.

Prefer split when evidence is ambiguous. Never claim that a zero overlap score

proves a file is unrelated. Path vocabulary is a cheap, deterministic proxy.

Write the scope report

Use this compact structure:

  1. Intent and diff source
  2. Files and subsystems touched, with total additions and deletions
  3. In-scope changes
  4. Likely creep with signal evidence
  5. Keep, split, or justify table
  6. Proposed follow-up grouping, if any

Name file paths and hunk headers. For an oversized mixed hunk, explain that the

script cannot split it automatically and describe the smallest coherent edit.

Ask before applying any split, revert, staging, or commit operation.

Files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.