@tongfun/ui 0.0.1-alpha.3 → 0.0.1-alpha.4
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/dist/agent-schema/index.d.ts +12 -0
- package/dist/agent-schema/index.js +33 -0
- package/dist/agent-schema/types.d.ts +27 -0
- package/dist/formula/index.d.ts +17 -0
- package/dist/formula/types.d.ts +136 -0
- package/dist/index.d.ts +55 -4
- package/dist/index.js +142216 -125508
- package/dist/lowcode-agent/index.js +9409 -3792
- package/dist/lowcode-agent/types.d.ts +312 -312
- package/dist/skill/golden-examples/dashboard-workbench.md +224 -0
- package/dist/skill/golden-examples/form-create.md +227 -0
- package/dist/skill/golden-examples/management-list.md +264 -0
- package/dist/skill/golden-examples/new-document.md +748 -0
- package/dist/skill/tongfun-ui-skill.json +470 -0
- package/dist/skill/tongfun-ui-skill.md +297 -0
- package/dist/style.css +1 -1
- package/package.json +99 -91
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tongfun-ui-skill",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AI Agent skill for generating Vue 3 enterprise admin pages with @tongfun/ui.",
|
|
5
|
+
"techStack": [
|
|
6
|
+
"Vue 3",
|
|
7
|
+
"<script setup lang=\"ts\">",
|
|
8
|
+
"TypeScript",
|
|
9
|
+
"Tailwind CSS for layout, spacing and small utility classes only",
|
|
10
|
+
"lucide-vue-next for icons",
|
|
11
|
+
"reka-ui only as an accessibility fallback when @tongfun/ui lacks a complex interaction"
|
|
12
|
+
],
|
|
13
|
+
"componentPriority": [
|
|
14
|
+
{
|
|
15
|
+
"priority": 1,
|
|
16
|
+
"rule": "Use @tongfun/ui base and business components first."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"priority": 2,
|
|
20
|
+
"rule": "When @tongfun/ui lacks a capability, compose with native HTML/Vue and @tongfun/ui design tokens."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"priority": 3,
|
|
24
|
+
"rule": "Use reka-ui only for complex accessible interactions not covered by @tongfun/ui."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"priority": 4,
|
|
28
|
+
"rule": "Do not recreate Button, Input, Select, Dialog, Drawer, Table, Form or Pagination."
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"styleContract": {
|
|
32
|
+
"tone": [
|
|
33
|
+
"enterprise-admin",
|
|
34
|
+
"restrained",
|
|
35
|
+
"professional",
|
|
36
|
+
"high-density",
|
|
37
|
+
"task-focused"
|
|
38
|
+
],
|
|
39
|
+
"requiredTokens": [
|
|
40
|
+
"--tf-color-*",
|
|
41
|
+
"--tf-border-radius-*",
|
|
42
|
+
"--tf-font-size-*",
|
|
43
|
+
"--tf-spacing-*",
|
|
44
|
+
"--tf-border-*"
|
|
45
|
+
],
|
|
46
|
+
"forbidden": [
|
|
47
|
+
"hard-coded brand colors",
|
|
48
|
+
"hard-coded status colors",
|
|
49
|
+
"large gradients",
|
|
50
|
+
"decorative backgrounds",
|
|
51
|
+
"exaggerated shadows",
|
|
52
|
+
"oversized border radii",
|
|
53
|
+
"marketing-style hero sections"
|
|
54
|
+
],
|
|
55
|
+
"tailwindUsage": [
|
|
56
|
+
"layout",
|
|
57
|
+
"spacing",
|
|
58
|
+
"grid",
|
|
59
|
+
"flex",
|
|
60
|
+
"responsive utilities",
|
|
61
|
+
"small helper classes"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"pagePatterns": [
|
|
65
|
+
{
|
|
66
|
+
"id": "management-list",
|
|
67
|
+
"title": "管理列表页",
|
|
68
|
+
"structure": [
|
|
69
|
+
"TfPageHeader",
|
|
70
|
+
"TfCard",
|
|
71
|
+
"TfForm + TfFormLayout filters",
|
|
72
|
+
"TfToolbar",
|
|
73
|
+
"TfTable",
|
|
74
|
+
"TfPagination"
|
|
75
|
+
],
|
|
76
|
+
"recommendedComponents": [
|
|
77
|
+
"TfPageHeader",
|
|
78
|
+
"TfCard",
|
|
79
|
+
"TfForm",
|
|
80
|
+
"TfFormLayout",
|
|
81
|
+
"TfFormInput",
|
|
82
|
+
"TfFormSelect",
|
|
83
|
+
"TfButton",
|
|
84
|
+
"TfToolbar",
|
|
85
|
+
"TfTable",
|
|
86
|
+
"TfPagination",
|
|
87
|
+
"TfEmpty",
|
|
88
|
+
"TfSkeleton",
|
|
89
|
+
"TfAlert"
|
|
90
|
+
],
|
|
91
|
+
"requiredStates": [
|
|
92
|
+
"loading",
|
|
93
|
+
"empty",
|
|
94
|
+
"error",
|
|
95
|
+
"disabled",
|
|
96
|
+
"permission",
|
|
97
|
+
"pagination",
|
|
98
|
+
"filter-reset"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": "filter-table",
|
|
103
|
+
"title": "查询筛选 + 表格页",
|
|
104
|
+
"structure": [
|
|
105
|
+
"filter form above table",
|
|
106
|
+
"query/reset actions at the end of filters",
|
|
107
|
+
"table toolbar above table",
|
|
108
|
+
"pagination below table"
|
|
109
|
+
],
|
|
110
|
+
"recommendedComponents": [
|
|
111
|
+
"TfForm",
|
|
112
|
+
"TfFormLayout",
|
|
113
|
+
"TfFormInput",
|
|
114
|
+
"TfFormSelect",
|
|
115
|
+
"TfDatePicker",
|
|
116
|
+
"TfToolbar",
|
|
117
|
+
"TfTable",
|
|
118
|
+
"TfPagination"
|
|
119
|
+
],
|
|
120
|
+
"requiredStates": [
|
|
121
|
+
"loading",
|
|
122
|
+
"empty",
|
|
123
|
+
"error",
|
|
124
|
+
"filtering",
|
|
125
|
+
"resetting",
|
|
126
|
+
"pagination"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "new-document",
|
|
131
|
+
"title": "新建单据页面",
|
|
132
|
+
"intent": {
|
|
133
|
+
"keywords": [
|
|
134
|
+
"单据",
|
|
135
|
+
"新建单据",
|
|
136
|
+
"新增单据",
|
|
137
|
+
"创建单据",
|
|
138
|
+
"合同",
|
|
139
|
+
"采购合同",
|
|
140
|
+
"销售合同",
|
|
141
|
+
"采购单",
|
|
142
|
+
"销售单",
|
|
143
|
+
"付款申请",
|
|
144
|
+
"报销",
|
|
145
|
+
"document",
|
|
146
|
+
"bill",
|
|
147
|
+
"contract"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"structure": [
|
|
151
|
+
"TfPageHeader document title and actions",
|
|
152
|
+
"TfSidebarLayout left navigation plus right content",
|
|
153
|
+
"left progress card with totalProgress and requiredProgress",
|
|
154
|
+
"TfSideNav generated from sections",
|
|
155
|
+
"right multi-section TfCard form areas",
|
|
156
|
+
"each section card has a stable id matching sideNavItems[].id",
|
|
157
|
+
"TfForm wraps the document form model",
|
|
158
|
+
"TfFormLayout controls compact field layout inside each card"
|
|
159
|
+
],
|
|
160
|
+
"recommendedComponents": [
|
|
161
|
+
"TfPageHeader",
|
|
162
|
+
"TfSidebarLayout",
|
|
163
|
+
"TfSideNav",
|
|
164
|
+
"TfProgress",
|
|
165
|
+
"TfStack",
|
|
166
|
+
"TfCard",
|
|
167
|
+
"TfForm",
|
|
168
|
+
"TfFormLayout",
|
|
169
|
+
"TfFormInput",
|
|
170
|
+
"TfFormSelect",
|
|
171
|
+
"TfFormDatePicker",
|
|
172
|
+
"TfFormTextarea",
|
|
173
|
+
"TfButton",
|
|
174
|
+
"TfAlert",
|
|
175
|
+
"TfTag"
|
|
176
|
+
],
|
|
177
|
+
"requiredStates": [
|
|
178
|
+
"activeSection",
|
|
179
|
+
"section-progress",
|
|
180
|
+
"required-field-progress",
|
|
181
|
+
"saving",
|
|
182
|
+
"notice",
|
|
183
|
+
"validation-error",
|
|
184
|
+
"validation-failure-highlight",
|
|
185
|
+
"disabled"
|
|
186
|
+
],
|
|
187
|
+
"goldenExample": "docs/golden-examples/new-document.md",
|
|
188
|
+
"generationContract": {
|
|
189
|
+
"requiredComponents": [
|
|
190
|
+
"TfPageHeader",
|
|
191
|
+
"TfSidebarLayout",
|
|
192
|
+
"TfSideNav",
|
|
193
|
+
"TfProgress",
|
|
194
|
+
"TfStack",
|
|
195
|
+
"TfCard",
|
|
196
|
+
"TfForm",
|
|
197
|
+
"TfFormLayout"
|
|
198
|
+
],
|
|
199
|
+
"recommendedComponents": [
|
|
200
|
+
"TfFormInput",
|
|
201
|
+
"TfFormSelect",
|
|
202
|
+
"TfFormDatePicker",
|
|
203
|
+
"TfFormTextarea",
|
|
204
|
+
"TfButton",
|
|
205
|
+
"TfAlert",
|
|
206
|
+
"TfTag"
|
|
207
|
+
],
|
|
208
|
+
"minimumComponents": {
|
|
209
|
+
"TfCard": 3
|
|
210
|
+
},
|
|
211
|
+
"layoutMustInclude": [
|
|
212
|
+
"left-sidebar-progress-navigation",
|
|
213
|
+
"right-multi-section-cards"
|
|
214
|
+
],
|
|
215
|
+
"forbiddenStructures": [
|
|
216
|
+
"plain-single-card-form",
|
|
217
|
+
"single-section-large-form",
|
|
218
|
+
"marketing-hero-layout"
|
|
219
|
+
],
|
|
220
|
+
"requiredBehaviors": [
|
|
221
|
+
"section-navigation-scroll",
|
|
222
|
+
"section-progress",
|
|
223
|
+
"required-field-progress",
|
|
224
|
+
"validate-before-save",
|
|
225
|
+
"validation-failure-scroll-to-first-invalid-section"
|
|
226
|
+
],
|
|
227
|
+
"stateModel": [
|
|
228
|
+
"form",
|
|
229
|
+
"sections",
|
|
230
|
+
"activeSection",
|
|
231
|
+
"sideNavItems",
|
|
232
|
+
"totalProgress",
|
|
233
|
+
"requiredProgress",
|
|
234
|
+
"saving",
|
|
235
|
+
"notice"
|
|
236
|
+
],
|
|
237
|
+
"sectionModel": {
|
|
238
|
+
"requiredFields": [
|
|
239
|
+
"id",
|
|
240
|
+
"title",
|
|
241
|
+
"description",
|
|
242
|
+
"requiredFields",
|
|
243
|
+
"summary"
|
|
244
|
+
],
|
|
245
|
+
"idRule": "sections[].id must equal sideNavItems[].id and the corresponding right TfCard id.",
|
|
246
|
+
"progressRule": "section progress is computed from completed requiredFields; do not hard-code progress values.",
|
|
247
|
+
"cardRule": "render each section as a separate TfCard inside the right content area."
|
|
248
|
+
},
|
|
249
|
+
"navigationContract": {
|
|
250
|
+
"activeKey": "activeSection",
|
|
251
|
+
"navSource": "sections",
|
|
252
|
+
"navComponent": "TfSideNav",
|
|
253
|
+
"targetComponent": "TfCard",
|
|
254
|
+
"scrollMethod": "scrollIntoView",
|
|
255
|
+
"failureBehavior": "scroll to first invalid section and set highlightedSection temporarily"
|
|
256
|
+
},
|
|
257
|
+
"outputChecklist": [
|
|
258
|
+
"Use a left sidebar with progress and TfSideNav.",
|
|
259
|
+
"Use at least three right-side TfCard sections.",
|
|
260
|
+
"Bind each nav item id to a section card id.",
|
|
261
|
+
"Compute totalProgress and requiredProgress from form/sections state.",
|
|
262
|
+
"Validate before save or submit.",
|
|
263
|
+
"On validation failure, scroll to the first invalid section."
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"id": "form-create-edit",
|
|
269
|
+
"title": "创建/编辑表单页",
|
|
270
|
+
"structure": [
|
|
271
|
+
"TfPageHeader",
|
|
272
|
+
"TfForm",
|
|
273
|
+
"TfCard sections",
|
|
274
|
+
"TfFormLayout",
|
|
275
|
+
"form field wrappers",
|
|
276
|
+
"save/submit actions"
|
|
277
|
+
],
|
|
278
|
+
"recommendedComponents": [
|
|
279
|
+
"TfPageHeader",
|
|
280
|
+
"TfCard",
|
|
281
|
+
"TfForm",
|
|
282
|
+
"TfFormLayout",
|
|
283
|
+
"TfFormInput",
|
|
284
|
+
"TfFormSelect",
|
|
285
|
+
"TfFormTextarea",
|
|
286
|
+
"TfFormDatePicker",
|
|
287
|
+
"TfButton"
|
|
288
|
+
],
|
|
289
|
+
"requiredStates": [
|
|
290
|
+
"loading",
|
|
291
|
+
"saving",
|
|
292
|
+
"submitting",
|
|
293
|
+
"validation-error",
|
|
294
|
+
"disabled",
|
|
295
|
+
"view-mode",
|
|
296
|
+
"save-success",
|
|
297
|
+
"save-error"
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"id": "detail",
|
|
302
|
+
"title": "详情页",
|
|
303
|
+
"structure": [
|
|
304
|
+
"TfPageHeader with status and actions",
|
|
305
|
+
"TfCard information sections",
|
|
306
|
+
"semantic field groups",
|
|
307
|
+
"related table when needed"
|
|
308
|
+
],
|
|
309
|
+
"recommendedComponents": [
|
|
310
|
+
"TfPageHeader",
|
|
311
|
+
"TfCard",
|
|
312
|
+
"TfGrid",
|
|
313
|
+
"TfStack",
|
|
314
|
+
"TfTypography",
|
|
315
|
+
"TfTag",
|
|
316
|
+
"TfBadge",
|
|
317
|
+
"TfStatusDot",
|
|
318
|
+
"TfTable"
|
|
319
|
+
],
|
|
320
|
+
"requiredStates": [
|
|
321
|
+
"loading",
|
|
322
|
+
"not-found",
|
|
323
|
+
"no-access",
|
|
324
|
+
"error",
|
|
325
|
+
"delete-confirm"
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"id": "dashboard-workbench",
|
|
330
|
+
"title": "Dashboard / 工作台",
|
|
331
|
+
"structure": [
|
|
332
|
+
"TfPageHeader",
|
|
333
|
+
"TfMetric grid",
|
|
334
|
+
"task cards",
|
|
335
|
+
"tables or compact lists",
|
|
336
|
+
"partial error handling"
|
|
337
|
+
],
|
|
338
|
+
"recommendedComponents": [
|
|
339
|
+
"TfPageHeader",
|
|
340
|
+
"TfGrid",
|
|
341
|
+
"TfMetric",
|
|
342
|
+
"TfCard",
|
|
343
|
+
"TfTable",
|
|
344
|
+
"TfProgress",
|
|
345
|
+
"TfTag",
|
|
346
|
+
"TfSkeleton"
|
|
347
|
+
],
|
|
348
|
+
"requiredStates": [
|
|
349
|
+
"loading",
|
|
350
|
+
"empty",
|
|
351
|
+
"error",
|
|
352
|
+
"refreshing",
|
|
353
|
+
"partial-error"
|
|
354
|
+
]
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"id": "settings",
|
|
358
|
+
"title": "配置页",
|
|
359
|
+
"structure": [
|
|
360
|
+
"navigation or tabs",
|
|
361
|
+
"TfCard configuration groups",
|
|
362
|
+
"TfForm settings",
|
|
363
|
+
"save and dangerous action confirmation"
|
|
364
|
+
],
|
|
365
|
+
"recommendedComponents": [
|
|
366
|
+
"TfTabs",
|
|
367
|
+
"TfTabsList",
|
|
368
|
+
"TfTabsTrigger",
|
|
369
|
+
"TfTabsContent",
|
|
370
|
+
"TfCard",
|
|
371
|
+
"TfForm",
|
|
372
|
+
"TfFormSwitch",
|
|
373
|
+
"TfFormInput",
|
|
374
|
+
"TfButton"
|
|
375
|
+
],
|
|
376
|
+
"requiredStates": [
|
|
377
|
+
"loading",
|
|
378
|
+
"saving",
|
|
379
|
+
"disabled",
|
|
380
|
+
"permission",
|
|
381
|
+
"confirm",
|
|
382
|
+
"save-success",
|
|
383
|
+
"save-error"
|
|
384
|
+
]
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"id": "empty-error-state",
|
|
388
|
+
"title": "空状态 / 异常状态",
|
|
389
|
+
"structure": [
|
|
390
|
+
"TfEmpty for no data",
|
|
391
|
+
"TfSkeleton for loading",
|
|
392
|
+
"TfAlert for local errors",
|
|
393
|
+
"retry or back action"
|
|
394
|
+
],
|
|
395
|
+
"recommendedComponents": [
|
|
396
|
+
"TfEmpty",
|
|
397
|
+
"TfSkeleton",
|
|
398
|
+
"TfAlert",
|
|
399
|
+
"TfButton",
|
|
400
|
+
"TfStateContainer"
|
|
401
|
+
],
|
|
402
|
+
"requiredStates": [
|
|
403
|
+
"empty",
|
|
404
|
+
"error",
|
|
405
|
+
"no-access",
|
|
406
|
+
"retry",
|
|
407
|
+
"disabled"
|
|
408
|
+
]
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
"do": [
|
|
412
|
+
"Use TfButton, TfForm, TfTable, TfCard and TfPageHeader first.",
|
|
413
|
+
"Use design tokens for color, spacing, font size, border and radius.",
|
|
414
|
+
"Group forms with more than 8 fields.",
|
|
415
|
+
"Cover empty/loading/error states on list pages.",
|
|
416
|
+
"Provide loading and error feedback for save, submit and delete actions.",
|
|
417
|
+
"Use lucide-vue-next icons for recognizable actions.",
|
|
418
|
+
"Define TypeScript types for rows, forms, filters and event payloads.",
|
|
419
|
+
"Report the @tongfun/ui component list after generation."
|
|
420
|
+
],
|
|
421
|
+
"dont": [
|
|
422
|
+
"Do not hard-code #1677ff, #1890ff or rgb(...) brand/status colors.",
|
|
423
|
+
"Do not recreate base buttons, inputs, dialogs, tables or pagination.",
|
|
424
|
+
"Do not mix Element Plus, Ant Design Vue, Naive UI or other UI libraries.",
|
|
425
|
+
"Do not generate marketing-style hero pages for admin workflows.",
|
|
426
|
+
"Do not use large gradients or decorative graphics.",
|
|
427
|
+
"Do not use oversized radii, heavy shadows or low-density layouts.",
|
|
428
|
+
"Do not omit loading, empty, error or permission states.",
|
|
429
|
+
"Do not place every table action inline when toolbar or more actions are more appropriate."
|
|
430
|
+
],
|
|
431
|
+
"requiredStates": [
|
|
432
|
+
"loading",
|
|
433
|
+
"empty",
|
|
434
|
+
"error",
|
|
435
|
+
"disabled",
|
|
436
|
+
"permission",
|
|
437
|
+
"no-access",
|
|
438
|
+
"validation-error",
|
|
439
|
+
"saving",
|
|
440
|
+
"submitting",
|
|
441
|
+
"save-success",
|
|
442
|
+
"save-error",
|
|
443
|
+
"pagination",
|
|
444
|
+
"filter-reset",
|
|
445
|
+
"danger-confirm"
|
|
446
|
+
],
|
|
447
|
+
"fallbackPolicy": {
|
|
448
|
+
"allowedFallbacks": [
|
|
449
|
+
"native HTML",
|
|
450
|
+
"Vue composition",
|
|
451
|
+
"CSS using @tongfun/ui design tokens",
|
|
452
|
+
"reka-ui for missing complex accessible interactions"
|
|
453
|
+
],
|
|
454
|
+
"mustExplainReason": true,
|
|
455
|
+
"forbiddenFallbacks": [
|
|
456
|
+
"new UI library",
|
|
457
|
+
"duplicate base components",
|
|
458
|
+
"hard-coded visual system"
|
|
459
|
+
]
|
|
460
|
+
},
|
|
461
|
+
"goldenExamplesPath": "docs/golden-examples",
|
|
462
|
+
"agentOutputRequirements": [
|
|
463
|
+
"Report page type.",
|
|
464
|
+
"Report @tongfun/ui components used.",
|
|
465
|
+
"Report fallback usage and reason.",
|
|
466
|
+
"Report covered states.",
|
|
467
|
+
"Generate compilable, previewable and maintainable Vue SFC code.",
|
|
468
|
+
"List missing API, field, permission or enum inputs that business teams must provide."
|
|
469
|
+
]
|
|
470
|
+
}
|