scope-drift-guard
Skill0 starsChanged 19 days agoMITView on GitHub
Detect edits outside the requested change surface and require a dependency rationale for every additional file. Use during or after autonomous code changes.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- completion-claims-auditorSkill
- existing-work-preservationSkill
- mcp-reliability-auditorSkill
- multi-agent-integration-reviewerSkill
- project-context-recoverySkill
- requirement-traceability-auditorSkill
- architecture-complexity-auditorSkill
- dependency-cycle-auditorSkill
- database-schema-reviewerSkill
- data-consistency-auditorSkill
- migration-safety-reviewerSkill
- loop-breakerSkill
- reproduction-builderSkill
- root-cause-debuggerSkill
- dependency-grounding-auditorSkill
- ci-failure-investigatorSkill
- cross-platform-readiness-auditorSkill
- environment-config-auditorSkill
- environment-parity-auditorSkill
- production-readiness-auditorSkill
- documentation-accuracy-auditorSkill
- token-efficient-workflowSkill
- accessibility-auditorSkill
- dead-feature-detectorSkill
- responsive-design-auditorSkill
- ux-state-completeness-auditorSkill
- release-verification-agentSkill
- agent-tool-trust-auditorSkill
- authentication-security-auditorSkill
- authorization-boundary-auditorSkill
- dependency-vulnerability-auditorSkill
- injection-risk-auditorSkill
- input-validation-auditorSkill
- secret-leakage-detectorSkill
- security-misconfiguration-auditorSkill
- api-contract-auditorSkill
- integration-reality-checkerSkill
- missing-test-detectorSkill
- regression-detectorSkill
- test-quality-auditorSkill
- ui-flow-verifierSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Keep agent edits reviewable and prevent opportunistic unrelated cleanup.
- Distinctive: line 20
Read applicable repository instructions before edits.
- Very specific: line 47
Never use reset/clean/blanket formatting to remove drift when it could destroy unrelated user work.
- Distinctive: line 51
Every changed file has a defensible category tied to the task.
- Distinctive: line 52
No pre-existing unrelated working-tree change is overwritten/reverted.
- Distinctive: line 64
If the baseline includes pre-existing uncommitted work, identify it first and exclude it from the agent-owned diff rather than resetting it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Purpose
Keep agent edits reviewable and prevent opportunistic unrelated cleanup.
When to activate
A task has a defined scope or an agent has produced a broad diff.
When not to activate
A deliberately repository-wide migration explicitly authorizes broad edits.
Preconditions
- Read applicable repository instructions before edits.
- Preserve unrelated working-tree changes and establish a baseline when the workflow can modify code.
- Identify which tools and environments are actually available; do not claim unavailable checks ran.
Required inputs
- Task requirements
- Baseline commit/status
- Changed-file diff
- Repository instructions/ownership
Workflow
- Define the expected change surface from requirements and known dependency paths before broad editing.
- List changed files against the baseline and classify each as direct requirement, necessary dependency, generated artifact, validation/documentation, or unrelated.
- For necessary dependency files, state the concrete caller/contract reason.
- Flag drive-by formatting, renames, dependency upgrades, cleanup, or refactors with no requirement/dependency justification.
- Revert or split unrelated changes while preserving other authors' pre-existing working-tree changes.
- Re-run focused tests after narrowing because removing incidental changes can expose hidden coupling.
- Report the final classified changed-file set.
Relevant tools
Version control, repository dependency/caller search; this library includes a scope helper.
Safety restrictions
Never use reset/clean/blanket formatting to remove drift when it could destroy unrelated user work.
Validation
- Every changed file has a defensible category tied to the task.
- No pre-existing unrelated working-tree change is overwritten/reverted.
- The narrowed patch still passes relevant checks.
Expected output
- Changed-file scope table
- Flagged drift
- Files removed/split from scope
- Post-narrowing validation
Failure handling
If the baseline includes pre-existing uncommitted work, identify it first and exclude it from the agent-owned diff rather than resetting it.
Completion criteria
The skill is complete only when every applicable validation item above has observed evidence or is explicitly marked not executed with the concrete blocker. Do not replace missing evidence with confidence language.
Research mapping
This skill was selected from research problems: P046, P010. See research/vibe-coding-problems.md and research/problem-evidence.csv in the Vibe Coding Skills repository.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

