Templates outgrow their documentation
A prompt template that has been edited over several months by several people accumulates variables. Nobody maintains a list, and the only authoritative source is the template itself.
Extracting the list mechanically is how you find the variable that was added six weeks ago and is only populated on one code path.
Generating a type
The TypeScript output turns an unfilled placeholder from a runtime surprise into a compile error. That is the single most effective fix for this class of bug, and it costs nothing to adopt.
The JSON skeleton serves the same purpose for a test fixture: it gives you every key the template needs, so a test cannot silently omit one.
What the usage counts tell you
A variable used once is usually fine. A variable used four times is a maintenance risk — change its meaning and you must find every occurrence, and templates are not refactored by tooling.
Repeated substitution is also a token cost: the same value inserted four times is billed four times. Where the repetition exists for emphasis rather than necessity, it is usually removable.