Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad pull requests, changes that grew beyond a fix, dependency additions, pu
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-scope-creep-detector-78a5f695fe9f ,按照其中的说明把「scope-creep-detector」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
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.
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 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.
Read references/scope-signals.md before making a recommendation. Treat the classifier as triage evidence, not proof of authorial intent.
in_scope: file paths with at least one intent/path keyword overlaplikely_creep: paths without overlap, with the reason and detected signalsnew_deps: dependencies introduced in supported manifest formatsapi_renames: nearby removed and added public function or class declarationsconfig_edits: CI, container, build, YAML, and TOML changesstats: churn, subsystem counts, oversized hunks, and formatting-only filesEmpty arrays are evidence too. Say that no signal was detected, not that the diff is guaranteed to be in scope.
Give every item in likely_creep one disposition:
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.
Use this compact structure:
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.
scripts/scope_creep.py: deterministic unified-diff parser and classifierreferences/scope-signals.md: signal definitions, thresholds, and limits