Agent Framework + middleware + source generation is the way to go.
Agent Framework made middleware much easier to work with.
Source generation makes it possible to build "strongly typed prompts"[0]
Middleware makes it possible to substitute those at runtime if necessary.
[0] https://github.com/CharlieDigital/SKPromptGenerator/tree/mai...