@quicktvui/ai 1.0.3 → 1.0.4

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
@@ -11,7 +11,7 @@ QuickTVUI 官方提供的 AI 辅助开发规范包。
11
11
  - `.clinerules` (供 Cline/Roo-Code 使用)
12
12
  - `.github/copilot-instructions.md` (供 GitHub Copilot 使用)
13
13
  - `GEMINI.md` / `CLAUDE.md` / `AGENTS.md` (供其他模型使用)
14
- - `.docs/` (本地轻量级 QuickTVUI 知识库)
14
+ - `node_modules/@quicktvui/ai/rules/.docs/` (本地轻量级 QuickTVUI 知识库)
15
15
 
16
16
  这些规则会强制 AI:
17
17
  1. **停止捏造标签**(如禁止使用 `qt-web-view`,强制使用 `qt-web`)。
@@ -33,4 +33,4 @@ yarn add @quicktvui/ai --dev
33
33
 
34
34
  ## 验证
35
35
 
36
- 安装完毕后,请检查你的项目根目录是否多出了 `.cursorrules` 等文件以及 `.docs` 目录。如果有,说明注入成功,尽情享受不踩坑的 AI 编程体验吧!
36
+ 安装完毕后,请检查你的项目根目录是否多出了 `.cursorrules` 等文件。如果有,说明注入成功,尽情享受不踩坑的 AI 编程体验吧!(注:`.docs` 文档库现在直接引用 `node_modules` 路径,不再复制到根目录)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quicktvui/ai",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "QuickTVUI AI 开发规范与脚手架注入工具",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/postinstall.js CHANGED
@@ -41,7 +41,7 @@ function copyDirectorySync(src, dest) {
41
41
  }
42
42
 
