rojim666/sztucode/component-instance
Claude Code and agent skill by rojim666/sztucode
- community
Checking that the SKILL.md file is still in the repository.
Create/update component instances; set componentProperties; switch VARIANT / 变体 via variantOptions. Triggers: instance, COMPONENT_SET, variant, 变体, componentProperties.
Install
npx vskill@latest install rojim666/sztucode/component-instanceSKILL.md
Components and Instances
COMPONENTorCOMPONENT_SETnodes are reusable (symbols).- Insert instances with
type: "ref"pointing to component/componentSet ID. - For Component/ComponentSet: call
batch_readwith the ID to getcomponentPropertyDefinitions, thenbatch_editto update instance properties. - Instance overrides:
- Root properties: set directly on the
refobject - Descendant properties: use
descendantsmap —{descendants: {"childId": {content: "New"}}} - Nested instances: slash-separated paths —
instanceId/nestedInstanceId/childId - Replace subtree: include
typein descendant override - "Delete" descendant: override
visible: false - When using
descendants, paths can access multi-level descendant nodes — use paths indescendantskeys, DO NOT create multiple levels ofdescendantsobjects. - Prefer updating the component over individual instances for shared changes.
- ID formats: rendered tree uses semicolons (
instanceId;childId), batch_edit uses binding + nodeID (card+"childId"). Fall back to semicolon ID if binding fails. - Reuse existing components instead of creating duplicates.
- Instead of duplicating the same component multiple times with small tweaks, try to make them more generic so instances can reuse in more places.
- Cannot reference components across files — copy them over.
- Place reusable components on the side, next to the main design.
- Overrides are applied only to the overridden object — changes will NOT be inherited to all children.
- When parsing designs, treat "component" broadly — some are formal symbols, others are ad-hoc groupings visually behaving like components (sometimes prefixed "component/").
Composition Contract
Before inserting a component, inspect its root sizing, exposed properties, visible controls, and nested instances. A component is reusable only when its semantics fit the role in this screen.
- No duplicate affordances: inspect composed components for built-in status bars, back buttons, search controls, titles, close actions, tabs, or bottom navigation before adding siblings with the same role. Keep exactly one primary affordance per action unless the user explicitly asks for both. "It is part of the native component" does not justify two back buttons or two status bars.
- Give every repeated and nested instance distinct, scenario-derived text and icons: update the text and icon slots within each relevant nested instance to reflect its real purpose and never keeps a component default. For menu rows, tabs, list rows, table columns, and cards, replace generic labels such as "菜单" or "默认选项", placeholder sequences, and repeated default or empty-box icons with a coherent set inferred from the page scenario; otherwise, it is a generation defect.
- Operations: inspect nested descendants with
batch_readusing sufficientreadDepthandproperties: ["mainComponent"]. Override text through its TEXT component property orU(instance+"childId", {content: "..."}), and swap icons throughINSTANCE_SWAPorU(path, {mainComponent: "matchingIconId"}). - Semantic fit over coverage: do not instance a Table, Picker, Card, or other component merely because it was returned by search. Use it only when its interaction and content model match the requested module.
- Preserve composite structure: reuse the smallest complete component root; never use internal rows, columns, cells, items, or slots as standalone modules. Tables/DataGrids need headers, at least two columns, and data rows; otherwise use a list or fallback.
- Adaptive sizing: use
fill_containeron parent-driven axes andhug_contentson content-driven axes. Preserve verified intrinsic/fixed variants, and update relevant nested wrappers when their fixed sizing causes clipping or artificial gaps.
Use descendants property to override the child nodes inside the component.
Or use U() to update the instance child nodes by combining the instance ID and the child node ID.
For an already created instance, if you want to update its source component, you can use U(instance, {mainComponent: "newComponentId"}), including nested instances which can also be changed in the same way. Swap Instance:
Component Property Definitions
Use componentPropertyDefinitions in U() or I() to add, edit, or delete component properties on a Component or ComponentSet node. Pass an array of action objects:
add — Add a new property. Supports BOOLEAN, TEXT, INSTANCE_SWAP, and VARIANT types.
VARIANTis only supported for nodes of typeCOMPONENT_SET.
The response returnInfo contains the added property IDs.
edit — Modify an existing property's name, default value, or preferred values.
nameis supported for all property typesdefaultValueis supported forBOOLEAN,TEXT, andINSTANCE_SWAP, but NOT forVARIANTpreferredValuesis only supported forINSTANCE_SWAP
delete — Remove an existing property. Only supports BOOLEAN, TEXT, and INSTANCE_SWAP. Cannot delete VARIANT properties.
Bind Component Properties to Nodes
Use componentPropertyReferences in U() or I() to bind component properties to child node properties:
visible— Reference to a boolean property controlling visibility.characters— Reference to a text property controlling text content.mainComponent— Reference to an instance swap property controlling the main component of an instance node.
Important: Use the property name defined in componentPropertyDefinitions. Before binding, ensure the property exists and the binding node is a child of the component.
Update Component Properties on Instance
Important: use the property name which is defined in componentPropertyDefinitions to set new value.
already exist three component nodes: 3:5 and 3:7, and 3:11, 3:11 has three component properties: Boolean Property: Show Icon#252:1, Text Property: Label#252:2 and Instance Swap Property: Icon#252:3.
For a remote team-library component, add libraryKey to the ref node. Use the component's source node id (assetId from component_search) as ref, and the library source file id as libraryKey.
Update Variant Properties on Instance
Important: use the property name which is defined in componentPropertyDefinitions to set new value. Important: use the property value which is provided in variantOptions to switch variant.
already exist a componentSet nodes: 55:2, has three Variant properties:
only use provided variantOptions to switch variant.
Make Sure Update Instance completely
Important: use the property name which is defined in mainComponent:{componentPropertyDefinitions: ...} to set new value.
Customize a Complex Instance
Use task requirements or the asset mapping, when available, to identify nested content, state, icon, or sizing slots that require overrides. Reuse each source component's property map across its instances; do not recursively inspect every leaf by default.
Workflow:
- Read the source component with the minimum depth needed to get its property definitions:
``javascript batch_read(nodeIds: ["instanceId"], readDepth: 2, resolveInstances: true, properties: ["mainComponent"]) ``
- Update mapped properties with
U()using names frommainComponent.componentPropertyDefinitions:
``javascript U("instanceId", {componentProperties: {"Label#252:2": "New Text", "Show Icon#252:1": true}}) ``
- If a mapped slot remains unresolved, read only that subtree more deeply, up to
readDepth: 5:
``javascript batch_read(nodeIds: ["nestedInstanceId"], readDepth: 3, resolveInstances: true, properties: ["mainComponent"]) ``
- Stop once all required mapped slots are resolved. Report unresolved optional or inaccessible slots rather than expanding into an unbounded read loop.
Override Child Text Layers in (Nested) Instances
An instance's content may live in child TEXT layers, including nested instances. Override required mapped content with scenario-appropriate values. Identity and state fields should distinguish repeated records; shared actions, units, and common chrome may repeat.
Hide Optional Children
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/runtime-ts/prompts/Sztubuddy/skills/ardot-design-core/func-rule/component-instance/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rojim666/sztucode/component-instance)