openxiangda 1.0.78 → 1.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -66,11 +66,12 @@ openxiangda update install
66
66
 
67
67
  Domestic npm mirrors may lag and return an older OpenXiangda version. `openxiangda update check --json` is designed for AI agents: it returns the installed version, latest official npm version, whether an update is available, and the compatibility commands to run after updating. `openxiangda update install` installs from the official registry and refreshes OpenXiangda skills by default.
68
68
 
69
- Codex skills are installed separately from login/profile state. Run `openxiangda skill install` after installing or linking the CLI. It installs the `openxiangda` root skill plus the 7 top-level subskills into `${CODEX_HOME:-~/.codex}/skills` by default:
69
+ Codex skills are installed separately from login/profile state. Run `openxiangda skill install` after installing or linking the CLI. It installs the `openxiangda` root skill plus the 8 top-level subskills into `${CODEX_HOME:-~/.codex}/skills` by default:
70
70
 
71
71
  - `openxiangda`
72
72
  - `openxiangda-core`
73
73
  - `openxiangda-app`
74
+ - `openxiangda-architecture-design`
74
75
  - `openxiangda-form`
75
76
  - `openxiangda-page`
76
77
  - `openxiangda-workflow-automation`
package/lib/cli.js CHANGED
@@ -4506,7 +4506,16 @@ async function requestOptionalWithAuth(config, profileName, apiPath, options = {
4506
4506
  try {
4507
4507
  return await requestWithAuth(config, profileName, apiPath, options);
4508
4508
  } catch (error) {
4509
- if (Number(error?.apiCode) === 404 || String(error?.message || '').includes('HTTP 404')) {
4509
+ const status = Number(error?.status || error?.statusCode || error?.response?.status);
4510
+ const apiCode = Number(error?.apiCode);
4511
+ const message = String(error?.message || '');
4512
+ if (
4513
+ status === 404 ||
4514
+ apiCode === 404 ||
4515
+ message.includes('HTTP 404') ||
4516
+ message.includes('不存在') ||
4517
+ /not\s*found/i.test(message)
4518
+ ) {
4510
4519
  return null;
4511
4520
  }
4512
4521
  throw error;
package/lib/skills.js CHANGED
@@ -31,6 +31,13 @@ const SKILL_SPECS = [
31
31
  sourceRelativePath: 'openxiangda-skills/skills/openxiangda-app',
32
32
  type: 'subskill',
33
33
  },
34
+ {
35
+ name: 'openxiangda-architecture-design',
36
+ displayName: 'OpenXiangda Architecture Design',
37
+ shortDescription: '新应用和复杂需求的架构设计、详细设计和开发任务门禁。',
38
+ sourceRelativePath: 'openxiangda-skills/skills/openxiangda-architecture-design',
39
+ type: 'subskill',
40
+ },
34
41
  {
35
42
  name: 'openxiangda-form',
36
43
  displayName: 'OpenXiangda Form',
@@ -20,6 +20,7 @@ OpenXiangda supports two workspace modes. Classic `sy-lowcode-app-workspace` pub
20
20
  | 发布 classic workspace / 上线旧模式 | `openxiangda-core` | `openxiangda workspace publish --profile <name> --changed --dry-run` |
21
21
  | 发布 React SPA / Phase 6 runtime | `openxiangda-core` | `openxiangda resource publish --profile <name>` then `openxiangda runtime deploy --profile <name>` |
22
22
  | 只发布改动 / 增量 / 单页 / 单表 | `openxiangda-core` | `... --changed` / `--page <code>` / `--form <code>` / `--only pages/a,forms/b` |
23
+ | 架构设计 / 详细设计 / 新应用需求 / 需求文档转享搭应用 | `openxiangda-architecture-design` | read `references/architecture-design.md`; inspect workspace/app state before coding |
23
24
  | 创建应用 / 新建 app / scaffold / 初始化工作区 | `openxiangda-app` | `openxiangda workspace init <dir> --profile <name> --app-name "..."` |
24
25
  | 绑定已有应用 / bind existing app | `openxiangda-app` | `openxiangda workspace bind --profile <name> --app-type APP_XXX` |
25
26
  | 创建 / 修改表单字段 / 表单页 / schema | `openxiangda-form` | edit `src/forms/<code>/{schema.ts,page.tsx}` → `workspace publish --form <code>` |
@@ -39,7 +40,10 @@ OpenXiangda supports two workspace modes. Classic `sy-lowcode-app-workspace` pub
39
40
  - ✅ User token lives in `~/.openxiangda/profiles.json`; project state in `.openxiangda/state.json` (IDs only).
40
41
  - ✅ Each profile (dev / prod / ...) has its own `appType` and resource IDs; never copy a `formUuid` / `pageId` / `workflowId` / `automationId` across profiles.
41
42
  - ✅ Run `openxiangda update check --json` at the start of substantial work; if `updateAvailable`, run `openxiangda update install` and `openxiangda skill install --force`.
43
+ - ✅ For non-trivial app requirements, run the architecture design gate first: forms, fields, pages, permissions, data views, status/workflow, automation, notifications, and development tasks must be decided before coding.
42
44
  - ✅ For form-entry UX, pick components in this order: OpenXiangda platform form components → `antd` / `antd-mobile` wrappers → custom component only when neither exists.
45
+ - ✅ List pages, linked options, remote selectors, and report drill-downs must use paginated server-side queries with explicit searchable fields. Do not fetch a large page and filter in local state.
46
+ - ✅ Treat workflow forms as an exception. Ordinary ticket/order/task/asset lifecycles use status fields, state machines, action logs, permissions, and automations; workflows are for real approval tasks.
43
47
  - ✅ Proactively submit platform feedback when you discover a defect, missing capability, unclear rule, repeated workaround, user-visible UX gap, or implementation uncertainty worth improving.
44
48
 
45
49
  ### Hard rules — never
@@ -149,6 +153,7 @@ When the user provides a root domain such as `https://yida.wisejob.cn/`, use it
149
153
 
150
154
  - `skills/openxiangda-core/SKILL.md`: command workflow and API contract details.
151
155
  - `skills/openxiangda-app/SKILL.md`: app creation, binding, snapshots, and profile-isolated workspace state.
156
+ - `skills/openxiangda-architecture-design/SKILL.md`: OpenXiangda-specific architecture design, detailed design, critical review, and development task planning before implementation.
152
157
  - `skills/openxiangda-form/SKILL.md`: workspace-based form and workflow form page development, bundle registration, and form publishing.
153
158
  - `skills/openxiangda-page/SKILL.md`: custom code page development and publishing in `sy-lowcode-app-workspace`.
154
159
  - `skills/openxiangda-workflow-automation/SKILL.md`: workflow v3 definitions, automation triggers, publishing, enabling, and profile-isolated IDs.
@@ -170,6 +175,7 @@ Load these references on demand instead of memorizing them. Subskills cite the s
170
175
  Core CLI / state:
171
176
 
172
177
  - `references/openxiangda-api.md` — `/openxiangda-api/v1` request and response fields.
178
+ - `references/architecture-design.md` — OpenXiangda architecture design gate, anti-pattern rejection, question gates, final design template, and black-box demo scenario.
173
179
  - `references/workspace-state.md` — `.openxiangda/state.json` shape and profile isolation rules.
174
180
  - `references/connector-resources.md` — `src/resources` manifests, connector schema, App Function boundary, and platform runtime calls.
175
181
  - `references/resource-manifest-cheatsheet.md` — 复制即用的 connector / data-view / notification / App Function / workflow / automation / JS_CODE / role / permission group / settings / menu manifest 骨架与运行时调用示例。在创建任何 `src/resources/` 资源前先看这份。
@@ -0,0 +1,312 @@
1
+ # OpenXiangda Architecture Design Reference
2
+
3
+ Use this reference to turn product material into an OpenXiangda-specific architecture document and task plan.
4
+
5
+ ## Table Of Contents
6
+
7
+ - [Purpose](#purpose)
8
+ - [Critical Review Stance](#critical-review-stance)
9
+ - [Architecture Gate Workflow](#architecture-gate-workflow)
10
+ - [Anti-Patterns To Reject](#anti-patterns-to-reject)
11
+ - [Question Gates](#question-gates)
12
+ - [Resource Design Checklist](#resource-design-checklist)
13
+ - [Final Document Template](#final-document-template)
14
+ - [Black-Box Demo Scenario](#black-box-demo-scenario)
15
+
16
+ ## Purpose
17
+
18
+ This design flow is for applications built on OpenXiangda. The output is not a generic PRD. It must tell the implementer exactly which platform resources to create and why:
19
+
20
+ - forms and fields
21
+ - custom pages and menus
22
+ - data views
23
+ - roles, page permission groups, form permission groups, data scopes, and field access
24
+ - status machines or workflows
25
+ - automations, JS_CODE V2 nodes, and App Functions
26
+ - notifications and connectors
27
+ - publish and acceptance steps
28
+
29
+ The design is complete only when another agent can implement it without deciding major architecture tradeoffs.
30
+
31
+ ## Critical Review Stance
32
+
33
+ Act as the technical architect. Product requirements are inputs, not orders.
34
+
35
+ Be direct when a requirement is technically wrong:
36
+
37
+ - "这个设计不能按你说的实现。把 1000 条数据拉到前端再筛选,会在真实数据量下变慢,也会绕开后端权限边界。这里必须做分页查询和服务端过滤。"
38
+ - "这不是审批流,是业务状态流转。硬做成流程表单会让页面、权限、数据修复和后续扩展都变复杂。应该用普通表单 + 状态机。"
39
+ - "前端隐藏按钮不是权限控制。敏感数据必须落到表单权限组、数据范围和字段权限。"
40
+
41
+ Do not insult the person. Criticize the proposal and explain the technical consequence.
42
+
43
+ ## Architecture Gate Workflow
44
+
45
+ 1. **Read the input**: user prompt, uploaded requirements, current workspace files, app snapshots, and existing resources.
46
+ 2. **Classify the app**: admin CRUD, portal, workbench, dashboard, workflow approval, status lifecycle, automation-heavy app, integration-heavy app, or mixed.
47
+ 3. **Draft the resource map**:
48
+ - forms as data tables
49
+ - pages/routes/menus
50
+ - permissions
51
+ - data views
52
+ - workflow/status/automation/function boundaries
53
+ - notifications/connectors
54
+ 4. **Ask missing high-impact questions**. Ask in small rounds; do not dump every possible question at once.
55
+ 5. **Reject bad assumptions** and replace them with OpenXiangda-native patterns.
56
+ 6. **Confirm UI design needs**. For portals, dashboards, mobile pages, and workbenches, ask whether to run Product Design / visual ideation before implementation.
57
+ 7. **Write the design artifact**. Default path when a workspace exists:
58
+ `docs/architecture/<app-slug>-openxiangda-design.md`.
59
+ 8. **Create a development task table** that can be executed by OpenXiangda subskills.
60
+
61
+ ## Anti-Patterns To Reject
62
+
63
+ | Anti-pattern | Why it is wrong | Required replacement |
64
+ |---|---|---|
65
+ | Fetch 1000 rows then filter in React state | Breaks at real data volume, wastes network, and may bypass data permission thinking | Paginated query with `currentPage`, `pageSize`, sort, and structured server filters |
66
+ | Dropdown options load all records | Large forms become slow and stale | `linkedForm` `SelectField` with `remoteSearch`, explicit `searchFieldId`, and page size |
67
+ | Broad `searchKeyWord` for every search | Expensive and imprecise | Explicit searchable fields and `filterGroup` OR conditions |
68
+ | Workflow form for normal ticket lifecycle | Adds approval constraints and operational overhead without approval semantics | Normal form + status field + state machine + action log + automations |
69
+ | Frontend-only data isolation | Hides UI but does not enforce data access | Page permission groups, form permission groups, data scopes, and field access |
70
+ | One large page owns all business logic | Hard to test and change | `domain/`, `shared/services/`, hooks, reusable components |
71
+ | Repeated multi-form joins in page code | Duplicated, slow, inconsistent | Data View for read-only reusable row/aggregate queries |
72
+ | Materialized view for hard realtime data | Users see stale data | `storageMode: "live"` only for bounded realtime joins, or direct source queries/App Function |
73
+ | Live view for unbounded heavy joins | Slow runtime queries | Materialized view with scheduled refresh and indexes |
74
+ | JS_CODE for reusable business service | Logic gets duplicated in graph nodes | App Function for shared backend logic; JS_CODE only for node-local trigger logic |
75
+ | Raw native form controls | Inconsistent with platform runtime and validation | OpenXiangda platform components first, Ant Design wrappers second |
76
+
77
+ ## Question Gates
78
+
79
+ Ask only what materially changes the design.
80
+
81
+ ### Scope And Actors
82
+
83
+ - Who are the user roles?
84
+ - Which roles create, process, approve, view, export, or administer data?
85
+ - Is this PC-only, mobile-only, or both?
86
+ - Is the app greenfield or modifying an existing app?
87
+
88
+ ### Forms And Data
89
+
90
+ - What are the core business objects?
91
+ - Which objects need independent lifecycle, permissions, or reporting?
92
+ - Which fields are visible to users, hidden scope keys, computed fields, or system-derived fields?
93
+ - Which fields will be searched, sorted, grouped, or used for permissions?
94
+ - What data volume is expected now and after growth?
95
+
96
+ ### Pagination And Search
97
+
98
+ - Which list pages need filters?
99
+ - Which fields support exact filtering versus fuzzy search?
100
+ - Which selectors need remote search?
101
+ - What default page size is acceptable?
102
+ - Which sorts are business-critical?
103
+
104
+ Default if the user does not know: design conservative pagination with explicit filters, do not fetch all rows.
105
+
106
+ ### Permissions
107
+
108
+ - Is data sensitive?
109
+ - Is frontend-only filtering acceptable, or must backend data isolation be enforced?
110
+ - Does each role see all records, own records, department records, assigned records, or a custom scope?
111
+ - Are any fields sensitive enough for backend field access policy?
112
+ - Are page permission groups enough for visibility, or do forms also need permission groups?
113
+
114
+ Default: if the app contains personal data, costs, approval records, or cross-department data, backend-enforced permissions are required.
115
+
116
+ ### Status Machine Or Workflow
117
+
118
+ - Is there an actual approver task with agree/reject opinion and approval history?
119
+ - Does each node require field permissions?
120
+ - Is audit history tied to approval tasks, or is a business action log enough?
121
+ - Can the process be represented as a normal status transition?
122
+
123
+ Default: ordinary service, ticket, order, asset, and task lifecycles are status machines, not workflow forms.
124
+
125
+ ### Data Views And Reports
126
+
127
+ - Is the query single-form CRUD or repeated multi-form read-only logic?
128
+ - Is the output row-level or aggregate?
129
+ - Must users see source changes immediately?
130
+ - What staleness is acceptable: realtime, 10-30 minutes, hourly, daily, manual?
131
+ - Which fields are filters, dimensions, measures, drill-down keys, and permission scope aliases?
132
+ - What rows can be excluded early by definition `where`?
133
+
134
+ Default: management dashboards usually use materialized views with scheduled refresh. Operational bounded drill-downs can use live views.
135
+
136
+ ### Automation, JS_CODE, App Function
137
+
138
+ - What should happen after form submit/update/delete or field change?
139
+ - Are there scheduled scans or deadline reminders?
140
+ - Does logic need to be reused by pages and multiple backend flows?
141
+ - Does it need external HTTP or platform API calls?
142
+ - Which logs are needed for diagnosis?
143
+
144
+ Default: reusable calculations and validations become App Functions; one-off backend trigger orchestration becomes JS_CODE V2 in automation/workflow.
145
+
146
+ ### Notifications And Connectors
147
+
148
+ - Which channels are required: in-app, email, DingTalk, WeChat, third-party todo?
149
+ - Who receives each notification and why?
150
+ - Which payload fields are needed?
151
+ - Are templates reusable resources?
152
+ - Are external credentials needed? If yes, use connectors/resources, never page source secrets.
153
+
154
+ ### UI Design
155
+
156
+ Ask whether to use Product Design or another design skill for:
157
+
158
+ - dashboard
159
+ - portal
160
+ - mobile entry
161
+ - workbench
162
+ - dense operation console
163
+ - executive report page
164
+ - visually important landing/first screen
165
+
166
+ For simple CRUD/admin lists, design can proceed with the appropriate OpenXiangda template unless the user asks for visual exploration.
167
+
168
+ ## Resource Design Checklist
169
+
170
+ ### Forms
171
+
172
+ - Use deterministic `formCode`.
173
+ - Define visible fields, hidden scope keys, and derived values.
174
+ - Use platform field components.
175
+ - Use `SelectField` / `RadioField` for enums.
176
+ - Use `linkedForm` select with remote search for large source forms.
177
+ - Avoid extra system metadata fields unless they represent a separate business concept.
178
+
179
+ ### Pages
180
+
181
+ - Choose React SPA or classic workspace based on the app mode.
182
+ - Use `DataManagementList` for standard management lists.
183
+ - Split PC/mobile when workflows differ, but reuse `domain/` and `shared/services/`.
184
+ - Keep page components thin.
185
+
186
+ ### Permissions
187
+
188
+ - App roles use stable local codes.
189
+ - Page permission groups control entry/menu visibility.
190
+ - Form permission groups enforce data access.
191
+ - Field permissions hide sensitive fields where backend support exists.
192
+ - Frontend-only button hiding is UX, not security.
193
+
194
+ ### Data Views
195
+
196
+ - Use row view for joined lists and drill-downs.
197
+ - Use aggregate view for fixed metrics.
198
+ - Choose `materialized` for read-heavy reports with staleness tolerance.
199
+ - Choose `live` only for bounded realtime joins.
200
+ - Index materialized output aliases used for filters, sort, and dimensions.
201
+ - Show `lastRefreshedAt` when users care about freshness.
202
+
203
+ ### Status, Workflow, Automation
204
+
205
+ - Model normal lifecycles as status fields and state machines.
206
+ - Use workflow for real approval tasks only.
207
+ - Use automation for backend triggers and schedules.
208
+ - Use JS_CODE V2 trusted_node for node-local backend logic.
209
+ - Use App Function for reusable backend services.
210
+
211
+ ## Final Document Template
212
+
213
+ ```markdown
214
+ # <App Name> OpenXiangda Architecture Design
215
+
216
+ ## 1. Design Decision Summary
217
+
218
+ - App type:
219
+ - Runtime/publish mode:
220
+ - Key platform resources:
221
+ - Main tradeoffs:
222
+ - Rejected unsafe assumptions:
223
+
224
+ ## 2. Actors And Permissions
225
+
226
+ | Role | Users | Page visibility | Data scope | Field restrictions | Notes |
227
+ |---|---|---|---|---|---|
228
+
229
+ ## 3. Forms And Fields
230
+
231
+ | Form code | Purpose | Key fields | Hidden/scope fields | Search/sort fields | Permission notes |
232
+ |---|---|---|---|---|---|
233
+
234
+ ## 4. Pages, Menus, And UX
235
+
236
+ | Page/route | Audience | Pattern/template | Main actions | Data source | Design mockup needed |
237
+ |---|---|---|---|---|---|
238
+
239
+ ## 5. Query, Pagination, And Search
240
+
241
+ - List pages:
242
+ - Remote selectors:
243
+ - Server-side filters:
244
+ - Default page sizes:
245
+ - Index/search-field plan:
246
+
247
+ ## 6. Data Views And Reports
248
+
249
+ | Data view | Type | Mode | Freshness | Filters/indexes | Permission scope | Runtime call |
250
+ |---|---|---|---|---|---|---|
251
+
252
+ ## 7. Status, Workflow, Automation, And Functions
253
+
254
+ - Status machines:
255
+ - Workflow forms:
256
+ - Automations:
257
+ - JS_CODE V2 nodes:
258
+ - App Functions:
259
+
260
+ ## 8. Notifications And Connectors
261
+
262
+ | Scenario | Trigger | Channel | Recipients | Template/resource | Notes |
263
+ |---|---|---|---|---|---|
264
+
265
+ ## 9. Development Task Table
266
+
267
+ | Phase | Task | Resources/files | Validation | Publish step |
268
+ |---|---|---|---|---|
269
+
270
+ ## 10. Acceptance Criteria
271
+
272
+ - Functional checks:
273
+ - Permission checks:
274
+ - Performance/query checks:
275
+ - Report freshness checks:
276
+ - Notification/automation checks:
277
+
278
+ ## 11. Open Questions And Confirmed Assumptions
279
+
280
+ - Confirmed:
281
+ - Still open:
282
+ ```
283
+
284
+ ## Black-Box Demo Scenario
285
+
286
+ Use this scenario to validate this skill after release. Run it in a fresh Codex session that only has the installed OpenXiangda skills.
287
+
288
+ Product-manager style prompt:
289
+
290
+ ```text
291
+ 我要做一个校园综合服务工单与物资审批平台。所有工单列表先拉 1000 条前端筛选就行,普通工单从提交到完成也都走审批流。需要 PC 管理后台、移动端报修、SLA 看板、库存预警、通知和一些自动化。
292
+ ```
293
+
294
+ Expected behavior:
295
+
296
+ - The agent rejects fetching 1000 rows and proposes paginated server queries.
297
+ - The agent rejects workflow for ordinary ticket status changes and keeps workflow only for high-value spare-part approval.
298
+ - The agent asks about permission strictness, sensitive cost fields, data scope, report freshness, design mockups, searchable fields, and pagination.
299
+ - The final design covers normal forms, one workflow form, pages, Data Views, permissions, automations, JS_CODE V2, App Functions, notifications, and task plan.
300
+
301
+ Coverage target:
302
+
303
+ - Forms: service ticket, service category, asset equipment, spare-part inventory, satisfaction evaluation, role settings.
304
+ - Status machine: submitted, accepted, assigned, processing, pending acceptance, completed, closed.
305
+ - Workflow: high-value spare-part approval only.
306
+ - Pages: PC admin, mobile report entry, ticket workbench, SLA/inventory/satisfaction dashboard.
307
+ - Data Views: live ticket joined detail, materialized SLA aggregate, inventory alert statistics.
308
+ - Permissions: reporter self, repairer assigned, supervisor department, admin all, sensitive cost field restrictions.
309
+ - Automations: new ticket notification, timeout escalation, completion evaluation reminder, low-stock warning.
310
+ - JS_CODE V2: SLA classification, dynamic recipients, message payload assembly.
311
+ - App Functions: dispatch rule, inventory deduction validation, SLA calculation.
312
+ - Notifications: in-app, DingTalk/third-party todo as required.
@@ -186,13 +186,17 @@ JS_CODE 调用:`ctx.notification.sendByType({ ... })`。允许的 channels:`
186
186
  {
187
187
  "code": "reservation_reminder_summary",
188
188
  "name": "Reservation Reminder Summary",
189
- "sourceFile": { "localPath": "src/functions/reservation_reminder_summary/index.ts" },
190
- "runtimeMode": "trusted_node",
191
- "timeout": 30000,
192
189
  "resources": {
193
190
  "forms": ["reservation_order"],
194
191
  "dataViews": ["reservation_order_overview"],
195
192
  "connectors": ["crm"]
193
+ },
194
+ "definitionJson": {
195
+ "runtimeMode": "trusted_node",
196
+ "timeout": 30000,
197
+ "sourceFile": {
198
+ "localPath": "src/functions/reservation_reminder_summary/index.ts"
199
+ }
196
200
  }
197
201
  }
198
202
  ```
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: openxiangda-architecture-design
3
+ description: Design OpenXiangda / 享搭 / 私有化低代码 applications before implementation. Use when the user asks for 架构设计 / 详细设计 / 开发方案 / 技术方案 / 应用设计 / 新应用 / 空应用 / 需求文档转享搭应用 / PRD 转开发计划 / form-page-workflow-permission-data-view planning, or when a non-trivial OpenXiangda app should be planned before coding. Produces an OpenXiangda-specific architecture document, detailed design, and task plan; repeatedly asks design-gate questions; challenges bad product assumptions such as fetching 1000 rows then local filtering, workflow forms for ordinary status changes, frontend-only permissions, or unbounded dashboard queries.
4
+ ---
5
+
6
+ # OpenXiangda Architecture Design
7
+
8
+ Use this skill before building a non-trivial OpenXiangda app or turning product requirements into implementation tasks.
9
+
10
+ This is an architecture gate, not a generic PRD writer. Convert the user's material into OpenXiangda resources: forms, fields, pages, menus, permissions, data views, workflows, automations, JS_CODE nodes, App Functions, notifications, connectors, and publish/test tasks.
11
+
12
+ ## Required Reference
13
+
14
+ Before producing a final architecture document, read:
15
+
16
+ - `references/architecture-design.md`
17
+
18
+ Read these supporting references when the design touches the topic:
19
+
20
+ - `references/best-practices.md`
21
+ - `references/architecture-patterns.md`
22
+ - `references/data-views.md`
23
+ - `references/permissions-settings.md`
24
+ - `references/workflow-v3.md`
25
+ - `references/automation-v3.md`
26
+ - `references/notifications.md`
27
+ - `references/pages/page-sdk.md`
28
+ - `references/forms/form-schema.md`
29
+
30
+ ## Operating Mode
31
+
32
+ Be the technical architect. Do not passively accept product requirements when they conflict with platform constraints, performance, permissions, or maintainability.
33
+
34
+ Keep the tone direct and critical about the design, but do not insult the person. Acceptable: "这个方案不能这样做,会把查询压力和权限风险推到前端。" Not acceptable: personal attacks.
35
+
36
+ ## Non-Negotiable Rules
37
+
38
+ - Do not design list pages, option searches, linked-form choices, or report drill-downs that fetch 1000 rows and filter in local state. Use paginated queries, explicit filters, sort, and server-side search fields.
39
+ - Do not default to `searchKeyWord` for broad fuzzy search. Prefer explicit searchable fields and structured `filterGroup` conditions.
40
+ - Do not use workflow forms for ordinary business lifecycles. Use normal forms, status fields, state machines, responsibility fields, action logs, permissions, and automations. Use workflow only for real approval semantics.
41
+ - Do not put sensitive authorization in page conditions only. Use page permission groups, form permission groups, backend data scope, and field access policy when data is sensitive.
42
+ - Do not put repeated multi-form joins or fixed dashboard metrics into page-side loops. Use Data View when the query is reusable and read-only; choose `live` or `materialized` deliberately.
43
+ - Do not scatter reusable backend logic in pages or JS_CODE nodes. Use App Functions for logic shared by pages, automations, and workflows. Use JS_CODE V2 for node-local backend trigger logic.
44
+ - Do not design raw native form controls for AI-authored workspace code. Use OpenXiangda platform form components first, then Ant Design / antd-mobile wrappers.
45
+
46
+ ## Workflow
47
+
48
+ 1. Ground in the current state:
49
+ - If a workspace exists, inspect `.openxiangda/state.json`, `app-workspace.config.ts`, and relevant `src/` resources before designing.
50
+ - If this is an existing app, use snapshots/read-only inspection before proposing changes.
51
+ - If this is a blank app, explicitly state that the design is greenfield.
52
+ 2. Extract the domain:
53
+ - Actors and roles.
54
+ - Business objects that should become forms.
55
+ - Status lifecycles versus true approval workflows.
56
+ - Pages, menus, PC/mobile entrances, and reporting surfaces.
57
+ - Backend logic, notifications, integrations, and scheduled work.
58
+ 3. Build an OpenXiangda resource map:
59
+ - Forms and fields.
60
+ - Pages and routes.
61
+ - Roles, permission groups, data scopes, and field permissions.
62
+ - Data Views with mode, query shape, freshness, indexes, and permissions.
63
+ - Workflows, automations, JS_CODE nodes, App Functions, notifications, connectors, and settings.
64
+ 4. Ask design-gate questions in rounds. Do not produce the final design while high-impact unknowns remain.
65
+ 5. Challenge bad assumptions. Give the cost, reject the unsafe implementation path, and propose the OpenXiangda-native alternative.
66
+ 6. For frontend-heavy pages, ask whether a visual/interaction design pass is needed. If Product Design or another UI design skill is available, route design work there before page implementation.
67
+ 7. Write the final artifact by default when a workspace exists:
68
+ - `docs/architecture/<app-slug>-openxiangda-design.md`
69
+ If there is no workspace or safe target path, output the document in the conversation and ask for the destination before writing files.
70
+
71
+ ## Design Gates To Resolve
72
+
73
+ Resolve these before finalizing:
74
+
75
+ - Data volume, pagination, searchable fields, sort fields, and expected indexes.
76
+ - Role model, data sensitivity, backend-enforced data scope, and field visibility.
77
+ - Which flows are status machines and which are real approvals.
78
+ - Report freshness: real-time live view, materialized refresh cadence, or manual snapshot.
79
+ - Whether dashboards and joins are bounded enough for Data View.
80
+ - Which logic belongs in page services, App Function, automation, workflow, or JS_CODE V2.
81
+ - Notification channels, recipients, trigger timing, and template payloads.
82
+ - PC/mobile split and whether Product Design / visual mockups are required.
83
+ - Publish profile, acceptance criteria, and demo/test path.
84
+
85
+ ## Final Output
86
+
87
+ The final design must be decision-complete. Include:
88
+
89
+ - Architecture overview and OpenXiangda resource map.
90
+ - Form and field design with storage shape, hidden scope keys, searchable fields, and pagination strategy.
91
+ - Permission design with page groups, form groups, data scope, and field access policy.
92
+ - Page/menu/UX design, including PC/mobile and design mockup decisions.
93
+ - Data access and Data View plan with `live` / `materialized`, refresh, indexes, and runtime SDK calls.
94
+ - Status machine, workflow, automation, JS_CODE V2, and App Function plan.
95
+ - Notification and connector plan.
96
+ - Development task table with order, files/resources, validation, and publish steps.
97
+ - Open questions and confirmed assumptions.
98
+
99
+ After the design is accepted, hand off execution to the relevant OpenXiangda subskills. Do not skip the design gate for complex applications.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {