A transit team's prompts are embedded inside UI code. What large-scale refactor fits?
Select an answer to reveal the explanation.
Short Explanation
Prompts glued to the UI are like schedules painted on the bus doors—impossible to version cleanly. Pull them into their own modules.
Full Explanation
Transit teams whose prompts are embedded inside UI code should move those prompts out of UI code into versioned modules as a large-scale refactor. Extracting prompts fits because instructional text for Claude changes independently of stylesheets and button layout: versioned modules enable review, reuse across apps, A/B of wording, and unit testing of prompt assembly without compiling UI. Clean separation also prevents designers and frontend edits from accidentally altering production model instructions. Consolidating prompts into shared UI helper functions fails by concept: helper functions still live inside the UI layer and couple instructional text to components, so prompts remain entangled with stylesheets and layout rather than existing as independent, versioned modules. Caching prompt responses in browser local storage fails by concept: it stores model outputs on the client instead of managing prompt source, leaving prompts embedded in UI code and introducing stale or offline data without solving versioning or review. Managing prompt edits through CMS preview workflows fails by concept: preview workflows are content-editing tools, not deployable, versioned source for runtime Claude calls, and they do not extract prompts out of UI code into reviewable modules. Exam caveat: extracted modules still need ownership, content-boundary review, and environment-specific configuration where transit agencies differ—and moving files is not complete until call sites import the modules instead of legacy inline strings. Operational check: relocate a production transit prompt into a versioned module, add a golden-file or unit test for the assembled Messages API payload, remove the UI-embedded copy, and verify the rider-facing flow still produces the same Claude request structure in staging.