Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
0
0
# Install this skill:
npx skills add kieutrongthien/skills-fullstack --skill "frontend-vue3"
Install specific skill from multi-skill repository
# Description
Build, maintain, and debug Vue 3 frontends (Vite + TypeScript).
# SKILL.md
name: frontend-vue3
description: Build, maintain, and debug Vue 3 frontends (Vite + TypeScript).
metadata: {"openclaw":{"emoji":"#️","requires":{"bins":["npm"]}}}
Frontend - Vue 3
When to use this skill
- Feature work or fixes in Vue 3 projects scaffolded with Vite.
- Creating pages/components, routing, forms, state (Pinia), or API integration.
- Testing, linting, performance, or accessibility improvements in the Vue app.
Quick start
- Install:
npm ci(orpnpm i,yarnas project standard). - Env: copy
.env.example->.env; setVITE_API_URLand otherVITE_vars. - Dev server:
npm run dev; build:npm run build; preview:npm run preview. - Quality:
npm run lintfor ESLint;npm run test(Vitest) if present.
Project structure basics
src/main.ts: app bootstrap; registers router, Pinia, global styles.src/router/*: route definitions; lazy-load views to shrink bundles.src/stores/*: Pinia stores for shared state.src/components/*: reusable UI; keep props typed and emit events explicitly.src/composables/*: extract logic into composables for reuse/testability.
Coding principles
- Keep components small; move logic to composables; keep stores focused and typed.
- Validate inputs, handle loading/error states explicitly, and surface user-friendly messages.
- Accessibility first: semantic elements, focus management, keyboard support.
- Enforce lint/type/test/build before merge (see
scripts/dev-check.sh).
Patterns and snippets
- Composition, router, Pinia, form, and HTTP client templates live in references/snippets.md.
- Prefer route-level code splitting; centralize HTTP client (base URL, auth, error normalization).
- Use
v-model+ client-side validation; show per-field API errors.
Testing
- Component tests with Vitest + Vue Test Utils; mock stores and router as needed.
- Prefer testing behavior (rendered text, emitted events) over implementation details.
Performance and DX
- Use
<script setup>and<Suspense>for async components when helpful. - Split vendor chunks via Vite config if bundles grow large.
- Keep components small; extract logic to composables; avoid unnecessary reactive nesting.
Accessibility and UI
- Use semantic elements first; bind
aria-*labels for interactive controls. - Manage focus on navigation or modal open/close; ensure keyboard access.
Bundled resources
- scripts/dev-check.sh: run before committing/raising a PR to ensure lint, type-check, tests, and build all pass with the detected package manager.
- references/coding-standards.md: quick guardrails on component sizing, typing, accessibility, and pre-merge checks.
- references/best-practices.md: deeper guidance for routing, state, styling, API, testing, performance, and a11y decisions.
- references/snippets.md: ready-to-use templates for composition API, routing, Pinia, forms, and HTTP client setup.
- assets/pr-template.md: use when opening PRs so reviewers see scope, testing proof, and UI evidence (desktop/mobile, a11y/perf notes).
Delivery checklist
- Lint and tests clean; types pass.
- No console logs left; env vars documented; API errors surfaced to users.
- Routes lazy-loaded; bundle size reasonable; loading states present for async flows.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Amp
Antigravity
Claude Code
Clawdbot
Codex
Cursor
Droid
Gemini CLI
GitHub Copilot
Goose
Kilo Code
Kiro CLI
OpenCode
Roo Code
Trae
Windsurf
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.