veeqtoh/prompt-deck
Manage AI prompts as versioned files in Laravel and PHP. Organise agent instructions, compare prompt performance, and activate the right version with variable interpolation, tracking, A/B testing, and AI SDK integration.
resources/prompts and ship with the app, "tweak the support agent's tone" is a deploy, not a config change. That's a deliberate trade — git review, code review, and rollback for prompt content — and it should be an explicit roadmap decision, not an accident. If prompt changes must ship faster than your deploy cadence, this approach is the wrong primitive.prompt:activate + the active_version key gives you a one-command promote/rollback story for prompt changes. That's a genuine incident-response lever: when an agent starts behaving badly, you revert the prompt instead of hotfixing code.make:prompt, prompt:list, and prompt:diff. This is what makes it viable to have more than one engineer touching agent behavior, and it makes prompt changes auditable in PR history.HasPromptTemplate trait removes hand-written instructions() methods from agents, which reduces drift between "the prompt we think is running" and "the prompt that is running."Adopt when most of these are true:
toMessages() as a plain array builder for any chat-completion API.veeqtoh/prompt-deck → promptphp/deck, namespace Veeqtoh\PromptDeck → PromptPHP\Deck) at v0.4.0, and v0.4.6 was a substantial correctness release. Budget for reading upgrade guides on minor bumps and pinning versions.Look elsewhere or build when:
active_version file is bootstrap state, and once tracking is enabled the database takes precedence — environment state and git state can diverge, which is a governance problem for regulated or multi-tenant products.Adoption caveats worth a written note: install from the new package name (promptphp/deck), not the old one, and check config/deck.php rather than relying on defaults — tracking now defaults off after 0.4.6, so if you want the metrics that justify the adoption, set DECK_TRACKING_ENABLED=true and run the tracking migrations as a deliberate step. Also confirm your migration and config publishing steps in staging first: the 0.4.6 fixes describe exactly the failure mode (no such table on first Deck::get() in a production-shaped install) that erodes trust in a first rollout.
For executives: We are shipping AI features whose behavior is largely determined by prompt text, and today that text is buried in application code with no versioning, no review trail, and no way to tell whether a change made things better or worse. Deck is a small, MIT-licensed Laravel package that makes prompts versioned, reviewable files with a promote/rollback command and optional per-version performance tracking. The value is risk reduction and decision quality: every prompt change becomes a reviewable diff with a one-command rollback, and we can compare cost, latency, and quality between prompt versions instead of guessing. It is not a platform commitment — prompts stay as files in our repository and we can walk away at any time. Cost is integration time plus a small amount of ongoing upgrade maintenance; the package is pre-1.0 and recently renamed, so we should pin versions and plan for occasional upgrade work.
For engineering: Low-risk, Laravel-idiomatic addition. Prompts become files under resources/prompts managed by Artisan commands; the Deck facade renders them with {{ $variable }} interpolation and returns a ready-made messages array, with an optional trait that supplies instructions() for Laravel AI SDK agents. Tracking is opt-in and must degrade gracefully — verify in staging that a missing tracking table logs a warning rather than throwing, and confirm the database-vs-metadata.json precedence for active_version before enabling it in production, since that changes what "edit the file and deploy" means. Pin the version, read the 0.4.x upgrade guides, and treat the prompt directory as reviewable source of truth.
For the product team: Prompt changes will follow the release train unless we invest in something more. If sub-day prompt iteration or non-engineer editing is on the roadmap, flag it now — that's a different (larger) investment than this package represents.
How can I help you explore Laravel packages today?