Développer des vues Locus pour Unity

VérifiéPrudence

Créer ou modifier des packages Locus View pour Unity : panneaux Vue, inspecteurs, tableaux, graphes et plus.

Spar Skills Guide Bot
DeveloppementIntermédiaire
22/08/2026
Claude Code
#unity#vue#editor-ui#locus-view#node-graph

Recommandé pour

Synthèse automatique

Génère et modifie des Locus Views, c'est-à-dire des panneaux Vue servant d'interface d'édition pour un projet Unity connecté (inspecteurs, tableaux, tableaux de blocs, éditeurs de graphes).

Points forts

  • Couvre le cycle complet : lister ou créer un package de View, éditer les sources, recharger, compiler et exécuter
  • Propose sept templates ciblés (inspector-form, canvas-board, node-graph, serialized-table, etc.) selon le type d'interface demandé
  • Encadre la découverte des API via un contrat stable (@locus/view-runtime, @locus/components) et un runtime-api.md de référence
  • Précise les conventions de chemins, de manifeste view.json et de partage de code via @locus/project-view

Limites

  • Fortement dépendant de l'outillage Locus et de ses outils MCP ; inutilisable hors de cet environnement
  • Les templates capables d'interagir avec Unity exigent un éditeur Unity connecté au moment de l'exécution
  • Le SKILL.md fourni est tronqué, la fin du workflow (édition de propriétés, write-back) n'est pas entièrement visible
Quand l'utiliser

Quand l'utilisateur veut créer ou retoucher un panneau, un inspecteur, un tableau ou un éditeur de graphes dans l'éditeur Unity via une Locus View.

Quand l'éviter

Pour manipuler des classes View Unity classiques, des dossiers, des assets ou des vues caméra/runtime, ou pour du développement web sans lien avec Unity.

Analyse de sécurité

Prudence
Score qualité90/100

The skill does not contain destructive, exfiltrating, or obfuscated instructions. All actions are scoped to building Locus Views and interacting with a connected Unity project. However, the ability to compile and call scripts and write Unity properties is powerful and could cause unintended project changes if misused, warranting caution.

Points d'attention
  • •Uses view_compile_script and view_call_script, which can execute C# scripts in the connected Unity editor and potentially modify project state.
  • •view_property_write and view_property_apply allow programmatic changes to Unity assets and properties without an explicit user confirmation step.
Comment cette analyse est faite

Exemples

ScriptableObject inspector
Create a Locus View using the inspector-form template that lets me edit the health, speed and damage fields of the PlayerStats ScriptableObject.
Dialogue node graph
Build a node-graph View for our dialogue system: nodes with parameters, ports and links, plus write-back into the Unity asset when the graph is saved.
Asset overview table
Make a serialized-table View that lists every enemy asset with columns for health, speed and aggro radius, and lets me edit the values inline.

summary: >- Use when the user asks to build or edit a Locus View (视图/面板): a Vue UI panel, inspector, table, board, or graph editor for the connected Unity project. Ignore Unity project View classes, folders, assets, and camera/runtime views. tools:

  • knowledge_query
  • read
  • view_list
  • view_create
  • view_reload
  • view_run
  • view_compile_script
  • view_call_script
  • view_property_read
  • view_property_discover
  • view_property_write
  • view_property_apply

View

Instructions

Use this workflow when the user asks for a Locus View or a frontend-built Unity editor interface.

  1. Resolve the target View.

    • Use view_list first when a matching View may already exist. To change an existing View, reuse its packageRoot and continue from step 3.
    • For a new View, choose the template:
      • blank for custom panels and early prototypes.
      • inspector-form for field-oriented Unity asset, GameObject, Component, Material, or ScriptableObject editing.
      • canvas-board for draggable custom blocks.
      • field-blocks for block-based Unity SerializedProperty editors.
      • node-graph for graph editors with nodes, parameters, links, ports, layout, and scripted write-back.
      • link-board for source-to-target mapping interfaces.
      • serialized-table for table-based aggregation and editing of SerializedProperty data.
  2. Create the package with view_create.

    • Keep id lowercase kebab-case and the display name concise. Pick icon from the tool enum, or omit it for the template default.
    • Set temporary: true for one-off display Views. They are written under the app temp directory, stay out of Locus/View and view_list, and the requested id gains a unique suffix — use the returned id everywhere afterwards.
    • displayPath only changes the user-visible View tree path. packageName picks the workspace folder under Locus/View and defaults to the Unity project name.
    • Unity-capable templates (inspector-form, field-blocks, node-graph, serialized-table) need a connected Unity editor when the View runs.
  3. Edit only inside the returned packageRoot.

    • Manifest view.json owns id, name, template, apiVersion, entry/style paths, scripts, capabilities, and requirements. Keep every path package-relative with forward slashes; never write absolute Unity project paths.
    • Main UI: src/App.vue. Entry: src/main.ts. Styles: src/style.css (template styles extend a shared base block — keep it and append rules). Optional Unity script: unity/ViewApi.cs. Additional modules (for example a src/store.ts for shared state) may be created under packageRoot as needed.
    • Code shared across Views in the same workspace lives in the workspace src/ and is imported as @locus/project-view.
  4. Resolve API details through the stable View contract, in this order:

    • runtime-api.md in this skill package: the quick reference for @locus/view-runtime services (Unity property editing, drawers, drag/drop, graph/canvas, session, LLM, storage, fs, logs) and @locus/components components. Locate it with knowledge_query, then read the returned physical path.
    • Exported runtime sources under this skill package's app/view-runtime/src/: exact component props, graph/canvas data shapes, and release behavior.
    • Locus application sources: only present in a development checkout. Installed releases do not ship them, so never depend on them from package code or instructions.

    Typical starting imports:

