← 返回 Skills 市场
magicscape

mofang-page-builder

作者 Peng · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
68
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install mofang-page-builder
功能描述
Build Magicflu/Mofang web-table custom pages from the jsonv2 records API. Use when users ask for Magicflu/Mofang forms, records, lists, create/edit/detail/ad...
使用说明 (SKILL.md)

魔方网表页面生成

Use this skill to generate and publish Magicflu/Mofang web-table pages. The safe path is:

  1. Confirm spaceId, formId, and page type.
  2. Fetch or import the real fielddef.
  3. Generate page code using only field name values from fielddef.fields[].
  4. Test with local mock-jsonv2 or proxy.
  5. Set CONFIG.apiBase to '' before same-origin publishing.

Install Locations

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

Client Project install Global install
Claude Code .claude/skills/mofang-page-builder/ ~/.claude/skills/mofang-page-builder/
Trae .trae/skills/mofang-page-builder/ ~/.trae/skills/mofang-page-builder/
Trae CN .trae/skills/mofang-page-builder/ ~/.trae-cn/skills/mofang-page-builder/

Keep these directories with the skill: examples/, assets/, references/, and scripts/.

Required Workflow

Never guess real form field names from Chinese labels. For real data:

  1. Ask for or identify spaceId and formId.
    • If only a space name is known, resolve it with /magicflu/service/json/spaces/feed.
    • To traverse all spaces, use /magicflu/service/json/spaces/feed?start=0&limit=-1&bq=(created,orderby,desc).
    • If only a form label is known, resolve it with /magicflu/service/s/json/{spaceId}/forms/feed.
  2. Run scripts/fetch-form-spec.mjs, or ask the user for an exported fielddef JSON and import it.
  3. Use only fielddef.fields[].name as API keys, submit keys, and filter field names.
  4. Use fielddef.fields[].label only for UI text.
  5. Test locally before deployment.

Example fields in examples/ and assets/mock-data/ are demos only.

Page Contract

Generated pages must include:

const CONFIG = {
  apiBase: '', // local debug: 'http://127.0.0.1:3847'; same-origin production: ''
  spaceId: 'YOUR_SPACE_ID',
  formId: 'YOUR_FORM_ID',
};

function apiUrl(path) {
  const origin = CONFIG.apiBase ? CONFIG.apiBase.replace(/\/$/, '') : '';
  return `${origin}${path}`;
}

Same-origin pages rely on browser Cookie auth. Do not set an Authorization header in page code.

API Summary

Read references/api-summary.md when you need endpoint details, bq syntax, response shape, or field value formats.

Core paths:

Capability Method Path
List all spaces GET /magicflu/service/json/spaces/feed?start=0&limit=-1&bq=(created,orderby,desc)
Find spaces by label GET /magicflu/service/json/spaces/feed?start=0&limit=10&bq=(label,eq,{spaceLabel})
List forms in a space GET /magicflu/service/s/json/{spaceId}/forms/feed?start=0&limit=-1
Find forms by label GET /magicflu/service/s/json/{spaceId}/forms/feed?start=0&limit=10&bq=(label,eq,{formLabel})
Field definition GET /magicflu/service/s/jsonv2/{spaceId}/forms/{formId}?selector=fielddef&lng=en
List records GET /magicflu/service/s/jsonv2/{spaceId}/forms/{formId}/records/entry
Create record POST /magicflu/service/s/jsonv2/{spaceId}/forms/{formId}/records
Update record PUT /magicflu/service/s/jsonv2/{spaceId}/forms/{formId}/records/entry/{recordId}
Delete record DELETE /magicflu/service/s/jsonv2/{spaceId}/forms/{formId}/records/entry/{recordId}

Use the spaces endpoint when the user gives only a space name. The returned space id is items[].id; the display name is items[].label. Use the form-list endpoint when the user gives only a spaceId or form label. The returned form id is feed.entry[].id; the display name is feed.entry[].content.form.label; the English form key is feed.entry[].content.form.name.

Field rules:

  • API payload keys must be name, not label.
  • Omit empty values before submit.
  • Never submit "" for number fields.
  • Do not submit system, serial, secondary reference, image, attachment, location, webpage, comment, or external field-group fields.

Fetch Field Definitions

Account/password:

BASE_URL="http://appdev.com.magicflu.com:9999" \
MOFANG_USERNAME="你的账号" \
MOFANG_PASSWORD='你的密码' \
node scripts/fetch-form-spec.mjs \
  --spaceId \x3C空间UUID> \
  --formId \x3C表单UUID> \
  --out ./mock-data

If only names are known, resolve and fetch in one command:

BASE_URL="http://appdev.com.magicflu.com:9999" \
MOFANG_USERNAME="你的账号" \
MOFANG_PASSWORD='你的密码' \
node scripts/fetch-form-spec.mjs \
  --spaceLabel "空间名称" \
  --formLabel "表单名称" \
  --out ./mock-data

Cookie:

node scripts/fetch-form-spec.mjs \
  --baseUrl https://你的魔方域名 \
  --spaceId \x3C空间UUID> \
  --formId \x3C表单UUID> \
  --out ./mock-data \
  --cookie "浏览器 Cookie"

Offline import:

