Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
9f945b6
ci(windows,linux): check published install, Wayland grim and global s…
akiojin Oct 3, 2026
b0df8c0
test(windows): run the published installer in a child scope (#465)
akiojin Oct 3, 2026
ab6db5d
chore(gwt): record work events for #465
akiojin Oct 3, 2026
48f4201
Merge pull request #466 from akiojin/work/issue-465
akiojin Oct 3, 2026
0458d7f
fix(windows): harden Editor launches and profile isolation
akiojin Oct 3, 2026
3adb177
fix(windows): validate Git skill links and observe E2E processes safely
akiojin Oct 3, 2026
342f499
Merge remote-tracking branch 'origin/develop' into work/issue-386
akiojin Oct 3, 2026
d0c5ce2
fix(windows): repair reference fetch, bake validation and input verif…
akiojin Oct 4, 2026
3f9286a
docs(windows): record full CLI comparison and final GUI verification
akiojin Oct 4, 2026
a50ddd4
chore(deps): bump the npm_and_yarn group with 3 updates
dependabot[bot] Oct 5, 2026
7d2ef38
ci: make Codecov upload non-fatal and ignore bincode >=3 (#472)
akiojin Oct 5, 2026
b390d54
chore(gwt): record work events for #472
akiojin Oct 5, 2026
2209c12
Merge pull request #473 from akiojin/work/issue-472
akiojin Oct 5, 2026
376a57a
chore(deps): bump actions/upload-artifact from 6 to 7
dependabot[bot] Oct 5, 2026
34bcd6e
Merge branch 'develop' into work/issue-386
akiojin Oct 5, 2026
be40ddf
Merge pull request #467 from akiojin/dependabot/github_actions/develo…
akiojin Oct 5, 2026
a2aff26
Merge branch 'develop' into dependabot/npm_and_yarn/develop/npm_and_y…
akiojin Oct 5, 2026
1b37f53
Merge pull request #469 from akiojin/dependabot/npm_and_yarn/develop/…
akiojin Oct 5, 2026
61f906e
Merge branch 'develop' into work/issue-386
akiojin Oct 5, 2026
ca6ab5a
Merge pull request #471 from akiojin/work/issue-386
akiojin Oct 5, 2026
7f52551
chore(deps): update cargo group and preserve embedding indexes
akiojin Oct 5, 2026
3f9cc02
Merge pull request #476 from akiojin/work/issue-475
akiojin Oct 5, 2026
551422b
docs(skills): document per-tool GameObject parameter names
arghhhhh Oct 9, 2026
a647572
feat(scripts): install a source build as the managed binary
arghhhhh Oct 9, 2026
9d12d9e
fix(update): keep the installed CLI on daemon start when auto-update …
arghhhhh Oct 9, 2026
40908a0
fix(scripts): install-from-source warning, broken installs, --no-skills
arghhhhh Oct 9, 2026
826d7d6
test(scripts): cover install-from-source on Windows and Linux CI
arghhhhh Oct 9, 2026
f7a4a3a
chore(deps): bump the npm_and_yarn group with 3 updates
dependabot[bot] Oct 12, 2026
742a492
chore(deps): bump the cargo group with 4 updates
dependabot[bot] Oct 12, 2026
9154821
Merge pull request #482 from akiojin/dependabot/npm_and_yarn/develop/…
akiojin Oct 12, 2026
fb950c5
Merge branch 'develop' into dependabot/cargo/develop/cargo-54506f75e3
akiojin Oct 12, 2026
48bc175
Merge pull request #483 from akiojin/dependabot/cargo/develop/cargo-5…
akiojin Oct 12, 2026
7897420
Merge branch 'develop' into docs/skills-parameter-names
akiojin Oct 12, 2026
486d523
Merge branch 'develop' into feat/install-from-source
akiojin Oct 12, 2026
fcece1d
Merge branch 'develop' into fix/no-auto-update-daemon-start
akiojin Oct 12, 2026
145016a
Merge pull request #478 from arghhhhh/docs/skills-parameter-names
akiojin Oct 13, 2026
f3e1d95
Merge branch 'develop' into feat/install-from-source
akiojin Oct 13, 2026
69d4cbe
docs(readme): split install instructions into LLM-prompt and manual p…
akiojin Oct 13, 2026
4a255ba
Merge branch 'develop' into fix/no-auto-update-daemon-start
akiojin Oct 13, 2026
230fc91
Merge branch 'develop' into work/issue-484
akiojin Oct 13, 2026
42cf483
Merge pull request #485 from akiojin/work/issue-484
akiojin Oct 13, 2026
f088e94
Merge branch 'develop' into feat/install-from-source
akiojin Oct 13, 2026
5e268cf
Merge branch 'develop' into fix/no-auto-update-daemon-start
akiojin Oct 13, 2026
d7fc362
Merge pull request #479 from arghhhhh/fix/no-auto-update-daemon-start
akiojin Oct 13, 2026
656b1fb
Merge branch 'develop' into feat/install-from-source
akiojin Oct 13, 2026
3f85f41
Merge pull request #481 from arghhhhh/feat/install-from-source
akiojin Oct 13, 2026
91f7ac8
docs(readme): make the LLM install prompt also update the CLI and the…
akiojin Oct 13, 2026
0c5744f
Merge branch 'develop' into work/issue-487
akiojin Oct 13, 2026
72beaa2
Merge pull request #489 from akiojin/work/issue-487
akiojin Oct 13, 2026
b506174
fix(skills): route C# script creation and fixes through the LSP write…
akiojin Oct 13, 2026
8d8ec51
ci(auto-merge): auto-merge reviewed external PRs pinned to the labele…
akiojin Oct 13, 2026
8176567
Merge pull request #492 from akiojin/work/issue-486
akiojin Oct 13, 2026
636c205
Merge branch 'develop' into work/issue-488
akiojin Oct 13, 2026
e60b9da
feat(lsp): make LSP the default backend for C# symbol search
akiojin Oct 13, 2026
ef46458
Merge pull request #493 from akiojin/work/issue-488
akiojin Oct 13, 2026
ac0bc40
Merge remote-tracking branch 'origin/develop' into work/issue-491
akiojin Oct 13, 2026
d8d8d76
fix(skills): add the LSP write-tool failure fallback to unity-csharp-…
akiojin Oct 13, 2026
c350f43
Merge pull request #496 from akiojin/work/issue-494
akiojin Oct 13, 2026
6031ade
fix(lsp): keep write tools on the direct LSP session when the mode is…
akiojin Oct 13, 2026
91ad357
Merge remote-tracking branch 'origin/develop' into work/issue-491
akiojin Oct 13, 2026
7f8982c
Merge pull request #495 from akiojin/work/issue-491
akiojin Oct 13, 2026
dc2a718
test(lsp): measure cross-platform write reliability
akiojin Oct 13, 2026
41574a6
test(ci): gate LSP measurements through a required check
akiojin Oct 13, 2026
5950388
Merge branch 'develop' into work/issue-490
akiojin Oct 13, 2026
61cbc6d
chore(work): record issue 490 PR handoff
akiojin Oct 13, 2026
3834ade
fix(test): tolerate case-insensitive LSP server aliases in the reliab…
akiojin Oct 13, 2026
96e6487
test(lsp): handle case-insensitive executable aliases
akiojin Oct 13, 2026
64b973f
chore(sync): integrate concurrent issue 490 CI recovery
akiojin Oct 13, 2026
90f8f1b
docs(lsp): link registered reliability defects
akiojin Oct 13, 2026
c6b442e
fix(lsp): keep trailing comments when replace_symbol_body replaces a …
akiojin Oct 13, 2026
1a5291e
fix(lsp): add using UnityEngine to ScriptableObject classes from crea…
akiojin Oct 13, 2026
ffddf63
Merge pull request #502 from akiojin/work/issue-500
akiojin Oct 13, 2026
c100c00
Merge branch 'develop' into work/issue-499
akiojin Oct 13, 2026
4bef002
Merge remote-tracking branch 'origin/develop' into work/issue-490
akiojin Oct 13, 2026
8d5b5a9
Merge pull request #503 from akiojin/work/issue-499
akiojin Oct 13, 2026
c2b4704
test(lsp): gate the ScriptableObject template fix and sample cold starts
akiojin Oct 13, 2026
abc193e
Merge remote-tracking branch 'origin/develop' into work/issue-490
akiojin Oct 13, 2026
8078a94
Merge branch 'develop' into work/issue-490
akiojin Oct 13, 2026
e4d4406
test(ci): bound PR cold samples and budget weekly measurements
akiojin Oct 13, 2026
190602e
test(lsp): enforce the trailing-comment fix on the checkout LSP
akiojin Oct 13, 2026
be35d3f
Merge remote-tracking branch 'origin/work/issue-490' into work/issue-490
akiojin Oct 13, 2026
18bc3b8
test(lsp): reject fixed comment loss in checkout measurements
akiojin Oct 13, 2026
9110e05
chore(sync): integrate the published LSP regression gate
akiojin Oct 13, 2026
18be4b1
test(lsp): pin known published defects to the measured release
akiojin Oct 13, 2026
a07409f
fix(lsp): wait for a live auto-started lspd instead of failing after …
akiojin Oct 13, 2026
f1c6ea6
Merge pull request #505 from akiojin/work/issue-501
akiojin Oct 13, 2026
b5a4059
test(ci): take three cold-start samples per cell for the #490 report
akiojin Oct 13, 2026
b73ad8e
Merge branch 'develop' into work/issue-490
akiojin Oct 13, 2026
877aadd
test(ci): isolate repeated cold samples to the initial report
akiojin Oct 13, 2026
434ce6b
Merge pull request #497 from akiojin/work/issue-490
akiojin Oct 13, 2026
626c1e5
fix(lsp): bound Windows daemon connection retries
akiojin Oct 13, 2026
b3c032d
fix(lsp): keep the original BOM and newlines when C# LSP write tools …
akiojin Oct 13, 2026
923e255
docs(lsp): report the three-OS reliability matrix and the enforcement…
akiojin Oct 13, 2026
9955648
Merge remote-tracking branch 'origin/develop' into work/issue-490
akiojin Oct 13, 2026
53c8b2d
Merge remote-tracking branch 'origin/develop' into work/issue-498
akiojin Oct 13, 2026
b8beff9
test(lsp): reject checkout BOM additions in the write reliability gate
akiojin Oct 13, 2026
e6fa006
Merge pull request #506 from akiojin/work/issue-504
akiojin Oct 13, 2026
72c583a
Merge remote-tracking branch 'origin/work/issue-490' into work/issue-509
akiojin Oct 13, 2026
6edbdb6
fix(test): wait for lspd shutdown before deleting a reliability trial
akiojin Oct 13, 2026
2bd6c3b
Merge branch 'develop' into work/issue-498
akiojin Oct 13, 2026
9315374
Merge pull request #510 from akiojin/work/issue-509
akiojin Oct 13, 2026
e634773
Merge branch 'develop' into work/issue-498
akiojin Oct 13, 2026
12f743c
Merge pull request #507 from akiojin/work/issue-498
akiojin Oct 13, 2026
0236e75
fix(lsp): resolve canonical file URIs across Windows and Unix
akiojin Oct 13, 2026
514c563
chore(work): record pull request for issue 511
akiojin Oct 13, 2026
63f0e7d
fix(lsp): keep UTF-32 BE BOMs and CR-only newlines when saving C# files
akiojin Oct 13, 2026
97e760a
chore(work): record work events for #498
akiojin Oct 13, 2026
68a3672
fix(lsp): negotiate file URI encoding with older servers
akiojin Oct 13, 2026
bcf7f3a
chore(work): record work events for #498
akiojin Oct 13, 2026
02783f0
fix(install): retry transient download errors and wait for the test r…
akiojin Oct 13, 2026
8cf14d4
Merge pull request #512 from akiojin/work/issue-511
akiojin Oct 13, 2026
fbbc47f
Merge branch 'develop' into work/issue-498
akiojin Oct 13, 2026
2e744ff
Merge branch 'develop' into work/issue-514
akiojin Oct 13, 2026
e413d7c
Merge pull request #513 from akiojin/work/issue-498
akiojin Oct 13, 2026
40b6e98
Merge branch 'develop' into work/issue-514
akiojin Oct 13, 2026
973dc3f
Merge pull request #515 from akiojin/work/issue-514
akiojin Oct 13, 2026
d3359d6
fix(lsp): normalize lone CR in edits to the file's newline style (#516)
akiojin Oct 14, 2026
69ad5ab
Merge pull request #517 from akiojin/work/issue-516
akiojin Oct 14, 2026
8f15477
fix(lsp): preserve string CRs in all preprocessor branches
akiojin Oct 14, 2026
0c99d8e
Merge branch 'develop' into work/issue-516
akiojin Oct 14, 2026
63d10ee
fix(lsp): recognize all whitespace before directive names
akiojin Oct 14, 2026
e8a6189
chore(work): record Work events for #516 verification
akiojin Oct 14, 2026
22de281
fix(lsp): parse each preprocessor branch in isolation for string CRs
akiojin Oct 14, 2026
02dbdea
fix(lsp): activate each skipped branch to find its real extent
akiojin Oct 14, 2026
f511815
perf(lsp): skip string-literal parsing when input has no lone CR
akiojin Oct 14, 2026
d435a0b
fix(lsp): handle long branch directives and fake directive paths
akiojin Oct 14, 2026
653d81a
fix(lsp): keep CRs any well-formed parse reads as string content
akiojin Oct 14, 2026
5bb3ace
fix(lsp): preserve literal CRs across malformed nested branches
akiojin Oct 14, 2026
1c39ad8
Merge pull request #518 from akiojin/work/issue-516
akiojin Oct 14, 2026
48d44dc
fix(lsp): integrate branch scans and nested literal regressions
akiojin Oct 14, 2026
5ce38e6
chore: synchronize develop after PR 518
akiojin Oct 14, 2026
06d7765
chore(work): record issue 516 pull request delivery
akiojin Oct 14, 2026
2b03c7e
fix(lsp): align closed-string preservation with newline input matrix
akiojin Oct 14, 2026
74806ad
Merge pull request #519 from akiojin/work/issue-516
akiojin Oct 14, 2026
9b30e39
fix(lsp): keep closed-string CRs in branches hidden by unterminated l…
akiojin Oct 14, 2026
93109dc
perf(lsp): solve each preprocessor group once and bound the CR scan
akiojin Oct 14, 2026
ac865de
fix(lsp): preserve nested literals and oracle string content
akiojin Oct 14, 2026
f776aaa
chore(merge): combine AC-2 fixes and bounded scanning
akiojin Oct 14, 2026
01a0e62
Merge pull request #521 from akiojin/work/issue-520
akiojin Oct 14, 2026
69d5d8d
chore(deps): bump the npm_and_yarn group with 3 updates
dependabot[bot] Oct 19, 2026
2a79fbf
Merge pull request #524 from akiojin/dependabot/npm_and_yarn/develop/…
akiojin Oct 19, 2026
593bb7c
fix(deps): migrate to zip 9 and bump cargo group (#525)
akiojin Oct 19, 2026
1e36987
Merge pull request #526 from akiojin/work/issue-525
akiojin Oct 19, 2026
c15b84f
chore(work): record issue 522 release work events
akiojin Oct 19, 2026
907d612
chore(release): v0.19.0
akiojin Oct 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .claude-plugin/plugins/unity-cli/agents/unity-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You are a Unity automation specialist. Execute multi-step workflows using `unity

### Code Scaffold

1. Create class with `create_class` or `create_csharp_file` → update code with `write_csharp_file` or `apply_csharp_edits` → build or update index → check compilation state
1. Create the script with `create_csharp_file` (LSP-validated; `create_class` is only an empty-class shortcut on the same LSP path) → update code with `write_csharp_file`, `apply_csharp_edits`, or symbol edits → build or update index → check compilation state → fix compile errors with the same LSP write tools, never with direct file edits

### Test Cycle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

- A failed `system ping` does not prove the Editor is closed. Run `unity-cli doctor --output json` (add `--project-path <dir>` outside the project) before any fallback such as hand-editing YAML.
- Act on the `diagnosis` code:
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) by editing the file directly, then let Unity recompile or restart the Editor.
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) with the LSP write tools (`apply_csharp_edits`, `replace_symbol_body`, `write_csharp_file`); they run locally and do not need the bridge. Then let Unity recompile or restart the Editor.
- `BRIDGE_NOT_INSTALLED`: run `unity-cli setup` (or `unity-cli bridge install`) to add `com.akiojin.unity-cli-bridge` to `Packages/manifest.json`.
- `PORT_IN_USE`: `port.listenerPid` / `port.listenerProcess` hold the port. Stop it or change the bridge port and pass the same `--port`.
- `EDITOR_NOT_RUNNING`: start the Editor for the project and wait for import to finish.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

- A failed `system ping` does not prove the Editor is closed. Run `unity-cli doctor --output json` (add `--project-path <dir>` outside the project) before any fallback such as hand-editing YAML.
- Act on the `diagnosis` code:
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) by editing the file directly, then let Unity recompile or restart the Editor.
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) with the LSP write tools (`apply_csharp_edits`, `replace_symbol_body`, `write_csharp_file`); they run locally and do not need the bridge. Then let Unity recompile or restart the Editor.
- `BRIDGE_NOT_INSTALLED`: run `unity-cli setup` (or `unity-cli bridge install`) to add `com.akiojin.unity-cli-bridge` to `Packages/manifest.json`.
- `PORT_IN_USE`: `port.listenerPid` / `port.listenerProcess` hold the port. Stop it or change the bridge port and pass the same `--port`.
- `EDITOR_NOT_RUNNING`: start the Editor for the project and wait for import to finish.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ completion and inspect that call's exit code.

- A failed `system ping` does not prove the Editor is closed. Run `unity-cli doctor --output json` (add `--project-path <dir>` outside the project) before any fallback such as hand-editing YAML.
- Act on the `diagnosis` code:
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) by editing the file directly, then let Unity recompile or restart the Editor.
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) with the LSP write tools (`apply_csharp_edits`, `replace_symbol_body`, `write_csharp_file`); they run locally and do not need the bridge. Then let Unity recompile or restart the Editor.
- `BRIDGE_NOT_INSTALLED`: run `unity-cli setup` (or `unity-cli bridge install`) to add `com.akiojin.unity-cli-bridge` to `Packages/manifest.json`.
- `PORT_IN_USE`: `port.listenerPid` / `port.listenerProcess` hold the port. Stop it or change the bridge port and pass the same `--port`.
- `EDITOR_NOT_RUNNING`: start the Editor for the project and wait for import to finish.
Expand Down
30 changes: 26 additions & 4 deletions .claude-plugin/plugins/unity-cli/skills/unity-csharp-edit/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
---
name: unity-csharp-edit
description: Implement, fix, and refactor Unity C# code with unity-cli write tools. Use when the user wants to change behavior in .cs files, create or rewrite scripts, update multiple C# files together, rename a symbol, add or remove members, or change project or package settings as part of a code change. Do not use for read-only inspection with no planned edit; use `unity-csharp-navigate` instead.
description: Implement, fix, and refactor Unity C# code with unity-cli write tools. Use when the user wants to change behavior in .cs files, create a new script, class, MonoBehaviour or ScriptableObject, rewrite scripts, fix compile errors, update multiple C# files together, rename a symbol, add or remove members, or change project or package settings as part of a code change. Do not use for read-only inspection with no planned edit; use `unity-csharp-navigate` instead.
allowed-tools: Bash(unity-cli:*), Read, Grep, Glob, Edit, Write
metadata:
author: akiojin
version: 0.3.0
version: 0.3.2
category: code
triggers:
- csharp
- script
- new script
- class
- monobehaviour
- scriptableobject
- compile error
- rename
- refactor
- symbol
Expand All @@ -31,7 +36,8 @@ Implement Unity C# changes with `unity-cli` as the primary write path. Prefer th
## Use When

- The user intends to change C# behavior in `.cs` files.
- The user wants to create or rewrite scripts (single or coordinated multi-file).
- The user wants to create a new script, class, `MonoBehaviour`, or `ScriptableObject`, or rewrite scripts (single or coordinated multi-file).
- The user wants to fix C# compile errors.
- The user asks for a symbol rename, member add/remove, or refactor.
- The user changes project or package settings as part of a code change.

Expand All @@ -44,22 +50,38 @@ Implement Unity C# changes with `unity-cli` as the primary write path. Prefer th

## Preferred Flow

1. Decide the write shape: symbol edit, full-file write, multi-file write, or settings change.
1. Decide the write shape: new file, symbol edit, full-file write, multi-file write, or settings change. Always write `.cs` files through the LSP write tools (`create_csharp_file`, `write_csharp_file`, `apply_csharp_edits`, symbol edits) so the text is validated before it lands; do not hand-write `.cs` files with direct file edits unless the LSP write path fails (see LSP Write Failure Fallback).
2. Read only the minimum context with `read`, `get_symbols`, `find_symbol`, or `find_refs`.
3. Preview risky symbol edits with `apply: false`.
4. Apply with `refresh`, `waitForCompile`, and `updateIndex` when later steps depend on clean diagnostics.
5. Inspect `changedFiles`, `changedSymbols`, and `diagnostics`; fix compilation issues before unrelated follow-up.

```bash
unity-cli raw create_csharp_file --json '{"relative":"Assets/Scripts/EnemyAI.cs","text":"using UnityEngine;\n\npublic class EnemyAI : MonoBehaviour\n{\n}\n","validate":true,"apply":true,"waitForCompile":true,"updateIndex":true}'
unity-cli raw get_symbols --json '{"path":"Assets/Scripts/Player.cs"}'
unity-cli raw rename_symbol --json '{"relative":"Assets/Scripts/Player.cs","namePath":"Player/Jump","newName":"Leap","apply":false}'
unity-cli raw apply_csharp_edits --json '{"files":[{"relative":"Assets/Scripts/IPlayerMover.cs","newText":"public interface IPlayerMover { void Move(); }\n"}],"validate":true,"apply":true,"waitForCompile":true,"updateIndex":true}'
unity-cli raw get_compilation_state --json '{}'
```

## LSP Write Failure Fallback

Use this only when an LSP write tool fails: the LSP server fails to start, the call times out, or the tool returns an unsupported-edit error. Retry once if the failure looks transient; do not stop the task.

1. Make the same change with your own `Edit` (existing file) or `Write` (new file). Keep it identical in scope to the intended LSP write.
2. Refresh and confirm compilation with `unity-cli`:
```bash
unity-cli raw refresh_assets --json '{}'
unity-cli raw get_compilation_state --json '{}'
```
Fix any reported errors before continuing; if the Editor is unreachable, say so and leave compilation unconfirmed.
3. In your work report, state that the LSP path was not used, which tool failed, and why (error code or message).

## Examples

- "Implement dash cooldown in `PlayerController.cs` and update the related tests."
- "Create an `EnemyAI` MonoBehaviour in `Assets/Scripts/AI`."
- "Fix the compile error in `PlayerController.cs`."
- "Rename `Jump` to `Leap` across the player package without breaking serialized field names."
- "Create a new editor utility script and change the matching project setting."
- "Refactor an interface, its implementation, and the tests in one coordinated write."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ Recommended options:

## Choose `create_csharp_file` When

- You need a new file that is not just a standard class shell.
- The file should contain an interface, enum, test fixture, editor utility, or multiple types.
- You need any new `.cs` file: a class, `MonoBehaviour`, `ScriptableObject`, interface, enum, test fixture, editor utility, or multiple types.
- You want the same validated write contract as `write_csharp_file`.

Use `create_class` only when the class template itself is the useful shortcut.
`create_class` is a shortcut for an empty class shell (`name`, `folder`, optional `namespace` / `inherits`). It writes through the same LSP path as `create_csharp_file`, so both are safe; prefer `create_csharp_file` when the file needs members.

## Choose `apply_csharp_edits` When

Expand All @@ -56,6 +55,7 @@ Keep the `files` array minimal and coherent. If files are unrelated, split the t
## Example Paths

```bash
unity-cli raw create_csharp_file --json '{"relative":"Assets/Scripts/EnemyAI.cs","text":"using UnityEngine;\n\npublic class EnemyAI : MonoBehaviour\n{\n}\n","validate":true,"apply":true,"waitForCompile":true,"updateIndex":true}'
unity-cli raw replace_symbol_body --json '{"relative":"Assets/Scripts/PlayerController.cs","namePath":"PlayerController/Move","body":"{ transform.position += direction * speed * Time.deltaTime; }","apply":false}'
unity-cli raw write_csharp_file --json '{"relative":"Assets/Scripts/PlayerController.cs","newText":"using UnityEngine;\n\npublic sealed class PlayerController : MonoBehaviour {}\n","validate":true,"apply":true,"waitForCompile":true,"updateIndex":true}'
unity-cli raw apply_csharp_edits --json '{"files":[{"relative":"Assets/Scripts/IPlayerMover.cs","newText":"public interface IPlayerMover { void Move(); }\n"},{"relative":"Assets/Scripts/PlayerMover.cs","newText":"public sealed class PlayerMover : IPlayerMover { public void Move() {} }\n"},{"relative":"Assets/Tests/EditMode/PlayerMoverTests.cs","newText":"using NUnit.Framework;\n\npublic class PlayerMoverTests {}\n"}],"validate":true,"apply":true,"waitForCompile":true,"updateIndex":true}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@
3. Run `get_compilation_state` for non-trivial edits or when diagnostics are still unclear.
4. Report and fix real diagnostics before attempting unrelated follow-up changes.

## Class Creation
## New Files

- Use `create_class` for new files instead of hand-writing boilerplate when possible.
- Use `create_csharp_file` for every new `.cs` file (classes, `MonoBehaviour`, `ScriptableObject`, interfaces, enums, tests). It validates the text through LSP before writing.
- `create_class` (`name`, `folder`, optional `namespace` / `inherits`) is a shortcut that renders an empty class shell and writes it through the same LSP path as `create_csharp_file`. Prefer `create_csharp_file` when the file needs any members.
- Do not create or edit `.cs` files with direct file writes; they skip LSP validation. The only exception is the `LSP Write Failure Fallback` in `SKILL.md`.
- Use `validate_text_edits` when constructing larger manual replacements.

## Compile Error Fixes

- Read the error `file` / `line` from `get_compilation_state` or `editorLog.compileErrors[]`.
- Fix it with the smallest LSP write: `replace_symbol_body` for one member, `write_csharp_file` for one file, `apply_csharp_edits` when several files must change together.
- These tools run locally, so they work in `SAFE_MODE` when the bridge is not loaded.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- A failed `system ping` does not prove the Editor is closed. Run `unity-cli doctor --output json` (add `--project-path <dir>` outside the project) before any fallback such as hand-editing YAML.
- Act on the `diagnosis` code:
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) by editing the file directly, then let Unity recompile or restart the Editor.
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) with the LSP write tools (`apply_csharp_edits`, `replace_symbol_body`, `write_csharp_file`); they run locally and do not need the bridge. Then let Unity recompile or restart the Editor.
- `BRIDGE_NOT_INSTALLED`: add `com.akiojin.unity-cli-bridge` to `Packages/manifest.json`.
- `PORT_IN_USE`: `port.listenerPid` / `port.listenerProcess` hold the port. Stop it or change the bridge port and pass the same `--port`.
- `EDITOR_NOT_RUNNING`: start the Editor for the project and wait for import to finish.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ Modify existing GameObjects and their components in an already-prepared scene. T
4. Reserve `delete_gameobject` and `remove_component` for confirmed scopes.
5. Save the scene after destructive or bulk updates so reloads do not lose work.

## Target Parameter Names

The key that names the target object differs by tool. A wrong key fails locally with `INVALID_ARGUMENT` (`$.<key> is required` or `$.<key> is not allowed`) before reaching Unity.

| Key | Tools |
| ---------------- | ------------------------------------------------------------------------------------------------- |
| `path` | `modify_gameobject` (its `name` renames), `delete_gameobject` (`paths` for several) |
| `gameObjectPath` | `add_component`, `modify_component`, `set_component_field`, `remove_component`, `list_components` |
| `name` | `find_gameobject`, `create_gameobject` (parent via `parentPath`) |
| `gameObjectName` | read-only queries such as `get_component_values`; see `unity-scene-inspect` |

When unsure, read the schema: `unity-cli tool schema <tool_name> --output json`.

```bash
unity-cli raw modify_gameobject --json '{"path":"/Player","name":"Hero","active":true}'
unity-cli raw add_component --json '{"gameObjectPath":"/Player","componentType":"Rigidbody"}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

- A failed `system ping` does not prove the Editor is closed. Run `unity-cli doctor --output json` (add `--project-path <dir>` outside the project) before any fallback such as hand-editing YAML.
- Act on the `diagnosis` code:
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) by editing the file directly, then let Unity recompile or restart the Editor.
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) with the LSP write tools (`apply_csharp_edits`, `replace_symbol_body`, `write_csharp_file`); they run locally and do not need the bridge. Then let Unity recompile or restart the Editor.
- `BRIDGE_NOT_INSTALLED`: run `unity-cli setup` (or `unity-cli bridge install`) to add `com.akiojin.unity-cli-bridge` to `Packages/manifest.json`.
- `PORT_IN_USE`: `port.listenerPid` / `port.listenerProcess` hold the port. Stop it or change the bridge port and pass the same `--port`.
- `EDITOR_NOT_RUNNING`: start the Editor for the project and wait for import to finish.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

- A failed `system ping` does not prove the Editor is closed. Run `unity-cli doctor --output json` (add `--project-path <dir>` outside the project) before any fallback such as hand-editing YAML.
- Act on the `diagnosis` code:
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) by editing the file directly, then let Unity recompile or restart the Editor.
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) with the LSP write tools (`apply_csharp_edits`, `replace_symbol_body`, `write_csharp_file`); they run locally and do not need the bridge. Then let Unity recompile or restart the Editor.
- `BRIDGE_NOT_INSTALLED`: run `unity-cli setup` (or `unity-cli bridge install`) to add `com.akiojin.unity-cli-bridge` to `Packages/manifest.json`.
- `PORT_IN_USE`: `port.listenerPid` / `port.listenerProcess` hold the port. Stop it or change the bridge port and pass the same `--port`.
- `EDITOR_NOT_RUNNING`: start the Editor for the project and wait for import to finish.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ Inspect scene hierarchy, find objects, and read component data without mutating
3. Inspect targets with `get_gameobject_details`, `get_component_values`, or animator queries.
4. Use `analyze_scene_contents` with `includeInactive` for broad audits.

## Target Parameter Names

Read-only queries name their target differently from the edit tools. A wrong key fails locally with `INVALID_ARGUMENT` before reaching Unity.

| Key | Tools |
| -------------------------- | -------------------------------------------------------------------------------------------------- |
| `gameObjectName` | `get_component_values`, `get_object_references`, `get_animator_state`, `get_animator_runtime_info` |
| `gameObjectName` or `path` | `get_gameobject_details` |
| `name` | `find_gameobject` |
| `rootPath` | `get_hierarchy` |

`gameObjectName` takes a name or a hierarchy path such as `/Root/Child`. Edit tools use `path` or `gameObjectPath` instead; see `unity-gameobject-edit`. When unsure: `unity-cli tool schema <tool_name> --output json`.

```bash
unity-cli raw get_hierarchy --json '{"nameOnly":true}'
unity-cli raw find_gameobject --json '{"name":"Player"}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

- A failed `system ping` does not prove the Editor is closed. Run `unity-cli doctor --output json` (add `--project-path <dir>` outside the project) before any fallback such as hand-editing YAML.
- Act on the `diagnosis` code:
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) by editing the file directly, then let Unity recompile or restart the Editor.
- `SAFE_MODE` / `COMPILE_ERRORS`: the bridge is not loaded. Fix each `editorLog.compileErrors[]` entry (`file`, `line`, `code`) with the LSP write tools (`apply_csharp_edits`, `replace_symbol_body`, `write_csharp_file`); they run locally and do not need the bridge. Then let Unity recompile or restart the Editor.
- `BRIDGE_NOT_INSTALLED`: run `unity-cli setup` (or `unity-cli bridge install`) to add `com.akiojin.unity-cli-bridge` to `Packages/manifest.json`.
- `PORT_IN_USE`: `port.listenerPid` / `port.listenerProcess` hold the port. Stop it or change the bridge port and pass the same `--port`.
- `EDITOR_NOT_RUNNING`: start the Editor for the project and wait for import to finish.
Expand Down
Loading
Loading