Reads Form.xml and emits compact JSON in the format form-compile. The result is a draft, not a reversible representation: see the "What you get" section.
When to use
- Scaffold a new form based on a sample — take an existing form, get JSON, modify it, and compile it into a new one.
- Structural refactoring — iterate over the element tree, attributes, commands.
When not to use
- Point edits to a finished form (add an element, attribute, command; move an element, move it to another group, change the title or visibility, delete) →
/form-edit. The "decompile → edit JSON → compile" cycle rewrites the form entirely, may lose uncovered constructs, and produces a large diff./form-editedits in a targeted way.
Parameters
| Parameter | Description |
|---|---|
FormPath |
Path to Form.xml (required) |
OutputPath |
Path to the output JSON. If not specified — JSON to stdout |
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/form-decompile.ps1" -FormPath "<Form.xml>" -OutputPath "<out.json>"
What you get
JSON draft in the format /form-compile — not a fully reversible representation: round-trip xml → json → xml is not guaranteed, some DSL constructs are not covered and are lost silently.
Critical constructs (ConditionalAppearance with scope, design-time diagrams/planners on an attribute, unknown element type, non-Form root) → the script fails with a nonzero code and a message to stderr; for edits to such a form — /form-edit.
Workflow
/form-decompile <Form.xml> -OutputPath draft.json— get a draft.- Modify the JSON for the task.
/form-compile -JsonPath draft.json -OutputPath new/Form.xml— assemble it back./form-validate+/form-info— check the result.