Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

msw-behaviourtree

БесплатноЗапускает вложенные скриптыНе проверен

Authors MSW `.behaviourtree` files end-to-end and maintains the project-specific authoring spec (`.behaviourDocs/bt-spec.md`). Scans every `.codeblock` whose…

MSW-Gitот MSW-Git★ 38 звёзд на GitHub

Об этом скилле

MSW BehaviourTree

End-to-end authoring skill for MSW .behaviourtree files — the default way to give an AIComponent a behaviour tree. Owns both the project-specific authoring spec (<ProjectRoot>/.behaviourDocs/bt-spec.md) and the tree generation itself. Fixed graph rules and skeletons live in this skill's references/; the per-project spec is (re)built by this skill's local scripts/build-spec.cjs.


🚦 Execution order (follow this sequence)

0. Build / refresh the project spec (bt-spec.md)

The spec is the source of truth for every project-specific data point: each custom action/decorator/composite node's definitionId, btNodeType, visible propertyKey names, and the serialized Type.type strings stamped to this project's CoreVersion.

When to (re)build:

  • First time working on BT in a project (no .behaviourDocs/bt-spec.md yet).
  • After any change that affects BT node surface area:
    • new / renamed / removed .codeblock whose paired .mlua extends ActionNode / DecoratorNode / CompositeNode
    • added / removed / renamed property lines in such a .mlua
    • Environment/config CoreVersion bumped (the serialized type strings are version-tagged).
  • The user says they recently added/changed a BT codeblock or a .mlua property — stale UUIDs / missing properties silently produce broken trees.
  • The downstream validation (Step 7) flags a definitionId, propertyKey, or version mismatch.

How to run — invoke this skill's local script:

node "scripts/build-spec.cjs" --projectRoot "<MSW project root>"

If the current working directory is already the MSW project root, --projectRoot can be omitted. Requires Node.js on PATH (no other dependencies — pure stdlib fs/path).

Optional overrides (long flags, case-insensitive):

Flag Default Notes
--projectRoot current working directory MSW project root to scan
--outputPath <ProjectRoot>/.behaviourDocs/bt-spec.md folder is created if missing
--coreVersion read from <ProjectRoot>/Environment/config (CoreVersion field) required if the config is missing

Example with overrides:

node "scripts/build-spec.cjs" --projectRoot "C:/path/to/project" --coreVersion <CoreVersion>

The script throws if Environment/config is absent and --coreVersion is not passed — there is no fallback default.

What the spec contains:

  1. Project metadata — project root, CoreVersion, generated time, discovered node counts.
  2. Composite nodes — built-in names with fixed definitionId / btNodeType, plus discovered custom composites (.mlua declares extends CompositeNode).
  3. Custom action nodes — Name, definitionId, btNodeType, visible property names.
  4. Custom decorator nodes — same shape as action nodes.
  5. Type map — mlua type to serialized MODNativeType.type plus Blackboard ObjectValue shape.

UUIDs come from real .codeblock files in the project — the spec never invents them. @HideFromInspector properties are filtered out automatically. Fixed authoring rules, file skeletons, and validation checklists live in this skill's references/ rather than in the generated spec.

After (re)building, read the freshly written <ProjectRoot>/.behaviourDocs/bt-spec.md and continue with the steps below. The compact spec intentionally lists only property names; when constructing nodeProperties, resolve each property's mlua type/default from the paired .mlua file, then use the type map in bt-spec.md §4 for propertyType.type.

Also read references/skeleton-minimal.json for the smallest valid tree, references/skeleton-full.json for a Composite+Decorator+Action+Blackboard example with all optional fields populated, references/node-catalog.md for fixed graph rules, and any existing .behaviourtree in the project (**/*.behaviourtree) to mirror conventions. Replace {CORE_VERSION} in the skeletons with the CoreVersion from bt-spec.md — both at the top level and inside every MOD.Core.* type string in Blackboard variables and nodeProperties.

1. Collect input from the user

Confirm via context, or ask via AskUserQuestion if anything is ambiguous:

Item Description Example
name Display name for the tree "PatrolAndChase"
Save path .behaviourtree location (relative to project root) RootDesk/MyDesk/PatrolAndChase.behaviourtree
Tree shape Intended node graph (root composite + children) Sequence → [Chase, MoveTo]
Custom nodes Action/decorator/composite codeblocks the tree references Chase, MoveTo, Jump
Blackboard variables Variable name + type + initial value TargetEntity: Entity, MoveSpeed: number = 10.0
Node properties For each custom node, which property maps to which Blackboard variable `Chas
Полный SKILL.md на GitHub

Установить msw-behaviourtree в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/node-catalog.mdreferences/skeleton-full.jsonreferences/skeleton-minimal.jsonscripts/build-spec.cjs

FAQ

Что делает скилл msw-behaviourtree?

Authors MSW `.behaviourtree` files end-to-end and maintains the project-specific authoring spec (`.behaviourDocs/bt-spec.md`). Scans every `.codeblock` whose paired `.mlua` extends `ActionNode`/`DecoratorNode`/`CompositeNode` to build a compact catalog of custom action/decorator/composite UUIDs, propertyKey names, and version-stamped MODNativeType strings. Then generates the full tree: RootNode → Nodes graph, Blackboard variables, nodeProperties wiring, and self-validates parent/child consistency. Triggers: 'create behaviourtree', 'new BT', 'add a behaviour tree', 'BT node graph', '비헤이비어 트리 만들어', '.behaviourtree 생성', 'SequenceNode SelectorNode', 'Blackboard variable', 'definitionId codeblock', 'startNodeId', 'build BT spec', 'refresh bt-spec', 'generate behaviourtree catalog', 'BT 스펙 생성', 'bt-spec.md 만들어', 'rescan BT nodes'.

Как установить скилл msw-behaviourtree?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл msw-behaviourtree запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить msw-behaviourtree с