@mingfuyun/star-allinone 0.2.0 → 0.3.1

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.
Files changed (31) hide show
  1. package/README.md +17 -10
  2. package/examples/AGENTS.md +26 -0
  3. package/examples/projects/starlink-frontend.star-allinone.json +7 -0
  4. package/examples/projects/starscope-frontend.star-allinone.json +7 -0
  5. package/examples/skills/custom-domain-invariants/SKILL.md +16 -0
  6. package/package.json +5 -3
  7. package/scripts/cli.js +52 -13
  8. package/scripts/gen/fixtures/run.js +104 -0
  9. package/scripts/gen/fixtures/widgets.openapi.json +194 -0
  10. package/scripts/gen/names.js +117 -0
  11. package/scripts/gen/page.js +483 -0
  12. package/scripts/gen/project.js +154 -0
  13. package/scripts/gen/service.js +264 -0
  14. package/scripts/gen/spec.js +220 -0
  15. package/scripts/gen/ts.js +121 -0
  16. package/skills/README.md +45 -188
  17. package/skills/shared/api-to-service/SKILL.md +18 -10
  18. package/skills/shared/{api-mock/SKILL.md → api-to-service/references/mock.md} +3 -10
  19. package/skills/shared/design-to-page/SKILL.md +45 -6
  20. package/skills/shared/design-to-page/references/list-page-template.md +44 -0
  21. package/skills/shared/design-to-page/references/page-conventions.md +1 -1
  22. package/skills/shared/i-have-adhd/{SKILL.md → i-have-adhd.md} +0 -10
  23. package/skills/shared/project-conventions/references/architecture.md +3 -0
  24. package/skills/shared/publish-test/SKILL.md +4 -2
  25. package/skills/shared/review-and-submit/SKILL.md +8 -16
  26. package/skills/shared/{ai-review/SKILL.md → review-and-submit/references/ai-review.md} +4 -11
  27. package/skills/shared/{commit-current-changes/SKILL.md → review-and-submit/references/commit.md} +4 -12
  28. package/skills/shared/{impact-analysis/SKILL.md → review-and-submit/references/impact-analysis.md} +1 -10
  29. package/skills/shared/{verify/SKILL.md → review-and-submit/references/verify.md} +4 -11
  30. package/skills/shared/project-conventions/SKILL.md +0 -34
  31. /package/skills/shared/{api-mock → api-to-service}/references/mock-conventions.md +0 -0
@@ -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
+ ## Container 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.
@@ -75,7 +75,7 @@ Follow [overlays.md](overlays.md). Use `CustomDrawer`, `BaseModal`, and `HocModa
75
75
  - API-backed pages include types, service methods, aggregate exports, and page consumption in the same change.
76
76
  - Do not embed production fake data or invented response fields.
77
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`.
78
+ - Pair missing services with `.agents/skills/shared-api-to-service/SKILL.md`. Pair missing deterministic data with `.agents/skills/shared-api-to-service/references/mock.md`.
79
79
 
80
80
  ## Styling and fidelity
81
81
 
@@ -1,13 +1,3 @@
1
- ---
2
- name: {{sharedSkillName}}
3
- description: 'Shape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress tangents, give specific time estimates, make wins visible. Invoke with /i-have-adhd; stays on until "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
1
  # i-have-adhd
12
2
 
13
3
  The reader has ADHD. Output is not just brief. It is shaped so an ADHD brain can act on it.
@@ -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 frontend Git branch to the project's Yunxiao test pipeline only after explicit confirmation such as 确认推送流水线 or 发布测试环境. Never run the pipeline automatically after git push.
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.
@@ -58,4 +60,4 @@ The dashboard comment is `BUILD_REMARK` and contains branch, commit subject, and
58
60
 
59
61
  ## User-facing output
60
62
 
61
- Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
63
+ Read and apply `.agents/skills/shared-i-have-adhd/i-have-adhd.md` to every response this skill sends to the user.
@@ -1,10 +1,12 @@
1
1
  ---
2
2
  name: {{sharedSkillName}}
3
- description: Run the frontend pre-submit workflow: impact analysis, verification, then confirmation-gated commit review. Use when the user asks for the full submit flow or says 使用完整流程提交代码. Never stage, commit, or push before explicit confirmation.
3
+ description: User-facing. Pre-submit workflow: impact analysis, verify, then confirmation-gated commit. Use when the user wants to review, submit, or commit.
4
4
  ---
