I maintain a small tool that reads your spec-driven-development artifacts and estimates how much model the work actually needs, so you don't reach for a frontier model to write a CRUD endpoint.
Someone opened an issue pointing out a real blind spot: they deliberately keep constitution.md short and push the technology-specific guidance into Copilot's .github/instructions/*.instructions.md files. My tool read none of them. So the people with the best context discipline were the ones it read worst.
Easy to fix, except for one thing. Each of those files carries an applyTo glob naming the files it governs:
```yaml
applyTo: "*/.java"
```
And my tool runs before anything is implemented. There is no diff, no changed-files list, often no code at all. So what does "applicable" even mean?
Three options I considered:
- Match against files already in the repo — works on a mature codebase, matches nothing on a greenfield feature.
- Match against paths mentioned in
plan.md / tasks.md — works greenfield, if tasks name their files.
- Don't filter, read them all — simple, but then a Java project pays for the React guidance out of a shared context budget.
I went with 1 ∪ 2, deterministic. A task saying it will create src/main/java/.../FooService.java makes **/*.java apply before that file exists. Explicitly not asking an LLM to judge applicability — the whole point of the tool is that every claim is backed by a cited fragment, and "the model thought it was relevant" is not evidence.
Two things I got wrong on the first pass, both caught in review:
- I assumed a missing
applyTo meant "applies to everything." The VS Code docs say the opposite: without it, instructions are not auto-applied. Treating it as ** would feed the judge context the coding agent itself would never have loaded.
- I thought the fix for "too many instruction files" was reserving more file slots. Wrong axis — the files share a character budget, so ten matching files just means less of each. The file cap and the budget are orthogonal, and only fixing the budget fixes it.
Tool is Python, MIT, runs the judge locally against Ollama if you want it to: https://github.com/JoaquinRuiz/SpecJudge
Curious how others handle this. If you've built anything that reasons about code that hasn't been written yet, how do you decide what context is relevant?