pdd detect has two modes: change detection mode and user story validation mode. Change detection identifies which prompts are impacted by a described change. User story validation (--stories) checks that all user stories continue to pass against your current set of prompts. pdd change uses pdd detect internally after modifying prompts.
Usage
Arguments
One or more prompt files to analyze. The last positional argument is always treated as the
CHANGE_FILE. Not allowed in --stories mode.A file whose content describes the change to be analyzed. PDD uses this description to determine which prompts need modifications. Not allowed in
--stories mode.Options
Where to save the CSV analysis results. Default:
<change_file_basename>_detect.csv. Also reads from PDD_DETECT_OUTPUT_PATH. Not supported in --stories mode.Run user story validation mode. Positional
PROMPT_FILES and CHANGE_FILE arguments are not allowed when this flag is set.Directory containing
story__*.md files. Default: user_stories. Used in --stories mode only.Directory containing
.prompt files. Default: prompts. Used in --stories mode only.Include
*_llm.prompt files in user story validation. Used in --stories mode only.Stop on the first failing story in
--stories mode. Use --no-fail-fast to run all stories and collect all failures before reporting.Output format
In change detection mode, the output CSV has two columns:| Column | Description |
|---|---|
prompt_name | The name of the prompt file that needs changes |
change_instructions | Description of what changes are needed in that prompt |
This CSV format is compatible with
pdd change --csv, allowing you to chain the commands: detect which prompts need changes, then batch-apply them.User story validation mode
In--stories mode, pdd detect validates each story__*.md file against the current set of prompts. A story passes when detect returns no required prompt changes for that story’s scope.
Stories may include optional metadata to scope validation to a subset of prompts:
| Variable | Default | Description |
|---|---|---|
PDD_USER_STORIES_DIR | user_stories | Stories directory |
PDD_PROMPTS_DIR | prompts | Prompts directory |
Examples
Relationship with pdd change
pdd change calls pdd detect --stories automatically after modifying prompts to verify that no existing user stories are broken by the changes. If any story fails, pdd change will fail and report which stories need attention.
Related commands
pdd change— Usesdetectinternally and can consume the CSV output via--csv.pdd conflicts— Produces the same CSV format for a different analysis (prompt-vs-prompt conflicts).