@templmf/temp-solf-lmf 0.0.28 → 0.0.29
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 +1 -1
- package/skills/code-reviewer/SKILL.md +482 -0
- package/skills/daily-qa-skill/SKILL.md +147 -0
- package/skills/daily-qa-skill/references/tools.md +130 -0
- package/skills/element-plus-vue3/LICENSE.txt +202 -0
- package/skills/element-plus-vue3/SKILL.md +218 -0
- package/skills/element-plus-vue3/api/component-api.md +94 -0
- package/skills/element-plus-vue3/api/global-config.md +89 -0
- package/skills/element-plus-vue3/api/props-and-events.md +101 -0
- package/skills/element-plus-vue3/examples/components/button.md +99 -0
- package/skills/element-plus-vue3/examples/components/date-picker.md +115 -0
- package/skills/element-plus-vue3/examples/components/dialog.md +106 -0
- package/skills/element-plus-vue3/examples/components/form.md +127 -0
- package/skills/element-plus-vue3/examples/components/input.md +123 -0
- package/skills/element-plus-vue3/examples/components/message.md +93 -0
- package/skills/element-plus-vue3/examples/components/overview.md +59 -0
- package/skills/element-plus-vue3/examples/components/select.md +133 -0
- package/skills/element-plus-vue3/examples/components/table.md +166 -0
- package/skills/element-plus-vue3/examples/guide/design.md +68 -0
- package/skills/element-plus-vue3/examples/guide/global-config.md +95 -0
- package/skills/element-plus-vue3/examples/guide/i18n.md +95 -0
- package/skills/element-plus-vue3/examples/guide/installation.md +110 -0
- package/skills/element-plus-vue3/examples/guide/quick-start.md +103 -0
- package/skills/element-plus-vue3/examples/guide/theme.md +78 -0
- package/skills/element-plus-vue3/templates/component-usage.md +92 -0
- package/skills/element-plus-vue3/templates/installation.md +82 -0
- package/skills/element-plus-vue3/templates/project-setup.md +83 -0
package/package.json
CHANGED
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-reviewer
|
|
3
|
+
description:
|
|
4
|
+
Use this skill to review frontend code professionally. It supports both local changes(staged or working tree) and remote Pull Requests (by ID or URL). Focuses on correctness, maintainability, browser compatibility, memory leaks, XSS vulnerabilities, and modern JavaScript/CSS best practices. Trigger whenever the user asks to "review code", "review PR", "check my changes", or mentions code quality concerns in a frontend/web project.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Frontend Code Reviewer
|
|
8
|
+
|
|
9
|
+
A professional code review skill tailored for frontend projects. In addition to general
|
|
10
|
+
code quality, this skill pays special attention to browser compatibility, security
|
|
11
|
+
vulnerabilities, memory management, and modern JavaScript/CSS pitfalls.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
### 1. Determine Review Target
|
|
18
|
+
|
|
19
|
+
- **Remote PR**: If the user provides a PR number or URL (e.g., "Review PR #123"), target that remote PR.
|
|
20
|
+
- **Local Changes**: If no specific PR is mentioned, or the user says "review my changes", target current local file system state (staged and unstaged).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
### 2. Preparation
|
|
25
|
+
|
|
26
|
+
#### For Remote PRs:
|
|
27
|
+
```bash
|
|
28
|
+
gh pr checkout <PR_NUMBER>
|
|
29
|
+
npm run preflight # or yarn / pnpm equivalent
|
|
30
|
+
```
|
|
31
|
+
Read the PR description and existing comments to understand intent and history.
|
|
32
|
+
|
|
33
|
+
#### For Local Changes:
|
|
34
|
+
```bash
|
|
35
|
+
git status
|
|
36
|
+
git diff # working tree
|
|
37
|
+
git diff --staged # staged changes
|
|
38
|
+
```
|
|
39
|
+
If changes are substantial, ask whether to run `npm run preflight` first.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### 3. In-Depth Analysis
|
|
44
|
+
|
|
45
|
+
Analyze changes across the following pillars. **Frontend-specific checks are marked 🌐.**
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
#### ✅ Correctness
|
|
50
|
+
- Does the code achieve its stated purpose without bugs or logical errors?
|
|
51
|
+
- Are async flows (Promise chains, async/await, event callbacks) handled correctly?
|
|
52
|
+
- Are there race conditions or unhandled rejections?
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
#### 🌐 Browser Compatibility
|
|
57
|
+
Check whether any JS, CSS, or Web API used has limited browser support.
|
|
58
|
+
|
|
59
|
+
**JavaScript — flag if used without transpilation/polyfill:**
|
|
60
|
+
- Optional chaining `?.`, nullish coalescing `??` (ES2020)
|
|
61
|
+
- Logical assignment `||=`, `&&=`, `??=` (ES2021)
|
|
62
|
+
- `Array.at()`, `Object.hasOwn()`, `structuredClone()` (ES2022+)
|
|
63
|
+
- Top-level `await` (requires ES module context)
|
|
64
|
+
- `WeakRef`, `FinalizationRegistry`
|
|
65
|
+
- Private class fields `#field`
|
|
66
|
+
|
|
67
|
+
**Regex — flag if used without transpilation/polyfill:**
|
|
68
|
+
|
|
69
|
+
| Feature | Syntax | Introduced | Risk |
|
|
70
|
+
|---------|--------|------------|------|
|
|
71
|
+
| Named capture groups | `(?<name>...)` | ES2018 | No IE support |
|
|
72
|
+
| Lookbehind assertions | `(?<=...)` `(?<!...)` | ES2018 | No IE; Safari < 16.4 partial |
|
|
73
|
+
| `s` (dotAll) flag | `/./s` | ES2018 | No IE |
|
|
74
|
+
| Unicode property escapes | `\p{Letter}` | ES2018 | No IE; needs `u` flag |
|
|
75
|
+
| `d` (indices) flag | `/.../d` | ES2022 | Chrome 90+, Firefox 88+, Safari 15+ |
|
|
76
|
+
| `v` (unicodeSets) flag | `/.../v` | ES2024 | Chrome 112+, Firefox 116+, Safari 17+ — flag aggressively |
|
|
77
|
+
| `hasIndices` / `String.prototype.matchAll` | — | ES2020 | No IE |
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
// ❌ Lookbehind — broken in Safari < 16.4
|
|
81
|
+
const price = str.replace(/(?<=\$)\d+/, 'XX')
|
|
82
|
+
|
|
83
|
+
// ❌ Unicode property escape — no IE support, requires `u` flag
|
|
84
|
+
const isLetter = /^\p{Letter}+$/u.test(input)
|
|
85
|
+
|
|
86
|
+
// ❌ `v` flag (unicodeSets) — very new, avoid without polyfill
|
|
87
|
+
const regex = /[\p{Emoji}&&\p{ASCII}]/v
|
|
88
|
+
|
|
89
|
+
// ✅ Fallback: explicit character ranges for broad compatibility
|
|
90
|
+
const isLetter = /^[a-zA-Z\u00C0-\u024F]+$/.test(input)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Regex performance — also flag these patterns:**
|
|
94
|
+
```js
|
|
95
|
+
// ❌ Catastrophic backtracking (ReDoS risk)
|
|
96
|
+
// Nested quantifiers on overlapping patterns
|
|
97
|
+
/^(a+)+$/.test(input) // exponential backtracking
|
|
98
|
+
/(x+x+)+y/.test(input) // same issue
|
|
99
|
+
|
|
100
|
+
// ❌ Unbounded greedy match on long strings
|
|
101
|
+
/.*foo.*bar/.test(longString) // use lazy .+? or anchors
|
|
102
|
+
|
|
103
|
+
// ✅ Use atomic groups or possessive quantifiers (ES2018+)
|
|
104
|
+
// Or restructure to avoid ambiguity
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
> **Reference**: https://caniuse.com/?search=regex and https://kangax.github.io/compat-table/es2016plus/
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
**CSS — flag if used without fallback:**
|
|
112
|
+
- `container` queries
|
|
113
|
+
- `:has()` selector
|
|
114
|
+
- `@layer` cascade layers
|
|
115
|
+
- `color-mix()`, `oklch()` color functions
|
|
116
|
+
- `subgrid` layout
|
|
117
|
+
- `scrollbar-gutter`, `overscroll-behavior`
|
|
118
|
+
|
|
119
|
+
**Web APIs — verify support before use:**
|
|
120
|
+
- `ResizeObserver`, `IntersectionObserver` (good support, but verify target)
|
|
121
|
+
- `Clipboard API`, `Web Share API`, `File System Access API`
|
|
122
|
+
- `navigator.scheduling.isInputPending()`
|
|
123
|
+
- CSS Houdini / Paint Worklet APIs
|
|
124
|
+
|
|
125
|
+
> **Reference**: Always check https://caniuse.com and https://developer.mozilla.org for support tables.
|
|
126
|
+
> Flag usage with < 90% global browser support unless a polyfill or graceful fallback is present.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
#### 🌐 Memory Leaks
|
|
131
|
+
Look for patterns that prevent garbage collection or accumulate resources over time:
|
|
132
|
+
|
|
133
|
+
**Event listeners:**
|
|
134
|
+
```js
|
|
135
|
+
// ❌ Listener added but never removed
|
|
136
|
+
window.addEventListener('resize', handler)
|
|
137
|
+
|
|
138
|
+
// ✅ Cleaned up properly
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
window.addEventListener('resize', handler)
|
|
141
|
+
return () => window.removeEventListener('resize', handler)
|
|
142
|
+
}, [])
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Timers:**
|
|
146
|
+
```js
|
|
147
|
+
// ❌ Interval never cleared
|
|
148
|
+
setInterval(poll, 1000)
|
|
149
|
+
|
|
150
|
+
// ✅ Cleared on unmount / cleanup
|
|
151
|
+
const id = setInterval(poll, 1000)
|
|
152
|
+
return () => clearInterval(id)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Closures capturing large objects:**
|
|
156
|
+
- Functions closing over DOM nodes, large arrays, or entire component state unnecessarily
|
|
157
|
+
- Caches or memoization maps with no eviction policy (unbounded growth)
|
|
158
|
+
|
|
159
|
+
**Detached DOM nodes:**
|
|
160
|
+
- References to DOM elements stored in closures or variables after the element is removed
|
|
161
|
+
|
|
162
|
+
**Observers / subscriptions not unsubscribed:**
|
|
163
|
+
- `MutationObserver`, `IntersectionObserver`, `ResizeObserver` — must call `.disconnect()`
|
|
164
|
+
- Pub/sub or event bus subscriptions — must call `.off()` / `.unsubscribe()`
|
|
165
|
+
- RxJS / reactive streams — must call `.unsubscribe()`
|
|
166
|
+
- WebSocket connections not closed
|
|
167
|
+
|
|
168
|
+
**Circular references** in data structures that prevent GC.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
#### 🌐 XSS (Cross-Site Scripting) Vulnerabilities
|
|
173
|
+
Flag any code that inserts untrusted content into the DOM without sanitization.
|
|
174
|
+
|
|
175
|
+
**Dangerous patterns:**
|
|
176
|
+
```js
|
|
177
|
+
// ❌ Direct HTML injection from user input
|
|
178
|
+
element.innerHTML = userInput
|
|
179
|
+
document.write(userInput)
|
|
180
|
+
$('#el').html(userInput)
|
|
181
|
+
|
|
182
|
+
// ❌ React escape hatch with unsanitized data
|
|
183
|
+
<div dangerouslySetInnerHTML={{ __html: userInput }} />
|
|
184
|
+
|
|
185
|
+
// ❌ Dynamic script creation
|
|
186
|
+
const s = document.createElement('script')
|
|
187
|
+
s.src = userControlledUrl
|
|
188
|
+
|
|
189
|
+
// ❌ eval / Function constructor with external data
|
|
190
|
+
eval(apiResponse.code)
|
|
191
|
+
new Function(dynamicString)()
|
|
192
|
+
|
|
193
|
+
// ❌ href / src / data: URI injection
|
|
194
|
+
<a href={userInput}> // could be javascript: URI
|
|
195
|
+
<img src={userInput}> // SSRF / content injection risk
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Safe alternatives:**
|
|
199
|
+
```js
|
|
200
|
+
// ✅ Use textContent for plain text
|
|
201
|
+
element.textContent = userInput
|
|
202
|
+
|
|
203
|
+
// ✅ Sanitize before innerHTML (use DOMPurify)
|
|
204
|
+
import DOMPurify from 'dompurify'
|
|
205
|
+
element.innerHTML = DOMPurify.sanitize(userInput)
|
|
206
|
+
|
|
207
|
+
// ✅ Validate URLs before use
|
|
208
|
+
const url = new URL(userInput)
|
|
209
|
+
if (!['http:', 'https:'].includes(url.protocol)) throw new Error('Invalid protocol')
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Also check:**
|
|
213
|
+
- `postMessage` handlers — validate `event.origin` before trusting `event.data`
|
|
214
|
+
- `localStorage` / `sessionStorage` values rendered into the DOM
|
|
215
|
+
- URL query params or hash fragments used in rendering (reflected XSS)
|
|
216
|
+
- CSP headers — note if inline scripts or `unsafe-eval` directives are present in config files
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
#### 🌐 Other Frontend Security Concerns
|
|
221
|
+
- **CSRF**: Are state-mutating requests protected with tokens or `SameSite` cookies?
|
|
222
|
+
- **Sensitive data exposure**: API keys, tokens, or secrets hardcoded in frontend source
|
|
223
|
+
- **Prototype pollution**: Unsafe `Object.assign({}, untrustedData)` or `_.merge` with user input
|
|
224
|
+
- **Clickjacking**: Missing `X-Frame-Options` or CSP `frame-ancestors` in server config
|
|
225
|
+
- **Open redirects**: `window.location = userInput` without validation
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
#### 🌐 Performance
|
|
230
|
+
|
|
231
|
+
**General:**
|
|
232
|
+
- **Large bundle imports**: `import _ from 'lodash'` instead of `import debounce from 'lodash/debounce'`
|
|
233
|
+
- **Layout thrash**: Interleaved DOM reads and writes in loops (use `requestAnimationFrame` batching)
|
|
234
|
+
- **Unthrottled scroll/resize handlers**: Should use `throttle` or `debounce`
|
|
235
|
+
- **Image optimization**: Missing `loading="lazy"`, `srcset`, or WebP format
|
|
236
|
+
- **Render-blocking resources**: Synchronous scripts in `<head>` without `defer` / `async`
|
|
237
|
+
|
|
238
|
+
**React-specific:**
|
|
239
|
+
- **Unnecessary re-renders**: Missing `React.memo`, `useMemo`, `useCallback` where warranted
|
|
240
|
+
- **Missing dependency arrays**: `useEffect` / `useCallback` without deps will run on every render
|
|
241
|
+
- **Stale closures**: Deps array omitting values used inside the callback
|
|
242
|
+
|
|
243
|
+
**Vue-specific:**
|
|
244
|
+
- **Unnecessary re-renders**: Computed properties depending on non-reactive data won't update; reactive data not needed for rendering should use plain variables, not `ref`/`reactive`
|
|
245
|
+
- **`v-if` vs `v-show`**: Use `v-show` for frequently toggled elements; `v-if` for rarely shown ones
|
|
246
|
+
- **Missing `:key` on `v-for`**: Always provide a stable, unique `:key`; avoid using array index as key when list order may change
|
|
247
|
+
- **`v-for` + `v-if` on same element**: Never combine — `v-if` has higher priority in Vue 3 (lower in Vue 2), leading to confusing behavior; use a wrapping `<template>` instead
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
#### 🌐 Vue-Specific Issues
|
|
252
|
+
|
|
253
|
+
**Reactivity pitfalls (Options API):**
|
|
254
|
+
```js
|
|
255
|
+
// ❌ Adding new properties to reactive object directly (Vue 2 only)
|
|
256
|
+
this.obj.newProp = value // NOT reactive in Vue 2
|
|
257
|
+
|
|
258
|
+
// ✅ Vue 2: use Vue.set
|
|
259
|
+
this.$set(this.obj, 'newProp', value)
|
|
260
|
+
|
|
261
|
+
// ✅ Vue 3: no issue — Proxy-based reactivity handles new props
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Reactivity pitfalls (Composition API):**
|
|
265
|
+
```js
|
|
266
|
+
// ❌ Destructuring loses reactivity
|
|
267
|
+
const { count } = useMyComposable() // count is now a plain value
|
|
268
|
+
|
|
269
|
+
// ✅ Keep the ref, or use toRefs
|
|
270
|
+
const { count } = toRefs(useMyComposable())
|
|
271
|
+
|
|
272
|
+
// ❌ Replacing entire reactive object breaks reactivity
|
|
273
|
+
const state = reactive({ count: 0 })
|
|
274
|
+
state = reactive({ count: 1 }) // original reference is lost
|
|
275
|
+
|
|
276
|
+
// ✅ Mutate properties, or use ref + .value
|
|
277
|
+
state.count = 1
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
**`watch` vs `watchEffect` misuse:**
|
|
281
|
+
```js
|
|
282
|
+
// ❌ Watching a non-ref plain value — will never trigger
|
|
283
|
+
watch(count, handler) // count must be a ref, reactive prop, or getter
|
|
284
|
+
|
|
285
|
+
// ✅ Correct patterns
|
|
286
|
+
watch(() => state.count, handler)
|
|
287
|
+
watch(countRef, handler)
|
|
288
|
+
|
|
289
|
+
// ❌ watchEffect with heavy side effects and no cleanup
|
|
290
|
+
watchEffect(() => {
|
|
291
|
+
fetch(`/api?q=${query.value}`) // fires on every dependency change, no abort
|
|
292
|
+
})
|
|
293
|
+
|
|
294
|
+
// ✅ Provide cleanup for async work
|
|
295
|
+
watchEffect((onCleanup) => {
|
|
296
|
+
const controller = new AbortController()
|
|
297
|
+
fetch(`/api?q=${query.value}`, { signal: controller.signal })
|
|
298
|
+
onCleanup(() => controller.abort())
|
|
299
|
+
})
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**Memory leaks in Vue:**
|
|
303
|
+
```js
|
|
304
|
+
// ❌ Event bus or global emitter subscribed in setup/mounted, never removed
|
|
305
|
+
emitter.on('event', handler)
|
|
306
|
+
|
|
307
|
+
// ✅ Clean up in onUnmounted
|
|
308
|
+
onMounted(() => emitter.on('event', handler))
|
|
309
|
+
onUnmounted(() => emitter.off('event', handler))
|
|
310
|
+
|
|
311
|
+
// ❌ setInterval / setTimeout in setup without cleanup
|
|
312
|
+
const id = setInterval(poll, 1000)
|
|
313
|
+
|
|
314
|
+
// ✅ Clear in onUnmounted
|
|
315
|
+
onUnmounted(() => clearInterval(id))
|
|
316
|
+
|
|
317
|
+
// ❌ Third-party library instance (charts, maps, players) not destroyed
|
|
318
|
+
onMounted(() => { chart = new Chart(canvas, options) })
|
|
319
|
+
// missing: onUnmounted(() => chart.destroy())
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**XSS in Vue templates:**
|
|
323
|
+
```html
|
|
324
|
+
<!-- ❌ v-html with unsanitized user content -->
|
|
325
|
+
<div v-html="userInput" />
|
|
326
|
+
|
|
327
|
+
<!-- ✅ Sanitize first -->
|
|
328
|
+
<div v-html="DOMPurify.sanitize(userInput)" />
|
|
329
|
+
|
|
330
|
+
<!-- ❌ Dynamic component name from user input -->
|
|
331
|
+
<component :is="userDefinedComponent" />
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
**Props & emits best practices:**
|
|
335
|
+
```js
|
|
336
|
+
// ❌ Mutating props directly (violates one-way data flow)
|
|
337
|
+
props.modelValue = newVal
|
|
338
|
+
|
|
339
|
+
// ✅ Emit update event instead
|
|
340
|
+
emit('update:modelValue', newVal)
|
|
341
|
+
|
|
342
|
+
// ❌ Missing emits declaration (Vue 3) — causes attribute fallthrough warnings
|
|
343
|
+
// ✅ Always declare emits
|
|
344
|
+
const emit = defineEmits(['update:modelValue', 'close'])
|
|
345
|
+
|
|
346
|
+
// ❌ No prop validation
|
|
347
|
+
defineProps({ count: Number })
|
|
348
|
+
|
|
349
|
+
// ✅ With validator
|
|
350
|
+
defineProps({
|
|
351
|
+
count: { type: Number, required: true, validator: v => v >= 0 }
|
|
352
|
+
})
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
**`<script setup>` specific checks:**
|
|
356
|
+
- `defineProps` / `defineEmits` / `defineExpose` must be called at top level, not inside conditions
|
|
357
|
+
- Avoid using `await` at top level without `<Suspense>` wrapping the component
|
|
358
|
+
- Components imported in `<script setup>` are auto-registered — flag if the same component is also manually registered in `components:` (duplication)
|
|
359
|
+
|
|
360
|
+
**Vue Router guards — memory & navigation leaks:**
|
|
361
|
+
```js
|
|
362
|
+
// ❌ beforeEach guard added inside a component lifecycle — duplicates on re-mount
|
|
363
|
+
onMounted(() => router.beforeEach(guard))
|
|
364
|
+
|
|
365
|
+
// ✅ Register global guards only once, outside component lifecycle (e.g., main.js)
|
|
366
|
+
// Or use per-route guards in route config
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
**Pinia / Vuex state management:**
|
|
370
|
+
```js
|
|
371
|
+
// ❌ Storing non-serializable values in store (DOM nodes, class instances, functions)
|
|
372
|
+
// ❌ Direct state mutation outside actions (Vuex strict mode violation)
|
|
373
|
+
// ✅ Always mutate state through actions/mutations
|
|
374
|
+
// ✅ Use storeToRefs() when destructuring Pinia store to preserve reactivity
|
|
375
|
+
const { count } = storeToRefs(useCounterStore())
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
#### Maintainability
|
|
381
|
+
- Is the code clean, modular, and easy to modify?
|
|
382
|
+
- Does it follow the project's established patterns and naming conventions?
|
|
383
|
+
- Are magic numbers and strings replaced with named constants?
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
#### Readability
|
|
388
|
+
- Are complex logic blocks commented?
|
|
389
|
+
- Is formatting consistent with the project's linting rules?
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
#### Edge Cases & Error Handling
|
|
394
|
+
- Are network errors and empty/null responses handled gracefully?
|
|
395
|
+
- Do loading and error UI states exist where needed?
|
|
396
|
+
- Are forms validated client-side before submission?
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
#### Testability
|
|
401
|
+
- Is new logic covered by unit or integration tests?
|
|
402
|
+
- Suggest additional test cases for edge cases, async flows, or security scenarios if missing.
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
### 4. Provide Feedback
|
|
407
|
+
|
|
408
|
+
#### Structure
|
|
409
|
+
|
|
410
|
+
**Summary**
|
|
411
|
+
High-level overview: what the PR/change does and the overall quality impression.
|
|
412
|
+
|
|
413
|
+
**Findings** (group by severity)
|
|
414
|
+
|
|
415
|
+
| Severity | Label | Meaning |
|
|
416
|
+
|----------|-------|---------|
|
|
417
|
+
| 🔴 | **Critical** | Bugs, XSS, memory leaks, breaking changes — must fix |
|
|
418
|
+
| 🟡 | **Improvement** | Better patterns, performance, compatibility issues |
|
|
419
|
+
| 🔵 | **Nitpick** | Formatting, naming, minor style — optional |
|
|
420
|
+
|
|
421
|
+
For each finding include:
|
|
422
|
+
- **Location**: file + line reference
|
|
423
|
+
- **Issue**: what the problem is
|
|
424
|
+
- **Why it matters**: brief explanation
|
|
425
|
+
- **Suggestion**: concrete fix or alternative
|
|
426
|
+
|
|
427
|
+
**Conclusion**
|
|
428
|
+
- ✅ **Approved** — acknowledge specific value of the contribution
|
|
429
|
+
- 🔄 **Request Changes** — summarize what must be addressed before merging
|
|
430
|
+
|
|
431
|
+
#### Tone
|
|
432
|
+
- Constructive, professional, and friendly
|
|
433
|
+
- Always explain *why* a change is requested
|
|
434
|
+
- Distinguish must-fix from nice-to-have clearly
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
### 5. Cleanup (Remote PRs only)
|
|
439
|
+
After the review, ask the user if they want to switch back to the default branch:
|
|
440
|
+
```bash
|
|
441
|
+
git checkout main # or master
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## Quick Reference — High-Risk Patterns to Always Check
|
|
447
|
+
|
|
448
|
+
```
|
|
449
|
+
// XSS
|
|
450
|
+
innerHTML / outerHTML / insertAdjacentHTML → XSS risk
|
|
451
|
+
dangerouslySetInnerHTML (React) → XSS risk
|
|
452
|
+
v-html (Vue) → XSS risk
|
|
453
|
+
eval / new Function → XSS / code injection
|
|
454
|
+
href={userInput} / src={userInput} → URL injection
|
|
455
|
+
|
|
456
|
+
// Memory leaks
|
|
457
|
+
addEventListener without removeEventListener → memory leak
|
|
458
|
+
setInterval / setTimeout without clear* → memory leak
|
|
459
|
+
Observer without .disconnect() → memory leak
|
|
460
|
+
emitter.on without .off in onUnmounted → Vue memory leak
|
|
461
|
+
chart/map instance without .destroy() → Vue memory leak
|
|
462
|
+
|
|
463
|
+
// Vue reactivity
|
|
464
|
+
destructuring reactive/composable → loses reactivity (use toRefs)
|
|
465
|
+
replacing entire reactive() object → breaks reactivity
|
|
466
|
+
props.xxx = value → illegal prop mutation
|
|
467
|
+
v-html with unsanitized input → XSS
|
|
468
|
+
v-for without :key / :key={index} → rendering bugs
|
|
469
|
+
watch(plainValue, ...) → watcher never triggers
|
|
470
|
+
storeToRefs missing on Pinia destructure → loses reactivity
|
|
471
|
+
|
|
472
|
+
// React
|
|
473
|
+
useEffect missing deps array → runs every render
|
|
474
|
+
stale closure in useEffect → stale deps
|
|
475
|
+
|
|
476
|
+
// General
|
|
477
|
+
import entireLibrary from 'lib' → bundle bloat
|
|
478
|
+
?. ?? #privateField Array.at() → browser compat check
|
|
479
|
+
/regex/s /regex/d /regex/v (?<=...) → regex browser compat
|
|
480
|
+
(?<name>...) \p{Letter} → regex browser compat
|
|
481
|
+
(a+)+ .*foo.*bar → ReDoS / backtracking risk
|
|
482
|
+
```
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: daily-tech-qa
|
|
3
|
+
description: A daily tech Q&A assistant for answering questions about installation, version info, official links, and configuration of common developer tools. Use this skill whenever the user asks how to install a tool (e.g. Node.js, Python, Docker, Git), what versions are available, where to find the official website or docs, how to configure an environment, or how to use a package manager. Trigger on keywords like "how to install", "what versions", "official site", "how to configure", "how to use". Always provide official links, recommended versions, and multi-platform installation instructions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Daily Tech Q&A Skill
|
|
7
|
+
|
|
8
|
+
## Goal
|
|
9
|
+
|
|
10
|
+
Provide accurate, practical information about developer tools, including:
|
|
11
|
+
- 📦 Installation instructions (multi-platform)
|
|
12
|
+
- 🔖 Version info and recommended versions
|
|
13
|
+
- 🔗 Official documentation links
|
|
14
|
+
- ⚙️ Basic configuration tips
|
|
15
|
+
- 🚀 Quick-start guidance
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Response Structure
|
|
20
|
+
|
|
21
|
+
Each answer should follow this structure (include relevant sections based on the question):
|
|
22
|
+
|
|
23
|
+
### 1. Brief Introduction (1-2 sentences)
|
|
24
|
+
What the tool is and what it's used for.
|
|
25
|
+
|
|
26
|
+
### 2. Official Resources
|
|
27
|
+
- 🌐 Website: `https://...`
|
|
28
|
+
- 📖 Docs: `https://...`
|
|
29
|
+
- 💾 Download: `https://...`
|
|
30
|
+
- 🐙 GitHub: `https://...` (if applicable)
|
|
31
|
+
|
|
32
|
+
### 3. Version Info
|
|
33
|
+
- **Latest Stable (LTS)**: Recommended for production
|
|
34
|
+
- **Latest (Current)**: Newest features, may be less stable
|
|
35
|
+
- Link to full version list
|
|
36
|
+
|
|
37
|
+
### 4. Installation (by Platform)
|
|
38
|
+
|
|
39
|
+
#### macOS
|
|
40
|
+
```bash
|
|
41
|
+
# Recommended: use a package manager
|
|
42
|
+
brew install <package>
|
|
43
|
+
|
|
44
|
+
# Or download installer from official site
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### Windows
|
|
48
|
+
```powershell
|
|
49
|
+
# Recommended: use winget or Chocolatey
|
|
50
|
+
winget install <package>
|
|
51
|
+
# Or download .exe installer from official site
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### Linux (Ubuntu/Debian)
|
|
55
|
+
```bash
|
|
56
|
+
# Using apt or official script
|
|
57
|
+
sudo apt install <package>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### Universal (Version Manager)
|
|
61
|
+
Consider using a version manager (e.g. nvm, pyenv, sdkman) for easy multi-version switching.
|
|
62
|
+
|
|
63
|
+
### 5. Verify Installation
|
|
64
|
+
```bash
|
|
65
|
+
<tool> --version
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 6. Quick Start / Common Commands (optional)
|
|
69
|
+
List 3-5 most commonly used commands or config options.
|
|
70
|
+
|
|
71
|
+
### 7. Notes / Tips (optional)
|
|
72
|
+
- Environment variable setup
|
|
73
|
+
- Mirror/proxy sources
|
|
74
|
+
- Common pitfalls
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Tool Reference
|
|
79
|
+
|
|
80
|
+
Read `references/tools.md` for pre-compiled info on common tools (Node.js, Python, Docker, Git, etc.).
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Search Strategy
|
|
85
|
+
|
|
86
|
+
When the user asks about version info or the latest installation method:
|
|
87
|
+
1. **Always use web_search for the latest version** - don't rely on training data (versions change frequently)
|
|
88
|
+
2. Query format: `<tool name> latest version 2025` or `<tool name> download`
|
|
89
|
+
3. Prefer content from official websites
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Language & Style
|
|
94
|
+
|
|
95
|
+
- Respond in the user's language
|
|
96
|
+
- Always specify language type in code blocks
|
|
97
|
+
- Links should be directly clickable
|
|
98
|
+
- If a mirror or proxy source is available, list it separately
|
|
99
|
+
- Be concise and clear - avoid redundancy
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Example Q&A
|
|
104
|
+
|
|
105
|
+
**Q: How do I install Node.js? What versions are available?**
|
|
106
|
+
|
|
107
|
+
Node.js is a JavaScript runtime built on Chrome's V8 engine, widely used for server-side development and frontend tooling.
|
|
108
|
+
|
|
109
|
+
**Official Resources**
|
|
110
|
+
- 🌐 Website: https://nodejs.org
|
|
111
|
+
- 📖 Docs: https://nodejs.org/docs
|
|
112
|
+
- 💾 Download: https://nodejs.org/en/download
|
|
113
|
+
- 🐙 GitHub: https://github.com/nodejs/node
|
|
114
|
+
|
|
115
|
+
**Versions**
|
|
116
|
+
- **LTS (Long-Term Support)**: Recommended for production - currently v20.x (Iron)
|
|
117
|
+
- **Current**: Latest features, less battle-tested
|
|
118
|
+
- Full version list: https://nodejs.org/en/about/previous-releases
|
|
119
|
+
|
|
120
|
+
**Installation**
|
|
121
|
+
|
|
122
|
+
macOS:
|
|
123
|
+
```bash
|
|
124
|
+
brew install node
|
|
125
|
+
# Or use nvm for multi-version management (recommended)
|
|
126
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
|
127
|
+
nvm install --lts
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Windows:
|
|
131
|
+
```powershell
|
|
132
|
+
winget install OpenJS.NodeJS.LTS
|
|
133
|
+
# Or download the .msi installer from the official site
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Linux (Ubuntu):
|
|
137
|
+
```bash
|
|
138
|
+
# Using the official NodeSource script
|
|
139
|
+
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
|
|
140
|
+
sudo apt-get install -y nodejs
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Verify Installation**
|
|
144
|
+
```bash
|
|
145
|
+
node --version
|
|
146
|
+
npm --version
|
|
147
|
+
```
|