Skip to content
Back to skills

Unity Csharp Editing

ASecurity

Use when creating or changing Unity C# files, preflighting code, waiting for compilation, writing focused tests, or renaming serialized fields.

  • 34 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 16, 2026
ai-agentsc#testing

Works with

  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 16, 2026

npx -y skills add german-krasnikov/unity-biome-mcp --skill unity-csharp-editing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Unity Csharp Editing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Unity Csharp Editing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/german-krasnikov-unity-csharp-editing/badge)](https://www.skillsdirectory.com/skills/german-krasnikov-unity-csharp-editing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: unity-csharp-editing
description: Use when creating or changing Unity C# files, preflighting code, waiting for compilation, writing focused tests, or renaming serialized fields.
---

# Unity C# Editing

Read `.claude/skills/unity-mcp-operations/SKILL.md` once if it is not already
loaded. This skill covers code in the consumer's Unity project; follow that
project's assemblies, test framework, fixture hierarchy, and style.

## Workflow

1. Read the complete target file, direct callers, and nearby tests.
2. Mark the console before editing.
3. Prepare the complete proposed file content.
4. Preflight it:

```text
compile_preflight(
  file_path="Assets/Scripts/FeatureController.cs",
  new_content="<complete proposed file>"
)
```

5. Write only after preflight succeeds or explicitly reports that Roslyn is
   unavailable.
6. Call `sync_unity(timeout=60)` once to trigger refresh and wait for the new
   domain.
7. Run focused tests with one correlated
   `run_tests_wait(mode="EditMode", filter="...")` call.
8. Check the console delta and inspect any serialized data affected by the
   change.

Use `await_compile` only when compilation was already started by another
action. It waits and reports; it does not trigger refresh or compilation.

## Test Changes

- Match the project's installed Unity Test Framework version and existing
  fixture conventions.
- Keep tests independent and register or restore every resource they own.
- Use bounded waits and await all asynchronous work before the test ends.
- Prefer a narrow EditMode test for deterministic editor or serialization
  behavior; use PlayMode only when runtime frames or engine behavior matter.
- Do not save user scenes, delete unowned assets, or hide cleanup failures.
- Retain exact failing test names, expected and actual values, and stack traces.

Do not copy Unity Biome MCP's repository-only fixtures, worker attributes, or CI
commands into a consumer project. They are implementation details of this
package's own repository, not a public testing framework.

## Execute Code

Use `execute_code` only for bounded Editor automation, never as a substitute for
maintainable source. Its convenience transforms hoist user `using` directives,
inject `using Object = UnityEngine.Object;` when needed, and rewrite a bare
`return;` for the generated execution wrapper.

Filesystem and external-process side effects from `execute_code` are not part
of scene Undo. Keep them outside atomic scene transactions.

## Serialized Field Rename

```text
serialized_field_rename_audit(
  type="FeatureController",
  old_field="oldValue",
  new_field="value"
)
```

Use the result to decide whether `FormerlySerializedAs` is required and when it
is safe to remove. Reinspect serialized values after the domain reload.

## Rules

- Prefer normal file edits for persistent code.
- Do not call parameterless `compile_preflight`.
- Keep compiler file paths and line numbers intact.
- Never accept tests from a stale domain after compilation failed or timed out.
- Do not hand-roll `run_tests` plus a polling loop for an ordinary run.
- Do not claim Play Mode acceptance from compilation or EditMode tests.
- Stop when the project cannot compile cleanly or the focused test result is
  incomplete.

Files in this skill

  • SKILL.md3.2 KB
  • SKILL.md.meta155 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.