用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ForceInjection/domain-driven-design-skills --skill unityaiforge命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Conduct deep academic research for philosophy, neuroscience, cognitive science, and theoretical computer science (computability, complexity, AI theory, logic). Use when user asks to: research academic topics, find scholarly papers, conduct literature reviews, analyze citations, synthesize research findings, explore philosophical arguments, investigate consciousness/cognition, study computability/decidability/Turing machines, or analyze academic debates. Triggers on: 'research papers', 'literature review', 'academic sources', 'scholarly articles', 'philosophy of mind', 'computability theory', 'neuroscience studies', 'find papers on', 'what does the research say'.
Create clear action plans with steps, success criteria, and risk awareness. Use before implementing features, making changes, starting projects, or anytime you need a roadmap to success. Triggers on "plan this", "how should we approach", "what's the strategy", "steps to complete", or when facing complex multi-step work.
Add keyboard navigation to a feature using CommandRegistryService. Use when implementing keyboard shortcuts, vim-style navigation, or hotkeys for a page or component.
基于 SOC 职业分类
正在显示 SKILL.md
| name | unityaiforge |
| description | AI-powered Unity development toolkit with Model Context Protocol integration |
| license | MIT |
Forge Unity games through AI collaboration. Model Context Protocol integration with GameKit framework.
You are now working with Unity-AI-Forge, a powerful system that lets you create, modify, and manage Unity projects directly from this conversation through intelligent AI collaboration.
Before using these tools, ensure:
Unity-AI-Forge includes the GameKit framework - a high-level game development system with MCP integration.
GameKit provides:
📚 See SKILL_GAMEKIT.md for complete GameKit documentation with examples.
# Create a player actor
gamekitActor({
"operation": "create",
"actorId": "Player",
"controlMode": "directController",
"behaviorProfile": "3dCharacterController"
})
# Create a resource manager for RPG
gamekitManager({
"operation": "create",
"managerId": "PlayerStats",
"managerType": "resourcepool",
"initialResources": {
"health": 100,
"mana": 50,
"gold": 0
}
})
# Create UI buttons that control resources
gamekitUICommand({
"operation": "createCommandPanel",
"panelId": "ShopUI",
"canvasPath": "Canvas",
"targetType": "manager",
"targetManagerId": "PlayerStats",
"commands": [
{
"name": "buyPotion",
"label": "HP Potion (50g)",
"commandType": "consumeResource",
"commandParameter": "gold",
"resourceAmount": 50
}
]
})
# Set up a 3D game scene (Camera + Light)
unity_scene_quickSetup({"setupType": "3D"})
# Set up a UI scene (Canvas + EventSystem)
unity_scene_quickSetup({"setupType": "UI"})
# Set up a 2D scene
unity_scene_quickSetup({"setupType": "2D"})
# Create from template (fastest way)
unity_gameobject_createFromTemplate({
"template": "Sphere", # Cube, Sphere, Player, Enemy, etc.
"name": "Ball",
"position": {"x": 0, "y": 5, "z": 0},
"scale": {"x": 0.5, "y": 0.5, "z": 0.5}
})
# Create hierarchical menu system
unity_menu_hierarchyCreate({
"menuName": "MainMenu",
"menuStructure": {
"Play": "Start Game",
"Settings": {
"text": "Game Settings",
"submenus": {
"Graphics": "Graphics Options",
"Audio": "Audio Settings"
}
},
"Quit": "Exit Game"
},
"generateStateMachine": True,
"stateMachineScriptPath": "Assets/Scripts/MenuManager.cs"
})
# Create button with one command
unity_ugui_createFromTemplate({
"template": "Button",
"text": "Start Game",
"width": 200,
"height": 50,
"anchorPreset": "middle-center"
})
# Create complete menu with navigation
unity_menu_hierarchyCreate({
"menuName": "GameMenu",
"menuStructure": {
"NewGame": "New Game",
"LoadGame": "Load Game",
"Options": {
"text": "Options",
"submenus": {
"Display": "Display Settings",
"Sound": "Sound Settings",
"Controls": "Control Settings"
}
},
"Exit": "Exit Game"
},
"generateStateMachine": True,
"stateMachineScriptPath": "Assets/Scripts/GameMenuManager.cs",
"buttonWidth": 250,
"buttonHeight": 60,
"navigationMode": "both"
})
# Add component
unity_component_crud({
"operation": "add",
"gameObjectPath": "Player",
"componentType": "UnityEngine.Rigidbody"
})
# Update component properties
unity_component_crud({
"operation": "update",
"gameObjectPath": "Player",
"componentType": "UnityEngine.Transform",
"propertyChanges": {
"position": {"x": 0, "y": 1, "z": 0},
"rotation": {"x": 0, "y": 45, "z": 0}
}
})
# Fast inspection (existence check only)
unity_component_crud({
"operation": "inspect",
"gameObjectPath": "Player",
"componentType": "UnityEngine.CharacterController",
"includeProperties": False # 10x faster!
})
# Get scene overview (returns one level of hierarchy for performance)
unity_scene_crud({
"operation": "inspect",
"includeHierarchy": True,
"includeComponents": False, # Skip components for speed
"filter": "Player*" # Optional: filter by pattern
})
# For deeper exploration, inspect specific GameObject
unity_gameobject_crud({
"operation": "inspect",
"gameObjectPath": "Player/Weapon",
"includeComponents": True
})
# Generate MonoBehaviour template
unity_script_template_generate({
"templateType": "MonoBehaviour",
"className": "PlayerController",
"scriptPath": "Assets/Scripts/PlayerController.cs",
"namespace": "MyGame.Player"
})
# Generate ScriptableObject template
unity_script_template_generate({
"templateType": "ScriptableObject",
"className": "GameConfig",
"scriptPath": "Assets/ScriptableObjects/GameConfig.cs"
})
# Modify generated template using asset_crud
unity_asset_crud({
"operation": "update",
"assetPath": "Assets/Scripts/PlayerController.cs",
"content": "using UnityEngine;\n\nnamespace MyGame.Player\n{\n public class PlayerController : MonoBehaviour\n {\n public float speed = 5f;\n \n void Update()\n {\n // Movement code\n }\n }\n}"
})
# Generate Singleton pattern
unity_designPattern_generate({
"patternType": "singleton",
"className": "GameManager",
"scriptPath": "Assets/Scripts/GameManager.cs",
"options": {
"persistent": True,
"threadSafe": True,
"monoBehaviour": True
}
})
# Generate ObjectPool pattern
unity_designPattern_generate({
"patternType": "objectpool",
"className": "BulletPool",
"scriptPath": "Assets/Scripts/BulletPool.cs",
"options": {
"pooledType": "Bullet",
"defaultCapacity": "100",
"maxSize": "500"
}
})
# Generate StateMachine pattern
unity_designPattern_generate({
"patternType": "statemachine",
"className": "PlayerStateMachine",
"scriptPath": "Assets/Scripts/PlayerStateMachine.cs",
"namespace": "MyGame.Player"
})
# Available patterns: singleton, objectpool, statemachine, observer, command, factory, servicelocator
Use templates - 10x faster than manual creation
unity_ugui_createFromTemplate({"template": "Button"}) # Not manual GameObject + components
Check context first - Understand current state before changes
unity_context_inspect({"includeHierarchy": True, "includeComponents": False})
Use menu creation - Create complete menu systems with navigation
unity_menu_hierarchyCreate({"menuName": "MainMenu", "menuStructure": {...}}) # Not manual UI creation
Use script templates - Generate standard Unity script structures quickly
unity_script_template_generate({"templateType": "MonoBehaviour", "className": "Player", "scriptPath": "Assets/Scripts/Player.cs"})
Optimize inspections - Use includeProperties=false and propertyFilter
unity_component_crud({
"operation": "inspect",
"gameObjectPath": "Player",
"componentType": "UnityEngine.Transform",
"propertyFilter": ["position", "rotation"] # Only specific properties
})
Limit batch operations - Use maxResults to prevent timeouts
unity_component_crud({
: ,
: ,
: ,
:
})
maxResultsUnityEngine.TransformUnityEngine.RigidbodyUnityEngine.BoxCollider, UnityEngine.SphereCollider, UnityEngine.CapsuleColliderUnityEngine.MeshRenderer, UnityEngine.SpriteRendererUnityEngine.CameraUnityEngine.LightUnityEngine.AudioSource, UnityEngine.AudioListenerUnityEngine.Canvas, UnityEngine.UI.CanvasScaler, UnityEngine.UI.GraphicRaycasterUnityEngine.UI.Button, UnityEngine.UI.Toggle, UnityEngine.UI.Slider, UnityEngine.UI.InputFieldUnityEngine.UI.Text, UnityEngine.UI.Image, UnityEngine.UI.RawImageUnityEngine.UI.VerticalLayoutGroup, UnityEngine.UI.HorizontalLayoutGroup, UnityEngine.UI.GridLayoutGroup# ⚡ Ultra-fast: Check existence only (0.1s)
unity_component_crud({
"operation": "inspect",
"gameObjectPath": "Player",
"componentType": "UnityEngine.Rigidbody",
"includeProperties": False
})
# ⚡ Fast: Get specific properties (0.3s)
unity_component_crud({
"operation": "inspect",
"gameObjectPath": "Player",
"componentType": "UnityEngine.Transform",
"propertyFilter": ["position"]
})
# Test small first
test = unity_component_crud({
"operation": "addMultiple",
"pattern": "Enemy*",
"componentType": "UnityEngine.Rigidbody",
"maxResults": 10, # Test with 10 first
"stopOnError": False
})
# If successful, scale up
if test["errorCount"] == 0:
unity_component_crud({...,"maxResults": 1000})
# 1. Setup UI scene
unity_scene_quickSetup({"setupType": "UI"})
# 2. Create complete menu system with navigation
unity_menu_hierarchyCreate({
"menuName": "MainMenu",
"menuStructure": {
"Play": "Start Game",
"Settings": {
"text": "Settings",
"submenus": {
"Graphics": "Graphics Settings",
"Audio": "Audio Settings",
"Controls": "Control Settings"
}
},
"Credits": "View Credits",
"Quit": "Exit Game"
},
"generateStateMachine": True,
"stateMachineScriptPath": "Assets/Scripts/MainMenuManager.cs",
"buttonWidth": 300,
"buttonHeight": 60,
"spacing": 15
})
# 1. Setup 3D scene
unity_scene_quickSetup({"setupType": "3D"})
# 2. Create player
unity_gameobject_createFromTemplate({
"template": "Player",
"position": {"x": 0, "y": 1, "z": 0}
})
# 3. Create ground
unity_gameobject_createFromTemplate({
"template": "Plane",
"name": "Ground",
"scale": {"x": 10, "y": 1, "z": 10}
})
# 4. Create obstacles
for i in range(5):
unity_gameobject_createFromTemplate({
"template": "Cube",
"name": f"Obstacle{i}",
"position": {"x": i*2, "y": 0.5, "z": 0}
})
Solution: Open Unity → Tools → MCP Assistant → Start Bridge
Solution: Use unity_context_inspect() to see what exists
Solution: Use fully qualified names (e.g., UnityEngine.UI.Button, not just Button)
Solution:
includeProperties=false for faster operationsmaxResults limit for batch operations📚 For detailed documentation of all 28 tools, see TOOLS_REFERENCE.md
The tools are organized into 10 categories:
| Category | Tools | Description |
|---|---|---|
| Core Tools | 4 | Connection, context, menu creation, compilation |
| Scene Management | 2 | Scene CRUD, quick setup templates |
| GameObject Operations | 3 | GameObject CRUD, templates, tag/layer management |
| Component Management | 1 | Component CRUD with batch operations |
| Asset Management | 2 | Asset operations, C# script batch management |
| Design Patterns | 1 | Generate production-ready design pattern implementations |
| UI (UGUI) Tools | 6 | UI templates, layouts, RectTransform, overlap detection |
| Prefab Management | 1 | Prefab workflow (create, instantiate, apply/revert) |
| Advanced Features | 7 | Settings, pipeline, input system, tilemap, navmesh, constants |
| Utility Tools | 1 | Compilation waiting |
Total: 28 Tools
unity_scene_quickSetup - Quick scene setup (3D/2D/UI/VR)unity_scene_crud - Create, load, save, delete scenes, manage build settingsunity_context_inspect - Get scene hierarchy and stateunity_gameobject_createFromTemplate - Create from templatesunity_gameobject_crud - Full GameObject CRUD operationsunity_menu_hierarchyCreate - Create hierarchical menu systems with navigationunity_component_crud - Add, update, remove, inspect componentsunity_ugui_createFromTemplate - Create UI elements from templatesunity_ugui_layoutManage - Manage layout componentsunity_asset_crud - Asset file operations (including C# scripts)unity_script_template_generate - Generate MonoBehaviour/ScriptableObject templatesunity_designPattern_generate - Generate design pattern implementations (Singleton, ObjectPool, StateMachine, Observer, Command, Factory, ServiceLocator)unity_prefab_crud - Prefab workflow operationsunity_projectSettings_crud - Project settings management (player, quality, time, physics, audio, editor)unity_renderPipeline_manage - Render pipeline configuration (Built-in, URP, HDRP)unity_tagLayer_manage - Tag and layer managementunity_constant_convert - Convert between Unity constants and values (enums, colors, layers)unity_template_manage - Customize GameObjects and convert to prefabsunity_ugui_manage - Unified UGUI management (RectTransform operations)unity_ugui_rectAdjust - Adjust RectTransform sizeunity_ugui_anchorManage - Manage RectTransform anchorsunity_ugui_detectOverlaps - Detect overlapping UI elementsunity_ping - Test connection and get Unity versionunity_await_compilation - Wait for Unity compilation to complete (includes console logs in results)📚 SKILL_GAMEKIT.md - Complete guide to GameKit framework:
📚 TOOLS_REFERENCE.md - Detailed documentation of all 28+ MCP tools
You now have complete control over Unity Editor. Build amazing projects! 🚀