node scripts/fetch-form-spec.mjs \
  --spaceId \x3C空间UUID> \
  --formId \x3C表单UUID> \
  --out ./mock-data \
  --import-json ./fielddef-export.json

Output: mock-data/manifest.json, mock-data/\x3CformId>/fielddef.json, records.seed.json, typesnippets.md, and api-outline.md.

Local Debug

Use the bundled demo data:

cp -R assets/mock-data ./mock-data
node scripts/mock-jsonv2.mjs --port 3847 --dir ./mock-data

Set page config:

CONFIG.apiBase = 'http://127.0.0.1:3847';

Proxy to a real environment only when the user explicitly wants real data behavior:

BASE_URL="http://appdev.com.magicflu.com:9999" \
MOFANG_USERNAME="你的账号" \
MOFANG_PASSWORD='你的密码' \
node scripts/mock-jsonv2.mjs --mode proxy --port 3847

Proxy mode forwards supported space, json, and jsonv2 calls to the real environment. POST, PUT, and DELETE will change real records.

Publish Same-Origin Pages

Before publishing, set page CONFIG.apiBase to ''.

BASE_URL="http://appdev.com.magicflu.com:9999" \
MOFANG_USERNAME="你的账号" \
MOFANG_PASSWORD='你的密码' \
node scripts/deploy.mjs \
  --spaceId \x3C空间UUID> \
  --label "站点名称" \
  --shortcut custom-page \
  --files index.html

The deploy script logs in, creates a website, warms the session, uploads files through filemanager.jsp, and prints the final URL:

{BASE_URL}/magicflu/html/sites/userfiles/{spaceId}/{websiteId}/index.html

Read references/design.md, references/requirements.md, and references/filemanager.js only when debugging implementation details.

Examples

Stack File Purpose
Vanilla HTML+JS examples/vanilla/list-page.html Same-origin list page
Vanilla HTML+JS examples/vanilla/list-page-with-apibase.html List page wired to local mock
Vanilla HTML+JS examples/vanilla/form-page.html Create-record form
React examples/react/MagicfluList.tsx List component
Vue examples/vue/MagicfluForm.md Text-safe create-record form component

Validation

Run these from the skill root:

npm run check:scripts
npm run smoke:fetch-import
npm run smoke:mock
npm run smoke:upload
安全使用建议
Install only if you trust the publisher and understand the Magicflu account access involved. Use mock mode by default, prefer a test space/account, avoid running the proxy with production credentials near untrusted web pages, stop the proxy when finished, and review deploy commands before creating sites or uploading files.
功能分析
Type: OpenClaw Skill Name: mofang-page-builder Version: 1.1.0 The skill bundle is a specialized development tool for the Magicflu/Mofang (魔方网表) platform, designed to help AI agents generate and deploy custom web pages. It contains scripts for fetching form definitions (fetch-form-spec.mjs), a local mock server for testing (mock-jsonv2.mjs), and a deployment utility (deploy.mjs) that interacts with the platform's file manager. The code is transparent, uses standard Node.js APIs without external dependencies, and directs all network traffic to user-provided endpoints (BASE_URL). No indicators of data exfiltration, unauthorized persistence, or malicious prompt injection were found.
能力标签
requires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The page-building, field-definition fetching, local mock, CRUD-page generation, and publishing features fit the stated Magicflu/Mofang purpose, but they include real account data and site-publishing capabilities.
Instruction Scope
Proxy mode forwards authenticated Magicflu service requests, including mutating methods, and the provided artifacts do not show per-request approval, caller authentication, or a read-only default.
Install Mechanism
There is no install script or external package dependency shown; the included Node scripts are user-run tools and Node >=18 is documented in the package/SKILL metadata.
Credentials
Using a real Magicflu username/password, JWT, or browser cookie is purpose-aligned, but the local authenticated proxy is broader than needed unless tightly restricted to trusted local pages.
Persistence & Privilege
No autostart, self-propagation, hidden background persistence, or credential storage is shown; local servers and generated mock-data appear to be started or written only by explicit commands.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install mofang-page-builder
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /mofang-page-builder 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Initial release of mofang-page-builder. - Generate custom Magicflu/Mofang web-table pages using jsonv2 records API. - Supports CRUD page generation, H5 extensions, and code examples in React, Vue, and vanilla JS. - Provides clear workflow and API usage for form/field resolution, fielddef importing, and mock/proxy/local debugging. - Includes scripts for fetching field definitions, local data mocking, and same-origin site publishing. - Offers install and usage instructions for multiple platforms (Codex, OpenAI, Claude Code, Trae, Trae CN). - Bundles example code, assets, and references for fast setup and validation.
元数据
Slug mofang-page-builder
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

mofang-page-builder 是什么?

Build Magicflu/Mofang web-table custom pages from the jsonv2 records API. Use when users ask for Magicflu/Mofang forms, records, lists, create/edit/detail/ad... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 68 次。

如何安装 mofang-page-builder?

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

mofang-page-builder 是免费的吗?

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

mofang-page-builder 支持哪些平台?

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

谁开发了 mofang-page-builder?

由 Peng(@magicscape)开发并维护,当前版本 v1.1.0。

💬 留言讨论