@mingfuyun/star-allinone 0.1.9 → 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 +32 -3
- package/skills/shared/ai-review/SKILL.md +8 -1
- package/skills/shared/api-mock/SKILL.md +8 -1
- package/skills/shared/api-to-service/SKILL.md +20 -8
- package/skills/shared/commit-current-changes/SKILL.md +8 -1
- package/skills/shared/design-to-page/SKILL.md +9 -1
- package/skills/shared/i-have-adhd/SKILL.md +142 -0
- package/skills/shared/impact-analysis/SKILL.md +8 -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 +8 -1
- package/skills/shared/project-conventions/references/architecture.md +3 -0
- package/skills/shared/publish-test/SKILL.md +7 -1
- package/skills/shared/review-and-submit/SKILL.md +7 -1
- package/skills/shared/verify/SKILL.md +9 -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,12 +71,14 @@ 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/
|
|
71
78
|
├── impact-analysis/
|
|
72
79
|
├── ai-review/
|
|
73
80
|
├── commit-current-changes/
|
|
81
|
+
├── i-have-adhd/ # 同步为 shared-i-have-adhd;其他 shared skill 的用户输出格式
|
|
74
82
|
└── publish-test/ # 流水线 ID 从 .star-allinone.json 读取
|
|
75
83
|
```
|
|
76
84
|
|
|
@@ -172,7 +180,7 @@ git commit -m "feat(skill): 增加设备管理 skill"
|
|
|
172
180
|
|
|
173
181
|
不需要修改 `star-allinone`,也不需要重新发布 npm。
|
|
174
182
|
|
|
175
|
-
|
|
183
|
+
审查、提交、测试环境发布、单接口 Mock/Service、标准列表都走公共入口 skill。`custom-*` 只用于真正的业务特例。单接口生成禁止再做 custom;只有整份契约全量重建才允许留在 custom,并必须在 description 里写明「只用于全量」。度量类 custom 不得生成代码。
|
|
176
184
|
|
|
177
185
|
## 公共部分和业务定制组合
|
|
178
186
|
|
|
@@ -213,6 +221,7 @@ description: Generate StarScope device service code.
|
|
|
213
221
|
|
|
214
222
|
```text
|
|
215
223
|
starscope-frontend/
|
|
224
|
+
├── AGENTS.md
|
|
216
225
|
├── .star-allinone.json
|
|
217
226
|
└── .agents/
|
|
218
227
|
├── skills/
|
|
@@ -246,6 +255,24 @@ StarLink 使用:
|
|
|
246
255
|
|
|
247
256
|
可选字段 `sharedSkills` 用于只同步部分公共 skill;省略时同步 `skills/shared` 下的全部公共 skill。
|
|
248
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
|
+
|
|
249
276
|
## 公共规则写在哪里
|
|
250
277
|
|
|
251
278
|
| Skill | 规则位置 | 覆盖内容 |
|
|
@@ -253,6 +280,7 @@ StarLink 使用:
|
|
|
253
280
|
| `shared-api-to-service` | SKILL + `references/service-conventions.md`、`api-artifact-generation.md` | 指定 operation、`MFRequest` 映射、namespace 类型、snake_case、schema 闭包、禁止改 transport |
|
|
254
281
|
| `shared-api-mock` | SKILL + `references/mock-conventions.md` | 对话 JSON 默认、完整响应信封、分页/空列表/错误场景、禁止 handler 和随机数 |
|
|
255
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` |
|
|
256
284
|
| `shared-project-conventions` | SKILL + `references/architecture.md`、`review-checklist.md`、`quality-checklist.md` | 架构边界、质量禁令、审查清单;其他 skill 会引用这些文件 |
|
|
257
285
|
| `shared-verify` | SKILL | 成套产物检查、await/loading/弹层、验证命令和报告格式 |
|
|
258
286
|
| `shared-impact-analysis` | SKILL | 只读影响分类和回归路径 |
|
|
@@ -289,9 +317,10 @@ star-allinone 修改
|
|
|
289
317
|
最终结构和责任边界:
|
|
290
318
|
|
|
291
319
|
```text
|
|
320
|
+
AGENTS.md ← 常驻约定,不要加 .cursor/rules
|
|
292
321
|
.agents/skills/
|
|
293
|
-
├── shared-*
|
|
294
|
-
└── custom-*
|
|
322
|
+
├── shared-* ← npm 包同步,不能在业务项目直接维护
|
|
323
|
+
└── custom-* ← 业务项目自己维护
|
|
295
324
|
```
|
|
296
325
|
|
|
297
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`
|
|
@@ -27,3 +30,7 @@ Do not require a project-local review-rules file. If `.agents/project/review-rul
|
|
|
27
30
|
Lead with findings ordered `[P0]`–`[P3]`, with file and line. Separate blocking issues from recommendations. Do not report style preferences as bugs.
|
|
28
31
|
|
|
29
32
|
If none, write `No issues found.` Always include validation performed and gaps. Do not modify files unless the user explicitly asks for fixes.
|
|
33
|
+
|
|
34
|
+
## User-facing output
|
|
35
|
+
|
|
36
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|
|
@@ -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`.
|
|
@@ -21,3 +24,7 @@ If the service contract is missing, first follow `.agents/skills/shared-api-to-s
|
|
|
21
24
|
## Handoff
|
|
22
25
|
|
|
23
26
|
For every endpoint, report HTTP method, path, scenario label, and one strict parseable JSON block. If files were written, list the paths and confirm they parse as JSON.
|
|
27
|
+
|
|
28
|
+
## User-facing output
|
|
29
|
+
|
|
30
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|
|
@@ -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,11 @@ 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.
|
|
60
|
+
|
|
61
|
+
## User-facing output
|
|
62
|
+
|
|
63
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|
|
@@ -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
|
|
@@ -64,3 +67,7 @@ A confirmed commit or push does not authorize the test pipeline. If the user lat
|
|
|
64
67
|
- Never expose credentials from diffs; stop if secrets are present.
|
|
65
68
|
- Never use destructive Git commands to clean the working tree.
|
|
66
69
|
- If push is rejected, report the reason and do not rewrite history without separate authorization.
|
|
70
|
+
|
|
71
|
+
## User-facing output
|
|
72
|
+
|
|
73
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|
|
@@ -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.
|
|
@@ -46,3 +50,7 @@ pnpm exec tsc --noEmit
|
|
|
46
50
|
```
|
|
47
51
|
|
|
48
52
|
Run `pnpm lint` for broad or shared changes. Run the project's documented build command when routes, entry, or multiple pages change.
|
|
53
|
+
|
|
54
|
+
## User-facing output
|
|
55
|
+
|
|
56
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: {{sharedSkillName}}
|
|
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
|
+
disable-model-invocation: true
|
|
5
|
+
license: MIT
|
|
6
|
+
metadata:
|
|
7
|
+
tags: "ADHD, Output Style, Productivity, Formatting"
|
|
8
|
+
category: "productivity"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# i-have-adhd
|
|
12
|
+
|
|
13
|
+
The reader has ADHD. Output is not just brief. It is shaped so an ADHD brain can act on it.
|
|
14
|
+
|
|
15
|
+
## Persistence
|
|
16
|
+
|
|
17
|
+
These rules apply to every response for the rest of the session, not only this one. They do not expire after a few turns and they do not lapse when the topic changes. If you are unsure whether they still apply, they do.
|
|
18
|
+
|
|
19
|
+
Turn them off only when the reader says "stop adhd mode" or "normal mode". Confirm in one line, then return to your default style.
|
|
20
|
+
|
|
21
|
+
## What ADHD changes about reading
|
|
22
|
+
|
|
23
|
+
Five facts drive every rule below:
|
|
24
|
+
|
|
25
|
+
1. Working memory is small. Anything not on screen is forgotten. Do not ask the reader to "keep in mind X."
|
|
26
|
+
2. Knowing the answer is not doing the answer. The friction between "got it" and "done it" is where work dies.
|
|
27
|
+
3. Starting is the hardest step. The first action must be obvious, small, and doable now.
|
|
28
|
+
4. Time estimates feel uniform. "A bit of work" and "a few hours" register the same. Vague estimates fail.
|
|
29
|
+
5. Dopamine is scarce. Visible progress matters. Buried wins do not register.
|
|
30
|
+
|
|
31
|
+
## Rules
|
|
32
|
+
|
|
33
|
+
### 1. Lead with the next action
|
|
34
|
+
|
|
35
|
+
The first line is something the reader can do. Not context. Not a plan. The action.
|
|
36
|
+
|
|
37
|
+
Bad: "Let's think about this. Your auth flow has a few moving pieces..."
|
|
38
|
+
Good: "Run `npm install jsonwebtoken`, then edit `src/auth.ts:42`."
|
|
39
|
+
|
|
40
|
+
If the answer is a command, path, or snippet, it goes first. Prose comes after, if at all.
|
|
41
|
+
|
|
42
|
+
### 2. Number multi-step tasks
|
|
43
|
+
|
|
44
|
+
If the work takes more than one step, write a numbered list. Each step is one bounded action. No step contains "and then" twice.
|
|
45
|
+
|
|
46
|
+
Use the fewest steps that still work. Cut any step the reader does not need, and fold trivial steps into the one before. A short path finished beats a complete path abandoned.
|
|
47
|
+
|
|
48
|
+
Bad: "First open the file, find the function, swap it out, then run the tests."
|
|
49
|
+
|
|
50
|
+
Good:
|
|
51
|
+
```
|
|
52
|
+
1. Open `src/auth.ts`
|
|
53
|
+
2. Replace `verifyToken` (lines 42 to 58) with the snippet below
|
|
54
|
+
3. Run `npm test -- auth.spec.ts`
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 3. End with one concrete next action
|
|
58
|
+
|
|
59
|
+
If anything is left open, name ONE thing the reader can do in under two minutes. Even "open the file" counts.
|
|
60
|
+
|
|
61
|
+
Bad: "Hope that helps. Let me know if you want to dig deeper."
|
|
62
|
+
Good: "Next: run `npm test` and paste the first failing line."
|
|
63
|
+
|
|
64
|
+
### 4. Suppress tangents
|
|
65
|
+
|
|
66
|
+
If a second issue exists, finish the first, then offer the second as a separate question.
|
|
67
|
+
|
|
68
|
+
Bad: "Here's the fix. By the way, your dependency is also stale, and your README is out of date, and..."
|
|
69
|
+
Good: "Here's the fix. Separately: there is also a stale dependency. Want me to handle that next?"
|
|
70
|
+
|
|
71
|
+
A question that comes up mid-work is not a tangent: answer it yourself if you can and fold the result in. If it still needs the reader, surface it once, at the end.
|
|
72
|
+
|
|
73
|
+
### 5. Restate state every turn
|
|
74
|
+
|
|
75
|
+
The reader cannot hold "we are on step 3 of 5" between messages. Restate it.
|
|
76
|
+
|
|
77
|
+
Bad: "Done. Ready for the next part?"
|
|
78
|
+
Good: "Step 3 of 5 done: schema updated. Next: backfill the new column. Run the script?"
|
|
79
|
+
|
|
80
|
+
If the harness has a task or plan tool, use it for multi-step work: one item per step, one in progress at a time. The checklist does the restating; do not also narrate the full plan as prose.
|
|
81
|
+
|
|
82
|
+
### 6. Give specific time estimates
|
|
83
|
+
|
|
84
|
+
Vague estimates fail. Ballpark in concrete units.
|
|
85
|
+
|
|
86
|
+
Bad: "This will take some work."
|
|
87
|
+
Good: "About 15 minutes if tests already cover this. An afternoon if not."
|
|
88
|
+
|
|
89
|
+
### 7. Make completed work visible
|
|
90
|
+
|
|
91
|
+
Show what now works, in concrete terms. Do not bury wins in a recap.
|
|
92
|
+
|
|
93
|
+
Bad: "I've made some changes to the auth flow. Among other things..."
|
|
94
|
+
Good: "Login now works with magic links. Try: `npm run dev`, open `/login`."
|
|
95
|
+
|
|
96
|
+
### 8. Matter-of-fact tone for errors
|
|
97
|
+
|
|
98
|
+
Never use "Uh oh," "Oh no," or "There seems to be a problem." State cause and fix.
|
|
99
|
+
|
|
100
|
+
Bad: "Uh oh, the test is failing. There seems to be an issue..."
|
|
101
|
+
Good: "Test fails at `auth.spec.ts:42`: expected 200, got 401. Cause: missing auth header. Fix: add `Authorization: Bearer ${token}` to the request."
|
|
102
|
+
|
|
103
|
+
### 9. Cap lists to 5 items
|
|
104
|
+
|
|
105
|
+
For long lists in the final response, group related items and rank the most relevant first. Keep the visible working set small: aim for no more than five items per group. When more items are relevant, retain them internally without discarding them. Display them only when the user asks or when they become the next items to address.
|
|
106
|
+
|
|
107
|
+
Never omit relevant items when completeness matters. This rule shapes presentation only; it must not limit analysis, search, tool results, candidate generation, or retained information.
|
|
108
|
+
|
|
109
|
+
### 10. No preamble, no recap, no closing pleasantries
|
|
110
|
+
|
|
111
|
+
Forbidden openers: "Great question," "Let me...", "I'll...", "Sure!", "Looking at your...", "To answer your question..."
|
|
112
|
+
|
|
113
|
+
Forbidden recaps after a completed task: "I've now done X, Y, and Z, which means..."
|
|
114
|
+
|
|
115
|
+
Forbidden closers: "Let me know if you need anything else," "Hope this helps," "Happy to clarify," "Feel free to ask."
|
|
116
|
+
|
|
117
|
+
Start with the answer. End when the answer is done.
|
|
118
|
+
|
|
119
|
+
## When to break the rules
|
|
120
|
+
|
|
121
|
+
Override the defaults when:
|
|
122
|
+
|
|
123
|
+
1. User asks to "explain" or "walk me through." Explain fully. Still no preamble, still no closer, but the body runs as long as the topic needs. Add headers so the reader can skim back.
|
|
124
|
+
2. Destructive action ahead (`rm -rf`, force push, schema migration, dropping a table). Confirm before acting. Safety wins over brevity.
|
|
125
|
+
3. Debug spiral. If the last three turns have been "still broken," stop iterating on code. Name the assumption that might be wrong. Ask one diagnostic question.
|
|
126
|
+
4. Real ambiguity in the request. One short clarifying question beats guessing and rewriting.
|
|
127
|
+
5. A rule fights the task. When a rule would delete the answer itself, the task wins; the shape stays. Example: "what are my options" gets 2 to 4 ranked options with one-line trade-offs, recommendation first, not one path. The options are the answer.
|
|
128
|
+
6. A rule fights the harness. Inside an agent harness, the system prompt outranks this skill: announce a tool call when the harness requires it, do the work instead of asking "want me to," point time estimates at whoever executes the steps. Same principle as 5: the constraint wins, the shape stays.
|
|
129
|
+
|
|
130
|
+
## Pre-send check
|
|
131
|
+
|
|
132
|
+
Before sending, delete:
|
|
133
|
+
|
|
134
|
+
1. The first sentence if it announces what you are about to do.
|
|
135
|
+
2. The last sentence if it asks "anything else?" or recaps what just happened.
|
|
136
|
+
3. Any "by the way" sidebar.
|
|
137
|
+
4. Any hedging adverb adding no information ("perhaps," "might," "could possibly"). Keep a hedge that carries real uncertainty; deleting it manufactures confidence.
|
|
138
|
+
5. Any idiom or figurative phrase ("circle back," "get the ball rolling," "on the same page"). Replace with the literal action.
|
|
139
|
+
|
|
140
|
+
Then verify: if the reader reads only the first line and the last line, do they know (a) what to do next, and (b) what just happened?
|
|
141
|
+
|
|
142
|
+
If yes, send.
|
|
@@ -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
|
|
@@ -28,3 +31,7 @@ Read `.agents/skills/shared-project-conventions/references/review-checklist.md`
|
|
|
28
31
|
- Risks that cannot be confirmed statically, with why
|
|
29
32
|
|
|
30
33
|
Use repository facts only. Do not invent backend behavior.
|
|
34
|
+
|
|
35
|
+
## User-facing output
|
|
36
|
+
|
|
37
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|
|
@@ -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:
|
|
@@ -28,3 +31,7 @@ Shared rules are complete for review, commit, mock, and service generation. If `
|
|
|
28
31
|
## Completion
|
|
29
32
|
|
|
30
33
|
Report changed files, API operations used, states covered, validation commands and results, and remaining gaps.
|
|
34
|
+
|
|
35
|
+
## User-facing output
|
|
36
|
+
|
|
37
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|
|
@@ -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.
|
|
@@ -55,3 +57,7 @@ If Yunxiao selected a different branch or commit, the script stops the run. That
|
|
|
55
57
|
A missing current-commit field is not a failure. `commit_verification=unavailable` is acceptable when Yunxiao has not yet returned a commit.
|
|
56
58
|
|
|
57
59
|
The dashboard comment is `BUILD_REMARK` and contains branch, commit subject, and `来源: Codex`. A missing top-level `comment` field is not a publication failure.
|
|
60
|
+
|
|
61
|
+
## User-facing output
|
|
62
|
+
|
|
63
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|
|
@@ -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.
|
|
@@ -76,3 +78,7 @@ If the user says `提交代码` before a review proposal exists, run the three s
|
|
|
76
78
|
| `$shared-commit-current-changes` | Review plus confirmation-gated commit |
|
|
77
79
|
| `$shared-ai-review` | Standalone review without commit |
|
|
78
80
|
| `$shared-publish-test` | Publish to the test pipeline only after a separate `确认推送流水线`. Never run it automatically after git push. |
|
|
81
|
+
|
|
82
|
+
## User-facing output
|
|
83
|
+
|
|
84
|
+
Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
|