mofang-records

Magicflu/Mofang web-table records and BPM workflow CLI skill. Use when users ask about 魔方网表, Magicflu/Mofang spaces, forms, fields, records, data query/search/list, create/update/delete/import records, field definitions, CRUD, json records, BPM/workflow tasks, 待办, 审批, 提交, 转办, 认领, 驳回, 终止, 取回, 加签, or process transactions. Supports OpenClaw, Claude Code, Codex, Trae, and Trae CN.

Audits

Pass

Install

openclaw skills install mofang-records

魔方网表记录与流程 CLI

Use this skill to operate Magicflu/Mofang web-table records and BPM tasks through the bundled CLI. Do not hand-write HTTP requests for supported operations; the CLI handles token refresh, field mapping, space/form resolution, filters, and BPM cookies.

Install Locations

Copy the whole mofang-records/ folder, not only SKILL.md.

ClientProject installGlobal install
OpenClaw.openclaw/skills/mofang-records/~/.openclaw/skills/mofang-records/
Claude Code.claude/skills/mofang-records/~/.claude/skills/mofang-records/
Codex.codex/skills/mofang-records/~/.codex/skills/mofang-records/
Trae.trae/skills/mofang-records/~/.trae/skills/mofang-records/
Trae CN.trae/skills/mofang-records/~/.trae-cn/skills/mofang-records/

Required runtime: Node.js 18+.

Configuration

The CLI reads these environment variables, with MOFANG_* taking priority:

  • MOFANG_BASE_URL or BASE_URL
  • MOFANG_USERNAME or USERNAME
  • MOFANG_PASSWORD or PASSWORD
  • Optional: FETCH_TIMEOUT_MS in milliseconds, default 120000

If a .env file exists beside cli.mjs, values are loaded only when the variable is not already set in the environment.

CLI Contract

Run commands from the skill directory:

node cli.mjs <command> '<json-params>'

Every command prints JSON:

{"success":true,"message":"...","data":{}}

If a command fails, keep the JSON output and report message to the user. Do not expose tokens or passwords.

Bash Examples

export MOFANG_BASE_URL="http://appdev.com.magicflu.com:9999"
export MOFANG_USERNAME="admin"
export MOFANG_PASSWORD="***"
node cli.mjs mofang_list_spaces '{}'
node cli.mjs mofang_list_spaces '{"q":"前端编程"}'
node cli.mjs mofang_list_forms '{"spaceHint":"AI前端编程演示"}'
node cli.mjs mofang_query_records '{"spaceHint":"AI前端编程演示","formHint":"采购申请主表","pageSize":10}'

PowerShell Examples

$env:MOFANG_BASE_URL='http://appdev.com.magicflu.com:9999'
$env:MOFANG_USERNAME='admin'
$env:MOFANG_PASSWORD='***'
node cli.mjs mofang_list_spaces '{}'
node cli.mjs mofang_list_spaces '{\"q\":\"前端编程\"}'
node cli.mjs mofang_list_forms '{\"spaceHint\":\"AI前端编程演示\"}'
node cli.mjs mofang_query_records '{\"spaceHint\":\"AI前端编程演示\",\"formHint\":\"采购申请主表\",\"pageSize\":10}'

Required Workflow

  1. Prefer read-only commands first: list spaces, list forms, get field definitions, query records.
  2. Always pass spaceHint when the user provides or implies a target space. This prevents cross-space ambiguity.
  3. Before create or update, run mofang_get_field_definitions for the target form and use real field name or label values.
  4. Show a concise preview before write operations and get user confirmation, unless the user already explicitly confirmed the exact write.
  5. Treat delete and BPM actions as high risk. Confirm the target record/task and explain the consequence before running them.
  6. Use the CLI for supported operations. Do not import handler modules directly or build custom fetch/requests calls for records/BPM.

Commands

Records and Forms

CommandPurposeKey params
mofang_test_connectionTest base URL and credentials{}
mofang_list_spacesList or search accessible spacesq?, spaceHint?, page?, pageSize?, all?
mofang_list_formsList forms in a spacespaceHint?
mofang_get_field_definitionsGet fields, names, types, optionsformHint, spaceHint?
mofang_query_recordsQuery records with pagination/filter/orderformHint, spaceHint?, filters?, page?, pageSize?, all?
mofang_create_recordCreate one recordformHint, spaceHint?, data
mofang_update_recordUpdate one recordformHint, spaceHint?, recordId, data
mofang_delete_recordDelete one recordformHint, spaceHint?, recordId

BPM

CommandPurposeKey params
mofang_bpm_list_tasksList assignee/candidate/delegated tasksmode?, page?, pageSize?
mofang_bpm_query_tasksLocate BPM tasks by form/record/processformHint?, spaceHint?, recordId?, taskName?
mofang_bpm_get_taskGet one task and variablestaskId
mofang_bpm_complete_taskComplete/submit a tasktaskId, simple?, variables?
mofang_bpm_delegate_taskDelegate a tasktaskId, assignee
mofang_bpm_claim_taskClaim a group tasktaskId, assignee?
mofang_bpm_resolve_taskResolve delegated tasktaskId
mofang_bpm_jump_taskAbort, rollback, or recovertaskId, kind, jumpTargetId?, targetTaskName?
mofang_bpm_open_transactionOpen transaction such as COSIGNtaskAction, processName?, taskName?
mofang_bpm_close_transactionClose transactiontransactionId

Field Value Rules

  • Text, multiline text, URL: string
  • Number: number, never ""
  • Date: YYYY-MM-DD
  • Datetime: YYYY-MM-DD HH:mm:ss
  • Dropdown/tree: option value shown by mofang_get_field_definitions
  • Checkbox: comma-separated option values, such as "1,2"
  • Main reference: {"id":"recordId"}
  • Embed field: do not create child records inside the main create call. Create child records first, then update the main embed field with {"entry":[{"id":"childId"}]}

The CLI accepts either Chinese label or English name for data keys and filters[].fieldName, but using field name is safest for generated code.

Filters

Use filters as an array. Do not use frontend-only filterType, value2, or filterGroup unless you are relying on the CLI's best-effort legacy conversion.

{
  "formHint": "采购申请主表",
  "spaceHint": "AI前端编程演示",
  "filters": [
    {"fieldName": "申请日期", "operator": "between", "value": "2026-03-01,2026-04-01"}
  ],
  "pageSize": 50
}

Supported operators include eq, noteq, like, like_and, like_or, lt, gt, lte, gte, between, isnull, isnotnull, in, notin, checkbox_in, checkbox_eq, tree, and rddl.

Troubleshooting

  • If a form name resolves incorrectly, rerun with explicit spaceHint.
  • mofang_list_spaces {} lists spaces by created time descending. To locate a specific space faster, search directly with {"q":"关键词"} or {"spaceHint":"空间名"}.
  • If a request hangs or times out, check MOFANG_BASE_URL, network/VPN, and optionally set FETCH_TIMEOUT_MS.
  • If numeric fields fail with NumberFormatException, remove empty string values and check field definitions.
  • If dropdown values become empty, inspect mofang_get_field_definitions options and submit the shown option value, not the display label unless they are the same.
  • If PowerShell JSON parsing fails, escape inner quotes as \" or run from bash with normal single-quoted JSON.