persagy-vant 0.0.31 → 0.0.32

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 CHANGED
@@ -4,25 +4,24 @@ Persagy 移动端 Vue 3 组件库。产品经理可通过 AI 编程工具复用
4
4
 
5
5
  ## 产品经理使用方式
6
6
 
7
- 只使用这一条流程:在**自己的产品项目**安装组件库,再让 AI 读取包内的 Skill。无需下载或复制本仓库。
7
+ 只使用这一条流程:在**自己的产品项目**安装组件库、初始化一次 Codex Skill,然后直接调用 `$use-persagy-vant`。无需下载或复制本仓库。
8
8
 
9
9
  ### 1. 安装组件库
10
10
 
11
11
  ```bash
12
12
  pnpm add persagy-vant
13
+ pnpm exec persagy-vant init
13
14
  ```
14
15
 
15
- ### 2. 每次新开 AI 会话先发送统一指令
16
+ 初始化会在项目中创建 `.agents/skills/use-persagy-vant/SKILL.md`。它只引用 npm 包内的 Skill 内容,因此不会复制规范或造成版本分叉。
16
17
 
17
- ```text
18
- 请先读取并严格执行 node_modules/persagy-vant/skills/use-persagy-vant/SKILL.md。
18
+ ### 2. 直接在 Codex 中调用
19
19
 
20
- 本项目所有移动端 UI 和业务选择能力必须优先复用 persagy-vant;
21
- 不要自行实现组件库已有的组件、交互或样式。
22
- 实现前先阅读所用组件在 node_modules/persagy-vant/es/<组件名>/README.zh-CN.md 中的 API 和示例。
20
+ ```text
21
+ $use-persagy-vant 根据当前 PRD 实现移动端页面
23
22
  ```
24
23
 
25
- 这套方式兼容 Codex、Cursor、Claude Code、Windsurf、Copilot 等可读取项目文件的 AI 编程工具。
24
+ Skill 会自动读取 npm 包内的复用规则、组件目录、设计交互规范与组件 API 文档。
26
25
 
27
26
  ### 3. 描述本次任务
28
27
 
@@ -35,10 +34,10 @@ pnpm add persagy-vant
35
34
  组件库发布新版本后,在产品项目根目录执行:
36
35
 
37
36
  ```bash
38
- pnpm up persagy-vant
37
+ pnpm up persagy-vant@latest
39
38
  ```
40
39
 
41
- 然后在下一次 AI 会话重新发送“统一指令”。组件、组件文档和 Skill 会随 npm 包一起更新。
40
+ 组件、组件文档和 Skill 会随 npm 包一起更新;已有的 `.agents` 入口会自动读取新版内容,无需再次初始化。仅当维护者通知入口机制有变时,才执行 `pnpm exec persagy-vant init --force`。
42
41
 
43
42
  完整的可转发说明见:[产品经理 AI 开发使用说明](./docs/markdown/product-manager-guide.zh-CN.md)。
44
43
 
@@ -47,8 +46,8 @@ pnpm up persagy-vant
47
46
  ```text
48
47
  src/ 组件源码、单组件示例、测试与中英文 API 文档
49
48
  docs/ 组件站点与设计文档
50
- skills/ 随 npm 包分发的 AI Skill
51
- scripts/ 构建辅助脚本
49
+ skills/ 随 npm 包分发的 AI Skill 正文与参考资料
50
+ bin/ 初始化项目级 Codex Skill 的命令
52
51
  ```
53
52
 
54
53
  ## 开发
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
4
+ import { dirname, relative, resolve } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
8
+ const skillSource = resolve(packageRoot, 'skills/use-persagy-vant/SKILL.md');
9
+ const [command, ...options] = process.argv.slice(2);
10
+ const force = options.includes('--force');
11
+
12
+ const usage = () => {
13
+ console.log(`Usage:
14
+ pnpm exec persagy-vant init [--force]
15
+
16
+ Creates a project-level Codex Skill entry at:
17
+ .agents/skills/use-persagy-vant/SKILL.md
18
+
19
+ After setup, use in Codex:
20
+ $use-persagy-vant <your task>`);
21
+ };
22
+
23
+ if (!command || command === '--help' || command === '-h') {
24
+ usage();
25
+ process.exit(command ? 0 : 1);
26
+ }
27
+
28
+ if (command !== 'init') {
29
+ console.error(`Unknown command: ${command}`);
30
+ usage();
31
+ process.exit(1);
32
+ }
33
+
34
+ if (!existsSync(skillSource)) {
35
+ console.error('Persagy Vant Skill source is missing. Reinstall persagy-vant and try again.');
36
+ process.exit(1);
37
+ }
38
+
39
+ const projectRoot = process.cwd();
40
+ const target = resolve(projectRoot, '.agents/skills/use-persagy-vant/SKILL.md');
41
+
42
+ if (existsSync(target) && !force) {
43
+ console.log(`Skill entry already exists: ${relative(projectRoot, target)}`);
44
+ console.log('Use --force only if you need to recreate the entry.');
45
+ process.exit(0);
46
+ }
47
+
48
+ const entry = `---
49
+ name: use-persagy-vant
50
+ description: 使用 Persagy Vant 为 Vue 3 移动端业务页面规划、实现、改造或验收 UI 时使用。适用于需要强制复用 Persagy 基础与业务组件、统一交互和视觉的任务。
51
+ ---
52
+
53
+ 读取并严格执行 \`node_modules/persagy-vant/skills/use-persagy-vant/SKILL.md\` 及其 \`references/\` 资料。
54
+
55
+ 当前项目的移动端 UI 与业务组件必须优先复用 \`persagy-vant\`;不得重写组件库已有的组件、交互或样式。
56
+ `;
57
+
58
+ mkdirSync(dirname(target), { recursive: true });
59
+ writeFileSync(target, entry, 'utf8');
60
+
61
+ console.log(`Created Codex Skill entry: ${relative(projectRoot, target)}`);
62
+ console.log('Now use in Codex: $use-persagy-vant <your task>');
63
+ console.log('After upgrading persagy-vant, this entry automatically reads the new packaged Skill.');
package/es/index.d.ts CHANGED
@@ -116,4 +116,4 @@ declare namespace _default {
116
116
  }
117
117
  export default _default;
118
118
  export function install(app: any): void;
119
- export const version: "0.0.31";
119
+ export const version: "0.0.32";
package/es/index.mjs CHANGED
@@ -109,7 +109,7 @@ import { Uploader } from "./uploader/index.mjs";
109
109
  import { VideoPreview } from "./video-preview/index.mjs";
110
110
  import { WorkOrderCard } from "./work-order-card/index.mjs";
111
111
  import { WorkOrderFilter } from "./work-order-filter/index.mjs";
112
- const version = "0.0.31";
112
+ const version = "0.0.32";
113
113
  function install(app) {
114
114
  const components = [
115
115
  ActionBar,
package/lib/index.d.ts CHANGED
@@ -116,4 +116,4 @@ declare namespace _default {
116
116
  }
117
117
  export default _default;
118
118
  export function install(app: any): void;
119
- export const version: "0.0.31";
119
+ export const version: "0.0.32";
package/lib/index.js CHANGED
@@ -246,7 +246,7 @@ __reExport(stdin_exports, require("./uploader"), module.exports);
246
246
  __reExport(stdin_exports, require("./video-preview"), module.exports);
247
247
  __reExport(stdin_exports, require("./work-order-card"), module.exports);
248
248
  __reExport(stdin_exports, require("./work-order-filter"), module.exports);
249
- const version = "0.0.31";
249
+ const version = "0.0.32";
250
250
  function install(app) {
251
251
  const components = [
252
252
  import_action_bar.ActionBar,
package/lib/vant.cjs.js CHANGED
@@ -20214,7 +20214,7 @@ const Lazyload = {
20214
20214
  });
20215
20215
  }
20216
20216
  };
20217
- const version = "0.0.31";
20217
+ const version = "0.0.32";
20218
20218
  function install(app) {
20219
20219
  const components = [
20220
20220
  ActionBar,
package/lib/vant.es.js CHANGED
@@ -20212,7 +20212,7 @@ const Lazyload = {
20212
20212
  });
20213
20213
  }
20214
20214
  };
20215
- const version = "0.0.31";
20215
+ const version = "0.0.32";
20216
20216
  function install(app) {
20217
20217
  const components = [
20218
20218
  ActionBar,
package/lib/vant.js CHANGED
@@ -23801,7 +23801,7 @@
23801
23801
  });
23802
23802
  }
23803
23803
  };
23804
- const version = "0.0.31";
23804
+ const version = "0.0.32";
23805
23805
  function install(app) {
23806
23806
  const components = [
23807
23807
  ActionBar,