pdd-cli 0.0.90__py3-none-any.whl → 0.0.118__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. pdd/__init__.py +38 -6
  2. pdd/agentic_bug.py +323 -0
  3. pdd/agentic_bug_orchestrator.py +497 -0
  4. pdd/agentic_change.py +231 -0
  5. pdd/agentic_change_orchestrator.py +526 -0
  6. pdd/agentic_common.py +521 -786
  7. pdd/agentic_e2e_fix.py +319 -0
  8. pdd/agentic_e2e_fix_orchestrator.py +426 -0
  9. pdd/agentic_fix.py +118 -3
  10. pdd/agentic_update.py +25 -8
  11. pdd/architecture_sync.py +565 -0
  12. pdd/auth_service.py +210 -0
  13. pdd/auto_deps_main.py +63 -53
  14. pdd/auto_include.py +185 -3
  15. pdd/auto_update.py +125 -47
  16. pdd/bug_main.py +195 -23
  17. pdd/cmd_test_main.py +345 -197
  18. pdd/code_generator.py +4 -2
  19. pdd/code_generator_main.py +118 -32
  20. pdd/commands/__init__.py +6 -0
  21. pdd/commands/analysis.py +87 -29
  22. pdd/commands/auth.py +309 -0
  23. pdd/commands/connect.py +290 -0
  24. pdd/commands/fix.py +136 -113
  25. pdd/commands/maintenance.py +3 -2
  26. pdd/commands/misc.py +8 -0
  27. pdd/commands/modify.py +190 -164
  28. pdd/commands/sessions.py +284 -0
  29. pdd/construct_paths.py +334 -32
  30. pdd/context_generator_main.py +167 -170
  31. pdd/continue_generation.py +6 -3
  32. pdd/core/__init__.py +33 -0
  33. pdd/core/cli.py +27 -3
  34. pdd/core/cloud.py +237 -0
  35. pdd/core/errors.py +4 -0
  36. pdd/core/remote_session.py +61 -0
  37. pdd/crash_main.py +219 -23
  38. pdd/data/llm_model.csv +4 -4
  39. pdd/docs/prompting_guide.md +864 -0
  40. pdd/docs/whitepaper_with_benchmarks/data_and_functions/benchmark_analysis.py +495 -0
  41. pdd/docs/whitepaper_with_benchmarks/data_and_functions/creation_compare.py +528 -0
  42. pdd/fix_code_loop.py +208 -34
  43. pdd/fix_code_module_errors.py +6 -2
  44. pdd/fix_error_loop.py +291 -38
  45. pdd/fix_main.py +204 -4
  46. pdd/fix_verification_errors_loop.py +235 -26
  47. pdd/fix_verification_main.py +269 -83
  48. pdd/frontend/dist/assets/index-B5DZHykP.css +1 -0
  49. pdd/frontend/dist/assets/index-DQ3wkeQ2.js +449 -0
  50. pdd/frontend/dist/index.html +376 -0
  51. pdd/frontend/dist/logo.svg +33 -0
  52. pdd/generate_output_paths.py +46 -5
  53. pdd/generate_test.py +212 -151
  54. pdd/get_comment.py +19 -44
  55. pdd/get_extension.py +8 -9
  56. pdd/get_jwt_token.py +309 -20
  57. pdd/get_language.py +8 -7
  58. pdd/get_run_command.py +7 -5
  59. pdd/insert_includes.py +2 -1
  60. pdd/llm_invoke.py +459 -95
  61. pdd/load_prompt_template.py +15 -34
  62. pdd/path_resolution.py +140 -0
  63. pdd/postprocess.py +4 -1
  64. pdd/preprocess.py +68 -12
  65. pdd/preprocess_main.py +33 -1
  66. pdd/prompts/agentic_bug_step10_pr_LLM.prompt +182 -0
  67. pdd/prompts/agentic_bug_step1_duplicate_LLM.prompt +73 -0
  68. pdd/prompts/agentic_bug_step2_docs_LLM.prompt +129 -0
  69. pdd/prompts/agentic_bug_step3_triage_LLM.prompt +95 -0
  70. pdd/prompts/agentic_bug_step4_reproduce_LLM.prompt +97 -0
  71. pdd/prompts/agentic_bug_step5_root_cause_LLM.prompt +123 -0
  72. pdd/prompts/agentic_bug_step6_test_plan_LLM.prompt +107 -0
  73. pdd/prompts/agentic_bug_step7_generate_LLM.prompt +172 -0
  74. pdd/prompts/agentic_bug_step8_verify_LLM.prompt +119 -0
  75. pdd/prompts/agentic_bug_step9_e2e_test_LLM.prompt +289 -0
  76. pdd/prompts/agentic_change_step10_identify_issues_LLM.prompt +1006 -0
  77. pdd/prompts/agentic_change_step11_fix_issues_LLM.prompt +984 -0
  78. pdd/prompts/agentic_change_step12_create_pr_LLM.prompt +131 -0
  79. pdd/prompts/agentic_change_step1_duplicate_LLM.prompt +73 -0
  80. pdd/prompts/agentic_change_step2_docs_LLM.prompt +101 -0
  81. pdd/prompts/agentic_change_step3_research_LLM.prompt +126 -0
  82. pdd/prompts/agentic_change_step4_clarify_LLM.prompt +164 -0
  83. pdd/prompts/agentic_change_step5_docs_change_LLM.prompt +981 -0
  84. pdd/prompts/agentic_change_step6_devunits_LLM.prompt +1005 -0
  85. pdd/prompts/agentic_change_step7_architecture_LLM.prompt +1044 -0
  86. pdd/prompts/agentic_change_step8_analyze_LLM.prompt +1027 -0
  87. pdd/prompts/agentic_change_step9_implement_LLM.prompt +1077 -0
  88. pdd/prompts/agentic_e2e_fix_step1_unit_tests_LLM.prompt +90 -0
  89. pdd/prompts/agentic_e2e_fix_step2_e2e_tests_LLM.prompt +91 -0
  90. pdd/prompts/agentic_e2e_fix_step3_root_cause_LLM.prompt +89 -0
  91. pdd/prompts/agentic_e2e_fix_step4_fix_e2e_tests_LLM.prompt +96 -0
  92. pdd/prompts/agentic_e2e_fix_step5_identify_devunits_LLM.prompt +91 -0
  93. pdd/prompts/agentic_e2e_fix_step6_create_unit_tests_LLM.prompt +106 -0
  94. pdd/prompts/agentic_e2e_fix_step7_verify_tests_LLM.prompt +116 -0
  95. pdd/prompts/agentic_e2e_fix_step8_run_pdd_fix_LLM.prompt +120 -0
  96. pdd/prompts/agentic_e2e_fix_step9_verify_all_LLM.prompt +146 -0
  97. pdd/prompts/agentic_fix_primary_LLM.prompt +2 -2
  98. pdd/prompts/agentic_update_LLM.prompt +192 -338
  99. pdd/prompts/auto_include_LLM.prompt +22 -0
  100. pdd/prompts/change_LLM.prompt +3093 -1
  101. pdd/prompts/detect_change_LLM.prompt +571 -14
  102. pdd/prompts/fix_code_module_errors_LLM.prompt +8 -0
  103. pdd/prompts/fix_errors_from_unit_tests_LLM.prompt +1 -0
  104. pdd/prompts/generate_test_LLM.prompt +20 -1
  105. pdd/prompts/generate_test_from_example_LLM.prompt +115 -0
  106. pdd/prompts/insert_includes_LLM.prompt +262 -252
  107. pdd/prompts/prompt_code_diff_LLM.prompt +119 -0
  108. pdd/prompts/prompt_diff_LLM.prompt +82 -0
  109. pdd/remote_session.py +876 -0
  110. pdd/server/__init__.py +52 -0
  111. pdd/server/app.py +335 -0
  112. pdd/server/click_executor.py +587 -0
  113. pdd/server/executor.py +338 -0
  114. pdd/server/jobs.py +661 -0
  115. pdd/server/models.py +241 -0
  116. pdd/server/routes/__init__.py +31 -0
  117. pdd/server/routes/architecture.py +451 -0
  118. pdd/server/routes/auth.py +364 -0
  119. pdd/server/routes/commands.py +929 -0
  120. pdd/server/routes/config.py +42 -0
  121. pdd/server/routes/files.py +603 -0
  122. pdd/server/routes/prompts.py +1322 -0
  123. pdd/server/routes/websocket.py +473 -0
  124. pdd/server/security.py +243 -0
  125. pdd/server/terminal_spawner.py +209 -0
  126. pdd/server/token_counter.py +222 -0
  127. pdd/summarize_directory.py +236 -237
  128. pdd/sync_animation.py +8 -4
  129. pdd/sync_determine_operation.py +329 -47
  130. pdd/sync_main.py +272 -28
  131. pdd/sync_orchestration.py +136 -75
  132. pdd/template_expander.py +161 -0
  133. pdd/templates/architecture/architecture_json.prompt +41 -46
  134. pdd/trace.py +1 -1
  135. pdd/track_cost.py +0 -13
  136. pdd/unfinished_prompt.py +2 -1
  137. pdd/update_main.py +23 -5
  138. {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.118.dist-info}/METADATA +15 -10
  139. pdd_cli-0.0.118.dist-info/RECORD +227 -0
  140. pdd_cli-0.0.90.dist-info/RECORD +0 -153
  141. {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.118.dist-info}/WHEEL +0 -0
  142. {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.118.dist-info}/entry_points.txt +0 -0
  143. {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.118.dist-info}/licenses/LICENSE +0 -0
  144. {pdd_cli-0.0.90.dist-info → pdd_cli-0.0.118.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,131 @@
1
+ % You are an expert software engineer. Your task is to create a pull request from the worktree branch and link it to the original GitHub issue.
2
+
3
+ % Context
4
+
5
+ You are working on step 12 of 12 in an agentic change workflow. This is the final step. All prompt changes have been made and verified. Now you create a PR for review.
6
+
7
+ % Inputs
8
+
9
+ - GitHub Issue URL: {issue_url}
10
+ - Repository: {repo_owner}/{repo_name}
11
+ - Issue Number: {issue_number}
12
+ - Issue Title: {issue_title}
13
+ - Worktree Path: {worktree_path}
14
+ - Branch Name: change/issue-{issue_number}
15
+ - Files Changed: {files_to_stage}
16
+
17
+ % Issue Content
18
+ <issue_content>
19
+ {issue_content}
20
+ </issue_content>
21
+
22
+ % Change Summary (from previous steps)
23
+ <step8_output>
24
+ {step8_output}
25
+ </step8_output>
26
+
27
+ % Your Task
28
+
29
+ 1. **Stage all changes**
30
+ ```bash
31
+ cd {worktree_path}
32
+ git add -A
33
+ ```
34
+
35
+ 2. **Create commit**
36
+ - Use a clear commit message referencing the issue
37
+ - Format: `feat: [brief description] (#{issue_number})`
38
+
39
+ 3. **Push branch**
40
+ ```bash
41
+ git push -u origin change/issue-{issue_number}
42
+ ```
43
+
44
+ 4. **Create pull request**
45
+ Use `gh pr create` to create a PR that:
46
+ - References the original issue
47
+ - Summarizes the prompt changes made
48
+ - Lists files modified
49
+ - Includes next steps for reviewer
50
+
51
+ 5. **Link PR to issue**
52
+ - The PR body should include `Closes #{issue_number}` or `Fixes #{issue_number}`
53
+ - This ensures the issue is automatically closed when PR is merged
54
+
55
+ % Output
56
+
57
+ Create the PR using the gh CLI:
58
+
59
+ ```bash
60
+ gh pr create --title "feat: [description] (#{issue_number})" --body "..." --base main --head change/issue-{issue_number}
61
+ ```
62
+
63
+ Then post a final comment to the issue:
64
+
65
+ ```
66
+ gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
67
+ ```
68
+
69
+ **PR Body Format:**
70
+ ```markdown
71
+ ## Summary
72
+
73
+ [1-2 sentence description of what this PR does]
74
+
75
+ Closes #{issue_number}
76
+
77
+ ## Changes Made
78
+
79
+ ### Prompts Modified
80
+ - `prompts/xxx_python.prompt` - [brief description]
81
+ - `prompts/yyy_python.prompt` - [brief description]
82
+
83
+ ### Documentation Updated
84
+ - `README.md` - [brief description]
85
+
86
+ ## Review Checklist
87
+
88
+ - [ ] Prompt syntax is valid
89
+ - [ ] PDD conventions followed
90
+ - [ ] Documentation is up to date
91
+
92
+ ## Next Steps After Merge
93
+
94
+ 1. Run `pdd sync <module>` to regenerate code from modified prompts
95
+ 2. Run tests to verify functionality
96
+ 3. Deploy if applicable
97
+
98
+ ---
99
+ *Created by pdd change workflow*
100
+ ```
101
+
102
+ **Issue Comment Format:**
103
+ ```markdown
104
+ ## Step 12: Pull Request Created
105
+
106
+ **Status:** PR Ready for Review
107
+
108
+ ### Pull Request
109
+ [PR #{{pr_number}}]({{pr_url}})
110
+
111
+ ### Summary
112
+ - Branch: `change/issue-{issue_number}`
113
+ - Files changed: {{N}}
114
+ - Ready for review
115
+
116
+ ### What's Next
117
+ 1. Review the PR
118
+ 2. Run `pdd sync` on affected modules after merge
119
+ 3. Run tests to verify
120
+
121
+ ---
122
+ *Agentic change workflow complete. Total cost: ${{total_cost:.4f}}*
123
+ ```
124
+
125
+ % Important
126
+
127
+ - Always link the PR to the issue using "Closes #N" or "Fixes #N"
128
+ - Push to origin before creating PR
129
+ - Include clear next steps for the reviewer
130
+ - Report the PR URL in the issue comment
131
+ - This is the final step - workflow is complete after this
@@ -0,0 +1,73 @@
1
+ % You are an expert software engineer investigating a change request. Your task is to check if this issue is a duplicate of an existing issue.
2
+
3
+ % Context
4
+
5
+ You are working on step 1 of 12 in an agentic change workflow. Your findings will be posted as a comment on the GitHub issue.
6
+
7
+ % Inputs
8
+
9
+ - GitHub Issue URL: {issue_url}
10
+ - Repository: {repo_owner}/{repo_name}
11
+ - Issue Number: {issue_number}
12
+
13
+ % Issue Content
14
+ <issue_content>
15
+ {issue_content}
16
+ </issue_content>
17
+
18
+ % Your Task
19
+
20
+ 1. **Search for duplicates**
21
+ - Use `gh issue list` to search for similar issues in this repository
22
+ - Look for issues with similar feature requests, enhancement descriptions, or change proposals
23
+ - Consider both open and closed issues
24
+ - Search using key terms from the request (feature names, affected modules, desired behavior)
25
+
26
+ 2. **Evaluate matches**
27
+ - For each potential duplicate, read the issue to verify similarity
28
+ - Consider: same feature request? same affected modules? same desired outcome?
29
+ - A true duplicate requests the same change, not just uses similar keywords
30
+
31
+ 3. **Handle duplicates**
32
+ If duplicates are found:
33
+ - Merge any unique information from this issue into the original
34
+ - Add a comment to the original issue noting the additional context
35
+ - Close this issue with a comment linking to the original
36
+ - Report which issue is the canonical one
37
+
38
+ If no duplicates:
39
+ - Report that this appears to be a new change request
40
+ - Proceed with investigation
41
+
42
+ % Output
43
+
44
+ After completing your analysis, use `gh issue comment` to post your findings to issue #{issue_number}:
45
+
46
+ ```
47
+ gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
48
+ ```
49
+
50
+ Your comment should follow this format:
51
+
52
+ ```markdown
53
+ ## Step 1: Duplicate Check
54
+
55
+ **Status:** [No duplicates found | Duplicate of #XXX]
56
+
57
+ ### Search Performed
58
+ - Searched for: [key terms used]
59
+ - Issues reviewed: [count]
60
+
61
+ ### Findings
62
+ [If duplicates found: explanation of why they match and what action was taken]
63
+ [If no duplicates: brief confirmation this is a new change request]
64
+
65
+ ---
66
+ *Proceeding to Step 2: Documentation Check*
67
+ ```
68
+
69
+ % Important
70
+
71
+ - Always post your findings as a GitHub comment before completing
72
+ - If this is a duplicate, still post a comment explaining the closure
73
+ - Be thorough but efficient in your search
@@ -0,0 +1,101 @@
1
+ % You are an expert software engineer investigating a change request. Your task is to check if the requested change is already implemented or documented.
2
+
3
+ % Context
4
+
5
+ You are working on step 2 of 12 in an agentic change workflow. Previous step checked for duplicate issues.
6
+
7
+ **This step may terminate the workflow** if the feature is already implemented.
8
+
9
+ % Inputs
10
+
11
+ - GitHub Issue URL: {issue_url}
12
+ - Repository: {repo_owner}/{repo_name}
13
+ - Issue Number: {issue_number}
14
+ - Issue Author: @{issue_author}
15
+
16
+ % Issue Content
17
+ <issue_content>
18
+ {issue_content}
19
+ </issue_content>
20
+
21
+ % Previous Step Output
22
+ <step1_output>
23
+ {step1_output}
24
+ </step1_output>
25
+
26
+ % Your Task
27
+
28
+ 1. **Locate documentation**
29
+ - Find README.md, docs/, CONTRIBUTING.md, and any relevant documentation
30
+ - Look for API documentation, usage guides, or configuration docs
31
+ - Check for inline documentation in relevant code files
32
+
33
+ 2. **Check for existing implementation**
34
+ - Is the requested feature already implemented?
35
+ - Are there documented ways to achieve the same outcome?
36
+ - Does the documentation describe how to do what the user wants?
37
+
38
+ 3. **Evaluate**
39
+ - **Already Implemented**: Feature exists and is documented → STOP workflow
40
+ - **Partially Implemented**: Feature exists but needs enhancement → Continue workflow
41
+ - **Not Implemented**: Feature doesn't exist → Continue workflow
42
+ - **Documentation Gap**: Feature exists but isn't documented → Continue (fix docs)
43
+
44
+ % Output
45
+
46
+ After completing your analysis, use `gh issue comment` to post your findings to issue #{issue_number}:
47
+
48
+ ```
49
+ gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
50
+ ```
51
+
52
+ Your comment should follow this format:
53
+
54
+ **If Not Implemented or Needs Enhancement:**
55
+ ```markdown
56
+ ## Step 2: Documentation Check
57
+
58
+ **Status:** [Not Implemented | Partially Implemented | Documentation Gap]
59
+
60
+ ### Documentation Reviewed
61
+ - [List of files/sections checked]
62
+
63
+ ### Findings
64
+ [Explanation of current state vs. what the user requests]
65
+
66
+ ---
67
+ *Proceeding to Step 3: Identify Dev Units*
68
+ ```
69
+
70
+ **If Already Implemented (STOP workflow):**
71
+ ```markdown
72
+ ## Step 2: Documentation Check
73
+
74
+ **Status:** Already Implemented
75
+
76
+ ### Documentation Reviewed
77
+ - [List of files/sections checked]
78
+
79
+ ### Findings
80
+ The requested feature is already available. Here's how to use it:
81
+
82
+ **Current implementation:**
83
+ [Quote or summarize relevant documentation]
84
+
85
+ **How to achieve your goal:**
86
+ [Step-by-step instructions for the user]
87
+
88
+ ### Recommendation
89
+ The feature you requested already exists. Please try the approach above. If this doesn't meet your needs, please reopen this issue with more specific requirements.
90
+
91
+ ---
92
+ *Investigation paused - feature already exists.*
93
+ ```
94
+
95
+ % Important
96
+
97
+ - **STOP the workflow** if status is "Already Implemented"
98
+ - **CONTINUE the workflow** if status is "Not Implemented", "Partially Implemented", or "Documentation Gap"
99
+ - Tag the issue author when providing guidance
100
+ - Be helpful and provide clear instructions if feature exists
101
+ - Always post your findings as a GitHub comment before completing
@@ -0,0 +1,126 @@
1
+ % You are an expert software engineer using Prompt-Driven Development (PDD). Your task is to research and clarify the feature change request using web search.
2
+
3
+ % Context
4
+
5
+ You are working on step 3 of 12 in an agentic change workflow. Previous steps confirmed this is not a duplicate and the feature is not already implemented. Now you need to research the topic to better understand the requirements.
6
+
7
+ % Inputs
8
+
9
+ - GitHub Issue URL: {issue_url}
10
+ - Repository: {repo_owner}/{repo_name}
11
+ - Issue Number: {issue_number}
12
+
13
+ % Issue Content
14
+ <issue_content>
15
+ {issue_content}
16
+ </issue_content>
17
+
18
+ % Previous Step Outputs
19
+ <step1_output>
20
+ {step1_output}
21
+ </step1_output>
22
+
23
+ <step2_output>
24
+ {step2_output}
25
+ </step2_output>
26
+
27
+ % Your Task
28
+
29
+ 1. **Identify knowledge gaps**
30
+ - What technical concepts in the issue need clarification?
31
+ - Are there industry standards or best practices to consider?
32
+ - Are there existing libraries, tools, or patterns that could inform the implementation?
33
+
34
+ 2. **Conduct web research**
35
+ - Search for relevant documentation, tutorials, or examples
36
+ - Look for similar implementations in other projects
37
+ - Find best practices for the type of feature being requested
38
+ - Check for any security considerations or common pitfalls
39
+
40
+ 3. **Synthesize findings**
41
+ - Summarize the key insights from your research
42
+ - Identify how these findings affect the implementation approach
43
+ - Note any constraints or requirements discovered during research
44
+ - Highlight any alternative approaches worth considering
45
+
46
+ 4. **Refine specifications**
47
+ - Based on research, clarify any ambiguous requirements
48
+ - Suggest specific implementation details informed by best practices
49
+ - Identify edge cases or considerations the original issue may have missed
50
+
51
+ % Output
52
+
53
+ After completing your research, use `gh issue comment` to post your findings to issue #{issue_number}:
54
+
55
+ ```
56
+ gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
57
+ ```
58
+
59
+ Your comment should follow this format:
60
+
61
+ ```markdown
62
+ ## Step 3: Research & Clarification
63
+
64
+ **Status:** [Research Complete | Additional Clarification Needed]
65
+
66
+ ### Summary
67
+ [1-2 sentence summary of the research focus and key findings]
68
+
69
+ ### Research Findings
70
+
71
+ #### Technical Background
72
+ [Key concepts, standards, or patterns relevant to this feature]
73
+
74
+ #### Best Practices
75
+ [Industry best practices or patterns that should inform the implementation]
76
+
77
+ #### Similar Implementations
78
+ [Examples from other projects or libraries, if found]
79
+
80
+ #### Security/Edge Cases
81
+ [Any security considerations or edge cases discovered]
82
+
83
+ ### Refined Specifications
84
+ Based on the research, here are clarified requirements:
85
+ 1. [Clarified requirement or specification]
86
+ 2. [Additional consideration from research]
87
+ 3. [Edge case to handle]
88
+
89
+ ### Alternative Approaches Considered
90
+ - [Alternative 1]: [pros/cons]
91
+ - [Alternative 2]: [pros/cons]
92
+
93
+ ### Recommended Approach
94
+ [Brief recommendation based on research]
95
+
96
+ ---
97
+ *Proceeding to Step 4: Documentation Changes*
98
+ ```
99
+
100
+ **If additional user input is needed (PAUSE workflow):**
101
+ ```markdown
102
+ ## Step 3: Research & Clarification
103
+
104
+ **Status:** Additional Clarification Needed
105
+
106
+ ### Research Summary
107
+ [What was researched and found]
108
+
109
+ ### Questions for Clarification
110
+ 1. [Specific question that needs user input]
111
+ 2. [Another question if applicable]
112
+
113
+ ### Why This Matters
114
+ [Brief explanation of how the answer affects implementation]
115
+
116
+ ---
117
+ *Awaiting user response before proceeding.*
118
+ ```
119
+
120
+ % Important
121
+
122
+ - Focus on research that directly informs the implementation
123
+ - Be thorough but concise in summarizing findings
124
+ - Prioritize authoritative sources (official docs, established libraries)
125
+ - If the issue is already well-specified, acknowledge this and proceed
126
+ - Always post your findings as a GitHub comment before completing
@@ -0,0 +1,164 @@
1
+ % You are an expert software engineer using Prompt-Driven Development (PDD). Your task is to determine if the feature change request is clear enough to proceed with implementation.
2
+
3
+ % Context
4
+
5
+ You are working on step 4 of 12 in an agentic change workflow. Previous steps confirmed this is not a duplicate, is not already implemented, and conducted research. Now you must determine if the requirements are sufficiently clear.
6
+
7
+ **This step may STOP the workflow** if clarifying questions are needed. When the user answers and runs `pdd change` again, this step will re-evaluate.
8
+
9
+ % Inputs
10
+
11
+ - GitHub Issue URL: {issue_url}
12
+ - Repository: {repo_owner}/{repo_name}
13
+ - Issue Number: {issue_number}
14
+ - Issue Author: {issue_author}
15
+
16
+ % Issue Content
17
+ <issue_content>
18
+ {issue_content}
19
+ </issue_content>
20
+
21
+ % Previous Step Outputs
22
+ <step1_output>
23
+ {step1_output}
24
+ </step1_output>
25
+
26
+ <step2_output>
27
+ {step2_output}
28
+ </step2_output>
29
+
30
+ <step3_output>
31
+ {step3_output}
32
+ </step3_output>
33
+
34
+ % Your Task
35
+
36
+ 1. **Analyze clarity of requirements**
37
+ Review the issue content and research findings to assess:
38
+ - Is the problem statement clear and unambiguous?
39
+ - Are the expected outcomes/behaviors well-defined?
40
+ - Are there conflicting or vague requirements?
41
+ - Are edge cases and error handling addressed?
42
+ - Is the scope bounded (not too broad)?
43
+
44
+ 2. **Check for missing information**
45
+ Identify gaps that would block implementation:
46
+ - Missing input/output specifications
47
+ - Undefined behavior for edge cases
48
+ - Unclear integration points with existing code
49
+ - Ambiguous terminology or concepts
50
+ - Missing acceptance criteria
51
+
52
+ 3. **Decide: Clear or Needs Clarification**
53
+
54
+ **CLEAR ENOUGH** if:
55
+ - Core functionality is well-defined
56
+ - Implementation approach can be determined
57
+ - Edge cases can be reasonably inferred
58
+ - Minor ambiguities can be resolved during implementation
59
+
60
+ **NEEDS CLARIFICATION** if:
61
+ - Core requirements are ambiguous
62
+ - Multiple valid interpretations exist
63
+ - Critical edge cases are undefined
64
+ - Implementation would require guessing user intent
65
+
66
+ 4. **If clarification needed, formulate questions with options**
67
+ - Ask specific, actionable questions
68
+ - Provide context for why the answer matters
69
+ - **Always provide 2-3 possible answers** with explanations
70
+ - Explain the implications of each option
71
+ - Make a recommendation if you have a preference
72
+ - Limit to 2-4 most critical questions
73
+
74
+ % Output
75
+
76
+ After completing your analysis, use `gh issue comment` to post your findings to issue #{issue_number}:
77
+
78
+ ```
79
+ gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..."
80
+ ```
81
+
82
+ **If requirements are CLEAR ENOUGH:**
83
+ ```markdown
84
+ ## Step 4: Requirements Clarity Check
85
+
86
+ **Status:** Requirements Clear
87
+
88
+ ### Clarity Assessment
89
+ | Aspect | Status |
90
+ |--------|--------|
91
+ | Problem statement | :white_check_mark: Clear |
92
+ | Expected outcomes | :white_check_mark: Defined |
93
+ | Scope | :white_check_mark: Bounded |
94
+ | Edge cases | :white_check_mark: Addressable |
95
+
96
+ ### Understanding Summary
97
+ [1-2 sentence summary of what will be implemented]
98
+
99
+ ### Assumptions Made
100
+ - [Any reasonable assumptions for minor ambiguities]
101
+
102
+ ---
103
+ *Proceeding to Step 5: Documentation Changes*
104
+ ```
105
+
106
+ **If CLARIFICATION NEEDED (STOP workflow):**
107
+ ```markdown
108
+ ## Step 4: Requirements Clarity Check
109
+
110
+ **Status:** Clarification Needed
111
+
112
+ ### Clarity Assessment
113
+ | Aspect | Status |
114
+ |--------|--------|
115
+ | Problem statement | :white_check_mark: Clear |
116
+ | Expected outcomes | :x: Unclear |
117
+ | Scope | :warning: Partially defined |
118
+ | Edge cases | :x: Not addressed |
119
+
120
+ ### What's Clear
121
+ [Summary of well-defined aspects]
122
+
123
+ ### Questions for @{issue_author}
124
+
125
+ To proceed with implementation, I need clarification on the following:
126
+
127
+ 1. **[Topic - e.g., "Input Validation"]**
128
+
129
+ [Brief context explaining why this matters for implementation]
130
+
131
+ **Options:**
132
+ - **A) [Option name]**: [Description of this approach]
133
+ - Implications: [What this means for the implementation]
134
+ - **B) [Option name]**: [Description of this approach]
135
+ - Implications: [What this means for the implementation]
136
+ - **C) [Option name]**: [Description of this approach]
137
+ - Implications: [What this means for the implementation]
138
+
139
+ **Recommendation:** [Your suggestion if you have one, and why]
140
+
141
+ 2. **[Topic]**
142
+
143
+ [Context]
144
+
145
+ **Options:**
146
+ - **A)** [Option and implications]
147
+ - **B)** [Option and implications]
148
+
149
+ ### Next Steps
150
+ Please reply with your preferred options (e.g., "1A, 2B"). Then run `pdd change {issue_url}` again to continue.
151
+
152
+ ---
153
+ *Workflow paused - awaiting clarification from @{issue_author}*
154
+ ```
155
+
156
+ % Important
157
+
158
+ - Be pragmatic: don't block on minor details that can be reasonably inferred
159
+ - Focus on questions that would significantly impact implementation approach
160
+ - If requirements are 80%+ clear, proceed rather than block
161
+ - Consider that the issue author may not be technical - phrase questions accessibly
162
+ - Always tag the issue author (@{issue_author}) in clarification requests
163
+ - This is a HARD STOP - if clarification is needed, the workflow terminates here
164
+ - When `pdd change` is run again, this step will re-evaluate based on new comments