Skip to content

Commit 92cce15

Browse files
authored
Merge pull request #2873 from JoeStech/actions-agent
Github custom agent info and prompt file differentiation
2 parents 5400cac + 7c7dd19 commit 92cce15

2 files changed

Lines changed: 46 additions & 7 deletions

File tree

content/learning-paths/servers-and-cloud-computing/arm-mcp-server/3-simd-migration.md

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ layout: learningpathall
99

1010
{{% notice Note %}} This section uses Visual Studio Code with GitHub Copilot. If you're using a different AI assistant, skip to the next section, where you'll configure the same migration workflow using other agentic systems.{{% /notice %}}
1111

12-
When migrating applications from x86 to Arm, you might encounter SIMD (Single Instruction, Multiple Data) code that is written using architecture-specific intrinsics. On x86 platforms, SIMD is commonly implemented with SSE, AVX, or AVX2 intrinsics, while Arm platforms use NEON and SVE intrinsics to provide similar vectorized capabilities. Updating this code manually can be time-consuming and challenging. By combining the Arm MCP Server with a well-defined prompt file, you can create an Arm Cloud Migration Agent in GitHub Copilot that automates much of this work and guides the AI assistant through a structured, architecture-aware migration of your codebase.
12+
When migrating applications from x86 to Arm, you might encounter SIMD (Single Instruction, Multiple Data) code that is written using architecture-specific intrinsics. On x86 platforms, SIMD is commonly implemented with SSE, AVX, or AVX2 intrinsics, while Arm platforms use NEON and SVE intrinsics to provide similar vectorized capabilities. Updating this code manually can be time-consuming and challenging. By combining the Arm MCP Server with GitHub Copilot, you can create an Arm Cloud Migration Agent that automates much of this work and guides the AI assistant through a structured, architecture-aware migration of your codebase. GitHub Copilot supports two file formats for this: **prompt files** (`.prompt.md`) that reference an already-configured MCP server, and **agent files** (`.agent.md`) that create agents which can be assigned to issues directly in the GitHub interface.
1313

14-
This section walks through creating the agent prompt file and using it to migrate a sample x86 application with AVX2 SIMD code to Arm NEON.
14+
This section walks through both approaches and uses them to migrate a sample x86 application with AVX2 SIMD code to Arm NEON.
1515

1616
## Sample x86 code with AVX2 intrinsics
1717

@@ -175,9 +175,18 @@ int main() {
175175
}
176176
```
177177

178-
## The Arm migration prompt file
178+
## Prompt files vs. agent files
179179

180-
To automate migration, you can define a prompt file that instructs the AI assistant how to analyze and transform the project using the Arm MCP Server. Prompt files act as executable migration playbooks. They encode best practices, tool usage, and migration strategy, allowing the AI assistant to operate fully autonomously through complex multi-step workflows.
180+
GitHub Copilot provides two ways to package persistent instructions for the AI assistant:
181+
182+
- **Prompt files** (`.prompt.md`) are stored in `.github/prompts/` and reference MCP server tools that you have already configured in your IDE. They are invoked with a slash command such as `/arm-migration`.
183+
- **Agent files** (`.agent.md`) are stored in `.github/agents/` (or `~/.github/agents/` for global access) and create agents that can be assigned to issues directly in the GitHub interface. They are selected from the agent dropdown in the Copilot Chat window or when assigning an agent to an issue.
184+
185+
Both formats encode the same migration logic. Choose whichever fits your workflow.
186+
187+
## Option 1: Prompt file
188+
189+
A prompt file instructs the AI assistant how to analyze and transform the project using the Arm MCP Server. Prompt files act as executable migration playbooks. They encode best practices, tool usage, and migration strategy, allowing the AI assistant to operate fully autonomously through complex multi-step workflows.
181190

182191
Create the following prompt file at `.github/prompts/arm-migration.prompt.md`:
183192
```markdown
@@ -208,15 +217,45 @@ If you have good versions to update for the Dockerfile, requirements.txt, and ot
208217

209218
Provide a summary of the changes you made and how they'll improve the project.
210219
```
211-
This prompt file encodes best practices, tool usage, and migration strategy, allowing the AI assistant to operate fully agentically.
220+
This prompt file requires the Arm MCP Server to be configured in your IDE settings before use.
221+
222+
## Option 2: Agent file
223+
224+
An agent file creates an agent that can be assigned to issues directly in the GitHub interface. You can download the Arm Cloud Migration Agent file directly:
225+
226+
```bash
227+
wget https://raw.githubusercontent.com/github/awesome-copilot/refs/heads/main/agents/arm-migration.agent.md
228+
```
229+
230+
To make the agent available across all your projects, place it in the global GitHub agents directory:
231+
232+
```bash
233+
mkdir -p ~/.github/agents
234+
mv arm-migration.agent.md ~/.github/agents/
235+
```
236+
237+
{{% notice Note %}}
238+
If you prefer to scope the agent to a single repository, place the file in the `.github/agents/` directory at the root of that repository instead:
239+
```bash
240+
mkdir -p .github/agents
241+
mv arm-migration.agent.md .github/agents/
242+
```
243+
{{% /notice %}}
212244

213245
## Running the migration
214246

215-
With the prompt file in place and the Arm MCP Server connected, invoke the migration workflow from your AI assistant:
247+
With either the prompt file or agent file in place, invoke the migration workflow from GitHub Copilot chat.
248+
249+
If you're using the **prompt file**, type:
216250

217251
```text
218252
/arm-migration
219253
```
254+
255+
If you're using the **agent file**, select the `arm-migration-agent` from the agent dropdown in the Copilot Chat window, or assign it to an issue on GitHub.com using the agents panel dropdown.
256+
257+
![Selecting a custom agent from the dropdown in VS Code](select-custom-agent-vscode.png)
258+
220259
The assistant will:
221260
* Detect x86-specific intrinsics
222261
* Rewrite SIMD code using NEON
@@ -249,6 +288,6 @@ If compilation or runtime issues occur, feed the errors back to the AI assistant
249288

250289
## What you've accomplished and what's next
251290

252-
In this section, you've created an Arm Cloud Migration Agent in GitHub Copilot using a prompt file and used it to perform a fully automated migration of x86 AVX2 SIMD code to Arm NEON. You've seen how structured instructions enable the assistant to analyze, transform, and verify architecture-specific code.
291+
In this section, you've created an Arm Cloud Migration Agent in GitHub Copilot using either a prompt file or an agent file that can be assigned to issues in the GitHub interface, and used it to perform a fully automated migration of x86 AVX2 SIMD code to Arm NEON. You've seen how structured instructions enable the assistant to analyze, transform, and verify architecture-specific code.
253292

254293
In the next section, you'll learn how to configure other agentic AI systems with the same migration workflow.
58.9 KB
Loading

0 commit comments

Comments
 (0)