diff --git a/.github/agents/agentic-workflows.agent.md b/.github/agents/agentic-workflows.agent.md index a6fe05babb..32772dbe58 100644 --- a/.github/agents/agentic-workflows.agent.md +++ b/.github/agents/agentic-workflows.agent.md @@ -44,7 +44,7 @@ When you interact with this agent, it will: ### Create New Workflow **Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet -**Prompt file**: `.github/aw/create.md` +**Prompt file**: `.github/aw/create-agentic-workflow.md` **Use cases**: - "Create a workflow that triages issues" @@ -54,7 +54,7 @@ When you interact with this agent, it will: ### Update Existing Workflow **Load when**: User wants to modify, improve, or refactor an existing workflow -**Prompt file**: `.github/aw/update.md` +**Prompt file**: `.github/aw/update-agentic-workflow.md` **Use cases**: - "Add web-fetch tool to the issue-classifier workflow" @@ -64,7 +64,7 @@ When you interact with this agent, it will: ### Debug Workflow **Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors -**Prompt file**: `.github/aw/debug.md` +**Prompt file**: `.github/aw/debug-agentic-workflow.md` **Use cases**: - "Why is this workflow failing?" diff --git a/.github/aw/create.md b/.github/aw/create-agentic-workflow.md similarity index 100% rename from .github/aw/create.md rename to .github/aw/create-agentic-workflow.md diff --git a/.github/aw/debug.md b/.github/aw/debug-agentic-workflow.md similarity index 100% rename from .github/aw/debug.md rename to .github/aw/debug-agentic-workflow.md diff --git a/.github/aw/update.md b/.github/aw/update-agentic-workflow.md similarity index 100% rename from .github/aw/update.md rename to .github/aw/update-agentic-workflow.md diff --git a/Makefile b/Makefile index 4374316b23..9646219d73 100644 --- a/Makefile +++ b/Makefile @@ -533,10 +533,10 @@ sync-templates: @echo "Syncing templates from .github to pkg/cli/templates..." @mkdir -p pkg/cli/templates @cp .github/aw/github-agentic-workflows.md pkg/cli/templates/ - @cp .github/aw/create.md pkg/cli/templates/ - @cp .github/aw/update.md pkg/cli/templates/ + @cp .github/aw/create-agentic-workflow.md pkg/cli/templates/ + @cp .github/aw/update-agentic-workflow.md pkg/cli/templates/ @cp .github/aw/create-shared-agentic-workflow.md pkg/cli/templates/ - @cp .github/aw/debug.md pkg/cli/templates/ + @cp .github/aw/debug-agentic-workflow.md pkg/cli/templates/ @cp .github/aw/upgrade-agentic-workflows.md pkg/cli/templates/ @cp .github/agents/agentic-workflows.agent.md pkg/cli/templates/ @cp .github/agents/agentic-campaigns.agent.md pkg/cli/templates/ diff --git a/pkg/cli/agentic_workflow_agent_test.go b/pkg/cli/agentic_workflow_agent_test.go index 6388f3bc0d..f770452868 100644 --- a/pkg/cli/agentic_workflow_agent_test.go +++ b/pkg/cli/agentic_workflow_agent_test.go @@ -54,7 +54,7 @@ func TestEnsureCreateWorkflowPrompt(t *testing.T) { } awDir := filepath.Join(tempDir, ".github", "aw") - promptPath := filepath.Join(awDir, "create.md") + promptPath := filepath.Join(awDir, "create-agentic-workflow.md") // Create initial content if specified if tt.existingContent != "" { @@ -122,7 +122,7 @@ func TestEnsureCreateWorkflowPrompt_WithSkipInstructionsTrue(t *testing.T) { // Check that file was NOT created awDir := filepath.Join(tempDir, ".github", "aw") - promptPath := filepath.Join(awDir, "create.md") + promptPath := filepath.Join(awDir, "create-agentic-workflow.md") if _, err := os.Stat(promptPath); !os.IsNotExist(err) { t.Fatalf("Expected prompt file to NOT exist when skipInstructions=true") } @@ -155,7 +155,7 @@ func TestEnsureCreateWorkflowPrompt_CreatesNewFile(t *testing.T) { // Check that new prompt file was created in .github/aw/ awDir := filepath.Join(tempDir, ".github", "aw") - newPromptPath := filepath.Join(awDir, "create.md") + newPromptPath := filepath.Join(awDir, "create-agentic-workflow.md") if _, err := os.Stat(newPromptPath); os.IsNotExist(err) { t.Fatalf("Expected new prompt file to be created in .github/aw/") } diff --git a/pkg/cli/commands.go b/pkg/cli/commands.go index 899d6bd577..9dbfcb9496 100644 --- a/pkg/cli/commands.go +++ b/pkg/cli/commands.go @@ -30,16 +30,16 @@ var agenticWorkflowsDispatcherTemplate string //go:embed templates/agentic-campaigns.agent.md var agenticCampaignsDispatcherTemplate string -//go:embed templates/create.md +//go:embed templates/create-agentic-workflow.md var createWorkflowPromptTemplate string -//go:embed templates/update.md +//go:embed templates/update-agentic-workflow.md var updateWorkflowPromptTemplate string //go:embed templates/create-shared-agentic-workflow.md var createSharedAgenticWorkflowPromptTemplate string -//go:embed templates/debug.md +//go:embed templates/debug-agentic-workflow.md var debugWorkflowPromptTemplate string //go:embed templates/upgrade-agentic-workflows.md diff --git a/pkg/cli/copilot-agents.go b/pkg/cli/copilot-agents.go index b9e5977a46..c1a316418d 100644 --- a/pkg/cli/copilot-agents.go +++ b/pkg/cli/copilot-agents.go @@ -107,28 +107,6 @@ func cleanupOldPromptFile(promptFileName string, verbose bool) error { return nil } -// cleanupLegacyCreateAgenticWorkflowPrompt removes the legacy create-agentic-workflow.md file from .github/aw/ if it exists -func cleanupLegacyCreateAgenticWorkflowPrompt(verbose bool) error { - gitRoot, err := findGitRoot() - if err != nil { - return nil // Not in a git repository, skip - } - - legacyPath := filepath.Join(gitRoot, ".github", "aw", "create-agentic-workflow.md") - - // Check if the legacy file exists and remove it - if _, err := os.Stat(legacyPath); err == nil { - if err := os.Remove(legacyPath); err != nil { - return fmt.Errorf("failed to remove legacy create-agentic-workflow.md: %w", err) - } - if verbose { - fmt.Fprintf(os.Stderr, "Removed legacy prompt file: %s\n", legacyPath) - } - } - - return nil -} - // ensureCopilotInstructions ensures that .github/aw/github-agentic-workflows.md contains the copilot instructions func ensureCopilotInstructions(verbose bool, skipInstructions bool) error { // First, clean up the old file location if it exists @@ -173,11 +151,11 @@ func ensureAgenticWorkflowsDispatcher(verbose bool, skipInstructions bool) error return ensureAgentFromTemplate("agentic-workflows.agent.md", agenticWorkflowsDispatcherTemplate, verbose, skipInstructions) } -// ensureCreateWorkflowPrompt ensures that .github/aw/create.md contains the new workflow creation prompt +// ensureCreateWorkflowPrompt ensures that .github/aw/create-agentic-workflow.md contains the new workflow creation prompt func ensureCreateWorkflowPrompt(verbose bool, skipInstructions bool) error { return ensureFileMatchesTemplate( filepath.Join(".github", "aw"), - "create.md", + "create-agentic-workflow.md", createWorkflowPromptTemplate, "create workflow prompt", verbose, @@ -185,11 +163,11 @@ func ensureCreateWorkflowPrompt(verbose bool, skipInstructions bool) error { ) } -// ensureUpdateWorkflowPrompt ensures that .github/aw/update.md contains the workflow update prompt +// ensureUpdateWorkflowPrompt ensures that .github/aw/update-agentic-workflow.md contains the workflow update prompt func ensureUpdateWorkflowPrompt(verbose bool, skipInstructions bool) error { return ensureFileMatchesTemplate( filepath.Join(".github", "aw"), - "update.md", + "update-agentic-workflow.md", updateWorkflowPromptTemplate, "update workflow prompt", verbose, @@ -209,11 +187,11 @@ func ensureCreateSharedAgenticWorkflowPrompt(verbose bool, skipInstructions bool ) } -// ensureDebugWorkflowPrompt ensures that .github/aw/debug.md contains the debug workflow prompt +// ensureDebugWorkflowPrompt ensures that .github/aw/debug-agentic-workflow.md contains the debug workflow prompt func ensureDebugWorkflowPrompt(verbose bool, skipInstructions bool) error { return ensureFileMatchesTemplate( filepath.Join(".github", "aw"), - "debug.md", + "debug-agentic-workflow.md", debugWorkflowPromptTemplate, "debug workflow prompt", verbose, diff --git a/pkg/cli/fix_command_test.go b/pkg/cli/fix_command_test.go index f77de682d1..a1cf5ba518 100644 --- a/pkg/cli/fix_command_test.go +++ b/pkg/cli/fix_command_test.go @@ -682,17 +682,17 @@ This is a test workflow. t.Error("Expected dispatcher agent file to be created/updated") } - createPromptPath := filepath.Join(".github", "aw", "create.md") + createPromptPath := filepath.Join(".github", "aw", "create-agentic-workflow.md") if _, err := os.Stat(createPromptPath); os.IsNotExist(err) { t.Error("Expected create workflow prompt file to be created/updated") } - updatePromptPath := filepath.Join(".github", "aw", "update.md") + updatePromptPath := filepath.Join(".github", "aw", "update-agentic-workflow.md") if _, err := os.Stat(updatePromptPath); os.IsNotExist(err) { t.Error("Expected update workflow prompt file to be created/updated") } - debugPromptPath := filepath.Join(".github", "aw", "debug.md") + debugPromptPath := filepath.Join(".github", "aw", "debug-agentic-workflow.md") if _, err := os.Stat(debugPromptPath); os.IsNotExist(err) { t.Error("Expected debug workflow prompt file to be created/updated") } diff --git a/pkg/cli/init.go b/pkg/cli/init.go index 875b3882b2..74cf584e86 100644 --- a/pkg/cli/init.go +++ b/pkg/cli/init.go @@ -99,13 +99,6 @@ func InitRepository(verbose bool, mcp bool, campaign bool, tokens bool, engine s return fmt.Errorf("failed to delete setup agentic workflows agent: %w", err) } - // Clean up legacy create-agentic-workflow.md file if it exists - initLog.Print("Cleaning up legacy create-agentic-workflow.md") - if err := cleanupLegacyCreateAgenticWorkflowPrompt(verbose); err != nil { - initLog.Printf("Failed to cleanup legacy create-agentic-workflow.md: %v", err) - return fmt.Errorf("failed to cleanup legacy create-agentic-workflow.md: %w", err) - } - // Write debug workflow prompt initLog.Print("Writing debug workflow prompt") if err := ensureDebugWorkflowPrompt(verbose, false); err != nil { diff --git a/pkg/cli/init_command.go b/pkg/cli/init_command.go index 7861210f52..f42a5199a8 100644 --- a/pkg/cli/init_command.go +++ b/pkg/cli/init_command.go @@ -22,10 +22,10 @@ This command: - Creates .github/aw/logs/.gitignore to ignore downloaded workflow logs - Creates GitHub Copilot custom instructions at .github/aw/github-agentic-workflows.md - Creates the dispatcher agent at .github/agents/agentic-workflows.agent.md -- Creates workflow creation prompt at .github/aw/create.md (for new workflows) -- Creates workflow update prompt at .github/aw/update.md (for updating existing workflows) +- Creates workflow creation prompt at .github/aw/create-agentic-workflow.md (for new workflows) +- Creates workflow update prompt at .github/aw/update-agentic-workflow.md (for updating existing workflows) - Creates shared workflow creation prompt at .github/aw/create-shared-agentic-workflow.md -- Creates debug workflow prompt at .github/aw/debug.md +- Creates debug workflow prompt at .github/aw/debug-agentic-workflow.md - Creates upgrade workflow prompt at .github/aw/upgrade-agentic-workflows.md - Removes old prompt files from .github/prompts/ if they exist - Configures VSCode settings (.vscode/settings.json) diff --git a/pkg/cli/init_test.go b/pkg/cli/init_test.go index ec6d60557e..a0c9bb6796 100644 --- a/pkg/cli/init_test.go +++ b/pkg/cli/init_test.go @@ -109,19 +109,19 @@ func TestInitRepository(t *testing.T) { } // Verify create workflow prompt was created - createPromptPath := filepath.Join(tempDir, ".github", "aw", "create.md") + createPromptPath := filepath.Join(tempDir, ".github", "aw", "create-agentic-workflow.md") if _, err := os.Stat(createPromptPath); os.IsNotExist(err) { t.Errorf("Expected create workflow prompt file to exist") } // Verify update workflow prompt was created - updatePromptPath := filepath.Join(tempDir, ".github", "aw", "update.md") + updatePromptPath := filepath.Join(tempDir, ".github", "aw", "update-agentic-workflow.md") if _, err := os.Stat(updatePromptPath); os.IsNotExist(err) { t.Errorf("Expected update workflow prompt file to exist") } // Verify debug workflow prompt was created - debugPromptPath := filepath.Join(tempDir, ".github", "aw", "debug.md") + debugPromptPath := filepath.Join(tempDir, ".github", "aw", "debug-agentic-workflow.md") if _, err := os.Stat(debugPromptPath); os.IsNotExist(err) { t.Errorf("Expected debug workflow prompt file to exist") } @@ -188,17 +188,17 @@ func TestInitRepository_Idempotent(t *testing.T) { t.Errorf("Expected dispatcher agent file to exist after second call") } - createPromptPath := filepath.Join(tempDir, ".github", "aw", "create.md") + createPromptPath := filepath.Join(tempDir, ".github", "aw", "create-agentic-workflow.md") if _, err := os.Stat(createPromptPath); os.IsNotExist(err) { t.Errorf("Expected create workflow prompt file to exist after second call") } - updatePromptPath := filepath.Join(tempDir, ".github", "aw", "update.md") + updatePromptPath := filepath.Join(tempDir, ".github", "aw", "update-agentic-workflow.md") if _, err := os.Stat(updatePromptPath); os.IsNotExist(err) { t.Errorf("Expected update workflow prompt file to exist after second call") } - debugPromptPath := filepath.Join(tempDir, ".github", "aw", "debug.md") + debugPromptPath := filepath.Join(tempDir, ".github", "aw", "debug-agentic-workflow.md") if _, err := os.Stat(debugPromptPath); os.IsNotExist(err) { t.Errorf("Expected debug workflow prompt file to exist after second call") } diff --git a/pkg/cli/templates/agentic-workflows.agent.md b/pkg/cli/templates/agentic-workflows.agent.md index a6fe05babb..32772dbe58 100644 --- a/pkg/cli/templates/agentic-workflows.agent.md +++ b/pkg/cli/templates/agentic-workflows.agent.md @@ -44,7 +44,7 @@ When you interact with this agent, it will: ### Create New Workflow **Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet -**Prompt file**: `.github/aw/create.md` +**Prompt file**: `.github/aw/create-agentic-workflow.md` **Use cases**: - "Create a workflow that triages issues" @@ -54,7 +54,7 @@ When you interact with this agent, it will: ### Update Existing Workflow **Load when**: User wants to modify, improve, or refactor an existing workflow -**Prompt file**: `.github/aw/update.md` +**Prompt file**: `.github/aw/update-agentic-workflow.md` **Use cases**: - "Add web-fetch tool to the issue-classifier workflow" @@ -64,7 +64,7 @@ When you interact with this agent, it will: ### Debug Workflow **Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors -**Prompt file**: `.github/aw/debug.md` +**Prompt file**: `.github/aw/debug-agentic-workflow.md` **Use cases**: - "Why is this workflow failing?" diff --git a/pkg/cli/templates/create.md b/pkg/cli/templates/create-agentic-workflow.md similarity index 100% rename from pkg/cli/templates/create.md rename to pkg/cli/templates/create-agentic-workflow.md diff --git a/pkg/cli/templates/debug.md b/pkg/cli/templates/debug-agentic-workflow.md similarity index 100% rename from pkg/cli/templates/debug.md rename to pkg/cli/templates/debug-agentic-workflow.md diff --git a/pkg/cli/templates/update.md b/pkg/cli/templates/update-agentic-workflow.md similarity index 100% rename from pkg/cli/templates/update.md rename to pkg/cli/templates/update-agentic-workflow.md