← 返回 Skills 市场
chikawa11

chat2workflow

作者 chikawa11 · GitHub ↗ · v1.1.1 · MIT-0
cross-platform ✓ 安全检测通过
171
总下载
1
收藏
0
当前安装
12
版本数
在 OpenClaw 中安装
/install chat2workflow
功能描述
A design-only workflow designer for the Dify and Coze platforms. Through multi-round conversation, it produces a structured workflow JSON (nodes, edges, vari...
使用说明 (SKILL.md)

Chat2Workflow Builder Skill

What this skill does

This skill is design-only. Its deliverable is three tagged sections of text (see Output Format below) — most importantly a workflow JSON wrapped in \x3Cworkflow>\x3C/workflow>. Producing those three sections involves only reading the platform documentation under node_docs/ and emitting text; nothing else happens.

A few Python files also live in this folder (converter.py, autofix.py, tools.py, bash_converter.sh). They are not part of the skill's deliverable and are not referenced by the generation process. They exist as standalone utilities that a user can run manually from a shell, entirely outside the skill's text-generation flow, if they separately want to turn a JSON file into a Dify YAML or Coze ZIP on their own machine. See the bundled README/source of those scripts for their CLI usage; the skill itself does not invoke them.

Overview

A Chat2Workflow design is a Directed Acyclic Graph of connected nodes, where each node represents a step of logic, data processing, or model inference. The design is serialized as a JSON object that enumerates the nodes and the edges that connect them.

This skill supports two target platforms:

Platform Documentation File Selection criterion
Dify (default) node_docs/dify.md The user instruction explicitly mentions Dify, or no platform is specified at all.
Coze node_docs/coze.md The user instruction explicitly mentions Coze / 扣子.

Platform Resolution

Platform selection is a two-step lookup performed against the user's instruction:

  1. The user's instruction is scanned for platform keywords — dify / Dify / DIFY or coze / Coze / 扣子.
  2. If a platform keyword is present, that platform is the target. Otherwise the target is Dify (the default).
  3. The matching file from node_docs/node_docs/dify.md or node_docs/coze.md — is the authoritative schema for node type strings, param objects, and referable variables on that platform. The two platforms have different node sets, different parameter schemas, and different referable variables.
  4. The chosen platform is named in \x3Cdesign_principle> with a short justification, e.g. "Platform: Dify (user did not specify, defaulting to Dify).".

A single workflow targets a single platform; every node's type comes from that platform's documentation file.

The interaction model is conversational: the user supplies creation or modification instructions across multiple rounds, and — unless an instruction says otherwise — each new response extends the current design rather than replacing it. Responses follow the structure described in Output Format.

Output Format

A well-formed response consists of three clearly tagged sections rendered as inline text (not files):

1. Node Selection

Wrapped in \x3Cnode_selection>\x3C/node_selection> tags. Lists the names of the nodes chosen for the design.

2. Design Principle

Wrapped in \x3Cdesign_principle>\x3C/design_principle> tags. Explains the reasoning and architecture decisions. Contains at minimum:

  • A one-line Platform declaration (Platform: Dify or Platform: Coze).
  • A Variable Checklist subsection that cross-checks the input and output variables against the instruction's requirements (see Workflow Validity Rule 2 below).

3. Workflow JSON

Wrapped in \x3Cworkflow>\x3C/workflow> tags. Contains the complete workflow as a single valid JSON object.

The content inside \x3Cworkflow> is raw JSON — markdown code fences around it break parsing, because the downstream pipeline calls json.loads() directly on the content between the tags. Concretely, ```json immediately after \x3Cworkflow> or ``` immediately before \x3C/workflow> will cause the parse step to fail. Code fences that appear inside JSON string values (for example inside a code node's code field) are fine — only the outer wrapping fences cause parsing problems.

JSON Structure Specification

The JSON object describes a Directed Acyclic Graph (DAG) workflow, consisting of two core fields:

nodes_info (Array)

Contains detailed configuration information for all nodes. Each element is an object representing a functional node and contains the following fields:

  • id (String): The unique identifier of the node, a string that increments starting from 1 (e.g., "1","2").
    • Note: Child nodes within an Iteration node use the format "\x3CParentID>-\x3CSeqNum>", where \x3CParentID> is the id of the enclosing iteration node and \x3CSeqNum> is a sequential number starting from 1 that increments for each child node within that iteration canvas. For example, if the iteration node's id is "3", its child nodes are "3-1", "3-2", "3-3", etc. The iteration-start node is always the first child, i.e., "\x3CParentID>-1" (e.g., "3-1", "5-1").
  • type (String): The type of the node. The type value should exactly match the Type specified in the selected platform's node documentation (e.g., the Template node's type is template-transform, not template). Using an incorrect type string — or a type string that does not belong to the selected platform — will cause the workflow to fail.
  • param (Object): Specific configuration parameters for the node. The structure varies depending on the type.

edges (Array)

Each element in the list represents a connection line. Each element follows a triplet structure: [SourceNodeID (String), OutputPortIndex (Number), TargetNodeID (String)](e.g., ["1", 0, "2"]).

  • Default output port is 0.
  • For branching nodes (question-classifier, if-else), port indices correspond to branch order (0, 1, 2...).
  • For if-else, the ELSE branch port index equals the number of explicitly defined cases (i.e., it's the last port).

Downstream Variable References

Downstream nodes can reference the referable_variables of upstream nodes, which will be represented in param.

Variable Reference System

Downstream nodes reference upstream node outputs through one of two patterns:

In structured parameters (arrays/tuples):

[SourceVariableName, SourceNodeID] Example: ["text", "3"] — references the text variable from node 3.

In text fields:

{{#\x3CSourceNodeID>.\x3CSourceVariableName>#}} Example: {{#'3'.text#}} — references the text variable from node 3.

When the SourceNodeID contains a hyphen (iteration child nodes such as "2-2"), it is quoted: {{#'2-2'.text#}}.

Workflow Validity Rules

The rules below describe what makes a produced workflow valid. They are constraints on the emitted JSON/tags, not instructions to any external system.

  1. Node Selection ↔ Workflow Consistency: The node types declared in \x3Cnode_selection> and those actually used in \x3Cworkflow> are exactly consistent. Every node declared in \x3Cnode_selection> appears in \x3Cworkflow>, and every node used in \x3Cworkflow> is declared in \x3Cnode_selection>. No omissions, no extras.

  2. Variable Checklist in Design Principle: The \x3Cdesign_principle> section contains a Variable Checklist subsection that verifies whether the input and output variables satisfy the instruction's requirements — especially relevant across multi-round interactions where variable requirements may change between rounds.

  3. JSON Bracket Integrity: The \x3Cworkflow> tag contains a single-line, valid JSON string parseable by json.loads() in Python directly. Bracket closure is critical — truncation, mismatched brackets, and unclosed structures all invalidate the JSON. Nodes with deeply nested bracket structures (for example if-else cases with multiple conditions) are the most common source of bracket mismatches; verifying that every [, {, and ( has a matching closing counterpart before finalizing avoids these errors.

  4. Escape Sequences in String Values: JSON string values cannot contain raw control characters (newline, tab, etc.), so escaping is required. This is especially relevant for the code field (Python code), LLM-node message fields (the system and user keys under a model node's param), and template fields:

  • Newlines inside string values: \ (backslash + n), not a real line break.
  • Tabs inside string values: (backslash + t).
  • Carriage returns inside string values: \r (backslash + r).
  • Double quotes inside string values: \" (backslash + quote).
  • Backslashes that should appear literally in the final string (for example in regex patterns such as \d{4}, or in Jinja2 replace('\ ', ' ')): \\ (double backslash).
    • For example, a Jinja2 template needing replace('\ ', ' ') is written in JSON as replace('\\ ',' '), because \\ in JSON represents the literal two-character sequence backslash+n.
  • Common mistake: Double-escaped forms such as \\\\ or \\\ produce literal backslash characters in the parsed output, not actual newlines/tabs. Exactly ONE level of JSON escaping is correct, regardless of whether the string content happens to be Python code or a template — JSON only ever needs one level of escaping.
    • For example: a Python snippet containing line.split(" ") is written in JSON as line.split(\"\ \")\" escapes the double quotes, \ represents a literal tab character in the parsed string.

All newlines, tabs, and carriage returns within JSON string values are represented as two-character escape sequences (\ , , \r), not as literal whitespace characters. This is especially relevant for the code field (Python code), LLM-node message fields (the system and user keys under a model node's param), and template fields.

  1. Topological Ordering of nodes_info: The nodes_info array is in topological order. Nodes use "forward references" — a node only references variables from nodes that appear before it in the array. The one exception is the output_selector of an iteration node, which may reference a child node that is defined later (since iteration child nodes are created as part of the iteration).

  2. Iteration Canvas Boundary: Edges and variable references never cross the iteration boundary. Specifically:

  • No edges exist between iteration child nodes and external nodes. External nodes connect to/from the iteration node itself, which acts as the sole bridge between internal and external.
  • External node variables are not referenced from inside the iteration canvas, and iteration child node variables are not referenced from outside (the iteration node's output is used instead).
  • Child nodes inside the iteration canvas reference the iteration node's built-in item and index variables directly (via the iteration node's id, not the iteration-start node's id in Dify).
  • The iteration node receives internal results via its output_selector parameter, which points to a child node's output variable.
  • Child nodes within an iteration canvas are connected to each other via internal edges — they are not isolated nodes.
  • On Dify, no edge exists between the iteration and iteration-start nodes.
  1. No Isolated Nodes: Every node in the workflow is connected to at least one other node via edges. A node created without any connecting edge is invalid. The workflow is a connected DAG — all nodes (except for the child nodes within the iteration canvas) are reachable from the start node through the edge graph.

  2. Instruction Fidelity — No Key Node Omissions: Producing a working workflow requires identifying every node implied or explicitly mentioned by the creation/modification instruction. A missing key node — omitting a Document Extractor when the instruction involves file content processing, or omitting an If-Else when the instruction describes conditional logic — causes the workflow to fail. A valid workflow can actually execute and solve the problem end-to-end.

  3. File-Aware Workflow Design: Whether the instruction's input or output involves files matters for node selection:

  • Inputs mentioning document or image are typically file-typed variables.
  • Inputs with multiple optional forms (where some may be empty while others have values) are handled with an if-else node that detects which inputs are provided and routes to the appropriate processing branch.
  1. Format Compliance: Creation, addition, deletion, modification, and correction all follow the structure described in Output Format so the response can be correctly parsed.

Multi-Round Interaction Rules

Unless explicitly instructed to add, remove, or modify, variables and logic not mentioned in the instruction should remain unchanged. The following rules govern how output specifications are interpreted across rounds:

Pattern Interpretation
"Only output" — "only needs to output X" (without additive language) Output exactly X. This is a fresh specification — REPLACE all previous outputs. Previous outputs NOT listed are dropped.
"Additionally add" — Additive language (any phrasing conveying "in addition to what already exists") ADD the new variables to existing outputs.
"Remove" — "Remove the output Y" Remove only Y, keep all others.
"No mention" — No mention of outputs Keep them unchanged.
"Branch-scoped change" — In a branching workflow, the output specification constrains only the branch(es) it refers to Unmentioned branches remain unchanged.

Platform-Specific Node Documentation

The complete list of node types, their parameter schemas, and their referable variables for each platform lives in a dedicated, pluggable documentation file under node_docs/:

Once the target platform has been resolved (see Platform Resolution above), the corresponding file in node_docs/ is the authoritative reference for node type strings and their param structures. Because the two platforms have different and evolving node sets, the node_docs/ file for the selected platform is consulted each time rather than relied on from memory.

Note on placeholder auth fields in node schemas

Node templates for the http-request node (and similar) contain placeholder fields such as bearerTokenData with a literal "EMPTY" value. These are schema placeholders that describe what a user-authored workflow can contain; the skill does not read, request, or transmit any credentials. Users authoring a workflow should avoid pasting real API keys, bearer tokens, or passwords into the generated JSON — those values, if pasted in, would be stored verbatim in whatever artifact the user produces.

安全使用建议
This package is coherent with its stated purpose: it produces textual workflow JSON based on bundled platform docs and includes optional, offline CLI helpers you run manually. Before installing or running anything, do these checks: 1) Open SKILL.md and search for any lines that tell the model to 'ignore', 'override', or 'change' the system prompt or model role — remove or refuse any such instruction. 2) If you plan to run converter.py/autofix.py locally, review the SAFETY_AUDIT and the scripts (they claim no network or env access) and run them in an isolated environment (e.g., sandbox or VM) if you're cautious. 3) Be aware that exported workflows may contain placeholders for tokens/API keys (e.g., bearerTokenData); you must not supply real credentials unless you trust the target platform and the workflow contents. Overall the skill appears benign and self-consistent, but manually verify there are no prompt-override directives in SKILL.md before use.
功能分析
Type: OpenClaw Skill Name: chat2workflow Version: 1.1.1 The chat2workflow skill is a legitimate utility designed to generate and convert AI workflow configurations for the Dify and Coze platforms. The skill's primary function is text generation (producing structured JSON), while the bundled Python scripts (converter.py, autofix.py, tools.py) serve as optional offline utilities for the user to compile that JSON into platform-native artifacts (YAML/ZIP). The code demonstrates high security awareness, including explicit measures to prevent writing files into the skill directory, disabling Python bytecode caching to avoid suspicious file drops, and a comprehensive SAFETY_AUDIT.md that verifies the absence of network I/O, shell execution, and credential access. No evidence of malicious intent, data exfiltration, or prompt injection was found.
能力标签
cryptorequires-sensitive-credentials
能力评估
Purpose & Capability
Name/description (chat2workflow: design-only workflow builder for Dify/Coze) align with the repository contents: node schema files (nodes/...), platform docs (node_docs/...), and helper scripts (converter.py, tools.py, autofix.py) that convert or repair the produced JSON offline. There are no unrelated requested environment variables or external binaries.
Instruction Scope
SKILL.md clearly states the skill is text-only and that the runtime output is three tagged text sections produced by reading the bundled node_docs/. The skill's instructions reference only local files and the required JSON output format. However, a pre-scan detected a 'system-prompt-override' pattern in SKILL.md (prompt-injection signal). You should manually inspect SKILL.md for phrasing that attempts to change the agent's system role or instruct the model to ignore prior policies; such content would be risky even if the package otherwise appears benign.
Install Mechanism
No install spec is provided (instruction-only skill). The included helper scripts are local CLI utilities and not automatically installed or fetched from the network. requirements.txt lists only PyYAML and json_repair. No remote downloads or extract steps are present in the skill metadata.
Credentials
The skill declares no required environment variables, no primary credential, and no config paths. The node templates include schema fields for things like bearerTokenData or plugin IDs, but these are placeholders describing what a generated workflow might contain for the target platform — the skill itself does not read environment variables or request secrets.
Persistence & Privilege
The skill does not request 'always: true' or other elevated privileges. It is user-invocable and does not modify other skills' configuration. The helper scripts run only if a user manually executes them; SKILL.md asserts they are not invoked by the skill's generation flow.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install chat2workflow
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /chat2workflow 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.1
**This update clarifies workflow and script separation, and adds user-facing script usage documentation.** - Added `CONVERTER_USAGE.md` to document usage of optional helper scripts. - Updated documentation to clearly state that bundled scripts (like `converter.py`) are not part of the skill deliverable and are not invoked by the skill itself. - Revised and condensed the skill description to emphasize design-only operation and reinforce that only text output is produced. - Removed references to automatic or conditional script invocation within the main documentation.
v1.0.10
Version 1.0.10 - Added SAFETY_AUDIT.md file to the repository. - No changes to core logic or skill behavior. - Documentation update only; no user-facing feature changes.
v1.0.9
No functional changes detected; only SKILL.md documentation has been updated for clarity. - Clarified the workflow design model and output format in documentation. - Improved explanation of platform selection and JSON requirements. - Reworded guidance on the use of helper scripts for conversion. - Updated naming and description consistency for rules and formats. - No changes to code, features, or behavior.
v1.0.8
No user-visible changes in this version. - No file changes detected since the previous release. - Functionality and documentation remain unchanged.
v1.0.7
chat2workflow 1.0.7 changelog: - Improved and clarified documentation in SKILL.md: further emphasizes the design-only nature of the skill and the non-executing role of the agent. - Moved detailed scope and execution constraints from many bulleted safety rules to more accessible summary descriptions. - Simplified explanations for how offline conversion scripts relate to core outputs. - Focused Output Format and Platform Resolution Rule sections for easier compliance and user guidance. - No logic or file changes; documentation only.
v1.0.6
- Documentation reframed for clarity: SKILL.md is now reference material for human workflow authors, not operational agent instructions. - Clarified the skill's scope: design-only with no automatic script execution; optional utility scripts are for manual, offline use. - Platform selection and output format descriptions rewritten for easier reference and to emphasize JSON schema correctness. - Node and variable referencing rules simplified, with redundant instructional wording removed. - Minor edits throughout for brevity and improved human readability.
v1.0.5
chat2workflow 1.0.5 - Rewrote and clarified documentation, especially the explanation of what bundled scripts do and do not do. - Documented script output locations, bytecode handling, and variable reference patterns as inherent script behavior. - Updated "Scope & Safety" section into plain factual explanations about script boundaries (not runtime rules). - Kept all workflow design, platform selection, and output format rules unchanged. - No file or code changes made; documentation improvements only.
v1.0.4
**Expanded security and output policies for conversion scripts and generated files.** - Clarified that no package installation, script execution, or file writes ever occur within the skill boundary. - Documented that all conversion artifacts (YAML, ZIP, etc.) are written outside the skill directory, with hard enforcement and redirection if necessary. - Added strong statements on avoiding Python bytecode cache files in the skill folder. - Specified that all third-party dependencies must be installed by users beforehand; runtime installation by the skill is strictly forbidden. - No changes to workflow design logic or core output format.
v1.0.3
- **Clarified skill scope:** The skill now only designs workflow JSON and does not execute or invoke any scripts or compilation steps automatically. - The use of bundled scripts (e.g., converter, autofix) is now strictly user-initiated and never run autonomously. - Output now consists solely of the tagged workflow design sections; compilation to platform-native formats must be explicitly requested by the user each time. - Updated descriptions and instructions to reinforce that all local tools are optional, safe, and require per-turn user consent before use.
v1.0.2
- No code or documentation changes in this version. - No functional differences from the previous release. - Version bump only; no updates impacting users.
v1.0.1
- Added a "Post-Generation Auto Pipeline" requirement: Whenever a response contains the three required tagged sections (`<node_selection>`, `<design_principle>`, `<workflow>`), the full pipeline—autofix, JSON extraction, and platform-specific config generation—must be executed immediately in the same turn. - Documented exception: The auto pipeline does NOT trigger for turns that do not output all three sections (e.g., clarification-only turns or when explicitly drafting). - Updated documentation to clarify this mandatory, end-to-end automated workflow generation and compilation process for every completed response.
v1.0.0
chat2workflow 1.0.0 — Initial Release - Expert workflow builder for Dify and Coze platforms via multi-round conversation. - Generates structured JSON workflows (nodes, edges, variable references) with platform-specific validation. - Produces importable workflow JSON, convertible to YAML using the included converter. - Supports incremental add/modify/remove operations on existing workflows. - Ensures output consistency with strict response formatting and variable tracking.
元数据
Slug chat2workflow
版本 1.1.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 12
常见问题

chat2workflow 是什么?

A design-only workflow designer for the Dify and Coze platforms. Through multi-round conversation, it produces a structured workflow JSON (nodes, edges, vari... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 171 次。

如何安装 chat2workflow?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install chat2workflow」即可一键安装,无需额外配置。

chat2workflow 是免费的吗?

是的,chat2workflow 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

chat2workflow 支持哪些平台?

chat2workflow 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 chat2workflow?

由 chikawa11(@chikawa11)开发并维护,当前版本 v1.1.1。

💬 留言讨论