Introduction
Deck by PromptPHP provides an Artisan generator command that scaffolds versioned, role-based prompt structures for your AI agents. The command follows Laravel conventions and supports interactive workflows, automatic versioning, customisable stubs, and rich metadata.Generating prompts
Basic usage
To create a new prompt, use themake:prompt Artisan command:
resources/prompts):
metadata.json files are written: one at the prompt root recording the prompt’s name, description, roles, and creation timestamp, and one inside the version directory recording that version alone.
Interactive mode
Run the command without any arguments to enter a fully interactive flow:- What should the prompt be named? — Provide a name (automatically converted to kebab-case).
- Briefly describe this prompt (press Enter to skip) — An optional description stored in
metadata.json. - Would you also like to create a user prompt file? — Confirm to scaffold a
user.mdalongsidesystem.md. - Would you like to create prompt files for additional roles? — Confirm, then enter comma-separated role names (e.g.
assistant, developer).
The interactive description and user-prompt questions are only asked when
the name argument is omitted. When passing a name directly, use the
--desc, --user, and --interactive options instead.Command signature
Arguments
Options
Prompt structure
Directory layout
Every prompt is organised into a named directory containing versioned sub-directories and ametadata.json file:
deck.extension configuration value (default: md). For example, setting it to txt produces system.txt, user.txt, etc.
Metadata
The command writes two metadata files: one at the prompt root describing the prompt as a whole, and one inside the version directory describing that version.Prompt metadata
<prompt-name>/metadata.json is merged, never replaced, each time the command runs:
Any other keys you add by hand are preserved — including
active_version, so scaffolding a new version never changes which version your application serves. When another version is active, the command tells you how to promote the one you just created:
Version metadata
<prompt-name>/v{n}/metadata.json records that version alone:
Roles
System role (default)
Asystem.md file is always created. This is the primary prompt file and represents the system-level instructions for your AI agent. No flag is needed:
User role
To also scaffold a user prompt file, pass the--user (or -u) flag:
Extra roles
You can scaffold prompt files for any additional roles using the--role option. It is repeatable:
ToolCall becomes tool-call.md). Each role file uses the role-prompt.stub template with the {{ $role }} placeholder replaced by the actual role name.
The default role prompt stub contains:
--interactive (or -i):
When
--role values are provided explicitly, the interactive role prompt is
skipped — explicit values always take precedence.system and optionally user) are recorded in the roles array of metadata.json.
Versioning
Deck uses directory-based versioning. Each version lives in its own sub-directory (v1/, v2/, etc.) inside the prompt folder.
Auto-increment
When you run the command for a prompt that already has one or more versions, you are presented with a choice:v3/). Existing versions remain untouched.
Overwriting
Selecting “Overwrite” replaces the files in the latest version directory. The version number stays the same, but the prompt files are regenerated from the current stubs. Selecting “Cancel” aborts the command without making any changes.Force mode
In non-interactive environments (CI pipelines, scripts), use--force (or -f) to overwrite the latest version without any prompts:
--force overwrites v2/ directly. It will never create a new version automatically — its purpose is to regenerate the latest version.
For brand-new prompts, --force has no special effect; v1/ is created as normal.
Stubs
The content of generated prompt files comes from stub templates. Three stubs ship with the package:Default stubs
The default stubs are located in the package’s
stubs/ directory.
Custom stubs
To customise the stubs for your project, create astubs/deck/ directory at your application root and place your own versions of any stub file there:
Using a one-off template
To use a specific file as the user prompt template for a single invocation, pass--from:
--from option only affects the user prompt file. The system prompt always uses its own stub.
Name normalisation
All prompt names are automatically converted to kebab-case for consistent directory naming. The conversion handles a variety of input formats:
This normalisation applies to both the prompt name and any extra role names provided via
--role.
Configuration
The command respects the following values fromconfig/deck.php:
See the full Configuration reference for all options.