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
81 changes: 0 additions & 81 deletions .agents/skills/link-go-cli/SKILL.md

This file was deleted.

3 changes: 1 addition & 2 deletions .agents/skills/uloop-clear-console/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ Returns JSON with:
- `errorCount` (number): Errors cleared
- `warningCount` (number): Warnings cleared
- `logCount` (number): Info logs cleared
- `message` (string): Description of the result; carries the failure summary when the operation fails (e.g. `"Failed to clear console: ..."`)
- `errorMessage` (string): Currently always empty for this tool — read `message` for failure details
- `message` (string): Description of the result. On failure, this field carries the error summary.
7 changes: 2 additions & 5 deletions .agents/skills/uloop-control-play-mode/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ Returns JSON with the current play mode state:

## Notes

- Play action starts the game in the Unity Editor (also resumes from pause)
- Stop action exits play mode and returns to edit mode. If Play Mode was already stopped, `changed` is `false`, `wasAlreadyStopped` is `true`, and `message` is `Play mode was already stopped`.
- Pause action pauses the game while remaining in play mode
- Step action advances exactly one frame and leaves play mode paused (the Editor's Next Frame button; independent of Time.timeScale). Requires PlayMode to be running; repeat to walk transitions frame by frame
- Useful for automated testing workflows
- Stop on an already-stopped Editor sets `changed: false`, `wasAlreadyStopped: true`
- Step is independent of `Time.timeScale`; requires PlayMode to be running
- The command waits for the requested state before returning. Increase `--timeout-seconds` for projects with slow PlayMode entry.
6 changes: 2 additions & 4 deletions .agents/skills/uloop-execute-dynamic-code/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ This tool can inspect reachable Unity state, such as GameObjects, components, pu
1. Read the relevant reference file(s) from the Code Examples section below
2. Construct C# code based on the reference examples
3. Execute with `--code` or `--code-file` using the active shell's quoting guidance
4. If execution fails, adjust code and retry
5. Report the execution result
4. Report the execution result

## Parameters

Expand Down Expand Up @@ -48,8 +47,7 @@ Returns JSON:
- `result`: string — value of the snippet's `return` statement (empty when omitted)
- `logs`: string[] — execution messages from the dynamic-code tool; read Unity Console `Debug.Log` output with `get-logs`
- `compilationErrors`: object[] — Roslyn diagnostics with `message`, `line`, `column`, `errorCode`, optional `hint` and `suggestions`
- `errorMessage`: string — top-level failure summary (empty on success)
- `error`: string — alias of `errorMessage`
- `error` / `errorMessage`: string — top-level failure summary (empty on success)
- `updatedCode`: string|null — the wrapped form actually compiled (handy when debugging using-statement reordering)
- `diagnosticsSummary`: string|null — compact summary when diagnostics are available
- `diagnostics`: object[] — structured diagnostics; same shape as `compilationErrors`, usually populated together with it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,25 @@

Code examples for AssetDatabase operations using `execute-dynamic-code`.

## Find Assets by Type
## Find Assets

```csharp
using UnityEditor;
using System.Collections.Generic;

string[] prefabGuids = AssetDatabase.FindAssets("t:Prefab");
List<string> paths = new List<string>();

foreach (string guid in prefabGuids)
{
paths.Add(AssetDatabase.GUIDToAssetPath(guid));
}
return $"Found {paths.Count} prefabs";
```

## Find Assets by Name
// By type
string[] guids = AssetDatabase.FindAssets("t:Prefab");
// By name
// string[] guids = AssetDatabase.FindAssets("Player");
// By type in folder
// string[] guids = AssetDatabase.FindAssets("t:Prefab", new[] { "Assets/Prefabs" });

```csharp
using UnityEditor;
using System.Collections.Generic;

string searchName = "Player";
string[] guids = AssetDatabase.FindAssets(searchName);
List<string> paths = new List<string>();

foreach (string guid in guids)
{
paths.Add(AssetDatabase.GUIDToAssetPath(guid));
}
return $"Found {paths.Count} assets matching '{searchName}'";
```

## Find Assets in Folder

```csharp
using UnityEditor;
using System.Collections.Generic;

string folder = "Assets/Prefabs";
string[] guids = AssetDatabase.FindAssets("t:Prefab", new[] { folder });
List<string> paths = new List<string>();

foreach (string guid in guids)
{
paths.Add(AssetDatabase.GUIDToAssetPath(guid));
}
return $"Found {paths.Count} prefabs in {folder}";
return $"Found {paths.Count} assets";
```

## Duplicate Asset
Expand All @@ -76,7 +47,7 @@ string error = AssetDatabase.MoveAsset(sourcePath, destPath);
return string.IsNullOrEmpty(error) ? $"Moved to {destPath}" : $"Error: {error}";
```

## Rename Asset
## Rename Asset (no Undo)

```csharp
using UnityEditor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,56 +78,27 @@ Undo.CollapseUndoOperations(undoGroup);
return $"Removed {totalRemoved} missing scripts from scene";
```

## Detect Missing References in Component
## Scan for Missing References

Scans the entire scene by default. Set `scanSelectionOnly` to `true` only when the task asks for the selected GameObject.

```csharp
using UnityEditor;

bool scanSelectionOnly = false;
GameObject selected = Selection.activeGameObject;
if (selected == null)
if (scanSelectionOnly && selected == null)
{
return "No GameObject selected";
}

List<string> missingRefs = new List<string>();

Component[] components = selected.GetComponents<Component>();
foreach (Component comp in components)
{
if (comp == null) continue;

SerializedObject so = new SerializedObject(comp);
SerializedProperty prop = so.GetIterator();

while (prop.NextVisible(true))
{
if (prop.propertyType == SerializedPropertyType.ObjectReference)
{
if (prop.objectReferenceValue == null && prop.objectReferenceInstanceIDValue != 0)
{
missingRefs.Add($"{comp.GetType().Name}.{prop.name}");
}
}
}
}
GameObject[] targets = scanSelectionOnly
? new[] { selected }
: Object.FindObjectsByType<GameObject>(FindObjectsSortMode.None);

if (missingRefs.Count == 0)
{
return "No missing references found";
}

return $"Missing references: {string.Join(", ", missingRefs)}";
```

## Scan Scene for Missing References

```csharp
using UnityEditor;

GameObject[] allObjects = Object.FindObjectsByType<GameObject>(FindObjectsSortMode.None);
List<string> results = new List<string>();

foreach (GameObject obj in allObjects)
foreach (GameObject obj in targets)
{
Component[] components = obj.GetComponents<Component>();
foreach (Component comp in components)
Expand All @@ -152,10 +123,10 @@ foreach (GameObject obj in allObjects)

if (results.Count == 0)
{
return "No missing references found in scene";
return "No missing references found";
}

return $"Missing references ({results.Count}): {string.Join(", ", results.Take(10))}...";
return $"Missing references ({results.Count}): {string.Join(", ", results.Take(10))}";
```

## Find Unused Materials in Project
Expand Down Expand Up @@ -196,31 +167,6 @@ foreach (string guid in materialGuids)
return $"Found {unusedMaterials.Count} materials not referenced by prefabs. Verify scene and other asset references manually before deleting.";
```

## Find Empty GameObjects

```csharp
using UnityEditor;

GameObject[] allObjects = Object.FindObjectsByType<GameObject>(FindObjectsSortMode.None);
List<string> emptyObjects = new List<string>();

foreach (GameObject obj in allObjects)
{
Component[] components = obj.GetComponents<Component>();
if (components.Length == 1 && obj.transform.childCount == 0)
{
emptyObjects.Add(obj.name);
}
}

if (emptyObjects.Count == 0)
{
return "No empty GameObjects found";
}

return $"Empty objects ({emptyObjects.Count}): {string.Join(", ", emptyObjects.Take(20))}";
```

## Find Duplicate Names in Hierarchy

```csharp
Expand Down Expand Up @@ -311,31 +257,30 @@ if (negativeScale.Count == 0)
return $"Negative scale objects: {string.Join(", ", negativeScale.Take(10))}";
```

## Remove Empty Leaf GameObjects
## Find Empty Leaf GameObjects

```csharp
using UnityEditor;

GameObject[] allObjects = Object.FindObjectsByType<GameObject>(FindObjectsSortMode.None);

int undoGroup = Undo.GetCurrentGroup();
Undo.SetCurrentGroupName("Remove Empty Leaves");

int removedCount = 0;
List<string> emptyObjects = new List<string>();
foreach (GameObject obj in allObjects)
{
if (obj == null) continue;

Component[] components = obj.GetComponents<Component>();
if (components.Length == 1 && obj.transform.childCount == 0)
{
Undo.DestroyObjectImmediate(obj);
removedCount++;
emptyObjects.Add(obj.name);
}
}

Undo.CollapseUndoOperations(undoGroup);
return $"Removed {removedCount} empty leaf GameObjects";
if (emptyObjects.Count == 0)
{
return "No empty leaf GameObjects found";
}

return $"Empty leaf GameObjects ({emptyObjects.Count}): {string.Join(", ", emptyObjects.Take(20))}";
```

## Find Large Meshes
Expand Down
Loading