Split A0 remote workflow skills by affordance

Replace the combined A0 CLI remote workflow skill with separate text-editor and code-execution remote skills, update tool stubs to load the matching per-tool guide, and keep computer-use remote scoped to desktop control. Add prompt-gating coverage for the per-affordance skill split.

Alessandro committed May 8, 2026 at 18:53 UTC a3d41e2ca14cb153368178d63eb1a9056fe4c954
7 files changed +134 -72
plugins/_a0_connector/prompts/agent.connector_tool.code_execution_remote.md
+1 -1
@@ -1,7 +1,7 @@
1 # code_execution_remote tool
2
3 Runs shell-backed execution on the machine where the subscribed A0 CLI is running.
4 -Load `a0-cli-remote-workflows` before using this tool for nontrivial local project work.
4 +Load `code-execution-remote` before using this tool for nontrivial local project work.
5
6 Current local access mode: `{{access_mode}}`
7
plugins/_a0_connector/prompts/agent.connector_tool.text_editor_remote.md
+1 -1
@@ -1,7 +1,7 @@
1 # text_editor_remote tool
2
3 Reads, writes, and patches files on the machine where the subscribed A0 CLI is running.
4 -This is different from server-side file tools. Load `a0-cli-remote-workflows` before using it for edits.
4 +This is different from server-side file tools. Load `text-editor-remote` before using it for edits.
5
6 Current access mode: `{{access_mode}}`
7
plugins/_a0_connector/skills/a0-cli-remote-workflows/SKILL.md deleted
-64
@@ -1,64 +0,0 @@
1 ----
2 -name: a0-cli-remote-workflows
3 -description: Guide safe use of A0 CLI remote shell execution and remote file editing on the connected host machine. Load before using code_execution_remote or text_editor_remote for local project work through the CLI connector.
4 -version: 1.0.0
5 -author: Agent Zero Team
6 -tags: ["agent-zero", "a0", "cli", "connector", "remote-execution", "remote-files"]
7 -trigger_patterns:
8 - - "code_execution_remote"
9 - - "text_editor_remote"
10 - - "remote file editing"
11 - - "remote shell execution"
12 - - "edit my local files through a0 cli"
13 - - "run commands on the cli host"
14 -allowed_tools:
15 - - code_execution_remote
16 - - text_editor_remote
17 ----
18 -
19 -# A0 CLI Remote Workflows
20 -
21 -## Boundary
22 -
23 -Use `code_execution_remote` and `text_editor_remote` only for work on the machine where A0 CLI is running. These paths, shells, runtimes, and files belong to the CLI host, not the Agent Zero server or Docker container.
24 -
25 -If the task belongs inside Agent Zero's own runtime, use the normal server-side tools instead.
26 -
27 -## Access Modes
28 -
29 -- Read only: inspect files and poll/reset existing execution sessions. Do not attempt writes or mutating shell work until the user switches the CLI to Read&Write with F3.
30 -- Read&Write: shell-backed execution, writes, and patches may modify the CLI host. Keep changes narrow and intentional.
31 -- Execution may also be disabled locally in the CLI. If a remote tool returns a structured disabled/no-client error, explain the required CLI toggle instead of falling back to the server filesystem.
32 -
33 -## Remote Execution
34 -
35 -- Use `runtime=terminal` for shell commands, `runtime=python` for Python snippets, and `runtime=nodejs` for Node.js snippets.
36 -- Reuse the same integer `session` while continuing a workflow; session state is local to the CLI frontend.
37 -- Use `runtime=output` when a previous command is still running or returned before the shell reached a prompt.
38 -- Use `runtime=reset` when a session is stuck or a clean shell is safer.
39 -- Treat `runtime=input` as deprecated compatibility for sending one line to a running shell.
40 -- Match the remote host shell syntax. A Windows CLI may need PowerShell syntax even when Agent Zero runs on Linux.
41 -
42 -## Remote File Editing
43 -
44 -- Start with `read` when inspecting a file or preparing line-based edits.
45 -- Use `write` only when replacing or creating the whole file is truly the right operation.
46 -- Prefer `patch` with `patch_text` for context-anchored edits, especially after inserts/deletes or when line numbers may have shifted.
47 -- Use `patch` with `edits` only for small line-range edits based on the latest remote read.
48 -- If freshness-aware line patching rejects an edit as stale, reread the file and retry with updated ranges.
49 -
50 -## Patch Text Rules
51 -
52 -- `patch_text` supports update hunks for one file.
53 -- Use one `@@ existing line` anchor, then `+new line` entries for insertion.
54 -- For replacement, use `@@ before target` followed by `-old` and `+new`, or use `@@ old target` followed by the same replacement pair.
55 -- Do not repeat the same old line as both context and deletion in one hunk.
56 -- Every non-header content line must begin with exactly one prefix: space for context, `+` for additions, or `-` for removals.
57 -- Do not stack multiple `@@` anchors for one insert.
58 -
59 -## Failure Handling
60 -
61 -- If no CLI is connected or subscribed, ask the user to connect A0 CLI to this chat.
62 -- If writes are blocked, tell the user to switch local access to Read&Write with F3.
63 -- If execution is disabled, tell the user to enable remote execution in the CLI.
64 -- If a request times out or the CLI disconnects, poll once if a session may still be running; otherwise summarize the failure and wait for reconnection.
plugins/_a0_connector/skills/code-execution-remote/SKILL.md new
+45
@@ -0,0 +1,45 @@
1 +---
2 +name: code-execution-remote
3 +description: Guide safe use of code_execution_remote for shell-backed execution on the connected A0 CLI host machine.
4 +version: 1.0.0
5 +author: Agent Zero Team
6 +tags: ["agent-zero", "a0", "cli", "connector", "remote-execution", "shell"]
7 +trigger_patterns:
8 + - "code_execution_remote"
9 + - "remote shell execution"
10 + - "run commands on the cli host"
11 + - "run python on the cli host"
12 + - "run node on the cli host"
13 +allowed_tools:
14 + - code_execution_remote
15 +---
16 +
17 +# Code Execution Remote
18 +
19 +## Boundary
20 +
21 +Use `code_execution_remote` only for shell-backed execution on the machine where A0 CLI is running. Shells, runtimes, and paths belong to the CLI host, not the Agent Zero server or Docker container.
22 +
23 +If the task belongs inside Agent Zero's own runtime, use the normal server-side execution tool instead.
24 +
25 +## Access Modes
26 +
27 +- Remote execution can be disabled locally in the CLI. If the tool returns a disabled/no-client error, explain the required CLI toggle instead of falling back to the server runtime.
28 +- Read&Write local file access allows mutating runtimes such as `terminal`, `python`, and `nodejs`.
29 +- Read only local file access blocks mutating runtimes. `runtime=output` and `runtime=reset` remain available for existing sessions.
30 +
31 +## Runtimes
32 +
33 +- Use `runtime=terminal` for shell commands, `runtime=python` for Python snippets, and `runtime=nodejs` for Node.js snippets.
34 +- Reuse the same integer `session` while continuing a workflow; session state is local to the CLI frontend.
35 +- Use `runtime=output` when a previous command is still running or returned before the shell reached a prompt.
36 +- Use `runtime=reset` when a session is stuck or a clean shell is safer.
37 +- Treat `runtime=input` as deprecated compatibility for sending one line to a running shell.
38 +- Match the remote host shell syntax. A Windows CLI may need PowerShell syntax even when Agent Zero runs on Linux.
39 +
40 +## Failure Handling
41 +
42 +- If no CLI is connected or subscribed, ask the user to connect A0 CLI to this chat.
43 +- If execution is disabled, tell the user to enable remote execution in the CLI.
44 +- If mutating runtimes are blocked, tell the user to switch local file access to Read&Write with F3.
45 +- If a request times out or the CLI disconnects, poll once if a session may still be running; otherwise summarize the failure and wait for reconnection.
plugins/_a0_connector/skills/text-editor-remote/SKILL.md new
+51
@@ -0,0 +1,51 @@
1 +---
2 +name: text-editor-remote
3 +description: Guide safe use of text_editor_remote for reading, writing, and patching files on the connected A0 CLI host machine.
4 +version: 1.0.0
5 +author: Agent Zero Team
6 +tags: ["agent-zero", "a0", "cli", "connector", "remote-files", "file-editing"]
7 +trigger_patterns:
8 + - "text_editor_remote"
9 + - "remote file editing"
10 + - "edit my local files through a0 cli"
11 + - "read files on the cli host"
12 + - "patch files on the cli host"
13 +allowed_tools:
14 + - text_editor_remote
15 +---
16 +
17 +# Text Editor Remote
18 +
19 +## Boundary
20 +
21 +Use `text_editor_remote` only for file work on the machine where A0 CLI is running. These paths and files belong to the CLI host, not the Agent Zero server or Docker container.
22 +
23 +If the task belongs inside Agent Zero's own runtime, use the normal server-side file tools instead.
24 +
25 +## Access Modes
26 +
27 +- Read&Write: reads, writes, and patches may modify the CLI host. Keep changes narrow and intentional.
28 +- Read only: inspect files only. If writes are blocked, tell the user to switch local file access to Read&Write with F3.
29 +
30 +## Editing Flow
31 +
32 +- Start with `read` when inspecting a file or preparing line-based edits.
33 +- Use `write` only when replacing or creating the whole file is truly the right operation.
34 +- Prefer `patch` with `patch_text` for context-anchored edits, especially after inserts/deletes or when line numbers may have shifted.
35 +- Use `patch` with `edits` only for small line-range edits based on the latest remote read.
36 +- If freshness-aware line patching rejects an edit as stale, reread the file and retry with updated ranges.
37 +
38 +## Patch Text Rules
39 +
40 +- `patch_text` supports update hunks for one file.
41 +- Use one `@@ existing line` anchor, then `+new line` entries for insertion.
42 +- For replacement, use `@@ before target` followed by `-old` and `+new`, or use `@@ old target` followed by the same replacement pair.
43 +- Do not repeat the same old line as both context and deletion in one hunk.
44 +- Every non-header content line must begin with exactly one prefix: space for context, `+` for additions, or `-` for removals.
45 +- Do not stack multiple `@@` anchors for one insert.
46 +
47 +## Failure Handling
48 +
49 +- If no CLI is connected or subscribed, ask the user to connect A0 CLI to this chat.
50 +- If writes are blocked, tell the user to switch local file access to Read&Write with F3.
51 +- If a request times out or the CLI disconnects, summarize the failure and wait for reconnection.
skills/computer-use-remote/SKILL.md
+2 -1
@@ -14,7 +14,6 @@ trigger_patterns:
14 - "native ui"
15 allowed_tools:
16 - computer_use_remote
17 - - code_execution_remote
17 ---
18
19 # Computer Use Remote
@@ -25,6 +24,8 @@ Load this skill before using `computer_use_remote` for local desktop and native
24
25 If the task is browser-only and the user is flexible, prefer direct browser tooling because it is usually more reliable and token-efficient than screenshot-driven desktop control.
26
27 +If the task needs shell execution on the CLI host, load `code-execution-remote` separately rather than treating desktop control and shell execution as one affordance.
28 +
29 ## Core Loop
30
31 1. Call `start_session` first.
tests/test_a0_connector_prompt_gating.py
+34 -5
@@ -198,8 +198,8 @@ def test_computer_use_enabled_cli_adds_computer_stub():
198 assert "code_execution_remote tool" not in prompt
199
200
201 -def test_remote_workflow_skills_parse():
202 - connector_skill = _parse_skill_frontmatter(
201 +def test_remote_affordance_skills_parse():
202 + legacy_connector_skill = (
203 PROJECT_ROOT
204 / "plugins"
205 / "_a0_connector"
@@ -207,11 +207,40 @@ def test_remote_workflow_skills_parse():
207 / "a0-cli-remote-workflows"
208 / "SKILL.md"
209 )
210 + text_editor_skill = _parse_skill_frontmatter(
211 + PROJECT_ROOT
212 + / "plugins"
213 + / "_a0_connector"
214 + / "skills"
215 + / "text-editor-remote"
216 + / "SKILL.md"
217 + )
218 + code_execution_skill = _parse_skill_frontmatter(
219 + PROJECT_ROOT
220 + / "plugins"
221 + / "_a0_connector"
222 + / "skills"
223 + / "code-execution-remote"
224 + / "SKILL.md"
225 + )
226 computer_skill = _parse_skill_frontmatter(
227 PROJECT_ROOT / "skills" / "computer-use-remote" / "SKILL.md"
228 )
229
214 - assert connector_skill["name"] == "a0-cli-remote-workflows"
215 - assert connector_skill["description"]
230 + assert not legacy_connector_skill.exists()
231 + assert text_editor_skill["name"] == "text-editor-remote"
232 + assert text_editor_skill["allowed_tools"] == ["text_editor_remote"]
233 + assert code_execution_skill["name"] == "code-execution-remote"
234 + assert code_execution_skill["allowed_tools"] == ["code_execution_remote"]
235 assert computer_skill["name"] == "computer-use-remote"
217 - assert computer_skill["description"]
236 + assert computer_skill["allowed_tools"] == ["computer_use_remote"]
237 +
238 +
239 +def test_remote_tool_stubs_point_to_per_tool_skills():
240 + text_stub = (PROMPT_ROOT / "agent.connector_tool.text_editor_remote.md").read_text(encoding="utf-8")
241 + exec_stub = (PROMPT_ROOT / "agent.connector_tool.code_execution_remote.md").read_text(encoding="utf-8")
242 +
243 + assert "Load `text-editor-remote`" in text_stub
244 + assert "Load `code-execution-remote`" in exec_stub
245 + assert "a0-cli-remote-workflows" not in text_stub
246 + assert "a0-cli-remote-workflows" not in exec_stub