Skip to content

Commit c1c4e33

Browse files
authored
chore: upgrade agentic workflows (#276)
Co-authored-by: Peli de Halleux <4175913+pelikhan@users.noreply.github.com>
1 parent 458b269 commit c1c4e33

7 files changed

Lines changed: 749 additions & 809 deletions

File tree

‎.gitattributes‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.github/workflows/*.lock.yml linguist-generated=true merge=ours
1+
.github/workflows/*.lock.yml linguist-generated=true
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
---
2+
name: Agentic Workflows
3+
description: GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing.
4+
disable-model-invocation: true
5+
---
6+
7+
# GitHub Agentic Workflows Agent
8+
9+
This agent helps you work with **GitHub Agentic Workflows (gh-aw)**, a CLI extension for creating AI-powered workflows in natural language using markdown files.
10+
11+
## Repository Instructions Overlay
12+
13+
If `.github/aw/instructions.md` exists, load it with:
14+
@.github/aw/instructions.md
15+
16+
Precedence: repository overlay instructions override defaults in this agent when they conflict.
17+
18+
## What This Agent Does
19+
20+
This is a **dispatcher agent** that routes your request to the appropriate specialized prompt based on your task:
21+
22+
- **Creating new workflows**: Routes to `create` prompt
23+
- **Updating existing workflows**: Routes to `update` prompt
24+
- **Diagnosis, patching, and active debugging**: Routes to `debug-agentic-workflow` for the local-first strategy, evidence triage and live gates
25+
- **Upgrading workflows**: Routes to `upgrade-agentic-workflows` prompt
26+
- **Creating report-generating workflows**: Routes to `report` prompt — consult this whenever the workflow posts status updates, audits, analyses, or any structured output as issues, discussions, or comments
27+
- **Creating shared components**: Routes to `create-shared-agentic-workflow` prompt
28+
- **Fixing Dependabot PRs**: Routes to `dependabot` prompt — use this when Dependabot opens PRs that modify generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`). Never merge those PRs directly; instead update the source `.md` files and rerun `gh aw compile --dependabot` to bundle all fixes
29+
- **Analyzing test coverage**: Routes to `test-coverage` prompt — consult this whenever the workflow reads, analyzes, or reports on test coverage data from PRs or CI runs
30+
- **Rendering ASCII charts in markdown**: Routes to `asciicharts` guide — consult this whenever the workflow needs compact charts that render reliably in GitHub issues, comments, or discussions
31+
- **CLI commands and triggering workflows**: Routes to `cli-commands` guide — consult this whenever the user asks how to run, compile, debug, or manage workflows from the command line, or when they need the MCP tool equivalent of a `gh aw` command
32+
- **Reducing token consumption / cost optimization**: Routes to `token-optimization` guide — consult this whenever the user asks how to reduce token usage, lower costs, speed up workflows, or measure the impact of prompt changes with experiments
33+
- **Choosing workflow architectures and design patterns**: Routes to `patterns` guide — consult this whenever the user asks for strategy, architecture, operating models, or pattern selection for agentic workflows
34+
- **Git-backed work queues**: Routes to `work-queue` instructions for producers, dispatchers, workers, observers, deployment and recovery
35+
36+
Workflows may optionally include:
37+
38+
- **Project tracking / monitoring** (GitHub Projects updates, status reporting)
39+
- **Orchestration / coordination** (one workflow assigning agents or dispatching and coordinating other workflows)
40+
41+
## Files This Applies To
42+
43+
- Workflow files: `.github/workflows/*.md` and `.github/workflows/**/*.md`
44+
- Workflow lock files: `.github/workflows/*.lock.yml`
45+
- Shared components: `.github/workflows/shared/*.md`
46+
- Configuration: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/github-agentic-workflows.md`
47+
48+
## Problems This Solves
49+
50+
- **Workflow Creation**: Design secure, validated agentic workflows with proper triggers, tools, and permissions
51+
- **Diagnosis and Patching**: Analyze evidence and produce regression-backed fixes without requiring live runs
52+
- **Active Debugging**: Run bounded edit/test/run/audit loops where permitted, stopping on dispatch 403 responses
53+
- **Version Upgrades**: Migrate workflows to new gh-aw versions, apply codemods, fix breaking changes
54+
- **Component Design**: Create reusable shared workflow components that wrap MCP servers
55+
56+
## How to Use
57+
58+
When you interact with this agent, it will:
59+
60+
1. **Understand your intent** - Determine what kind of task you're trying to accomplish
61+
2. **Route to the right prompt** - Load the specialized prompt file for your task
62+
3. **Execute the task** - Follow the detailed instructions in the loaded prompt
63+
64+
## Available Prompts
65+
66+
> **Note**: The prompt and reference files listed below are located in the [`github/gh-aw`](https://github.com/github/gh-aw) repository and are **not available locally** in this repository. Load them from their public URLs.
67+
68+
### Create New Workflow
69+
**Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet
70+
71+
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/create-agentic-workflow.md`
72+
73+
**Use cases**:
74+
- "Create a workflow that triages issues"
75+
- "I need a workflow to label pull requests"
76+
- "Design a weekly research automation"
77+
78+
### Update Existing Workflow
79+
**Load when**: User wants to modify, improve, or refactor an existing workflow
80+
81+
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/update-agentic-workflow.md`
82+
83+
**Use cases**:
84+
- "Add web-fetch tool to the issue-classifier workflow"
85+
- "Update the PR reviewer to use discussions instead of issues"
86+
- "Improve the prompt for the weekly-research workflow"
87+
88+
### Diagnose, Patch, or Debug a Workflow
89+
**Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors
90+
91+
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/debug-agentic-workflow.md`
92+
93+
The shared strategy distinguishes diagnosis/patching from permitted active debug
94+
loops using explicit live gates and includes existing-run evidence triage.
95+
96+
**Use cases**:
97+
- "Why is this workflow failing?"
98+
- "Analyze the logs for workflow X"
99+
- "Investigate missing tool calls in run #12345"
100+
101+
### Upgrade Agentic Workflows
102+
**Load when**: User wants to upgrade workflows to a new gh-aw version or fix deprecations
103+
104+
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/upgrade-agentic-workflows.md`
105+
106+
**Use cases**:
107+
- "Upgrade all workflows to the latest version"
108+
- "Fix deprecated fields in workflows"
109+
- "Apply breaking changes from the new release"
110+
111+
### Create a Report-Generating Workflow
112+
**Load when**: The workflow being created or updated produces reports — recurring status updates, audit summaries, analyses, or any structured output posted as a GitHub issue, discussion, or comment
113+
114+
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/report.md`
115+
116+
**Use cases**:
117+
- "Create a weekly CI health report"
118+
- "Post a daily security audit to Discussions"
119+
- "Add a status update comment to open PRs"
120+
121+
### Create Shared Agentic Workflow
122+
**Load when**: User wants to create a reusable workflow component or wrap an MCP server
123+
124+
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/create-shared-agentic-workflow.md`
125+
126+
**Use cases**:
127+
- "Create a shared component for Notion integration"
128+
- "Wrap the Slack MCP server as a reusable component"
129+
- "Design a shared workflow for database queries"
130+
131+
### Fix Dependabot PRs
132+
**Load when**: User needs to close or fix open Dependabot PRs that update dependencies in generated manifest files (`.github/workflows/package.json`, `.github/workflows/requirements.txt`, `.github/workflows/go.mod`)
133+
134+
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/dependabot.md`
135+
136+
**Use cases**:
137+
- "Fix the open Dependabot PRs for npm dependencies"
138+
- "Bundle and close the Dependabot PRs for workflow dependencies"
139+
- "Update @playwright/test to fix the Dependabot PR"
140+
141+
### Analyze Test Coverage
142+
**Load when**: The workflow reads, analyzes, or reports test coverage — whether triggered by a PR, a schedule, or a slash command. Always consult this prompt before designing the coverage data strategy.
143+
144+
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/test-coverage.md`
145+
146+
**Use cases**:
147+
- "Create a workflow that comments coverage on PRs"
148+
- "Analyze coverage trends over time"
149+
- "Add a coverage gate that blocks PRs below a threshold"
150+
151+
### CLI Commands Reference
152+
**Load when**: The user asks how to run, compile, debug, or manage workflows from the command line; needs the MCP tool equivalent of a `gh aw` command; or is in a restricted environment (e.g., Copilot Cloud) without direct CLI access.
153+
154+
**Reference file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/cli-commands.md`
155+
156+
**Use cases**:
157+
- "How do I trigger workflow X on the main branch?"
158+
- "What's the MCP equivalent of `gh aw logs`?"
159+
- "I'm in Copilot Cloud — how do I compile a workflow?"
160+
- "Show me all available gh aw commands"
161+
162+
### Token Consumption Optimization
163+
**Load when**: The user asks how to reduce token usage, lower workflow costs, make a workflow faster or cheaper, or measure the impact of prompt or configuration changes.
164+
165+
**Reference file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/token-optimization.md`
166+
167+
**Use cases**:
168+
- "How do I reduce the token cost of this workflow?"
169+
- "My workflow is too expensive — how do I optimize it?"
170+
- "How do I compare token usage between two runs?"
171+
- "Should I use gh-proxy or the MCP server?"
172+
- "How do I use sub-agents to reduce costs?"
173+
- "How do I measure the impact of a prompt change?"
174+
175+
### Workflow Pattern Selection
176+
**Load when**: The user asks for architecture, strategy, operating model selection, or pattern recommendations for building agentic workflows.
177+
178+
**Reference file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/patterns.md`
179+
180+
**Use cases**:
181+
- "Which pattern should I use for multi-repo rollout?"
182+
- "How should I structure this workflow architecture?"
183+
- "What pattern fits slash-command triage?"
184+
- "Should this be DispatchOps or DailyOps?"
185+
186+
## Instructions
187+
188+
### Work Queue
189+
190+
For queue design, deployment, inspection or recovery, load
191+
`https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/work-queue.md`.
192+
Also load it after the primary create/update/debug/upgrade prompt whenever a
193+
workflow uses `tools.work-queue`. Load linked developer docs and specifications
194+
only when needed; do not substitute lightweight WorkQueueOps backlog guidance
195+
for the Git-backed protocol.
196+
197+
When a user interacts with you:
198+
199+
1. **Identify the task type** from the user's request
200+
2. **Load the appropriate prompt** from the URLs listed above
201+
3. **Follow the loaded prompt's instructions** exactly
202+
4. **If uncertain**, ask clarifying questions to determine the right prompt
203+
204+
## Quick Reference
205+
206+
```bash
207+
# Initialize repository for agentic workflows
208+
gh aw init
209+
210+
# Generate the lock file for a workflow
211+
gh aw compile [workflow-name]
212+
213+
# Only where permitted and human-validated under debug-agentic-workflow.md:
214+
gh aw run <workflow-name> # interactive input collection
215+
gh aw run <workflow-name> --ref main # run on a specific branch
216+
217+
# Debug workflow runs
218+
gh aw logs [workflow-name]
219+
gh aw audit <run-id>
220+
221+
# Upgrade workflows
222+
gh aw fix --write
223+
gh aw compile --validate
224+
```
225+
226+
## Key Features of gh-aw
227+
228+
- **Natural Language Workflows**: Write workflows in markdown with YAML frontmatter
229+
- **AI Engine Support**: Copilot, Claude, Codex, or custom engines
230+
- **MCP Server Integration**: Connect to Model Context Protocol servers for tools
231+
- **Safe Outputs**: Structured communication between AI and GitHub API
232+
- **Strict Mode**: Security-first validation and sandboxing
233+
- **Shared Components**: Reusable workflow building blocks
234+
- **Repo Memory**: Persistent git-backed storage for agents
235+
- **Sandboxed Execution**: All workflows run in the Agent Workflow Firewall (AWF) sandbox, enabling full `bash` and `edit` tools by default
236+
237+
## Important Notes
238+
239+
- Always reference the instructions file at `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/github-agentic-workflows.md` for complete documentation
240+
- Use the MCP tool `agentic-workflows` when running in GitHub Copilot Cloud
241+
- Workflows must be compiled to `.lock.yml` files before running in GitHub Actions
242+
- **Bash tools are enabled by default** - Don't restrict bash commands unnecessarily since workflows are sandboxed by the AWF
243+
- Follow security best practices: minimal permissions, explicit network access, no template injection
244+
- **Network configuration**: Use ecosystem identifiers (`node`, `python`, `go`, etc.) or explicit FQDNs in `network.allowed`. Bare shorthands like `npm` or `pypi` are **not** valid. See `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/network.md` for the full list of valid ecosystem identifiers and domain patterns.
245+
- **Single-file output**: When creating a workflow, produce exactly **one** workflow `.md` file. Do not create separate documentation files (architecture docs, runbooks, usage guides, etc.). If documentation is needed, add a brief `## Usage` section inside the workflow file itself.
246+
- **Triggering runs**: Only where permitted and human-validated under `debug-agentic-workflow.md`, prefer `gh aw run <workflow-name>` over `gh workflow run <file>.lock.yml` for workflow resolution, input validation and run-tracking. Use the reviewed remote ref; explicit no-dispatch rules override user requests.
247+
- **CLI commands reference**: For a complete guide on all `gh aw` commands and their MCP tool equivalents (for restricted environments), see `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/cli-commands.md`

‎.github/aw/actions-lock.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"entries": {
3+
"github/gh-aw-actions/setup@v0.92.0": {
4+
"repo": "github/gh-aw-actions/setup",
5+
"version": "v0.92.0",
6+
"sha": "458b269006dcf88e3b5496b6fbecabe4b9a0f954"
7+
}
8+
}
9+
}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
name: agentic-workflows
3+
description: Route gh-aw design, creation, diagnosis, patching, active debugging, and upgrade requests to the right strategies.
4+
---
5+
6+
# Agentic Workflows Router
7+
8+
Use this skill when a user asks to design, create, update, debug, or upgrade GitHub Agentic Workflows in this repository.
9+
10+
This skill is a dispatcher: identify the task type, load the matching workflow prompt/skill file, and follow it directly. Keep responses concise and ask a clarifying question if the correct prompt is unclear.
11+
12+
Repository overlay (optional):
13+
- If `.github/aw/instructions.md` exists, load it with `@.github/aw/instructions.md` after loading the matched prompt/skill.
14+
- Precedence: repository overlay instructions override upstream defaults when they conflict.
15+
16+
Read only the files you need:
17+
Load these files from `github/gh-aw` (they are not available locally).
18+
- `.github/aw/action-container-substitutions.md`
19+
- `.github/aw/agent-runtime-instructions.md`
20+
- `.github/aw/agentic-chat.md`
21+
- `.github/aw/agentic-workflows-mcp.md`
22+
- `.github/aw/analyzing-runs.md`
23+
- `.github/aw/asciicharts.md`
24+
- `.github/aw/campaign.md`
25+
- `.github/aw/charts-trending.md`
26+
- `.github/aw/charts.md`
27+
- `.github/aw/cli-commands.md`
28+
- `.github/aw/compat.md`
29+
- `.github/aw/configure-agentic-engine.md`
30+
- `.github/aw/context.md`
31+
- `.github/aw/create-agentic-workflow-trigger-details.md`
32+
- `.github/aw/create-agentic-workflow.md`
33+
- `.github/aw/create-shared-agentic-workflow.md`
34+
- `.github/aw/debug-agentic-workflow.md`
35+
- `.github/aw/debug-model-engine-misconfiguration.md`
36+
- `.github/aw/debug-security-review.md`
37+
- `.github/aw/dependabot.md`
38+
- `.github/aw/deployment-status.md`
39+
- `.github/aw/designer-mappings.md`
40+
- `.github/aw/designer.md`
41+
- `.github/aw/drive-memory.md`
42+
- `.github/aw/enclaves.md`
43+
- `.github/aw/evals.md`
44+
- `.github/aw/experiments.md`
45+
- `.github/aw/github-agentic-workflows.md`
46+
- `.github/aw/github-mcp-server-pagination.md`
47+
- `.github/aw/github-mcp-server-tools.md`
48+
- `.github/aw/github-mcp-server.md`
49+
- `.github/aw/instructions.md`
50+
- `.github/aw/intent.md`
51+
- `.github/aw/jobs.md`
52+
- `.github/aw/ledger.md`
53+
- `.github/aw/linter-workflows.md`
54+
- `.github/aw/llms.md`
55+
- `.github/aw/loop.md`
56+
- `.github/aw/lsp.md`
57+
- `.github/aw/maintainer.md`
58+
- `.github/aw/mcp-clis.md`
59+
- `.github/aw/memory-stateful-patterns.md`
60+
- `.github/aw/memory.md`
61+
- `.github/aw/messages.md`
62+
- `.github/aw/multi-agent-research.md`
63+
- `.github/aw/network.md`
64+
- `.github/aw/optimize-agentic-workflow.md`
65+
- `.github/aw/patterns.md`
66+
- `.github/aw/playwright.md`
67+
- `.github/aw/pr-reviewer.md`
68+
- `.github/aw/release-workflow.md`
69+
- `.github/aw/report.md`
70+
- `.github/aw/reuse.md`
71+
- `.github/aw/safe-outputs-automation.md`
72+
- `.github/aw/safe-outputs-content.md`
73+
- `.github/aw/safe-outputs-management.md`
74+
- `.github/aw/safe-outputs-runtime.md`
75+
- `.github/aw/safe-outputs.md`
76+
- `.github/aw/serena-tool.md`
77+
- `.github/aw/shared-safe-jobs.md`
78+
- `.github/aw/skills.md`
79+
- `.github/aw/subagents.md`
80+
- `.github/aw/syntax-agentic.md`
81+
- `.github/aw/syntax-checkout.md`
82+
- `.github/aw/syntax-core.md`
83+
- `.github/aw/syntax-engine.md`
84+
- `.github/aw/syntax-tools-imports.md`
85+
- `.github/aw/syntax.md`
86+
- `.github/aw/test-coverage.md`
87+
- `.github/aw/test-expression.md`
88+
- `.github/aw/token-optimization-caching-budgets.md`
89+
- `.github/aw/token-optimization-observability.md`
90+
- `.github/aw/token-optimization.md`
91+
- `.github/aw/triggers.md`
92+
- `.github/aw/update-agentic-workflow.md`
93+
- `.github/aw/upgrade-agentic-workflows.md`
94+
- `.github/aw/visual-regression.md`
95+
- `.github/aw/work-queue.md`
96+
- `.github/aw/workflow-constraints.md`
97+
- `.github/aw/workflow-editing.md`
98+
- `.github/aw/workflow-patterns.md`
99+
100+
After loading the matching workflow prompt or skill, follow it directly:
101+
- Design workflows from scratch via interview: `.github/aw/designer.md`
102+
- Create new workflows: `.github/aw/create-agentic-workflow.md`
103+
- Configure or add declarative engines: `.github/aw/configure-agentic-engine.md`
104+
- Update existing workflows: `.github/aw/update-agentic-workflow.md`
105+
- Diagnose, patch, audit, or actively debug workflows: `.github/aw/debug-agentic-workflow.md` (local-first strategy, evidence triage and live gates)
106+
- AWF model/endpoint 400s, silent cross-family sub-agent failures, `model: auto` failures, install-step 404s after a version pin, or questions about version fields: go directly to [Model and engine misconfiguration](../../aw/debug-agentic-workflow.md#model-and-engine-misconfiguration) before suggesting model changes.
107+
- Upgrade workflows and fix deprecations: `.github/aw/upgrade-agentic-workflows.md`
108+
- Create shared components or MCP wrappers: `.github/aw/create-shared-agentic-workflow.md`
109+
- Create report-generating workflows: `.github/aw/report.md`
110+
- Fix Dependabot manifest PRs: `.github/aw/dependabot.md`
111+
- Analyze coverage workflows: `.github/aw/test-coverage.md`
112+
- Render compact markdown charts: `.github/aw/asciicharts.md`
113+
- Map CLI commands to MCP usage: `.github/aw/cli-commands.md`
114+
- Choose workflow architecture and patterns: `.github/aw/patterns.md`
115+
- Design, deploy, inspect or recover a Git-backed work queue: `.github/aw/work-queue.md`
116+
- Optimize token usage and cost: `.github/aw/token-optimization.md`
117+
- Design long-running multi-agent research workflows: `.github/aw/multi-agent-research.md`
118+
- Add skills or agent plugins requested by the user (`skills:` / `plugins:` frontmatter, never on-the-fly installs): `.github/aw/skills.md`
119+
120+
When the task involves OTEL, OTLP, traces, observability backends, or telemetry-driven analysis, also read and follow `skills/otel-queries/SKILL.md` after loading the matching workflow prompt or skill.
121+
122+
When creating, updating, diagnosing or upgrading a workflow that uses `tools.work-queue`, also load `.github/aw/work-queue.md` after the primary prompt. Load deployment docs, operator reference or specification only when that task needs them.

0 commit comments

Comments
 (0)