@mingfuyun/star-allinone 0.2.0 → 0.3.0
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 +21 -9
- package/examples/AGENTS.md +29 -0
- package/examples/projects/starlink-frontend.star-allinone.json +7 -0
- package/examples/projects/starscope-frontend.star-allinone.json +7 -0
- package/examples/skills/custom-device-service/SKILL.md +18 -0
- package/package.json +5 -3
- package/scripts/cli.js +44 -11
- package/scripts/gen/fixtures/run.js +104 -0
- package/scripts/gen/fixtures/widgets.openapi.json +194 -0
- package/scripts/gen/names.js +117 -0
- package/scripts/gen/page.js +483 -0
- package/scripts/gen/project.js +154 -0
- package/scripts/gen/service.js +264 -0
- package/scripts/gen/spec.js +220 -0
- package/scripts/gen/ts.js +121 -0
- package/skills/README.md +31 -3
- package/skills/shared/ai-review/SKILL.md +4 -1
- package/skills/shared/api-mock/SKILL.md +4 -1
- package/skills/shared/api-to-service/SKILL.md +16 -8
- package/skills/shared/commit-current-changes/SKILL.md +4 -1
- package/skills/shared/design-to-page/SKILL.md +5 -1
- package/skills/shared/i-have-adhd/SKILL.md +1 -1
- package/skills/shared/impact-analysis/SKILL.md +4 -1
- package/skills/shared/page-recipe/SKILL.md +72 -0
- package/skills/shared/page-recipe/references/list-page-template.md +44 -0
- package/skills/shared/project-conventions/SKILL.md +4 -1
- package/skills/shared/project-conventions/references/architecture.md +3 -0
- package/skills/shared/publish-test/SKILL.md +3 -1
- package/skills/shared/review-and-submit/SKILL.md +3 -1
- package/skills/shared/verify/SKILL.md +5 -2
package/skills/README.md
CHANGED
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
```text
|
|
12
12
|
starscope-frontend/
|
|
13
|
+
├── AGENTS.md
|
|
13
14
|
├── .star-allinone.json
|
|
14
15
|
└── .agents/
|
|
15
16
|
├── skills/
|
|
16
17
|
│ ├── shared-api-to-service/
|
|
17
18
|
│ ├── shared-api-mock/
|
|
18
19
|
│ ├── shared-design-to-page/
|
|
20
|
+
│ ├── shared-page-recipe/
|
|
19
21
|
│ ├── shared-verify/
|
|
20
22
|
│ ├── shared-review-and-submit/
|
|
21
23
|
│ ├── shared-publish-test/
|
|
@@ -30,11 +32,13 @@ StarLink:
|
|
|
30
32
|
|
|
31
33
|
```text
|
|
32
34
|
starlink-frontend/
|
|
35
|
+
├── AGENTS.md
|
|
33
36
|
└── .agents/
|
|
34
37
|
└── skills/
|
|
35
38
|
├── shared-api-to-service/
|
|
36
39
|
├── shared-api-mock/
|
|
37
40
|
├── shared-design-to-page/
|
|
41
|
+
├── shared-page-recipe/
|
|
38
42
|
├── shared-verify/
|
|
39
43
|
├── shared-review-and-submit/
|
|
40
44
|
├── shared-publish-test/
|
|
@@ -50,6 +54,8 @@ custom-* 业务定制 skill,由业务项目维护
|
|
|
50
54
|
|
|
51
55
|
这样所有 skill 都在业务项目中,Codex 可以直接发现;同时通过名称可以清楚区分来源。
|
|
52
56
|
|
|
57
|
+
Cursor / Codex 的常驻说明只放仓库根 `AGENTS.md`(模板见 `examples/AGENTS.md`)。项目差异放 `.agents/project/`。不要新增 `.cursor/rules`。
|
|
58
|
+
|
|
53
59
|
## npm 包的职责
|
|
54
60
|
|
|
55
61
|
`@mingfuyun/star-allinone` 包中保存公共 skill 源文件。每个 skill 包含可执行规则,细节放在同目录 `references/`:
|
|
@@ -65,6 +71,7 @@ custom-* 业务定制 skill,由业务项目维护
|
|
|
65
71
|
│ └── api-artifact-generation.md
|
|
66
72
|
├── api-mock/
|
|
67
73
|
├── design-to-page/ # page-conventions.md + overlays.md
|
|
74
|
+
├── page-recipe/ # 标准列表页;CLI `gen page`
|
|
68
75
|
├── project-conventions/ # architecture / review-checklist / quality-checklist
|
|
69
76
|
├── verify/
|
|
70
77
|
├── review-and-submit/
|
|
@@ -173,7 +180,7 @@ git commit -m "feat(skill): 增加设备管理 skill"
|
|
|
173
180
|
|
|
174
181
|
不需要修改 `star-allinone`,也不需要重新发布 npm。
|
|
175
182
|
|
|
176
|
-
|
|
183
|
+
审查、提交、测试环境发布、单接口 Mock/Service、标准列表都走公共入口 skill。`custom-*` 只用于真正的业务特例。单接口生成禁止再做 custom;只有整份契约全量重建才允许留在 custom,并必须在 description 里写明「只用于全量」。度量类 custom 不得生成代码。
|
|
177
184
|
|
|
178
185
|
## 公共部分和业务定制组合
|
|
179
186
|
|
|
@@ -214,6 +221,7 @@ description: Generate StarScope device service code.
|
|
|
214
221
|
|
|
215
222
|
```text
|
|
216
223
|
starscope-frontend/
|
|
224
|
+
├── AGENTS.md
|
|
217
225
|
├── .star-allinone.json
|
|
218
226
|
└── .agents/
|
|
219
227
|
├── skills/
|
|
@@ -247,6 +255,24 @@ StarLink 使用:
|
|
|
247
255
|
|
|
248
256
|
可选字段 `sharedSkills` 用于只同步部分公共 skill;省略时同步 `skills/shared` 下的全部公共 skill。
|
|
249
257
|
|
|
258
|
+
## 用户入口 vs 内部 skill
|
|
259
|
+
|
|
260
|
+
对话里只点这些入口:
|
|
261
|
+
|
|
262
|
+
| 入口 | 用途 |
|
|
263
|
+
| --- | --- |
|
|
264
|
+
| `shared-api-to-service` | 单个 `METHOD /path/` → 类型、`MFRequest`、默认 mock |
|
|
265
|
+
| `shared-page-recipe` | 标准列表页(表格 + 抽屉 + 确认) |
|
|
266
|
+
| `shared-design-to-page` | 非标准设计稿 |
|
|
267
|
+
| `shared-review-and-submit` | 审查并提交(内部会读 impact / verify / commit) |
|
|
268
|
+
| `shared-publish-test` | 测发 |
|
|
269
|
+
|
|
270
|
+
下面这些会随包同步,但 **不要作为用户入口调用**(`disable-model-invocation`)。入口 skill 会去读对应 `SKILL.md`:
|
|
271
|
+
|
|
272
|
+
`shared-api-mock`、`shared-project-conventions`、`shared-verify`、`shared-impact-analysis`、`shared-ai-review`、`shared-commit-current-changes`、`shared-i-have-adhd`
|
|
273
|
+
|
|
274
|
+
`custom-*` 禁止再实现一遍上述入口。单接口生成走公共 CLI;只有「整份契约全量重建」才允许留在 custom(例如 StarLink `custom-swagger-to-markdown`)。度量类 custom 不得生成代码。
|
|
275
|
+
|
|
250
276
|
## 公共规则写在哪里
|
|
251
277
|
|
|
252
278
|
| Skill | 规则位置 | 覆盖内容 |
|
|
@@ -254,6 +280,7 @@ StarLink 使用:
|
|
|
254
280
|
| `shared-api-to-service` | SKILL + `references/service-conventions.md`、`api-artifact-generation.md` | 指定 operation、`MFRequest` 映射、namespace 类型、snake_case、schema 闭包、禁止改 transport |
|
|
255
281
|
| `shared-api-mock` | SKILL + `references/mock-conventions.md` | 对话 JSON 默认、完整响应信封、分页/空列表/错误场景、禁止 handler 和随机数 |
|
|
256
282
|
| `shared-design-to-page` | SKILL + `references/page-conventions.md`、`overlays.md` | 页面分层、`MFProTable`、`ProForm`、权限、异步、`HocModal` 弹层合同 |
|
|
283
|
+
| `shared-page-recipe` | SKILL + `references/list-page-template.md` | 标准列表页文件树;先跑 `star-allinone gen page` |
|
|
257
284
|
| `shared-project-conventions` | SKILL + `references/architecture.md`、`review-checklist.md`、`quality-checklist.md` | 架构边界、质量禁令、审查清单;其他 skill 会引用这些文件 |
|
|
258
285
|
| `shared-verify` | SKILL | 成套产物检查、await/loading/弹层、验证命令和报告格式 |
|
|
259
286
|
| `shared-impact-analysis` | SKILL | 只读影响分类和回归路径 |
|
|
@@ -290,9 +317,10 @@ star-allinone 修改
|
|
|
290
317
|
最终结构和责任边界:
|
|
291
318
|
|
|
292
319
|
```text
|
|
320
|
+
AGENTS.md ← 常驻约定,不要加 .cursor/rules
|
|
293
321
|
.agents/skills/
|
|
294
|
-
├── shared-*
|
|
295
|
-
└── custom-*
|
|
322
|
+
├── shared-* ← npm 包同步,不能在业务项目直接维护
|
|
323
|
+
└── custom-* ← 业务项目自己维护
|
|
296
324
|
```
|
|
297
325
|
|
|
298
326
|
这比全局安装更适合团队协作,也比把公共 skill 藏在 `node_modules` 中更可靠,因为公共 skill 最终会进入业务项目仓库,团队成员拉取代码后即可直接使用。
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description:
|
|
3
|
+
description: Internal. Do not invoke. Standalone review checklist used by shared-review-and-submit. Do not modify files.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# AI Code Review
|
|
7
8
|
|
|
9
|
+
Not a user-facing entry. Do not invoke this skill. `shared-review-and-submit` covers review. Do not treat this as a generate or submit entry.
|
|
10
|
+
|
|
8
11
|
This skill is fully shared. Review the current diff plus relevant callers and types. Before reviewing, read:
|
|
9
12
|
|
|
10
13
|
1. `.agents/skills/shared-project-conventions/references/review-checklist.md`
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description:
|
|
3
|
+
description: Internal. Do not invoke. Called by shared-api-to-service when extra mock scenarios are needed. Not a user-facing generate-service entry.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# API Mock
|
|
7
8
|
|
|
9
|
+
Not a user-facing entry. Do not invoke this skill. `shared-api-to-service` reads this file when extra mock scenarios are needed. Generating types or `MFRequest` methods is not this skill's job.
|
|
10
|
+
|
|
8
11
|
This skill is fully shared. Read [references/mock-conventions.md](references/mock-conventions.md), `.star-allinone.json`, the related service types, and the OpenAPI file from `openapi` in `.star-allinone.json` (or the document provided in this conversation).
|
|
9
12
|
|
|
10
13
|
If the service contract is missing, first follow `.agents/skills/shared-api-to-service/SKILL.md`.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description: Generate
|
|
3
|
+
description: User-facing. Generate or update one OpenAPI/Swagger operation as TypeScript types, an MFRequest method, and optional mock JSON. Use for a named METHOD /path or operationId. Do not use for full-spec domain regen.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# API to Service
|
|
7
7
|
|
|
8
|
+
User-facing entry for **one** `METHOD /path/` or `operationId`. Do not regenerate an entire Swagger domain here. StarLink full-spec rebuilds stay on `custom-swagger-to-markdown`.
|
|
9
|
+
|
|
8
10
|
This skill is fully shared. Generate only the requested `METHOD /path/` or `operationId`. Do not guess undocumented fields or change unrelated endpoints.
|
|
9
11
|
|
|
10
12
|
Read before editing:
|
|
@@ -25,12 +27,18 @@ OpenAPI lookup order:
|
|
|
25
27
|
## Workflow
|
|
26
28
|
|
|
27
29
|
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.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
2. From the business project root, generate the artifacts with the CLI. Do not hand-write types or `MFRequest` methods when the spec exists:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm exec star-allinone gen service --operation "GET /api/v1/devices/"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Use `--spec <file>` when `.star-allinone.json` has no `openapi`. Use `--domain <Name>` when the folder cannot be inferred. Use `--mock-file` only when the user asked for a mock file; otherwise keep the default conversation JSON.
|
|
37
|
+
|
|
38
|
+
3. If the CLI reports reuse, keep the existing method. If it reports a conflict, stop and show the diff; do not overwrite.
|
|
39
|
+
4. Review the generated types against the spec: snake_case, optionality, `| null`, unwrapped `data`, and exact method/path.
|
|
40
|
+
5. Produce extra empty or error mocks only when requested, using `.agents/skills/shared-api-mock/SKILL.md`.
|
|
41
|
+
6. Verify formatting, TypeScript, JSON parsing, exact method/path, and a focused diff.
|
|
34
42
|
|
|
35
43
|
## Hard rules
|
|
36
44
|
|
|
@@ -45,7 +53,7 @@ OpenAPI lookup order:
|
|
|
45
53
|
|
|
46
54
|
```bash
|
|
47
55
|
pnpm exec prettier --check <changed-service-and-json-files>
|
|
48
|
-
pnpm
|
|
56
|
+
pnpm typecheck
|
|
49
57
|
```
|
|
50
58
|
|
|
51
59
|
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.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description:
|
|
3
|
+
description: Internal. Do not invoke. Step 3 of shared-review-and-submit. Confirmation-gated commit only after that entry skill has run.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Commit Current Changes
|
|
7
8
|
|
|
9
|
+
Not a user-facing entry. Do not invoke this skill when the user says 提交 or 审查. Use `shared-review-and-submit`, which calls this file as step 3.
|
|
10
|
+
|
|
8
11
|
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
12
|
|
|
10
13
|
## Write-operation gate
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description: Implement
|
|
3
|
+
description: User-facing. Implement a non-standard page from Figma, screenshots, or UI specs. For a standard table + drawer + confirm list, use shared-page-recipe instead.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Design to Page
|
|
7
7
|
|
|
8
|
+
User-facing entry for **non-standard** pages. If the request is a standard table + drawer + confirm list, stop and follow `shared-page-recipe` instead.
|
|
9
|
+
|
|
8
10
|
Translate a design into repository-native code. Reuse existing architecture; do not invent a parallel stack.
|
|
9
11
|
|
|
10
12
|
Before implementation, read:
|
|
@@ -18,6 +20,8 @@ If `.agents/project/conventions.md` exists, use it only for extra paths.
|
|
|
18
20
|
|
|
19
21
|
Inspect the nearest existing page of the same type before proposing files.
|
|
20
22
|
|
|
23
|
+
If the request is a standard management list (table + query + drawer form + confirm), use `.agents/skills/shared-page-recipe/SKILL.md` and `pnpm exec star-allinone gen page` instead of guessing the file tree.
|
|
24
|
+
|
|
21
25
|
## Workflow
|
|
22
26
|
|
|
23
27
|
1. List visible states: default, loading, empty, error, disabled, overflow, permission, and narrow-screen.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description:
|
|
3
|
+
description: Internal output style. Do not invoke as a task. Other shared skills apply this file to user-facing replies. Turn on with /i-have-adhd; off with stop adhd mode.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
license: MIT
|
|
6
6
|
metadata:
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description:
|
|
3
|
+
description: Internal. Do not invoke. Step 1 of shared-review-and-submit. Read-only impact tracing.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Impact Analysis
|
|
7
8
|
|
|
9
|
+
Not a user-facing entry. Do not invoke this skill. `shared-review-and-submit` runs this as step 1.
|
|
10
|
+
|
|
8
11
|
This skill does not modify files.
|
|
9
12
|
|
|
10
13
|
## Workflow
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: {{sharedSkillName}}
|
|
3
|
+
description: User-facing. Scaffold a standard management list (route, MFProTable, drawer form, confirm modal, permissions, services). Use for CRUD list pages. Do not use for dashboards or one-off layouts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# List Page Recipe
|
|
7
|
+
|
|
8
|
+
User-facing entry for a **standard** management list. Dashboards, iframes, and one-off layouts use `shared-design-to-page`.
|
|
9
|
+
|
|
10
|
+
Scaffold a standard management list. Do not use this for dashboards, iframes, or one-off visualizations. Those stay on `shared-design-to-page`.
|
|
11
|
+
|
|
12
|
+
Read before editing:
|
|
13
|
+
|
|
14
|
+
1. `.star-allinone.json`
|
|
15
|
+
2. `.agents/skills/shared-design-to-page/references/page-conventions.md`
|
|
16
|
+
3. `.agents/skills/shared-design-to-page/references/overlays.md`
|
|
17
|
+
4. [references/list-page-template.md](references/list-page-template.md)
|
|
18
|
+
5. `.agents/project/conventions.md` if it exists
|
|
19
|
+
|
|
20
|
+
## Required inputs
|
|
21
|
+
|
|
22
|
+
Collect any missing item before generating:
|
|
23
|
+
|
|
24
|
+
- Feature folder (`src/pages/<Feature>`)
|
|
25
|
+
- Route path and menu title
|
|
26
|
+
- List operation (`METHOD /path/` or `operationId`)
|
|
27
|
+
- Optional create / update / delete operations
|
|
28
|
+
- Optional permission codes for create / edit / delete
|
|
29
|
+
|
|
30
|
+
## Workflow
|
|
31
|
+
|
|
32
|
+
1. Run the CLI from the business project root. Prefer this over hand-writing the skeleton:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pnpm exec star-allinone gen page \
|
|
36
|
+
--feature <Feature> \
|
|
37
|
+
--route /path \
|
|
38
|
+
--title <中文标题> \
|
|
39
|
+
--list-operation "GET /api/v1/resource/" \
|
|
40
|
+
--create-operation "POST /api/v1/resource/" \
|
|
41
|
+
--update-operation "PATCH /api/v1/resource/{id}/" \
|
|
42
|
+
--delete-operation "DELETE /api/v1/resource/{id}/"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Add `--permission-create`, `--permission-edit`, `--permission-delete` when codes are known.
|
|
46
|
+
|
|
47
|
+
2. If only services are missing, run `pnpm exec star-allinone gen service --operation "METHOD /path/"` first. Follow `.agents/skills/shared-api-to-service/SKILL.md`.
|
|
48
|
+
3. Fill generated placeholders: columns, form fields, rowKey, permission constants, and pagination adapter (`results/count` vs `list/total`) using the nearest page of the same type.
|
|
49
|
+
4. If `src/components/Page/Container/config.tsx` exists, register the new page as a tab after generating the standalone files. Do not invent a second page shell.
|
|
50
|
+
5. Run focused verification.
|
|
51
|
+
|
|
52
|
+
## Hard rules
|
|
53
|
+
|
|
54
|
+
- `MFProTable` for the list. `ProForm` inside `CustomDrawer`. Confirmations use `BaseModal` + `HocModal`.
|
|
55
|
+
- Pages consume `import Service from '@/services'` only.
|
|
56
|
+
- Keep columns and toolbar builders in `const.tsx`.
|
|
57
|
+
- Every `await` uses `try-catch`; restore loading in `finally`.
|
|
58
|
+
- Do not use `Modal.confirm` or feature-level Ant Design `Modal` / `Drawer` shells.
|
|
59
|
+
- Do not overwrite existing page files. Tell the user the CLI refused, then edit in place.
|
|
60
|
+
|
|
61
|
+
## Verification
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pnpm exec prettier --check <changed-files>
|
|
65
|
+
pnpm typecheck
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Run `pnpm lint` when routes or shared components change.
|
|
69
|
+
|
|
70
|
+
## User-facing output
|
|
71
|
+
|
|
72
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# List page template
|
|
2
|
+
|
|
3
|
+
The CLI writes this tree. Edit the generated files; do not recreate a parallel structure.
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
config/route.ts
|
|
7
|
+
src/pages/<Feature>/
|
|
8
|
+
├── index.tsx
|
|
9
|
+
├── index.less
|
|
10
|
+
├── const.tsx
|
|
11
|
+
└── components/
|
|
12
|
+
├── <Feature>Drawer.tsx
|
|
13
|
+
└── <Feature>ConfirmModal.tsx
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## index.tsx
|
|
17
|
+
|
|
18
|
+
- Wrap with `PageContainer` when `src/components/PageContainer` exists.
|
|
19
|
+
- `fetchData` is a `useCallback` that calls `Service.<listFn>`, maps pagination, and returns `{ code, data: { list, total } }`.
|
|
20
|
+
- Open the drawer with `drawerRef.current?.show({ record })`.
|
|
21
|
+
- Destructive actions go through the confirm modal ref, then `tableRef.current?.reload()`.
|
|
22
|
+
|
|
23
|
+
## const.tsx
|
|
24
|
+
|
|
25
|
+
- Export `columns`, `getActionColumn`, `getToolBarRender`.
|
|
26
|
+
- Put permission strings on actions and toolbar items when the project uses them.
|
|
27
|
+
- Render empty cells as `'-'`.
|
|
28
|
+
|
|
29
|
+
## Drawer
|
|
30
|
+
|
|
31
|
+
- `CustomDrawer` + `HocModal`.
|
|
32
|
+
- `ProForm` with `submitter={false}` and `layout="horizontal"`.
|
|
33
|
+
- `validateFields()` in `try`. Create vs update from `record`.
|
|
34
|
+
- Reset fields when `visible` becomes true.
|
|
35
|
+
|
|
36
|
+
## Confirm modal
|
|
37
|
+
|
|
38
|
+
- `BaseModal` + `HocModal`.
|
|
39
|
+
- `confirmLoading` tied to the async `onConfirm`.
|
|
40
|
+
- Do not use `Modal.confirm`.
|
|
41
|
+
|
|
42
|
+
## StarScope tabs
|
|
43
|
+
|
|
44
|
+
If the project uses `src/components/Page/Container/config.tsx`, the generated `src/pages/<Feature>/index.tsx` is still the source of truth. Add a tab entry that renders the feature component. Do not duplicate fetch logic inside Container.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description:
|
|
3
|
+
description: Internal. Do not invoke. Referenced by other shared skills for architecture and hard rules. Not a user-facing task.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Project Conventions
|
|
7
8
|
|
|
9
|
+
Not a user-facing entry. Do not invoke this skill. Other shared skills read this file for architecture and hard rules.
|
|
10
|
+
|
|
8
11
|
Use this skill for every non-trivial change. Preserve existing patterns and make the smallest scoped change.
|
|
9
12
|
|
|
10
13
|
Read in this order:
|
|
@@ -4,6 +4,7 @@ Apply these rules to every non-trivial frontend change. Shared review, commit, m
|
|
|
4
4
|
|
|
5
5
|
## Architecture
|
|
6
6
|
|
|
7
|
+
- Always-on agent instructions live in the repo-root `AGENTS.md`. Do not add `.cursor/rules`.
|
|
7
8
|
- Use React function components and TypeScript.
|
|
8
9
|
- Put transport code in `src/services`. Pages must not call axios or the request helper directly.
|
|
9
10
|
- Keep API DTOs in the domain `typings.d.ts`. Use named types and adapters instead of `any`.
|
|
@@ -38,6 +39,8 @@ pnpm exec prettier --check <changed-files>
|
|
|
38
39
|
pnpm exec tsc --noEmit
|
|
39
40
|
```
|
|
40
41
|
|
|
42
|
+
Prefer `pnpm typecheck` when that script exists.
|
|
43
|
+
|
|
41
44
|
Run `pnpm lint` for broad or shared changes. Run `pnpm run build` when routes, entry behavior, shared runtime, or multiple page modules change. If `.star-allinone.json` documents a TypeScript `baseUrl` or build script, use that command.
|
|
42
45
|
|
|
43
46
|
Distinguish failures introduced by the current change from pre-existing or environment failures.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description: Publish the current
|
|
3
|
+
description: User-facing. Publish the current Git branch to the Yunxiao test pipeline after explicit confirmation such as 确认推送流水线. Never run automatically after git push.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Publish Test Environment
|
|
7
7
|
|
|
8
|
+
User-facing entry for test-environment publish only.
|
|
9
|
+
|
|
8
10
|
This skill is fully shared. The only project-specific value is `publishPipelineId` in `.star-allinone.json`.
|
|
9
11
|
|
|
10
12
|
Do not run the pipeline script after a git push. Git push, `确认提交并推送`, and `确认` are not pipeline authorization.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description:
|
|
3
|
+
description: User-facing. Pre-submit workflow: impact analysis, verify, then confirmation-gated commit. Use when the user wants to review, submit, or commit. Do not invoke impact/verify/commit skills separately.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Review and Submit
|
|
7
7
|
|
|
8
|
+
User-facing entry for review, submit, and commit. Do not tell the user to invoke `shared-impact-analysis`, `shared-verify`, `shared-ai-review`, or `shared-commit-current-changes` separately. Read those files in order.
|
|
9
|
+
|
|
8
10
|
This is the unified pre-submit entry and is fully shared. Do not mutate Git until the user confirms the exact reviewed scope.
|
|
9
11
|
|
|
10
12
|
If `.agents/project/review-rules.md` exists, apply extra domain checks only; do not weaken shared hard rules.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{sharedSkillName}}
|
|
3
|
-
description:
|
|
3
|
+
description: Internal. Do not invoke. Step 2 of shared-review-and-submit. Not a user-facing generate or review entry.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Frontend Verification
|
|
7
8
|
|
|
9
|
+
Not a user-facing entry. Do not invoke this skill. `shared-review-and-submit` runs this as step 2.
|
|
10
|
+
|
|
8
11
|
This skill is fully shared. Read the current diff, related callers, and:
|
|
9
12
|
|
|
10
13
|
1. `.agents/skills/shared-project-conventions/references/review-checklist.md`
|
|
@@ -28,7 +31,7 @@ Choose by risk. Do not auto-fix to make a command pass.
|
|
|
28
31
|
git diff --check
|
|
29
32
|
pnpm exec prettier --check <changed-files>
|
|
30
33
|
pnpm exec eslint <changed-files>
|
|
31
|
-
pnpm
|
|
34
|
+
pnpm typecheck
|
|
32
35
|
pnpm lint
|
|
33
36
|
```
|
|
34
37
|
|