5
5
 
6
6
  # Review and Submit
7
7
 
8
+ User-facing entry for review, submit, and commit. Read the files under `references/` in order. Do not tell the user to invoke other review skills.
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.
@@ -15,7 +17,7 @@ Execute in this order.
15
17
 
16
18
  ### 1. Impact analysis
17
19
 
18
- Follow `.agents/skills/shared-impact-analysis/SKILL.md`. Output:
20
+ Follow [references/impact-analysis.md](references/impact-analysis.md). Output:
19
21
 
20
22
  - Change summary
21
23
  - Direct callers and affected pages
@@ -25,7 +27,7 @@ Follow `.agents/skills/shared-impact-analysis/SKILL.md`. Output:
25
27
 
26
28
  ### 2. Verification
27
29
 
28
- Follow `.agents/skills/shared-verify/SKILL.md`. Output:
30
+ Follow [references/verify.md](references/verify.md). Output:
29
31
 
30
32
  - P0/P1/P2 blockers
31
33
  - Completeness of route, permission, API, types, mock, and page states
@@ -33,11 +35,11 @@ Follow `.agents/skills/shared-verify/SKILL.md`. Output:
33
35
  - Prettier, TypeScript, lint, and build results
34
36
  - Uncovered risks
35
37
 
36
- If the current change introduced P0/P1 issues or validation failures, stop. Do not enter commit review.
38
+ Also apply [references/ai-review.md](references/ai-review.md). If the current change introduced P0/P1 issues or validation failures, stop. Do not enter commit review.
37
39
 
38
40
  ### 3. Commit review
39
41
 
40
- Follow `.agents/skills/shared-commit-current-changes/SKILL.md`. Output:
42
+ Follow [references/commit.md](references/commit.md). Output:
41
43
 
42
44
  - Findings sorted P0–P2
43
45
  - Optional improvements
@@ -67,16 +69,6 @@ If the user only says `确认` but the scope is unclear, do not commit; ask for
67
69
 
68
70
  If the user says `提交代码` before a review proposal exists, run the three steps above first. Do not skip review.
69
71
 
70
- ## Related skills
71
-
72
- | Skill | Purpose |
73
- | --- | --- |
74
- | `$shared-impact-analysis` | Read-only impact analysis |
75
- | `$shared-verify` | Convention and command verification |
76
- | `$shared-commit-current-changes` | Review plus confirmation-gated commit |
77
- | `$shared-ai-review` | Standalone review without commit |
78
- | `$shared-publish-test` | Publish to the test pipeline only after a separate `确认推送流水线`. Never run it automatically after git push. |
79
-
80
72
  ## User-facing output
81
73
 
82
- Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
74
+ Read and apply `.agents/skills/shared-i-have-adhd/i-have-adhd.md` to every response this skill sends to the user.
@@ -1,16 +1,13 @@
1
- ---
2
- name: {{sharedSkillName}}
3
- description: Review frontend changes for correctness, API and permission contracts, React lifecycle, performance, maintainability, security, accessibility, and test gaps. Use for a standalone review without commit. Do not modify files.
4
- ---
5
-
6
1
  # AI Code Review
7
2
 
8
- This skill is fully shared. Review the current diff plus relevant callers and types. Before reviewing, read:
3
+ Checklist used by `shared-review-and-submit`. Do not treat this file as a generate or submit entry.
4
+
5
+ Review the current diff plus relevant callers and types. Before reviewing, read:
9
6
 
10
7
  1. `.agents/skills/shared-project-conventions/references/review-checklist.md`
11
8
  2. `.agents/skills/shared-project-conventions/references/quality-checklist.md`
12
9
 
13
- Do not require a project-local review-rules file. If `.agents/project/review-rules.md` exists, apply extra domain checks only; do not weaken shared hard rules.
10
+ If `.agents/project/review-rules.md` exists, apply extra domain checks only; do not weaken shared hard rules.
14
11
 
15
12
  ## Required checks
16
13
 
