Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion create.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
20 changes: 8 additions & 12 deletions docs/src/content/docs/guides/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Comment on lines +70 to 74
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

This section says upgrade updates only the dispatcher agent file, but the gh aw upgrade implementation also upgrades .github/workflows/copilot-setup-steps.yml during step 1. Please document that additional file update here so users know what to expect in diffs/commits.

Copilot uses AI. Check for mistakes.
- `.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

Expand All @@ -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
Expand Down Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/setup/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

This description says init "logs .gitignore", which is unclear and appears incorrect (init doesn’t create .github/aw/logs/.gitignore; that’s handled by the logs download command). Please reword to either remove this clause or explicitly reference .github/aw/logs/.gitignore and the command that creates it.

Suggested change
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.
Initialize repository for agentic workflows. Configures `.gitattributes` and creates the dispatcher agent file (`.github/agents/agentic-workflows.agent.md`). Enables MCP server integration by default (use `--no-mcp` to skip). Without arguments, enters interactive mode for engine selection and secret configuration.

Copilot uses AI. Check for mistakes.

```bash wrap
gh aw init # Interactive mode: select engine and configure secrets
Expand Down
7 changes: 2 additions & 5 deletions install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`
Expand Down Expand Up @@ -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 <workflow-name>` os using the agent
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

Typo: "os" should be "or".

Suggested change
- **Create new workflows**: `gh aw new <workflow-name>` os using the agent
- **Create new workflows**: `gh aw new <workflow-name>` or using the agent

Copilot uses AI. Check for mistakes.
- **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

Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/copilot_agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

This comment says the function deletes old workflow-specific .agent.md files from .github/agents/, but the implementation also deletes at least one file from .github/aw/ via the filesToDelete map. Please update the comment to reflect both locations (or remove the .github/aw deletion if it’s no longer intended).

Suggested change
// deleteOldAgentFiles deletes old workflow-specific .agent.md files from .github/agents/
// deleteOldAgentFiles deletes old workflow-specific agent/template files from .github/agents/ and .github/aw/

Copilot uses AI. Check for mistakes.
func deleteOldAgentFiles(verbose bool) error {
gitRoot, err := findGitRoot()
if err != nil {
Expand Down
9 changes: 4 additions & 5 deletions pkg/cli/fix_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Comment on lines 47 to 49
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The delete-old-agents codemod description says it deletes only workflow-specific .agent.md files from .github/agents/, but deleteOldAgentFiles also deletes several non-.agent.md files (e.g. create-agentic-workflow.md, setup-agentic-workflows.md) and even an entry under .github/aw/. Please update this help text to match what the codemod actually removes (or narrow the deletion list).

Copilot uses AI. Check for mistakes.

If no workflows are specified, all Markdown files in .github/workflows will be processed.
Expand All @@ -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)
Comment on lines 57 to +60
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The help text no longer mentions updating the dispatcher agent, but runFixCommand still calls ensureAgenticWorkflowsDispatcher on every invocation. Please either restore a step noting that the dispatcher agent file is updated (even in dry-run), or change the implementation to match the documented behavior.

Copilot uses AI. Check for mistakes.

` + WorkflowIDExplanation + `

Expand Down
3 changes: 1 addition & 2 deletions pkg/cli/init_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 8 additions & 9 deletions pkg/cli/upgrade_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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")
Comment on lines +150 to +152
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

This step/message says only the dispatcher agent file is updated, but updateAgentFiles also runs upgradeCopilotSetupSteps (updating .github/workflows/copilot-setup-steps.yml). Please adjust the user-facing text/logs to reflect all files updated, or split setup-steps into its own step.

This issue also appears on line 301 of the same file.

Copilot uses AI. Check for mistakes.

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)
Expand Down Expand Up @@ -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 {
Expand Down
Loading