fcode-json-schema
Author Factorial Code process input-parameter schemas (parametersSchema.json) — every supported input type and validation option, with a complete annotated sample. Use when creating or editing a parametersSchema.json, or defining a Factorial Code (fcode) process's input parameters or form fields.
How do I install this agent skill?
npx skills add https://github.com/factorialco/factorial-code-skills --skill fcode-json-schemaIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides documentation and examples for authoring JSON schemas for Factorial Code process parameters. It includes security best practices for handling sensitive data and validates user input.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
Factorial Code — input parameter schemas
A process's input parameters are defined by a JSON Schema in
parametersSchema.json. The same schema is what fcode-forms renders as a web
form, so designing the schema is designing the form. Values arrive in code as
fcode.context.parameters (see fcode-javascript / fcode-python).
Schemas render with react-jsonschema-form,
so its ui: options apply.
How to author one
- Top level is
"type": "object"with apropertiesmap (one entry per field) and an optionalrequiredarray. - Pick a
typeper field (string,integer,number,boolean,array,object) and add validation (minimum/maximum,format,enum/oneOf,uniqueItems, nestedproperties). - Control rendering with a per-field
uiobject (e.g."ui": { "ui:widget": "textarea" }). - Open
assets/parametersSchema.sample.jsonfor a complete, copy-pasteable schema exercising every supported type — adapt fields from it rather than guessing the shape.
Field types & widgets (in the sample)
-
Text —
"type": "string";format: "email";ui:widgetoftextarea,color,hidden, orfile. -
Secret —
"isSensitive": truemasks the input and marks it as a secret for the platform (e.g. passwords/tokens); the platform never serves itsdefault/examples/const(seefcode-forms)."ui:widget": "password"alone only hides the value on screen — withoutisSensitivethe field is not protected, and the CLI warns on push about a password widget or a secret-looking name (token, password, API key, client secret…) without it. -
Numbers —
integer/numberwithminimum/maximum. -
Boolean —
"type": "boolean". -
Choices —
enum(select),oneOfof{ const, title }(labeled radio withui:widget: "radio"), or an array withui:widget: "checkboxes"+uniqueItems. -
Structured — nested
objectwith its ownproperties/required; arrays of strings or of objects (type: "array"+items); raw JSON via"ui": { "ui:field": "json" }. -
Conditional fields — use top-level
dependenciesto show/hide fields based on another field's value (seeanotherBooleanFieldin the sample). -
Content around a field — a per-field
markdownobject withbefore/afterstrings renders block markdown (full GFM, incl. tables) above/below the field. Detail and a worked example infcode-forms(references/advanced.md). -
Long forms — split roughly ten or more fields into steps with a root-level
ui:stepsnode; seefcode-forms§Multi-step forms. The same node can declareprocesssteps that span several processes' forms (a multi-process flow, owned byfcode-forms). -
Connect an external account — a
stringorbooleanwith"ui": { "ui:widget": "oauth", "ui:options": { "authorizationUrl": … } }renders a button that completes an OAuth flow in a popup ("ui:field": "oauth"for anobject; seeoneOauthConnectFieldin the sample). Contract and callback infcode-forms§Connect an external account. -
Pair records with another system — an
objectwith"ui": { "ui:field": "pairing" }whose properties are one row each (astring; the other system's records as choices, once for the section inx-fcode-choicesor per row asoneOf/enum, or, in a section that setsui:options.freeText: true, no choices at all for a row the admin types, when those records can't be listed; without the flag such a row is dropped) renders as one reviewable table instead of a dropdown per record. Per row,"x-fcode-suggestion": { "value", "reason" }proposes a match and"x-fcode-in-use": truenarrows the default list;defaultis the stored pair. Use it for any mapping of more than a handful of Factorial records (accounts, tax codes, cost centers, wage types, absence codes, positions). Contract and semantics infcode-forms§Pairing tables; seeaccountPairingin the sample. -
Let One fill the form — a
"type": "object"property with"ui": { "ui:field": "launch-one", "ui:options": { "label", "prompt", … } }renders a "Set up with One" button inside Factorial and submits nothing; seefcode-forms§Set up with One. -
Employees — Factorial's employee picker (search, filters, avatars). An
arrayofstringpicks several people and astringpicks one; mark it with"x-fcode-entity": "employee"and draw it with"ui:widget": "employee". The value is Factorial employee IDs (not access IDs), the same IDs the public API and Factorial One use. Optionalui:options:onlyActive(defaulttrue;falselists inactive employees too) andfilters, the filter names to offer (e.g.["team", "legalEntity"]). Seeemployeesin the sample."employees": { "type": "array", "title": "Employees", "items": { "type": "string" }, "x-fcode-entity": "employee", "ui": { "ui:widget": "employee", "ui:options": { "filters": ["team", "legalEntity"] } } }
Gotchas
- A file field (
"ui:widget": "file") is auto-uploaded to Storage before the process runs; the parameter arrives as anfcode.storage://…reference, not the file contents. Strip the prefix beforefcode.storage.download(...). - The employee picker only exists inside Factorial. Anywhere else (an
embedded form, the hosted
forms.js) the field falls back to a plain select when it lists its choices withenum/oneOf, and to a short notice otherwise (ui:options.unavailableMessagereplaces the text). Expose a form with an employee field through Factorial (fcode-factorial-actions). - Keep both keys on an employee field.
x-fcode-entitysays what the field means and is what Factorial One reads;ui:widgetonly draws it, and One never seesuikeys. Withoutx-fcode-entity, One does not know to pass employee IDs. - The picker lists the employees the person filling in the form may see, not what the App may see. Check every employee ID the process receives before acting on it.
- There is no "select all". The user picks each person; the process never receives "everyone matching a filter".
- A pairing row's suggestion is not its
default. Put a proposal inx-fcode-suggestion, never indefault: adefaultis a stored pair, shown as confirmed and submitted as it is, while a suggestion is only submitted once the user accepts it. A"default": ""is an explicit "not mapped" when the choices include a""option (without one the SDK drops it), and never a blank. Keep both on the row (x-fcode-*is what Factorial One reads;uionly draws the table). isSensitive: trueonly affects display/masking — still read the value from a secret variable, never hardcode it.- An oauth field's
authorizationUrlmust be injected with{ "$ref": "#/variables/x" }from apreRenderProcessvariable — never{{x}}, which Mustache HTML-escapes into a URL the widget refuses (the button renders disabled with a console warning). - The schema is the single source of the form's fields — to change fields, edit the schema, not the form embed code.
- The schema is data, not code — no executable JavaScript, and all form
text is markdown (raw HTML is never rendered). Client-side behaviour belongs
in the embedding page — see
fcode-forms. - Size a choice field for the biggest customer. Every option of an
enum, aoneOfof{ const, title }or thefcode-formsmodule'sselectField/multiSelectFieldships inside the schema, so a list fed from a directory that grows with the company (every employee, every manager, all projects or cost centers) turns into thousands of options for a large account. Nobody can pick from that, and hosts on a forms SDK older than@factorialco/fcode-react-forms3.7.1 fail validation with "Maximum call stack size exceeded" from about 1,000 options: the submit button silently does nothing. Small organisational lists (teams, legal entities, locations, roles) stay in the tens even for large accounts and are fine to list whole. The forms SDK has no searchable or remote-loading picker, so for people, projects or cost centers ask for something bounded instead: a team, legal entity, role or location the process resolves to people; a list narrowed by the API's filters to the people who can plausibly be chosen (keep it to a couple of hundred at most); or emails / ids as text. Free text drops the limit a select gave, so the process must check both that the person exists and that the caller may choose them (for example as an approver), and reject anything else with a clear message — parameters are untrusted (fcode-forms§What a form may trust). - Visible text can be translated: schema strings (titles, descriptions,
ui:placeholder) acceptfcode.i18n("key")tokens, substituted server-side before the form is served — seefcode-i18n.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/factorialco/factorial-code-skills/fcode-json-schema">View fcode-json-schema on skillZs</a>