Overview
pdd generate produces the full implementation code that fulfills all requirements in a prompt. When changes are detected between the current prompt and its last committed version, it automatically performs incremental updates rather than full regeneration.
Passing a GitHub issue URL instead of a prompt file activates agentic architecture mode, which runs an 11-step workflow to generate architecture.json, .pddrc, and prompt files from a PRD.
Usage
- Prompt file
- Agentic (GitHub issue)
- Template
PROMPT_FILE— Path to the prompt file, or a GitHub issue URL for agentic architecture mode. Required unless--templateis used.
Options
Where to save the generated code. Supports
$VAR and ${VAR} expansion from -e/--env values. Defaults to <basename>.<language_extension> in the current directory, or to PDD_GENERATE_OUTPUT_PATH if that environment variable is set.The original prompt file used to generate the existing code. When omitted, the command automatically retrieves the last committed version of the prompt file from git.
Force incremental patching even if changes are significant. Only valid when
--output points to an existing file.Path to a unit test file. When provided, automatic test discovery is disabled and only this file’s content is included in the prompt, instructing the model to generate code that passes the specified tests.
Do not automatically include test files found in the default tests directory.
Use a built-in or project template instead of a prompt file. Cannot be combined with
PROMPT_FILE.Set parameter variables as
KEY=VALUE pairs (repeatable). Used for prompt templating and --output path expansion. See Parameter variables below.Target subdirectory for the new project (agentic architecture mode only).
In agentic architecture mode, skip prompt file generation (steps 8–11) and only generate
architecture.json and .pddrc.In agentic architecture mode, force single-project generation even if the PRD describes a complex multi-app system (skips the complexity check).
Parameter variables
Use-e KEY=VALUE (or -e KEY to read VALUE from the current shell environment) to parameterize a prompt so that one prompt can generate multiple files with different values.
- In prompt content:
$VARand${VAR}are replaced only whenVARwas explicitly provided via-e. - In
--output: the same variable set is used for path expansion. - Unknowns: placeholders without a provided value are left unchanged — no escaping required.
- Precedence:
-e/--envvalues override same-named OS environment variables during expansion for this command.
- Quote values with spaces:
-e "DISPLAY_NAME=Order Processor". - Use single quotes to let PDD expand
--outputrather than the shell:--output 'src/${MODULE}.py'.
Git integration
Generate uses git to determine the scope of changes:- When the output file exists and the prompt has changed since the last commit, generate automatically considers incremental patching.
- After incremental generation, both the prompt and code file are staged with
git addto ensure rollback is possible. - Full regeneration always occurs for new files (no existing output file) or when the output file has been deleted.
Agentic architecture mode
When the positional argument is a GitHub issue URL,generate enters agentic architecture mode. The issue body serves as the PRD (Product Requirements Document), and an 11-step workflow produces architecture.json, .pddrc, and prompt files.
Design
Module breakdown with dependency graph and priority ordering. Auth modules are separated into dedicated concerns with low priority numbers.
ghCLI must be installed and authenticated.- The issue must contain a PRD describing the project scope.
pdd generate <issue-url> resumes from the last completed step. State is persisted to GitHub issue comments for cross-machine resume.
Hard stops: The workflow halts if the PRD is insufficient, the tech stack is ambiguous, or clarification is needed. Answer any questions in the issue and re-run to continue.
Templates
Templates are reusable prompt files with YAML front matter metadata. Use--template instead of a prompt file path: