One-click install
npx skills add https://github.com/BasarEkinci/memory-card-game --skill assembly-definitions-basarekinci
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: assembly-definitions
Source: https://github.com/BasarEkinci/memory-card-game/tree/main/.claude/skills/core/assembly-definitions
Command: npx skills add https://github.com/BasarEkinci/memory-card-game --skill assembly-definitions-basarekinci

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves slow Unity iteration caused by Unity recompiling too many scripts on every change by splitting code into targeted compilation units.

Core Features & Use Cases

  • Asmdef creation rules: Guides when to create .asmdef files (e.g., >50 scripts, Editor-only code, and test code separation).
  • Dependency direction: Enforces a clear layering model (Core must not reference Gameplay; Editor can reference runtime, but runtime must not reference Editor) to prevent circular references and compile failures.
  • Platform/test/editor targeting: Shows how to use includePlatforms and test constraints (like UNITY_INCLUDE_TESTS) for correct build inclusion.

Quick Start

Use this skill to design and implement an asmdef layout that separates Core, Systems, Gameplay, Editor, and Tests, then verify your dependency arrows follow the recommended direction.

Frequently Asked Questions about assembly-definitions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does Unity recompile my entire project when I change a single script?

Unity recompiles the entire project when scripts are not separated into assembly definition files. Creating targeted .asmdef compilation units prevents whole-project recompiles, significantly speeding up iteration and build times.

How do I structure asmdef files to separate editor, runtime, and test assemblies?

Structure asmdef files by using includePlatforms for Editor-only code and constraints like UNITY_INCLUDE_TESTS for test assemblies. Proper platform targeting ensures correct build inclusion and strict runtime, editor, and test separation.

When should I create an assembly definition file in my Unity project?

Create an .asmdef file when a folder contains more than 50 scripts, or when separating Editor-only code and test code. Splitting code into targeted compilation units prevents slow Unity iteration and reduces build issues.

How do I prevent circular references and compile failures with Unity asmdef files?

Prevent circular references by enforcing a clear dependency direction model: Core must not reference Gameplay, and runtime must not reference Editor. This strict layering model avoids compile failures and maintains clean assembly structures.

Does this assembly definition structure work for Unity 6 projects?

Yes, this asmdef structure applies to Unity 6 projects. It guides the creation of .asmdef files to split code into compilation units for faster iteration, ensuring proper dependency direction and platform constraints.

What is the best way to speed up Unity compilation for gameplay and editor tooling?

The best way to speed up Unity compilation is using .asmdef files to split gameplay, editor tooling, and test code into separate compilation units. This targeted separation prevents full project recompiles on every change.