@quicktvui/ai 1.0.1 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quicktvui/ai",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "QuickTVUI AI 开发规范与脚手架注入工具",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/postinstall.js CHANGED
@@ -11,7 +11,10 @@ if (!projectRoot || !fs.existsSync(projectRoot)) {
11
11
  }
12
12
 
13
13
  // 避免在包自身的开发环境中循环复制
14
- if (projectRoot === __dirname || projectRoot === path.join(__dirname, '..', '..')) {
14
+ if (
15
+ projectRoot === __dirname ||
16
+ projectRoot === path.join(__dirname, "..", "..")
17
+ ) {
15
18
  process.exit(0);
16
19
  }
17
20
 
@@ -20,7 +23,7 @@ console.log(`📂 目标目录: ${projectRoot}`);
20
23
 
21
24
  const rulesDir = path.join(__dirname, "rules");
22
25
  const backupBaseDir = path.join(projectRoot, ".quicktvui-ai-backup");
23
- const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
26
+ const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
24
27
  const currentBackupDir = path.join(backupBaseDir, `backup_${timestamp}`);
25
28
 
26
29
  function copyDirectorySync(src, dest) {
@@ -46,7 +49,8 @@ try {
46
49
  const targetPath = path.join(projectRoot, item);
47
50
  if (fs.existsSync(targetPath)) {
48
51
  if (!backupNeeded) {
49
- if (!fs.existsSync(currentBackupDir)) fs.mkdirSync(currentBackupDir, { recursive: true });
52
+ if (!fs.existsSync(currentBackupDir))
53
+ fs.mkdirSync(currentBackupDir, { recursive: true });
50
54
  backupNeeded = true;
51
55
  }
52
56
  const backupPath = path.join(currentBackupDir, item);
@@ -59,7 +63,9 @@ try {
59
63
  });
60
64
 
61
65
  if (backupNeeded) {
62
- console.log(`📦 已检测到现有 AI 配置文件,已备份至: .quicktvui-ai-backup/backup_${timestamp}`);
66
+ console.log(
67
+ `📦 已检测到现有 AI 配置文件,已备份至: .quicktvui-ai-backup/backup_${timestamp}`,
68
+ );
63
69
  }
64
70
 
65
71
  // 2. 注入新规则
@@ -75,7 +81,9 @@ try {
75
81
 
76
82
  const itemsToIgnore = [
77
83
  ".quicktvui-ai-backup",
78
- ...rootItems.map(item => item === ".github" ? ".github/copilot-instructions.md" : item)
84
+ ...rootItems.map((item) =>
85
+ item === ".github" ? ".github/copilot-instructions.md" : item,
86
+ ),
79
87
  ];
80
88
 
81
89
  let updatedGitignore = gitignoreContent;
@@ -83,7 +91,10 @@ try {
83
91
 
84
92
  const sectionHeader = "# QuickTVUI AI Rules";
85
93
  if (!updatedGitignore.includes(sectionHeader)) {
86
- updatedGitignore += (updatedGitignore.length > 0 && !updatedGitignore.endsWith("\n") ? "\n" : "") + `\n${sectionHeader}\n`;
94
+ updatedGitignore +=
95
+ (updatedGitignore.length > 0 && !updatedGitignore.endsWith("\n")
96
+ ? "\n"
97
+ : "") + `\n${sectionHeader}\n`;
87
98
  hasChanges = true;
88
99
  }
89
100
 
@@ -97,11 +108,10 @@ try {
97
108
  });
98
109
 
99
110
  if (hasChanges) {
100
- fs.writeFileSync(gitignorePath, updatedGitignore);
101
- console.log("✅ 已更新 .gitignore,排除 AI 配置文件。");
111
+ fs.writeFileSync(gitignorePath, updatedGitignore);
112
+ console.log("✅ 已更新 .gitignore,排除 AI 配置文件。");
102
113
  }
103
- } catch (err) {
104
-
114
+ } catch (err) {
105
115
  console.error(`❌ 注入失败: ${err.message}`);
106
116
  }
107
117
 
@@ -12,7 +12,7 @@
12
12
  - 子元素跟随焦点状态:`:duplicateParentState="true"`
13
13
  - 文字用 `<span>` 或 `<qt-text>` 包裹
14
14
  - 所有元素显式指定 width/height(px)
15
- - 不用写 `display: flex`,默认就是 flex,默认 flex-direction: column
15
+ - 必须声明 `display: flex;`,QuickTVUI 仅支持 flex 布局,默认 flex-direction: column
16
16
  - 不支持 %、auto、vh/vw、grid、动画、阴影、CSS 简写属性
17
17
  - 横向列表用 `<ul :horizontal="true">`
18
18
  - 设置 border 必须同时设置 border-color
package/rules/.clinerules CHANGED
@@ -126,7 +126,7 @@ Other CSS rules:
126
126
  - **CRITICAL: Static styles MUST be in `<style>` (kebab-case), Dynamic styles MUST be in `:style` attributes.**
127
127
  - **CRITICAL: NO `-webkit-font-smoothing: antialiased;`**. This is not supported.
128
128
  - **CRITICAL: ONLY use `div` and `span` for standard tags.** Do NOT use `p`, `h1-h6`, `section`, etc.
129
- - **CRITICAL: DEFAULT LAYOUT IS `flex-direction: column`**. Unlike web browsers, QuickTVUI defaults to vertical layout. You rarely need to specify `display: flex`.
129
+ - **CRITICAL: MANDATORY `display: flex;`**. QuickTVUI exclusively supports Flexbox layout. Every styled element MUST explicitly include `display: flex;`. The default orientation is `flex-direction: column;`.
130
130
  - Only use properties listed in "Supported Style Properties" section below
131
131
  - Do NOT use `<style scoped>` (unreliable in native rendering)
132
132
  - Only `px` units (no %, auto, vh, vw, rem, em). No CSS shorthand.
@@ -143,6 +143,26 @@ Other CSS rules:
143
143
  <qt-list-view :clipChildren="false" :clipPadding="false" />
144
144
  ```
145
145
 
146
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
147
+
148
+ 当用户通过以下方式表达困惑时:
149
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
150
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
151
+
152
+ **AI 执行协议:**
153
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
154
+ - 提取报错日志(去除绝对路径和私密 Token)。
155
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
156
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
157
+ 2. **寻求授权 (Request Consent)**:
158
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
159
+ 3. **提交方式 (Submission)**:
160
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
161
+ - macOS: `open "URL"`
162
+ - Linux: `xdg-open "URL"`
163
+ - Windows: `start "URL"`
164
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
165
+
146
166
  ### Import Sources
147
167
  - `defineComponent` from `vue` — NOT from `@vue/runtime-core`
148
168
  - Router: `useESRouter` from `@extscreen/es3-router`
@@ -154,7 +174,7 @@ Other CSS rules:
154
174
 
155
175
  Only properties listed below are supported. Default layout: flexbox, flex-direction: column.
156
176
 
157
- Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. No `display: flex` needed. All elements MUST have explicit width/height.
177
+ Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. MANDATORY `display: flex;` for all elements. All elements MUST have explicit width/height.
158
178
 
159
179
  ### Layout & Size
160
180
  `width`, `height`, `left`, `top`, `overflow`, `direction`, `z-index`, `visibility`, `opacity`, `transform`
@@ -126,7 +126,7 @@ Other CSS rules:
126
126
  - **CRITICAL: Static styles MUST be in `<style>` (kebab-case), Dynamic styles MUST be in `:style` attributes.**
127
127
  - **CRITICAL: NO `-webkit-font-smoothing: antialiased;`**. This is not supported.
128
128
  - **CRITICAL: ONLY use `div` and `span` for standard tags.** Do NOT use `p`, `h1-h6`, `section`, etc.
129
- - **CRITICAL: DEFAULT LAYOUT IS `flex-direction: column`**. Unlike web browsers, QuickTVUI defaults to vertical layout. You rarely need to specify `display: flex`.
129
+ - **CRITICAL: MANDATORY `display: flex;`**. QuickTVUI exclusively supports Flexbox layout. Every styled element MUST explicitly include `display: flex;`. The default orientation is `flex-direction: column;`.
130
130
  - Only use properties listed in "Supported Style Properties" section below
131
131
  - Do NOT use `<style scoped>` (unreliable in native rendering)
132
132
  - Only `px` units (no %, auto, vh, vw, rem, em). No CSS shorthand.
@@ -143,6 +143,26 @@ Other CSS rules:
143
143
  <qt-list-view :clipChildren="false" :clipPadding="false" />
144
144
  ```
145
145
 
146
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
147
+
148
+ 当用户通过以下方式表达困惑时:
149
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
150
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
151
+
152
+ **AI 执行协议:**
153
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
154
+ - 提取报错日志(去除绝对路径和私密 Token)。
155
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
156
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
157
+ 2. **寻求授权 (Request Consent)**:
158
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
159
+ 3. **提交方式 (Submission)**:
160
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
161
+ - macOS: `open "URL"`
162
+ - Linux: `xdg-open "URL"`
163
+ - Windows: `start "URL"`
164
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
165
+
146
166
  ### Import Sources
147
167
  - `defineComponent` from `vue` — NOT from `@vue/runtime-core`
148
168
  - Router: `useESRouter` from `@extscreen/es3-router`
@@ -154,7 +174,7 @@ Other CSS rules:
154
174
 
155
175
  Only properties listed below are supported. Default layout: flexbox, flex-direction: column.
156
176
 
157
- Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. No `display: flex` needed. All elements MUST have explicit width/height.
177
+ Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. MANDATORY `display: flex;` for all elements. All elements MUST have explicit width/height.
158
178
 
159
179
  ### Layout & Size
160
180
  `width`, `height`, `left`, `top`, `overflow`, `direction`, `z-index`, `visibility`, `opacity`, `transform`
@@ -5,7 +5,8 @@ lang: zh-CN
5
5
 
6
6
  # display
7
7
 
8
- QuickTVUI 默认采用 Flex 布局。同时,因为仅支持 Flex 布局,所以不需要手写 `display: flex` 即可使用。
8
+ QuickTVUI 默认采用 Flex 布局。同时, 因为仅支持 Flex 布局,所以必须手写 `display: flex` 才能生效。
9
+
9
10
 
10
11
  | Name | Description | Type | Default |
11
12
  |--------------------|------------------|------------------------------| ------- |
@@ -28,7 +28,7 @@ lang: zh-CN
28
28
  ## 布局(Flex)
29
29
 
30
30
  默认采用现在移动端最流行的 `Flex` 布局。
31
- 因为仅支持 `Flex` 布局,所以不需要手写 `display: flex` 即可使用。
31
+ 因为仅支持 `Flex` 布局,所以必须手写 `display: flex` 才能生效。
32
32
  `Flex` 布局与 `Web` 的 `Flex` 类似,它们都旨在提供一个更加有效的方式制定、调整和分布一个容器里的项目布局,即使他们的大小是未知或者是动态的。
33
33
  `Flex` 规定了弹性元素如何伸长或缩短,以适应`flex容器`中的可用空间。
34
34
 
@@ -133,7 +133,7 @@ Other CSS rules:
133
133
  - **CRITICAL: Static styles MUST be in `<style>` (kebab-case), Dynamic styles MUST be in `:style` attributes.**
134
134
  - **CRITICAL: NO `-webkit-font-smoothing: antialiased;`**. This is not supported.
135
135
  - **CRITICAL: ONLY use `div` and `span` for standard tags.** Do NOT use `p`, `h1-h6`, `section`, etc.
136
- - **CRITICAL: DEFAULT LAYOUT IS `flex-direction: column`**. Unlike web browsers, QuickTVUI defaults to vertical layout. You rarely need to specify `display: flex`.
136
+ - **CRITICAL: MANDATORY `display: flex;`**. QuickTVUI exclusively supports Flexbox layout. Every styled element MUST explicitly include `display: flex;`. The default orientation is `flex-direction: column;`.
137
137
  - Only use properties listed in "Supported Style Properties" section below
138
138
  - Do NOT use `<style scoped>` (unreliable in native rendering)
139
139
  - Only `px` units (no %, auto, vh, vw, rem, em). No CSS shorthand.
@@ -166,7 +166,7 @@ Android clips child views outside parent bounds by default. When using `focusSca
166
166
 
167
167
  Only properties listed below are supported. Default layout: flexbox, flex-direction: column.
168
168
 
169
- Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. No `display: flex` needed. All elements MUST have explicit width/height.
169
+ Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. MANDATORY `display: flex;` for all elements. All elements MUST have explicit width/height.
170
170
 
171
171
  ### Layout & Size
172
172
 
@@ -126,7 +126,7 @@ Other CSS rules:
126
126
  - **CRITICAL: Static styles MUST be in `<style>` (kebab-case), Dynamic styles MUST be in `:style` attributes.**
127
127
  - **CRITICAL: NO `-webkit-font-smoothing: antialiased;`**. This is not supported.
128
128
  - **CRITICAL: ONLY use `div` and `span` for standard tags.** Do NOT use `p`, `h1-h6`, `section`, etc.
129
- - **CRITICAL: DEFAULT LAYOUT IS `flex-direction: column`**. Unlike web browsers, QuickTVUI defaults to vertical layout. You rarely need to specify `display: flex`.
129
+ - **CRITICAL: MANDATORY `display: flex;`**. QuickTVUI exclusively supports Flexbox layout. Every styled element MUST explicitly include `display: flex;`. The default orientation is `flex-direction: column;`.
130
130
  - Only use properties listed in "Supported Style Properties" section below
131
131
  - Do NOT use `<style scoped>` (unreliable in native rendering)
132
132
  - Only `px` units (no %, auto, vh, vw, rem, em). No CSS shorthand.
@@ -143,6 +143,26 @@ Other CSS rules:
143
143
  <qt-list-view :clipChildren="false" :clipPadding="false" />
144
144
  ```
145
145
 
146
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
147
+
148
+ 当用户通过以下方式表达困惑时:
149
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
150
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
151
+
152
+ **AI 执行协议:**
153
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
154
+ - 提取报错日志(去除绝对路径和私密 Token)。
155
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
156
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
157
+ 2. **寻求授权 (Request Consent)**:
158
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
159
+ 3. **提交方式 (Submission)**:
160
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
161
+ - macOS: `open "URL"`
162
+ - Linux: `xdg-open "URL"`
163
+ - Windows: `start "URL"`
164
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
165
+
146
166
  ### Import Sources
147
167
  - `defineComponent` from `vue` — NOT from `@vue/runtime-core`
148
168
  - Router: `useESRouter` from `@extscreen/es3-router`
@@ -154,7 +174,7 @@ Other CSS rules:
154
174
 
155
175
  Only properties listed below are supported. Default layout: flexbox, flex-direction: column.
156
176
 
157
- Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. No `display: flex` needed. All elements MUST have explicit width/height.
177
+ Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. MANDATORY `display: flex;` for all elements. All elements MUST have explicit width/height.
158
178
 
159
179
  ### Layout & Size
160
180
  `width`, `height`, `left`, `top`, `overflow`, `direction`, `z-index`, `visibility`, `opacity`, `transform`
package/rules/AGENTS.md CHANGED
@@ -133,7 +133,7 @@ CORRECT — `<template>` tag attributes use camelCase:
133
133
 
134
134
  Other CSS rules:
135
135
 
136
- - **CRITICAL: DEFAULT LAYOUT IS `flex-direction: column`**. Unlike web browsers, QuickTVUI defaults to vertical layout. You rarely need to specify `display: flex`.
136
+ - **CRITICAL: MANDATORY `display: flex;`**. QuickTVUI exclusively supports Flexbox layout. Every styled element MUST explicitly include `display: flex;`. The default orientation is `flex-direction: column;`.
137
137
  - Only use properties listed in "Supported Style Properties" section below
138
138
  - Do NOT use `<style scoped>` (unreliable in native rendering)
139
139
  - Only `px` units (no %, auto, vh, vw, rem, em). No CSS shorthand.
@@ -154,6 +154,26 @@ Android clips child views outside parent bounds by default. When using `focusSca
154
154
  <qt-list-view :clipChildren="false" :clipPadding="false" />
155
155
  ```
156
156
 
157
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
158
+
159
+ 当用户通过以下方式表达困惑时:
160
+ - **关键词触发**:当用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
161
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
162
+
163
+ **AI 执行协议 (Execution Protocol):**
164
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
165
+ - 提取报错日志(必须去除绝对路径和私密 Token/API Keys)。
166
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
167
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
168
+ 2. **寻求授权 (Request Consent)**:
169
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
170
+ 3. **提交方式 (Submission)**:
171
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
172
+ - macOS: `open "URL"`
173
+ - Linux: `xdg-open "URL"`
174
+ - Windows: `start "URL"`
175
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
176
+
157
177
  ### Import Sources
158
178
 
159
179
  - `defineComponent` from `vue` — NOT from `@vue/runtime-core`
@@ -166,7 +186,7 @@ Android clips child views outside parent bounds by default. When using `focusSca
166
186
 
167
187
  Only properties listed below are supported. Default layout: flexbox, flex-direction: column.
168
188
 
169
- Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. No `display: flex` needed. All elements MUST have explicit width/height.
189
+ Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. MANDATORY `display: flex;` for all elements. All elements MUST have explicit width/height.
170
190
 
171
191
  ### Layout & Size
172
192
 
package/rules/CLAUDE.md CHANGED
@@ -151,9 +151,9 @@ https://quicktvui.com
151
151
  - **CRITICAL: Static styles MUST be in `<style>` (kebab-case), Dynamic styles MUST be in `:style` attributes.**
152
152
  - **CRITICAL: NO `-webkit-font-smoothing: antialiased;`**. This is not supported.
153
153
  - **CRITICAL: ONLY use `div` and `span` for standard tags.** Do NOT use `p`, `h1-h6`, `section`, etc.
154
- - **⚠️ 强制要求:默认布局为 `flex-direction: column`**。与 Web 浏览器不同,QuickTVUI 默认就是垂直布局。你几乎不需要写 `display: flex`。
154
+ - **⚠️ 强制要求:必须声明 `display: flex;`**。QuickTVUI 仅支持 Flexbox 布局,所有样式化的元素必须显式包含 `display: flex;`。默认布局方向为 `flex-direction: column;`。
155
155
  - 只有本文档"二、样式属性"章节中列出的属性才能使用
156
- - `display: flex` 和 `flex-direction: column` 是支持的,但它们是默认值,通常不需要写
156
+ - `display: flex` 和 `flex-direction: column` 是强制要求的。
157
157
  - 不要用 `<style scoped>`(在原生渲染中不可靠,直接用 `<style>`)
158
158
  - 不支持 `%`、`auto`、`vh`、`vw`、`rem`、`em` 单位,只支持 `px`
159
159
  - 不支持 CSS 简写如 `margin: 5px 10px`,必须拆写为 `margin-top: 5px; margin-right: 10px`
@@ -178,6 +178,26 @@ Android 默认裁切超出父容器边界的子元素。TV 端使用 `focusScale
178
178
  <qt-waterfall :clipChildren="false" :clipPadding="false" />
179
179
  ```
180
180
 
181
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
182
+
183
+ 当用户通过以下方式表达困惑时:
184
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
185
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
186
+
187
+ **AI 执行协议:**
188
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
189
+ - 提取报错日志(去除绝对路径和私密 Token)。
190
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
191
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
192
+ 2. **寻求授权 (Request Consent)**:
193
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
194
+ 3. **提交方式 (Submission)**:
195
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
196
+ - macOS: `open "URL"`
197
+ - Linux: `xdg-open "URL"`
198
+ - Windows: `start "URL"`
199
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
200
+
181
201
  ### import 来源
182
202
 
183
203
  - `defineComponent` 从 `vue` 导入(对),不要从 `@vue/runtime-core` 导入
@@ -266,7 +286,7 @@ QuickTVUI 的样式是 Web CSS 的子集,默认 Flexbox 布局,默认 flex-d
266
286
  - 只支持 px 单位(不支持 %、auto、vh/vw/rem/em)
267
287
  - 不支持 CSS 简写属性(如 `margin: 5px 10px`,必须拆写)
268
288
  - 不支持 CSS 变量 `var(--xxx)`、`!important`
269
- - 不需要写 `display: flex`(默认就是)
289
+ - **强制要求:必须声明 `display: flex;`**
270
290
  - 所有元素必须显式指定 width 和 height
271
291
  - 文字必须用 `<span>` 或 `<qt-text>` 包裹
272
292
 
package/rules/GEMINI.md CHANGED
@@ -136,9 +136,9 @@ CORRECT — `<template>` tag attributes use camelCase:
136
136
 
137
137
  Other CSS rules:
138
138
 
139
- - **CRITICAL: DEFAULT LAYOUT IS `flex-direction: column`**. Unlike web browsers, QuickTVUI defaults to vertical layout. You rarely need to specify `display: flex`.
139
+ - **CRITICAL: MANDATORY `display: flex;`**. QuickTVUI exclusively supports Flexbox layout. Every styled element MUST explicitly include `display: flex;`. The default orientation is `flex-direction: column;`.
140
140
  - Only use properties listed in "Supported Style Properties" section below
141
- - `display: flex` and `flex-direction: column` are supported but are defaults, usually unnecessary
141
+ - `display: flex` and `flex-direction: column` are supported and MANDATORY for all layouts.
142
142
  - Do NOT use `<style scoped>` (unreliable in native rendering, use `<style>` only)
143
143
  - Only `px` units (no %, auto, vh, vw, rem, em)
144
144
  - No CSS shorthand like `margin: 5px 10px` — must split: `margin-top: 5px; margin-right: 10px`
@@ -159,6 +159,26 @@ Android clips child views outside parent bounds by default. When using `focusSca
159
159
  <qt-list-view :clipChildren="false" :clipPadding="false" />
160
160
  ```
161
161
 
162
+ ## 🛡️ AI Sentinel: 框架问题上报机制 (Bug Reporting)
163
+
164
+ 当用户通过以下方式表达困惑时:
165
+ - **关键词触发**:用户提到“问题上报”、“碰到问题”、“反馈”、“Bug 反馈”、“还是没改好”、“运行报错”、“API 报错”等。
166
+ - **自动检测触发**:同一段代码逻辑在 3 次修复后仍然报错,或 AI 确认生成的代码符合 `.docs` 规范但无法在用户端运行。
167
+
168
+ **AI 执行协议:**
169
+ 1. **脱敏诊断 (Sanitized Diagnosis)**:
170
+ - 提取报错日志(去除绝对路径和私密 Token)。
171
+ - 整理环境信息(Node 版本、package.json 中的框架版本)。
172
+ - 编写最小可复现 Demo 代码(Minimum Reproducible Example)。
173
+ 2. **寻求授权 (Request Consent)**:
174
+ - AI 必须询问:“检测到该问题可能属于 QuickTVUI 框架缺陷,我已为您准备好一份脱敏后的诊断报告,是否允许我协助您将其上报到 GitHub 官方仓库以寻求官方支持?”
175
+ 3. **提交方式 (Submission)**:
176
+ - 授权后,**自动打开浏览器**:AI 应尝试根据操作系统执行系统命令以自动打开 Issue 链接:
177
+ - macOS: `open "URL"`
178
+ - Linux: `xdg-open "URL"`
179
+ - Windows: `start "URL"`
180
+ - 如果自动打开失败,则展示 Issue 预填充链接引导用户点击。
181
+
162
182
  ### Import Sources
163
183
 
164
184
  - `defineComponent` from `vue` (correct) — NOT from `@vue/runtime-core`
@@ -171,7 +191,7 @@ Android clips child views outside parent bounds by default. When using `focusSca
171
191
 
172
192
  Only properties listed below are supported. Default layout: flexbox, flex-direction: column.
173
193
 
174
- Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. No `display: flex` needed. All elements MUST have explicit width/height.
194
+ Rules: px units only (no %, auto, vh/vw/rem/em). No CSS shorthand. No CSS variables. MANDATORY `display: flex;` for all elements. All elements MUST have explicit width/height.
175
195
 
176
196
  ### Layout & Size
177
197