Conversation
…iles Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Standardize organization of generatePromptStep functions
Standardize prompt generation pattern - move scattered functions to dedicated files
Nov 10, 2025
pelikhan
approved these changes
Nov 10, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the prompt generation code by extracting three function groups from compiler_yaml.go into dedicated files, following the project's code organization guidelines of keeping files focused and under 800 lines. The refactoring improves maintainability by organizing prompt-related functions by their specific domain.
Key changes:
- Extracted safe outputs prompt generation to
safe_outputs_prompt.go - Extracted cache memory prompt generation to
cache_memory_prompt.go - Extracted PR context prompt generation to
pr_prompt.go - Added comprehensive test coverage for all three prompt generation features
- Enhanced documentation for
runs-onandconcurrencyfields
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/safe_outputs_prompt.go | New file containing generateSafeOutputsPromptStep function (moved from compiler_yaml.go) |
| pkg/workflow/safe_outputs_prompt_test.go | New test file with 3 test cases covering safe outputs prompt generation scenarios |
| pkg/workflow/cache_memory_prompt.go | New file containing generateCacheMemoryPromptStep function (moved from compiler_yaml.go) |
| pkg/workflow/cache_memory_prompt_test.go | New test file with 3 test cases covering cache memory prompt generation scenarios |
| pkg/workflow/pr_prompt.go | New file containing generatePRContextPromptStep and hasCommentRelatedTriggers functions (moved from pr.go) |
| pkg/workflow/pr_prompt_test.go | New test file with 4 test cases covering PR context prompt generation scenarios |
| pkg/workflow/pr.go | Removed two functions that were moved to pr_prompt.go |
| pkg/workflow/compiler_yaml.go | Removed two functions that were moved to their respective domain files |
| docs/src/content/docs/reference/frontmatter-full.md | Enhanced documentation with clearer descriptions and context for runs-on and concurrency fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Three
generate*PromptStepfunctions were scattered incompiler_yaml.goandpr.gowhile five others already had dedicated files. This PR completes the standardization by moving all prompt generation functions to the{feature}_prompt.gopattern.Changes
Moved Functions to Dedicated Files:
generateCacheMemoryPromptStep→cache_memory_prompt.gogenerateSafeOutputsPromptStep→safe_outputs_prompt.gogeneratePRContextPromptStep+ helper →pr_prompt.goPattern:
All 8 prompt generation functions now follow consistent file organization. Helper functions like
generateCacheMemoryPromptSectionremain in their domain files (cache.go,safe_outputs.go).Test Coverage: Added 10 test cases covering enabled/disabled states and edge cases for each moved function.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.