Prompt
Para una primera versión sobre la que trabajar nosotros más tarde, es interesante usar un agente, Claude especialmente usando este prompt, que generará un .json generalmente bastante bueno de modelo, que podremos nosotros trabajar sobre él.
TASK: Generate a RadiXML Model JSON
You are an expert XML integration engineer. Your task is to generate a `model.json` file for the RadiXML converter system.
1. Context Information
- **Source Format Name**: [INSERT_SOURCE_NAME]
- **Target Format Name**: [INSERT_TARGET_NAME]
- **Sample Source XML**:
```xml
[INSERT_SOURCE_SAMPLE]
- - **Sample Target
XMLXML**:
[INSERT_TARGET_SAMPLE]
2. - Requirements
Requirements-
- Create a single JSON object.
- - **Root
attributesattributes**: Include`name`,name`description`,description`sourceFormat`,sourceFormat`targetFormat`,targetFormat`rootElement`, androotElement`namespaces`.namespaces - - **Logic
RuleRule**: Use ONLY **JavaScript CustomNodesNodes** for any data transformation or calculation. Do NOT use`transform` nodes.transform - - **Connection
RuleRule**: Every dynamic value must flow from a`SourceNode` ->Node`CustomNode` ->Node`TargetNode`.Node - - **Static
ValuesValues**: Use`staticValue` in the Target Node orstaticValue`value` in thevalue`structure` for fields that never change.structure
- Custom Node Implementation Guide A custom node must be structured as follows:
id[id](cci:1://file:///c:/Users/bolty/Desktop/RadiXML/RadiXML/frontend/src/converters/BaseConverter.js:179:2-189:3): Unique string (e.g., "custom-1234").- `language`: "javascript".language- `inputs`: Defines variable names (e.g.,inputs`DoseRateIn`).DoseRateIn- `outputs`: Defines the result name (e.g.,outputs`DoseRateOut`).DoseRateOut- `code`: Must be a valid JS function. Example:code
4.function run() { // Inputs are accessible directly by name const val = parseFloat(DoseRateIn); return (val * 1000).toFixed(2); }
Model Anatomy Reference Use this structure as your template: { "name": "Format Converter", "rootElement": "RadInstrumentData", "namespaces": { "ns": "..." }, "nodes": { "sources": [ { "id": "src-1", "label": "Value", "path": "Path/To/Tag" } ], "targets": [ { "id": "tgt-1", "label": "Result", "path": "Result/Path" } ], "customs": [ { "id": "custom-1", "inputs": [{"name": "In"}], "outputs": [{"name": "Out"}], "code": "..." } ] }, "connections": [ { "from": "src-1", "to": "custom-1" }, { "from": "custom-1", "to": "tgt-1" } ], "structure": [ { "element": "Parent", "children": [ { "element": "Child", "value": "" } // Targeted by connections ] } ] }
5. Output Generate the full, valid JSON model based on the provided XML samples. Ensure every mandatory tag in the Target XML is present in the
`structure`.structure