Pixso component config
Skill PixsoLtd/pixso-ai-integration/skills/pixso-component-config
Generate or update Pixso Design-to-Code component parser JSON (`componentParsers` / component config) from the current Pixso desktop file, `get_all_components` output, a local component library, or an open source component library. Use when the user asks to create, extract, draft, validate, or update component parser config JSON. Always confirm the target code resource first, fetch current Pixso component facts through Pixso MCP, inspect representative node DSL before complex mappings, and never generate mappings from cached data, stale output, or guesses.From its SKILL.md
npx -y skills add PixsoLtd/pixso-ai-integration --skill pixso-component-configAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
16.8 KB, as published. Nobody here has run it
Pixso Component Config
Use this skill to generate Pixso Design-to-Code component parser config JSON. The goal is to map stable Pixso component families to target code components, imports, props, text, icons, child traversal, object data, and table data rules.
First-Action Gate
Before generating JSON, resolve which code resource the current Pixso file should map to:
- If the user already specified a target library, package, repo, resource path, or documentation link, use it and do not ask again.
- Otherwise ask:
Which code resource should this Pixso file map to for component config generation? 1. A local component library, in which case provide the resource path; 2. An open source component library, in which case provide the library name, documentation link, or local docs path. - If the user chooses
1without a path, ask for the local resource path before continuing. - If the user chooses
2without enough information, ask for the library/package name and official documentation link or local docs path before continuing.
Pixso MCP Hard Gate
Before generating any component config, verify Pixso MCP connectivity and fetch current-file component facts.
Prefer injected Pixso MCP tools when available:
read_component_config_data({})
get_all_components({})
get_node_dsl({ "guid": "<node_id>" })
If injected tools are unavailable, use the fallback script bundled with this skill. Resolve the script path from this SKILL.md directory, not from an old external toolbox path. From the repository root, the command is:
node --experimental-strip-types .\skills\pixso-component-config\scripts\fetch-pixso-components.ts --summary-only --max-families 80
Fetch representative node DSL through the same script:
node --experimental-strip-types .\skills\pixso-component-config\scripts\fetch-pixso-components.ts --node-dsl "59194:149"
Default MCP endpoint: http://127.0.0.1:3667/mcp. If Pixso uses another port, pass --mcp-url.
If Pixso MCP cannot connect, or a required MCP call for the current workflow (read_component_config_data, or get_all_components / get_node_dsl in the fallback path) fails, stop. Do not continue from cached data, stale output, inferred component names, or manual guesses. Ask the user to open the current Pixso desktop file, enable MCP, confirm endpoint/port, and retry.
Component Config Data Interface
When generating component config, prefer calling read_component_config_data({}) to fetch design-side component data required for config generation from the current file. This interface is the dedicated entry point for component config.
Usage rules:
- Treat each returned array item as a component family that can receive one config rule; variants in a
componentSetlive under the item'schildren, so do not use variant names as component-family keys. - Prefer the item's
keyas the component parser config key; usenameonly as the original design-side name and manual review aid. - Use
propDefMapto identify design-side variant / props axes, then combine those facts with target component-library props documentation to generateprops.mappings. - Use
attras visual-attribute candidates; generateattrconfig only when the visual attribute clearly maps to target component prop semantics. - Use
subLayersas a child-layer candidate summary. First-levelsubLayersdefine the valid scope fortraverse.filter; deeperchildrencan help identifytext.nodeName, icon candidates,object, andtableDatastructure. subLayers.typeis the raw DSLnode.type; do not infer slots or icons fromtypealone. Slot / icon rules must be confirmed from layer names, the target code component API, and representative node DSL when needed.- For large component sets, use this interface result first for candidate filtering and summary judgment; do not call
get_node_dslfor every variant. Only sample representative node DSL when the interface data is insufficient to confirm complex fields. - If
read_component_config_datais unavailable in the current environment, or the interface response lacks required fields, fall back to theget_all_components+get_node_dsl/ fallback script workflow.
Required References
Read the bundled references as needed:
- Read references/component-parser-json.md for every config generation task to confirm schema and safe defaults.
- Read references/component-parsers.md when generating or validating complex fields such as
props.mappings,icon.childComponent,attr,traverse,object,tableData,@icons, or@text. - Read references/component-config-tutorial.md only when examples are useful for explaining, debugging, or authoring a complex parser rule.
Required Workflow
- Resolve the target code resource. Choose local component library mode or open source component library mode.
- Gather code facts. Read the user's plan, docs,
package.json, exports, component directories, props definitions, and style entry. Do not guess imports when a repo is available. - Fetch component config data. Prefer
read_component_config_data({})to get component families, design-side props, attr, and child-layer candidates; only useget_all_componentsor the fallback script to get raw components and a component-family summary when that interface is unavailable. - Sample node DSL as needed. For
text,icon,attr,traverse,object, ortableDatafields that the interface data still cannot confirm, inspect representativenodeIdswithget_node_dsl; do not make DSL sampling the default full workflow. - Normalize component families. Use stable family names as config keys, not variant sample names.
- Generate JSON. Output the component parser object directly. Do not wrap it in
codeOptionsunless the user explicitly asks. - Report manual completion items. Put private, helper, legacy, unknown, and unverified families into a "Manual Completion List".
- Validate output. Confirm the JSON parses with
JSON.parseand state whethercodeOptionsis absent.
Component Family Normalization
- When using the fallback script with
--summary-only, usefamilies[].nameas the processed component config key. - When using
read_component_config_data, use the returned item'skeyas the component config key candidate. - Use
families[].rawNamesandfamilies[].keySourcesonly for review and manual correction; do not use raw variant names orsampleNamesas keys. - Prefer non-empty
aliasName. - Otherwise use
containing_frame.containingStateGroup.name. - Fall back to
nameonly for standalone components. - Treat variant
namevalues such asSize=small, State=disabledas variant samples, not component family names. - The fallback script applies generic component-name normalization: strip angle brackets, remove invalid component-name characters, remove leading digits, and fall back to
Component_<session>_<local>fromnode_idwhen needed.
Target Resource Modes
Local Component Library
When the user provides a local path, treat it as a candidate code resource. First locate the real component-library boundary, then map components. Do not assume the path itself is the package root, and do not assume the library is Vue, React, or any fixed directory layout.
Use this general discovery order:
- Locate the library root. From the user-provided path, search inward or upward for package/workspace signals such as
package.json,pnpm-workspace.yaml, lockfiles,rush.json,turbo.json,nx.json,lerna.json,tsconfig.json,vite.config.*,rollup.config.*, andunbuild.config.*. In a monorepo, identify the package that actually exposes components instead of using the repo root directly. - Confirm package identity. Read the candidate package manifest for package name, version,
main/module/types/exports, files, peer dependencies, dependencies, and style side effects. Do not infer package name from the directory name. - Confirm public exports. Follow manifest entry points,
src/index.*,components/index.*, barrel exports, plugin installers, auto-import resolvers, or documentation examples to identify public component names and import paths. - Identify framework and component shape. Determine from source whether the package uses Vue SFC, Vue TSX, React, Web Components, Svelte, headless hooks, or mixed implementations. Read only the component rules relevant to the current target framework.
- Read component APIs. Prefer type definitions, props schemas, variant / size / status constants, emits/events, slots, compound subcomponents, and icon handling. Common files include
props.*,types.*,interface.*,constants.*, component entries, component implementations, and generated.d.ts. - Confirm styles and dependencies. Read style entry points, on-demand style paths, CSS variables, theme tokens, icon packages, peer dependencies, and whether a global import is required. Emit
__mainImports__/__package__only when the config should be installable and runnable. - Sample real usage. Search demos, stories, docs, tests, or examples to confirm real tags/component names, prop values, slot syntax, icon syntax, and compound component usage.
- Limit read scope. Start with manifests, entry points, and a few representative components; inspect implementations only when mapping fields are unclear. Do not traverse the entire repo before making initial decisions.
If the path points to an application rather than a component library, first find the actual component package that the app depends on or references locally. If that cannot be determined, ask the user which local package to map.
If source, types, examples, or docs conflict, prefer public exports and official examples. Put unresolved conflicts into the manual completion list.
Open Source Component Library
When the user provides an open source library name, docs link, or local docs path, read official docs or local docs before generating imports, tag names, prop mappings, style entries, or package entries. Element Plus and Ant Design Vue are examples, not defaults.
If local source or documentation does not establish package, import, tag, or prop conventions, ask for those facts instead of guessing.
JSON Generation Rules
- Output the component parser object directly; do not wrap it in
codeOptionsby default. - Add
__imports__for every emittednametag. - Add
__mainImports__and__package__only when the target project needs them or the user asks for a complete installable config. - Add
@iconsonly if icon-prefixed layers or icon components are present. - For each stable component family, emit only verified
name,props,text,icon,attr,traverse,object, ortableDatafields. - When Pixso variant prop names or enum values differ from the target component library API, use
props.mappingsfor key/value mapping. Mapping facts must come from node DSLpropRefMapvariants and target library prop docs; never guess. - Do not fabricate
nodeName, visualattr.mappings,props.mappings, or imports.
props.mappings Rules
Use when design variant prop names or enum values differ from the target UI library API. The engine reads aliasName || name and aliasValue || value. Outer mapping keys must match the source prop name exactly (case-sensitive), unlike component-family key normalization.
| Form | Meaning |
|---|---|
"modelValue": "value" | Rename prop key only |
"type": { "Primary": "primary" } | Map values only (like attr.mappings) |
"Type": { "name": "type", "values": { "Primary": "primary" } } | Rename key and map values |
"DocTag": "" or { "name": "" } | Suppress entire variant axis (no output for any value) |
"values": { "secondary": "" } | Suppress only that mapped value |
Example (design prop Type, value Primary to output type="primary"; secondary suppressed):
{
"button": {
"name": "el-button",
"props": {
"mappings": {
"Type": {
"name": "type",
"values": {
"Primary": "primary",
"Success": "success",
"secondary": ""
}
}
}
}
}
}
When generating:
- If the variant already has
aliasName: "type", use outer key"type", not"Type". - Value mapping keys must match
aliasValue || valueas read from DSL; if alias already yieldsprimary, do not use"Primary". - Use
props.filteronly for cross-prop generic values (md,default,false). Do not put prop-specific defaults (for example,secondary,medium,normal) in filter. - To suppress a specific value, map it to
""invalues. To suppress an entire variant axis, use"PropName": ""or{ "name": "" }. props.filterruns before mappings; empty-string suppress runs after mappings.- Emit mappings only when variant names/values and target prop semantics are confirmed from node DSL or docs; otherwise list the family for manual completion.
Node DSL Inspection
- After calling
read_component_config_data, first use returnedsubLayersto judge direct child-layer names, text layers, and nested structure; callget_node_dslonly when required details are missing or complex structures need review. - Choose representative node IDs from
families[].nodeIdsin the summary output. Start with one representative node per component family; for variant-sensitive components, inspect at least the default variant and one non-default variant. - Pass the value exactly as
guideven though it comes fromnode_id:
get_node_dsl({ "guid": "59194:149" })
- Parse JSON from
result.content[0].textwhen using an injected MCP tool. The fallback script already parses this text and prints JSON. - Expect compact DSL. Treat
rootsas the requested node tree and recursively inspectchildren;refsIndexcontains lightweight variable, style, component-set, vector, and image references rather than complete definitions. - For component instances, follow
componentRefto the component or concrete variant, usecomponentSetReffor the containing set, align instance children with definition nodes throughcomponentNodeRef, and read instance differences fromoverride. Query requiredcomponentRefvalues recursively instead of inferring structure from legacy DSL fields. - Use real layer names under
roots/children, together withcomponentNodeRefandoverridewhen needed, to decide stabletext.nodeName,icon.nodeName, slot/traverse rules,objectmappings, andtableDatastructure. - Resolve variable, style, and asset definitions through tools using IDs from
refsIndex. Do not treat compact DSL as a complete raw file or call default/inherited field omission data loss. - Use visual properties from node DSL for
attronly when they map cleanly to documented target component prop semantics. - Do not call
get_node_dslfor every raw component unless needed; sample enough variants to confirm layer names and state-dependent structure. - If one
node_idfails, try anothernodeIdsentry from the same family. If all fail, put that family in the manual completion list instead of fabricating rules.
Output Contract
Return, in order:
- A valid JSON code block containing only the generated component parser config.
- A short "Manual Completion List".
- A verification note stating whether
JSON.parsepassed and whethercodeOptionsis absent.
Do not write a config file unless the user explicitly provides a file path.
Completion Checklist
Before the final response, verify:
- the target local or open source component library is resolved;
- required references were read;
- current-file component facts were fetched through Pixso MCP;
- component families needing complex fields had representative node DSL inspected, or were listed for manual completion;
- imports, tag names, props, style entries, and package entries come from source or documentation facts;
- output JSON parses;
codeOptionswas not added by default;- counts were reported for raw components, component families, generated rules, and skipped/manual families.