From 8e6f0a8540c6bdfe2b006f9873aa1f548a3ed920 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 21:21:34 +0000 Subject: [PATCH 1/2] Initial plan From 1e4799bb45d47da09a61a547df632de8be791d95 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 21:38:08 +0000 Subject: [PATCH 2/2] docs: update docs/help text - init/upgrade/fix no longer create .github/aw prompt files Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- create.md | 1 - docs/src/content/docs/guides/upgrading.md | 20 ++++++++------------ docs/src/content/docs/setup/cli.md | 2 +- install.md | 7 ++----- pkg/cli/copilot_agents.go | 2 +- pkg/cli/fix_command.go | 9 ++++----- pkg/cli/init_command.go | 3 +-- pkg/cli/upgrade_command.go | 17 ++++++++--------- 8 files changed, 25 insertions(+), 36 deletions(-) diff --git a/create.md b/create.md index 1f7d83066bb..2f0d5d7a5d7 100644 --- a/create.md +++ b/create.md @@ -130,7 +130,6 @@ If creating a workflow, check the .gitattributes file and make sure it exists an You do not need to run `gh aw init` as part of your workflow creation. However if you did run this you may also see: -- `.github/aw/github-agentic-workflows.md` - `.github/agents/agentic-workflows.agent.md` - `.vscode/settings.json` - `.vscode/mcp.json` diff --git a/docs/src/content/docs/guides/upgrading.md b/docs/src/content/docs/guides/upgrading.md index 70e2ac86340..a472cf45045 100644 --- a/docs/src/content/docs/guides/upgrading.md +++ b/docs/src/content/docs/guides/upgrading.md @@ -16,7 +16,7 @@ This guide walks you through upgrading your agentic workflows to the latest vers The upgrade process updates three key areas: -1. **Agent and prompt files** - GitHub Copilot instructions, dispatcher agent, and workflow creation prompts +1. **Dispatcher agent file** - Updates `.github/agents/agentic-workflows.agent.md` to the latest template 2. **Workflow syntax** - Automatically migrates deprecated fields and applies the latest configuration patterns 3. **Workflow compilation** - Automatically compiles all workflows to generate up-to-date `.lock.yml` files @@ -67,17 +67,13 @@ gh aw upgrade This command performs three main operations: -### 3.1 Updates Agent and Prompt Files +### 3.1 Updates Dispatcher Agent File -The upgrade updates these files to the latest templates (similar to running `gh aw init`): +The upgrade updates the dispatcher agent file to the latest template (similar to running `gh aw init`): -- `.github/aw/github-agentic-workflows.md` - GitHub Copilot custom instructions - `.github/agents/agentic-workflows.agent.md` - Dispatcher agent for routing tasks -- `.github/aw/create-agentic-workflow.md` - Prompt for creating new workflows -- `.github/aw/update-agentic-workflow.md` - Prompt for updating existing workflows -- `.github/aw/create-shared-agentic-workflow.md` - Prompt for shared workflows -- `.github/aw/debug-agentic-workflow.md` - Prompt for debugging workflows -- `.github/aw/upgrade-agentic-workflows.md` - Prompt for upgrade guidance + +Workflow prompt files (`.github/aw/*.md`) are no longer managed by the CLI. They live in the gh-aw repository and are resolved directly from GitHub by the agent. ### 3.2 Applies Codemods to All Workflows @@ -99,8 +95,8 @@ The upgrade automatically compiles all workflows to generate or update `.lock.ym **Example output:** ```text -Updating agent and prompt files... -✓ Updated agent and prompt files +Updating agent file... +✓ Updated agent file Applying codemods to all workflows... Processing workflow: daily-team-status ✓ Applied schedule-at-to-around-migration @@ -165,7 +161,7 @@ Test workflows locally with `gh aw status` and `gh aw compile my-workflow --vali Stage and commit your changes: ```bash wrap -git add .github/workflows/ .github/aw/ .github/agents/ +git add .github/workflows/ .github/agents/ git commit -m "Upgrade agentic workflows to latest version" git push origin main ``` diff --git a/docs/src/content/docs/setup/cli.md b/docs/src/content/docs/setup/cli.md index 8d27e9772e5..6db6d778d7e 100644 --- a/docs/src/content/docs/setup/cli.md +++ b/docs/src/content/docs/setup/cli.md @@ -117,7 +117,7 @@ Commands are organized by workflow lifecycle: creating, building, testing, monit #### `init` -Initialize repository for agentic workflows. Configures `.gitattributes`, Copilot instructions, prompt files, and logs `.gitignore`. Enables MCP server integration by default (use `--no-mcp` to skip). Without arguments, enters interactive mode for engine selection and secret configuration. +Initialize repository for agentic workflows. Configures `.gitattributes`, creates the dispatcher agent file (`.github/agents/agentic-workflows.agent.md`), and logs `.gitignore`. Enables MCP server integration by default (use `--no-mcp` to skip). Without arguments, enters interactive mode for engine selection and secret configuration. ```bash wrap gh aw init # Interactive mode: select engine and configure secrets diff --git a/install.md b/install.md index e561e792294..59258daa3f0 100644 --- a/install.md +++ b/install.md @@ -43,9 +43,7 @@ gh aw init **What this does**: - Configures `.gitattributes` to mark `.lock.yml` files as generated -- Creates `.github/aw/github-agentic-workflows.md` with comprehensive documentation -- Creates `.github/agents/agentic-workflows.agent.md` as an AI assistant for workflows -- Creates workflow management prompts in `.github/aw/` directory +- Creates `.github/agents/agentic-workflows.agent.md` as the dispatcher agent for AI workflows - Configures VSCode settings in `.vscode/settings.json` - Creates GH-AW MCP server configuration in `.vscode/mcp.json` - Creates `.github/workflows/copilot-setup-steps.yml` with setup instructions @@ -63,7 +61,6 @@ git status You should see new/modified files including: - `.gitattributes` -- `.github/aw/github-agentic-workflows.md` - `.github/agents/agentic-workflows.agent.md` - `.vscode/settings.json` - `.vscode/mcp.json` @@ -105,7 +102,7 @@ After successful initialization, the user can: - **Add workflows from repos**: `gh aw add githubnext/agentics` - **Create new workflows**: `gh aw new ` os using the agent - **Use the AI agent**: Type `/agent` in GitHub Copilot Chat and select `agentic-workflows` -- **Read documentation**: View `.github/aw/github-agentic-workflows.md` +- **Read documentation**: Visit `https://github.github.com/gh-aw/` ## Reference diff --git a/pkg/cli/copilot_agents.go b/pkg/cli/copilot_agents.go index f3943d3e440..1216c096a05 100644 --- a/pkg/cli/copilot_agents.go +++ b/pkg/cli/copilot_agents.go @@ -182,7 +182,7 @@ func deleteOldTemplateFiles(verbose bool) error { return nil } -// deleteOldAgentFiles deletes old .agent.md files that have been moved to .github/aw/ +// deleteOldAgentFiles deletes old workflow-specific .agent.md files from .github/agents/ func deleteOldAgentFiles(verbose bool) error { gitRoot, err := findGitRoot() if err != nil { diff --git a/pkg/cli/fix_command.go b/pkg/cli/fix_command.go index 966b15a0cac..cda745fe905 100644 --- a/pkg/cli/fix_command.go +++ b/pkg/cli/fix_command.go @@ -45,7 +45,7 @@ Available codemods: • safe-inputs-mode-removal: Removes deprecated 'safe-inputs.mode' field • schedule-at-to-around-migration: Converts 'daily at TIME' to 'daily around TIME' • delete-schema-file: Deletes deprecated .github/aw/schemas/agentic-workflow.json - • delete-old-agents: Deletes old .agent.md files moved to .github/aw/ + • delete-old-agents: Deletes old workflow-specific .agent.md files from .github/agents/ • delete-old-templates: Removes old template files from pkg/cli/templates/ If no workflows are specified, all Markdown files in .github/workflows will be processed. @@ -55,10 +55,9 @@ The command will: 2. Apply relevant codemods to fix issues 3. Report what was changed in each file 4. Write updated files back to disk (with --write flag) - 5. Update prompt and agent files to latest templates (similar to 'init' command) - 6. Delete deprecated .github/aw/schemas/agentic-workflow.json file if it exists - 7. Delete old template files from pkg/cli/templates/ (with --write flag) - 8. Delete old .agent.md files that have been moved to .github/aw/ (with --write flag) + 5. Delete deprecated .github/aw/schemas/agentic-workflow.json file if it exists + 6. Delete old template files from pkg/cli/templates/ (with --write flag) + 7. Delete old workflow-specific .agent.md files from .github/agents/ (with --write flag) ` + WorkflowIDExplanation + ` diff --git a/pkg/cli/init_command.go b/pkg/cli/init_command.go index 3b4f258e8f8..905fb326ed3 100644 --- a/pkg/cli/init_command.go +++ b/pkg/cli/init_command.go @@ -15,7 +15,7 @@ func NewInitCommand() *cobra.Command { cmd := &cobra.Command{ Use: "init", Short: "Initialize repository for agentic workflows", - Long: `Initialize the repository for agentic workflows by configuring .gitattributes and creating GitHub Copilot instruction files. + Long: `Initialize the repository for agentic workflows by configuring .gitattributes and creating the dispatcher agent file. Interactive Mode (default): gh aw init @@ -29,7 +29,6 @@ Interactive Mode (default): This command: - Configures .gitattributes to mark .lock.yml files as generated - Creates the dispatcher agent at .github/agents/agentic-workflows.agent.md -- 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 - Configures VSCode settings (.vscode/settings.json) - Generates/updates .github/workflows/agentics-maintenance.yml if any workflows use expires field for discussions or issues diff --git a/pkg/cli/upgrade_command.go b/pkg/cli/upgrade_command.go index 07f41a38ac3..41d15bf7631 100644 --- a/pkg/cli/upgrade_command.go +++ b/pkg/cli/upgrade_command.go @@ -40,7 +40,7 @@ func NewUpgradeCommand() *cobra.Command { Long: `Upgrade the repository for the latest version of agentic workflows. This command: - 1. Updates all agent and prompt files to the latest templates (like 'init' command) + 1. Updates the dispatcher agent file to the latest template (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) @@ -56,7 +56,6 @@ The --audit flag skips the normal upgrade process. The upgrade process ensures: - Dispatcher agent is current (.github/agents/agentic-workflows.agent.md) -- All workflow prompts exist in .github/aw/ (create, update, debug, upgrade) - All workflows use the latest syntax and configuration options - Deprecated fields are automatically migrated across all workflows - GitHub Actions are pinned to the latest versions @@ -148,17 +147,17 @@ func runUpgradeCommand(verbose bool, workflowDir string, noFix bool, noCompile b return err } - // Step 1: Update all agent and prompt files (like init command) - fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Updating agent and prompt files...")) - upgradeLog.Print("Updating agent and prompt files") + // Step 1: Update dispatcher agent file (like init command) + fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Updating agent file...")) + upgradeLog.Print("Updating agent file") if err := updateAgentFiles(verbose); err != nil { - upgradeLog.Printf("Failed to update agent files: %v", err) - return fmt.Errorf("failed to update agent files: %w", err) + upgradeLog.Printf("Failed to update agent file: %v", err) + return fmt.Errorf("failed to update agent file: %w", err) } if verbose { - fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("✓ Updated agent and prompt files")) + fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("✓ Updated agent file")) } // Step 2: Apply codemods to all workflows (unless --no-fix is specified) @@ -299,7 +298,7 @@ func runUpgradeCommand(verbose bool, workflowDir string, noFix bool, noCompile b return nil } -// updateAgentFiles updates all agent and prompt files to the latest templates +// updateAgentFiles updates the dispatcher agent file to the latest template func updateAgentFiles(verbose bool) error { // Update dispatcher agent if err := ensureAgenticWorkflowsDispatcher(verbose, false); err != nil {