43
43
  try {
44
- const rootItems = fs.readdirSync(rulesDir);
44
+ const rootItems = fs.readdirSync(rulesDir).filter((item) => item !== ".docs");
45
45
  let backupNeeded = false;
46
46
 
47
47
  // 1. 检查并备份现有配置
@@ -69,7 +69,15 @@ try {
69
69
  }
70
70
 
71
71
  // 2. 注入新规则
72
- copyDirectorySync(rulesDir, projectRoot);
72
+ rootItems.forEach((item) => {
73
+ const srcPath = path.join(rulesDir, item);
74
+ const destPath = path.join(projectRoot, item);
75
+ if (fs.lstatSync(srcPath).isDirectory()) {
76
+ copyDirectorySync(srcPath, destPath);
77
+ } else {
78
+ fs.copyFileSync(srcPath, destPath);
79
+ }
80
+ });
73
81
  console.log("🎉 [@quicktvui/ai] AI 规范注入成功!");
74
82
 
75
83
  // 3. 更新 .gitignore
package/rules/.clinerules CHANGED
@@ -6,14 +6,14 @@
6
6
 
7
7
  **AI MUST refer to the official documentation and source code below BEFORE generating any code. NEVER hallucinate component names, attribute names, or APIs. These are the ONLY authorities.**
8
8
 
9
- 1. **Local Documentation (PRIMARY)**: The `.docs/` folder in the project root. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `.docs/` directory before generating code.**
9
+ 1. **Local Documentation (PRIMARY)**: The `node_modules/@quicktvui/ai/rules/.docs/` folder. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `node_modules/@quicktvui/ai/rules/.docs/` directory before generating code.**
10
10
  2. **Official Docs**: https://quicktvui.com
11
11
  3. **Core Library Samples**: https://github.com/quicktvui/quicktvui.git
12
12
  4. **Cross-platform Framework Samples**: https://github.com/quicktvui/es-vue3.git
13
13
  5. **Best Practice App**: https://github.com/quicktvui/hellotv.git
14
14
 
15
15
  **STRICT RULES:**
16
- - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
16
+ - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
17
17
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
18
18
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
19
19
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
@@ -147,7 +147,7 @@ Other CSS rules:
147
147
 
148
148
  当用户通过以下方式表达困惑时:
149
149
  - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
150
- - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
150
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `node_modules/@quicktvui/ai/rules/.docs/` 规范 but 无法在用户端运行。
151
151
 
152
152
  **AI 执行协议:**
153
153
  1. **脱敏诊断 (Sanitized Diagnosis)**:
@@ -6,14 +6,14 @@
6
6
 
7
7
  **AI MUST refer to the official documentation and source code below BEFORE generating any code. NEVER hallucinate component names, attribute names, or APIs. These are the ONLY authorities.**
8
8
 
9
- 1. **Local Documentation (PRIMARY)**: The `.docs/` folder in the project root. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `.docs/` directory before generating code.**
9
+ 1. **Local Documentation (PRIMARY)**: The `node_modules/@quicktvui/ai/rules/.docs/` folder. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `node_modules/@quicktvui/ai/rules/.docs/` directory before generating code.**
10
10
  2. **Official Docs**: https://quicktvui.com
11
11
  3. **Core Library Samples**: https://github.com/quicktvui/quicktvui.git
12
12
  4. **Cross-platform Framework Samples**: https://github.com/quicktvui/es-vue3.git
13
13
  5. **Best Practice App**: https://github.com/quicktvui/hellotv.git
14
14
 
15
15
  **STRICT RULES:**
16
- - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
16
+ - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
17
17
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
18
18
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
19
19
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
@@ -147,7 +147,7 @@ Other CSS rules:
147
147
 
148
148
  当用户通过以下方式表达困惑时:
149
149
  - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
150
- - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
150
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `node_modules/@quicktvui/ai/rules/.docs/` 规范但无法在用户端运行。
151
151
 
152
152
  **AI 执行协议:**
153
153
  1. **脱敏诊断 (Sanitized Diagnosis)**:
@@ -6,14 +6,14 @@
6
6
 
7
7
  **AI MUST refer to the official documentation and source code below BEFORE generating any code. NEVER hallucinate component names, attribute names, or APIs. These are the ONLY authorities.**
8
8
 
9
- 1. **Local Documentation (PRIMARY)**: The `.docs/` folder in the project root. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `.docs/` directory before generating code.**
9
+ 1. **Local Documentation (PRIMARY)**: The `node_modules/@quicktvui/ai/rules/.docs/` folder. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `node_modules/@quicktvui/ai/rules/.docs/` directory before generating code.**
10
10
  2. **Official Docs**: https://quicktvui.com
11
11
  3. **Core Library Samples**: https://github.com/quicktvui/quicktvui.git
12
12
  4. **Cross-platform Framework Samples**: https://github.com/quicktvui/es-vue3.git
13
13
  5. **Best Practice App**: https://github.com/quicktvui/hellotv.git
14
14
 
15
15
  **STRICT RULES:**
16
- - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
16
+ - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
17
17
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
18
18
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
19
19
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
@@ -6,14 +6,14 @@
6
6
 
7
7
  **AI MUST refer to the official documentation and source code below BEFORE generating any code. NEVER hallucinate component names, attribute names, or APIs. These are the ONLY authorities.**
8
8
 
9
- 1. **Local Documentation (PRIMARY)**: The `.docs/` folder in the project root. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `.docs/` directory before generating code.**
9
+ 1. **Local Documentation (PRIMARY)**: The `node_modules/@quicktvui/ai/rules/.docs/` folder. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `node_modules/@quicktvui/ai/rules/.docs/` directory before generating code.**
10
10
  2. **Official Docs**: https://quicktvui.com
11
11
  3. **Core Library Samples**: https://github.com/quicktvui/quicktvui.git
12
12
  4. **Cross-platform Framework Samples**: https://github.com/quicktvui/es-vue3.git
13
13
  5. **Best Practice App**: https://github.com/quicktvui/hellotv.git
14
14
 
15
15
  **STRICT RULES:**
16
- - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
16
+ - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
17
17
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
18
18
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
19
19
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
@@ -147,7 +147,7 @@ Other CSS rules:
147
147
 
148
148
  当用户通过以下方式表达困惑时:
149
149
  - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
150
- - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
150
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `node_modules/@quicktvui/ai/rules/.docs/` 规范但无法在用户端运行。
151
151
 
152
152
  **AI 执行协议:**
153
153
  1. **脱敏诊断 (Sanitized Diagnosis)**:
package/rules/AGENTS.md CHANGED
@@ -6,14 +6,14 @@
6
6
 
7
7
  **AI MUST refer to the official documentation and source code below BEFORE generating any code. NEVER hallucinate component names, attribute names, or APIs. These are the ONLY authorities.**
8
8
 
9
- 1. **Local Documentation (PRIMARY)**: The `.docs/` folder in the project root. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `.docs/` directory before generating code.**
9
+ 1. **Local Documentation (PRIMARY)**: The `node_modules/@quicktvui/ai/rules/.docs/` folder. Contains detailed MD documentation for all components, CSS, and native modules. **AI MUST use `grep_search` or `read_file` to retrieve relevant content from the `node_modules/@quicktvui/ai/rules/.docs/` directory before generating code.**
10
10
  2. **Official Docs**: https://quicktvui.com (390+ docs)
11
11
  3. **Core Library Samples**: https://github.com/quicktvui/quicktvui.git (Core library + samples)
12
12
  4. **Cross-platform Framework Samples**: https://github.com/quicktvui/es-vue3.git (Cross-platform framework + samples)
13
13
  5. **Best Practice App**: https://github.com/quicktvui/hellotv.git (Complete video app)
14
14
 
15
15
  **STRICT RULES:**
16
- - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
16
+ - **VERIFY CAPABILITIES FIRST**: Before implementing features like "video playback," search the `node_modules/@quicktvui/ai/rules/.docs/` directory to verify component capabilities. DO NOT assume web behavior. **For example, `qt-web-view` does NOT support video playback; you MUST use the native `es-video-player` and `es-player-manager` components.**
17
17
  - **NOT A BROWSER & NO HTML**: **This framework does NOT support HTML. Standard HTML tags (like `p`, `img`, `a`, `ul`, `li`, `h1`) are STRICTLY PROHIBITED. It does NOT support `window`, `document` (DOM), or DOM APIs. You must exclusively use framework tags (like `qt-text`, `qt-image`) and Vue `ref`s.**
18
18
  - **NO HALLUCINATED TAGS**: e.g. `qt-web` is wrong, it is `qt-web-view`.
19
19
  - **NO HALLUCINATED APIs**: e.g. `onBack` is wrong, it must be `onBackPressed`.
@@ -158,7 +158,7 @@ Android clips child views outside parent bounds by default. When using `focusSca
158
158
 
159
159
  当用户通过以下方式表达困惑时:
160
160
  - **关键词触发**:当用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
161
- - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
161
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `node_modules/@quicktvui/ai/rules/.docs/` 规范但无法在用户端运行。
162
162
 
163
163
  **AI 执行协议 (Execution Protocol):**
164
164
  1. **脱敏诊断 (Sanitized Diagnosis)**:
@@ -6,14 +6,14 @@
6
6
 
7
7
  **AI 在生成任何代码前,必须严格参考以下权威来源,严禁凭空想象任何组件名、属性名或 API。这是所有开发工作的唯一依据。**
8
8
 
9
- 1. **本地文档 (PRIMARY)**:项目根目录下的 `.docs/` 文件夹。包含所有组件、CSS、原生模块的详细 MD 文档。**AI 必须在生成代码前使用 `grep_search` 或 `read_file` 检索 `.docs/` 目录中的相关内容。**
9
+ 1. **本地文档 (PRIMARY)**:`node_modules/@quicktvui/ai/rules/.docs/` 目录。包含所有组件、CSS、原生模块的详细 MD 文档。**AI 必须在生成代码前使用 `grep_search` 或 `read_file` 检索 `node_modules/@quicktvui/ai/rules/.docs/` 目录中的相关内容。**
10
10
  2. **官方文档**:https://quicktvui.com (包含约 390 个详细文档)
11
11
  3. **核心库示例**:https://github.com/quicktvui/quicktvui.git (Core library + samples)
12
12
  4. **跨平台框架示例**:https://github.com/quicktvui/es-vue3.git (Cross-platform framework + samples)
13
13
  5. **最佳实践应用**:https://github.com/quicktvui/hellotv.git (Complete video app)
14
14
 
15
15
  **要求:**
16
- - **检索与能力验证优先**:在实现任何功能(如“视频播放”)前,必须先在 `.docs/` 目录中检索相关文档,验证组件是否支持该功能。切勿想当然!**例如:`qt-web-view` 绝对不支持视频播放,视频播放必须使用框架提供的专用视频组件和管理器(如 `es-video-player` 和 `es-player-manager`)。**
16
+ - **检索与能力验证优先**:在实现任何功能(如“视频播放”)前,必须先在 `node_modules/@quicktvui/ai/rules/.docs/` 目录中检索相关文档,验证组件是否支持该功能。切勿想当然!**例如:`qt-web-view` 绝对不支持视频播放,视频播放必须使用框架提供的专用视频组件和管理器(如 `es-video-player` 和 `es-player-manager`)。**
17
17
  - **非浏览器与无 HTML 环境**:**本框架绝对不支持标准 HTML 标签(如 `p`, `img`, `a`, `ul`, `li`, `h1` 等),严禁在模板中使用!绝对不支持 `window`、`document` (DOM) 对象或任何 DOM 操作 API。必须使用框架专属标签(如 `qt-text`, `qt-image`)和 Vue `ref`。**
18
18
  - **严禁自造标签**:如 `qt-web` 是错的,官方示例中是 `qt-web-view`。
19
19
  - **严禁自造 API**:如 `onBack` 是错的,必须是 `onBackPressed`。
@@ -64,7 +64,7 @@ QuickTVUI 是基于 Vue 3 的 Android TV/大屏端 UI 框架,运行在 Hippy-b
64
64
 
65
65
  1. 自动理解 QuickTVUI 框架的核心概念和约束
66
66
  2. 生成符合框架规范的 Vue 代码(焦点系统、CSS 子集、TV 交互)
67
- 3. 所有配置文件自包含、可移植,拷贝到任何 QuickTVUI 应用项目即可使用
67
+ 3. 所有配置文件引用 `@quicktvui/ai` 包内的文档库,安装包后即可使用。
68
68
 
69
69
  ## 三、已创建的文件清单
70
70
 
@@ -134,9 +134,9 @@ CSS 属性列表由框架作者直接提供,优先级高于文档推断。已
134
134
 
135
135
  ### 1. 自包含 vs 引用本地文档路径
136
136
 
137
- 最初版本引用了 `docs/zh-CN/component/<name>.md` 等本地路径,但这些路径只存在于框架源码仓库中,不存在于用户的应用项目中。
137
+ 最初版本引用了 `docs/zh-CN/component/<name>.md` 等本地路径,但这些路径只存在于框架源码仓库中,不存 在于用户的应用项目中。
138
138
 
139
- **最终方案**:所有 AI 指令文件完全自包含,将核心知识直接嵌入文件内容,不依赖任何本地文件路径。用户只需将文件拷贝到自己的项目根目录即可使用。
139
+ **最终方案**:AI 指令文件引用 `node_modules/@quicktvui/ai/rules/.docs/` 目录。用户通过安装 `@quicktvui/ai` 包即可获得这些文档。这样既保持了知识的实时性,又避免了在用户项目根目录下生成大量冗余文件。
140
140
 
141
141
  ### 2. 分层详略
142
142
 
@@ -354,7 +354,7 @@ onESCreate(params) → onESStart() → onESResume() → onESPause() → onESStop
354
354
  3. 根据"后续改进建议"选择优先级高的任务开始改进
355
355
 
356
356
  4. 改进时的关键原则:
357
- - 保持所有文件自包含、可移植
357
+ - 保持配置文件引用的路径正确、可移植
358
358
  - 从 `docs/zh-CN/` 提取知识,不要编造
359
359
  - 使用用户提供的权威 CSS 属性列表
360
360
  - 参考 3 个外部代码仓库的实际代码风格
package/rules/CLAUDE.md CHANGED
@@ -6,18 +6,18 @@
6
6
 
7
7
  **AI 在生成代码前,必须严格参考以下权威来源,严禁凭空想象任何组件名、属性名或 API。这是所有代码的唯一依据。**
8
8
 
9
- 1. **本地文档 (PRIMARY)**:项目根目录下的 `.docs/` 文件夹。包含所有组件、CSS、原生模块的详细 MD 文档。**AI 必须在生成代码前使用 `grep_search` 或 `read_file` 检索 `.docs/` 目录中的相关内容。**
9
+ 1. **本地文档 (PRIMARY)**:`node_modules/@quicktvui/ai/rules/.docs/` 目录。包含所有组件、CSS、原生模块的详细 MD 文档。**AI 必须在生成代码前使用 `grep_search` 或 `read_file` 检索 `node_modules/@quicktvui/ai/rules/.docs/` 目录中的相关内容。**
10
10
  2. **官方文档**:https://quicktvui.com (官网 390+ 篇详细文档)
11
11
  3. **核心库示例**:https://github.com/quicktvui/quicktvui.git (Core library + samples)
12
12
  4. **跨平台框架示例**:https://github.com/quicktvui/es-vue3.git (Cross-platform framework + samples)
13
13
  5. **最佳实践应用**:https://github.com/quicktvui/hellotv.git (Complete video app)
14
14
 
15
15
  **要求:**
16
- - **检索与能力验证优先**:在实现任何功能(如“视频播放”)前,必须先在 `.docs/` 目录中检索相关文档,验证组件是否支持该功能。切勿想当然!**例如:`qt-web-view` 绝对不支持视频播放,视频播放必须使用框架提供的专用视频组件和管理器(如 `es-video-player` 和 `es-player-manager`)。**
16
+ - **检索与能力验证优先**:在实现任何功能(如“视频播放”)前,必须先在 `node_modules/@quicktvui/ai/rules/.docs/` 目录中检索相关文档,验证组件是否支持该功能。切勿想当然!**例如:`qt-web-view` 绝对不支持视频播放,视频播放必须使用框架提供的专用视频组件和管理器(如 `es-video-player` 和 `es-player-manager`)。**
17
17
  - **非浏览器与无 HTML 环境**:**本框架绝对不支持标准 HTML 标签(如 `p`, `img`, `a`, `ul`, `li`, `h1` 等),严禁在模板中使用!绝对不支持 `window`、`document` (DOM) 对象或任何 DOM 操作 API。必须使用框架专属标签(如 `qt-text`, `qt-image`)和 Vue `ref`。**
18
18
  - **严禁自造标签**:如 `qt-web` 是错的,官方示例中是 `qt-web-view`。
19
19
  - **严禁自造 API**:如 `onBack` 是错的,必须是 `onBackPressed`。
20
- - **参考优先**:遇到不确定的组件用法,必须先在上述仓库中搜索同名组件的实际用法。
20
+ - **参考优先**:遇到不确定的组件用法,必须先在上述仓库或 `node_modules/@quicktvui/ai/rules/.docs/` 中搜索同名组件的实际用法。
21
21
 
22
22
  ## 快速创建项目 (Scaffolding)
23
23
 
@@ -182,7 +182,7 @@ Android 默认裁切超出父容器边界的子元素。TV 端使用 `focusScale
182
182
 
183
183
  当用户通过以下方式表达困惑时:
184
184
  - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
185
- - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
185
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `node_modules/@quicktvui/ai/rules/.docs/` 规范但无法在用户端运行。
186
186
 
187
187
  **AI 执行协议:**
188
188
  1. **脱敏诊断 (Sanitized Diagnosis)**:
package/rules/GEMINI.md CHANGED
@@ -6,18 +6,18 @@
6
6
 
7
7
  **AI 在生成代码前,必须严格参考以下权威来源,严禁凭空想象任何组件名、属性名或 API。这是所有代码的唯一依据。**
8
8
 
9
- 1. **本地文档 (PRIMARY)**:项目根目录下的 `.docs/` 文件夹。包含所有组件、CSS、原生模块的详细 MD 文档。**AI 必须在生成代码前使用 `grep_search` 或 `read_file` 检索 `.docs/` 目录中的相关内容。**
9
+ 1. **本地文档 (PRIMARY)**:`node_modules/@quicktvui/ai/rules/.docs/` 目录。包含所有组件、CSS、原生模块的详细 MD 文档。**AI 必须在生成代码前使用 `grep_search` 或 `read_file` 检索 `node_modules/@quicktvui/ai/rules/.docs/` 目录中的相关内容。**
10
10
  2. **官方文档**:https://quicktvui.com (官网 390+ 篇详细文档)
11
11
  3. **核心库示例**:https://github.com/quicktvui/quicktvui.git (Core library + samples)
12
12
  4. **跨平台框架示例**:https://github.com/quicktvui/es-vue3.git (Cross-platform framework + samples)
13
13
  5. **最佳实践应用**:https://github.com/quicktvui/hellotv.git (Complete video app)
14
14
 
15
15
  **要求:**
16
- - **检索与能力验证优先**:在实现任何功能(如“视频播放”)前,必须先在 `.docs/` 目录中检索相关文档,验证组件是否支持该功能。切勿想当然!**例如:`qt-web-view` 绝对不支持视频播放,视频播放必须使用框架提供的专用视频组件和管理器(如 `es-video-player` 和 `es-player-manager`)。**
17
- - **非浏览器与无 HTML 环境**:**本框架绝对不支持标准 HTML 标签(如 `p`, `img`, `a`, `ul`, `li`, `h1` 等),严禁在模板中使用!绝对不支持 `window`、`document` (DOM) 对象或任何 DOM 操作 API。必须使用框架专属标签(如 `qt-text`, `qt-image`)和 Vue `ref`。**
16
+ - **检索与能力验证优先**:在实现任何功能(如“视频播放”)前,必须先在 `node_modules/@quicktvui/ai/rules/.docs/` 目录中检索相关文档,验证组件是否支持该功能。切勿想当然!**例如:`qt-web-view` 绝对不支持视频播放,视频播放必须使用框架提供的专用视频组件和管理器(如 `es-video-player` 和 `es-player-manager`)。**
17
+ - **非浏览器与无 HTML 环境**:**本框架绝对不支持标准 HTML 标签(如 `p`, `img`, `a`, `ul`, `li`, `h1` 等),严禁在模板中使用!绝对不支持 `window`、`document` (DOM) 对象或任何 DOM 操作 API。必须使用框架专属标签(如 `qt-text`, `qt-image`) and Vue `ref`。**
18
18
  - **严禁自造标签**:如 `qt-web` 是错的,官方示例中是 `qt-web-view`。
19
19
  - **严禁自造 API**:如 `onBack` 是错的,必须是 `onBackPressed`。
20
- - **参考优先**:遇到不确定的组件用法,必须先在上述仓库或本地 `.docs` 中搜索同名组件的实际用法。
20
+ - **参考优先**:遇到不确定的组件用法,必须先在上述仓库或 `node_modules/@quicktvui/ai/rules/.docs/` 中搜索同名组件的实际用法。
21
21
 
22
22
  ## 快速创建项目 (Scaffolding)
23
23
 
@@ -163,7 +163,7 @@ Android clips child views outside parent bounds by default. When using `focusSca
163
163
 
164
164
  当用户通过以下方式表达困惑时:
165
165
  - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
166
- - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
166
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `node_modules/@quicktvui/ai/rules/.docs/` 规范但无法在用户端运行。
167
167
 
168
168
  **AI 执行协议:**
169
169
  1. **脱敏诊断 (Sanitized Diagnosis)**: