@ysk-kit/cli 1.4.0 → 1.5.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.
- package/dist/doctor.js +3 -3
- package/package.json +4 -4
- package/templates/agent/nested/clients.md +1 -1
- package/templates/agent/rules/tests.mdc +1 -1
- package/templates/agent/rules/ui.mdc +1 -1
- package/templates/agent/skills/debug-issue/SKILL.md +2 -2
- package/templates/agent/skills/layout-system/SKILL.md +19 -0
- package/templates/agent/skills/security-review/SKILL.md +1 -1
- package/templates/agent/skills/test-plan/SKILL.md +3 -3
- package/templates/agent/skills/ui-design/SKILL.md +1 -1
- package/templates/agent/skills/ui-review/SKILL.md +1 -1
- package/templates/agent/skills/verify-change/SKILL.md +2 -2
- package/templates/agent/skills/write-tests/SKILL.md +2 -2
package/dist/doctor.js
CHANGED
|
@@ -235,13 +235,13 @@ const enginesCheck = (productRoot, nodeVersion, pnpmVersion) => {
|
|
|
235
235
|
if (problems.length > 0) {
|
|
236
236
|
const message = [...problems, ...warnings].join('; ');
|
|
237
237
|
return check('engines', 'error', message, pinned
|
|
238
|
-
? `Install Node
|
|
239
|
-
: 'Install Node
|
|
238
|
+
? `Install Node 26 and run \`corepack enable && corepack prepare pnpm@${pinned} --activate\`.`
|
|
239
|
+
: 'Install Node 26 and pnpm 12 (`corepack enable && corepack prepare pnpm@12 --activate`).');
|
|
240
240
|
}
|
|
241
241
|
if (warnings.length > 0) {
|
|
242
242
|
return check('engines', 'warn', warnings.join('; '), pinned
|
|
243
243
|
? `Run \`corepack prepare pnpm@${pinned} --activate\` so the packageManager pin matches.`
|
|
244
|
-
: 'Add engines.node >=
|
|
244
|
+
: 'Add engines.node >=26.0.0 and engines.pnpm >=12.0.0 to package.json.');
|
|
245
245
|
}
|
|
246
246
|
const nodeMsg = nodeRange ? `Node ${nodeVersion} satisfies ${nodeRange}` : `Node ${nodeVersion}`;
|
|
247
247
|
const pnpmMsg = pnpmVersion === null
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ysk-kit/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ysk-kit": "./dist/index.js",
|
|
7
7
|
"yskk": "./dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@ysk-kit/api-http": "1.
|
|
11
|
-
"@ysk-kit/contracts": "1.
|
|
10
|
+
"@ysk-kit/api-http": "1.5.1",
|
|
11
|
+
"@ysk-kit/contracts": "1.5.1",
|
|
12
12
|
"zod": "^4.6.5"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/node": "^
|
|
15
|
+
"@types/node": "^26.6.5",
|
|
16
16
|
"tsx": "^4.23.15",
|
|
17
17
|
"typescript": "^6.0.3",
|
|
18
18
|
"vitest": "^5.0.3"
|
|
@@ -5,4 +5,4 @@ Local notes for this client app. Root law: `AGENTS.md`. The same rule applies to
|
|
|
5
5
|
- Call the API only through `@ysk-kit/sdk` (React Query via `@ysk-kit/web-sdk`).
|
|
6
6
|
- No raw `fetch` to kit paths. No `@prisma/client`, `@ysk-kit/db-prisma`, or `apps/api/src/generated`.
|
|
7
7
|
- Do not import `@ysk-kit/observability`, Express, Fastify, jobs, mail, push, or the AWS SDK.
|
|
8
|
-
- Screens: `docs/skills/ui-design.md`. Not done until `docs/skills/ui-review.md` is green.
|
|
8
|
+
- Screens: complex structure via `docs/skills/layout-system.md`, then `docs/skills/ui-design.md`. Not done until `docs/skills/ui-review.md` is green.
|
|
@@ -6,4 +6,4 @@ alwaysApply: false
|
|
|
6
6
|
|
|
7
7
|
Local reminder. Law: `AGENTS.md`.
|
|
8
8
|
|
|
9
|
-
Plan with `docs/skills/test-plan.md`, then write with `docs/skills/write-tests.md
|
|
9
|
+
Plan with `docs/skills/test-plan.md`, then write with `docs/skills/write-tests.md` (one red `it()` per feature slice). Red CI or a user report: `docs/skills/debug-issue.md` (hypotheses first). In-memory ports only. Assert `{ ok, data }` / `{ ok, error }`. Do not start Redis, Stripe, Twilio, FCM, Jaeger, or Grafana.
|
|
@@ -6,4 +6,4 @@ alwaysApply: false
|
|
|
6
6
|
|
|
7
7
|
Local reminder. Law: `AGENTS.md`.
|
|
8
8
|
|
|
9
|
-
Reuse `@ysk-kit/ui` and the zinc theme (`docs/skills/ui-design.md`). Do not invent a parallel design system. A screen is not done until `docs/skills/ui-review.md` is green. No raw `fetch`.
|
|
9
|
+
Reuse `@ysk-kit/ui` and the zinc theme (`docs/skills/ui-design.md`). Complex structure: `docs/skills/layout-system.md` first. Do not invent a parallel design system. A screen is not done until `docs/skills/ui-review.md` is green. No raw `fetch`.
|
|
@@ -11,8 +11,8 @@ description: >
|
|
|
11
11
|
Read `docs/skills/debug-issue.md`. Law: `AGENTS.md`.
|
|
12
12
|
|
|
13
13
|
1. Write or isolate a red test first (memory-port, then Express+Fastify HTTP).
|
|
14
|
-
2.
|
|
15
|
-
3. Climb to SDK / e2e / git bisect only if the lower loop cannot see it.
|
|
14
|
+
2. Fill a 3–5 row hypotheses table; falsify one row at a time before changing code.
|
|
15
|
+
3. Climb to SDK / e2e / git bisect only if the lower loop cannot see it. Keep the regression test.
|
|
16
16
|
Gotcha: do not log OTP/sk_/whsec_. Do not set RATE_LIMIT_MAX=0 in production.
|
|
17
17
|
Verify: the named Vitest is green, then the five verify commands.
|
|
18
18
|
Full steps: `docs/skills/debug-issue.md`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout-system
|
|
3
|
+
description: >
|
|
4
|
+
Design predictable layout inside existing zinc + @ysk-kit/ui: ASCII wireframe,
|
|
5
|
+
AppShell, grid, alignment, 375/768/1280, zh-HK width. Use when adding a shell,
|
|
6
|
+
dashboard columns, nav/sidebar, list+detail, or multi-column form.
|
|
7
|
+
中文:版面系統、殼、分欄、閱讀順序、響應式結構。
|
|
8
|
+
Do not use to change the palette, invent a second component library, or for
|
|
9
|
+
API-only work (use ui-design for components; ui-review when finishing).
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Read `docs/skills/layout-system.md`. Law: `AGENTS.md`.
|
|
13
|
+
|
|
14
|
+
1. ASCII wireframe (desktop + 375): grouping and reading order.
|
|
15
|
+
2. AppShell + PageHeader; sidebar vs top-nav; 1-col max-w-4xl or md:grid-cols-2.
|
|
16
|
+
3. Rhythm space-y-4|6; numbers right, text left; zh-HK 1.5× width; then ui-design.
|
|
17
|
+
Gotcha: no hero/gradient, no card-in-card, no DOM @ysk-kit/ui on mobile.
|
|
18
|
+
Verify: 375/768/1280 clean, then ui-review visual+responsive.
|
|
19
|
+
Full steps: `docs/skills/layout-system.md`.
|
|
@@ -15,6 +15,6 @@ Read `docs/skills/security-review.md`. Law: `AGENTS.md`.
|
|
|
15
15
|
|
|
16
16
|
1. Diff is the report scope; the repo is research. HIGH confidence only.
|
|
17
17
|
2. AuthZ in `application/` (membership + role). Cross-tenant memory tests.
|
|
18
|
-
3. No secrets in logs. Webhook signatures. Client token stores.
|
|
18
|
+
3. No secrets in logs. Webhook signatures. Client token stores. Supply chain: ask before new runtime deps; do not `npx skills add` unknown sources.
|
|
19
19
|
4. Threat-model sub-mode only when the user asks or a new trust boundary lands.
|
|
20
20
|
Full steps: `docs/skills/security-review.md`.
|
|
@@ -12,8 +12,8 @@ description: >
|
|
|
12
12
|
Read `docs/skills/test-plan.md`. Law: `AGENTS.md`.
|
|
13
13
|
|
|
14
14
|
1. Restate the change. Rank data loss, auth, money, tenancy, secrets first.
|
|
15
|
-
2. Map each risk to a layer and file. Write given/when/then cases.
|
|
16
|
-
3. Name in-memory fixtures and explicit out of scope. Then write-tests.
|
|
17
|
-
Gotcha: do not start Redis or Stripe to plan tests. E2E stays thin.
|
|
15
|
+
2. Map each risk to a layer and file (those rows are TDD seams). Write given/when/then cases.
|
|
16
|
+
3. Name in-memory fixtures and explicit out of scope. Mark the first red `it()`. Then write-tests.
|
|
17
|
+
Gotcha: do not start Redis or Stripe to plan tests. E2E stays thin. Do not dump every test before code.
|
|
18
18
|
Verify: every case has layer + file; out of scope is written.
|
|
19
19
|
Full steps: `docs/skills/test-plan.md`.
|
|
@@ -13,6 +13,6 @@ Read `docs/skills/ui-design.md`. Law: `AGENTS.md`.
|
|
|
13
13
|
1. Reuse `@ysk-kit/ui` zinc tokens (`rounded-md`, `h-9`). No new palette.
|
|
14
14
|
2. Loading / empty / error / disabled. Forms: FormField + contracts Zod.
|
|
15
15
|
3. WCAG 2.2 AA, `zh-HK` length, no raw fetch. Then ui-review.
|
|
16
|
-
Gotcha:
|
|
16
|
+
Gotcha: complex layout → layout-system first. No purple gradients, no placeholder-as-label, no `div` buttons.
|
|
17
17
|
Verify: ui-review checklist, then verify-change.
|
|
18
18
|
Full steps: `docs/skills/ui-design.md`.
|
|
@@ -13,6 +13,6 @@ Read `docs/skills/ui-review.md`. Law: `AGENTS.md`.
|
|
|
13
13
|
1. Walk visual, a11y, states, copy. Fail if any required box is unchecked.
|
|
14
14
|
2. Keyboard-only on web/admin/desktop. Check 375 / 768 / 1280.
|
|
15
15
|
3. Exercise the flow (click, type, submit). Screenshot is not proof.
|
|
16
|
-
Gotcha:
|
|
16
|
+
Gotcha: reading order / optical alignment; complex layout must have used layout-system. Do not add axe or screenshot diffs to CI unless asked.
|
|
17
17
|
Verify: checklist + `pnpm e2e` when login/shell changed.
|
|
18
18
|
Full steps: `docs/skills/ui-review.md`.
|
|
@@ -11,7 +11,7 @@ Read `docs/skills/verify-change.md`. Law: `AGENTS.md`.
|
|
|
11
11
|
|
|
12
12
|
1. Run `pnpm layers && pnpm typecheck && pnpm test && pnpm gen:openapi && pnpm ysk-kit check agent`.
|
|
13
13
|
2. `git diff --exit-code docs/openapi.yaml` (commit YAML if HTTP changed).
|
|
14
|
-
3. Conditional: lint, check:links, zh pair, lockstep changeset, e2e.
|
|
15
|
-
Gotcha: never claim done without
|
|
14
|
+
3. Conditional: lint, check:links, zh pair, lockstep changeset, e2e. Behaviour change: at least one new/updated Vitest.
|
|
15
|
+
Gotcha: never claim done without fresh successful output of the five commands in this turn.
|
|
16
16
|
Verify: emit the verification report in the skill output format.
|
|
17
17
|
Full steps: `docs/skills/verify-change.md`.
|
|
@@ -12,7 +12,7 @@ Read `docs/skills/write-tests.md`. Law: `AGENTS.md`.
|
|
|
12
12
|
|
|
13
13
|
1. Put the case at the lowest layer that can fail it. Extend the generator test file.
|
|
14
14
|
2. given/when/then; envelope `ok` / `error.code`; other-tenant negative when owned.
|
|
15
|
-
3.
|
|
16
|
-
Gotcha: in-memory ports only. Never mock Prisma from a client.
|
|
15
|
+
3. Features: one red `it()` per TDD slice, then minimum code. Bugs: red regression first. Express and Fastify for HTTP.
|
|
16
|
+
Gotcha: in-memory ports only. Never mock Prisma from a client. Do not write all tests then all code.
|
|
17
17
|
Verify: `pnpm --filter @ysk-kit/<pkg> exec vitest run <file>`
|
|
18
18
|
Full steps: `docs/skills/write-tests.md`.
|