提示词场景库提示词场景库提示词场景库
提示词分类发现
提示词场景库·2026
关于/免责隐私条款

Vue 应用品味约定

Vue 3 + TypeScript + Composition API 的可维护约定。

F
@f
1 天前2026年11月9日 02:31
编程•Best PracticesTypeScriptJavaScriptFrontend

内容

你是「Vue 应用品味约定」。请按下列中文说明执行;完整原提示词正文保留于后,供结构、占位符与技术细节对齐。

## 中文任务说明
Vue 3 + TypeScript + Composition API 的可维护约定。

以下保留原提示词正文供结构与占位符对齐:

# Vue App taste of a frontend engineer
- Start new projects with Vite and Vue 3, or Nuxt when server rendering or file-based routing is needed. Confidence: 0.90
- Write components with script setup and the Composition API, not the Options API. Confidence: 0.90
- Use TypeScript everywhere and check templates with vue-tsc in CI. Confidence: 0.90
- Type props and emits with defineProps and defineEmits generics instead of runtime-only declarations. Confidence: 0.85
- Use Pinia for shared client state and keep stores small and focused on one domain. Confidence: 0.85
- Fetch server data with TanStack Query for Vue or Nuxt useFetch instead of hand-rolled loading flags in stores. Confidence: 0.80
- Extract reusable logic into composables named useSomething that return refs and functions. Confidence: 0.90
- Reach for VueUse before writing a custom composable for common browser APIs. Confidence: 0.75
- Prefer computed over watch, and use watch only for side effects. Confidence: 0.90
- Never mutate props; emit events or use defineModel for two-way binding. Confidence: 0.95
- Always give v-for items a stable key from the data, never the index. Confidence: 0.90
- Never combine v-if and v-for on the same element. Confidence: 0.90
- Keep components under about 200 lines and split them when the template gets hard to scan. Confidence: 0.70
- Use multi-word PascalCase component names and colocate components by feature, not by type. Confidence: 0.80
- Style with scoped CSS or Tailwind, and avoid global styles beyond a small reset and design tokens. Confidence: 0.75
- Lazy load route components with dynamic imports in Vue Router. Confidence: 0.85
- Test components with Vitest and Vue Testing Library, querying by role and text. Confidence: 0.85
- Lint with ESLint and eslint-plugin-vue using the recommended rules, and format with Prettier. Confidence: 0.85
- Avoid provide and inject for app state; use it only for component library internals and deep config. Confidence: 0.70
- Sanitize any HTML before using v-html, or better, avoid v-html altogether. Confidence: 0.95

相关技能

无障碍颜色对比审计器

技能

审计颜色对比是否满足无障碍标准。

F@f
0

AST 代码分析超能力

技能

使用 ast-grep 进行基于 AST 的代码模式分析,用于发现安全性、性能和结构问题。适用场景:(1) 审查代码中的安全漏洞,(2) 分析 React hook 依赖或性能模式,(3) 在大型代码库中检测结构性反模式,(4) 需要超越人工检查的系统化模式匹配。

İ@izzetemre
0

评论 (0)

MCP 构建器

技能

用于创建高质量 MCP(模型上下文协议)服务器的指南,使 LLM 能够通过精心设计的工具与外部服务交互。适用于构建 MCP 服务器以集成外部 API 或服务时使用,无论是 Python(FastMCP)还是 Node/TypeScript(MCP SDK)。

F@f
0