feat: Hierarchical architecture generation for large PRDs (#604)#647
Open
prompt-driven-github[bot] wants to merge 1 commit intomainfrom
Open
feat: Hierarchical architecture generation for large PRDs (#604)#647prompt-driven-github[bot] wants to merge 1 commit intomainfrom
prompt-driven-github[bot] wants to merge 1 commit intomainfrom
Conversation
Add subsystem support to architecture prompts and schema, enabling recursive sub-architecture generation for projects with 30+ modules. This prevents the LLM from collapsing granular routes/components into single modules when processing large PRDs. Changes: - architecture_json.prompt: Add "subsystem" type with sub_architecture_dir and scope fields - Step 5 (design): Add complexity assessment and subsystem hierarchy guidance - Step 5b/5b-fix (gate): Accept subsystem-scoped requirements as covered - Step 7 (generate): Document subsystem entry format in architecture.json - Step 7b (review): Validate subsystem entries for scope and directory correctness - Step 8 (.pddrc): Skip subsystem entries when building context mappings - Step 9 (prompts): Skip prompt generation for subsystem entries - Step 10 (validation): Defer subsystem-scoped requirements validation - Documentation: Update README, FAQ, tutorials, and prompting guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add subsystem support to the architecture generation pipeline, enabling recursive sub-architecture generation for large PRDs (30+ modules). This prevents the LLM from collapsing granular API routes and components into single modules — addressing the issue where a 74-module video editor PRD produced only 50 modules.
Closes #604
Changes Made
Schema Modified
pdd/templates/architecture/architecture_json.prompt— Add"type": "subsystem"entry withsub_architecture_dirandscopefieldsPrompts Modified
pdd/prompts/agentic_arch_step5_design_LLM.prompt— Add complexity assessment; instruct LLM to design subsystem hierarchy for 30+ module projectspdd/prompts/agentic_arch_step5b_completeness_gate_LLM.prompt— Accept subsystem-scoped requirements as coveredpdd/prompts/agentic_arch_step5b_fix_LLM.prompt— Handle subsystem entries when fixing completeness gapspdd/prompts/agentic_arch_step7_generate_LLM.prompt— Document subsystem entry format in architecture.json outputpdd/prompts/agentic_arch_step7b_review_LLM.prompt— Validate subsystem entries (scope coverage, directory paths, no overlaps)pdd/prompts/agentic_arch_step8_pddrc_LLM.prompt— Skip subsystem entries when building .pddrc context mappingspdd/prompts/agentic_arch_step9_prompts_LLM.prompt— Skip prompt generation for subsystem entriespdd/prompts/agentic_arch_step10_completeness_LLM.prompt— Defer subsystem-scoped requirements; skip prompt file checks for subsystem entriesDocumentation Updated
README.md— Add hierarchical architecture feature descriptiondocs/TUTORIALS.md— Add tutorial section on subsystem usagedocs/faq.md— Add FAQ entry for large PRD handlingdocs/prompting_guide.md— Add guidance on subsystem promptingReview Checklist
Note on Orchestrator Changes
This PR covers prompt and schema changes only. The following code changes are required to enable the full recursive workflow but are outside prompt scope:
pdd/agentic_architecture_orchestrator.py— Detect subsystem entries after Step 7 and recursively invoke the workflowpdd/agentic_architecture.py— Support scoped PRD context for subsystem passespdd/registry.py— Register and resolve cross-subsystem dependenciesThese should be implemented in a follow-up PR or as part of this PR before merge.
Next Steps After Merge
Created by pdd change workflow