import { view, unity, property, onEditorUpdate } from "@locus/view-runtime";
import { UnitySerializedPropertyTree, GraphView } from "@locus/components";
  1. Use the right runtime path for Unity data.

    • SerializedProperty editing from package code: property.fromPath("asset/<assetPath>/property/<propertyPath>") — also selection/…, guid/<assetGuid>/…, scene/…, and prefab/… path forms — then tree.drawDefaultEditor(), tree.require(path).draw(), property.write(target, value), or batched property.apply([...]).
    • Unknown property paths: view_property_discover before hardcoding any path. Agent-side spot checks and one-off fixes: view_property_read, view_property_write, view_property_apply.
    • Custom property rendering: propertyDrawer.registerValue/registerField/registerAttribute/registerPropertyPath/register, passed as propertyDrawers into UnitySerializedPropertyTree, UnityPropertyDraw, or UnityObjectPreview. Whole-object rendering: unityObjectDrawer.register(...), passed as objectDrawers into UnityObjectPreview. App-wide drawers (affecting chat fences and the Locus Inspector, not just this View) ship as plugin drawer packages instead — see runtime-api.md "Plugin Drawer Packages".
    • Custom Unity logic: declare the C# file in view.json scripts[], then call it with view.callScript from package code or view_compile_script + view_call_script from the agent.
    • Selection-driven panels: onEditorUpdate(handler). Unity selection and inspectors: unity.select(...), unity.inspect(...), unity.selectAsset(...), unity.selectSceneObject(...).
    • Locus <-> Unity drag and drop: useUnityReferenceDrag, useUnityAssetDropTarget, UnityReferenceChip, UnityDropZone.
    • LLM-assisted semantic editors: view.session and view.llm.
  2. Keep the UI aligned with Locus / Unity Editor tool style.

    • Prefer panels, split panes, inspectors, tables, trees, toolbars, and workspaces.
    • Keep controls compact, neutral, and useful for long editing sessions. Use existing tokens for surfaces, borders, text, hover states, and accent color.
    • Use state badges only for strong statuses such as running, error, modified, enabled, or disabled.
    • Avoid marketing-style hero areas, decorative gradients, heavy shadows, oversized cards, colorful chip clusters, and continuous animation.
  3. Validate, debug, and report.

    • Run view_reload after edits: it validates the manifest and refreshes an open host. Use view_run to open or focus the View host.
    • If the View fails to load or misbehaves, locate debug.md with knowledge_query, then read the returned physical path. Reading a registered Skill document activates its debugging tools (view_capture, view_snapshot, view_action, view_wait, view_console_read, view_debug_eval). Check view_console_read first for frontend runtime errors.
    • When the user-facing reply should reference the finished View, put a standalone line in this exact format: view:<view-id>, using the id returned by view_create, view_list, or view_reload. The Locus frontend renders that line as a View reference block with an Open View button.
    • Report the View id, packageRoot, template used, files changed, reload or run result, and the standalone view:<view-id> reference line.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/build-and-edit-locus-views-for-unity-mt3wm12b/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/build-and-edit-locus-views-for-unity-mt3wm12b' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/build-and-edit-locus-views-for-unity-mt3wm12b/download' --output '.skill-downloads/build-and-edit-locus-views-for-unity-mt3wm12b/SKILL.md.part' && mv '.skill-downloads/build-and-edit-locus-views-for-unity-mt3wm12b/SKILL.md.part' '.skill-downloads/build-and-edit-locus-views-for-unity-mt3wm12b/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Le fichier ne fournit pas un en-tête name/description exploitable pour cette procédure native. Le téléchargement reste disponible pour lecture ; utilisez le mode manuel ci-dessous.

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/build-and-edit-locus-views-for-unity-mt3wm12b/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires