Skip to content

Remove prompt file management functions from init/upgrade/fix commands#14150

Merged
pelikhan merged 4 commits intomainfrom
copilot/remove-github-agentic-workflows-file
Feb 6, 2026
Merged

Remove prompt file management functions from init/upgrade/fix commands#14150
pelikhan merged 4 commits intomainfrom
copilot/remove-github-agentic-workflows-file

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

The prompt files (including github-agentic-workflows.md) should exist only in the gh-aw repository itself, not be managed by CLI commands. Agents resolve them from GitHub directly.

Changes

  • Removed file management logic: Completely removed ensureCopilotInstructions(), ensureCreateWorkflowPrompt(), ensureUpdateWorkflowPrompt(), ensureCreateSharedAgenticWorkflowPrompt(), ensureDebugWorkflowPrompt(), ensureUpgradeAgenticWorkflowsPrompt(), ensureSerenaTool(), and ensurePromptFileExists() functions from copilot-agents.go
  • Removed all function calls: Stripped calls to these functions from init.go, upgrade_command.go, and fix_command.go
  • Updated command documentation: Changed "Creates GitHub Copilot custom instructions" → "Verifies workflow prompt files exist"
  • Removed test files: Deleted copilot_instructions_test.go, agentic_workflow_agent_test.go, and upgrade_agentic_workflow_agent_test.go for removed functions
  • Kept essential functions: Preserved ensureAgenticWorkflowsDispatcher() (creates dispatcher agent), deleteSetupAgenticWorkflowsAgent(), deleteOldTemplateFiles(), deleteOldAgentFiles(), and cleanupOldPromptFile() for cleanup operations

Behavior

Before: Init command attempted to check for multiple prompt files and logged misleading "Writing/Created" messages for files that weren't actually created

After: Init command only creates dispatcher agent at .github/agents/agentic-workflows.agent.md and runs cleanup functions

Impact

  • Reduced copilot-agents.go from 348 to 224 lines (35% reduction)
  • Cleaner command output with no misleading messages
  • Code changes: 7 files changed, 10 insertions(+), 764 deletions(-)

The prompt files remain in the gh-aw repository at .github/aw/ and the compiler continues to reference the GitHub URL.

Original prompt

The init command should not write the .github/aw/github-agentic-workflows.md file . The agent should resolve from github itself.

Remove from compiler and keep the copy in .github/aw folder.


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

…x commands

- Remove ensureCopilotInstructions calls from init.go, upgrade_command.go, and fix_command.go
- Update documentation in init_command.go and upgrade_command.go
- Update ensureCopilotInstructions documentation to clarify it only checks file existence
- Remove test code that tried to create agent files

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…command

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove .github/aw/github-agentic-workflows.md from init command Remove github-agentic-workflows.md creation from init/upgrade/fix commands Feb 6, 2026
Copilot AI requested a review from pelikhan February 6, 2026 14:27
@pelikhan
Copy link
Contributor

pelikhan commented Feb 6, 2026

@copilot remove embedded resource from go code in pkg/cli, remove copy from pkg/cli/...

Per feedback, removed all ensure* functions that only checked for prompt file existence:
- Removed ensureCopilotInstructions and related cleanup functions
- Removed ensureCreateWorkflowPrompt, ensureUpdateWorkflowPrompt, etc.
- Removed ensurePromptFileExists helper function
- Removed test files for deleted functions
- Kept only essential functions: ensureAgenticWorkflowsDispatcher, deleteSetupAgenticWorkflowsAgent, deleteOldTemplateFiles, deleteOldAgentFiles, cleanupOldPromptFile

The init/upgrade/fix commands now only create the dispatcher agent and run cleanup functions.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 6, 2026

@copilot remove embedded resource from go code in pkg/cli, remove copy from pkg/cli/...

Removed all unused prompt file check functions from pkg/cli (commit e299d95):

  • Deleted ensureCopilotInstructions(), ensureCreateWorkflowPrompt(), ensureUpdateWorkflowPrompt(), ensureCreateSharedAgenticWorkflowPrompt(), ensureDebugWorkflowPrompt(), ensureUpgradeAgenticWorkflowsPrompt(), ensureSerenaTool(), and ensurePromptFileExists() helper
  • Removed all calls to these functions from init.go, upgrade_command.go, and fix_command.go
  • Removed associated test files (3 files deleted)
  • Kept only essential functions: dispatcher agent download/creation and cleanup functions

The copilot-agents.go file reduced from 348 to 224 lines. Init command output is now cleaner with no misleading "Writing/Created" messages for files that aren't actually created.

Copilot AI changed the title Remove github-agentic-workflows.md creation from init/upgrade/fix commands Remove prompt file management functions from init/upgrade/fix commands Feb 6, 2026
@pelikhan pelikhan marked this pull request as ready for review February 6, 2026 14:42
Copilot AI review requested due to automatic review settings February 6, 2026 14:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes CLI-side management of workflow prompt files so prompt content remains source-controlled in the gh-aw repo and agents resolve prompts directly from GitHub, while keeping only the dispatcher agent creation and cleanup behaviors in CLI commands.

Changes:

  • Removed prompt/instructions management helpers and their invocations from init, upgrade, and fix.
  • Deleted tests that covered the removed prompt/instructions helper functions.
  • Updated CLI help text and docs to reflect the new direction (though some help text still overstates verification/updating of prompts).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/cli/init.go Removes writing/updating of prompt/instructions files during init; keeps dispatcher agent creation and cleanup.
