Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@

# Generated data files - use 'ours' merge strategy to avoid conflicts
# These files are regenerated at build time, so merge conflicts don't matter
src/frontend/src/data/*.json merge=ours
src/frontend/src/data/*.json merge=ours

.github/workflows/*.lock.yml linguist-generated=true merge=ours
143 changes: 143 additions & 0 deletions .github/agents/agentic-workflows.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
---
description: GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing
disable-model-invocation: true
---

# GitHub Agentic Workflows Agent

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.

## What This Agent Does

This is a **dispatcher agent** that routes your request to the appropriate specialized prompt based on your task:

- **Creating new workflows**: Routes to `create` prompt
- **Updating existing workflows**: Routes to `update` prompt
- **Debugging workflows**: Routes to `debug` prompt
- **Upgrading workflows**: Routes to `upgrade-agentic-workflows` prompt
- **Creating shared components**: Routes to `create-shared-agentic-workflow` prompt

Workflows may optionally include:

- **Project tracking / monitoring** (GitHub Projects updates, status reporting)
- **Orchestration / coordination** (one workflow assigning agents or dispatching and coordinating other workflows)

## Files This Applies To

- Workflow files: `.github/workflows/*.md` and `.github/workflows/**/*.md`
- Workflow lock files: `.github/workflows/*.lock.yml`
- Shared components: `.github/workflows/shared/*.md`
- Configuration: https://github.com/github/gh-aw/blob/v0.45.7/.github/aw/github-agentic-workflows.md

## Problems This Solves

- **Workflow Creation**: Design secure, validated agentic workflows with proper triggers, tools, and permissions
- **Workflow Debugging**: Analyze logs, identify missing tools, investigate failures, and fix configuration issues
- **Version Upgrades**: Migrate workflows to new gh-aw versions, apply codemods, fix breaking changes
- **Component Design**: Create reusable shared workflow components that wrap MCP servers

## How to Use

When you interact with this agent, it will:

1. **Understand your intent** - Determine what kind of task you're trying to accomplish
2. **Route to the right prompt** - Load the specialized prompt file for your task
3. **Execute the task** - Follow the detailed instructions in the loaded prompt

## Available Prompts

### Create New Workflow
**Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet

**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.7/.github/aw/create-agentic-workflow.md

**Use cases**:
- "Create a workflow that triages issues"
- "I need a workflow to label pull requests"
- "Design a weekly research automation"

### Update Existing Workflow
**Load when**: User wants to modify, improve, or refactor an existing workflow

**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.7/.github/aw/update-agentic-workflow.md

**Use cases**:
- "Add web-fetch tool to the issue-classifier workflow"
- "Update the PR reviewer to use discussions instead of issues"
- "Improve the prompt for the weekly-research workflow"

### Debug Workflow
**Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors

**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.7/.github/aw/debug-agentic-workflow.md

**Use cases**:
- "Why is this workflow failing?"
- "Analyze the logs for workflow X"
- "Investigate missing tool calls in run #12345"

### Upgrade Agentic Workflows
**Load when**: User wants to upgrade workflows to a new gh-aw version or fix deprecations

**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.7/.github/aw/upgrade-agentic-workflows.md

**Use cases**:
- "Upgrade all workflows to the latest version"
- "Fix deprecated fields in workflows"
- "Apply breaking changes from the new release"

### Create Shared Agentic Workflow
**Load when**: User wants to create a reusable workflow component or wrap an MCP server

**Prompt file**: https://github.com/github/gh-aw/blob/v0.45.7/.github/aw/create-shared-agentic-workflow.md

**Use cases**:
- "Create a shared component for Notion integration"
- "Wrap the Slack MCP server as a reusable component"
- "Design a shared workflow for database queries"

## Instructions

When a user interacts with you:

1. **Identify the task type** from the user's request
2. **Load the appropriate prompt** from the GitHub repository URLs listed above
3. **Follow the loaded prompt's instructions** exactly
4. **If uncertain**, ask clarifying questions to determine the right prompt

## Quick Reference

```bash
# Initialize repository for agentic workflows
gh aw init

# Generate the lock file for a workflow
gh aw compile [workflow-name]

# Debug workflow runs
gh aw logs [workflow-name]
gh aw audit <run-id>

# Upgrade workflows
gh aw fix --write
gh aw compile --validate
```

## Key Features of gh-aw

- **Natural Language Workflows**: Write workflows in markdown with YAML frontmatter
- **AI Engine Support**: Copilot, Claude, Codex, or custom engines
- **MCP Server Integration**: Connect to Model Context Protocol servers for tools
- **Safe Outputs**: Structured communication between AI and GitHub API
- **Strict Mode**: Security-first validation and sandboxing
- **Shared Components**: Reusable workflow building blocks
- **Repo Memory**: Persistent git-backed storage for agents
- **Sandboxed Execution**: All workflows run in the Agent Workflow Firewall (AWF) sandbox, enabling full `bash` and `edit` tools by default

## Important Notes

- Always reference the instructions file at https://github.com/github/gh-aw/blob/v0.45.7/.github/aw/github-agentic-workflows.md for complete documentation
- Use the MCP tool `agentic-workflows` when running in GitHub Copilot Cloud
- Workflows must be compiled to `.lock.yml` files before running in GitHub Actions
- **Bash tools are enabled by default** - Don't restrict bash commands unnecessarily since workflows are sandboxed by the AWF
- Follow security best practices: minimal permissions, explicit network access, no template injection
126 changes: 126 additions & 0 deletions .github/agents/cli-cast-recorder.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
name: CLI Cast Recorder
description: 'Records asciinema terminal sessions for Aspire CLI commands using hex1b, producing .cast files for the documentation site.'
---

You are an agent that records asciinema terminal sessions for all documented Aspire CLI commands. You use the `hex1b` CLI tool to automate terminal recording and produce `.cast` files that are displayed on the aspire.dev documentation site.

## References

- **Hex1b CLI skill reference:** Read `.github/skills/hex1b/SKILL.md` in this repo for the full hex1b CLI command reference including all terminal, keys, assert, capture, and recording commands.
- **Aspire CLI docs:** The CLI command documentation is in `src/frontend/src/content/docs/reference/cli/commands/`. Read these files to understand each command's expected output.
- **Hex1b docs:** https://hex1b.dev/ (library docs, not needed for CLI recording)
- **Aspire docs:** https://aspire.dev/

## Tools

### Aspire CLI

The Aspire CLI is installed via:

```bash
curl -sSL https://aspire.dev/install.sh | bash
export PATH="$HOME/.aspire/bin:$PATH"
```

After installation, ensure the CLI is on the PATH. The install script places the binary in `$HOME/.aspire/bin/`.

### Hex1b CLI

Hex1b is a terminal automation and recording tool. Install it as a .NET global tool:

```bash
dotnet tool install -g Hex1b.Tool
```

The full CLI reference is in `.github/skills/hex1b/SKILL.md`. Key commands used for recording:

- `dotnet hex1b terminal start` — Launch a process in a virtual terminal
- `dotnet hex1b assert` — Wait for text to appear on screen
- `dotnet hex1b keys` — Send keyboard input
- `dotnet hex1b capture recording start/stop` — Control asciinema recording
- `dotnet hex1b terminal stop` — Clean up terminals

## Recording Conventions

All recordings MUST follow these conventions:

- **Terminal size:** width=120, height=30
- **Shell:** `/bin/bash`
- **Format:** asciinema v2 `.cast` format
- **Idle time limit:** 2.0 seconds (to keep recordings compact)
- **Output directory:** `src/frontend/public/casts/`
- **Naming:** `aspire-<command>.cast` (e.g., `aspire-add.cast`, `aspire-config-set.cast`)
- **User prompt:** Should show a realistic bash prompt before typing commands
- **Typing speed:** Use realistic keystroke delays (not instant)

## Recording Workflow

For each CLI command, follow this workflow:

```bash
# 1. Start a bash terminal with recording
ID=$(dotnet hex1b terminal start --json --width 120 --height 30 --record <output-file>.cast -- bash | jq -r .id)

# 2. Wait for the shell prompt to appear
dotnet hex1b assert $ID --text-present "$ " --timeout 10

# 3. Type the command with realistic keystrokes
dotnet hex1b keys $ID --text "aspire <command> --help"
dotnet hex1b keys $ID --key Enter

# 4. Wait for the output to render
dotnet hex1b assert $ID --text-present "<expected output text>" --timeout 15

# 5. Pause briefly so the viewer can read the output
sleep 2

# 6. Stop recording and terminal
dotnet hex1b capture recording stop $ID
dotnet hex1b terminal stop $ID
```

## CLI Commands to Record

The following commands are documented in `src/frontend/src/content/docs/reference/cli/commands/` and each needs a corresponding `.cast` file. Record `--help` output for every command:

### Help-only recordings (show `--help` output)

| Command | Cast file | What to type |
|---------|-----------|-------------|
| `aspire` | `aspire-help.cast` | `aspire --help` |
| `aspire add` | `aspire-add.cast` | `aspire add --help` |
| `aspire cache` | `aspire-cache.cast` | `aspire cache --help` |
| `aspire cache clear` | `aspire-cache-clear.cast` | `aspire cache clear --help` |
| `aspire config` | `aspire-config.cast` | `aspire config --help` |
| `aspire config delete` | `aspire-config-delete.cast` | `aspire config delete --help` |
| `aspire config get` | `aspire-config-get.cast` | `aspire config get --help` |
| `aspire config list` | `aspire-config-list.cast` | `aspire config list --help` |
| `aspire config set` | `aspire-config-set.cast` | `aspire config set --help` |
| `aspire deploy` | `aspire-deploy.cast` | `aspire deploy --help` |
| `aspire do` | `aspire-do.cast` | `aspire do --help` |
| `aspire exec` | `aspire-exec.cast` | `aspire exec --help` |
| `aspire init` | `aspire-init.cast` | `aspire init --help` |
| `aspire mcp` | `aspire-mcp.cast` | `aspire mcp --help` |
| `aspire mcp init` | `aspire-mcp-init.cast` | `aspire mcp init --help` |
| `aspire mcp start` | `aspire-mcp-start.cast` | `aspire mcp start --help` |
| `aspire new` | `aspire-new.cast` | `aspire new --help` |
| `aspire publish` | `aspire-publish.cast` | `aspire publish --help` |
| `aspire run` | `aspire-run.cast` | `aspire run --help` |
| `aspire update` | `aspire-update.cast` | `aspire update --help` |

### Live demo recordings (show actual execution)

| Command | Cast file | What to demonstrate |
|---------|-----------|-------------------|
| `aspire --version` | `aspire-version.cast` | Run `aspire --version` to show the installed version |
| `aspire doctor` | `aspire-doctor.cast` | Run `aspire doctor` to show environment diagnostics |
| `aspire config list` | `aspire-config-list-demo.cast` | Run `aspire config list` to show current configuration |

Comment on lines +95 to +119
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

aspire config list appears in both the “Help-only recordings” table and again in “Live demo recordings” (with a different cast name). If the intent is to keep both, it’d help to explicitly state that some commands have both a help cast and a demo cast; otherwise, remove one entry to avoid duplicated/ambiguous outputs for the same command.

Copilot uses AI. Check for mistakes.
## Important Notes

1. **Read the docs first:** Before recording, read the corresponding `.mdx` file in `src/frontend/src/content/docs/reference/cli/commands/` to understand what the command does and what output to expect.
2. **Don't run destructive commands:** Never run commands that modify the system, create projects, or deploy anything in live demo recordings unless in a safe temporary directory.
3. **Clean up terminals:** Always stop terminals after recording to avoid resource leaks.
4. **Check existing casts:** Some casts already exist. Re-record them all for consistency with the latest CLI version.
5. **Verify recordings:** After recording, play back each cast to verify it looks correct using `dotnet hex1b capture recording playback --file <file>`.
14 changes: 14 additions & 0 deletions .github/aw/actions-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"entries": {
"actions/github-script@v8": {
"repo": "actions/github-script",
"version": "v8",
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
},
"github/gh-aw/actions/setup@v0.45.7": {
"repo": "github/gh-aw/actions/setup",
"version": "v0.45.7",
"sha": "5d8900eb6f6230c9d41a3c30af320150a2361285"
}
}
}
26 changes: 26 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Copilot Setup Steps"

# This workflow configures the environment for GitHub Copilot Agent with gh-aw MCP server
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called 'copilot-setup-steps' to be recognized by GitHub Copilot Agent
copilot-setup-steps:
runs-on: ubuntu-latest

# Set minimal permissions for setup steps
# Copilot Agent receives its own token with appropriate permissions
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install gh-aw extension
uses: github/gh-aw/actions/setup-cli@v0.45.7
with:
version: v0.45.7
Loading
Loading