1
---
2
name: on-device-delegate
3
description: 'Saves cloud-model context by briefing one bounded, read-heavy sub-task (more than about 25 KB of prose, or many files that no single command can answer) to the local-coding plugin''s on-device worker, which runs on the local MAI Code 1.1 Flash model. Use for log and test triage, summarizing many files, or extracting facts from large inputs. When the user names this skill, call the skill tool in the same response as your first other tool call, never as a separate step.'
4
compatibility: 'GitHub Copilot CLI on Windows with experimental features on, MAI Code 1.1 Flash installed from /model, and the local-coding plugin installed (it provides the on-device worker agent).'
5
---
6
7
# On-Device Delegate
8
9
Send the bulky reading in a task to the on-device worker, then check its answer
10
once. The main session keeps planning and answering. The worker reads the big
11
inputs on the local model, so they never enter the main context.
12
13
## Steps
14
15
1. **Gate on what you would read.** If one command or a short script can
16
compute the answer, do it yourself now: no plan, no notes about this
17
skill. Delegate only when you would otherwise READ more than about 25 KB
18
of text into your context (prose, many files). Never delegate security
19
review or design decisions.
20
2. **Check the worker.** The worker is the custom agent
21
`local-coding:on-device-worker` (the plugin id). If the task tool lists it
22
as plain `on-device-worker` instead (copied into an agents folder), use
23
that. If neither is available, work normally.
24
3. **Brief.** Do not read the big input first. Make ONE task call:
25
- `name`: "on-device-<short-kebab>"
26
- `description`: 3-5 words
27
- `agent_type`: the worker id from step 2
28
- `mode`: "sync"
29
- `model`: the on-device model id named in the session's routing line,
30
exactly (if there is none:
31
"winml-azureml-mai-code-1.1-flash-on-device/MAI-Code-1.1-Flash-On-Device").
32
The worker does not pin a model, so without this it runs on your own
33
model.
34
- `prompt`, exactly:
35
36
```text
37
GOAL: <one sentence>
38
INPUTS: <exact paths>
39
RULES: Read only INPUTS. At most 8 tool calls. Edit nothing but OUTPUT. No questions.
40
OUTPUT: <file path and exact format, or: reply only>
41
ANSWER: Reply ONCE with only <exact format>, then stop.
42
If you cannot, reply only: UNABLE: <reason>
43
```
44
45
4. **Check once.** At most ONE cheap check (format, a count, or one spot
46
check). Never recompute the answer or re-read the input. If the answer is
47
wrong, UNABLE, or the task call fails: do it yourself. Then finish.
48
49
## Example
50
51
User: "Use the on-device-delegate skill. From the logs under `logs\`, list
52
every distinct error message with its count, most frequent first."
53
54
Task prompt:
55
56
```text
57
GOAL: Count each distinct error message in the logs.
58
INPUTS: logs\
59
RULES: Read only INPUTS. At most 8 tool calls. Edit nothing but OUTPUT. No questions.
60
OUTPUT: reply only
61
ANSWER: Reply ONCE with only lines of the form "<count> <message>", most frequent first, then stop.
62
If you cannot, reply only: UNABLE: <reason>
63
```
64
65
Check: confirm the lines match the format and spot-check one count with a
66
single search. Then answer the user.
67
68
## Limits
69
70
- The worker can return a confident but wrong answer. The single check
71
catches format errors, not every wrong fact. Tell the user what you checked.
72
- Expect minutes, not seconds, per delegated task, especially on the first
73
call while the local model loads.
74
75
## Setup scripts
76
77
[`scripts/`](scripts/) holds two setup scripts for the user, described in the
78
local-coding plugin README. They are not part of a task: never run them while
79
you work on the user's request.
80
81
- [`scripts/Set-LocalOutputCap.ps1`](scripts/Set-LocalOutputCap.ps1) caps the
82
local model's output tokens in the user's `providers.json`.
83
- [`scripts/Update-LocalCodingPlugin.ps1`](scripts/Update-LocalCodingPlugin.ps1)
84
installs or updates the plugin, then runs the cap script.
85