1
---
2
name: intent-drift
3
description: Use when the user asks whether current work still matches the original request, or when an agent has made several edits and is about to continue. Compares the working-tree diff against the stated request and lists out-of-scope changes before more edits are made.
4
---
5
6
# Intent Drift Check
7
8
Use this skill when the user asks "are we still on track?", "did we drift?",
9
"check intent drift", or when an agent has made several edits and is about to
10
continue.
11
12
This skill produces a concrete diff review, not a score. A passing test only
13
proves the tested behavior; it does not prove the rest of the diff matches the
14
request. It uses only `git` and the repository's existing acceptance command;
15
it does not install or run external scoring packages.
16
17
## Procedure
18
19
1. **State the request and its acceptance check.** Write the original request in
20
one sentence. Then name the check that decides whether it is done. For "make
21
the tests pass", that is the full test suite the request refers to, not only
22
the first test that failed: a shared-helper change can need another edit to
23
keep an already-passing test green. Include any security constraint the
24
change must preserve (authorization, input validation, secret handling) in
25
the check.
26
2. **Inspect all pending changes.** Changes can be unstaged, staged, or in new
27
files, and `git diff` alone shows none of the last two. Run:
28
29
```bash
30
git status --short --untracked-files=all
31
git diff --stat
32
git diff
33
git diff --cached --stat
34
git diff --cached
35
```
36
37
`--untracked-files=all` is required: plain `git status --short` collapses a
38
new directory to `?? newdir/`, and can omit untracked files entirely when
39
`status.showUntrackedFiles` is disabled. Read every untracked file the
40
command lists. Review all of these sources before judging anything; a
41
staged-only or untracked change is still part of the work.
42
3. **Confirm a passing baseline, then split each hunk into logical changes.**
43
Run the acceptance check on the current tree. If it does not pass, the
44
necessity test has no baseline and would mislabel unrelated breakage as
45
required: report `VERDICT: inconclusive`, show what is failing, and pause
46
before reverting anything.
47
48
One hunk often mixes a required fix with unrelated edits, so a file-level or
49
hunk-level verdict can hide drift or wrongly protect it. Separate each hunk
50
into the smallest independently reviewable changes, then test each one:
51
52
*"Does the acceptance check fail without this change, or does the stated
53
request or a required security/input-validation constraint require it?"*
54
55
- **Required** — yes, the check fails without it, or the change directly
56
implements part of the stated request or a required security/input-validation
57
constraint. If the current acceptance check does not cover that required
58
control, keep it, add the missing coverage or flag it for human review, and
59
do not revert it.
60
- **Out of scope** — no, the check still passes without it and it does not
61
implement part of the stated request or a required constraint.
62
63
Do not treat a change as out of scope merely because it was not named in the
64
prompt; compare it against the stated request, acceptance check, and required
65
constraints. Docstrings, type coercion, cleanup, refactors, comment changes,
66
and edits to functions the acceptance check never exercises are often out of
67
scope, but only when they are not explicitly requested and not required by a
68
security/input-validation constraint. If classification is ambiguous, ask
69
before reverting. Only judge a whole hunk when it truly cannot be split.
70
4. **Report in this exact format:**
71
72
```
73
REQUEST: <one sentence>
74
ACCEPTANCE: <test suite or behavior that decides done>
75
REQUIRED: <files/functions and why the check fails without them>
76
OUT OF SCOPE: <every out-of-scope change, marked "reverted" or "kept because ...">
77
VERDICT: <on track | drifted (uncorrected) | drifted (corrected) | inconclusive>
78
```
79
80
Use `drifted (uncorrected)` when drift exists and has not been dealt with
81
yet, including when an out-of-scope change must be kept because it is
82
user-authored. Use `drifted (corrected)` only after step 5 is complete.
83
Use `inconclusive` when the acceptance check has no passing baseline.
84
5. **Correct only when the verdict is `drifted (uncorrected)`.** Revert only the
85
out-of-scope changes, keep the required changes, then re-run the full
86
acceptance check. A change can live in the index, the working tree, or both,
87
and each needs its own revert. Clear the index first, then the working tree:
88
89
```bash
90
git restore --staged -p # staged hunks: remove from the index
91
git restore -p # working-tree hunks: remove from files
92
```
93
94
That order matters. For a staged-only change the working tree already
95
matches the index, so restoring the working tree first does nothing; resetting
96
the index afterwards would only unstage the drift and leave it in the files.
97
98
Edit the file and stage the correction when that is clearer. If a revert
99
makes the check fail, that change was required: restore it and reclassify
100
it. Before reporting `drifted (corrected)`, confirm the drift is gone from
101
every source:
102
103
```bash
104
git status --short --untracked-files=all
105
git diff
106
git diff --cached
107
```
108
109
Both diffs omit untracked files, and unstaging a newly added file leaves it
110
untracked, so the status check is required. Do not delete untracked files by
111
default. Only remove an out-of-scope untracked file if you created it in this
112
task and it is clearly not user-authored work; if that is uncertain, keep it,
113
report it, and ask before deleting. Name every reverted or kept out-of-scope
114
change in `OUT OF SCOPE`; do not report "none" just because it is gone from
115
the final diff.
116
117
## Rules
118
119
- **Tests follow the requested behavior.** Weakening, skipping, deleting, or
120
bypassing a test to make it pass is drift (for example, broadening assertions,
121
commenting out checks, or adding skip/xfail/todo markers) unless the user
122
explicitly asked to remove or relax that coverage. Updating assertions that
123
encode the old behavior is required when the user asked to change that
124
behavior, even if the user never mentioned the test file. If a test is wrong or
125
obsolete, explain why, keep or replace its coverage where appropriate, and get
126
confirmation before removing it.
127
- **Passing tests are not proof of alignment.** Inspect the diff.
128
- **Report concrete changes.** Base the verdict on the request, the acceptance
129
check, and the diff. This skill does not run PyPI/npm engine checks and does
130
not rely on an external alignment score to decide the verdict.
131
- **Do not revert required changes, tests that define acceptance criteria, or
132
user-authored work.**
133
- **Security controls are required until the user says otherwise.** An
134
authorization check, input validation, escaping, or secret handling is not
135
out of scope just because the acceptance suite passes without it. Keep it,
136
add it to the acceptance check, and flag it for human review rather than
137
reverting it.
138
- **If the request is ambiguous, ask before reverting anything.**
139
140
## Worked example
141
142
See [examples/real-session.md](examples/real-session.md) for a real GitHub
143
Copilot CLI session (kept as a historical transcript) and an illustrative
144
current-procedure walkthrough that applies this package-free diff-review flow,
145
including keeping and flagging input-validation changes for human review.
146