Skip to content

[task] Standardize prompt generation pattern - organize generatePromptStep functions #3540

Description

@github-actions

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 - has edit_tool_prompt.go
  • generateGitHubContextPromptStep - has github_context.go
  • generatePlaywrightPromptStep - has playwright_prompt.go
  • generateTempFolderPromptStep - has temp_folder.go
  • generateXPIAPromptStep - has xpia.go
  • generateCacheMemoryPromptStep - in compiler_yaml.go
  • generateSafeOutputsPromptStep - in compiler_yaml.go
  • generatePRContextPromptStep - in pr.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 - Move generateCacheMemoryPromptStep
  • pkg/workflow/safe_outputs_prompt.go - Move generateSafeOutputsPromptStep
  • pkg/workflow/pr_prompt.go - Move generatePRContextPromptStep

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.go to remove moved functions
  • Update pr.go to remove moved functions
  • Update any files that reference these functions
  • Ensure no circular dependencies

Files to Modify

Create:

  • pkg/workflow/cache_memory_prompt.go
  • pkg/workflow/safe_outputs_prompt.go
  • pkg/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

AI generated by Plan Command for #3435

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions