Skip to content

Commit acbd759

Browse files
authored
Merge pull request #6388 from chrisdMSFT/local-coding-plugin-0.3.2
Add local-coding plugin: on-device offload to MAI Code 1.1 Flash for Copilot CLI 🤖
2 parents 6e4f57d + aa6878b commit acbd759

11 files changed

Lines changed: 840 additions & 0 deletions

File tree

‎.github/plugin/marketplace.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,12 @@
18531853
"sha": "940979bf3d82be136c4529a0b08aee7198ef178f"
18541854
}
18551855
},
1856+
{
1857+
"name": "local-coding",
1858+
"source": "plugins/local-coding",
1859+
"description": "Experimental. Hand large, mechanical sub-tasks (big reads, log and test triage, and the same edit across many files) from a cloud Copilot CLI session to the on-device MAI Code 1.1 Flash model on Windows, through an offload agent (the main session checks every DONE reply) or the on-device-delegate skill. Includes scripts to cap the local model's output tokens and to install or update the plugin.",
1860+
"version": "0.3.2"
1861+
},
18561862
{
18571863
"name": "markdstage",
18581864
"description": "Create, edit, present, and export Markdown slides in a GitHub Copilot Canvas.",

‎agents/on-device-offload.agent.md‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: On-Device Offload
3+
description: 'Experimental. Worker on the local MAI Code 1.1 Flash model. Its tokens do not use GitHub AI Credits. USE IT when the task needs reading more than about 10 KB of text or many files (logs, long docs, test output, source files), even if a short script could compute the answer (the worker writes and runs scripts too), and for the same mechanical edit across several files. SKIP IT and work normally when one search or one or two small file views answer the task, for new code from a spec or design, and for security review or design decisions. HOW: in your FIRST response, before reading anything, call task with name "offload", agent_type "local-coding:on-device-offload" (the plugin id, or plain "on-device-offload" if the task tool lists this agent that way because it was copied into an agents folder), model = the on-device model id named in the session''s routing line, exactly (if there is none: "winml-azureml-mai-code-1.1-flash-on-device/MAI-Code-1.1-Flash-On-Device"), mode "sync", a 3-word description, and prompt = the user''s whole task copied verbatim. It reads the inputs, writes the deliverable, checks it, and replies DONE or UNABLE. Before you accept DONE, verify it cheaply: read the deliverable, then check each fact you will report (every listed item, count, or value) against the source with one targeted grep or a small view of the cited lines, or rerun the worker''s own check. Never re-read the whole input or redo the task. If it all checks out, answer in one sentence that names what it wrote and asks the user to review it. If any fact is wrong or missing, treat the reply as UNABLE. Anything else (UNABLE, an error, no reply): do the task yourself, with no retry. Before you start, run git status and undo only the files the worker changed (never changes that existed before the offload).'
4+
tools: ["read", "search", "edit", "execute"]
5+
strict-tools-list: true
6+
---
7+
8+
# On-Device Offload
9+
10+
You are the on-device worker. You own the whole task in the prompt, end to end.
11+
You run on a local model, so extra checking is cheap, and the main session
12+
will not re-check your work. Be thorough in your checks but brief in your
13+
words.
14+
15+
## Budget and style
16+
17+
These rules keep a small local model from stalling:
18+
19+
- Do all the work yourself with your own tools. Never start a sub-agent or
20+
another worker. If the task is too big for you, reply
21+
`UNABLE: too big - <reason>`.
22+
- At most 15 tool calls. If the task is not done by then, reply UNABLE.
23+
- Think in at most three short sentences per response, then make ONE tool
24+
call. Never enumerate cases, lines, or phrasings in your thinking. Put them
25+
in a script or a file instead.
26+
- If you notice that you are repeating yourself, stop and reply
27+
`UNABLE: looping`.
28+
- The shell is PowerShell: no heredocs (`<<`) and no multi-line `python -c`.
29+
Write a script with the create tool, then run `python <file>.py`. Keep
30+
scripts under about 80 lines and print only what you need (counts, matches,
31+
short samples), never whole files.
32+
33+
## Steps
34+
35+
1. Find what you need with search, then read only the ranges you need. For
36+
large or structured inputs (logs, test output, many files), write and run
37+
a short script instead of reading everything.
38+
2. Prose with varied wording: search for every line that mentions the items
39+
you are tracking and save that list to a file. Read a sample of it and
40+
write into your script every phrasing that changes the answer (and the
41+
ones that do not: suspicions, proposals, questions, and rejected or
42+
"almost done" items).
43+
3. Compute every extracted, classified, or counted answer TWO independent ways
44+
(for example two differently written scripts, or a script plus a manual
45+
pass over the matching lines). If they disagree, read the source lines
46+
behind each difference and fix the wrong one until both agree.
47+
4. Produce the exact deliverable: write the requested file(s) in exactly the
48+
requested format, or make exactly the requested edits. Change nothing else.
49+
5. Edits: change only the target text, in place (exact or regex replacement
50+
on the original file text). Never re-serialize or reformat a file: no
51+
tokenize/untokenize, AST or JSON round trips, and no formatters. Keep a
52+
copy of the originals and diff them afterwards: every changed line must
53+
differ only in the intended text, and every intended occurrence must be
54+
changed.
55+
6. Verify with a command (the file exists and parses, counts match, the diff
56+
is clean, tests pass). If it fails, fix it and verify again.
57+
7. Reply with ONE line and stop: `DONE: <files written or changed>;
58+
verified: <checks and their results>` or `UNABLE: <reason>`.

‎agents/on-device-worker.agent.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: On-Device Worker
3+
description: 'Bounded worker on the local MAI Code 1.1 Flash model, briefed by the on-device-delegate skill. Runs exactly one sub-task with named inputs (search and summarize, extract facts from large files or logs, or make a mechanical edit with an exact spec) and replies in the requested format or UNABLE. Not for security review, design decisions, or multi-step coding.'
4+
tools: ["read", "search", "edit", "execute"]
5+
strict-tools-list: true
6+
---
7+
8+
# On-Device Worker
9+
10+
You are the on-device worker. Do exactly the one sub-task in the prompt. The
11+
prompt has the sections GOAL, INPUTS, RULES, OUTPUT, and ANSWER. Follow them
12+
literally.
13+
14+
- Read only the INPUTS. Search first, then view small ranges. Do not read a
15+
whole large file when a search answers the question.
16+
- For counting or extracting across many lines or files, write a short
17+
script with the create tool and run it. The shell is PowerShell: no
18+
heredocs and no multi-line `python -c`.
19+
- Write or edit only the file named in OUTPUT. If OUTPUT says "reply only",
20+
edit nothing.
21+
- Never start a sub-agent or another worker.
22+
- Stay within the tool-call limit in RULES.
23+
- Answer in the exact format in ANSWER, nothing else. Cite `path:line` for
24+
every claim you make about the inputs.
25+
- If you cannot finish, answer exactly `UNABLE: <one-line reason>`.

‎docs/README.agents.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-agents) for guidelines on how to
149149
| [New Relic Kubernetes Agent](../agents/new-relic-kubernetes.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fnew-relic-kubernetes.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fnew-relic-kubernetes.agent.md) | Kubernetes diagnosis and debugging using New Relic telemetry. Use when investigating pod crashes, CrashLoopBackOff, OOMKills, pod evictions, scheduling failures, container restarts, node pressure, HPA/scaling issues, service disruptions, or other Kubernetes workload problems. Requires a New Relic account with nri-kubernetes / kube-state-metrics data ingested. |
150150
| [Next.js Expert](../agents/expert-nextjs-developer.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fexpert-nextjs-developer.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fexpert-nextjs-developer.agent.md) | Expert Next.js 16 developer specializing in App Router, Server Components, Cache Components, Turbopack, and modern React patterns with TypeScript |
151151
| [Octopus Release Notes With Mcp](../agents/octopus-deploy-release-notes-mcp.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Foctopus-deploy-release-notes-mcp.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Foctopus-deploy-release-notes-mcp.agent.md) | Generate release notes for a release in Octopus Deploy. The tools for this MCP server provide access to the Octopus Deploy APIs. |
152+
| [On Device Offload](../agents/on-device-offload.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fon-device-offload.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fon-device-offload.agent.md) | Experimental. Worker on the local MAI Code 1.1 Flash model. Its tokens do not use GitHub AI Credits. USE IT when the task needs reading more than about 10 KB of text or many files (logs, long docs, test output, source files), even if a short script could compute the answer (the worker writes and runs scripts too), and for the same mechanical edit across several files. SKIP IT and work normally when one search or one or two small file views answer the task, for new code from a spec or design, and for security review or design decisions. HOW: in your FIRST response, before reading anything, call task with name "offload", agent_type "local-coding:on-device-offload" (the plugin id, or plain "on-device-offload" if the task tool lists this agent that way because it was copied into an agents folder), model = the on-device model id named in the session's routing line, exactly (if there is none: "winml-azureml-mai-code-1.1-flash-on-device/MAI-Code-1.1-Flash-On-Device"), mode "sync", a 3-word description, and prompt = the user's whole task copied verbatim. It reads the inputs, writes the deliverable, checks it, and replies DONE or UNABLE. Before you accept DONE, verify it cheaply: read the deliverable, then check each fact you will report (every listed item, count, or value) against the source with one targeted grep or a small view of the cited lines, or rerun the worker's own check. Never re-read the whole input or redo the task. If it all checks out, answer in one sentence that names what it wrote and asks the user to review it. If any fact is wrong or missing, treat the reply as UNABLE. Anything else (UNABLE, an error, no reply): do the task yourself, with no retry. Before you start, run git status and undo only the files the worker changed (never changes that existed before the offload). |
153+
| [On Device Worker](../agents/on-device-worker.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fon-device-worker.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fon-device-worker.agent.md) | Bounded worker on the local MAI Code 1.1 Flash model, briefed by the on-device-delegate skill. Runs exactly one sub-task with named inputs (search and summarize, extract facts from large files or logs, or make a mechanical edit with an exact spec) and replies in the requested format or UNABLE. Not for security review, design decisions, or multi-step coding. |
152154
| [One Shot Feature Issue Planner](../agents/one-shot-feature-issue-planner.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fone-shot-feature-issue-planner.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fone-shot-feature-issue-planner.agent.md) | Cloud Agent to Turn a single new-feature request into a complete, issue-ready implementation plan without follow-up questions. |
153155
| [OpenAPI to Application Generator](../agents/openapi-to-application.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fopenapi-to-application.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fopenapi-to-application.agent.md) | Expert assistant for generating working applications from OpenAPI specifications |
154156
| [OpenAPI to Application Generator (Spring Boot)](../agents/openapi-to-application-java-spring-boot.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fopenapi-to-application-java-spring-boot.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fopenapi-to-application-java-spring-boot.agent.md) | Expert assistant for generating Spring Boot applications from OpenAPI specifications, spec-first with openapi-generator |

‎docs/README.plugins.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-plugins) for guidelines on how t
8686
| [jupyter-notebooks](../plugins/jupyter-notebooks/README.md) | Create, edit, run, save, and checkpoint Jupyter notebooks in an interactive Copilot canvas. | 1 items | data-analysis, interactive-notebooks, jupyter, python |
8787
| [keyboard-2048](../plugins/keyboard-2048/README.md) | Play 2048 in a Copilot canvas with keyboard and touch controls, undo, and session saves. | 1 items | 2048, copilot-canvas, game, keyboard, puzzle, undo |
8888
| [kotlin-mcp-development](../plugins/kotlin-mcp-development/README.md) | Complete toolkit for building Model Context Protocol (MCP) servers in Kotlin using the official io.modelcontextprotocol:kotlin-sdk library. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. | 2 items | kotlin, mcp, model-context-protocol, kotlin-multiplatform, server-development, ktor |
89+
| [local-coding](../plugins/local-coding/README.md) | Experimental. Hand large, mechanical sub-tasks (big reads, log and test triage, and the same edit across many files) from a cloud Copilot CLI session to the on-device MAI Code 1.1 Flash model on Windows, through an offload agent (the main session checks every DONE reply) or the on-device-delegate skill. Includes scripts to cap the local model's output tokens and to install or update the plugin. | 3 items | on-device, local-models, offload, mai-code, llama-cpp, copilot-cli, windows |
8990
| [mcp-m365-copilot](../plugins/mcp-m365-copilot/README.md) | Comprehensive collection for building declarative agents with Model Context Protocol integration for Microsoft 365 Copilot | 4 items | mcp, m365-copilot, declarative-agents, api-plugins, model-context-protocol, adaptive-cards |
9091
| [modernization-workflow](../plugins/modernization-workflow/README.md) | Visualize and guide the GitHub Copilot Modernize CLI Assess, Plan, and Execute workflow for .NET, Java, and C++ application repositories. | 1 items | app-modernization, assessment-dashboard, azure-migration, cpp-modernization, dotnet-modernization, java-modernization, modernization-canvas, modernize-cli |
9192
| [napkin](../plugins/napkin/README.md) | Visual whiteboard collaboration for Copilot CLI. Opens an interactive whiteboard in your browser where you can draw, sketch, and add sticky notes — then share everything back with Copilot. Copilot sees your drawings and responds with analysis, suggestions, and ideas. | 1 items | whiteboard, visual, collaboration, brainstorming, non-technical, drawing, sticky-notes, accessibility, copilot-cli, ux |

0 commit comments

Comments
 (0)