Skip to content

Inject agentic-workflows MCP usage guide as a compiler-level builtin prompt#21117

Merged
pelikhan merged 3 commits intomainfrom
copilot/refactor-agentic-workflows-guide
Mar 15, 2026
Merged

Inject agentic-workflows MCP usage guide as a compiler-level builtin prompt#21117
pelikhan merged 3 commits intomainfrom
copilot/refactor-agentic-workflows-guide

Conversation

Copy link
Contributor

Copilot AI commented Mar 15, 2026

26 workflows using agentic-workflows: duplicate the same MCP usage warnings verbatim in their prompt bodies. Rather than a shared workflow component, this injects the guide automatically at compile time — zero workflow changes required.

Changes

  • actions/setup/md/agentic_workflows_guide.md — New runtime prompt file with the canonical MCP usage guide: critical gh aw direct-use warning, and parameter docs for status, logs, and audit tools
  • pkg/workflow/prompt_constants.go — Added agenticWorkflowsGuideFile constant
  • pkg/workflow/prompts.go — Added hasAgenticWorkflowsTool() helper, mirroring hasPlaywrightTool()
  • pkg/workflow/unified_prompt_step.go — New section 4 in collectPromptSections() injects the guide whenever agentic-workflows: is present in the tools config
  • Golden file + 173 lock files — Updated to reflect the new injected section

The guide is injected automatically — no workflow edits needed. Updates to the guide propagate to all 26+ affected workflows on next recompile.

Copilot AI and others added 2 commits March 15, 2026 19:27
)

- Add actions/setup/md/agentic_workflows_guide.md with MCP usage guidance
- Add agenticWorkflowsGuideFile constant in prompt_constants.go
- Add hasAgenticWorkflowsTool helper in prompts.go
- Inject guide in collectPromptSections when agentic-workflows tool is configured
- Update smoke-copilot golden file
- Add tests for inclusion/exclusion of the guide
- Recompile all 173 lock files

Co-authored-by: pelikhan <[email protected]>
@pelikhan pelikhan marked this pull request as ready for review March 15, 2026 20:47
Copilot AI review requested due to automatic review settings March 15, 2026 20:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Injects a canonical agentic-workflows MCP usage guide into the unified runtime prompt at compile time whenever the agentic-workflows tool is enabled, eliminating duplicated prompt text across workflows.

Changes:

  • Added a new runtime prompt file (agentic_workflows_guide.md) and wired it into prompt generation via a new constant and tool-detection helper.
  • Updated unified prompt section collection to inject the guide when agentic-workflows is enabled.
  • Updated golden output and regenerated affected .lock.yml workflows; added unit tests to verify inclusion/exclusion.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
actions/setup/md/agentic_workflows_guide.md Adds the canonical agentic-workflows MCP usage guide prompt content.
pkg/workflow/prompt_constants.go Adds a constant for the new guide prompt filename.
pkg/workflow/prompts.go Adds hasAgenticWorkflowsTool() helper for detecting tool enablement.
pkg/workflow/unified_prompt_step.go Injects the guide as a new prompt section when agentic-workflows is enabled.
pkg/workflow/prompts_test.go Adds tests verifying the guide is included/excluded based on tool configuration.
pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/smoke-copilot.golden Updates golden output to include the new prompt file concatenation.
.github/workflows/workflow-normalizer.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/static-analysis-report.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/smoke-copilot.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/smoke-copilot-arm.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/smoke-claude.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/security-review.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/safe-output-health.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/q.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/python-data-charts.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/prompt-clustering-analysis.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/portfolio-analyst.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/metrics-collector.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/mcp-inspector.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/example-workflow-analyzer.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/dev-hawk.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/deep-report.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/daily-safe-output-optimizer.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/daily-rendering-scripts-verifier.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/daily-observability-report.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/daily-firewall-report.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/daily-cli-tools-tester.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/cloclo.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/audit-workflows.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/agent-persona-explorer.lock.yml Regenerated to include concatenation of the new guide prompt file.
.github/workflows/agent-performance-analyzer.lock.yml Regenerated to include concatenation of the new guide prompt file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +4 to +13
**⚠️ CRITICAL**: The `status`, `logs`, `audit`, `list`, and `compile` operations are MCP server tools,
NOT shell commands. Do NOT run `gh aw` directly — it is not authenticated in this context.
Do not attempt to download or build the `gh aw` extension. If the MCP server fails, give up.
Call all operations as MCP tools with JSON parameters.

- Run the `status` tool to verify configuration and list all workflows
- Use the `logs` tool to download run logs (saves to `/tmp/gh-aw/aw-mcp/logs/`)
- Use the `audit` tool with a `run_id` to investigate specific runs
- Use the `list` tool to enumerate workflows in the repository

Comment on lines +20 to +22
- `count`: number of runs (default 30, max 5000)
- `start_date`: relative date, e.g. `-1d`, `-7d`, `-30d`
- `engine`: filter by AI engine (`copilot`, `claude`, `codex`)
Comment on lines +25 to +26
#### `audit` — Inspect a specific run
- `run_id`: GitHub Actions run ID (numeric)
@pelikhan
Copy link
Contributor

@copilot review comments, optimize prompt

Copy link
Contributor Author

Copilot AI commented Mar 15, 2026

@copilot review comments, optimize prompt

Fixed in f5cd100:

  • Removed the non-existent list tool reference (it's handled by status)
  • Fixed logs default count from 30 → 100, and added the missing params: end_date, branch, firewall/no_firewall, after_run_id/before_run_id
  • Changed audit parameter from run_id to run_id_or_url (accepts numeric ID, run URL, job URL, or job URL with step anchor)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw _test.go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw ,short (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .visibility (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from pelikhan March 15, 2026 21:04
@github-actions
Copy link
Contributor

Hey @Copilot 👋 — great work on the compiler-level injection of the agentic workflows MCP guide! Eliminating 26 instances of duplicated prompt boilerplate via a single compile-time mechanism is exactly the kind of DRY, systematic improvement this codebase benefits from.

This PR is well-structured, clearly described, focused on a single concern, and comes with both positive and negative test coverage (TestAgenticWorkflowsGuideIncludedWhenEnabled / TestAgenticWorkflowsGuideNotIncludedWhenDisabled). The pattern mirrors the existing hasPlaywrightTool() convention, which makes it easy for reviewers to verify correctness.

Checklist summary:

Check Result
On-topic ✅ Yes — core workflow compilation infrastructure
Follows process ✅ Yes — Copilot agent PR, core team (pelikhan) as assignee
Focused ✅ Yes — single coherent feature
New dependencies ✅ None added
Tests included ✅ Yes — 98 lines of new test coverage
PR description ✅ Yes — detailed breakdown of all changed files
Lines changed 191 (+185 / -6)

This PR looks ready for maintainer review. 🟢

Generated by Contribution Check ·

@github-actions github-actions bot added the lgtm label Mar 15, 2026
@pelikhan pelikhan merged commit 7b462bd into main Mar 15, 2026
53 checks passed
@pelikhan pelikhan deleted the copilot/refactor-agentic-workflows-guide branch March 15, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactoring] Extract Agentic Workflows MCP Tool Guide into shared component

3 participants