Skip to content

MuharremTozan/Agentic-Duel / .agent/skills/unity-assembly-management

unity-assembly-management

Verified

Manage project boundaries using Assembly Definitions (.asmdef) for faster compile times and modular architecture. Based on the patterns by Adam Myhre. Enforces responsibility-based organization and handles Runtime/Editor/Tests splits.

assets/code/AsmdefScaffolder.cs.txt

View on GitHub
using UnityEditor;
using UnityEngine;
using System.IO;

namespace UnityAssemblyManagement.Editor {
    public static class AsmdefScaffolder {
        [MenuItem("Tools/Ohm-Yura/Assembly/Scaffold Module")]
        public static void ScaffoldModule () {
            string path = EditorUtility.OpenFolderPanel("Select Module Root", "Assets", "");
            if ( string.IsNullOrEmpty(path) ) return;

            string moduleName = Path.GetFileName(path);
            
            CreateAssembly(Path.Combine(path, "Runtime"), moduleName);
            CreateAssembly(Path.Combine(path, "Editor"), moduleName + ".Editor", true);
            CreateAssembly(Path.Combine(path, "Tests"), moduleName + ".Tests", false, true);
            
            AssetDatabase.Refresh();
            Debug.Log($"[Assembly] Status: Scaffolding Complete | Data: Module={moduleName}");
        }

        private static void CreateAssembly (string folderPath, string name, bool isEditor = false, bool isTest = false) {
            if ( !Directory.Exists(folderPath) ) Directory.CreateDirectory(folderPath);
            
            string asmdefPath = Path.Combine(folderPath, name + ".asmdef");
            if ( File.Exists(asmdefPath) ) return;

            string content = $@"{{
    ""name"": ""{name}"",
    ""rootNamespace"": ""{name}"",
    ""references"": [],
    ""includePlatforms"": [{(isEditor ? "\"Editor\"" : "")}],
    ""excludePlatforms"": [],
    ""allowUnsafeCode"": false,
    ""overrideReferences"": false,
    ""precompiledReferences"": [],
    ""autoReferenced"": true,
    ""defineConstraints"": [],
    ""versionDefines"": [],
    ""noEngineReferences"": false
}}";
            File.WriteAllText(asmdefPath, content);
        }
    }
}
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall