---
description: src/forms/** — Use openxiangda-form skill
globs: src/forms/**/*
alwaysApply: false
---

# OpenXiangda Form Files

Editing files under `src/forms/<formCode>/`. Use the **`openxiangda-form`** skill.

Structure: `schema.ts`（`defineFormSchema()` default export — fields / options / rules / top-level FormEffect[]）+ `page.tsx`（presentation only）.

Pitfalls:
- 表单录入组件优先级：OpenXiangda 平台字段组件 → `antd` / `antd-mobile` wrapper → custom business component only when neither fits.
- `schema.ts` defines fields and platform components; `page.tsx` is presentation-only and should render the OpenXiangda standard form/runtime instead of assembling raw controls.
- `src/forms/**` must not contain raw native `<input>` / `<select>` / `<textarea>` / file input, hand-written pickers/uploaders, or hand-written user/department selectors.
- 选项字段（Select/MultiSelect/Radio/Checkbox/Cascade）必须有 `options`。
- 跨表数据 → `SelectField` + `optionSource.type: "linkedForm"`，禁止 `AssociationFormField`。
- 顶层 `schema.rules` 仅 `FormEffect[]`（when/then），校验放字段 `rules`。
- 平台系统字段（创建人/修改人/创建时间…）由平台维护，不要重复。
- 派生 / 隐式权限键 → `behavior: "HIDDEN"` + `valueSync`。
- Missing platform component capability → `openxiangda feedback submit --yes`, then use an `antd` / `antd-mobile` wrapper as temporary workaround and tell the user the fingerprint.

Publish: `openxiangda workspace publish --profile <name> --form <formCode>`（先 `--dry-run`）。
