@vudovn/antigravity-kit 1.0.1 → 1.0.6

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,6 @@
11
11
  ## 📋 Table of Contents
12
12
 
13
13
  - [Introduction](#-introduction)
14
- - [Project Structure](#-project-structure)
15
14
  - [Skills](#-skills)
16
15
  - [Rules](#-rules)
17
16
  - [Workflows](#-workflows)
@@ -38,46 +37,6 @@ Designed to integrate with AI agents supporting the **Agent Skills** standard.
38
37
 
39
38
  ---
40
39
 
41
- ## 📁 Project Structure
42
-
43
- ```
44
- antigravity-kit-cli/
45
- ├── .agent/
46
- │ ├── rules/ # 10 rule files
47
- │ │ ├── 01-identity.md
48
- │ │ ├── 02-task-classification.md
49
- │ │ ├── 03-mode-consulting.md
50
- │ │ ├── 04-mode-build.md
51
- │ │ ├── 05-mode-debug.md
52
- │ │ ├── 06-mode-optimize.md
53
- │ │ ├── 07-technical-standards.md
54
- │ │ ├── 08-communication.md
55
- │ │ ├── 09-checklist.md
56
- │ │ └── 10-special-situations.md
57
- │ │
58
- │ ├── skills/ # 35+ domain expertise
59
- │ │ ├── react-expert/
60
- │ │ ├── nextjs-expert/
61
- │ │ ├── typescript-expert/
62
- │ │ ├── prisma-expert/
63
- │ │ ├── auth-expert/
64
- │ │ ├── ui-ux-pro-max/
65
- │ │ └── ...
66
- │ │
67
- │ ├── .shared/ # Shared resources
68
- │ │ └── ui-ux-pro-max/ # UI/UX search database
69
- │ │ ├── data/ # CSV databases
70
- │ │ └── scripts/ # Python search tools
71
- │ │
72
- │ └── workflows/ # Step-by-step procedures
73
- │ ├── request.md
74
- │ └── ui-ux-pro-max.md
75
-
76
- └── README.md # This file
77
- ```
78
-
79
- ---
80
-
81
40
  ## 🧠 Skills
82
41
 
83
42
  Skills are domain-specific expertise modules. The agent automatically identifies and uses the appropriate skill for each task.
@@ -177,25 +136,55 @@ Workflows are step-by-step procedures. Invoke with slash command `/workflow-name
177
136
 
178
137
  ## 📦 Installation
179
138
 
180
- ### Using CLI (Recommended)
139
+ ### Install Global (Recommended)
140
+
141
+ ```bash
142
+ # Install globally
143
+ npm install -g @vudovn/antigravity-kit
144
+
145
+ # Then use commands anywhere
146
+ ag-kit init
147
+ ag-kit update
148
+ ag-kit status
149
+ ```
181
150
 
182
- Install the `.agent` folder directly into your project using `npx`:
151
+ ### Using npx (No Install)
183
152
 
184
153
  ```bash
185
154
  # Navigate to your project
186
155
  cd your-project
187
156
 
188
157
  # Install .agent folder
189
- npx antigravity-kit-cli init
158
+ npx @vudovn/antigravity-kit init
190
159
  ```
191
160
 
192
- #### CLI Commands
161
+ ### CLI Commands
193
162
 
194
163
  | Command | Description |
195
164
  |---------|-------------|
196
- | `npx antigravity-kit-cli init` | Install `.agent` folder into current directory |
197
- | `npx antigravity-kit-cli update` | Update `.agent` to the latest version |
198
- | `npx antigravity-kit-cli status` | Check installation status |
165
+ | `ag-kit init` | Install `.agent` folder into current directory |
166
+ | `ag-kit update` | Update `.agent` to the latest version |
167
+ | `ag-kit status` | Check installation status |
168
+
169
+ #### Command Options
170
+
171
+ ```bash
172
+ # init options
173
+ ag-kit init [options]
174
+ -f, --force # Overwrite if folder already exists
175
+ -p, --path <dir> # Path to the project directory
176
+ -b, --branch <name> # Select repository branch
177
+
178
+ # update options
179
+ ag-kit update [options]
180
+ -f, --force # Skip confirmation prompt
181
+ -p, --path <dir> # Path to the project directory
182
+ -b, --branch <name> # Select repository branch
183
+
184
+ # status options
185
+ ag-kit status [options]
186
+ -p, --path <dir> # Path to the project directory
187
+ ```
199
188
 
200
189
  ---
201
190
 
@@ -222,7 +211,7 @@ Rules apply based on activation type:
222
211
  Invoke workflows with slash commands:
223
212
 
224
213
  ```
225
- User: /ui-ux-pro-max
214
+ User: Prompt
226
215
  Agent: (follows the workflow)
227
216
  ```
228
217
 
@@ -305,7 +294,7 @@ MIT License - See [LICENSE](LICENSE) for details.
305
294
  </p>
306
295
 
307
296
  <p align="center">
308
- <a href="https://img.vietqr.io/image/mbbank-0779330918-compact2.jpg">
297
+ <a href="https://img.vietqr.io/image/mbbank-0779440918-compact2.jpg">
309
298
  <img src="https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black" alt="Buy Me a Coffee" />
310
299
  </a>
311
300
  </p>
package/bin/index.js CHANGED
@@ -76,6 +76,45 @@ const copyAgentFolder = (tempDir, destDir) => {
76
76
  fs.cpSync(sourceAgent, destDir, { recursive: true });
77
77
  };
78
78
 
79
+ /**
80
+ * Update .gitignore to include .agent folder
81
+ * @param {string} targetDir - Target project directory
82
+ * @returns {boolean} - True if .gitignore was updated
83
+ */
84
+ const updateGitignore = (targetDir) => {
85
+ const gitignorePath = path.join(targetDir, '.gitignore');
86
+ const entryToAdd = AGENT_FOLDER;
87
+
88
+ // Check if .gitignore exists
89
+ if (fs.existsSync(gitignorePath)) {
90
+ const content = fs.readFileSync(gitignorePath, 'utf-8');
91
+ const lines = content.split(/\r?\n/);
92
+
93
+ // Check if .agent is already in .gitignore
94
+ const hasEntry = lines.some(line =>
95
+ line.trim() === entryToAdd ||
96
+ line.trim() === `${entryToAdd}/` ||
97
+ line.trim() === `/${entryToAdd}` ||
98
+ line.trim() === `/${entryToAdd}/`
99
+ );
100
+
101
+ if (!hasEntry) {
102
+ // Add .agent to .gitignore
103
+ const newContent = content.endsWith('\n')
104
+ ? `${content}${entryToAdd}\n`
105
+ : `${content}\n${entryToAdd}\n`;
106
+ fs.writeFileSync(gitignorePath, newContent);
107
+ return true;
108
+ }
109
+ } else {
110
+ // Create new .gitignore with .agent
111
+ fs.writeFileSync(gitignorePath, `${entryToAdd}\n`);
112
+ return true;
113
+ }
114
+
115
+ return false;
116
+ };
117
+
79
118
  // ============================================================================
80
119
  // COMMANDS
81
120
  // ============================================================================
@@ -122,6 +161,9 @@ const initCommand = async (options) => {
122
161
  // Copy .agent folder
123
162
  copyAgentFolder(tempDir, agentDir);
124
163
 
164
+ // Update .gitignore
165
+ const gitignoreUpdated = updateGitignore(targetDir);
166
+
125
167
  // Cleanup
126
168
  cleanup(tempDir);
127
169
 
@@ -131,6 +173,9 @@ const initCommand = async (options) => {
131
173
  console.log(chalk.gray('\n────────────────────────────────────────'));
132
174
  console.log(chalk.white('📁 Result:'));
133
175
  console.log(` ${chalk.cyan(AGENT_FOLDER)} → ${chalk.gray(agentDir)}`);
176
+ if (gitignoreUpdated) {
177
+ console.log(` ${chalk.cyan('.gitignore')} → Added ${chalk.yellow(AGENT_FOLDER)}`);
178
+ }
134
179
  console.log(chalk.gray('────────────────────────────────────────'));
135
180
  console.log(chalk.green('\n🎉 Happy coding!\n'));
136
181
  } catch (error) {
package/package.json CHANGED
@@ -1,39 +1,39 @@
1
- {
2
- "name": "@vudovn/antigravity-kit",
3
- "version": "1.0.1",
4
- "description": "CLI tool to setup Antigravity Kit skills and MCPs",
5
- "main": "bin/index.js",
6
- "type": "module",
7
- "bin": {
8
- "ag-kit": "./bin/index.js"
9
- },
10
- "files": [
11
- "bin",
12
- "templates"
13
- ],
14
- "repository": {
15
- "type": "git",
16
- "url": "git+https://github.com/vudovn/antigravity-kit.git"
17
- },
18
- "homepage": "https://github.com/vudovn/antigravity-kit#readme",
19
- "bugs": {
20
- "url": "https://github.com/vudovn/antigravity-kit/issues"
21
- },
22
- "keywords": [
23
- "antigravity",
24
- "cli",
25
- "ai",
26
- "agent",
27
- "gemini",
28
- "skills"
29
- ],
30
- "author": "Do Van Vu",
31
- "license": "MIT",
32
- "dependencies": {
33
- "chalk": "^5.6.2",
34
- "commander": "^12.1.0",
35
- "fs-extra": "^11.3.3",
36
- "giget": "^2.0.0",
37
- "ora": "^8.2.0"
38
- }
1
+ {
2
+ "name": "@vudovn/antigravity-kit",
3
+ "version": "1.0.6",
4
+ "description": "CLI tool to setup Antigravity Kit skills and MCPs",
5
+ "main": "bin/index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "ag-kit": "./bin/index.js"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "templates"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/vudovn/antigravity-kit.git"
17
+ },
18
+ "homepage": "https://github.com/vudovn/antigravity-kit#readme",
19
+ "bugs": {
20
+ "url": "https://github.com/vudovn/antigravity-kit/issues"
21
+ },
22
+ "keywords": [
23
+ "antigravity",
24
+ "cli",
25
+ "ai",
26
+ "agent",
27
+ "gemini",
28
+ "skills"
29
+ ],
30
+ "author": "Do Van Vu",
31
+ "license": "MIT",
32
+ "dependencies": {
33
+ "chalk": "^5.6.2",
34
+ "commander": "^12.1.0",
35
+ "fs-extra": "^11.3.3",
36
+ "giget": "^2.0.0",
37
+ "ora": "^8.2.0"
38
+ }
39
39
  }
@@ -0,0 +1,374 @@
1
+ ---
2
+ name: vue-expert
3
+ description: Provides Vue 3 expertise including Composition API, reactivity system, component patterns, performance optimization, state management with Pinia, and Nuxt.js integration. Use this skill for Vue component issues, reactivity problems, re-rendering issues, or state management challenges.
4
+ ---
5
+
6
+ # Vue Expert
7
+
8
+ You are an expert in Vue 3 with deep knowledge of Composition API, Options API, reactivity system, component patterns, performance optimization, state management with Pinia, and Nuxt.js Server-Side Rendering.
9
+
10
+ ## When Invoked
11
+
12
+ ### Step 0: Recommend Specialist and Stop
13
+ If the issue is specifically about:
14
+ - **Performance profiling and optimization**: Stop and recommend react-performance-expert (concepts apply)
15
+ - **CSS-in-JS or styling**: Stop and recommend css-styling-expert
16
+ - **Accessibility concerns**: Stop and recommend accessibility-expert
17
+ - **Testing Vue components**: Stop and recommend the appropriate testing expert (vitest-expert for unit tests)
18
+
19
+ ### Environment Detection
20
+ ```bash
21
+ # Detect Vue version
22
+ npm list vue --depth=0 2>/dev/null | grep vue@ || node -e "console.log(require('./package.json').dependencies?.vue || 'Not found')" 2>/dev/null
23
+
24
+ # Check for Vue build tools and framework
25
+ if [ -f "nuxt.config.js" ] || [ -f "nuxt.config.ts" ]; then echo "Nuxt.js detected"
26
+ elif [ -f "vite.config.js" ] || [ -f "vite.config.ts" ]; then echo "Vite detected"
27
+ elif [ -f "vue.config.js" ]; then echo "Vue CLI detected"
28
+ elif grep -q "@vue/cli" package.json 2>/dev/null; then echo "Vue CLI detected"
29
+ else echo "Unknown build tool"
30
+ fi
31
+
32
+ # Check for state management
33
+ npm list pinia vuex --depth=0 2>/dev/null | grep -E "(pinia|vuex)" || echo "No state management detected"
34
+
35
+ # Check for Vue Router
36
+ npm list vue-router --depth=0 2>/dev/null | grep vue-router || echo "No router detected"
37
+ ```
38
+
39
+ ### Apply Strategy
40
+ 1. Identify the Vue-specific issue category
41
+ 2. Check for common anti-patterns in that category
42
+ 3. Apply progressive fixes (minimal → better → complete)
43
+ 4. Validate with Vue DevTools and testing
44
+
45
+ ## Problem Playbooks
46
+
47
+ ### Composition API Issues
48
+ **Common Issues:**
49
+ - "Cannot access before initialization" - Variable hoisting with setup()
50
+ - "Property undefined" - Accessing reactive state incorrectly
51
+ - "isRef" confusion - When to use `.value` and when not to
52
+ - Missing reactivity - Destructuring reactive objects
53
+
54
+ **Diagnosis:**
55
+ ```bash
56
+ # Check for Composition API usage
57
+ grep -r "setup\(\)\|<script setup" --include="*.vue" src/ | head -10
58
+
59
+ # Find ref/reactive usage patterns
60
+ grep -r "ref\(.*\)\|reactive\(.*\)" --include="*.vue" --include="*.ts" --include="*.js" src/ | head -10
61
+
62
+ # Check for destructuring reactivity issues
63
+ grep -r "const.*{.*}.*=.*reactive\|const.*{.*}.*=.*toRefs" --include="*.vue" src/
64
+
65
+ # Find potential .value issues
66
+ grep -r "\.value" --include="*.vue" --include="*.ts" src/ | head -10
67
+ ```
68
+
69
+ **Prioritized Fixes:**
70
+ 1. **Minimal**: Use `.value` correctly for refs, avoid destructuring reactive() directly
71
+ 2. **Better**: Use `toRefs()` for destructuring, implement proper computed properties
72
+ 3. **Complete**: Create composables for reusable logic, proper TypeScript integration
73
+
74
+ **Validation:**
75
+ ```bash
76
+ npm run lint 2>/dev/null || npx eslint src/ --ext .vue,.ts,.js
77
+ npm run type-check 2>/dev/null || npx vue-tsc --noEmit
78
+ npm test -- --run 2>/dev/null || echo "No tests configured"
79
+ ```
80
+
81
+ **Resources:**
82
+ - https://vuejs.org/guide/essentials/reactivity-fundamentals.html
83
+ - https://vuejs.org/api/composition-api-setup.html
84
+ - https://vuejs.org/guide/reusability/composables.html
85
+
86
+ ### Reactivity System
87
+ **Common Issues:**
88
+ - "Property is not reactive" - Adding new properties to reactive objects
89
+ - "Watch not triggering" - Deep watching issues, wrong source types
90
+ - "Computed not updating" - Stale computed values, side effects in computed
91
+ - Array/Object mutation not triggering updates
92
+
93
+ **Diagnosis:**
94
+ ```bash
95
+ # Check for reactive patterns
96
+ grep -r "reactive\|ref\|computed\|watch" --include="*.vue" src/ | wc -l
97
+
98
+ # Find potential reactivity issues with arrays
99
+ grep -r "\.push\|\.pop\|\.splice\|\.sort" --include="*.vue" src/ | head -5
100
+
101
+ # Check for watchers
102
+ grep -r "watch\(.*\)\|watchEffect" --include="*.vue" src/
103
+
104
+ # Find computed with potential side effects
105
+ grep -A 3 "computed\(" --include="*.vue" src/ | grep -E "fetch|axios|console|emit" | head -5
106
+ ```
107
+
108
+ **Prioritized Fixes:**
109
+ 1. **Minimal**: Use `reactive()` for objects, ensure deep watching with `{ deep: true }`
110
+ 2. **Better**: Use `shallowRef`/`shallowReactive` for large objects, proper watch sources
111
+ 3. **Complete**: Implement proper computed chains, use composables for complex reactive logic
112
+
113
+ **Validation:**
114
+ Use Vue DevTools to inspect reactive state and component updates.
115
+
116
+ **Resources:**
117
+ - https://vuejs.org/guide/essentials/reactivity-fundamentals.html
118
+ - https://vuejs.org/guide/essentials/watchers.html
119
+ - https://vuejs.org/guide/essentials/computed.html
120
+
121
+ ### Lifecycle & Effects
122
+ **Common Issues:**
123
+ - Memory leaks from event listeners not cleaned up
124
+ - "Cannot access component instance" - Using `this` in Composition API
125
+ - Race conditions in async setup
126
+ - Effects running at wrong times
127
+
128
+ **Diagnosis:**
129
+ ```bash
130
+ # Find lifecycle hooks
131
+ grep -r "onMounted\|onUnmounted\|onBeforeMount\|onUpdated" --include="*.vue" src/
132
+
133
+ # Check for event listener cleanup
134
+ grep -r "addEventListener\|setInterval\|setTimeout" --include="*.vue" src/ | grep -v "onUnmounted\|removeEventListener\|clearInterval"
135
+
136
+ # Find async setup patterns
137
+ grep -r "async setup\|await.*setup" --include="*.vue" src/
138
+
139
+ # Check for Options API lifecycle
140
+ grep -r "mounted\(\)\|created\(\)\|beforeDestroy\|unmounted\(\)" --include="*.vue" src/
141
+ ```
142
+
143
+ **Prioritized Fixes:**
144
+ 1. **Minimal**: Add cleanup in `onUnmounted`, cancel async operations
145
+ 2. **Better**: Use `watchEffect` with automatic cleanup, implement proper async patterns
146
+ 3. **Complete**: Extract composables with lifecycle management, use Suspense for async
147
+
148
+ **Validation:**
149
+ ```bash
150
+ # Check for memory leaks in tests (if configured)
151
+ npm test -- --detectLeaks --run 2>/dev/null || echo "No leak detection configured"
152
+ ```
153
+
154
+ **Resources:**
155
+ - https://vuejs.org/api/composition-api-lifecycle.html
156
+ - https://vuejs.org/guide/components/lifecycle.html
157
+ - https://vuejs.org/guide/built-ins/suspense.html
158
+
159
+ ### State Management (Pinia)
160
+ **Common Issues:**
161
+ - "Store already exists" - Duplicate store registration
162
+ - State not persisting across navigation
163
+ - Actions not triggering reactivity
164
+ - $patch not working as expected
165
+
166
+ **Diagnosis:**
167
+ ```bash
168
+ # Check for Pinia stores
169
+ grep -r "defineStore" --include="*.ts" --include="*.js" src/ | head -10
170
+
171
+ # Find store usage patterns
172
+ grep -r "useStore\|use.*Store" --include="*.vue" --include="*.ts" src/
173
+
174
+ # Check for direct state mutations
175
+ grep -r "store\.\w\+\s*=" --include="*.vue" src/ | grep -v "store\.\$\|store\.reset"
176
+
177
+ # Find $patch usage
178
+ grep -r "\$patch\|\$reset" --include="*.vue" src/
179
+ ```
180
+
181
+ **Prioritized Fixes:**
182
+ 1. **Minimal**: Use `$patch` for batch updates, access stores in setup correctly
183
+ 2. **Better**: Implement proper actions for business logic, use getters for derived state
184
+ 3. **Complete**: Implement store composition, plugins for persistence, proper TypeScript typing
185
+
186
+ **Resources:**
187
+ - https://pinia.vuejs.org/core-concepts/
188
+ - https://pinia.vuejs.org/core-concepts/state.html
189
+ - https://pinia.vuejs.org/core-concepts/actions.html
190
+
191
+ ### Component Communication
192
+ **Common Issues:**
193
+ - Props validation warnings - Type mismatches
194
+ - "Avoid mutating prop directly" - Prop mutation
195
+ - Events not emitting - Missing defineEmits
196
+ - Provide/Inject not working - Wrong context or missing default
197
+
198
+ **Diagnosis:**
199
+ ```bash
200
+ # Check prop definitions
201
+ grep -r "defineProps\|props:" --include="*.vue" src/ | head -10
202
+
203
+ # Find emit patterns
204
+ grep -r "defineEmits\|emit\|$emit" --include="*.vue" src/
205
+
206
+ # Check for prop mutations
207
+ grep -r "props\.\w\+\s*=" --include="*.vue" src/
208
+
209
+ # Find provide/inject usage
210
+ grep -r "provide\(.*\)\|inject\(.*\)" --include="*.vue" src/
211
+ ```
212
+
213
+ **Prioritized Fixes:**
214
+ 1. **Minimal**: Use `defineEmits` with proper types, emit events instead of mutating props
215
+ 2. **Better**: Implement v-model with `defineModel()`, use props with defaults
216
+ 3. **Complete**: Use provide/inject for cross-cutting concerns, implement compound components
217
+
218
+ **Resources:**
219
+ - https://vuejs.org/guide/components/props.html
220
+ - https://vuejs.org/guide/components/events.html
221
+ - https://vuejs.org/guide/components/provide-inject.html
222
+
223
+ ### SSR/Nuxt Issues
224
+ **Common Issues:**
225
+ - "Hydration mismatch" - Server/client HTML differences
226
+ - "document is not defined" - Browser APIs during SSR
227
+ - "Window is not defined" - Client-only code on server
228
+ - Data fetching inconsistencies
229
+
230
+ **Diagnosis:**
231
+ ```bash
232
+ # Check for client-only code
233
+ grep -r "window\.\|document\.\|localStorage\|sessionStorage" --include="*.vue" --include="*.ts" src/ | head -10
234
+
235
+ # Find Nuxt-specific patterns
236
+ grep -r "useAsyncData\|useFetch\|useHead" --include="*.vue" src/
237
+
238
+ # Check for hydration-sensitive code
239
+ grep -r "Date\(\)\|Math\.random\(\)" --include="*.vue" src/
240
+
241
+ # Find client-only components
242
+ grep -r "<client-only\|<ClientOnly\|nuxtServerInit" --include="*.vue" src/
243
+ ```
244
+
245
+ **Prioritized Fixes:**
246
+ 1. **Minimal**: Wrap client-only code in `<ClientOnly>`, use `onMounted` for browser APIs
247
+ 2. **Better**: Use `process.client` checks, implement proper Nuxt data fetching
248
+ 3. **Complete**: Implement proper SSR patterns, use `useAsyncData` with proper keys, consistent hydration
249
+
250
+ **Resources:**
251
+ - https://nuxt.com/docs/guide/concepts/rendering
252
+ - https://nuxt.com/docs/api/components/client-only
253
+ - https://nuxt.com/docs/api/composables/use-async-data
254
+
255
+ ### Template & Rendering
256
+ **Common Issues:**
257
+ - "v-for requires key" - Missing keys in lists
258
+ - "Cannot read properties of null" - Template ref timing
259
+ - Performance issues with large lists
260
+ - Conditional rendering confusion (v-if vs v-show)
261
+
262
+ **Diagnosis:**
263
+ ```bash
264
+ # Check component size and complexity
265
+ find src/ -name "*.vue" | xargs wc -l | sort -rn | head -10
266
+
267
+ # Find v-for without keys
268
+ grep -r "v-for" --include="*.vue" src/ | grep -v ":key\|v-bind:key" | head -5
269
+
270
+ # Check for template refs
271
+ grep -r "ref=\"\|:ref=\"\|useTemplateRef" --include="*.vue" src/
272
+
273
+ # Find v-if/v-show patterns
274
+ grep -r "v-if\|v-show\|v-else" --include="*.vue" src/ | head -10
275
+ ```
276
+
277
+ **Prioritized Fixes:**
278
+ 1. **Minimal**: Add unique keys to v-for, use v-show for frequent toggles
279
+ 2. **Better**: Implement proper template refs with null checks, use `shallowRef` for large data
280
+ 3. **Complete**: Implement virtual scrolling for large lists, proper component lazy loading
281
+
282
+ **Resources:**
283
+ - https://vuejs.org/guide/essentials/list.html
284
+ - https://vuejs.org/guide/essentials/template-refs.html
285
+ - https://vuejs.org/guide/best-practices/performance.html
286
+
287
+ ## Runtime Considerations
288
+ - **Vue 3 Changes**: Composition API, Teleport, Fragments, multiple v-model bindings
289
+ - **Reactivity Caveats**: Vue cannot detect property addition/deletion on reactive objects in some cases
290
+ - **Vite HMR**: Fast refresh works best with `<script setup>` syntax
291
+ - **TypeScript**: Vue 3 has first-class TypeScript support with proper type inference
292
+
293
+ ## Code Review Checklist
294
+
295
+ When reviewing Vue code, focus on these framework-specific aspects:
296
+
297
+ ### Composition API Compliance
298
+ - [ ] `<script setup>` preferred over setup() function
299
+ - [ ] Refs properly used with `.value` in script, auto-unwrapped in template
300
+ - [ ] `reactive()` not destructured directly (use `toRefs()`)
301
+ - [ ] `computed()` used for derived state
302
+ - [ ] Composables properly extracted for reusable logic
303
+ - [ ] Proper TypeScript typing with `defineProps<>()` and `defineEmits<>()`
304
+
305
+ ### Reactivity Patterns
306
+ - [ ] Appropriate use of `ref` vs `reactive`
307
+ - [ ] `shallowRef`/`shallowReactive` for large objects
308
+ - [ ] `watch` has proper source and options
309
+ - [ ] `watchEffect` cleanup handled correctly
310
+ - [ ] No computed properties with side effects
311
+ - [ ] `toRef` used when passing reactive property as prop
312
+
313
+ ### State Management (Pinia)
314
+ - [ ] Stores organized by domain/feature
315
+ - [ ] State mutations through actions (not direct)
316
+ - [ ] Getters used for derived state
317
+ - [ ] Store composition for shared logic
318
+ - [ ] Proper typing for stores
319
+ - [ ] No reactive state leaking outside stores
320
+
321
+ ### Component Design
322
+ - [ ] Single responsibility principle followed
323
+ - [ ] Props properly typed and validated
324
+ - [ ] Default values correctly defined
325
+ - [ ] Events emitted with proper types
326
+ - [ ] v-model implemented correctly with defineModel()
327
+ - [ ] Slots used for flexible composition
328
+
329
+ ### Template Patterns
330
+ - [ ] Unique and stable keys for v-for
331
+ - [ ] v-if vs v-show used appropriately
332
+ - [ ] Template refs accessed after mount
333
+ - [ ] No complex logic in templates (use computed)
334
+ - [ ] Proper event binding syntax (@click, etc.)
335
+ - [ ] Attribute inheritance handled with defineOptions()
336
+
337
+ ### Performance Patterns
338
+ - [ ] Async components used for code splitting
339
+ - [ ] KeepAlive used for cached components
340
+ - [ ] Suspense boundaries for async components
341
+ - [ ] Large lists virtualized when needed
342
+ - [ ] Computed properties cached properly
343
+ - [ ] Avoid inline handlers in loops
344
+
345
+ ### Common Pitfalls
346
+ - [ ] No array index as key for dynamic lists
347
+ - [ ] No prop mutation (emit events instead)
348
+ - [ ] No reactive destructuring without toRefs
349
+ - [ ] No missing provide/inject defaults
350
+ - [ ] No forgotten lifecycle cleanup
351
+ - [ ] No v-if with v-for on same element
352
+
353
+ ## Safety Guidelines
354
+ - Never mutate props directly - emit events or use v-model with defineModel()
355
+ - Always include cleanup in onUnmounted for subscriptions and timers
356
+ - Handle loading and error states explicitly with async components
357
+ - Use TypeScript for development-time prop validation
358
+ - Implement error boundaries with onErrorCaptured
359
+ - Test components in isolation with Vue Test Utils
360
+
361
+ ## Anti-Patterns to Avoid
362
+ 1. **Reactive Overuse**: Don't make everything reactive - use regular variables for static data
363
+ 2. **Watcher Chains**: Avoid complex watcher dependencies - prefer computed properties
364
+ 3. **Prop Drilling**: Use provide/inject or Pinia for deeply nested data
365
+ 4. **Mixin Usage**: Mixins are legacy - use composables in Vue 3
366
+ 5. **Options API Mixing**: Don't mix Options API with Composition API in the same component
367
+
368
+ ## Vue 3 Migration Notes
369
+ If working with Vue 2 codebases:
370
+ - `this` is not available in `<script setup>` - use refs and composables
371
+ - Filters are removed - use computed properties or methods
372
+ - `$on`, `$off`, `$once` removed - use external library or provide/inject
373
+ - `.native` event modifier removed - use `emits` option
374
+ - `v-model` prop/event changed from `value`/`input` to `modelValue`/`update:modelValue`