Placeholder write-up. Replace this body with the real account.
Why it exists
Prompts in a production codebase drift toward the worst of both worlds: scattered f-strings that nobody can find, or a config system heavy enough that nobody wants to touch it. Neither survives a team.
The approach
Prompts are classes. Subclass PromptBase, return the template from
set_prompt, and the manager discovers it. There is no registry to maintain and
no import list to keep in sync. Related variants group automatically, and
validation runs at load rather than at call time, so a missing variable is a
startup error rather than a production one.
from gs_prompt_manager import PromptBase
class GreetingPrompt(PromptBase):
def set_prompt(self):
return "Hello, {name}! Welcome to {place}."
prompt = GreetingPrompt()
prompt({"name": "Alice", "place": "Wonderland"})
What I would do differently
To be written.