Command Palette

Search for a command to run...

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

nasal-property-tree

БесплатноБез исполняемых скриптовНе проверен

Explains the components of the property tree, introduces the Nasal `props` library for property-tree access, and covers saving and loading PropertyList XML…

container32от container32678 установок в других каталогах

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

Components of the Property Tree

  • Nodes: A node can hold a typed value as well as child nodes, and both can coexist at the same time.
  • Indices: Sibling nodes sharing an identical identifier are organized as an indexed array using zero-based numerical offsets. Omitting brackets defaults to index 0 (e.g., /sim/view = /sim/view[0]). Deleting an indexed node does not re-index or shift subsequent elements, leaving the vacated slot available for reuse.
  • Aliases: Allows a node to dynamically mirror another target node path, routing all read and write operations directly to the destination.
  • Node attributes: Flags defining internal engine behaviors, including read/write permissions, runtime state preservation, logging triggers, and persistent serialization.

Besides the lossless XML format, properties can also be represented as a Nasal hash. If a node contains both a value and child nodes, only the child nodes are preserved when converted to a Nasal hash.

Property Tree Manipulation (props)

Nasal interacts with the FlightGear hierarchical Property Tree through the props module. The core wrapper class is props.Node, which wraps internal C++ property ghosts (prop) and exposes a complete API for tree navigation, type-safe modifications, structural node duplication, and evaluation.

Node Instantiation & Navigation

Constructors & Accessors

  • props.Node.new([structure_hash]): Instantiates a standalone property node. If an optional Nasal hash is passed, its nested keys, values, and arrays will automatically initialize equivalent node paths inside the new instance.
  • props.getNode(path[, create]): Global alias returning a path node from the root system property tree. If create is true, create the node when it does not exist.
  • props.globals: Global property tree root wrapper of type props.Node.
  • .getNode(rel_path[, create]): Evaluates a relative path string. Returns nil if not found and create is 0.
  • .getChild(name[, index[, create]]): Finds or instantiates a direct child element using a specific name and numerical array offset index.
  • .getChildren([name]): Returns a Nasal vector of props.Node child instances. If name is specified, it filters results to nodes matching that identifier.
  • .getParent(): Returns the parent props.Node wrapper or nil if executed at root.
  • .getPath(): Returns the absolute string path representing the location within the Property Tree.
  • .getName(): Returns the name string of the specific node.
  • .getIndex(): Returns the node's numerical index integer.
# Create an isolated mock tree
var local_root = props.Node.new({
    "instruments": {
        "altimeter": [
            { "indicated-ft": 5500 },
            { "indicated-ft": 12000 }
        ]
    }
});

# Navigate nested levels
var alt2 = local_root.getNode("instruments/altimeter[1]");
print("Target node path: " ~ alt2.getPath()); # /instruments/altimeter[1]
print("Altitude: " ~ alt2.getValue());       # 12000

Node Lifetime & Structural Mutation

  • .addChild(name[, min_idx[, append]]): Explicitly creates a single empty node child.

  • min_idx (default 0): Forces the index space to start at or above this value.

  • append (default 1): Adds the child immediately above the highest existing index for that name. If 0, fills the lowest available index starting at min_idx.

  • .addChildren(name, count[, min_idx[, append]]): Creates multiple sequential child elements with a single call.

  • .remove(): Safely destroys the calling node, detaching it from the tree hierarchy.

  • .removeChild(name, index): Destroys a targeted child node by its specific index.

  • .removeChildren([name]): Removes all child nodes matching a specific identifier name. If no argument is provided, it empties all child nodes.

  • .removeAllChildren(): Empties the node completely.


Type-Safe Values & Data Mutations

Nodes have strict internal types (e.g., BOOL, INT, DOUBLE, STRING, VEC3D, VEC4D).

Getting and Checking Types

  • .getValue([rel_path]): Reads the node value. Optionally takes a relative path to target a child node.
  • .getBoolValue(): Returns the value interpreted as a Nasal boolean (1 or 0). Strings like "false" resolve to 0.
  • .getType(): Returns the string type representation: "NONE", "BOOL", "INT", "LONG", "FLOAT", "DOUBLE", "STRING", "VEC3D", "VEC4D", "ALIAS", or "UNSPECIFIED".
  • .isInt(): Returns 1 if the node holds an integer or long integer, 0 otherwise.
  • .isNumeric(): Returns 1 if the node is numeric (INT, LONG, FLOAT, DOUBLE), 0 otherwise.

Writing Values

  • .setValue([rel_path, ]value): Resolves and commits a value to the node. Handles conversions automatically based on the input type. Passing a 3-element or 4-element vector of numbers converts the node type to VEC3D or VEC4D respectively.
  • .setBoolValue([rel_path, ]bool): Forces the node t
Полный SKILL.md на ClawHub

Установить nasal-property-tree в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл nasal-property-tree?

Explains the components of the property tree, introduces the Nasal `props` library for property-tree access, and covers saving and loading PropertyList XML files.

Как установить скилл nasal-property-tree?

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

Скилл nasal-property-tree запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить nasal-property-tree с