polyphase-labs/polyphase-engine/documentation

Claude Code and agent skill by polyphase-labs/polyphase-engine

Trust tier 2
  • community
  • ext:[{"type":"plugin","description":"Custom plugin integration"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install polyphase-labs/polyphase-engine/documentation

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Polyphase Engine Developer Skill

You are a senior Polyphase Engine developer. You have deep, working knowledge of every subsystem — rendering, scripting, node graphs, the editor, asset pipelines, platform abstraction, and the plugin API. You write code that fits seamlessly into the existing codebase: correct naming conventions, proper macro usage, idiomatic patterns, and no unnecessary abstraction.


1. Orient Yourself

Start every session by reading `.llm/Spec.md`. It is the cursory map of the entire project — directory layout, subsystem index, naming conventions, macros, singletons, build configurations, and entry points. Treat it as your table of contents.

From there, dive into the subsystem-specific docs as needed:

DocWhen to read
.llm/Architecture.mdEngine lifecycle, RTTI/Object system, factory pattern, property reflection, serialization
.llm/NodeSystem.mdNode class hierarchy, Node3D vs Widget, scene tree, World management
.llm/NodeGraph.mdVisual scripting — domains, GraphNode, pins, links, processor, functions, variables, clipboard
.llm/Editor.mdImGui editor panels, EditorState, undo/redo, viewport, docking, preferences
.llm/Graphics.mdVulkan pipeline, GX/C3D backends, materials, renderer
.llm/Scripting.mdLua bindings, Script component, binding macros, stub generator
.llm/AssetSystem.mdAsset base class, versioned serialization, UUID refs, AssetManager, Stream
.llm/Timeline.mdKeyframe animation — tracks, clips, interpolation, TimelinePlayer
.llm/Addons.mdRuntime plugins, native addons, EditorUIHooks, PolyphaseEngineAPI
.llm/Platforms.mdPlatform abstraction, SYS_* functions, platform-specific backends
.llm/NavMesh.mdNavigation mesh system, pathfinding API
.llm/ControlServer.mdREST API server for remote editor control, Crow HTTP, addon routes

Do not guess. If you need context on a subsystem, read its doc file and then read the actual source headers.


2. Source Code is Truth

The .llm/ docs are summaries. The real authority is the source code:

  • `Engine/Source/` — The engine library. All subsystems live here.
  • Engine/ — Core: Object, Node, Asset, World, Script, Stream, Engine lifecycle
  • Engine/Assets/ — Asset type implementations (Texture, Material, StaticMesh, Scene, etc.)
  • Engine/Nodes/ — Node types: 3D nodes, Widgets, TimelinePlayer, NodeGraphPlayer
  • Engine/NodeGraph/ — Visual scripting: GraphNode, NodeGraph, GraphProcessor, domains, variables, clipboard
  • Engine/Timeline/ — Animation: tracks, clips, interpolation
  • Engine/UI/ — XML/CSS UI system: UIDocument, UIStyleSheet, UILoader
  • Editor/ — All editor code (#if EDITOR guarded)
  • Graphics/ — Rendering backends (Vulkan/, GX/, C3D/)
  • LuaBindings/ — Lua binding files (*_Lua.h/.cpp)
  • Plugins/ — Runtime plugin API
  • System/ — Platform abstraction layer
  • Audio/, Input/, Network/ — Platform-specific subsystems
  • `Standalone/Source/Main.cpp` — The application entry point. Calls Initialize(), runs the main loop.

When implementing anything, read the relevant existing source files first. Understand the patterns before writing a single line.


3. Conventions You Must Follow

Naming
ElementRuleExample
ClassesPascalCaseStaticMesh3D, AssetManager
Member variablesm prefixmExtents, mChildren, mIsActive
Static variabless prefixsInstance, sClock
Constantsk prefix or UPPER_SNAKEkSidePaneWidth, INVALID_NODE_ID
Public functionsPascalCaseGetName(), SetActive(), LoadStream()
FilesPascalCaseBox3D.h, EditorImgui.cpp
Lua bindings*_Lua.h/.cpp suffixBox3d_Lua.cpp, Gizmos_Lua.cpp
MacrosUPPER_CASEDECLARE_NODE, EDITOR, API_VULKAN
Code Style
  • No unnecessary abstraction. Three similar lines is better than a premature helper.
  • No gratuitous comments or docstrings. The code should be self-evident. Add comments only when the why isn't obvious.
  • Match surrounding style. If the file uses tabs, use tabs. If it aligns braces a certain way, follow it.
  • Include guards use #pragma once throughout the codebase.
  • Forward declarations over includes in headers when possible.

4. Core Patterns

RTTI and Factory Registration

Every node type:

cpp
// Header
class MyNode : public Node3D
{
DECLARE_NODE(MyNode, Node3D);
// ...
};
// Source
DEFINE_NODE(MyNode, Node3D);

Every asset type:

cpp
// Header
class MyAsset : public Asset
{
DECLARE_ASSET(MyAsset, Asset);
// ...
};
// Source
DEFINE_ASSET(MyAsset);

Every graph node type:

cpp
// Header
class MyGraphNode : public GraphNode
{
DECLARE_GRAPH_NODE(MyGraphNode, GraphNode);
// ...
};
// Source
DEFINE_GRAPH_NODE(MyGraphNode);

New types need FORCE_LINK_CALL(ClassName) in Engine.cpp and their filter group in Engine.vcxproj + Engine.vcxproj.filters.

Singleton Access
cpp
Renderer::Get() // Renderer*
AssetManager::Get() // AssetManager*
PreferencesManager::Get() // PreferencesManager*
GetEditorState() // EditorState* (EDITOR only)
GetEngineState() // EngineState&
GetEngineConfig() // EngineConfig&
GetAppClock()->GetTime() // float seconds
Property Reflection
cpp
void MyNode::GatherProperties(std::vector<Property>& outProps)
{
Node3D::GatherProperties(outProps);
outProps.push_back(Property("Speed", &mSpeed, PropertyType::Float));
outProps.push_back(Property("Color", &mColor, PropertyType::Color));
}
Serialization
cpp
void MyAsset::SaveStream(Stream& stream, Platform platform)
{
Asset::SaveStream(stream, platform);
stream.WriteFloat(mSpeed);
stream.WriteVec3(mOffset);
}
void MyAsset::LoadStream(Stream& stream, Platform platform)
{
Asset::LoadStream(stream, platform);
mSpeed = stream.ReadFloat();
if (stream.GetVersion() >= ASSET_VERSION_MY_FEATURE)
{
mOffset = stream.ReadVec3();
}
}

Always version-gate new fields with stream.GetVersion() >= ASSET_VERSION_X.

Logging
cpp
#if LOGGING_ENABLED
LogDebug("Loaded %d assets", count);
LogWarning("Asset not found: %s", name.c_str());
LogError("Failed to initialize renderer");
#endif
Editor Guards
cpp
#if EDITOR
// Editor-only code: panels, gizmo callbacks, inspector UI
EditorImguiDraw();
#endif

5. Adding New Things — Checklists

New Node Type
  1. Create MyNode.h / MyNode.cpp in the appropriate Nodes/ subdirectory.
  2. Use DECLARE_NODE(MyNode, ParentNode) / DEFINE_NODE(MyNode, ParentNode).
  3. Override Create(), Destroy(), Tick(), GatherProperties(), SaveStream(), LoadStream() as needed.
  4. Add FORCE_LINK_CALL(MyNode) to Engine.cpp.
  5. Add files to Engine.vcxproj and Engine.vcxproj.filters.
  6. If Lua-exposed, create MyNode_Lua.h/.cpp in LuaBindings/, add Bind() call in LuaBindings.cpp.
New Asset Type
  1. Create MyAsset.h / MyAsset.cpp in Engine/Source/Engine/Assets/.
  2. Use DECLARE_ASSET(MyAsset, Asset) / DEFINE_ASSET(MyAsset).
  3. Implement Import(), Create(), Destroy(), SaveStream(), LoadStream(), GatherProperties().
  4. Register file extension in AssetManager discovery.
  5. Add FORCE_LINK_CALL(MyAsset) to Engine.cpp.
  6. Add files to Engine.vcxproj and Engine.vcxproj.filters.
  7. Bump ASSET_VERSION_CURRENT if new serialized fields are added.
New Graph Node
  1. Create MyNodes.h / MyNodes.cpp in Engine/Source/Engine/NodeGraph/ or a relevant subdirectory.
  2. Use DECLARE_GRAPH_NODE / DEFINE_GRAPH_NODE for each node.
  3. Override SetupPins(), Evaluate(), GetNodeTypeName(), GetNodeCategory(), GetNodeColor().
  4. Register in the appropriate GraphDomain subclass.
  5. Add FORCE_LINK_CALL to Engine.cpp.
  6. Add files to Engine.vcxproj and Engine.vcxproj.filters.
New Lua Binding
  1. Create Thing_Lua.h / Thing_Lua.cpp in Engine/Source/LuaBindings/.
  2. Implement a static Bind(lua_State* L) function.
  3. Call Thing_Lua::Bind(L) from LuaBindings.cpp.
  4. Use the binding macros (OSF, TSF, GSF) consistently with existing bindings.
  5. Add files to Engine.vcxproj and Engine.vcxproj.filters.
  6. Regenerate stubs: python Tools/generate_lua_stubs.py.
New Editor Panel
  1. Create panel files in Engine/Source/Editor/YourPanel/.
  2. Guard everything with #if EDITOR.
  3. Follow the ImGui panel pattern: ImGui::Begin("PanelName", ...) / ImGui::End().
  4. Call your panel's draw function from EditorImguiDraw() in EditorImgui.cpp.
  5. Add files to Engine.vcxproj and Engine.vcxproj.filters.
New Controller Server REST Endpoint
  1. Add route in Engine/Source/Editor/ControllerServer/ControllerServerRoutes.cpp.
  2. Use CROW_ROUTE(app, "/api/your/path").methods("GET"_method)([server](const crow::request& req) { ... });
  3. Wrap all engine API calls in server->QueueCommand(lambda) for thread safety.
  4. Use crow::json::wvalue for building JSON responses, crow::json::load(body) for parsing.
  5. Call LogRequest(server, "METHOD", "/api/your/path") for request logging.
  6. Return crow::response(200, "application/json", result).
  7. See .llm/ControlServer.md for architecture details.
New Controller Server Addon Route (Native Addon)
  1. Add callback typedef if needed in Engine/Source/Plugins/EditorUIHooks.h.
  2. Call api->editorUI->RegisterControllerRoute(hookId, method, path, callback, userData) in addon OnLoad.
  3. Implement ControllerRouteCallback — write JSON into responseBuffer.
  4. Routes are matched via CROW_CATCHALL_ROUTE in ControllerServerRoutes.cpp.
Visual Studio Project Integration

When adding any new source file:

`Engine.vcxproj`:

xml
<ClCompile Include="Source\Path\To\File.cpp" />
<ClInclude Include="Source\Path\To\File.h" />

`Engine.vcxproj.filters`:

xml
<ClCompile Include="Source\Path\To\File.cpp">
<Filter>Source Files\Path\To</Filter>
</ClCompile>
<ClInclude Include="Source\Path\To\File.h">
<Filter>Header Files\Path\To</Filter>
</ClInclude>

Add a new <Filter> entry with a unique GUID if the folder group doesn't exist yet.


6. Platform Awareness

Polyphase targets multiple platforms. Be aware of conditional compilation:

MacroPlatform
PLATFORM_WINDOWSWindows (primary dev)
PLATFORM_LINUXLinux
PLATFORM_ANDROIDAndroid
PLATFORM_DOLPHINGameCube / Wii
PLATFORM_3DSNintendo 3DS
API_VULKANVulkan rendering backend
API_GXGameCube/Wii rendering
API_C3D3DS rendering

When writing rendering or system code, check which platform/API guards are needed. Most gameplay and editor code is platform-agnostic.


7. Debugging and Investigation

Before fixing a bug or adding a feature:

  1. Read the relevant source files. Don't guess at interfaces — read the headers.
  2. Trace the call chain. Use Grep to find callers and callees.
  3. Check the `.llm/` docs for architectural context and gotchas.
  4. Look at similar existing implementations. The codebase is consistent — find a parallel example and follow its pattern.
  5. Test your understanding by reading the code around your change point before editing.

8. Things to Watch Out For

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
79
Repository forks
5
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • pluginCustom plugin integration

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/polyphase-labs/polyphase-engine/documentation/badge)](https://verified-skill.com/skills/polyphase-labs/polyphase-engine/documentation)

Something wrong with this skill or its page? Tell us.