INNER CODE UNIT · Python
_register_skill
kevinpbuckley/VibeUE · Content/Python/init_unreal.py:51
def _register_skill(class_suffix, description, instructions):
"""Create (or refresh) a registered UAgentSkill subclass with the given content."""
existing = _VIBEUE_SKILL_CLASSES.get(class_suffix)
if existing is not None:
# Reload path: the class already exists — refresh its CDO so ListSkills/GetSkills serve
# the new markdown without an editor restart (skills registered at startup only was
# issue #557). Deleted packs stay registered until the next editor launch.
cdo = existing.get_default_object()
cdo.set_editor_property("description", inspect.cleandoc(description or class_suffix))
cdo.set_editor_property("instructions", instructions)
return
class_name = "VibeUE_" + class_suffix
skill_cls = type(class_name, (unreal.AgentSkill,), {
"__doc__": description or class_suffix,
"instructions": instructions,
})
skill_cls = agent_skill(skill_cls)