uw-unity-feature-scaffold
Skill44 starsChanged 8 months agoMITView on GitHub
Create a complete feature module with folder structure, Assembly Definition (.asmdef), test assembly, and namespace. Use when adding a new feature, system, or module to a Unity project. Triggers on requests like "create a new feature", "scaffold a module", "add a combat system", "I need a health system", "set up inventory", "create a new module for X", "add a new system", "new feature folder", or any task requiring new folders, assemblies, or namespaces for a gameplay feature — even when the user just names a system they want to build from scratch. Reads ProjectConfig.yaml for folder_strategy and MCP availability.
In this repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- uw-code-reviewSkill
- uw-dependency-injectionSkill
- uw-game-feel-integratorSkill
- uw-network-setupSkill
- uw-scriptable-object-archSkill
- uw-skill-creatorSkill
- uw-state-machineSkill
- uw-ui-toolkit-binderSkill
- uw-unity-debuggingSkill
- uw-unity-editor-toolsSkill
- uw-unity-project-setupSkill
- uw-unity-test-runnerSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 0 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Ask the user for the feature name (PascalCase, e.g., Combat, PlayerMovement, Inventory).
- Very specific: line 99
GUID references: Read the GUID from the target .asmdef.meta file (the guid field on line 2).
- Very specific: line 120
When Feature B depends on Feature A, add Feature A's asmdef GUID to Feature B's references array.
- Very specific: line 122
Keep dependencies one-directional.
- Very specific: line 126
Write tests: Use uw-unity-test-runner — the test asmdef is already configured.
- Very specific: line 127
Add architecture patterns: Use uw-scriptable-object-arch (SO-first) or uw-dependency-injection (DI-first) based on ProjectConfig.yaml → …
- Very specific: line 128
Create editor tools: Use uw-unity-editor-tools for custom inspectors or editor windows alongside the feature.
- Very specific: line 132
All scripts must live inside an .asmdef.
- Very specific: line 133
All paths start with Assets/_Project/ to avoid Asset Store conflicts.
- Very specific: line 134
Never create, modify, or delete .meta files — Unity generates them automatically.
- Very specific: line 136
If ProjectConfig.yaml → mcp.unity_mcp is true, call refresh_unity after creating files.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unity Feature Scaffold
Generate a feature module with folders, assembly definitions, and a starter class based on docs/ProjectConfig.yaml.
Before You Start
- Read
docs/ProjectConfig.yamlfor:project_name— derive root namespace by converting to PascalCase (e.g.,"my cool game"→MyCoolGame)folder_strategy—"feature-based"or"type-based"architecture_pattern—"so-first"or"di-first"(informs post-scaffold next steps)mcp.unity_mcp— iftrue, callrefresh_unityafter creating files
- Ask the user for the feature name (PascalCase, e.g.,
Combat,PlayerMovement,Inventory). - Derive the namespace:
{RootNamespace}.{FeatureName}(e.g.,MyCoolGame.Combat). - Confirm the namespace with the user before generating files.
Folder Structures
Feature-based (folder_strategy: "feature-based"):
Assets/_Project/Features/{FeatureName}/
├── Scripts/
│ ├── {RootNamespace}.{FeatureName}.asmdef
│ └── {FeatureName}Manager.cs
├── Data/
└── Tests/
└── {RootNamespace}.{FeatureName}.Tests.asmdefType-based (folder_strategy: "type-based"):
Assets/_Project/Scripts/{FeatureName}/
├── {RootNamespace}.{FeatureName}.asmdef
└── {FeatureName}Manager.cs
Assets/_Project/Tests/{FeatureName}/
└── {RootNamespace}.{FeatureName}.Tests.asmdefAssembly Definition Templates
Feature asmdef
File: {RootNamespace}.{FeatureName}.asmdef
{
"name": "{RootNamespace}.{FeatureName}",
"rootNamespace": "{RootNamespace}.{FeatureName}",
"references": [
"GUID:{CoreAsmdefGUID}"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}Test asmdef
File: {RootNamespace}.{FeatureName}.Tests.asmdef
{
"name": "{RootNamespace}.{FeatureName}.Tests",
"rootNamespace": "{RootNamespace}.{FeatureName}.Tests",
"references": [
"GUID:{FeatureAsmdefGUID}",
"UnityEngine.TestRunner",
"UnityEditor.TestRunner"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
}GUID references: Read the GUID from the target .asmdef.meta file (the guid field on line 2). Use GUID: prefix for robustness against renames. Fall back to the string name (e.g., "{RootNamespace}.Core") if the .meta file isn't accessible.
Starter File
File: {FeatureName}Manager.cs
using UnityEngine;
namespace {RootNamespace}.{FeatureName}
{
public class {FeatureName}Manager : MonoBehaviour
{
}
}This is a minimal entry point. The actual class name and base type should be adjusted to fit the feature — not every feature needs a MonoBehaviour manager.
Cross-Feature References
When Feature B depends on Feature A, add Feature A's asmdef GUID to Feature B's references array. Read the GUID from Feature A's .asmdef.meta file — never modify .meta files directly.
Keep dependencies one-directional. If two features need to communicate bidirectionally, extract shared interfaces or event channels into {RootNamespace}.Core (see uw-scriptable-object-arch for event channel patterns).
After Scaffolding
- Write tests: Use
uw-unity-test-runner— the test asmdef is already configured. - Add architecture patterns: Use
uw-scriptable-object-arch(SO-first) oruw-dependency-injection(DI-first) based onProjectConfig.yaml → architecture_pattern. - Create editor tools: Use
uw-unity-editor-toolsfor custom inspectors or editor windows alongside the feature.
Rules
- All scripts must live inside an
.asmdef. - All paths start with
Assets/_Project/to avoid Asset Store conflicts. - Never create, modify, or delete
.metafiles — Unity generates them automatically. - Asmdef file names use dot notation:
{RootNamespace}.{FeatureName}.asmdef(perNAMING_CONVENTIONS.md). - If
ProjectConfig.yaml → mcp.unity_mcpistrue, callrefresh_unityafter creating files. Otherwise, instruct the user to return to Unity Editor for auto-refresh.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

