Problem
The PDD agentic bug workflow incorrectly creates duplicate prompt files in the wrong directory structure when analyzing existing codebases.
Evidence from PR #645 in pdd_cloud
When running pdd bug https://github.com/promptdriven/pdd_cloud/issues/643, the workflow created:
✅ Correct (modified existing): prompts/frontend/app/settings/billing/page_TypescriptReact.prompt
❌ Duplicate (wrong location): frontend/prompts/frontend/app/settings/billing/page_TypescriptReact.prompt
Root Cause Analysis
The prompt file discovery logic in the agentic bug workflow appears to incorrectly assume prompt files should be in the same directory tree as the source code being analyzed.
Source file analyzed: frontend/src/app/settings/billing/page.tsx
Incorrectly created prompt at: frontend/prompts/frontend/app/settings/billing/page_TypescriptReact.prompt
Should have found existing: prompts/frontend/app/settings/billing/page_TypescriptReact.prompt
Impact
This creates:
- Duplicate prompt files with identical content
- Confusion about which is the "canonical" prompt
- Repository pollution with incorrect file structures
- Potential sync conflicts when different tools reference different copies
- Breaks the established PDD project structure conventions
Expected Behavior
The agentic bug workflow should:
- Discover existing prompt files using the project's
.pddrc configuration
- Respect the established directory structure (
prompts/ not frontend/prompts/)
- Modify existing prompts rather than creating duplicates
- Use the same path resolution logic as
pdd sync and other commands
Suspected Location
This bug is likely in one of these files:
pdd/agentic_bug_orchestrator.py - Step that creates/modifies prompt files
pdd/construct_paths.py - Path resolution and discovery logic
pdd/prompts/agentic_bug_step*.prompt - The LLM prompt that handles prompt file creation
Reproduction Steps
- Run
pdd bug <issue-url> on any issue that requires modifying existing frontend modules
- Check if duplicate prompt files are created in
frontend/prompts/ vs prompts/frontend/
- Observe incorrect directory structure in the generated PR
Project Context
This was discovered while fixing CORS issues in pdd_cloud settings billing page:
Fix Requirements
The agentic bug workflow must use the same prompt discovery logic as other PDD commands to:
- Find existing prompt files correctly via
.pddrc configuration
- Respect established directory conventions
- Never create duplicate prompt files in alternative locations
Problem
The PDD agentic bug workflow incorrectly creates duplicate prompt files in the wrong directory structure when analyzing existing codebases.
Evidence from PR #645 in pdd_cloud
When running
pdd bug https://github.com/promptdriven/pdd_cloud/issues/643, the workflow created:✅ Correct (modified existing):
prompts/frontend/app/settings/billing/page_TypescriptReact.prompt❌ Duplicate (wrong location):
frontend/prompts/frontend/app/settings/billing/page_TypescriptReact.promptRoot Cause Analysis
The prompt file discovery logic in the agentic bug workflow appears to incorrectly assume prompt files should be in the same directory tree as the source code being analyzed.
Source file analyzed:
frontend/src/app/settings/billing/page.tsxIncorrectly created prompt at:
frontend/prompts/frontend/app/settings/billing/page_TypescriptReact.promptShould have found existing:
prompts/frontend/app/settings/billing/page_TypescriptReact.promptImpact
This creates:
Expected Behavior
The agentic bug workflow should:
.pddrcconfigurationprompts/notfrontend/prompts/)pdd syncand other commandsSuspected Location
This bug is likely in one of these files:
pdd/agentic_bug_orchestrator.py- Step that creates/modifies prompt filespdd/construct_paths.py- Path resolution and discovery logicpdd/prompts/agentic_bug_step*.prompt- The LLM prompt that handles prompt file creationReproduction Steps
pdd bug <issue-url>on any issue that requires modifying existing frontend modulesfrontend/prompts/vsprompts/frontend/Project Context
This was discovered while fixing CORS issues in pdd_cloud settings billing page:
Fix Requirements
The agentic bug workflow must use the same prompt discovery logic as other PDD commands to:
.pddrcconfiguration