@mingfuyun/star-allinone 0.1.7 → 0.1.9

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.
@@ -0,0 +1,90 @@
1
+ # Mock Conventions
2
+
3
+ Default output is conversation JSON. Do not create files, Umi routes, JavaScript, TypeScript, handlers, or server configuration unless the user explicitly asks for files.
4
+
5
+ ## Conversation output
6
+
7
+ Label each response with HTTP method, API path, and scenario, then provide one strict JSON code block.
8
+
9
+ ```text
10
+ GET /api/v1/devices/ — success
11
+ ```
12
+
13
+ Rules:
14
+
15
+ - Return the default success scenario unless the user requests another scenario.
16
+ - Use separate labeled JSON blocks for success, empty, validation error, or permission error responses.
17
+ - Preserve OpenAPI placeholders such as `{id}` in the label while using realistic concrete IDs in response data.
18
+ - Do not mention an output filename unless writing a file was requested.
19
+
20
+ When files are requested, write pure JSON at `mock/<api-path>/<method>.json`. Never generate `defineMock`, Umi imports, handlers, Faker, current timestamps, or unseeded randomness.
21
+
22
+ ## Response shapes
23
+
24
+ Use the actual OpenAPI response schema even when it differs from these common envelopes.
25
+
26
+ Ordinary success:
27
+
28
+ ```json
29
+ {
30
+ "code": 0,
31
+ "message": "success",
32
+ "data": {
33
+ "id": "device-001",
34
+ "hostname": "edge-shanghai-001"
35
+ }
36
+ }
37
+ ```
38
+
39
+ Paginated list. Follow the nearest domain; common shapes are `{ results, count }` or `{ list, total }`:
40
+
41
+ ```json
42
+ {
43
+ "code": 0,
44
+ "message": "success",
45
+ "data": {
46
+ "results": [
47
+ {
48
+ "id": "device-001",
49
+ "hostname": "edge-shanghai-001"
50
+ }
51
+ ],
52
+ "count": 1
53
+ }
54
+ }
55
+ ```
56
+
57
+ Business error:
58
+
59
+ ```json
60
+ {
61
+ "code": 400,
62
+ "message": "参数校验失败",
63
+ "data": {
64
+ "hostname": ["该字段不能为空"]
65
+ }
66
+ }
67
+ ```
68
+
69
+ `MFRequest` unwraps `data` for service callers. Mock JSON must keep the complete backend envelope.
70
+
71
+ ## Scenario coverage
72
+
73
+ - Default successful detail or operation response.
74
+ - Normal list containing representative status and enum variants.
75
+ - Empty list when requested: empty collection and matching total/count `0`.
76
+ - Very long names and remarks for overflow testing.
77
+ - Zero numeric values so UI code does not confuse zero with missing data.
78
+ - Nullable and optional fields only where the contract permits them.
79
+ - Validation and permission errors only when requested or documented.
80
+
81
+ Static JSON cannot implement pagination, filtering, mutation continuity, or upload parsing. Represent those as separate labeled responses.
82
+
83
+ ## Contract checks
84
+
85
+ 1. Copy the exact path and method from OpenAPI and the service module.
86
+ 2. Resolve every `$ref` used by the selected response schema.
87
+ 3. Include every required property and preserve snake_case.
88
+ 4. Keep enum values, nullability, number/string types, and nested arrays consistent.
89
+ 5. Keep pagination totals consistent with the represented collection unless the fixture intentionally shows another page.
90
+ 6. Ensure every fenced JSON block is strict, parseable JSON: double-quoted keys and strings, no comments, no trailing commas.
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: {{sharedSkillName}}
3
+ description: Generate frontend TypeScript API types, MFRequest service methods, aggregate exports, and contract-aligned mock artifacts for an explicitly selected API operation. Use when the user names an endpoint or operationId and asks to generate or update service, types, or mock data.
4
+ ---
5
+
6
+ # API to Service
7
+
8
+ This skill is fully shared. Generate only the requested `METHOD /path/` or `operationId`. Do not guess undocumented fields or change unrelated endpoints.
9
+
10
+ Read before editing:
11
+
12
+ 1. `.star-allinone.json`
13
+ 2. [references/service-conventions.md](references/service-conventions.md)
14
+ 3. [references/api-artifact-generation.md](references/api-artifact-generation.md)
15
+ 4. `.agents/skills/shared-api-mock/references/mock-conventions.md` before producing JSON
16
+
17
+ OpenAPI lookup order:
18
+
19
+ 1. `openapi` in `.star-allinone.json`
20
+ 2. A Swagger/OpenAPI file the user provided in this conversation
21
+ 3. Nearest existing domain `typings.d.ts` plus the live endpoint, reported as incomplete if no schema exists
22
+
23
+ `serviceDir` defaults to `src/services` unless `.star-allinone.json` sets it.
24
+
25
+ ## Workflow
26
+
27
+ 1. Resolve one exact operation. If a path has multiple methods and intent is unclear, ask for the method. Never infer a destructive method.
28
+ 2. Recursively resolve parameters, request body, responses, and local `$ref`s. Neighboring methods that share a path are out of scope.
29
+ 3. Build the target matrix in `api-artifact-generation.md`. Compare existing types, methods, exports, and mocks. Classify create / update / reuse / conflict.
30
+ 4. Report contract conflicts before overwriting deployed behavior.
31
+ 5. Update `src/services/<Domain>/typings.d.ts`, the thin `MFRequest` method, and `src/services/index.ts` when the domain export is missing.
32
+ 6. Produce the default successful JSON mock. Add empty or error variants only when requested.
33
+ 7. Verify formatting, TypeScript, JSON parsing, exact method/path, and a focused diff.
34
+
35
+ ## Hard rules
36
+
37
+ - Preserve backend snake_case, documented optionality, and `| null` nullability.
38
+ - Type callers against unwrapped `data`. Do not model the transport envelope inside `T`.
39
+ - Prefer named types. Do not use `Record<string, any>` or unexplained `any`.
40
+ - Do not modify `src/services/request.tsx` for one endpoint without explicit approval.
41
+ - Do not generate pages, hooks, or extra mock scenarios unless requested.
42
+ - Never refresh a checked-in OpenAPI snapshot with `cp` or full-file replacement.
43
+
44
+ ## Verification
45
+
46
+ ```bash
47
+ pnpm exec prettier --check <changed-service-and-json-files>
48
+ pnpm exec tsc --noEmit
49
+ ```
50
+
51
+ Parse changed JSON files. Search generated names, operationId, and exact API paths for omissions and collisions. Run `pnpm lint` for broad service changes. Cite the OpenAPI path, method, operationId, and schema names in the handoff.
@@ -0,0 +1,70 @@
1
+ # Specified API Artifact Generation
2
+
3
+ ## Accepted selectors
4
+
5
+ Resolve a request using one of these forms:
6
+
7
+ ```text
8
+ GET /api/v1/devices/
9
+ PATCH /api/v1/devices/{id}/
10
+ operationId: api_v1_devices_list
11
+ ```
12
+
13
+ Preserve the documented path, including placeholders and trailing slash. Never infer a destructive method.
14
+
15
+ If a path has multiple methods and intent does not identify one, stop and request the method.
16
+
17
+ ## Target matrix
18
+
19
+ Before editing, establish this matrix for every requested operation:
20
+
21
+ | Field | Value |
22
+ | ---------------- | -------------------------------------------------- |
23
+ | Method and path | Exact OpenAPI operation |
24
+ | operationId | Documented identifier |
25
+ | Domain | Existing service domain or tag-derived domain |
26
+ | Parameters | Path, query, header, and cookie schemas |
27
+ | Request body | Content type and resolved schema |
28
+ | Success response | Selected status, content type, and resolved schema |
29
+ | Error responses | Only those needed by the requested artifacts |
30
+ | Service method | Existing or proposed public method name |
31
+ | Types | Existing types to reuse and new types to create |
32
+ | Mock output | Conversation JSON, or `mock/<api-path>/<method>.json` when files are requested |
33
+
34
+ ## Default artifacts
35
+
36
+ Unless the user narrows the scope, generating `GET /api/v1/devices/` means:
37
+
38
+ - Request, query, and path-parameter types.
39
+ - Response, item, detail, pagination, enum, and nested object types required by that operation.
40
+ - One thin `MFRequest` method.
41
+ - Domain aggregate export when missing.
42
+ - One deterministic successful JSON response.
43
+
44
+ Do not generate a page, hook, model, component, test server, or extra mock scenario unless requested.
45
+
46
+ ## Schema closure
47
+
48
+ Starting from parameters, request bodies, and selected responses:
49
+
50
+ 1. Collect every local `$ref`.
51
+ 2. Read the referenced component schema.
52
+ 3. Repeat for nested properties, items, `allOf`, `oneOf`, and `anyOf`.
53
+ 4. Stop only when all leaves are primitive, inline, or unsupported external references that are explicitly reported.
54
+
55
+ Generate types only for schemas used by the selected operation. Reuse an existing project type only after verifying required fields, optionality, nullability, enums, and formats.
56
+
57
+ ## Existing artifact decisions
58
+
59
+ - **Create:** no matching service, type, or mock exists.
60
+ - **Update:** the artifact represents the selected operation but differs from the current contract.
61
+ - **Reuse:** the existing artifact matches semantically; do not rewrite it for formatting or naming.
62
+ - **Conflict:** deployed behavior intentionally differs or sources contradict; report before destructive changes.
63
+
64
+ Never regenerate an entire service namespace because one endpoint changed.
65
+
66
+ ## OpenAPI snapshot
67
+
68
+ Treat the project's OpenAPI/Swagger file as authoritative. Lookup order: `openapi` in `.star-allinone.json`, then a document provided in the conversation.
69
+
70
+ Never refresh a checked-in snapshot with `cp`, full-file replacement, or unconditional formatter output. Report the delta and wait for confirmation before rewriting the snapshot.
@@ -0,0 +1,89 @@
1
+ # Service Conventions
2
+
3
+ Read `.star-allinone.json` first. `serviceDir` defaults to `src/services`. Overlay extra domain paths only when `.agents/project/conventions.md` exists.
4
+
5
+ ## Layout
6
+
7
+ ```text
8
+ src/services/<Domain>/
9
+ ├── <domain>.ts
10
+ └── typings.d.ts
11
+ ```
12
+
13
+ Import the domain default export in `src/services/index.ts` and spread it into the aggregate object. Update an existing domain instead of creating a duplicate.
14
+
15
+ Pages must not call axios or `src/services/request.tsx` directly. Consume methods through `import Service from '@/services'`.
16
+
17
+ ## Request mapping
18
+
19
+ Inspect the project's `MFRequest` helper before generating. The common mapping is:
20
+
21
+ | Contract | Call |
22
+ | --------------------- | ------------------------------- |
23
+ | GET query | `MFRequest.get(url, params)` |
24
+ | POST JSON | `MFRequest.post(url, body)` |
25
+ | PATCH JSON | `MFRequest.patch(url, body)` |
26
+ | PUT JSON | `MFRequest.put(url, body)` |
27
+ | DELETE query | `MFRequest.delete(url, params)` |
28
+ | GET blob export | `MFRequest.export(url, params)` |
29
+ | POST multipart import | `MFRequest.import(url, params)` |
30
+
31
+ Do not modify the shared request module for a single endpoint unless the transport capability is missing and the user approves the cross-cutting change.
32
+
33
+ ## Types
34
+
35
+ - Put DTOs in `src/services/<Domain>/typings.d.ts` using the project's `declare namespace DOMAIN_API` pattern.
36
+ - Pages must not redefine service DTOs.
37
+ - Preserve backend snake_case.
38
+ - Mark a field optional only when the contract may omit it. Use `| null` when it is present but nullable.
39
+ - Prefer named types over `Record<string, any>` when the contract is known.
40
+ - Use `Partial<T>` only for genuinely partial update or filter contracts.
41
+ - Path parameters are explicit function arguments, not fields on the query type.
42
+ - Service callers are typed against the unwrapped `data` payload. `MFRequest` resolves the outer envelope; do not duplicate `code`, `message`/`msg`, or `data` inside `T`.
43
+ - Add concise Chinese JSDoc matching nearby services.
44
+
45
+ ```ts
46
+ import MFRequest from '../request';
47
+
48
+ /**
49
+ * 获取设备列表
50
+ */
51
+ const getDevicesList = (params: DEVICES_API.IDevicesListForm) => {
52
+ return MFRequest.get('/api/v1/devices/', params);
53
+ };
54
+
55
+ export default { getDevicesList };
56
+ ```
57
+
58
+ ```ts
59
+ declare namespace DEVICES_API {
60
+ type IDevicesListForm = {
61
+ page: number;
62
+ page_size: number;
63
+ keyword?: string;
64
+ };
65
+
66
+ type IDevicesListResponse = {
67
+ results: IDevicesListItem[];
68
+ count: number;
69
+ };
70
+ }
71
+ ```
72
+
73
+ If the nearest domain uses `{ list, total }` instead of `{ results, count }`, follow that domain. Do not invent a third pagination shape.
74
+
75
+ ## Endpoint checklist
76
+
77
+ - Exact HTTP method and trailing slash.
78
+ - Path variables and their types.
79
+ - Query versus JSON body versus multipart.
80
+ - Required, optional, and nullable fields.
81
+ - Enum values and display fields.
82
+ - Date/time and numeric units.
83
+ - List pagination and sorting fields.
84
+ - Download filename/content behavior.
85
+ - Empty response semantics for create/update/delete.
86
+
87
+ ## MFRequest side effects
88
+
89
+ Ordinary requests typically strip `undefined`, `null`, and empty strings. PATCH may convert `undefined` to `null`. Confirm the local wrapper before using `undefined` to mean “unchanged.”
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: {{sharedSkillName}}
3
+ description: Review the active frontend project's changes and prepare a confirmation-gated Conventional Commit and optional push. Use when the user asks to review current changes, submit code, or commit and push. Never commit before explicit confirmation.
4
+ ---
5
+
6
+ # Commit Current Changes
7
+
8
+ This skill is fully shared. Review user-authorized working-tree changes, report findings and a commit proposal, and mutate Git only after explicit confirmation.
9
+
10
+ ## Write-operation gate
11
+
12
+ Git writes are forbidden until both gates are complete in the current turn:
13
+
14
+ 1. **Review gate**: deliver a report with findings or `No issues found.`
15
+ 2. **Confirmation gate**: present exact file paths and the exact commit subject, then receive affirmative confirmation of that proposal. “提交代码” is not confirmation before the proposal exists.
16
+
17
+ Before `git add`, `git commit`, or `git push`, re-check status and diff. If scope changed, stop and issue a new proposal. Never infer confirmation from urgency or a previous turn.
18
+
19
+ ## Workflow
20
+
21
+ ### 1. Scope
22
+
23
+ Run `git status --short --branch`, `git diff --stat`, and `git diff`. Inspect cached diffs when staged changes exist. Do not include unrelated user-owned files. Follow recent `git log` language and naming.
24
+
25
+ ### 2. Review
26
+
27
+ Read:
28
+
29
+ 1. `.agents/skills/shared-project-conventions/references/review-checklist.md`
30
+ 2. `.agents/skills/shared-project-conventions/references/quality-checklist.md`
31
+ 3. `.agents/skills/shared-project-conventions/references/architecture.md`
32
+
33
+ This skill is fully shared. If `.agents/project/review-rules.md` exists, apply extra domain checks only; do not weaken shared hard rules.
34
+
35
+ Classify only concrete security, data-loss, runtime, contract, validation, performance, accessibility, or maintainability risks as P0–P2.
36
+
37
+ ```text
38
+ [P1] Short finding title — src/path/file.tsx:42
39
+ Impact and reproduction/contract evidence.
40
+ Fix: focused direction, without unrelated redesign.
41
+ ```
42
+
43
+ ### 3. Validate
44
+
45
+ Always run `git diff --check`. Then run focused Prettier, ESLint, TypeScript, and the project's documented build in proportion to risk. Do not auto-fix. Do not propose commit while an unresolved P0/P1 or a current-change validation failure remains.
46
+
47
+ ### 4. Proposal
48
+
49
+ Lead with findings. Then present optional improvements, validation results, change summary, exact files, branch/remote, and a concise Chinese Conventional Commit message (`feat` / `fix` / `refactor` / `chore` / `docs` / `test` / `style` / `perf` / `build` / `ci`). Stop and wait.
50
+
51
+ ### 5. After confirmation
52
+
53
+ 1. Re-inspect the working tree. If the diff changed, propose again.
54
+ 2. Stage only confirmed paths.
55
+ 3. Commit without `--no-verify` unless the user explicitly authorizes it. Do not amend unless requested.
56
+ 4. Push to upstream, or `git push -u origin HEAD` when none exists. Never force-push.
57
+ 5. Report hash, subject, files, validation, and remote branch.
58
+ 6. Stop. Do not run `$shared-publish-test` or any Yunxiao pipeline script after git push.
59
+
60
+ A confirmed commit or push does not authorize the test pipeline. If the user later says `确认推送流水线` or `发布测试环境`, follow `.agents/skills/shared-publish-test/SKILL.md`.
61
+
62
+ ## Safety
63
+
64
+ - Never expose credentials from diffs; stop if secrets are present.
65
+ - Never use destructive Git commands to clean the working tree.
66
+ - If push is rejected, report the reason and do not rewrite history without separate authorization.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: {{sharedSkillName}}
3
+ description: Implement frontend pages from designs using the active project's React, Umi, Ant Design Pro, service, permission, routing, and component conventions. Use when translating Figma, screenshots, wireframes, or UI specs into page code.
4
+ ---
5
+
6
+ # Design to Page
7
+
8
+ Translate a design into repository-native code. Reuse existing architecture; do not invent a parallel stack.
9
+
10
+ Before implementation, read:
11
+
12
+ 1. `.star-allinone.json`
13
+ 2. [references/page-conventions.md](references/page-conventions.md)
14
+ 3. [references/overlays.md](references/overlays.md) for any modal, drawer, or confirmation
15
+ 4. `.agents/skills/shared-project-conventions/references/architecture.md`
16
+
17
+ If `.agents/project/conventions.md` exists, use it only for extra paths.
18
+
19
+ Inspect the nearest existing page of the same type before proposing files.
20
+
21
+ ## Workflow
22
+
23
+ 1. List visible states: default, loading, empty, error, disabled, overflow, permission, and narrow-screen.
24
+ 2. Resolve ambiguities that affect APIs, route ownership, permissions, or component boundaries. For minor visual gaps, follow the closest precedent and state the assumption.
25
+ 3. Write a short implementation contract: route, sections, query fields, columns, actions, APIs, permissions, states, and files.
26
+ 4. Implement the smallest complete vertical slice. Keep columns and actions outside render. Keep overlay concerns in focused components.
27
+ 5. API-backed pages include types, `MFRequest` methods, aggregate exports, and page consumption in the same change. Use `.agents/skills/shared-api-to-service/SKILL.md` for missing services. Use `.agents/skills/shared-api-mock/SKILL.md` for deterministic data. Do not embed production fake data.
28
+ 6. Compare desktop and narrow layouts against the design. Fix structure and spacing before decoration.
29
+ 7. Run focused verification. Do not claim visual fidelity without inspecting the rendered page.
30
+
31
+ ## Hard rules
32
+
33
+ - React function components, TypeScript, Ant Design 5, Pro Components, Less.
34
+ - `ProForm` for business forms. `MFProTable` for management lists.
35
+ - Overlays from `@mingfuyun/star-allinone`: `CustomDrawer`, `BaseModal`, `HocModal`.
36
+ - Every `await` uses `try-catch`; loading restores in `finally`; `validateFields()` failures are logged and stop the request.
37
+ - Mutations guard duplicate submit, show feedback, and reload affected lists.
38
+ - Do not add a UI library, state library, or CSS-in-JS system without approval.
39
+ - Do not refactor unrelated code.
40
+
41
+ ## Verification
42
+
43
+ ```bash
44
+ pnpm exec prettier --check <changed-files>
45
+ pnpm exec tsc --noEmit
46
+ ```
47
+
48
+ Run `pnpm lint` for broad or shared changes. Run the project's documented build command when routes, entry, or multiple pages change.
@@ -0,0 +1,73 @@
1
+ # Overlays
2
+
3
+ Use this reference for every modal, confirmation dialog, and drawer. Import `@mingfuyun/star-allinone/dist/styles.css` once from the application entry, not from feature components.
4
+
5
+ ## Required components
6
+
7
+ - `CustomDrawer` for create, edit, detail, or configuration drawers.
8
+ - `BaseModal` for forms, selections, confirmations, previews, and other dialogs.
9
+ - Wrap feature overlays with `HocModal` so pages open them through a ref.
10
+ - Keep Ant Design and Pro Components for overlay content.
11
+ - Use `ProForm` for every editable overlay form.
12
+
13
+ Do not add new direct feature-level imports of Ant Design `Drawer`, `Modal`, or `Modal.confirm`.
14
+
15
+ ## Ref contract
16
+
17
+ ```tsx
18
+ export interface ItemDrawerRef {
19
+ show: (args?: { record?: DOMAIN_API.Item }) => void;
20
+ hide: () => void;
21
+ }
22
+ ```
23
+
24
+ The wrapped component receives `visible`, `handleCancel`, and the args passed to `show`. Render the overlay once and open it from the page:
25
+
26
+ ```tsx
27
+ const drawerRef = useRef<ItemDrawerRef>(null);
28
+ drawerRef.current?.show({ record });
29
+ <ItemDrawer ref={drawerRef} reload={() => tableRef.current?.reload()} />;
30
+ ```
31
+
32
+ Do not duplicate open/visible, selected-record, and close state in the page when `HocModal` can own it.
33
+
34
+ ## Drawer pattern
35
+
36
+ Use `CustomDrawer` confirmation controls and disable the ProForm submitter. Reset or initialize fields whenever the overlay becomes visible.
37
+
38
+ ```tsx
39
+ const handleConfirm = async () => {
40
+ try {
41
+ const values = await formRef.current?.validateFields();
42
+ setLoading(true);
43
+ await saveItem(values);
44
+ message.success('操作成功');
45
+ reload();
46
+ handleCancel();
47
+ } catch (error) {
48
+ console.error('提交失败:', error);
49
+ } finally {
50
+ setLoading(false);
51
+ }
52
+ };
53
+ ```
54
+
55
+ Validation failure must stop the request. Restore confirmation loading in `finally`. Never leave an empty `catch`.
56
+
57
+ ## Modal pattern
58
+
59
+ Use `BaseModal` with `visible`, `onOk`, `onCancel`, and `confirmLoading`. Use `footer={null}` for read-only dialogs. Use `destroyOnClose` when stale internal state would leak across openings.
60
+
61
+ ## Responsibilities
62
+
63
+ - Page: table refs, business entry points, and opening an overlay.
64
+ - Overlay: visibility, selected record, form initialization, validation, submitting state, feedback, close, and reload callback.
65
+ - Service: requests and API types.
66
+ - Feature constants: columns and action definitions; never overlay state.
67
+
68
+ ## Verification
69
+
70
+ - Open the same overlay for create, edit, close, and reopen; confirm no stale values remain.
71
+ - Confirm validation prevents closing and duplicate submission.
72
+ - Confirm async failure leaves the overlay open and restores the action button.
73
+ - Check long content, narrow screens, footer visibility, mask behavior, and keyboard closing.
@@ -0,0 +1,85 @@
1
+ # Page Conventions
2
+
3
+ Read `.star-allinone.json` first. Use extra component paths or permission helpers from `.agents/project/conventions.md` only when that file exists.
4
+
5
+ ## Stack and locations
6
+
7
+ - Umi Max, React function components, TypeScript, Ant Design 5, Ant Design Pro Components, Less.
8
+ - Pages: `src/pages/<Feature>/`.
9
+ - Shared components: `src/components/`.
10
+ - Shared hooks: `src/hooks/`.
11
+ - Routes: `config/route.ts`.
12
+ - Services: `src/services/index.ts` via `import Service from '@/services'`.
13
+ - Import application modules through `@/`; use relative imports inside the same feature.
14
+
15
+ ## File split
16
+
17
+ Keep the smallest complete vertical slice. A standard query-form plus table page usually looks like:
18
+
19
+ ```text
20
+ src/pages/<Feature>/
21
+ ├── index.tsx
22
+ ├── index.less
23
+ └── components/ or sibling files
24
+ ├── List.tsx # optional when the page is large
25
+ └── const.tsx # columns, actions, toolbar, maps
26
+ ```
27
+
28
+ Put substantial columns, action builders, status maps, and select options outside render functions. Do not create a second `const.tsx` inside a child component when the page already has one.
29
+
30
+ Styles live in the current page directory. Reuse shared mixins such as `@/styles/proTable.less`; do not import another feature's Less file.
31
+
32
+ ## Tables
33
+
34
+ - Prefer `MFProTable` for management lists. Use Ant Design `Table` only for a deliberately simple static shell.
35
+ - Extract `fetchData` as an `async` method. Do not inline request logic in JSX props.
36
+ - Wrap `await` in `try-catch` and return a table-safe empty shape on failure.
37
+ - Adapt backend pagination to the table contract. Common backend shapes are `{ results, count }` or `{ list, total }`; the table adapter is typically `{ code, data: { list, total } }`. Follow the nearest page.
38
+ - Use a stable `rowKey`. Wide tables use `scroll` with `x: 'max-content'`.
39
+ - Render missing display values as `'-'` unless the design requires another empty state.
40
+ - Keep the latest normalized query values available when export or secondary actions reuse them.
41
+ - Watch falsy bugs such as `value || fallback` when `0`, `false`, or `''` is valid.
42
+
43
+ If the table persists column visibility, order, or fixed state, use the project's column-state hook. Do not read or write `localStorage` in page code. Register new storage keys in the project's cache-reset UI when one exists.
44
+
45
+ ## Forms
46
+
47
+ - Use `ProForm` as the business form container in pages, drawers, and modals.
48
+ - Prefer `ProFormText`, `ProFormSelect`, `ProFormTextArea`, and related fields.
49
+ - Ant Design `Form` may provide `useForm`, `useWatch`, or `ProForm.Item` integration. Do not introduce a rendered `<Form>` container.
50
+ - Default overlay forms to `layout="horizontal"` with a stable label width. Toolbar query forms stay `layout="inline"`.
51
+ - Normalize submitted values before calling services. Do not send empty strings, `undefined`, or presentation-only fields unless the API requires them.
52
+ - Reset both form controls and the active query state.
53
+
54
+ ## Overlays
55
+
56
+ Follow [overlays.md](overlays.md). Use `CustomDrawer`, `BaseModal`, and `HocModal` from `@mingfuyun/star-allinone`. Do not add new feature-level Ant Design `Modal` or `Drawer` shells.
57
+
58
+ ## Permissions and routes
59
+
60
+ - Preserve runtime menu and button permissions with the project's wrappers (`WithPermission`, `TablePermissionActions`, `withAuth`, `actionColumn.permission`, or the equivalent named in project conventions).
61
+ - Do not treat hidden buttons as authorization. Backend enforcement must remain.
62
+ - Add explicit routes in `config/route.ts` when the page needs navigation. Preserve `/403`, `/404`, and nested menu behavior.
63
+
64
+ ## Async behavior
65
+
66
+ - Every `await` lives in `try-catch`, including handlers, loaders, and submissions.
67
+ - Put `validateFields()` inside the `try`. Log the caught error with `console.error` and do not continue to the request.
68
+ - Restore loading in `finally`. Never use an empty `catch`.
69
+ - Mutations disable or guard duplicate submission, show user-facing feedback, and reload affected lists.
70
+ - Destructive actions require confirmation. Use `BaseModal` + `HocModal`. Do not use `Modal.confirm`.
71
+ - Close overlays must clear form values, loading, selected records, and other async state.
72
+
73
+ ## Service integration
74
+
75
+ - API-backed pages include types, service methods, aggregate exports, and page consumption in the same change.
76
+ - Do not embed production fake data or invented response fields.
77
+ - If the backend contract is unavailable, label proposed methods, paths, and fields as proposed.
78
+ - Pair missing services with `.agents/skills/shared-api-to-service/SKILL.md`. Pair missing deterministic data with `.agents/skills/shared-api-mock/SKILL.md`.
79
+
80
+ ## Styling and fidelity
81
+
82
+ - Scope Less below a feature class. Use `:global` only for library internals.
83
+ - Do not add a UI library, state library, or CSS-in-JS system without approval.
84
+ - Cover loading, empty, error, disabled, permission, overflow, duplicate-submit, and narrow-screen behavior.
85
+ - Do not claim visual fidelity without inspecting the rendered page; otherwise say verification was static only.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: {{sharedSkillName}}
3
+ description: Analyze frontend Git changes and trace affected routes, pages, services, permissions, shared components, mocks, and regression checks. Read-only. Use for PR or pre-submit impact analysis.
4
+ ---
5
+
6
+ # Impact Analysis
7
+
8
+ This skill does not modify files.
9
+
10
+ ## Workflow
11
+
12
+ 1. Read `git status`, `git diff --stat`, `git diff`, and changed files. Include staged diffs when present.
13
+ 2. For each changed file, trace static imports, service calls, route references (`config/route.ts`), and permission references.
14
+ 3. Expand shared files: `MFProTable`, `src/services/request.tsx`, permission components, column-state hooks, overlay shells, and app bootstrap.
15
+ 4. Check matching `typings.d.ts`, mocks, drawers/modals, table columns, and menu/route config.
16
+ 5. Classify impact: direct callers, indirect pages, API/permission contracts, build/release risk.
17
+ 6. Give a minimal automated and manual regression path for each item. An import is not proof of runtime impact.
18
+
19
+ Read `.agents/skills/shared-project-conventions/references/review-checklist.md` for shared files that must be expanded. If `.agents/project/review-rules.md` exists, also expand any extra domain files it names.
20
+
21
+ ## Output
22
+
23
+ - Change summary
24
+ - Direct files and pages
25
+ - Possibly affected APIs, permissions, and mocks
26
+ - High-risk shared components and their callers
27
+ - Recommended automated checks and manual paths
28
+ - Risks that cannot be confirmed statically, with why
29
+
30
+ Use repository facts only. Do not invent backend behavior.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: {{sharedSkillName}}
3
+ description: Apply the active frontend project's architecture, API, business, permission, performance, testing, and naming conventions to generated or reviewed code.
4
+ ---
5
+
6
+ # Project Conventions
7
+
8
+ Use this skill for every non-trivial change. Preserve existing patterns and make the smallest scoped change.
9
+
10
+ Read in this order:
11
+
12
+ 1. `.star-allinone.json`
13
+ 2. [references/architecture.md](references/architecture.md)
14
+ 3. [references/review-checklist.md](references/review-checklist.md)
15
+
16
+ Shared rules are complete for review, commit, mock, and service generation. If `.agents/project/conventions.md` exists, use it only for extra paths or domain invariants. It must not weaken the shared hard rules below.
17
+
18
+ ## Hard rules
19
+
20
+ - Pages consume `import Service from '@/services'`. No direct axios or request-helper calls from pages.
21
+ - DTOs live in `src/services/<Domain>/typings.d.ts`. Pages do not redefine them.
22
+ - Reuse `MFProTable`, `ProForm`, `CustomDrawer`, `BaseModal`, `HocModal`, and existing permission wrappers.
23
+ - Backend field names stay in service types. Convert only at an adapter boundary.
24
+ - Async surfaces handle loading, empty, error, retry, unauthorized, and duplicate-submit.
25
+ - No unexplained `any`, `as any`, `@ts-ignore`, or `Record<string, any>` when the contract is known.
26
+ - No new UI/state library without approval.
27
+
28
+ ## Completion
29
+
30
+ Report changed files, API operations used, states covered, validation commands and results, and remaining gaps.