TL;DR: Extract the real import list from the file with a parser (not from the model's memory) and compare every "missing import" claim against it. The model usually reviews a diff hunk without the full file, never sees the import block at the top, then "notices" a used name with no visible import. Checking claims against the actual imports removes the phantom.

```text
review agent hallucinated a missing import the file never had
```

1. Pull the actual import list from the file using the language's parser or a scan of the import block. Do not use the model's memory of the file.
   Expected: a definitive list of what the file imports.
2. Compare each "missing import" claim against that list.
   Expected: claims matching a real import are marked false.
3. Drop the false claims before anything reaches the PR.
   Expected: they never get posted.
4. For any remaining claim, verify by running the file's linter or compiler and checking for a real unresolved-import error.
   Expected: only tool-confirmed missing imports get reported.
5. Tighten the review instructions: the agent must quote the full import block before claiming anything is missing.
   Expected: fewer claims, and all of them checkable.
6. If the file uses dynamic or conditional imports, teach the checker to recognize those patterns so they stop producing false findings.
   Expected: dynamic imports no longer trigger phantom reports.

## Use this when
- the agent reports missing imports that exist
- the finding quotes the import block selectively or not at all
- developers are dismissing the agent's import findings as noise

## Not for this skill when
- imports are genuinely missing (run the compiler; that is a real bug)
- the complaint is about unused imports (a different check, usually correct)
- the file is in a language without explicit imports (nothing to hallucinate about)

## Variant phrasings
### ai reviewer said import is missing but its right there
### false missing-import findings in automated review
### review bot claims module not imported when it is

## Why it happens
The model typically reviews a diff hunk, not the whole file, so the import block at the top of the file is outside what it sees. It spots a used name with no visible import and reports it missing. Truncated context plus eagerness to find issues equals phantom missing imports.

## Edge cases
- Re-exports and barrel files confuse naive import scans; resolve the import chain before judging.
- Type-only imports in TypeScript look unused to simple scans; do not flag them.
- Star and wildcard imports cover many names; the checker must account for them.
- In notebooks and REPL-style files, imports may live in earlier cells; scan the whole document.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_irPMPBeesXluxhdf1MQEJg
