Synthèse automatique
Guide l'agent pour piloter le frontend Locus en TypeScript et créer ou modifier des Views Vue (panneaux, inspecteurs, tableaux, éditeurs de graphe) via l'API locus.views.
Points forts
- Décrit un workflow ordonné et vérifiable : lister les Views existantes, créer le package, puis éditer uniquement dans le packageRoot retourné
- Précise les pièges concrets (ne pas régénérer view.json, lire detail.manifest.entry plutôt que supposer src/App.vue, suffixes d'id pour les Views temporaires)
- Distingue clairement le périmètre Locus des classes View, dossiers et assets Unity à ignorer
- Couvre les options utiles : icônes Lucide ou SVG inline, displayPath, packageName, dépendance Unity explicite
Limites
- Suppose un frontend Locus actif et l'outil execute_typescript chargé, sinon le skill est inopérant
- Le texte fourni s'interrompt au milieu de l'étape 4 et renvoie à des documents externes (frontend-sdk.md, components.md) non inclus
- Ne fournit aucun exemple complet de fichier .vue ni de code TypeScript réel
À utiliser lorsqu'il faut créer, modifier ou déboguer un panneau Vue dans le frontend Locus en passant par l'API TypeScript locus.
À éviter pour du travail sur des Views, assets ou composants Unity, ou dans un projet qui n'expose pas l'outil execute_typescript sur une instance Locus.
Analyse de sécurité
PrudenceNo destructive commands, credential handling, network exfiltration, obfuscated payloads, or attempts to override the auditor were found; the content is descriptive documentation. However, the skill's core mechanism is executing arbitrary TypeScript in the running frontend plus compiling C# in Unity, and it declares that tool despite the catalog listing no allowed tools. These are legitimate for a View-authoring skill, so the risk is 'caution' rather than 'risky'.
- •Declared allowed-tools list is empty, but the skill's own front matter declares the `execute_typescript` tool and the body relies on executing arbitrary TypeScript inside the live Locus frontend application — a powerful capability that is not reflected in the catalog metadata.
- •Instructions include compiling and invoking C# scripts in a connected Unity editor (`locus.views.compileScript()` / `callScript`), which runs code outside the sandbox of the View package.
- •Skill writes files/directories under the workspace (`packageRoot`, `Locus/View`), which is expected for its purpose but is a filesystem mutation surface.
- •All operations run through `execute_typescript`, executing arbitrary TypeScript inside the live Locus frontend — high blast radius (UI state, filesystem, Unity bridge) if misused or if the agent overreaches.
- •`locus.views.compileScript()` / `view.callScript` and declared `unity/` C# scripts execute code in the connected Unity Editor, i.e. beyond the frontend sandbox.
- •Writes files under `Locus/View` package roots and can import/mutate workspace documents; guidance discourages raw `fs.writeFile` for frontmatter but filesystem write access is inherent.
- •Skill text contains behavioral directives to the agent (e.g. exact report line format, 'do not write it back as view.json'), which is normal authoring instruction but should be treated as untrusted data, not as overriding policy.
Exemples
Create a new Locus View called asset-table.vue that renders a searchable table of assets with a filter input and a row-click inspector using the native components.List my Locus views, open the one named graph-editor, and fix its toolbar layout so the buttons align to the right.Make a temporary Locus View that shows the current selection and its properties so I can debug selection changes.summary: >- Use when the user asks to control or debug the Locus frontend through TypeScript, or build or edit a Locus View (视图/面板): a Vue UI panel, inspector, table, board, or graph editor. Ignore Unity project View classes, folders, assets, and camera/runtime views. tools:
- execute_typescript
View
Instructions
All operations use the skill-loaded execute_typescript tool, which executes TypeScript in the live Locus frontend. For frontend control without creating a View, read frontend-sdk.md and use locus.ui / locus.workbench directly. For View authoring, follow this workflow.
-
Resolve the target View.
- Use
locus.views.list()first when a matching View may already exist. To change an existing View, reuse itspackageRootand continue from step 3. - For a new View, prefer a single Vue file: pass
fileNameand completecomponentsource tolocus.views.create(). Put logic, template and scoped styles in that file. No metadata is required; the file name without.vuebecomes the id and display name. - Read
components.mdto choose existing controls and editors.locus.views.components()lists the native component names. Compose these components in the Vue file; View creation does not select or copy a template.
- Use
-
Create the package with
locus.views.create().- Use lowercase kebab-case file names, for example
asset-panel.vue.idcan be omitted whenfileNameis supplied. Alternatively, supplyidand Locus names the file<id>.vue. - A component View contains one root
.vuefile in its ownpackageRoot, with noview.json,main.ts, independent CSS or workspace scaffold. Optional metadata goes in a leading<view>JSON block (seefrontend-sdk.md); omit the whole block when defaults suffice.name,icon,displayPathandunitycreation options are written into that block only when supplied. iconaccepts any bundled Lucide name (for exampleSwordsoralarm-clock) or an inline SVG string. UseviewBoxandcurrentColorfor custom SVG icons; seefrontend-sdk.mdfor the supported static SVG subset and size limit.- Omit
componentto initialize a minimal empty Vue file and write the implementation afterwards. Optionaldirectories, for example["src/components", "unity"], create only those directories insidepackageRoot. There is no template parameter or template catalog. - Set
temporary: truefor one-off display Views. They are written under the app temp directory, stay out ofLocus/Viewandlocus.views.list(), and the requested id gains a unique suffix — use the returned id everywhere afterwards. displayPathonly changes the user-visible View tree path.packageNamepicks the workspace folder underLocus/Viewand defaults to the Unity project name.- Set
unity: trueonly when a connected Unity editor is required. Component selection never implicitly adds a Unity dependency or a C# script.
- Use lowercase kebab-case file names, for example
-
Edit only inside the returned
packageRoot.- Read
detail.manifest.entryto locate the actual Vue entry for a component View; do not assumesrc/App.vue. The returned manifest is derived by Locus from the file name and optional<view>block. Do not write it back asview.jsonor add schema, version, entry or style metadata to the component. - Existing multi-file packages with
view.jsonremain readable; inspect their actual entry and dependencies before editing. All paths remain package-relative with forward slashes. - Additional modules may be created under
src/when needed. Optional Unity scripts live underunity/; declare them in the component's<view>scriptsarray or the legacyview.json. - Code shared across Views in the same workspace lives in the workspace
src/and is imported as@locus/project-view.
- Read
-
Resolve API details through the stable View contract, in this order:
components.md: reusable component choices and small composition examples. Prefer native component props, slots and events over recreating controls or copying whole pages.runtime-api.mdin this skill package: the quick reference for@locus/view-runtimeservices (Unity property editing, drawers, drag/drop, graph/canvas, session, LLM, storage, fs, logs) and@locus/componentscomponents. Locate it withknowledge_query, thenreadthe 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.
For Markdown-backed tables, boards and editors, use
documentsfrom@locus/view-runtime(alsolocus.documents). Use workspace/Knowledge references, read properties and body, and save with the returned revision. Keep business data in the original documents. Seefrontend-sdk.md→ Markdown documents for discovery, typed edits and lifecycle-managed change notifications; do not implement frontmatter writes using rawfs.writeFileor persist a second editable copy in View storage.Typical starting imports:
import { view, unity, property, onEditorUpdate } from "@locus/view-runtime";
import { UnitySerializedPropertyTree, GraphView } from "@locus/components";
-
Use the right runtime path for Unity data.
- Default for configuration pages:
UnityPropertyScope :target="resolvedTarget"containingUnityPropertyField path="serialized.path". Display bindings are the demand declaration; do not maintain a second field list, fetch in each component, or implement a private cache/queue. Custom controls use the field slot oruseUnityPropertyBinding. Locus owns object-level value caching, static Schema, compact Live snapshots, incremental receipts, invalidation and local drafts. Pass project read-only/Play Mode constraints through the scope. Seecomponents.md→ Component-driven Unity data. - Custom setters must invalidate the affected target with
property.invalidate(target); usetree.refresh()when an authoritative reread is required. Do not replace the default writer with raw YAML, discard Undo, or save/import after every keystroke. A Liveappliedreceipt is not diskpersistedcompletion. - Keep TypeScript/C# for domain queries and semantic guards that cannot be inferred from serialized fields; do not bypass those checks when migrating to default fields.
SerializedPropertyediting from package code:property.fromPath("asset/<assetPath>/property/<propertyPath>")— alsoselection/…,guid/<assetGuid>/…,scene/…, andprefab/…path forms — thentree.drawDefaultEditor(),tree.require(path).draw(),property.write(target, value), or batchedproperty.apply([...]).- For existing bound-tree forms, use
tree.require(path).drawDefaultEditor()/.write(value). Bound scalar edits keep local drafts, merge authoritative receipts and preserve the mounted controls;tree.pendingandtree.errorare status, not reasons to disable the form. Do not add asavingguard that drops edits, change component keys per commit, or reread a whole page after each scalar change. Seeruntime-api.md→ Continuous property editing for conflict/Undo behavior. - Unknown property paths:
locus.unity.property.discover()before hardcoding any path. Agent-side spot checks and one-off fixes:locus.unity.property.read(),.write(),.apply(). - Custom property rendering:
propertyDrawer.registerValue/registerField/registerAttribute/registerPropertyPath/register, passed aspropertyDrawersintoUnitySerializedPropertyTree,UnityPropertyDraw, orUnityObjectPreview. Whole-object rendering:unityObjectDrawer.register(...), passed asobjectDrawersintoUnityObjectPreview. App-wide drawers (affecting chat fences and the Locus Inspector, not just this View) ship as plugin drawer packages instead — seeruntime-api.md"Plugin Drawer Packages". - Custom Unity logic: declare the C# file in
<view>scripts[](or legacyview.json), then call it withview.callScriptfrom package code orlocus.views.compileScript()+locus.views.callScript()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.sessionandview.llm.
- Default for configuration pages:
-
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.
-
Validate, debug, and report.
- Run
locus.views.reload()after edits: it validates the manifest and refreshes an open host.locus.views.open()creates and activates a permanent Workbench tab, or activates the existing tab for that View in the current window and checkout. It preserves other tabs and returns a handle bound to the selected instance. - If the View fails to load or misbehaves, locate
debug.mdwithknowledge_query, thenreadthe returned physical path. Reading a registered Skill document activates its debugging tools through the singleexecute_typescriptTypeScript tool. Checkpanel.logs()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 bylocus.views.create(),locus.views.list(), orlocus.views.reload(). The Locus frontend renders that line as a View reference block with an Open View button. - Report the View id,
packageRoot, actual source file, reload or run result, and the standaloneview:<view-id>reference line.
- Run
All View authoring and debugging calls run as TypeScript through execute_typescript. Read frontend-sdk.md for the shared native frontend SDK. Views are ordinary Workbench Vue subtrees; do not create another WebView or app-wide window globals.
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 annexesCe 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.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/build-and-edit-locus-views-with-vue-typescript-mvugylub/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-with-vue-typescript-mvugylub' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/build-and-edit-locus-views-with-vue-typescript-mvugylub/download' --output '.skill-downloads/build-and-edit-locus-views-with-vue-typescript-mvugylub/SKILL.md.part' && mv '.skill-downloads/build-and-edit-locus-views-with-vue-typescript-mvugylub/SKILL.md.part' '.skill-downloads/build-and-edit-locus-views-with-vue-typescript-mvugylub/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-with-vue-typescript-mvugylub/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.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.