Skip to content
Merged
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: 2 additions & 2 deletions .agents/skills/uloop-execute-dynamic-code/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ This tool can inspect reachable Unity state, such as GameObjects, components, pu

- `--code '<code>'`: Inline C# statements to execute. Use direct statements only; `return` is optional, and `using` directives may appear at the top of the snippet.
- `--code-file <path>`: Read the C# statements from a file instead of `--code`. Use this when the active shell or launcher cannot preserve inline code exactly. Exactly one of `--code` or `--code-file` is required; combining them is an error.
- **Shell quoting**: bash/zsh uses single quotes, for example `uloop execute-dynamic-code --code 'using UnityEngine; return Mathf.PI;'`. PowerShell 7 (`pwsh`) preserves C# double quotes inside single-quoted strings. Windows PowerShell 5.1 removes unescaped double quotes when invoking native commands; escape C# double quotes as `\"` there, or use `--code-file` when the snippet has many strings.
- `--parameters {}` (advanced, optional): Pass an object when reusing a snippet with varying data or when keeping values outside the code. Values are exposed as `parameters["param0"]`, `parameters["param1"]`, and so on. Omit this flag for most snippets, and pass an object instead of a JSON string.
- **Shell quoting**: bash/zsh uses single quotes, for example `uloop execute-dynamic-code --code 'using UnityEngine; return Mathf.PI;'`. PowerShell 7 (`pwsh`) can pass multiline snippets without `--code-file` by using a single-quoted here-string, for example `$code = @' ... '@; uloop execute-dynamic-code --code $code`. Windows PowerShell 5.1 removes unescaped double quotes when invoking native commands; escape C# double quotes as `\"` for short inline snippets, or use `--code-file` when the snippet has many strings.
- `--parameters {}` (advanced, optional): Pass a shell-quoted JSON object literal when reusing a snippet with varying data or when keeping values outside the code. Values are exposed as `parameters["param0"]`, `parameters["param1"]`, and so on. Omit this flag for most snippets. Do not pass a JSON string value such as `"{\"param0\":\"value\"}"`.
- `--wait-for-domain-reload` (optional): Wait for Domain Reload recovery after snippets that intentionally trigger Unity script reload or import work. Omit this for normal inspection and editor-state workflows.

## Code Rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,27 @@ Use `execute-dynamic-code` for direct automation and diagnostics, and switch to

## PowerShell Quoting Notes

Use these patterns when you need shell-safe inline code:
Use these patterns when you need shell-safe inline code.
PowerShell's equivalent to a bash heredoc is a single-quoted here-string.
In PowerShell 7 (`pwsh`), it can be passed to `--code` directly without creating a temporary file:

```powershell
uloop execute-dynamic-code --code @'
using UnityEngine;
using UnityEngine.SceneManagement;

Scene scene = SceneManager.GetActiveScene();
GameObject[] objects = UnityEngine.Object.FindObjectsByType<GameObject>(FindObjectsInactive.Include, FindObjectsSortMode.None);
return $"{scene.name}: {objects.Length} objects";
'@
```

Use `--code-file` when the active shell or launcher cannot preserve inline code exactly, especially for Windows PowerShell 5.1 snippets with many C# string literals.

### Native launcher check

Multi-line `--code` expects PowerShell to call the native `uloop.exe` launcher directly.
If `Get-Command uloop` resolves to an old npm `.cmd` shim, run `uloop install` and open a new terminal before relying on multi-line inline snippets.
Multi-line `--code` expects PowerShell to call the native Go `uloop.exe` launcher directly.
If `Get-Command uloop` resolves to an old `.cmd` shim from a previous installation, run `uloop install` and open a new terminal before relying on multi-line inline snippets.

```powershell
(Get-Command uloop).Source
Expand Down Expand Up @@ -58,17 +73,17 @@ If the C# snippet itself contains a single quote, double it inside the PowerShel
uloop execute-dynamic-code --code 'char initial = ''A''; return initial.ToString();'
```

### JSON-like values passed via `--parameters`
### JSON object values passed via `--parameters`

Wrap the whole expression in single quotes so PowerShell passes the inner double quotes through unchanged.
Pass a JSON object literal, not a JSON string value. Wrap the object literal in single quotes so PowerShell passes the inner double quotes through unchanged.

```powershell
uloop execute-dynamic-code --code 'return parameters["param0"];' --parameters '{"param0":"Hello from PowerShell"}'
```

### Multi-line C# snippets

Use a here-string when the snippet spans multiple lines in PowerShell 7 (`pwsh`).
Use a here-string variable when you want to prepare or reuse a snippet before executing it in PowerShell 7 (`pwsh`).

```powershell
$code = @'
Expand Down Expand Up @@ -98,7 +113,7 @@ return obj.name;
uloop execute-dynamic-code --code $code
```

You can combine multi-line code with multi-line parameters the same way.
You can combine multi-line code with a multi-line JSON object literal the same way.

