@moon791017/neo-skills 1.1.2 → 1.1.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/AGENTS.md +1 -1
- package/README.md +13 -19
- package/package.json +1 -1
- package/skills/neo-vue/SKILL.md +109 -70
- package/skills/neo-vue/assets/Vue3SFCComponentTemplate.vue +226 -0
- package/skills/neo-vue/evals/eval_queries.json +42 -0
- package/skills/neo-vue/evals/evals.json +29 -0
- package/skills/neo-vue/evals/files/LegacyTodoItem.vue +50 -0
- package/skills/neo-explain/SKILL.md +0 -39
- package/skills/neo-start-plan/SKILL.md +0 -29
- /package/skills/neo-vue/{reference → references}/anti-patterns.md +0 -0
- /package/skills/neo-vue/{reference → references}/coding-style.md +0 -0
- /package/skills/neo-vue/{reference → references}/patterns.md +0 -0
package/AGENTS.md
CHANGED
|
@@ -32,7 +32,7 @@ Add or update tests whenever you change installer behavior, filesystem layout, o
|
|
|
32
32
|
Follow the Conventional Commits pattern already used in history: `feat:`, `fix:`, `docs:`, `test(ci):`, `refactor(skills):`. Keep subjects short and imperative; add a scope when it clarifies impact. PRs against `develop` trigger the validation workflow, while merges to `main` feed the `release-please` release flow. In each PR, summarize behavior changes, list the commands you ran, and link the related issue when applicable.
|
|
33
33
|
|
|
34
34
|
## Security & Content Notes
|
|
35
|
-
Do not commit secrets, sample credentials, or unsafe prompts. When updating a skill, keep its `SKILL.md`, references, and any user-facing docs aligned.
|
|
35
|
+
Do not commit secrets, sample credentials, or unsafe prompts. When updating a skill, keep its `SKILL.md`, references, and any user-facing docs aligned. When deprecating or removing a skill, ensure the skill directory is completely deleted and all references are systematically scrubbed from project documentation (such as `README.md`) to maintain the agent's knowledge database hygiene.
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
package/README.md
CHANGED
|
@@ -34,11 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
* **智能審查**:針對程式碼變更進行多面向 (正確性、安全性、效能、可讀性) 的深度審查。
|
|
36
36
|
|
|
37
|
-
### 3.
|
|
38
|
-
|
|
39
|
-
* **技術解析**:深入分析原始碼或專案結構,提供高階用途摘要、邏輯流程分解以及核心元件說明。
|
|
40
|
-
|
|
41
|
-
### 4. .NET / C# 開發專家
|
|
37
|
+
### 3. .NET / C# 開發專家
|
|
42
38
|
|
|
43
39
|
* **C# 現代語法專家 (`skills/neo-csharp`)**:跨版本 C# 專家 (10-14+),專注於現代化語法、強型別與高效能開發模式。
|
|
44
40
|
* **.NET 核心路由 (`skills/neo-dotnet`)**:環境偵測與統一入口,自動將任務委派給最合適的子領域專家。
|
|
@@ -49,44 +45,44 @@
|
|
|
49
45
|
* **.NET Tag Helper 專家 (`skills/neo-dotnet-tag-helper`)**:開發 ASP.NET Core 自定義 Tag Helper 的專家指引,專注於純 C# 實作與異步渲染最佳實踐。
|
|
50
46
|
* **Interface 生成器**:針對 C# Class 自動生成符合規範的 Interface,並支援智慧檔案覆蓋功能。
|
|
51
47
|
|
|
52
|
-
###
|
|
48
|
+
### 4. Python 開發與環境管理專家
|
|
53
49
|
|
|
54
50
|
* **Python 3.10+ 專家 (`skills/neo-python`)**:專注於 Python 3.10 至 3.14 的現代語法特性、型別安全與非同步開發。
|
|
55
51
|
* **環境管理專家 (`skills/neo-python-manager`)**:智慧偵測與管理 Python 專案環境,支援 uv, Poetry, venv/pip 並提供自動化安裝建議。
|
|
56
52
|
|
|
57
|
-
###
|
|
53
|
+
### 5. Swift 開發專家
|
|
58
54
|
|
|
59
55
|
* **Swift 5.0+ 專家 (`skills/neo-swift`)**:支援從基礎語法到 Swift 6 的現代開發模式,涵蓋 SwiftUI、Structured Concurrency、記憶體安全以及高效能 App 開發指引。
|
|
60
56
|
* **SwiftUI 專家 (`skills/neo-swift-ui`)**:支援 iOS 16.0+ 與 Swift 5.0+ 的現代開發模式,專注於 NavigationStack、Observation 框架、資料流架構及高效能視圖設計。
|
|
61
57
|
|
|
62
|
-
###
|
|
58
|
+
### 6. JavaScript 開發專家
|
|
63
59
|
|
|
64
60
|
* **JavaScript 現代語法專家 (`skills/neo-javascript`)**:跨版本 JavaScript 專家 (ES6 - ES2025+),專注於現代化語法、模組系統與高效能開發模式。
|
|
65
61
|
|
|
66
|
-
###
|
|
62
|
+
### 7. TypeScript 開發專家
|
|
67
63
|
|
|
68
64
|
* **TypeScript 現代語法與型別安全 (`skills/neo-typescript`)**:專注於極致的型別安全、高可維護性與進階元程式設計(Meta-programming)。
|
|
69
65
|
* **型別系統防線**:涵蓋進階條件型別 (Conditional Types)、映射型別 (Mapped Types) 與樣板字面值型別。
|
|
70
66
|
* **互通性與配置最佳化**:深入調校 `tsconfig.json` 編譯選項,並徹底解決複雜的 ESM/CJS 互通性陷阱與執行期崩潰問題。
|
|
71
67
|
* **泛型約束設計**:引導設計高靈活度的泛型與變量 (Variance) 處理。
|
|
72
68
|
|
|
73
|
-
###
|
|
69
|
+
### 8. Vue 開發專家
|
|
74
70
|
|
|
75
71
|
* **Vue 3 現代開發專家 (`skills/neo-vue`)**:專注於 Vue 3 Composition API (`<script setup>`)、Pinia 狀態管理與 Vue Router 4。嚴格遵循官方 Style Guide 與最佳實踐,並提供反模式 (Anti-Patterns) 的避坑指引。
|
|
76
72
|
|
|
77
|
-
###
|
|
73
|
+
### 9. Rust 開發專家
|
|
78
74
|
|
|
79
75
|
* **Rust 專家 (`skills/neo-rust`)**:用於開發、重構或審查 Rust 應用程式的專家技能,涵蓋 ownership、borrowing、Result/Option 與現代 Rust 設計模式。
|
|
80
76
|
|
|
81
|
-
###
|
|
77
|
+
### 10. 需求釐清助手
|
|
82
78
|
|
|
83
79
|
* **需求釐清**:系統化引導用戶釐清模糊需求,並將其轉化為結構化的規格文件(背景、功能、約束、驗收標準)。
|
|
84
80
|
|
|
85
|
-
###
|
|
81
|
+
### 11. AI 開發流程健檢
|
|
86
82
|
|
|
87
83
|
* **AI 助手開發治理 (`skills/neo-agent-harness`)**:檢查專案規則、測試、CI、審查流程與安全防護是否足夠清楚,協助 AI 助手更穩定、更安全地參與開發。
|
|
88
84
|
|
|
89
|
-
###
|
|
85
|
+
### 12. AI Tells / Slop 贅詞消除專家
|
|
90
86
|
|
|
91
87
|
* **文字去 AI 腔調 (`skills/neo-stop-slop`)**:消除中英文 AI 腔、贅詞與公式化囉唆句式,還原為乾淨、生動且簡煉的自然語言,並包含工程師註解、Git Commit 及 PR 說明的特化優化。
|
|
92
88
|
|
|
@@ -168,10 +164,9 @@ npx skills add Benknightdark/neo-skills --all
|
|
|
168
164
|
| **16. Rust 開發專家** | `npx skills add Benknightdark/neo-skills --skill neo-rust` |
|
|
169
165
|
| **17. DevOps (Azure Pipelines) 架構師** | `npx skills add Benknightdark/neo-skills --skill neo-azure-pipelines` |
|
|
170
166
|
| **18. Code Review 專家** | `npx skills add Benknightdark/neo-skills --skill neo-code-review` |
|
|
171
|
-
| **19.
|
|
172
|
-
| **20.
|
|
173
|
-
| **21. AI
|
|
174
|
-
| **22. AI Tells/Slop 消除專家** | `npx skills add Benknightdark/neo-skills --skill neo-stop-slop` |
|
|
167
|
+
| **19. 需求分析與釐清助手** | `npx skills add Benknightdark/neo-skills --skill neo-clarification` |
|
|
168
|
+
| **20. AI 開發流程治理專家** | `npx skills add Benknightdark/neo-skills --skill neo-agent-harness` |
|
|
169
|
+
| **21. AI Tells/Slop 消除專家** | `npx skills add Benknightdark/neo-skills --skill neo-stop-slop` |
|
|
175
170
|
|
|
176
171
|
---
|
|
177
172
|
|
|
@@ -238,7 +233,6 @@ npx -p @moon791017/neo-skills install-system-instructions --ai-agent claude --in
|
|
|
238
233
|
| **設定 .NET CI Pipeline** | `neo-azure-pipelines` | `npx skills add Benknightdark/neo-skills --skill neo-azure-pipelines` | `幫這個專案設定 CI 流程` |
|
|
239
234
|
| **部署至 IIS On-Premises** | `neo-azure-pipelines` | `npx skills add Benknightdark/neo-skills --skill neo-azure-pipelines` | `部署到 IIS,站台名稱為 MySite` |
|
|
240
235
|
| **全方位程式碼深度審查** | `neo-code-review` | `npx skills add Benknightdark/neo-skills --skill neo-code-review` | `幫我 code review 剛才的修改` |
|
|
241
|
-
| **技術解析與架構洞察** | `neo-explain` | `npx skills add Benknightdark/neo-skills --skill neo-explain` | `分析這個專案的架構` |
|
|
242
236
|
| **生成 C# Interface 介面** | `neo-csharp-interface-generator` | `npx skills add Benknightdark/neo-skills --skill neo-csharp-interface-generator` | `幫我針對這個 class 產生介面` |
|
|
243
237
|
| **TS 型別設計與 CJS/ESM 互通** | `neo-typescript` | `npx skills add Benknightdark/neo-skills --skill neo-typescript` | `解決 tsconfig 還有 ESM/CJS 互通性的問題` |
|
|
244
238
|
| **複雜/模糊需求釐清與規格化** | `neo-clarification` | `npx skills add Benknightdark/neo-skills --skill neo-clarification` | `我想做一個電商網站` |
|
package/package.json
CHANGED
package/skills/neo-vue/SKILL.md
CHANGED
|
@@ -1,74 +1,113 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neo-vue
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
description: >
|
|
4
|
+
當建置、調試、重構或審查 Vue.js 應用程式、Vue 3 單一檔案元件 (SFC)、Pinia 狀態管理或 Vue Router 配置時使用此技能。
|
|
5
|
+
當專案包含 *.vue 檔案,或使用者提及「Vue」、「Pinia」、「Composition API」或「Vue Router」時觸發,
|
|
6
|
+
即使他們沒有明確要求 Vue 專家也適用。
|
|
7
|
+
license: MIT
|
|
8
|
+
compatibility: 支援 Vue 3.x (Composition API), Pinia 2.x, Vue Router 4.x, 以及 Vite 與 TypeScript。
|
|
9
|
+
metadata:
|
|
10
|
+
author: Antigravity Team
|
|
11
|
+
version: "1.1.0"
|
|
12
|
+
pattern: tool-wrapper-reviewer
|
|
7
13
|
---
|
|
8
14
|
|
|
9
|
-
# Modern Vue 3
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
3
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
15
|
+
# Modern Vue 3 & Pinia 開發專家 (neo-vue)
|
|
16
|
+
|
|
17
|
+
本技能旨在為 Agent 提供現代 Vue 3 (Composition API) 與 Pinia 狀態管理的開發與審查指南。它能確保產出的代碼完全符合官方 Vue Style Guide(優先級 A 與 B 級)的最佳實踐,避免常見的響應性陷阱(Reactivity Gotchas),並生成具備高質感與強型別的單一檔案元件(SFC)。
|
|
18
|
+
|
|
19
|
+
## Gotchas
|
|
20
|
+
* **解構 reactive 物件導致響應性丟失**:禁止直接解構 `props` 或由 `reactive()` 定義的物件(例如:`const { name } = props` 或 `const { x } = state`),這會徹底失去 Vue 響應式追蹤!
|
|
21
|
+
* **防錯機制**:必須使用 `toRefs(props)` 或 `toRef(props, 'name')` 來保持其響應性。
|
|
22
|
+
* **解構 Pinia Store 導致狀態響應性丟失**:直接解構 Pinia store 的 state(如 `const { user } = useAuthStore()`)會使 state 失去雙向響應!
|
|
23
|
+
* **防錯機制**:必須使用 `storeToRefs(store)` 來解構 state;而 action 則可以直接正常解構。
|
|
24
|
+
* **v-model 手動繁瑣綁定**:在 Vue 3.4 之前,自定義雙向綁定需要手動宣告 `modelValue` 屬性並觸發 `update:modelValue` 事件,這對 AI 而言極易寫錯。
|
|
25
|
+
* **防錯機制**:在 Vue 3.4+ 專案中,**強烈推薦**使用 `defineModel()` 巨集進行聲明,這會自動為您處理好屬性與事件,極大簡化程式碼。
|
|
26
|
+
* **v-if 與 v-for 在同一節點混用**:在 Vue 3 中,`v-if` 的優先級高於 `v-for`,這意味著 `v-if` 的條件判斷**無法**存取到 `v-for` 迴圈中的變數,會直接導致編譯或執行期報錯!
|
|
27
|
+
* **防錯機制**:永遠使用 `<template>` 標籤包裹 `v-for`,再於內部子節點使用 `v-if`,或者預先使用 `computed` 計算屬性對陣列進行過濾。
|
|
28
|
+
|
|
29
|
+
## Workflow Checklist
|
|
30
|
+
Progress:
|
|
31
|
+
- [ ] 步驟 1:感知專案環境與依賴 (Perceive Setup & Tooling)
|
|
32
|
+
- [ ] 步驟 2:載入編碼規範與踩坑指南 (Load Guides & Best Practices)
|
|
33
|
+
- [ ] 步驟 3:架構推理與響應式規劃 (Reasoning & Architecture)
|
|
34
|
+
- [ ] 步驟 4:套用範本生成高品質代碼 (Generate SFC & Stores)
|
|
35
|
+
- [ ] 步驟 5:程式碼健檢與自我校對 (Code Quality Review)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Detailed Guidelines
|
|
40
|
+
|
|
41
|
+
### 步驟 1 — 感知專案環境與依賴 (Perceive)
|
|
42
|
+
1. **檢查依賴配置**:讀取 `package.json`,確定 Vue 版本(確認為 Vue 3.x)以及是否安裝了 `pinia`、`vue-router`。
|
|
43
|
+
2. **識別建置工具與語言**:確認是否為 Vite 專案,以及是否啟用了 TypeScript(`lang="ts"`)與 Scoped CSS。
|
|
44
|
+
|
|
45
|
+
### 步驟 2 — 載入編碼規範與踩坑指南 (Reason)
|
|
46
|
+
在進行 Vue 3 開發或審查前,**必須動態載入深度知識庫**:
|
|
47
|
+
1. 讀取 `references/coding-style.md` 以確認組件命名(必須為多字詞 PascalCase)、屬性定義等官方優先級規範。
|
|
48
|
+
2. 讀取 `references/anti-patterns.md` 以避開 props mutation、computed 副作用等反模式。
|
|
49
|
+
3. 讀取 `references/patterns.md` 以獲得 Composables 的合理拆分與 Pinia Setup Stores 的架構設計。
|
|
50
|
+
|
|
51
|
+
### 步驟 3 — 架構推理與響應式規劃 (Reason)
|
|
52
|
+
在編寫程式碼前,先思考以下設計:
|
|
53
|
+
1. **Reactivity 選擇**:除非是多個屬性需要高度關聯的複雜物件,否則**優先使用 `ref()`** 而不是 `reactive()`,以確保存取 `.value` 的一致性並避免解構失活。
|
|
54
|
+
2. **狀態下沉**:評估狀態是屬於組件局部狀態(用 `ref`)還是全局狀態(用 `Pinia Setup Store`)。
|
|
55
|
+
|
|
56
|
+
### 步驟 4 — 套用範本生成高品質代碼 (Act)
|
|
57
|
+
1. **SFC 結構**:新建立的元件必須使用 `<script setup>` 語法,並強烈推薦加入 `lang="ts"`。
|
|
58
|
+
2. **套用範本**:讀取並參考 `assets/Vue3SFCComponentTemplate.vue` 作為高質感、標準 Vue 3 元件的排版範例。
|
|
59
|
+
3. **強制語言與風格**:所有程式碼註解、說明必須使用 **Traditional Chinese (Taiwan)**。專用術語需對齊(例如:元件、屬性、狀態管理、響應式、雙向綁定、計算屬性)。
|
|
60
|
+
|
|
61
|
+
### 步驟 5 — 程式碼健檢與自我校對 (Act)
|
|
62
|
+
1. 確認沒有在 `computed` 中做任何 state 修改或 API 調用等 Side Effects。
|
|
63
|
+
2. 確認沒有直接對 `props` 進行賦值與修改。
|
|
64
|
+
3. 確認 `v-for` 的 `key` 綁定使用了穩定的唯一 ID,而不是陣列索引 `index`。
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Output Templates
|
|
69
|
+
|
|
70
|
+
在生成新組件時,請嚴格按照以下高質感結構輸出(更多實作細節請參閱 `assets/Vue3SFCComponentTemplate.vue`):
|
|
71
|
+
|
|
72
|
+
```vue
|
|
73
|
+
<template>
|
|
74
|
+
<div class="vue-expert-component">
|
|
75
|
+
<!-- 模板內容 -->
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<script setup lang="ts">
|
|
80
|
+
import { ref, computed } from 'vue';
|
|
81
|
+
|
|
82
|
+
// 1. 定義屬性與事件 (Props, Emits, Models)
|
|
83
|
+
const props = defineProps<{
|
|
84
|
+
title: string;
|
|
85
|
+
}>();
|
|
86
|
+
|
|
87
|
+
const emit = defineEmits<{
|
|
88
|
+
(e: 'change', value: string): void;
|
|
89
|
+
}>();
|
|
90
|
+
|
|
91
|
+
// Vue 3.4+ 雙向綁定巨集
|
|
92
|
+
const modelValue = defineModel<string>();
|
|
93
|
+
|
|
94
|
+
// 2. 狀態定義 (State)
|
|
95
|
+
const count = ref(0);
|
|
96
|
+
|
|
97
|
+
// 3. 計算屬性 (Computed)
|
|
98
|
+
const doubleCount = computed(() => count.value * 2);
|
|
99
|
+
|
|
100
|
+
// 4. 方法定義 (Methods)
|
|
101
|
+
function handleAction() {
|
|
102
|
+
emit('change', 'action-triggered');
|
|
103
|
+
}
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<style scoped>
|
|
107
|
+
/* 必須使用 scoped 以免全域樣式污染,並優先選用 class 選擇器 */
|
|
108
|
+
.vue-expert-component {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
}
|
|
112
|
+
</style>
|
|
113
|
+
```
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="neo-card-container">
|
|
3
|
+
<header class="neo-card-header">
|
|
4
|
+
<h3 class="neo-card-title">{{ title }}</h3>
|
|
5
|
+
<span v-if="badge" class="neo-badge">{{ badge }}</span>
|
|
6
|
+
</header>
|
|
7
|
+
|
|
8
|
+
<main class="neo-card-body">
|
|
9
|
+
<p class="neo-card-description">
|
|
10
|
+
<slot name="description">這是預設的卡片描述內容。</slot>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<div class="neo-interactive-section">
|
|
14
|
+
<button
|
|
15
|
+
class="neo-btn neo-btn-primary"
|
|
16
|
+
:disabled="isLoading"
|
|
17
|
+
@click="handleAction"
|
|
18
|
+
>
|
|
19
|
+
<span v-if="isLoading" class="neo-spinner"></span>
|
|
20
|
+
{{ buttonText }}
|
|
21
|
+
</button>
|
|
22
|
+
|
|
23
|
+
<!-- 雙向綁定輸入框範例 -->
|
|
24
|
+
<input
|
|
25
|
+
v-model="inputValue"
|
|
26
|
+
type="text"
|
|
27
|
+
class="neo-input"
|
|
28
|
+
placeholder="請輸入內容..."
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</main>
|
|
32
|
+
|
|
33
|
+
<footer class="neo-card-footer">
|
|
34
|
+
<span class="neo-footer-text">點擊次數:{{ clickCount }} (雙倍: {{ doubleClickCount }})</span>
|
|
35
|
+
</footer>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script setup lang="ts">
|
|
40
|
+
import { ref, computed } from 'vue';
|
|
41
|
+
|
|
42
|
+
// ==========================================
|
|
43
|
+
// 1. 屬性 (Props) 定義 — 嚴格使用強型別聲明
|
|
44
|
+
// ==========================================
|
|
45
|
+
const props = withDefaults(
|
|
46
|
+
defineProps<{
|
|
47
|
+
title: string;
|
|
48
|
+
badge?: string;
|
|
49
|
+
buttonText?: string;
|
|
50
|
+
isLoading?: boolean;
|
|
51
|
+
}>(),
|
|
52
|
+
{
|
|
53
|
+
badge: '',
|
|
54
|
+
buttonText: '確定',
|
|
55
|
+
isLoading: false
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// ==========================================
|
|
60
|
+
// 2. 事件 (Emits) 定義 — 嚴格使用強型別聲明
|
|
61
|
+
// ==========================================
|
|
62
|
+
const emit = defineEmits<{
|
|
63
|
+
(e: 'action', clickCount: number): void;
|
|
64
|
+
(e: 'update:input', value: string): void;
|
|
65
|
+
}>();
|
|
66
|
+
|
|
67
|
+
// ==========================================
|
|
68
|
+
// 3. 雙向綁定 (Model) 定義 — Vue 3.4+ 推薦做法
|
|
69
|
+
// ==========================================
|
|
70
|
+
const inputValue = defineModel<string>({ default: '' });
|
|
71
|
+
|
|
72
|
+
// ==========================================
|
|
73
|
+
// 4. 響應式狀態 (State) 定義 — 優先選用 ref 以維持一致性
|
|
74
|
+
// ==========================================
|
|
75
|
+
const clickCount = ref(0);
|
|
76
|
+
|
|
77
|
+
// ==========================================
|
|
78
|
+
// 5. 計算屬性 (Computed) 定義 — 必須為純函式,無 Side Effects
|
|
79
|
+
// ==========================================
|
|
80
|
+
const doubleClickCount = computed(() => clickCount.value * 2);
|
|
81
|
+
|
|
82
|
+
// ==========================================
|
|
83
|
+
// 6. 方法 (Methods) 定義
|
|
84
|
+
// ==========================================
|
|
85
|
+
function handleAction() {
|
|
86
|
+
clickCount.value++;
|
|
87
|
+
emit('action', clickCount.value);
|
|
88
|
+
}
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<style scoped>
|
|
92
|
+
/* ==========================================
|
|
93
|
+
CSS 樣式設計 — 優先使用 class 選擇器以保證效能,並採用質感配色
|
|
94
|
+
========================================== */
|
|
95
|
+
:root {
|
|
96
|
+
--primary-color: #3eaf7c;
|
|
97
|
+
--primary-hover: #4abf8a;
|
|
98
|
+
--bg-color: #ffffff;
|
|
99
|
+
--border-color: #e2e8f0;
|
|
100
|
+
--text-primary: #2d3748;
|
|
101
|
+
--text-secondary: #718096;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.neo-card-container {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
background-color: var(--bg-color, #ffffff);
|
|
108
|
+
border: 1px solid var(--border-color, #e2e8f0);
|
|
109
|
+
border-radius: 12px;
|
|
110
|
+
padding: 20px;
|
|
111
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
|
|
112
|
+
transition: all 0.2s ease-in-out;
|
|
113
|
+
max-width: 400px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.neo-card-container:hover {
|
|
117
|
+
transform: translateY(-2px);
|
|
118
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.neo-card-header {
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: space-between;
|
|
124
|
+
align-items: center;
|
|
125
|
+
margin-bottom: 16px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.neo-card-title {
|
|
129
|
+
font-size: 1.25rem;
|
|
130
|
+
font-weight: 700;
|
|
131
|
+
color: var(--text-primary, #2d3748);
|
|
132
|
+
margin: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.neo-badge {
|
|
136
|
+
background-color: #e6fffa;
|
|
137
|
+
color: #319795;
|
|
138
|
+
font-size: 0.75rem;
|
|
139
|
+
font-weight: 600;
|
|
140
|
+
padding: 4px 8px;
|
|
141
|
+
border-radius: 9999px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.neo-card-body {
|
|
145
|
+
margin-bottom: 20px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.neo-card-description {
|
|
149
|
+
font-size: 0.95rem;
|
|
150
|
+
color: var(--text-secondary, #718096);
|
|
151
|
+
line-height: 1.5;
|
|
152
|
+
margin: 0 0 16px 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.neo-interactive-section {
|
|
156
|
+
display: flex;
|
|
157
|
+
gap: 12px;
|
|
158
|
+
align-items: center;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.neo-btn {
|
|
162
|
+
display: inline-flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
font-weight: 600;
|
|
166
|
+
padding: 8px 16px;
|
|
167
|
+
border-radius: 6px;
|
|
168
|
+
border: none;
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
transition: background-color 0.15s ease-in-out;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.neo-btn-primary {
|
|
174
|
+
background-color: var(--primary-color, #3eaf7c);
|
|
175
|
+
color: white;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.neo-btn-primary:hover:not(:disabled) {
|
|
179
|
+
background-color: var(--primary-hover, #4abf8a);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.neo-btn-primary:disabled {
|
|
183
|
+
opacity: 0.6;
|
|
184
|
+
cursor: not-allowed;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.neo-input {
|
|
188
|
+
flex: 1;
|
|
189
|
+
padding: 8px 12px;
|
|
190
|
+
border: 1px solid var(--border-color, #e2e8f0);
|
|
191
|
+
border-radius: 6px;
|
|
192
|
+
outline: none;
|
|
193
|
+
transition: border-color 0.15s ease;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.neo-input:focus {
|
|
197
|
+
border-color: var(--primary-color, #3eaf7c);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.neo-card-footer {
|
|
201
|
+
border-top: 1px solid var(--border-color, #e2e8f0);
|
|
202
|
+
padding-top: 12px;
|
|
203
|
+
display: flex;
|
|
204
|
+
justify-content: flex-end;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.neo-footer-text {
|
|
208
|
+
font-size: 0.8rem;
|
|
209
|
+
color: var(--text-secondary, #718096);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Spinner CSS */
|
|
213
|
+
.neo-spinner {
|
|
214
|
+
width: 14px;
|
|
215
|
+
height: 14px;
|
|
216
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
217
|
+
border-radius: 50%;
|
|
218
|
+
border-top-color: white;
|
|
219
|
+
animation: spin 0.8s linear infinite;
|
|
220
|
+
margin-right: 8px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@keyframes spin {
|
|
224
|
+
to { transform: rotate(360deg); }
|
|
225
|
+
}
|
|
226
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"query": "請幫我寫一個 Vue 3 SFC 元件,要用 TypeScript 和 <script setup>",
|
|
4
|
+
"should_trigger": true
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"query": "How to create a global state using Pinia Setup Store? Show me an example.",
|
|
8
|
+
"should_trigger": true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"query": "我的 Vue 元件 props 在子組件被修改時報錯,這該怎麼修正?",
|
|
12
|
+
"should_trigger": true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"query": "幫我看看這個 Vue 2 Options API 組件怎麼重構成 Vue 3 Composition API",
|
|
16
|
+
"should_trigger": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"query": "請幫我配置 Vue Router 4 的動態路由與導航守衛 (Navigation Guards)",
|
|
20
|
+
"should_trigger": true
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"query": "Why does destructuring my Pinia store break reactivity?",
|
|
24
|
+
"should_trigger": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"query": "請用 React 撰寫一個購物車元件,並使用 useState 管理狀態",
|
|
28
|
+
"should_trigger": false
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"query": "如何在 React 中利用 Context API 解構狀態並避免無意義重新渲染?",
|
|
32
|
+
"should_trigger": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"query": "請幫我寫一個 SQL Query,查詢 orders 表中所有已完成的訂單",
|
|
36
|
+
"should_trigger": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"query": "幫我配置一個 Dockerfile,用來部署 Nginx 靜態網站",
|
|
40
|
+
"should_trigger": false
|
|
41
|
+
}
|
|
42
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "neo-vue",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "請幫我把這個舊的 Vue 2 Options API 元件重構為 Vue 3 Composition API 與 TypeScript 強型別組件,並特別避開 props 雙向修改的反模式。",
|
|
7
|
+
"expected_output": "產出一個完美遵循 Vue 3.4+ 最佳實踐的 SFC 組件。使用 `<script setup lang="ts">`,以 `defineProps` 嚴格宣告屬性,並以 `defineEmits` 或 `defineModel` 來替代 props 直接修改。",
|
|
8
|
+
"files": [
|
|
9
|
+
"skills/neo-vue/evals/files/LegacyTodoItem.vue"
|
|
10
|
+
],
|
|
11
|
+
"assertions": [
|
|
12
|
+
"The output component uses <script setup lang=\"ts\">",
|
|
13
|
+
"The output strictly avoids mutating props directly",
|
|
14
|
+
"The output uses defineModel or typed defineEmits for parent communication",
|
|
15
|
+
"The styling block uses scoped to prevent style leakage"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": 2,
|
|
20
|
+
"prompt": "請幫我設計一個 Pinia setup store 用於管理使用者購物車狀態,並寫一個購物車明細元件,示範如何安全地解構 store 的狀態而不遺失響應性。",
|
|
21
|
+
"expected_output": "提供一個 Pinia setup store 檔案,以及一個購物車組件。組件中使用 `storeToRefs` 解構 store 的 state,以保持響應性;直接解構 actions。",
|
|
22
|
+
"assertions": [
|
|
23
|
+
"The store is structured as a Pinia Setup Store (using ref and computed instead of state and getters)",
|
|
24
|
+
"The component uses storeToRefs to safely destructure states from store",
|
|
25
|
+
"The code uses TypeScript for shopping cart items validation"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<!-- 遺留的 Vue 2 / Options API 元件,具有多項典型反模式 -->
|
|
2
|
+
<template>
|
|
3
|
+
<div class="todo-item">
|
|
4
|
+
<input type="checkbox" v-model="todo.completed" @change="statusChanged" />
|
|
5
|
+
<span :class="{ completed: todo.completed }">{{ todo.text }}</span>
|
|
6
|
+
<button @click="deleteItem">刪除</button>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'LegacyTodoItem',
|
|
13
|
+
props: {
|
|
14
|
+
// 雖然宣告了 props,但是在 template 中使用 v-model="todo.completed"
|
|
15
|
+
// 這直接修改了 props 傳入的物件屬性,違反了 props 單向資料流
|
|
16
|
+
todo: {
|
|
17
|
+
type: Object,
|
|
18
|
+
required: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
methods: {
|
|
22
|
+
statusChanged() {
|
|
23
|
+
// 潛在隱患:直接修改 props 物件內部屬性
|
|
24
|
+
this.todo.completed = !this.todo.completed;
|
|
25
|
+
this.$emit('status-change', this.todo);
|
|
26
|
+
},
|
|
27
|
+
deleteItem() {
|
|
28
|
+
// 潛在隱患:隱式地通過父元件屬性方法直接刪除,或是直接操作
|
|
29
|
+
if (this.$parent) {
|
|
30
|
+
this.$parent.todos = this.$parent.todos.filter(t => t.id !== this.todo.id);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style>
|
|
38
|
+
/* 潛在隱患:未使用 scoped,且直接使用 button 全域選擇器,引發嚴重的全域樣式污染 */
|
|
39
|
+
.todo-item {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
.completed {
|
|
44
|
+
text-decoration: line-through;
|
|
45
|
+
}
|
|
46
|
+
button {
|
|
47
|
+
margin-left: auto;
|
|
48
|
+
color: red;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: neo-explain
|
|
3
|
-
description: 分析原始碼或專案結構,提供技術解析與架構洞察。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Project Code Explanation Specification
|
|
7
|
-
|
|
8
|
-
## Perceive
|
|
9
|
-
1. Intercept the standard input (stdin) or file arguments passed via the CLI command.
|
|
10
|
-
2. Detect the file context by reading the specified file paths or the current working directory.
|
|
11
|
-
3. Identify programming languages through file extensions or shebang lines.
|
|
12
|
-
4. Capture optional flags such as `--all` or specific line ranges to define the scope of analysis.
|
|
13
|
-
|
|
14
|
-
## Reason
|
|
15
|
-
1. Structural Parsing: Map the relationships between variables, functions, and classes within the provided context.
|
|
16
|
-
2. Logic Synthesis: Consolidate fragmented code segments into a coherent operational flow.
|
|
17
|
-
3. Contextual Inference: Evaluate how the specific code block interacts with standard libraries or identified project dependencies.
|
|
18
|
-
4. Documentation Alignment: Compare the implementation against common design patterns to explain "why" the code is structured in its current form.
|
|
19
|
-
|
|
20
|
-
## Act
|
|
21
|
-
|
|
22
|
-
### Output Language
|
|
23
|
-
All output must be in **Traditional Chinese (Taiwan)**.
|
|
24
|
-
|
|
25
|
-
### Output Format
|
|
26
|
-
Structure the response using the following hierarchy:
|
|
27
|
-
|
|
28
|
-
#### 📝 Summary
|
|
29
|
-
High-level purpose and core objectives of the code.
|
|
30
|
-
|
|
31
|
-
#### ⚙️ Logic Flow
|
|
32
|
-
Step-by-step breakdown of execution, explaining data flow or control flow.
|
|
33
|
-
|
|
34
|
-
#### 🧩 Key Components
|
|
35
|
-
Definitions of primary symbols, classes, or functions and their roles.
|
|
36
|
-
|
|
37
|
-
### Additional Rules
|
|
38
|
-
1. Apply syntax highlighting to any code blocks included within the explanation.
|
|
39
|
-
2. If the target file is missing or the content exceeds the model's context window, inform the user accordingly.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: neo-start-plan
|
|
3
|
-
description: 分析需求與專案現況,並生成詳細的開發執行計畫。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Development Execution Planning Specification
|
|
7
|
-
|
|
8
|
-
## Perceive
|
|
9
|
-
1. **Context Gathering**: Systematically map the codebase using search tools (`grep_search`, `glob`) to understand file structures and existing patterns.
|
|
10
|
-
2. **Constraint Check**: Identify coding styles, configuration files (e.g., `package.json`, `gemini-extension.json`), and framework dependencies.
|
|
11
|
-
3. **Mandatory Deep Dive**: Validate all assumptions by reading relevant file contents. Do not skip this step.
|
|
12
|
-
|
|
13
|
-
## Reason
|
|
14
|
-
1. **Gap Analysis**: Clearly define the delta between the current codebase state and the user's desired state.
|
|
15
|
-
2. **Architectural Fit**: Ensure the proposed solution aligns with the established architecture (e.g., separating logic into `skills/`).
|
|
16
|
-
3. **Risk Assessment**: Identify potential breaking changes, ambiguous requirements, or side effects.
|
|
17
|
-
4. **Dependency Chain**: Determine the strictly logical order of operations (e.g., "Create directory before creating file").
|
|
18
|
-
|
|
19
|
-
## Act
|
|
20
|
-
1. **Structure the Plan**: Present the plan to the user in **Traditional Chinese (Taiwan)** using the following mandatory sections:
|
|
21
|
-
- **🧐 現況分析 (Context Analysis)**: Relevant files and architectural overview.
|
|
22
|
-
- **🎯 執行目標 (Objectives)**: Concise summary of the mission.
|
|
23
|
-
- **🛠️ 詳細執行計畫 (Step-by-Step Plan)**: Concrete steps presented as a **numbered list** (DO NOT use Markdown tables). Each step must include:
|
|
24
|
-
- **類型**: Action Type
|
|
25
|
-
- **路徑**: File Path
|
|
26
|
-
- **說明**: Detailed description
|
|
27
|
-
- **驗證**: Verification method
|
|
28
|
-
- **⚠️ 風險與確認事項 (Risks & Questions)**: Side effects or points requiring clarification.
|
|
29
|
-
2. **Constraint**: Do not write code or modify files during the planning phase.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|