FastGPT JSON Config Skill
Treat this skill as a specification plus test suite: generate by copying templates, then prove the file passes deterministic checks.
Required Resources
Load these first for every generation or repair task:
references/generation-hard-rules.md
references/official-default-node-templates.json
references/official-node-contract-summary.md
references/runtime-node-templates.md
references/node-field-contracts.md
references/acceptance-spec.md
scripts/validate_fastgpt_json.py
Load conditional references only when the requirement needs them:
references/required-input-rules.md
references/ifelse-rules.md
references/dataset-rules.md
references/classify-rules.md
references/node-selection-rules.md
references/workflow-generation-playbook.md
references/json-config-runtime-reference.md
references/json-import-feature-guide.md only for import UI/background behavior; do not copy node templates from it
references/json-config-specification.md only for historical/background context; do not copy node templates or IO keys from it
references/json-config-troubleshooting.md only when repairing a known broken file; do not copy node templates from it
references/protocol-v1.md
Execution Protocol
Follow this order exactly.
- Decompose the request into stages.
- Create a node inventory.
- Copy node shapes from
official-default-node-templates.json; use runtime-node-templates.md only as an override and usage guide.
- Fill
inputs[].value after node IDs are fixed.
- Generate
edges last.
- Save JSON with UTF-8.
- Run
python scripts/validate_fastgpt_json.py <generated-file>.
- Fix any
ERROR: and rerun until VALIDATION_OK.
- Apply readable layout before validation:
- connected columns must be spaced at least
1500 on x
- branch or sibling nodes must be spaced at least
1000 on y
- prefer
0, 1500, 3000, 4500... for x positions
- do not stack connected nodes at the same position
Node Inventory
Before writing JSON, record:
nodeId
flowNodeType
- purpose
- position
- required input keys
- output keys
- upstream data dependencies
- visual predecessor and visual successor
Include exactly one workflowStart and one userGuide.
Copy Rules
- Keep runtime configuration in
node.inputs, never props.
- Use
references/official-default-node-templates.json as the source of truth for single-node default inputs, outputs, render types, value types, labels, hidden fields, and dynamic system fields.
runtime-node-templates.md is not a competing template source. It only explains how to copy official defaults and which scenario values may be filled.
- Do not invent inputs, outputs, handles, or variable syntax.
- Generate clean UTF-8 Chinese user-facing text.
- Required files flow through
workflowStart.userFiles and readFiles.system_text.
- Normal input references use
["nodeId", "outputKey"].
answerNode.text.value must be a string. Variable references inside it must use {{$nodeId.outputKey$}}; never use array references such as ["nodeId", "outputKey"] for answerNode.text.
textEditor.system_textareaInput uses {{$nodeId.outputKey$}} when embedding upstream variables in text.
- Every runtime reference must point to a node that is upstream of the consuming node in the visual edge graph. A direct edge is not required when the referenced node and the consuming node are already on the same upstream chain.
- Do not leave business nodes isolated. Every non-
workflowStart and non-userGuide node must be reachable from workflowStart through edges, and every final path must reach an answerNode.
Edge Rules
- Edges are visual canvas connections, not data bindings.
- Normal edges must use:
sourceHandle: "{sourceNodeId}-source-right"
targetHandle: "{targetNodeId}-target-left"
- Never use business keys such as
system_text, answerText, userFiles, userChatInput, fileUrlList, system_textareaInput, or text as edge handles.
- Branch nodes use their documented branch handles.
- Edges express the readable execution chain. Do not add a separate direct edge for every referenced input when the referenced node is already upstream of the consuming node through the chain.
- If node B references output from node A and A is not already upstream of B, add or reorder visual edges so A becomes upstream of B.
- Do not create unreferenced business nodes just to satisfy a design idea.
Hard Requirements
- Official default
workflowStart has input userChatInput and output userChatInput; add userFiles only when the workflow needs chat file upload.
- Every
chatNode includes model, isResponseAnswerText, systemPrompt, history, quoteQA, fileUrlList, and userChatInput.
chatNode.model.renderTypeList includes settingLLMModel.
- If a
chatNode eventually outputs through an answerNode, set isResponseAnswerText.value = false.
contentExtract outputs only success, fields, and system_error_text.
textEditor puts deterministic template text in system_textareaInput.value.
answerNode is final reply only and uses input key text.
answerNode.text.value must never be ["nodeId", "outputKey"]; use "{{$nodeId.outputKey$}}" instead.
ifElseNode.ifElseList.value[] uses condition plus list.
httpRequest468.system_httpReqUrl.value is never empty.
userGuide follows the official default system config inputs (welcomeText, variables, questionGuide, tts, whisper, scheduleTrigger) and has no business outputs.
- Generated JSON must not contain mojibake markers.
- Connected nodes must differ by at least
1500 on x.
- Branch/sibling nodes must differ by at least
1000 on y.
- Node layout must remain readable; avoid stacked or overlapping positions.
- Runtime references and edges must agree: every
["nodeId", "outputKey"] and every {{$nodeId.outputKey$}} used inside a node must reference a node that is reachable upstream through the visual edge graph. Do not require direct source-to-target edges for all references.
- Every business node must be on the workflow path: reachable from
workflowStart and able to reach an answerNode, unless it is userGuide.
Validation
- Save the JSON to disk first unless the user explicitly requests chat-only output.
- Run the bundled validator from the skill directory or by absolute path.
- Any
ERROR: is blocking.
- If the validator cannot run, report
未验证:未能运行校验脚本.
- Do not call JSON import-ready unless validation passes.
Final Response
Return a concise Chinese report:
需求确认
生成结果 or 修复结果
验证报告
文件路径
Do not paste large JSON unless the user asks.
Protocol Export
When the user asks to "export with skill protocol", output a fenced block using fastgpt-json-skill-protocol/v1 from references/protocol-v1.md.
1---2name: aibuilder-json-creator3description: Generate, repair, and validate import-ready FastGPT workflow JSON from natural-language requirements or existing JSON. Use for FastGPT agents/workflows, broken JSON imports, node/edge/reference validation, strict runtime node IO, Markdown chatConfig, and deterministic acceptance checks.4---56# FastGPT JSON Config Skill78Treat this skill as a specification plus test suite: generate by copying templates, then prove the file passes deterministic checks.910## Required Resources1112Load these first for every generation or repair task:13141. `references/generation-hard-rules.md`152. `references/official-default-node-templates.json`163. `references/official-node-contract-summary.md`174. `references/runtime-node-templates.md`185. `references/node-field-contracts.md`196. `references/acceptance-spec.md`207. `scripts/validate_fastgpt_json.py`2122Load conditional references only when the requirement needs them:2324- `references/required-input-rules.md`25- `references/ifelse-rules.md`26- `references/dataset-rules.md`27- `references/classify-rules.md`28- `references/node-selection-rules.md`29- `references/workflow-generation-playbook.md`30- `references/json-config-runtime-reference.md`31- `references/json-import-feature-guide.md` only for import UI/background behavior; do not copy node templates from it32- `references/json-config-specification.md` only for historical/background context; do not copy node templates or IO keys from it33- `references/json-config-troubleshooting.md` only when repairing a known broken file; do not copy node templates from it34- `references/protocol-v1.md`3536## Execution Protocol3738Follow this order exactly.39401. Decompose the request into stages.412. Create a node inventory.423. Copy node shapes from `official-default-node-templates.json`; use `runtime-node-templates.md` only as an override and usage guide.434. Fill `inputs[].value` after node IDs are fixed.445. Generate `edges` last.456. Save JSON with UTF-8.467. Run `python scripts/validate_fastgpt_json.py <generated-file>`.478. Fix any `ERROR:` and rerun until `VALIDATION_OK`.489. Apply readable layout before validation:49 - connected columns must be spaced at least `1500` on x50 - branch or sibling nodes must be spaced at least `1000` on y51 - prefer `0, 1500, 3000, 4500...` for x positions52 - do not stack connected nodes at the same position5354## Node Inventory5556Before writing JSON, record:5758- `nodeId`59- `flowNodeType`60- purpose61- position62- required input keys63- output keys64- upstream data dependencies65- visual predecessor and visual successor6667Include exactly one `workflowStart` and one `userGuide`.6869## Copy Rules7071- Keep runtime configuration in `node.inputs`, never `props`.72- Use `references/official-default-node-templates.json` as the source of truth for single-node default inputs, outputs, render types, value types, labels, hidden fields, and dynamic system fields.73- `runtime-node-templates.md` is not a competing template source. It only explains how to copy official defaults and which scenario values may be filled.74- Do not invent inputs, outputs, handles, or variable syntax.75- Generate clean UTF-8 Chinese user-facing text.76- Required files flow through `workflowStart.userFiles` and `readFiles.system_text`.77- Normal input references use `["nodeId", "outputKey"]`.78- `answerNode.text.value` must be a string. Variable references inside it must use `{{$nodeId.outputKey$}}`; never use array references such as `["nodeId", "outputKey"]` for `answerNode.text`.79- `textEditor.system_textareaInput` uses `{{$nodeId.outputKey$}}` when embedding upstream variables in text.80- Every runtime reference must point to a node that is upstream of the consuming node in the visual edge graph. A direct edge is not required when the referenced node and the consuming node are already on the same upstream chain.81- Do not leave business nodes isolated. Every non-`workflowStart` and non-`userGuide` node must be reachable from `workflowStart` through edges, and every final path must reach an `answerNode`.8283## Edge Rules8485- Edges are visual canvas connections, not data bindings.86- Normal edges must use:87 - `sourceHandle: "{sourceNodeId}-source-right"`88 - `targetHandle: "{targetNodeId}-target-left"`89- Never use business keys such as `system_text`, `answerText`, `userFiles`, `userChatInput`, `fileUrlList`, `system_textareaInput`, or `text` as edge handles.90- Branch nodes use their documented branch handles.91- Edges express the readable execution chain. Do not add a separate direct edge for every referenced input when the referenced node is already upstream of the consuming node through the chain.92- If node B references output from node A and A is not already upstream of B, add or reorder visual edges so A becomes upstream of B.93- Do not create unreferenced business nodes just to satisfy a design idea.9495## Hard Requirements9697- Official default `workflowStart` has input `userChatInput` and output `userChatInput`; add `userFiles` only when the workflow needs chat file upload.98- Every `chatNode` includes `model`, `isResponseAnswerText`, `systemPrompt`, `history`, `quoteQA`, `fileUrlList`, and `userChatInput`.99- `chatNode.model.renderTypeList` includes `settingLLMModel`.100- If a `chatNode` eventually outputs through an `answerNode`, set `isResponseAnswerText.value = false`.101- `contentExtract` outputs only `success`, `fields`, and `system_error_text`.102- `textEditor` puts deterministic template text in `system_textareaInput.value`.103- `answerNode` is final reply only and uses input key `text`.104- `answerNode.text.value` must never be `["nodeId", "outputKey"]`; use `"{{$nodeId.outputKey$}}"` instead.105- `ifElseNode.ifElseList.value[]` uses `condition` plus `list`.106- `httpRequest468.system_httpReqUrl.value` is never empty.107- `userGuide` follows the official default system config inputs (`welcomeText`, `variables`, `questionGuide`, `tts`, `whisper`, `scheduleTrigger`) and has no business outputs.108- Generated JSON must not contain mojibake markers.109- Connected nodes must differ by at least `1500` on x.110- Branch/sibling nodes must differ by at least `1000` on y.111- Node layout must remain readable; avoid stacked or overlapping positions.112- Runtime references and edges must agree: every `["nodeId", "outputKey"]` and every `{{$nodeId.outputKey$}}` used inside a node must reference a node that is reachable upstream through the visual edge graph. Do not require direct source-to-target edges for all references.113- Every business node must be on the workflow path: reachable from `workflowStart` and able to reach an `answerNode`, unless it is `userGuide`.114115## Validation116117- Save the JSON to disk first unless the user explicitly requests chat-only output.118- Run the bundled validator from the skill directory or by absolute path.119- Any `ERROR:` is blocking.120- If the validator cannot run, report `未验证:未能运行校验脚本`.121- Do not call JSON import-ready unless validation passes.122123## Final Response124125Return a concise Chinese report:1261271. `需求确认`1282. `生成结果` or `修复结果`1293. `验证报告`1304. `文件路径`131132Do not paste large JSON unless the user asks.133134## Protocol Export135136When the user asks to "export with skill protocol", output a fenced block using `fastgpt-json-skill-protocol/v1` from `references/protocol-v1.md`.