pkg/cli/init_command.go Updates init command help text (currently claims prompt verification).
pkg/cli/upgrade_command.go Removes prompt/instructions update steps from upgrade; retains dispatcher update + setup steps upgrade (help text still references prompts).
pkg/cli/upgrade_command_test.go Removes test setup that invoked removed instructions helper.
pkg/cli/fix_command.go Removes prompt/instructions update steps from fix; retains dispatcher update + cleanup codemods (log text still mentions prompts).
pkg/cli/copilot-agents.go Deletes prompt/instructions ensure/check functions; keeps dispatcher ensure + cleanup helpers.
pkg/cli/copilot_instructions_test.go (deleted) Removes tests for removed Copilot instructions helper.
pkg/cli/agentic_workflow_agent_test.go (deleted) Removes tests for removed prompt-file helpers.
pkg/cli/upgrade_agentic_workflow_agent_test.go (deleted) Removes tests for removed upgrade prompt helper.
docs/src/content/docs/agent-factory-status.mdx Adds the Daily MCP Tool Concurrency Analysis workflow to the status table.
Comments suppressed due to low confidence (2)

pkg/cli/upgrade_command.go:264

  • The comment for updateAgentFiles says it "updates all agent and prompt files", but the function now only updates the dispatcher agent (and upgrades copilot-setup-steps). Please update the comment to reflect the narrower scope so future changes don’t assume prompts are handled here.
// updateAgentFiles updates all agent and prompt files to the latest templates
func updateAgentFiles(verbose bool) error {
	// Update dispatcher agent
	if err := ensureAgenticWorkflowsDispatcher(verbose, false); err != nil {
		upgradeLog.Printf("Failed to update dispatcher agent: %v", err)
		return fmt.Errorf("failed to update dispatcher agent: %w", err)
	}

pkg/cli/copilot-agents.go:22

  • ensureAgenticWorkflowsDispatcher still accepts a skipInstructions flag, but all current call sites pass false and the rest of the prompt/instructions management helpers were removed. If this flag is no longer part of any user-facing behavior, consider removing it (and the early return) to simplify the API and reduce confusion about what "instructions" means here.
// ensureAgenticWorkflowsDispatcher ensures that .github/agents/agentic-workflows.agent.md contains the dispatcher agent
func ensureAgenticWorkflowsDispatcher(verbose bool, skipInstructions bool) error {
	copilotAgentsLog.Print("Ensuring agentic workflows dispatcher agent")

	if skipInstructions {
		copilotAgentsLog.Print("Skipping agent creation: instructions disabled")
		return nil
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 37 to 46
This command:
1. Updates all agent and prompt files to the latest templates (like 'init' command)
2. Applies automatic codemods to fix deprecated fields in all workflows (like 'fix --write')
3. Updates GitHub Actions versions in .github/aw/actions-lock.json (unless --no-actions is set)
4. Compiles all workflows to generate lock files (like 'compile' command)

The upgrade process ensures:
- GitHub Copilot instructions are up-to-date (.github/aw/github-agentic-workflows.md)
- Dispatcher agent is current (.github/agents/agentic-workflows.agent.md)
- All workflow prompts are updated (create, update, debug, upgrade)
- All workflow prompts exist in .github/aw/ (create, update, debug, upgrade)
- All workflows use the latest syntax and configuration options
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upgrade command help text claims it updates "agent and prompt files" and that the upgrade process ensures workflow prompts exist in .github/aw/, but the upgrade implementation now only updates the dispatcher agent (and copilot-setup-steps). This mismatch can confuse users; adjust the command description/bullets to match the actual behavior (or reintroduce the verification/update logic if it’s still intended).

Copilot uses AI. Check for mistakes.
Comment on lines 186 to 189
// Update prompt and agent files (similar to init command)
// This ensures the latest templates are always used
fixLog.Print("Updating prompt and agent files")

Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log message (and the surrounding comment) still says "Updating prompt and agent files", but the fix command no longer updates prompt files. Consider updating the message to avoid implying prompt management that no longer happens.

See below for a potential fix:

	// Update agent workflow files (similar to init command)
	// This ensures the latest agent templates are always used
	fixLog.Print("Updating agent workflow files")

Copilot uses AI. Check for mistakes.
Comment on lines +32 to 33
- Verifies workflow prompt files exist in .github/aw/ (create-agentic-workflow.md, update-agentic-workflow.md, etc.)
- Removes old prompt files from .github/prompts/ if they exist
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The init command help text says it "Verifies workflow prompt files exist in .github/aw/", but the init implementation no longer checks for these prompt files (it only writes the dispatcher agent and performs cleanup). This is misleading for users; either add an explicit verification step (if still desired) or update the help text to reflect that prompt files are not managed/verified by the CLI and are resolved from GitHub by agents.

Suggested change
- Verifies workflow prompt files exist in .github/aw/ (create-agentic-workflow.md, update-agentic-workflow.md, etc.)
- Removes old prompt files from .github/prompts/ if they exist
- Relies on agents to resolve workflow prompt content from GitHub (no local .github/aw/ prompt verification)

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan merged commit eb184b6 into main Feb 6, 2026
133 checks passed
@pelikhan pelikhan deleted the copilot/remove-github-agentic-workflows-file branch February 6, 2026 14:48
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.

2 participants