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
6 changes: 3 additions & 3 deletions .github/agents/agentic-workflows.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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?"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/agentic_workflow_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down Expand Up @@ -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")
}
Expand Down Expand Up @@ -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/")
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 6 additions & 28 deletions pkg/cli/copilot-agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -173,23 +151,23 @@ 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,
skipInstructions,
)
}

// 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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/fix_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
7 changes: 0 additions & 7 deletions pkg/cli/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/init_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions pkg/cli/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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")
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/templates/agentic-workflows.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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?"
Expand Down
File renamed without changes.
Loading