Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

Adds a custom agent that provides direct instructions for upgrading workflows to the latest gh-aw version, handling breaking changes, compilation errors, and automated output generation. The agent supports both CLI and GitHub Copilot Cloud environments.

Changes

  • New agent template (pkg/cli/templates/upgrade-agentic-workflows.md)

    • Provides direct instructions for automated workflow upgrades (non-conversational)
    • Fetches and reviews gh-aw changelog for breaking changes
    • Applies automatic codemods with the fix tool to fix deprecated fields
    • Recompiles workflows and handles error fixing
    • Creates PRs on success or issues on failure with diagnostic context
    • Migrated from maintainer.md workflow in githubnext/agentics
    • Supports GitHub Copilot Cloud with MCP tool references for environments without CLI access
    • Simplified workflow using only fix and compile commands (no status or validation flags)
  • Integration into init command

    • Agent created by default when running gh aw init
    • Added ensureUpgradeAgenticWorkflowAgent() function
    • Updated help text to document the new agent
  • Test coverage

    • Validates agent creation, updates, and skipInstructions flag
    • Follows existing test patterns from other agents

Usage

gh aw init  # Creates .github/agents/upgrade-agentic-workflows.md

Then in GitHub Copilot Chat:

/agent upgrade-agentic-workflows

The agent provides direct instructions for changelog review, automatic codemod fixes, recompilation, and error resolution. It can be executed automatically without user interaction.

Environment Support

  • GitHub Copilot Cloud: Uses the agentic-workflows MCP tool for commands (fix, compile)
  • CLI Environments: Uses gh aw commands directly (gh aw fix, gh aw compile)

The agent automatically adapts its instructions based on the execution environment, ensuring it works seamlessly in both contexts. The workflow is streamlined to use only essential commands without optional features like status checks or validation flags.

Files Modified

  • pkg/cli/commands.go - Added embedded template
  • pkg/cli/copilot-agents.go - Added ensure function
  • pkg/cli/init.go - Integrated into init flow
  • pkg/cli/init_command.go - Updated documentation
  • pkg/cli/compile_campaign.go - Fixed unrelated staticcheck warning
Original prompt

Add a custom agent "upgrade-agentic-workflow.agent.md" that helps upgrade agentic workflows. The agent should be written by the "init" command

Migrate content from https://github.com/githubnext/agentics/blob/main/.github/workflows/maintainer.md?plain=1


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

@pelikhan
Copy link
Contributor

pelikhan commented Jan 5, 2026

@copilot update with latest version of maintainer.md

Copilot AI changed the title [WIP] Add custom agent to upgrade agentic workflows Add upgrade-agentic-workflow custom agent to init command Jan 5, 2026
Copilot AI requested a review from pelikhan January 5, 2026 21:18
Copy link
Contributor Author

Copilot AI commented Jan 5, 2026

@copilot update with latest version of maintainer.md

Updated the upgrade agent template with the latest version of maintainer.md. Added the automatic codemods step using gh aw fix --write to apply fixes for deprecated fields before recompiling workflows. Changes in commit 31d6fae.

@pelikhan
Copy link
Contributor

pelikhan commented Jan 5, 2026

@copilot when the custom agent runs in github copilot cloud, it does not have access "gh aw" but it has access to the github-agentic-workflows mcp server. In general, refer to command like "fix" , "compile" and explain that it might have to use the mcp tools

Copy link
Contributor Author

Copilot AI commented Jan 5, 2026

@copilot when the custom agent runs in github copilot cloud, it does not have access "gh aw" but it has access to the github-agentic-workflows mcp server. In general, refer to command like "fix" , "co...

Updated the agent to support GitHub Copilot Cloud environments. Commands are now referenced generically (version, fix, compile, status) with a note explaining that in Copilot Cloud, the agentic-workflows MCP tool should be used instead of gh aw CLI commands. Added clear documentation for both execution contexts. Changes in commit 171577b.

@pelikhan
Copy link
Contributor

pelikhan commented Jan 5, 2026

@copilot there is no "version" tool in the mcp so just ignore that

Copy link
Contributor Author

Copilot AI commented Jan 5, 2026

@copilot there is no "version" tool in the mcp so just ignore that

Removed all references to the version tool from the MCP tool list. Version checking is now documented as a CLI-only feature (using gh aw version) and is optional in the upgrade flow. Changes in commit 174b52a.

@pelikhan
Copy link
Contributor

pelikhan commented Jan 5, 2026

@copilot this is not meant as conversation with user

Copy link
Contributor Author

Copilot AI commented Jan 5, 2026

@copilot this is not meant as conversation with user

Removed all conversational elements. The agent now provides direct instructions for automated execution, matching the maintainer.md workflow style. Removed "Starting the Conversation" section, "Writing Style" guidance, example interactions, and user-facing prompts. Changes in commit c56c9a0.

Copilot AI changed the title Add upgrade-agentic-workflow custom agent to init command Add upgrade-agentic-workflows custom agent to init command Jan 5, 2026
Copilot AI requested a review from pelikhan January 5, 2026 23:37
Copilot AI requested a review from pelikhan January 5, 2026 23:58
@pelikhan pelikhan marked this pull request as ready for review January 6, 2026 00:02
@pelikhan pelikhan merged commit 1efc99e into main Jan 6, 2026
130 checks passed
@pelikhan pelikhan deleted the copilot/add-custom-upgrade-agent branch January 6, 2026 00:02
@github-actions github-actions bot mentioned this pull request Jan 6, 2026
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