```powershell
$code = @'
Expand Down
4 changes: 2 additions & 2 deletions .claude/skills/uloop-execute-dynamic-code/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ This tool can inspect reachable Unity state, such as GameObjects, components, pu

- `--code '<code>'`: Inline C# statements to execute. Use direct statements only; `return` is optional, and `using` directives may appear at the top of the snippet.
- `--code-file <path>`: Read the C# statements from a file instead of `--code`. Use this when the active shell or launcher cannot preserve inline code exactly. Exactly one of `--code` or `--code-file` is required; combining them is an error.
- **Shell quoting**: bash/zsh uses single quotes, for example `uloop execute-dynamic-code --code 'using UnityEngine; return Mathf.PI;'`. PowerShell 7 (`pwsh`) preserves C# double quotes inside single-quoted strings. Windows PowerShell 5.1 removes unescaped double quotes when invoking native commands; escape C# double quotes as `\"` there, or use `--code-file` when the snippet has many strings.
- `--parameters {}` (advanced, optional): Pass an object when reusing a snippet with varying data or when keeping values outside the code. Values are exposed as `parameters["param0"]`, `parameters["param1"]`, and so on. Omit this flag for most snippets, and pass an object instead of a JSON string.
- **Shell quoting**: bash/zsh uses single quotes, for example `uloop execute-dynamic-code --code 'using UnityEngine; return Mathf.PI;'`. PowerShell 7 (`pwsh`) can pass multiline snippets without `--code-file` by using a single-quoted here-string, for example `$code = @' ... '@; uloop execute-dynamic-code --code $code`. Windows PowerShell 5.1 removes unescaped double quotes when invoking native commands; escape C# double quotes as `\"` for short inline snippets, or use `--code-file` when the snippet has many strings.
- `--parameters {}` (advanced, optional): Pass a shell-quoted JSON object literal when reusing a snippet with varying data or when keeping values outside the code. Values are exposed as `parameters["param0"]`, `parameters["param1"]`, and so on. Omit this flag for most snippets. Do not pass a JSON string value such as `"{\"param0\":\"value\"}"`.
- `--wait-for-domain-reload` (optional): Wait for Domain Reload recovery after snippets that intentionally trigger Unity script reload or import work. Omit this for normal inspection and editor-state workflows.

## Code Rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,27 @@ Use `execute-dynamic-code` for direct automation and diagnostics, and switch to

## PowerShell Quoting Notes

Use these patterns when you need shell-safe inline code:
Use these patterns when you need shell-safe inline code.
PowerShell's equivalent to a bash heredoc is a single-quoted here-string.
In PowerShell 7 (`pwsh`), it can be passed to `--code` directly without creating a temporary file:

```powershell
uloop execute-dynamic-code --code @'
using UnityEngine;
using UnityEngine.SceneManagement;

Scene scene = SceneManager.GetActiveScene();
GameObject[] objects = UnityEngine.Object.FindObjectsByType<GameObject>(FindObjectsInactive.Include, FindObjectsSortMode.None);
return $"{scene.name}: {objects.Length} objects";
'@
```

Use `--code-file` when the active shell or launcher cannot preserve inline code exactly, especially for Windows PowerShell 5.1 snippets with many C# string literals.

### Native launcher check

Multi-line `--code` expects PowerShell to call the native `uloop.exe` launcher directly.
If `Get-Command uloop` resolves to an old npm `.cmd` shim, run `uloop install` and open a new terminal before relying on multi-line inline snippets.
Multi-line `--code` expects PowerShell to call the native Go `uloop.exe` launcher directly.
If `Get-Command uloop` resolves to an old `.cmd` shim from a previous installation, run `uloop install` and open a new terminal before relying on multi-line inline snippets.

```powershell
(Get-Command uloop).Source
Expand Down Expand Up @@ -58,17 +73,17 @@ If the C# snippet itself contains a single quote, double it inside the PowerShel
uloop execute-dynamic-code --code 'char initial = ''A''; return initial.ToString();'
```

### JSON-like values passed via `--parameters`
### JSON object values passed via `--parameters`

Wrap the whole expression in single quotes so PowerShell passes the inner double quotes through unchanged.
Pass a JSON object literal, not a JSON string value. Wrap the object literal in single quotes so PowerShell passes the inner double quotes through unchanged.

```powershell
uloop execute-dynamic-code --code 'return parameters["param0"];' --parameters '{"param0":"Hello from PowerShell"}'
```

### Multi-line C# snippets

Use a here-string when the snippet spans multiple lines in PowerShell 7 (`pwsh`).
Use a here-string variable when you want to prepare or reuse a snippet before executing it in PowerShell 7 (`pwsh`).

```powershell
$code = @'
Expand Down Expand Up @@ -98,7 +113,7 @@ return obj.name;
uloop execute-dynamic-code --code $code
```

You can combine multi-line code with multi-line parameters the same way.
You can combine multi-line code with a multi-line JSON object literal the same way.

```powershell
$code = @'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ This tool can inspect reachable Unity state, such as GameObjects, components, pu

- `--code '<code>'`: Inline C# statements to execute. Use direct statements only; `return` is optional, and `using` directives may appear at the top of the snippet.
- `--code-file <path>`: Read the C# statements from a file instead of `--code`. Use this when the active shell or launcher cannot preserve inline code exactly. Exactly one of `--code` or `--code-file` is required; combining them is an error.
- **Shell quoting**: bash/zsh uses single quotes, for example `uloop execute-dynamic-code --code 'using UnityEngine; return Mathf.PI;'`. PowerShell 7 (`pwsh`) preserves C# double quotes inside single-quoted strings. Windows PowerShell 5.1 removes unescaped double quotes when invoking native commands; escape C# double quotes as `\"` there, or use `--code-file` when the snippet has many strings.
- `--parameters {}` (advanced, optional): Pass an object when reusing a snippet with varying data or when keeping values outside the code. Values are exposed as `parameters["param0"]`, `parameters["param1"]`, and so on. Omit this flag for most snippets, and pass an object instead of a JSON string.
- **Shell quoting**: bash/zsh uses single quotes, for example `uloop execute-dynamic-code --code 'using UnityEngine; return Mathf.PI;'`. PowerShell 7 (`pwsh`) can pass multiline snippets without `--code-file` by using a single-quoted here-string, for example `$code = @' ... '@; uloop execute-dynamic-code --code $code`. Windows PowerShell 5.1 removes unescaped double quotes when invoking native commands; escape C# double quotes as `\"` for short inline snippets, or use `--code-file` when the snippet has many strings.
- `--parameters {}` (advanced, optional): Pass a shell-quoted JSON object literal when reusing a snippet with varying data or when keeping values outside the code. Values are exposed as `parameters["param0"]`, `parameters["param1"]`, and so on. Omit this flag for most snippets. Do not pass a JSON string value such as `"{\"param0\":\"value\"}"`.
- `--wait-for-domain-reload` (optional): Wait for Domain Reload recovery after snippets that intentionally trigger Unity script reload or import work. Omit this for normal inspection and editor-state workflows.

## Code Rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,27 @@ Use `execute-dynamic-code` for direct automation and diagnostics, and switch to

## PowerShell Quoting Notes

Use these patterns when you need shell-safe inline code:
Use these patterns when you need shell-safe inline code.
PowerShell's equivalent to a bash heredoc is a single-quoted here-string.
In PowerShell 7 (`pwsh`), it can be passed to `--code` directly without creating a temporary file:

```powershell
uloop execute-dynamic-code --code @'
using UnityEngine;
using UnityEngine.SceneManagement;

Scene scene = SceneManager.GetActiveScene();
GameObject[] objects = UnityEngine.Object.FindObjectsByType<GameObject>(FindObjectsInactive.Include, FindObjectsSortMode.None);
return $"{scene.name}: {objects.Length} objects";
'@
```

Use `--code-file` when the active shell or launcher cannot preserve inline code exactly, especially for Windows PowerShell 5.1 snippets with many C# string literals.

### Native launcher check

Multi-line `--code` expects PowerShell to call the native `uloop.exe` launcher directly.
If `Get-Command uloop` resolves to an old npm `.cmd` shim, run `uloop install` and open a new terminal before relying on multi-line inline snippets.
Multi-line `--code` expects PowerShell to call the native Go `uloop.exe` launcher directly.
If `Get-Command uloop` resolves to an old `.cmd` shim from a previous installation, run `uloop install` and open a new terminal before relying on multi-line inline snippets.

```powershell
(Get-Command uloop).Source
Expand Down Expand Up @@ -58,17 +73,17 @@ If the C# snippet itself contains a single quote, double it inside the PowerShel
uloop execute-dynamic-code --code 'char initial = ''A''; return initial.ToString();'
```

### JSON-like values passed via `--parameters`
### JSON object values passed via `--parameters`

Wrap the whole expression in single quotes so PowerShell passes the inner double quotes through unchanged.
Pass a JSON object literal, not a JSON string value. Wrap the object literal in single quotes so PowerShell passes the inner double quotes through unchanged.

```powershell
uloop execute-dynamic-code --code 'return parameters["param0"];' --parameters '{"param0":"Hello from PowerShell"}'
```

### Multi-line C# snippets

Use a here-string when the snippet spans multiple lines in PowerShell 7 (`pwsh`).
Use a here-string variable when you want to prepare or reuse a snippet before executing it in PowerShell 7 (`pwsh`).

```powershell
$code = @'
Expand Down Expand Up @@ -98,7 +113,7 @@ return obj.name;
uloop execute-dynamic-code --code $code
```

You can combine multi-line code with multi-line parameters the same way.
You can combine multi-line code with a multi-line JSON object literal the same way.

```powershell
$code = @'
Expand Down