Skip to content

Consolidate prompt template files into unified prompts.go#5684

Merged
pelikhan merged 2 commits into
mainfrom
copilot/consolidate-prompt-template-files
Dec 6, 2025
Merged

Consolidate prompt template files into unified prompts.go#5684
pelikhan merged 2 commits into
mainfrom
copilot/consolidate-prompt-template-files

Conversation

Copilot AI commented Dec 6, 2025

Copy link
Copy Markdown
Contributor

Merged 5 small prompt template files (14-61 lines each) into a single prompts.go for better discoverability and maintainability.

Changes

Consolidated into pkg/workflow/prompts.go:

  • Safe outputs prompt generation (generateSafeOutputsPromptStep)
  • Cache memory prompt generation (generateCacheMemoryPromptStep)
  • Edit tool prompt generation (hasEditTool, generateEditToolPromptStep)
  • Playwright prompt generation (hasPlaywrightTool, generatePlaywrightPromptStep)
  • PR context prompt generation (generatePRContextPromptStep, hasCommentRelatedTriggers)

Organized by feature area:

// ============================================================================
// Safe Outputs Prompts
// ============================================================================

// ============================================================================
// Cache Memory Prompts
// ============================================================================

// ============================================================================
// Tool Prompts - Edit Tool
// ============================================================================

Test consolidation:

  • Merged all 5 individual test files into prompts_test.go
  • Preserved all test coverage with identical test logic

Impact

  • Net -8 files (10 deleted, 2 added)
  • All prompt-related functions now in single location
  • No functional changes to prompt generation logic

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login -json GO111MODULE me-repo GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE che/go-build/bd/bda8c36ddea964ffbabcba4fac37dbe1024b8b9bfc7dead6065e89ae76325ddf-d/gh-aw by/28675739f792egh GOMOD GOMODCACHE che/go-build/bd/--json (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login -json d/gh-aw/main.go ps GOINSECURE GOMOD GOMODCACHE ps ns/s�� ns/setup.git GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login mplates from .github to pkg/cli//run/containerd/io.containerd.runtime.v2.task/moby/28675739f792egh GO111MODULE c0ad668813129b8895bfb17f2766151215e/log.json GOINSECURE GOMOD GOMODCACHE go env e=false GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE %H %ct %D GOMODCACHE go (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Consolidate prompt template files into unified prompts.go</issue_title>
<issue_description>## Objective

Merge 5+ small prompt template files into a single prompts.go file for better discoverability and reduced file count.

Problem

Multiple small files in pkg/workflow/ contain single prompt-related functions:

  • safe_outputs_prompt.go (14 lines, 1 function)
  • cache_memory_prompt.go (19 lines, 1 function)
  • edit_tool_prompt.go (22 lines, 2 functions)
  • playwright_prompt.go (22 lines, 2 functions)
  • pr_prompt.go (61 lines, 2 functions)

Approach

  1. Create new file: pkg/workflow/prompts.go
  2. Move all prompt-related functions from individual files into the new file
  3. Organize functions logically within the new file (group by feature/purpose)
  4. Add file-level documentation explaining the purpose
  5. Update any imports if function visibility changes
  6. Delete the old individual prompt files
  7. Run tests to verify no breakage

Files to Create/Modify

  • Create: pkg/workflow/prompts.go
  • Delete: pkg/workflow/safe_outputs_prompt.go
  • Delete: pkg/workflow/cache_memory_prompt.go
  • Delete: pkg/workflow/edit_tool_prompt.go
  • Delete: pkg/workflow/playwright_prompt.go
  • Delete: pkg/workflow/pr_prompt.go

Organization

Group functions in the new file by category:

  1. Safe outputs prompts
  2. Cache memory prompts
  3. Tool prompts (edit, playwright)
  4. PR prompts

Add comments to separate sections for clarity.

Acceptance Criteria

  • New pkg/workflow/prompts.go file created
  • All prompt functions consolidated into new file
  • Old individual prompt files deleted
  • Functions logically organized with comments
  • All tests pass (make test)
  • No import errors or broken references
  • File count reduced by 5 files

Estimated Effort

2-3 hours
Related to #5677

AI generated by Plan Command for #5506

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Consolidate prompt template files into unified prompts.go Consolidate prompt template files into unified prompts.go Dec 6, 2025
Copilot AI requested a review from mnkiefer December 6, 2025 19:27
@pelikhan pelikhan marked this pull request as ready for review December 6, 2025 19:34
@pelikhan pelikhan merged commit 0c0f11f into main Dec 6, 2025
5 checks passed
@pelikhan pelikhan deleted the copilot/consolidate-prompt-template-files branch December 6, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Consolidate prompt template files into unified prompts.go

3 participants