Form designer
Skill CloudChef/atlasclaw-providers/providers/SmartCMP-Provider/skills/form-designer
atlasclaw-providers are the integration with enterprise systems through skills and webhook.
npx -y skills add CloudChef/atlasclaw-providers --skill form-designerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 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.
What its author says it does
Copied from the file, not written here
Use when creating, reading, normalizing, regenerating, or modifying SmartCMP Angular form schema JSON, including dynamic JavaScript behavior, catalog context values, visibility, selects, tables, and form edit URLs.
SKILL.md
18.8 KB, as published. Nobody here has run it
form-designer
Design, read, and normalize SmartCMP Angular form schema JSON only. It does not submit requests or save changes.
Boundaries
- No submit/approve/status workflows.
- No CMP form writes: no POST, PUT, PATCH, DELETE, publish, save, or delete.
- Form URLs are read-only source material.
Workflow
- New form: if the user gave enough fields, do not read CMP or call datasource tools. Build complete
schema_json, then callsmartcmp_design_form_schemawithmode=new. - Bare form edit/design URL: inspect only. Call
smartcmp_read_form_schema; do not design. - URL plus full field-set or schema-shape changes: treat this as new-form generation with one extra read step. First call
smartcmp_read_form_schemato understand the current form, then generate a fresh complete replacement schema from the user's latest requirements and call design withmode=regenerate. Use the old schema only as context; do not patch, splice, or preserve existing fields/JavaScript unless the user explicitly asks to keep them. - URL plus deterministic projection/composition changes: after the read step, call
smartcmp_design_form_schemawithmode=modify,form_url, andvalue_expressions_json. This lets the tool load the source schema and replace the target expression with the hardened runtime expression instead of asking the LLM to hand-copy the old schema or JavaScript. mode=modifyis only for complete caller-provided JSON, deterministiccatalog_fields_jsoninsertion, or deterministicvalue_expressions_jsonupdates into a suppliedschema_jsonorform_urlsource. Never callmode=modifywith onlymodeor only insertion/update JSON; that would create an incomplete replacement schema.- If a read result warns that a field expression is not
function(model, sourceParams, schema, unused, cfg), do not answer by hand-writing a replacementschema_jsonwith another legacy signature such asfunction(formInRet, schemas, widget, injection). For catalog/model value rewrites, usevalue_expressions_json; for custom JavaScript, provide a complete modern-signature expression that writesmodel[fieldKey]. - If read/design output reports
designMode,modelKeys, orcomponentCount, tell the user the source form has visual-designer/model state that can preserve stale runtime values even when the schema expression changes. The generated schema is still a manual replacement draft; SmartCMP persistence and visual designer state must be reviewed in CMP.
General JavaScript Form Extensions
Use this skill for general SmartCMP form JavaScript extension work. The scripts provide generic validation, normalize structure, preserve unknown keys, and warn about JavaScript risk; they must not perform business semantic inference from field labels, expression substrings, or familiar variable names.
Prefer explicit field-level JavaScript for dynamic behavior. When the user asks for computed values, visibility, linkage, validation, or non-catalog model reads, generate the requested JavaScript directly under the relevant SmartCMP key, usually config.value.expression with source: "mock" and method: "mock" for computed values. Service-catalog context reads are the exception: do not hand-write sourceParams.<key>, sourceParams['<key>'], or label-based guesses such as sourceParams['业务组']; use value_expressions_json with catalog aliases so _catalog_fields.py and the generated fallback paths decide the runtime source. The LLM owns the business meaning of the generated JavaScript; the script layer is not the source of business semantics.
Catalog context is reference/catalog metadata for generating JavaScript, not a fixed synchronization feature. catalog-provided context values are read-only inputs to the generated expression. Do not add projection source values as form fields unless the user explicitly asks to show or edit them. Do not rely on catalog_fields_json to satisfy catalog context needs; use it only when the user explicitly asks to insert or display a SmartCMP standard catalog field.
value_expressions_json is an optional compatibility helper for deterministic projection/composition cases that already fit its limited data shape. In plain terms, value_expressions_json is an optional compatibility helper, not the default design path. Do not use value_expressions_json as the default path for general SmartCMP JavaScript work, and do not force a custom JavaScript request into this helper. When using this helper, keep these contracts:
- Service-catalog context derived fields are not general custom JavaScript. If the user asks a target field to be filled from standard service-catalog context, use
value_expressions_jsonwithfield/$fieldcatalog aliases unless the user provides complete custom JavaScript that reads verified paths instead of directsourceParamskeys. - User-enumerated fields are visible by default. Do not mark requested fields as hidden, titleless, off-screen, or non-editable unless the user explicitly asks for hidden or technical behavior. Field names do not imply hidden compatibility behavior by themselves.
value_expressions_jsonis always a JSON array string. For one computed target, pass a one-element array.- A form field is a user-facing/request parameter in
schema.properties. A source value used only to compute another field is not a form field. - When the user enumerates fields or gives a field count, pass
requested_fields_jsonwith exactly those top-level business form field keys, in order. Every item must be a non-empty string. This is for any number of fields; do not include source/dependency values used only byvalue_expressions_json, and do not include hidden SmartCMP technical fields such asschemaFormValid. The design tool rejects missing requested fields. - Exact field-set constraints can be expressed in any wording or language. Infer them from the user's intended scope, not by matching a fixed keyword list. When the user constrains the exact field set or field count,
schema.propertiesandfieldsetscontain exactly those requested business form fields plus any hidden SmartCMP technical fields added by the design tool. fieldKeyis always the exact requested target field. There is no default target.- Use
valueTypewhen the backend requires the submitted parameter type:string,jsonString,object, orarray.object/arraysubmit raw structuredmodel[fieldKey]values while the schema field stays atype: "string"/widget.id: "string"control so SmartCMP executesconfig.value.expression;jsonStringsubmits valid JSON text;stringsubmits formatted text. If omitted, the tool infersobjectorarrayfrom an existing target field schema type before falling back tostring. - Choose exactly one value shape per request: top-level
fieldsfor a flat object, orcomposefor the exact nested object/array/string structure the target field should receive. Never send bothfieldsandcomposefor the samefieldKey. fieldsmaps unique output labels to source reads and is only a shorthand for flat JSON such as{"名称":"..."}. Each item uses alabelplus eitherfieldfor a catalog alias orpathfor an exact model path. Do not repeatlabelto imply a parent key or group.composeis the target output structure itself. Plain object keys become literal output keys; source reads must be single-key leaf markers usingfield/$field,path/$path,$literal, or$concat.- For any nested, grouped, array, or complex concatenation request, copy the requested output structure into
composebefore resolving source reads. Decompose complex output into leaf source reads, then combine those leaves with the surrounding JSON structure or$concat. - When the final target value is a single formatted string, use one top-level
$concatcontaining literal text and source marker leaves. Do not model that final string as a plain object unless the user explicitly asks for JSON object output. - Do not invent helper metadata, placeholders, or alternate mini-languages inside
value_expressions_json; if a key is not one of the supported source markers, the tool treats it as output data. - Source reads use
field/$fieldfor known catalog aliases with fallback candidate paths, orpath/$pathfor exact model paths with no parent-path fallback. - Do not add source/dependency values as form fields unless the user explicitly asks to show or edit those values.
- Preserve requested visibility and titles. Value-expression target fields stay executable scalar controls; use
valueTypefor the runtime submitted value type instead of turning the schema field into an object or array container. Do not default value-expression target fields to hidden, titleless, or non-editable. - Return an empty string until at least one source value resolves.
Only these catalog aliases are supported: name/名称, owners/所有者, projects/应用系统, businessGroup/业务组.
For custom JavaScript, provide a complete function string under config.value.expression with source: "mock" and method: "mock". The design tool rejects literal ellipsis placeholder JavaScript. Keep Chinese labels as literal UTF-8 text, not Unicode escape sequences.
Common Widget Contracts
Use the SmartCMP widget shape, not generic web-control names:
- Text input:
type: "string"withwidget.id: "string". - Number input:
type: "number"withwidget.id: "number"and range validation when known. - Checkbox:
type: "boolean"withwidget.id: "checkbox". - Select:
type: "string",format: "uiselect",widget.id: "select", anddefault: nullwhen a placeholder should show. - Multi-select:
type: "array"ortype: "string",format: "uiselect",widget.id: "select", plusselectMode: "multiple". - Static options: use field-level
selectDataswith display labels and stored values; do not hide option data insidewidget. - Tables: top-level table fields use
type: "array"withwidget.id: "table-head"; row schema lives underitems.properties, anditems.fieldsetslists row columns. - User-facing text should prefer
i18nTitle,i18nPlaceholder, andi18nDescriptionwhen Chinese/English rendering matters. - Required fields use
required/isRequired; keepschema.requiredconsistent when the target renderer expects root required lists. - Description-only Angular2 schemas still need non-empty
properties; add a hidden placeholder property instead of returning a schema with only description text.
Schema Rules
- Root:
type: objectwithpropertiesandwidget.id: "object". propertiesandfieldsetsmust match the requested business form-field set; computed-value dependencies do not expand that set, and hidden SmartCMP technical fields such asschemaFormValidare the only allowed tool-added exception.- When adding fields through
catalog_fields_jsonorvalue_expressions_json, the generated target fields must also be present in rootfieldsets. - Root
fieldsetsuse the catalog-request-compatible idfieldset-default; requested business fields use stable 1-based top-levelindexvalues in display order, while hidden SmartCMP technical fields do not participate in business field indexing. - Top-level fields: stable
id, numericindex, matchingtype, andwidget.id(string, nottext, for string inputs). - Include
config.visibility.allowInRequestandallowInApprovalunless the user supplied different visibility. - Preserve unknown keys,
hidden,condition,fieldsets,selectDatas,value, anditems.
Output
Return the exact normalized schema text from smartcmp_design_form_schema as a fenced json block. All string values inside the returned JSON are opaque. Do not add, remove, rename, move, summarize, or abbreviate any property or string value. Do not summarize, abbreviate, reorder, rename, or replace long JavaScript strings with ....
For URL-based regenerate or modify work, state that the result is a replacement schema for manual review and copying. Do not imply that the tool saved, updated, or published the CMP form.