diff --git a/.github/agents/add-safe-output-type.md b/.github/prompts/add-safe-output-type.prompt.md similarity index 99% rename from .github/agents/add-safe-output-type.md rename to .github/prompts/add-safe-output-type.prompt.md index 11f500775f..453c0736d6 100644 --- a/.github/agents/add-safe-output-type.md +++ b/.github/prompts/add-safe-output-type.prompt.md @@ -1,4 +1,5 @@ --- +mode: agent name: add-safe-output-type description: Adding a New Safe Output Type to GitHub Agentic Workflows --- diff --git a/.github/agents/cli-consistency-checker.md b/.github/prompts/cli-consistency-checker.prompt.md similarity index 99% rename from .github/agents/cli-consistency-checker.md rename to .github/prompts/cli-consistency-checker.prompt.md index 7b1cddae89..be302ccdd7 100644 --- a/.github/agents/cli-consistency-checker.md +++ b/.github/prompts/cli-consistency-checker.prompt.md @@ -1,4 +1,5 @@ --- +mode: agent name: cli-consistency-checker description: Agent specialized in inspecting the gh-aw CLI tool by running actual commands with --help flags to verify consistency, documentation accuracy, and user-facing help text. --- diff --git a/pkg/cli/templates/create-agentic-workflow.md b/.github/prompts/create-agentic-workflow.prompt.md similarity index 99% rename from pkg/cli/templates/create-agentic-workflow.md rename to .github/prompts/create-agentic-workflow.prompt.md index 3cebd6ef0f..018c059cc5 100644 --- a/pkg/cli/templates/create-agentic-workflow.md +++ b/.github/prompts/create-agentic-workflow.prompt.md @@ -1,5 +1,5 @@ --- -name: create-agentic-workflow +mode: agent description: Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices. --- diff --git a/pkg/cli/templates/create-shared-agentic-workflow.md b/.github/prompts/create-shared-agentic-workflow.prompt.md similarity index 99% rename from pkg/cli/templates/create-shared-agentic-workflow.md rename to .github/prompts/create-shared-agentic-workflow.prompt.md index 9a8886b021..d9b2e0c0d5 100644 --- a/pkg/cli/templates/create-shared-agentic-workflow.md +++ b/.github/prompts/create-shared-agentic-workflow.prompt.md @@ -1,4 +1,5 @@ --- +mode: agent name: create-shared-agentic-workflow description: Create shared agentic workflow components that wrap MCP servers using GitHub Agentic Workflows (gh-aw) with Docker best practices. --- diff --git a/.github/agents/debug-agentic-workflow.md b/.github/prompts/debug-agentic-workflow.prompt.md similarity index 99% rename from .github/agents/debug-agentic-workflow.md rename to .github/prompts/debug-agentic-workflow.prompt.md index 6809f27765..b23543f761 100644 --- a/.github/agents/debug-agentic-workflow.md +++ b/.github/prompts/debug-agentic-workflow.prompt.md @@ -1,5 +1,5 @@ --- -name: debug-agentic-workflow +mode: agent description: Debug and refine agentic workflows using gh-aw CLI tools - analyze logs, audit runs, and improve workflow performance --- diff --git a/.github/agents/improve-json-schema-descriptions.md b/.github/prompts/improve-json-schema-descriptions.prompt.md similarity index 99% rename from .github/agents/improve-json-schema-descriptions.md rename to .github/prompts/improve-json-schema-descriptions.prompt.md index 7226155a7f..b23e703b3a 100644 --- a/.github/agents/improve-json-schema-descriptions.md +++ b/.github/prompts/improve-json-schema-descriptions.prompt.md @@ -1,4 +1,5 @@ --- +mode: agent name: improve-json-schema-descriptions description: Systematic approach for reviewing and improving descriptions in the frontmatter JSON schema for GitHub Agentic Workflows --- diff --git a/pkg/cli/templates/setup-agentic-workflows.md b/.github/prompts/setup-agentic-workflows.prompt.md similarity index 88% rename from pkg/cli/templates/setup-agentic-workflows.md rename to .github/prompts/setup-agentic-workflows.prompt.md index 9aa397a033..ba0d1bb5e8 100644 --- a/pkg/cli/templates/setup-agentic-workflows.md +++ b/.github/prompts/setup-agentic-workflows.prompt.md @@ -1,5 +1,5 @@ --- -name: setup-agentic-workflows +mode: agent description: A guided agent to help you set up your agentic workflows using gh-aw --- @@ -89,15 +89,11 @@ gh secret set OPENAI_API_KEY -a actions --body "your-openai-api-key-here" Say to the user: ```` -When you're ready, use the custom agent to create your workflow: +When you're ready, use the prompt to create your workflow: -**Option 1: Direct invocation** +**Direct invocation** Type `/create-agentic-workflow` in the chat -**Option 2: Menu selection** -1. Type `/agent` in the chat -2. Select `create-agentic-workflow` from the list of available custom agents - -This will activate the workflow creation custom agent to help you create your first agentic workflow. +This will help you create your first agentic workflow. ```` diff --git a/.github/agents/shell-2-script.md b/.github/prompts/shell-2-script.prompt.md similarity index 99% rename from .github/agents/shell-2-script.md rename to .github/prompts/shell-2-script.prompt.md index 41bee92400..74d1c9ad9c 100644 --- a/.github/agents/shell-2-script.md +++ b/.github/prompts/shell-2-script.prompt.md @@ -1,4 +1,5 @@ --- +mode: agent name: shell-2-script description: Extract inline bash scripts from Go compiler code into separate .sh files with embedded resources for improved maintainability, organization, and reusability --- diff --git a/.github/agents/technical-doc-writer.md b/.github/prompts/technical-doc-writer.prompt.md similarity index 99% rename from .github/agents/technical-doc-writer.md rename to .github/prompts/technical-doc-writer.prompt.md index b5f18f64dc..288faa24f1 100644 --- a/.github/agents/technical-doc-writer.md +++ b/.github/prompts/technical-doc-writer.prompt.md @@ -1,4 +1,5 @@ --- +mode: agent name: technical-doc-writer description: AI technical documentation writer for GitHub Actions library using Astro Starlight and GitHub Docs voice --- diff --git a/Makefile b/Makefile index e9a248295a..bf203027fa 100644 --- a/Makefile +++ b/Makefile @@ -286,9 +286,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/agents/create-agentic-workflow.md pkg/cli/templates/ - @cp .github/agents/setup-agentic-workflows.md pkg/cli/templates/ - @cp .github/agents/create-shared-agentic-workflow.md pkg/cli/templates/ + @cp .github/prompts/create-agentic-workflow.prompt.md pkg/cli/templates/ + @cp .github/prompts/setup-agentic-workflows.prompt.md pkg/cli/templates/ + @cp .github/prompts/create-shared-agentic-workflow.prompt.md pkg/cli/templates/ + @cp .github/prompts/debug-agentic-workflow.prompt.md pkg/cli/templates/ @echo "✓ Templates synced successfully" # Sync action pins from .github/aw to pkg/workflow/data diff --git a/docs/src/content/docs/reference/custom-agents.md b/docs/src/content/docs/reference/custom-agents.md index 280e8676c6..967f90bcc2 100644 --- a/docs/src/content/docs/reference/custom-agents.md +++ b/docs/src/content/docs/reference/custom-agents.md @@ -49,6 +49,6 @@ The agent instructions are merged with the workflow prompt, customizing the AI e - **Frontmatter**: Can include `name`, `description`, `tools`, and `mcp-servers` - **One per workflow**: Only one agent file can be imported per workflow -## Built-in Custom Agents +## Built-in Prompts -The `gh aw init` command sets up a `debug-agentic-workflow` custom agent that helps debug and refine workflows using CLI tools (`gh aw logs`, `gh aw audit`, `gh aw run`, `gh aw compile`). The agent provides conversational workflow debugging and performance analysis. +The `gh aw init` command sets up workflow creation prompts including `debug-agentic-workflow` that helps debug and refine workflows using CLI tools (`gh aw logs`, `gh aw audit`, `gh aw run`, `gh aw compile`). These prompts are stored in `.github/prompts/` and provide conversational workflow authoring and debugging capabilities. diff --git a/docs/src/content/docs/reference/glossary.md b/docs/src/content/docs/reference/glossary.md index 115d97f3cd..1c9d7c9cba 100644 --- a/docs/src/content/docs/reference/glossary.md +++ b/docs/src/content/docs/reference/glossary.md @@ -100,6 +100,9 @@ A human-friendly data format used for configuration files. Uses indentation and ### Personal Access Token (PAT) A token that authenticates you to GitHub's APIs with specific permissions. Required for GitHub Copilot CLI to access Copilot services. Created at github.com/settings/personal-access-tokens. +### Prompt Files +Markdown files with YAML frontmatter stored in `.github/prompts/` that define interactive Copilot Chat commands. Created by `gh aw init`, these files (like `create-agentic-workflow.prompt.md`) can be invoked as slash commands (e.g., `/create-agentic-workflow`) in Copilot Chat to guide workflow creation with specialized instructions. + ### Fine-grained Personal Access Token A type of GitHub Personal Access Token with granular permission control. Specify exactly which repositories the token can access and what permissions it has (`contents: read`, `issues: write`, etc.). Created at github.com/settings/personal-access-tokens. @@ -123,7 +126,10 @@ Special triggers that respond to slash commands in issue and PR comments (e.g., Settings that limit how many instances of a workflow can run simultaneously. Configured using the `concurrency:` field to prevent resource conflicts or rate limiting. ### Custom Agents -Specialized instructions or configurations that customize AI agent behavior for specific tasks or repositories. Stored in `.github/agents/` or `.github/copilot/instructions/` directories. +Specialized instructions or configurations that customize AI agent behavior for specific tasks or repositories. Can be stored as: +- **Prompt files** (`.github/prompts/*.prompt.md`) - Used with Copilot Chat slash commands for interactive workflow authoring +- **Agent files** (`.github/agents/*.md`) - Imported into workflows via the `imports` field for execution-time customization +- **Instruction files** (`.github/copilot/instructions/`) - Path-specific or repository-wide Copilot instructions ### Strict Mode An enhanced validation mode that enforces additional security checks and best practices. Enabled using `strict: true` in frontmatter or the `--strict` flag when compiling. diff --git a/docs/src/content/docs/setup/agentic-authoring.mdx b/docs/src/content/docs/setup/agentic-authoring.mdx index abeada0e32..9148ef0841 100644 --- a/docs/src/content/docs/setup/agentic-authoring.mdx +++ b/docs/src/content/docs/setup/agentic-authoring.mdx @@ -7,12 +7,12 @@ sidebar: import CopyEntireFileButton from '../../../components/CopyEntireFileButton.astro'; -GitHub Agentic Workflows provide a custom agent that turns GitHub Copilot into -a powerful workflow authoring tool. This guide explains how to use this agent to author agentic workflows in natural language. +GitHub Agentic Workflows provide prompts that turn GitHub Copilot into +a powerful workflow authoring tool. This guide explains how to use these prompts to author agentic workflows in natural language. ## Quick Start -Initialize your repository to set up GitHub Copilot instructions and custom agents for authoring agentic workflows: +Initialize your repository to set up GitHub Copilot instructions and prompts for authoring agentic workflows: ```bash wrap gh aw init @@ -20,35 +20,35 @@ gh aw init This creates: - `.github/aw/github-agentic-workflows.instructions.md` - Custom Copilot instructions for better workflow authoring -- `.github/agents/create-agentic-workflow.md` - Custom agent for the `/agent` command in Copilot Chat +- `.github/prompts/create-agentic-workflow.prompt.md` - Prompt for the `/create-agentic-workflow` command in Copilot Chat :::tip[VS Code integration] Once initialized, GitHub Copilot will automatically use these instructions when you edit workflow files in VS Code. See [VS Code Integration](/gh-aw/setup/vscode/) for more details. ::: -## What is the `create-agentic-workflow` custom agent? +## What is the `create-agentic-workflow` prompt? -`.github/agents/create-agentic-workflow.md` is a custom agent file that contains the structure and instructions GitHub Copilot will use to generate a workflow markdown file that the `gh aw` CLI understands. A [custom agent](/gh-aw/reference/glossary/#custom-agents) is a specialized instruction set that customizes AI behavior for specific tasks. +`.github/prompts/create-agentic-workflow.prompt.md` is a prompt file that contains the structure and instructions GitHub Copilot will use to generate a workflow markdown file that the `gh aw` CLI understands. A [prompt file](/gh-aw/reference/glossary/#prompt-files) is a specialized instruction set that customizes AI behavior for specific tasks. -Use the custom agent when you want to: +Use the prompt when you want to: - Draft a new agentic workflow using natural language - Iterate on workflow steps with AI assistance inside your editor -The custom agent contains specialized instructions and toolset to enable efficient workflow authoring. +The prompt contains specialized instructions and toolset to enable efficient workflow authoring. -## How to use the `create-agentic-workflow` custom agent +## How to use the `create-agentic-workflow` prompt -In Visual Studio Code with GitHub Copilot Chat or in Copilot CLI, enter the `/agent` command and select `create-agentic-workflow` from the list: +In Visual Studio Code with GitHub Copilot Chat or in Copilot CLI, enter the `/create-agentic-workflow` command: ```sh wrap -/agent +/create-agentic-workflow ``` -Then select `create-agentic-workflow` from the available custom agents. This will start the agentic workflow authoring process with interactive guidance. +This will start the agentic workflow authoring process with interactive guidance. ## Other Agents and Chats -The custom agent file can be loaded into other AI chat interfaces that support custom instructions. The agent is designed to be compatible with various AI tools, although some features might require configuration and you'll need to allow running the compiler. +The prompt file can be loaded into other AI chat interfaces that support custom instructions. The prompt is designed to be compatible with various AI tools, although some features might require configuration and you'll need to allow running the compiler. ## Dictating Agentic Workflows diff --git a/docs/src/content/docs/setup/cli.md b/docs/src/content/docs/setup/cli.md index 4ab1f1c066..8ae56ea6ca 100644 --- a/docs/src/content/docs/setup/cli.md +++ b/docs/src/content/docs/setup/cli.md @@ -78,11 +78,11 @@ Commands are organized by workflow lifecycle: creating, building, testing, monit Initialize your repository for agentic workflows. ```bash wrap -gh aw init # Configure .gitattributes, Copilot instructions, custom agent +gh aw init # Configure .gitattributes, Copilot instructions, prompts gh aw init --mcp # Also setup MCP server integration for Copilot Agent ``` -Configures `.gitattributes` to mark `.lock.yml` files as generated, adds Copilot instructions for better AI assistance, and sets up custom agent configuration. The `--mcp` flag additionally creates GitHub Actions workflow for MCP server setup, configures `.vscode/mcp.json` for VS Code integration, and enables gh-aw MCP tools in Copilot Agent. +Configures `.gitattributes` to mark `.lock.yml` files as generated, adds Copilot instructions for better AI assistance, and sets up prompt files for workflow creation. The `--mcp` flag additionally creates GitHub Actions workflow for MCP server setup, configures `.vscode/mcp.json` for VS Code integration, and enables gh-aw MCP tools in Copilot Agent. #### `add` diff --git a/docs/src/content/docs/setup/quick-start.md b/docs/src/content/docs/setup/quick-start.md index 17dd46e812..0679867c8d 100644 --- a/docs/src/content/docs/setup/quick-start.md +++ b/docs/src/content/docs/setup/quick-start.md @@ -166,7 +166,7 @@ You can leverage the help of an agent to customize your workflow without having ```bash wrap # install copilot cli npm install -g @github/copilot-cli -# install the custom agent files +# install the prompt files gh aw init ``` @@ -175,7 +175,7 @@ Then, run the following to create and edit your workflow: ```bash wrap # start an interactive session to customize the workflow copilot -> /agent create-agentic-workflow +> /create-agentic-workflow > edit @.github/workflows/daily-team-status.md ``` diff --git a/docs/src/content/docs/setup/vscode.md b/docs/src/content/docs/setup/vscode.md index 43696dc157..98b03385b1 100644 --- a/docs/src/content/docs/setup/vscode.md +++ b/docs/src/content/docs/setup/vscode.md @@ -17,11 +17,11 @@ gh aw init This creates files including: - **Copilot instructions**: `.github/aw/github-agentic-workflows.md` - Automatically imported when authoring markdown files under `.github/workflows/`, making Copilot Chat more efficient at generating Agentic Workflows. -- **Custom agent**: `.github/agents/create-agentic-workflow.md` - A custom agent you can reference in Copilot Chat to interactively create workflows. +- **Prompts**: `.github/prompts/create-agentic-workflow.prompt.md` - A prompt you can reference in Copilot Chat to interactively create workflows. -## create-agentic-workflow custom agent +## create-agentic-workflow prompt -Use the `/agent` command in Copilot Chat and select `create-agentic-workflow` from the list to interactively design workflows with guided assistance for trigger selection, permissions, security settings, tool configuration, and best practices. The conversational interface helps you build secure workflows without memorizing syntax. +Use the `/create-agentic-workflow` command in Copilot Chat to interactively design workflows with guided assistance for trigger selection, permissions, security settings, tool configuration, and best practices. The conversational interface helps you build secure workflows without memorizing syntax. ## Background Compilation diff --git a/pkg/cli/agentic_workflow_agent_test.go b/pkg/cli/agentic_workflow_agent_test.go index 3c1bffe977..6240441c7c 100644 --- a/pkg/cli/agentic_workflow_agent_test.go +++ b/pkg/cli/agentic_workflow_agent_test.go @@ -10,26 +10,26 @@ import ( "github.com/githubnext/gh-aw/pkg/testutil" ) -func TestEnsureAgenticWorkflowAgent(t *testing.T) { +func TestEnsureAgenticWorkflowPrompt(t *testing.T) { tests := []struct { name string existingContent string expectedContent string }{ { - name: "creates new agentic workflow agent file", + name: "creates new agentic workflow prompt file", existingContent: "", - expectedContent: strings.TrimSpace(agenticWorkflowAgentTemplate), + expectedContent: strings.TrimSpace(agenticWorkflowPromptTemplate), }, { name: "does not modify existing correct file", - existingContent: agenticWorkflowAgentTemplate, - expectedContent: strings.TrimSpace(agenticWorkflowAgentTemplate), + existingContent: agenticWorkflowPromptTemplate, + expectedContent: strings.TrimSpace(agenticWorkflowPromptTemplate), }, { name: "updates modified file", - existingContent: "# Modified Agentic Workflow Agent\n\nThis is a modified version.", - expectedContent: strings.TrimSpace(agenticWorkflowAgentTemplate), + existingContent: "# Modified Agentic Workflow Prompt\n\nThis is a modified version.", + expectedContent: strings.TrimSpace(agenticWorkflowPromptTemplate), }, } @@ -53,34 +53,34 @@ func TestEnsureAgenticWorkflowAgent(t *testing.T) { t.Fatalf("Failed to init git repo: %v", err) } - agentsDir := filepath.Join(tempDir, ".github", "agents") - agenticWorkflowAgentPath := filepath.Join(agentsDir, "create-agentic-workflow.md") + promptsDir := filepath.Join(tempDir, ".github", "prompts") + agenticWorkflowPromptPath := filepath.Join(promptsDir, "create-agentic-workflow.prompt.md") // Create initial content if specified if tt.existingContent != "" { - if err := os.MkdirAll(agentsDir, 0755); err != nil { - t.Fatalf("Failed to create agents directory: %v", err) + if err := os.MkdirAll(promptsDir, 0755); err != nil { + t.Fatalf("Failed to create prompts directory: %v", err) } - if err := os.WriteFile(agenticWorkflowAgentPath, []byte(tt.existingContent), 0644); err != nil { - t.Fatalf("Failed to create initial agentic workflow agent: %v", err) + if err := os.WriteFile(agenticWorkflowPromptPath, []byte(tt.existingContent), 0644); err != nil { + t.Fatalf("Failed to create initial agentic workflow prompt: %v", err) } } // Call the function with skipInstructions=false to test the functionality - err = ensureAgenticWorkflowAgent(false, false) + err = ensureAgenticWorkflowPrompt(false, false) if err != nil { - t.Fatalf("ensureAgenticWorkflowAgent() returned error: %v", err) + t.Fatalf("ensureAgenticWorkflowPrompt() returned error: %v", err) } // Check that file exists - if _, err := os.Stat(agenticWorkflowAgentPath); os.IsNotExist(err) { - t.Fatalf("Expected agentic workflow agent file to exist") + if _, err := os.Stat(agenticWorkflowPromptPath); os.IsNotExist(err) { + t.Fatalf("Expected agentic workflow prompt file to exist") } // Check content - content, err := os.ReadFile(agenticWorkflowAgentPath) + content, err := os.ReadFile(agenticWorkflowPromptPath) if err != nil { - t.Fatalf("Failed to read agentic workflow agent: %v", err) + t.Fatalf("Failed to read agentic workflow prompt: %v", err) } contentStr := strings.TrimSpace(string(content)) @@ -95,7 +95,7 @@ func TestEnsureAgenticWorkflowAgent(t *testing.T) { } } -func TestEnsureAgenticWorkflowAgent_WithSkipInstructionsTrue(t *testing.T) { +func TestEnsureAgenticWorkflowPrompt_WithSkipInstructionsTrue(t *testing.T) { // Create a temporary directory for testing tempDir := testutil.TempDir(t, "test-*") @@ -115,20 +115,20 @@ func TestEnsureAgenticWorkflowAgent_WithSkipInstructionsTrue(t *testing.T) { } // Call the function with skipInstructions=true - err = ensureAgenticWorkflowAgent(false, true) + err = ensureAgenticWorkflowPrompt(false, true) if err != nil { - t.Fatalf("ensureAgenticWorkflowAgent() returned error: %v", err) + t.Fatalf("ensureAgenticWorkflowPrompt() returned error: %v", err) } // Check that file was NOT created - agentsDir := filepath.Join(tempDir, ".github", "agents") - agenticWorkflowAgentPath := filepath.Join(agentsDir, "create-agentic-workflow.md") - if _, err := os.Stat(agenticWorkflowAgentPath); !os.IsNotExist(err) { - t.Fatalf("Expected agentic workflow agent file to NOT exist when skipInstructions=true") + promptsDir := filepath.Join(tempDir, ".github", "prompts") + agenticWorkflowPromptPath := filepath.Join(promptsDir, "create-agentic-workflow.prompt.md") + if _, err := os.Stat(agenticWorkflowPromptPath); !os.IsNotExist(err) { + t.Fatalf("Expected agentic workflow prompt file to NOT exist when skipInstructions=true") } } -func TestEnsureAgenticWorkflowAgent_RemovesLegacyPromptFile(t *testing.T) { +func TestEnsureAgenticWorkflowPrompt_RemovesLegacyAgentFile(t *testing.T) { // Create a temporary directory for testing tempDir := testutil.TempDir(t, "test-*") @@ -147,30 +147,37 @@ func TestEnsureAgenticWorkflowAgent_RemovesLegacyPromptFile(t *testing.T) { t.Fatalf("Failed to init git repo: %v", err) } - // Create the old prompt file (legacy format that should be cleaned up) - promptsDir := filepath.Join(tempDir, ".github", "prompts") - oldPromptPath := filepath.Join(promptsDir, "create-agentic-workflow.prompt.md") + // Create the old agent file (legacy format that should be cleaned up) + agentsDir := filepath.Join(tempDir, ".github", "agents") + oldAgentPath := filepath.Join(agentsDir, "create-agentic-workflow.md") - if err := os.MkdirAll(promptsDir, 0755); err != nil { - t.Fatalf("Failed to create prompts directory: %v", err) + if err := os.MkdirAll(agentsDir, 0755); err != nil { + t.Fatalf("Failed to create agents directory: %v", err) } - if err := os.WriteFile(oldPromptPath, []byte("old content"), 0644); err != nil { - t.Fatalf("Failed to create old prompt file: %v", err) + if err := os.WriteFile(oldAgentPath, []byte("old content"), 0644); err != nil { + t.Fatalf("Failed to create old agent file: %v", err) } // Verify old file exists - if _, err := os.Stat(oldPromptPath); os.IsNotExist(err) { - t.Fatalf("Old prompt file should exist before test") + if _, err := os.Stat(oldAgentPath); os.IsNotExist(err) { + t.Fatalf("Old agent file should exist before test") } - // Call the function to remove old prompt (now handled by agent cleanup) + // Call the function to create prompt (which should also remove old agent) err = ensureAgenticWorkflowPrompt(false, false) if err != nil { t.Fatalf("ensureAgenticWorkflowPrompt() returned error: %v", err) } // Check that old file was removed - if _, err := os.Stat(oldPromptPath); !os.IsNotExist(err) { - t.Fatalf("Expected old prompt file to be removed") + if _, err := os.Stat(oldAgentPath); !os.IsNotExist(err) { + t.Fatalf("Expected old agent file to be removed") + } + + // Check that new prompt file was created + promptsDir := filepath.Join(tempDir, ".github", "prompts") + newPromptPath := filepath.Join(promptsDir, "create-agentic-workflow.prompt.md") + if _, err := os.Stat(newPromptPath); os.IsNotExist(err) { + t.Fatalf("Expected new prompt file to be created") } } diff --git a/pkg/cli/commands.go b/pkg/cli/commands.go index 9075c84017..bd6c54a381 100644 --- a/pkg/cli/commands.go +++ b/pkg/cli/commands.go @@ -24,17 +24,17 @@ var ( //go:embed templates/github-agentic-workflows.instructions.md var copilotInstructionsTemplate string -//go:embed templates/create-agentic-workflow.md -var agenticWorkflowAgentTemplate string +//go:embed templates/create-agentic-workflow.prompt.md +var agenticWorkflowPromptTemplate string -//go:embed templates/create-shared-agentic-workflow.md -var sharedAgenticWorkflowAgentTemplate string +//go:embed templates/create-shared-agentic-workflow.prompt.md +var sharedAgenticWorkflowPromptTemplate string -//go:embed templates/setup-agentic-workflows.md -var setupAgenticWorkflowsAgentTemplate string +//go:embed templates/setup-agentic-workflows.prompt.md +var setupAgenticWorkflowsPromptTemplate string -//go:embed templates/debug-agentic-workflow.md -var debugAgenticWorkflowAgentTemplate string +//go:embed templates/debug-agentic-workflow.prompt.md +var debugAgenticWorkflowPromptTemplate string // SetVersionInfo sets the version information for the CLI func SetVersionInfo(v string) { diff --git a/pkg/cli/copilot-agents.go b/pkg/cli/copilot-agents.go index 43345ddfa0..b2a3807cba 100644 --- a/pkg/cli/copilot-agents.go +++ b/pkg/cli/copilot-agents.go @@ -57,18 +57,40 @@ func ensureFileMatchesTemplate(subdir, fileName, templateContent, fileType strin return nil } -// ensureAgentFromTemplate ensures that an agent file exists and matches the embedded template -func ensureAgentFromTemplate(agentFileName, templateContent string, verbose bool, skipInstructions bool) error { +// ensurePromptFromTemplate ensures that a prompt file exists and matches the embedded template +func ensurePromptFromTemplate(promptFileName, templateContent string, verbose bool, skipInstructions bool) error { return ensureFileMatchesTemplate( - filepath.Join(".github", "agents"), - agentFileName, + filepath.Join(".github", "prompts"), + promptFileName, templateContent, - "agent", + "prompt", verbose, skipInstructions, ) } +// cleanupOldAgentFile removes an old agent file if it exists +func cleanupOldAgentFile(agentFileName string, verbose bool) error { + gitRoot, err := findGitRoot() + if err != nil { + return nil // Not in a git repository, skip + } + + oldPath := filepath.Join(gitRoot, ".github", "agents", agentFileName) + + // Check if the old file exists and remove it + if _, err := os.Stat(oldPath); err == nil { + if err := os.Remove(oldPath); err != nil { + return fmt.Errorf("failed to remove old agent file: %w", err) + } + if verbose { + fmt.Printf("Removed old agent file: %s\n", oldPath) + } + } + + 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 @@ -108,50 +130,42 @@ func cleanupOldCopilotInstructions(verbose bool) error { return nil } -// ensureAgenticWorkflowPrompt removes the old agentic workflow prompt file if it exists +// ensureAgenticWorkflowPrompt ensures that .github/prompts/create-agentic-workflow.prompt.md contains the workflow creation prompt func ensureAgenticWorkflowPrompt(verbose bool, skipInstructions bool) error { - // This function now removes the old prompt file since we've migrated to agent format - if skipInstructions { - return nil - } - - gitRoot, err := findGitRoot() - if err != nil { - return err // Not in a git repository, skip + // First, clean up the old agent file if it exists + if err := cleanupOldAgentFile("create-agentic-workflow.md", verbose); err != nil { + return err } - promptsDir := filepath.Join(gitRoot, ".github", "prompts") - oldPromptPath := filepath.Join(promptsDir, "create-agentic-workflow.prompt.md") + return ensurePromptFromTemplate("create-agentic-workflow.prompt.md", agenticWorkflowPromptTemplate, verbose, skipInstructions) +} - // Check if the old prompt file exists and remove it - if _, err := os.Stat(oldPromptPath); err == nil { - if err := os.Remove(oldPromptPath); err != nil { - return fmt.Errorf("failed to remove old prompt file: %w", err) - } - if verbose { - fmt.Printf("Removed old prompt file: %s\n", oldPromptPath) - } +// ensureSharedAgenticWorkflowPrompt ensures that .github/prompts/create-shared-agentic-workflow.prompt.md contains the shared workflow creation prompt +func ensureSharedAgenticWorkflowPrompt(verbose bool, skipInstructions bool) error { + // First, clean up the old agent file if it exists + if err := cleanupOldAgentFile("create-shared-agentic-workflow.md", verbose); err != nil { + return err } - return nil + return ensurePromptFromTemplate("create-shared-agentic-workflow.prompt.md", sharedAgenticWorkflowPromptTemplate, verbose, skipInstructions) } -// ensureAgenticWorkflowAgent ensures that .github/agents/create-agentic-workflow.md contains the agentic workflow creation agent -func ensureAgenticWorkflowAgent(verbose bool, skipInstructions bool) error { - return ensureAgentFromTemplate("create-agentic-workflow.md", agenticWorkflowAgentTemplate, verbose, skipInstructions) -} +// ensureSetupAgenticWorkflowsPrompt ensures that .github/prompts/setup-agentic-workflows.prompt.md contains the setup guide prompt +func ensureSetupAgenticWorkflowsPrompt(verbose bool, skipInstructions bool) error { + // First, clean up the old agent file if it exists + if err := cleanupOldAgentFile("setup-agentic-workflows.md", verbose); err != nil { + return err + } -// ensureSharedAgenticWorkflowAgent ensures that .github/agents/create-shared-agentic-workflow.md contains the shared workflow creation agent -func ensureSharedAgenticWorkflowAgent(verbose bool, skipInstructions bool) error { - return ensureAgentFromTemplate("create-shared-agentic-workflow.md", sharedAgenticWorkflowAgentTemplate, verbose, skipInstructions) + return ensurePromptFromTemplate("setup-agentic-workflows.prompt.md", setupAgenticWorkflowsPromptTemplate, verbose, skipInstructions) } -// ensureSetupAgenticWorkflowsAgent ensures that .github/agents/setup-agentic-workflows.md contains the setup guide agent -func ensureSetupAgenticWorkflowsAgent(verbose bool, skipInstructions bool) error { - return ensureAgentFromTemplate("setup-agentic-workflows.md", setupAgenticWorkflowsAgentTemplate, verbose, skipInstructions) -} +// ensureDebugAgenticWorkflowPrompt ensures that .github/prompts/debug-agentic-workflow.prompt.md contains the debug workflow prompt +func ensureDebugAgenticWorkflowPrompt(verbose bool, skipInstructions bool) error { + // First, clean up the old agent file if it exists + if err := cleanupOldAgentFile("debug-agentic-workflow.md", verbose); err != nil { + return err + } -// ensureDebugAgenticWorkflowAgent ensures that .github/agents/debug-agentic-workflow.md contains the debug workflow agent -func ensureDebugAgenticWorkflowAgent(verbose bool, skipInstructions bool) error { - return ensureAgentFromTemplate("debug-agentic-workflow.md", debugAgenticWorkflowAgentTemplate, verbose, skipInstructions) + return ensurePromptFromTemplate("debug-agentic-workflow.prompt.md", debugAgenticWorkflowPromptTemplate, verbose, skipInstructions) } diff --git a/pkg/cli/init.go b/pkg/cli/init.go index 6d169c00ad..71526b3a2d 100644 --- a/pkg/cli/init.go +++ b/pkg/cli/init.go @@ -42,51 +42,44 @@ func InitRepository(verbose bool, mcp bool) error { fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created GitHub Copilot instructions")) } - // Remove old agentic workflow prompt if it exists - initLog.Print("Removing old agentic workflow prompt") + // Write agentic workflow prompt + initLog.Print("Writing agentic workflow prompt") if err := ensureAgenticWorkflowPrompt(verbose, false); err != nil { - initLog.Printf("Failed to remove old agentic workflow prompt: %v", err) - return fmt.Errorf("failed to remove old agentic workflow prompt: %w", err) - } - - // Write agentic workflow agent - initLog.Print("Writing agentic workflow agent") - if err := ensureAgenticWorkflowAgent(verbose, false); err != nil { - initLog.Printf("Failed to write agentic workflow agent: %v", err) - return fmt.Errorf("failed to write agentic workflow agent: %w", err) + initLog.Printf("Failed to write agentic workflow prompt: %v", err) + return fmt.Errorf("failed to write agentic workflow prompt: %w", err) } if verbose { - fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created custom agent for workflow creation")) + fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created prompt for workflow creation")) } - // Write shared agentic workflow agent - initLog.Print("Writing shared agentic workflow agent") - if err := ensureSharedAgenticWorkflowAgent(verbose, false); err != nil { - initLog.Printf("Failed to write shared agentic workflow agent: %v", err) - return fmt.Errorf("failed to write shared agentic workflow agent: %w", err) + // Write shared agentic workflow prompt + initLog.Print("Writing shared agentic workflow prompt") + if err := ensureSharedAgenticWorkflowPrompt(verbose, false); err != nil { + initLog.Printf("Failed to write shared agentic workflow prompt: %v", err) + return fmt.Errorf("failed to write shared agentic workflow prompt: %w", err) } if verbose { - fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created /create-shared-agentic-workflow agent")) + fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created /create-shared-agentic-workflow prompt")) } - // Write setup agentic workflows agent - initLog.Print("Writing setup agentic workflows agent") - if err := ensureSetupAgenticWorkflowsAgent(verbose, false); err != nil { - initLog.Printf("Failed to write setup agentic workflows agent: %v", err) - return fmt.Errorf("failed to write setup agentic workflows agent: %w", err) + // Write setup agentic workflows prompt + initLog.Print("Writing setup agentic workflows prompt") + if err := ensureSetupAgenticWorkflowsPrompt(verbose, false); err != nil { + initLog.Printf("Failed to write setup agentic workflows prompt: %v", err) + return fmt.Errorf("failed to write setup agentic workflows prompt: %w", err) } if verbose { - fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created setup agentic workflows agent")) + fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created setup agentic workflows prompt")) } - // Write debug agentic workflow agent - initLog.Print("Writing debug agentic workflow agent") - if err := ensureDebugAgenticWorkflowAgent(verbose, false); err != nil { - initLog.Printf("Failed to write debug agentic workflow agent: %v", err) - return fmt.Errorf("failed to write debug agentic workflow agent: %w", err) + // Write debug agentic workflow prompt + initLog.Print("Writing debug agentic workflow prompt") + if err := ensureDebugAgenticWorkflowPrompt(verbose, false); err != nil { + initLog.Printf("Failed to write debug agentic workflow prompt: %v", err) + return fmt.Errorf("failed to write debug agentic workflow prompt: %w", err) } if verbose { - fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created debug agentic workflow agent")) + fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Created debug agentic workflow prompt")) } // Configure MCP if requested @@ -122,7 +115,7 @@ func InitRepository(verbose bool, mcp bool) error { fmt.Fprintln(os.Stderr, console.FormatInfoMessage("✓ GitHub Copilot Agent MCP integration configured")) fmt.Fprintln(os.Stderr, "") } - fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Start Copilot, type /agent and select create-agentic-workflow")) + fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Start Copilot, type /create-agentic-workflow")) fmt.Fprintln(os.Stderr, "") fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Or add workflows from the catalog: "+constants.CLIExtensionPrefix+" add ")) fmt.Fprintln(os.Stderr, "") diff --git a/pkg/cli/init_command.go b/pkg/cli/init_command.go index 378cb110ce..313b1e981e 100644 --- a/pkg/cli/init_command.go +++ b/pkg/cli/init_command.go @@ -22,19 +22,19 @@ func NewInitCommand() *cobra.Command { This command: - Configures .gitattributes to mark .lock.yml files as generated - Creates GitHub Copilot custom instructions at .github/aw/github-agentic-workflows.md -- Creates the custom agent for workflow creation at .github/agents/create-agentic-workflow.md -- Creates the setup agentic workflows agent at .github/agents/setup-agentic-workflows.md -- Creates the debug agentic workflow agent at .github/agents/debug-agentic-workflow.md -- Removes the old /create-agentic-workflow prompt if it exists +- Creates the prompt for workflow creation at .github/prompts/create-agentic-workflow.prompt.md +- Creates the setup agentic workflows prompt at .github/prompts/setup-agentic-workflows.prompt.md +- Creates the debug agentic workflow prompt at .github/prompts/debug-agentic-workflow.prompt.md +- Removes old agent files from .github/agents/ if they exist With --mcp flag: - Creates .github/workflows/copilot-setup-steps.yml with gh-aw installation steps - Creates .vscode/mcp.json with gh-aw MCP server configuration After running this command, you can: -- Use GitHub Copilot Chat: type /agent and select create-agentic-workflow to create workflows interactively -- Use GitHub Copilot Chat: type /agent and select setup-agentic-workflows for setup guidance -- Use GitHub Copilot Chat: type /agent and select debug-agentic-workflow to debug existing workflows +- Use GitHub Copilot Chat: type /create-agentic-workflow to create workflows interactively +- Use GitHub Copilot Chat: type /setup-agentic-workflows for setup guidance +- Use GitHub Copilot Chat: type /debug-agentic-workflow to debug existing workflows - Add workflows from the catalog with: ` + constants.CLIExtensionPrefix + ` add - Create new workflows from scratch with: ` + constants.CLIExtensionPrefix + ` new diff --git a/pkg/cli/init_test.go b/pkg/cli/init_test.go index 653084e791..2a4f0b7ada 100644 --- a/pkg/cli/init_test.go +++ b/pkg/cli/init_test.go @@ -80,16 +80,16 @@ func TestInitRepository(t *testing.T) { t.Errorf("Expected copilot instructions file to exist") } - // Verify agentic workflow agent was created - agenticWorkflowAgentPath := filepath.Join(tempDir, ".github", "agents", "create-agentic-workflow.md") - if _, err := os.Stat(agenticWorkflowAgentPath); os.IsNotExist(err) { - t.Errorf("Expected agentic workflow agent file to exist") + // Verify agentic workflow prompt was created + agenticWorkflowPromptPath := filepath.Join(tempDir, ".github", "prompts", "create-agentic-workflow.prompt.md") + if _, err := os.Stat(agenticWorkflowPromptPath); os.IsNotExist(err) { + t.Errorf("Expected agentic workflow prompt file to exist") } - // Verify debug agentic workflow agent was created - debugAgenticWorkflowAgentPath := filepath.Join(tempDir, ".github", "agents", "debug-agentic-workflow.md") - if _, err := os.Stat(debugAgenticWorkflowAgentPath); os.IsNotExist(err) { - t.Errorf("Expected debug agentic workflow agent file to exist") + // Verify debug agentic workflow prompt was created + debugAgenticWorkflowPromptPath := filepath.Join(tempDir, ".github", "prompts", "debug-agentic-workflow.prompt.md") + if _, err := os.Stat(debugAgenticWorkflowPromptPath); os.IsNotExist(err) { + t.Errorf("Expected debug agentic workflow prompt file to exist") } // Verify .gitattributes contains the correct entry @@ -149,14 +149,14 @@ func TestInitRepository_Idempotent(t *testing.T) { t.Errorf("Expected copilot instructions file to exist after second call") } - agenticWorkflowAgentPath := filepath.Join(tempDir, ".github", "agents", "create-agentic-workflow.md") - if _, err := os.Stat(agenticWorkflowAgentPath); os.IsNotExist(err) { - t.Errorf("Expected agentic workflow agent file to exist after second call") + agenticWorkflowPromptPath := filepath.Join(tempDir, ".github", "prompts", "create-agentic-workflow.prompt.md") + if _, err := os.Stat(agenticWorkflowPromptPath); os.IsNotExist(err) { + t.Errorf("Expected agentic workflow prompt file to exist after second call") } - debugAgenticWorkflowAgentPath := filepath.Join(tempDir, ".github", "agents", "debug-agentic-workflow.md") - if _, err := os.Stat(debugAgenticWorkflowAgentPath); os.IsNotExist(err) { - t.Errorf("Expected debug agentic workflow agent file to exist after second call") + debugAgenticWorkflowPromptPath := filepath.Join(tempDir, ".github", "prompts", "debug-agentic-workflow.prompt.md") + if _, err := os.Stat(debugAgenticWorkflowPromptPath); os.IsNotExist(err) { + t.Errorf("Expected debug agentic workflow prompt file to exist after second call") } } diff --git a/pkg/cli/setup_agentic_workflows_agent_test.go b/pkg/cli/setup_agentic_workflows_agent_test.go index 136805b499..4864156c32 100644 --- a/pkg/cli/setup_agentic_workflows_agent_test.go +++ b/pkg/cli/setup_agentic_workflows_agent_test.go @@ -10,26 +10,26 @@ import ( "github.com/githubnext/gh-aw/pkg/testutil" ) -func TestEnsureSetupAgenticWorkflowsAgent(t *testing.T) { +func TestEnsureSetupAgenticWorkflowsPrompt(t *testing.T) { tests := []struct { name string existingContent string expectedContent string }{ { - name: "creates new setup agentic workflows agent file", + name: "creates new setup agentic workflows prompt file", existingContent: "", - expectedContent: strings.TrimSpace(setupAgenticWorkflowsAgentTemplate), + expectedContent: strings.TrimSpace(setupAgenticWorkflowsPromptTemplate), }, { name: "does not modify existing correct file", - existingContent: setupAgenticWorkflowsAgentTemplate, - expectedContent: strings.TrimSpace(setupAgenticWorkflowsAgentTemplate), + existingContent: setupAgenticWorkflowsPromptTemplate, + expectedContent: strings.TrimSpace(setupAgenticWorkflowsPromptTemplate), }, { name: "updates modified file", existingContent: "# Modified Setup\n\nThis is a modified version.", - expectedContent: strings.TrimSpace(setupAgenticWorkflowsAgentTemplate), + expectedContent: strings.TrimSpace(setupAgenticWorkflowsPromptTemplate), }, } @@ -53,34 +53,34 @@ func TestEnsureSetupAgenticWorkflowsAgent(t *testing.T) { t.Fatalf("Failed to init git repo: %v", err) } - agentsDir := filepath.Join(tempDir, ".github", "agents") - agentPath := filepath.Join(agentsDir, "setup-agentic-workflows.md") + promptsDir := filepath.Join(tempDir, ".github", "prompts") + promptPath := filepath.Join(promptsDir, "setup-agentic-workflows.prompt.md") // Create initial content if specified if tt.existingContent != "" { - if err := os.MkdirAll(agentsDir, 0755); err != nil { - t.Fatalf("Failed to create agents directory: %v", err) + if err := os.MkdirAll(promptsDir, 0755); err != nil { + t.Fatalf("Failed to create prompts directory: %v", err) } - if err := os.WriteFile(agentPath, []byte(tt.existingContent), 0644); err != nil { - t.Fatalf("Failed to create initial setup agent: %v", err) + if err := os.WriteFile(promptPath, []byte(tt.existingContent), 0644); err != nil { + t.Fatalf("Failed to create initial setup prompt: %v", err) } } // Call the function with skipInstructions=false to test the functionality - err = ensureSetupAgenticWorkflowsAgent(false, false) + err = ensureSetupAgenticWorkflowsPrompt(false, false) if err != nil { - t.Fatalf("ensureSetupAgenticWorkflowsAgent() returned error: %v", err) + t.Fatalf("ensureSetupAgenticWorkflowsPrompt() returned error: %v", err) } // Check that file exists - if _, err := os.Stat(agentPath); os.IsNotExist(err) { - t.Fatalf("Expected setup agentic workflows agent file to exist") + if _, err := os.Stat(promptPath); os.IsNotExist(err) { + t.Fatalf("Expected setup agentic workflows prompt file to exist") } // Check content - content, err := os.ReadFile(agentPath) + content, err := os.ReadFile(promptPath) if err != nil { - t.Fatalf("Failed to read setup agent: %v", err) + t.Fatalf("Failed to read setup prompt: %v", err) } contentStr := strings.TrimSpace(string(content)) @@ -95,7 +95,7 @@ func TestEnsureSetupAgenticWorkflowsAgent(t *testing.T) { } } -func TestEnsureSetupAgenticWorkflowsAgent_WithSkipInstructionsTrue(t *testing.T) { +func TestEnsureSetupAgenticWorkflowsPrompt_WithSkipInstructionsTrue(t *testing.T) { // Create a temporary directory for testing tempDir := testutil.TempDir(t, "test-*") @@ -114,22 +114,22 @@ func TestEnsureSetupAgenticWorkflowsAgent_WithSkipInstructionsTrue(t *testing.T) t.Fatalf("Failed to init git repo: %v", err) } - agentsDir := filepath.Join(tempDir, ".github", "agents") - agentPath := filepath.Join(agentsDir, "setup-agentic-workflows.md") + promptsDir := filepath.Join(tempDir, ".github", "prompts") + promptPath := filepath.Join(promptsDir, "setup-agentic-workflows.prompt.md") // Call the function with skipInstructions=true - err = ensureSetupAgenticWorkflowsAgent(false, true) + err = ensureSetupAgenticWorkflowsPrompt(false, true) if err != nil { - t.Fatalf("ensureSetupAgenticWorkflowsAgent() returned error: %v", err) + t.Fatalf("ensureSetupAgenticWorkflowsPrompt() returned error: %v", err) } // Check that file does not exist - if _, err := os.Stat(agentPath); !os.IsNotExist(err) { - t.Fatalf("Expected setup agent file to not exist when skipInstructions=true") + if _, err := os.Stat(promptPath); !os.IsNotExist(err) { + t.Fatalf("Expected setup prompt file to not exist when skipInstructions=true") } } -func TestSetupAgenticWorkflowsAgentContainsRequiredSections(t *testing.T) { +func TestSetupAgenticWorkflowsPromptContainsRequiredSections(t *testing.T) { // Verify the template contains all required sections requiredSections := []string{ "Configure Secrets for Your Chosen Agent", @@ -143,7 +143,7 @@ func TestSetupAgenticWorkflowsAgentContainsRequiredSections(t *testing.T) { "gh secret set", } - content := strings.TrimSpace(setupAgenticWorkflowsAgentTemplate) + content := strings.TrimSpace(setupAgenticWorkflowsPromptTemplate) for _, section := range requiredSections { if !strings.Contains(content, section) { @@ -152,14 +152,14 @@ func TestSetupAgenticWorkflowsAgentContainsRequiredSections(t *testing.T) { } } -func TestSetupAgenticWorkflowsAgentHasValidDocumentationLinks(t *testing.T) { +func TestSetupAgenticWorkflowsPromptHasValidDocumentationLinks(t *testing.T) { // Verify the template contains documentation links requiredLinks := []string{ "https://githubnext.github.io/gh-aw/reference/engines/", "https://github.com/settings/tokens", } - content := strings.TrimSpace(setupAgenticWorkflowsAgentTemplate) + content := strings.TrimSpace(setupAgenticWorkflowsPromptTemplate) for _, link := range requiredLinks { if !strings.Contains(content, link) { diff --git a/.github/agents/create-agentic-workflow.md b/pkg/cli/templates/create-agentic-workflow.prompt.md similarity index 99% rename from .github/agents/create-agentic-workflow.md rename to pkg/cli/templates/create-agentic-workflow.prompt.md index 3cebd6ef0f..018c059cc5 100644 --- a/.github/agents/create-agentic-workflow.md +++ b/pkg/cli/templates/create-agentic-workflow.prompt.md @@ -1,5 +1,5 @@ --- -name: create-agentic-workflow +mode: agent description: Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices. --- diff --git a/.github/agents/create-shared-agentic-workflow.md b/pkg/cli/templates/create-shared-agentic-workflow.prompt.md similarity index 99% rename from .github/agents/create-shared-agentic-workflow.md rename to pkg/cli/templates/create-shared-agentic-workflow.prompt.md index 9a8886b021..d9b2e0c0d5 100644 --- a/.github/agents/create-shared-agentic-workflow.md +++ b/pkg/cli/templates/create-shared-agentic-workflow.prompt.md @@ -1,4 +1,5 @@ --- +mode: agent name: create-shared-agentic-workflow description: Create shared agentic workflow components that wrap MCP servers using GitHub Agentic Workflows (gh-aw) with Docker best practices. --- diff --git a/pkg/cli/templates/debug-agentic-workflow.md b/pkg/cli/templates/debug-agentic-workflow.prompt.md similarity index 99% rename from pkg/cli/templates/debug-agentic-workflow.md rename to pkg/cli/templates/debug-agentic-workflow.prompt.md index 6809f27765..b23543f761 100644 --- a/pkg/cli/templates/debug-agentic-workflow.md +++ b/pkg/cli/templates/debug-agentic-workflow.prompt.md @@ -1,5 +1,5 @@ --- -name: debug-agentic-workflow +mode: agent description: Debug and refine agentic workflows using gh-aw CLI tools - analyze logs, audit runs, and improve workflow performance --- diff --git a/.github/agents/setup-agentic-workflows.md b/pkg/cli/templates/setup-agentic-workflows.prompt.md similarity index 88% rename from .github/agents/setup-agentic-workflows.md rename to pkg/cli/templates/setup-agentic-workflows.prompt.md index 9aa397a033..ba0d1bb5e8 100644 --- a/.github/agents/setup-agentic-workflows.md +++ b/pkg/cli/templates/setup-agentic-workflows.prompt.md @@ -1,5 +1,5 @@ --- -name: setup-agentic-workflows +mode: agent description: A guided agent to help you set up your agentic workflows using gh-aw --- @@ -89,15 +89,11 @@ gh secret set OPENAI_API_KEY -a actions --body "your-openai-api-key-here" Say to the user: ```` -When you're ready, use the custom agent to create your workflow: +When you're ready, use the prompt to create your workflow: -**Option 1: Direct invocation** +**Direct invocation** Type `/create-agentic-workflow` in the chat -**Option 2: Menu selection** -1. Type `/agent` in the chat -2. Select `create-agentic-workflow` from the list of available custom agents - -This will activate the workflow creation custom agent to help you create your first agentic workflow. +This will help you create your first agentic workflow. ````