Repository navigation
Closed
Description
Objective
Standardize the organization of generate*PromptStep functions by moving scattered prompt generators into dedicated files following the existing pattern.
Context
Multiple generate*PromptStep functions are inconsistently organized. Some have dedicated files, while others are scattered in larger files like compiler_yaml.go and pr.go.
Current distribution:
- ✅
generateEditToolPromptStep- hasedit_tool_prompt.go - ✅
generateGitHubContextPromptStep- hasgithub_context.go - ✅
generatePlaywrightPromptStep- hasplaywright_prompt.go - ✅
generateTempFolderPromptStep- hastemp_folder.go - ✅
generateXPIAPromptStep- hasxpia.go - ❌
generateCacheMemoryPromptStep- incompiler_yaml.go - ❌
generateSafeOutputsPromptStep- incompiler_yaml.go - ❌
generatePRContextPromptStep- inpr.go
Part of issue #3435.
Approach
1. Analyze existing prompt generation patterns
Review the well-organized prompt files to understand the pattern:
- File naming convention:
{feature}_prompt.go - Function structure and dependencies
- Testing approach
2. Create dedicated prompt files
Create:
pkg/workflow/cache_memory_prompt.go- MovegenerateCacheMemoryPromptSteppkg/workflow/safe_outputs_prompt.go- MovegenerateSafeOutputsPromptSteppkg/workflow/pr_prompt.go- MovegeneratePRContextPromptStep
3. Move prompt generation functions
Move each function to its dedicated file with:
- Function implementation
- Any related helper functions
- Appropriate documentation
4. Update imports
- Update
compiler_yaml.goto remove moved functions - Update
pr.goto remove moved functions - Update any files that reference these functions
- Ensure no circular dependencies
Files to Modify
Create:
pkg/workflow/cache_memory_prompt.gopkg/workflow/safe_outputs_prompt.gopkg/workflow/pr_prompt.go
Update:
pkg/workflow/compiler_yaml.go(remove moved functions)pkg/workflow/pr.go(remove moved function)- Update imports in files that use these functions
- Create/update test files as needed
Acceptance Criteria
- All
generate*PromptStepfunctions have dedicated files - Consistent file naming pattern:
{feature}_prompt.go - All imports updated correctly
- No circular dependencies
- All tests pass (
make test-unit) - Code follows existing prompt generation file patterns
- Functions properly documented
- Easy to add new prompt types in the future
Related to [refactor] 🔧 Semantic Function Clustering Analysis - Code Organization Opportunities #3435
AI generated by Plan Command for #3435
Reacted by Copilot
Activity