You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/agents/agentic-workflows.agent.md
+52-17Lines changed: 52 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,10 @@ This is a **dispatcher agent** that routes your request to the appropriate speci
19
19
-**Creating shared components**: Routes to `create-shared-agentic-workflow` prompt
20
20
-**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
21
21
-**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
22
+
-**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
22
23
-**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
24
+
-**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
25
+
-**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
23
26
24
27
Workflows may optionally include:
25
28
@@ -31,7 +34,7 @@ Workflows may optionally include:
31
34
- Workflow files: `.github/workflows/*.md` and `.github/workflows/**/*.md`
@@ -102,7 +105,7 @@ When you interact with this agent, it will:
102
105
103
106
**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
@@ -126,7 +129,7 @@ When you interact with this agent, it will:
126
129
127
130
**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`)
@@ -138,7 +141,7 @@ When you interact with this agent, it will:
138
141
139
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.
@@ -150,7 +153,7 @@ When you interact with this agent, it will:
150
153
151
154
**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.
@@ -159,12 +162,40 @@ When you interact with this agent, it will:
159
162
- "I'm in Copilot Cloud — how do I compile a workflow?"
160
163
- "Show me all available gh aw commands"
161
164
165
+
### Token Consumption Optimization
166
+
167
+
**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.
- "How do I reduce the token cost of this workflow?"
174
+
- "My workflow is too expensive — how do I optimize it?"
175
+
- "How do I compare token usage between two runs?"
176
+
- "Should I use gh-proxy or the MCP server?"
177
+
- "How do I use sub-agents to reduce costs?"
178
+
- "How do I measure the impact of a prompt change?"
179
+
180
+
### Workflow Pattern Selection
181
+
182
+
**Load when**: The user asks for architecture, strategy, operating model selection, or pattern recommendations for building agentic workflows.
183
+
184
+
**Reference file**: `.github/aw/patterns.md`
185
+
186
+
**Use cases**:
187
+
188
+
- "Which pattern should I use for multi-repo rollout?"
189
+
- "How should I structure this workflow architecture?"
190
+
- "What pattern fits slash-command triage?"
191
+
- "Should this be DispatchOps or DailyOps?"
192
+
162
193
## Instructions
163
194
164
195
When a user interacts with you:
165
196
166
197
1.**Identify the task type** from the user's request
167
-
2.**Load the appropriate prompt** from the GitHub repository URLs listed above
198
+
2.**Load the appropriate prompt** from the repository paths listed above
168
199
3.**Follow the loaded prompt's instructions** exactly
169
200
4.**If uncertain**, ask clarifying questions to determine the right prompt
170
201
@@ -203,36 +234,40 @@ gh aw compile --validate
203
234
204
235
## Important Notes
205
236
206
-
- Always reference the instructions file at [github-agentic-workflows.md](https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/github-agentic-workflows.md) for complete documentation
237
+
- Always reference the instructions file at `.github/aw/github-agentic-workflows.md` for complete documentation
207
238
- Use the MCP tool `agentic-workflows` when running in GitHub Copilot Cloud
208
239
- Workflows must be compiled to `.lock.yml` files before running in GitHub Actions
209
240
-**Bash tools are enabled by default** - Don't restrict bash commands unnecessarily since workflows are sandboxed by the AWF
210
241
- Follow security best practices: minimal permissions, explicit network access, no template injection
211
-
-**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 [network.md](https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/network.md) for the full list of valid ecosystem identifiers and domain patterns.
242
+
-**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 `.github/aw/network.md` for the full list of valid ecosystem identifiers and domain patterns.
212
243
-**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.
213
244
-**Triggering runs**: Always use `gh aw run <workflow-name>` to trigger a workflow on demand — not `gh workflow run <file>.lock.yml`. `gh aw run` handles workflow resolution by short name, input parsing and validation, and correct run-tracking for agentic workflows. Use `--ref <branch>` to run on a specific branch.
214
-
-**CLI commands reference**: For a complete guide on all `gh aw` commands and their MCP tool equivalents (for restricted environments), see [cli-commands.md](https://github.com/github/gh-aw/blob/v0.71.5/.github/aw/cli-commands.md)
245
+
-**CLI commands reference**: For a complete guide on all `gh aw` commands and their MCP tool equivalents (for restricted environments), see `.github/aw/cli-commands.md`
215
246
-**Repository-specific requirements**: There are multiple sets of repository-specific instructions below that must be respected. They affect workflow authoring, updates, compilation, and reviews.
216
247
217
248
## Repository-Specific Requirements: Copilot PAT Pool
218
249
219
-
**⚠️ MANDATORY**: Every agentic workflow in this repository **must** utilize the Copilot PAT Pool as detailed in `.github/workflows/shared/pat_pool.README.md`. This mechanism selects a random Copilot PAT from a numbered pool of secrets to avoid rate-limiting from a single shared PAT.
250
+
**⚠️ MANDATORY**: Every agentic workflow in this repository **must** utilize the Copilot PAT Pool in the `copilot-pat-pool` environment as detailed in `.github/workflows/shared/pat_pool.README.md`. This mechanism selects a random Copilot PAT from a numbered pool of environment secrets to avoid rate-limiting from a single shared PAT, while preventing agentic workflows from having access to secrets from other environments.
220
251
221
252
When **creating** or **updating** an agentic workflow, always include the following frontmatter that integrates the PAT pool. This should be used verbatim when first added.
When the workflow is being updated by hand, the `engine.env.COPILOT_GITHUB_TOKEN` may be reformatted to use a multi-line YAML string for the expression if desired for improved readability.
@@ -266,4 +301,4 @@ Arrange top-level frontmatter keys in this order within the `---` markers:
The PAT pool integration naturally falls into the **Execution** group at the bottom. Keep the PAT pool content together as the last items in the frontmatter.
304
+
The PAT pool integration naturally falls into the **Execution** group at the bottom, including the `environment` property that defines the _execution environment_ for the agentic job. Keep the PAT pool content together as the last items in the frontmatter.
0 commit comments