@@ -27,7 +24,3 @@ Do not require a project-local review-rules file. If `.agents/project/review-rul
27
24
  Lead with findings ordered `[P0]`–`[P3]`, with file and line. Separate blocking issues from recommendations. Do not report style preferences as bugs.
28
25
 
29
26
  If none, write `No issues found.` Always include validation performed and gaps. Do not modify files unless the user explicitly asks for fixes.
30
-
31
- ## User-facing output
32
-
33
- Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
@@ -1,11 +1,6 @@
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
1
  # Commit Current Changes
7
2
 
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.
3
+ Step 3 of `shared-review-and-submit`. Review user-authorized working-tree changes, report findings and a commit proposal, and mutate Git only after explicit confirmation.
9
4
 
10
5
  ## Write-operation gate
11
6
 
@@ -29,8 +24,9 @@ Read:
29
24
  1. `.agents/skills/shared-project-conventions/references/review-checklist.md`
30
25
  2. `.agents/skills/shared-project-conventions/references/quality-checklist.md`
31
26
  3. `.agents/skills/shared-project-conventions/references/architecture.md`
27
+ 4. [ai-review.md](ai-review.md)
32
28
 
33
- This skill is fully shared. If `.agents/project/review-rules.md` exists, apply extra domain checks only; do not weaken shared hard rules.
29
+ If `.agents/project/review-rules.md` exists, apply extra domain checks only; do not weaken shared hard rules.
34
30
 
35
31
  Classify only concrete security, data-loss, runtime, contract, validation, performance, accessibility, or maintainability risks as P0–P2.
36
32
 
@@ -55,7 +51,7 @@ Lead with findings. Then present optional improvements, validation results, chan
55
51
  3. Commit without `--no-verify` unless the user explicitly authorizes it. Do not amend unless requested.
56
52
  4. Push to upstream, or `git push -u origin HEAD` when none exists. Never force-push.
57
53
  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.
54
+ 6. Stop. Do not run the test pipeline after git push.
59
55
 
60
56
  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
57
 
@@ -64,7 +60,3 @@ A confirmed commit or push does not authorize the test pipeline. If the user lat
64
60
  - Never expose credentials from diffs; stop if secrets are present.
65
61
  - Never use destructive Git commands to clean the working tree.
66
62
  - If push is rejected, report the reason and do not rewrite history without separate authorization.
67
-
68
- ## User-facing output
69
-
70
- Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
@@ -1,11 +1,6 @@
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
1
  # Impact Analysis
7
2
 
8
- This skill does not modify files.
3
+ Step 1 of `shared-review-and-submit`. Do not modify files.
9
4
 
10
5
  ## Workflow
11
6
 
@@ -28,7 +23,3 @@ Read `.agents/skills/shared-project-conventions/references/review-checklist.md`
28
23
  - Risks that cannot be confirmed statically, with why
29
24
 
30
25
  Use repository facts only. Do not invent backend behavior.
31
-
32
- ## User-facing output
33
-
34
- Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
@@ -1,11 +1,8 @@
1
- ---
2
- name: {{sharedSkillName}}
3
- description: Verify generated or manually changed frontend code against shared conventions, API contracts, permissions, async behavior, and validation commands. Use after API, mock, page, or refactor work. Do not generate business code.
4
- ---
5
-
6
1
  # Frontend Verification
7
2
 
8
- This skill is fully shared. Read the current diff, related callers, and:
3
+ Step 2 of `shared-review-and-submit`.
4
+
5
+ Read the current diff, related callers, and:
9
6
 
10
7
  1. `.agents/skills/shared-project-conventions/references/review-checklist.md`
11
8
  2. `.agents/skills/shared-project-conventions/references/architecture.md`
@@ -28,7 +25,7 @@ Choose by risk. Do not auto-fix to make a command pass.
28
25
  git diff --check
29
26
  pnpm exec prettier --check <changed-files>
30
27
  pnpm exec eslint <changed-files>
31
- pnpm exec tsc --noEmit
28
+ pnpm typecheck
32
29
  pnpm lint
33
30
  ```
34
31
 
@@ -42,7 +39,3 @@ Run the project's build script when routes, entry, or shared runtime change.
42
39
  4. Regression list: affected pages, suggested manual paths, uncovered risks.
43
40
 
44
41
  If there are no blockers, write `未发现阻断问题`. Do not report only that commands passed.
45
-
46
- ## User-facing output
47
-
48
- Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.
@@ -1,34 +0,0 @@
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.
31
-
32
- ## User-facing output
33
-
34
- Read and apply `.agents/skills/shared-i-have-adhd/SKILL.md` to every response this skill sends to the user.