skills/my-coding-style/SKILL.md
编码时必须严格遵循我的编码风格,在进行 vue项目/nestjs项目/uniapp项目/js/ts 时应优先使用该技能,在写文档或其他编程语言时不使用该技能
npx skillsauth add sonvee/ai-skills my-coding-styleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
constants.js 文件.env.* 中读取UTF-8 编码,若遇到携带 BOM 标记的文件,则必须移除 BOM 以避免编码出现问题,如果文件中出现乱码,需要及时检测并修复编码问题type 或 interface 声明types.ts 或 types/*.tsfoo.js → foo.test.js(同目录)describe/it API(不使用 test)toMatchSnapshottoMatchFileSnapshot.pnpm-store| 使用场景 | 选择 | | -------- | ----------------------------------- | | 前端 | Vite + Vue3 | | 后端 | Nestjs + Prisma ORM v7 + PostgreSQL |
| 约定 | 偏好 |
| ------------ | ------------------------------------------------ |
| Script 语法 | 始终使用 <script setup> |
| JavaScript | 优先使用现代 JavaScript 语法,而非 TypeScript |
| 状态 | 优先 shallowRef() 而非 ref() |
| 对象 | 使用 ref(),避免 reactive() |
| Vue 路由 | Vue Router |
| UI 组件库 | Element Plus |
| 样式 | UnoCSS, Sass |
| 工具库 | VueUse, Lodash |
| 仓库状态管理 | Pinia, pinia-plugin-persistedstate(持久化插件) |
| Ajax 请求 | Axios |
components 文件夹,例如:src/views/<page-name>/components/<ComponentName>.vue,存放该页面专用组件,避免在全局组件目录下创建仅供单页面使用的组件生成新的 Vue 页面时,必须使用按页面分文件夹的结构:
src/views/<page-name>/index.vue规则:
<page-name> 必须为 kebab-casesrc/views 下直接创建单文件页面(禁止:src/views/home.vue)index.ts、types.ts、style.scss、__tests__)示例:
src/views/home/index.vue 或 src/views/about-me/index.vuesrc/views/home.vue 或 src/views/about-me.vue生成新的 Vue 组件时,必须使用按组件分文件夹的结构:
src/components/<ComponentName>/<ComponentName>.vue规则:
<ComponentName> 必须为 PascalCasesrc/components 下直接创建单文件组件(禁止:src/components/HelloWorld.vue)index.ts、types.ts、style.scss、__tests__)示例:
src/components/HelloWorld/HelloWorld.vuesrc/components/HelloWorld.vue严格按照 <template> 在上,<script setup> 在中,<style> 在下的结构生成 Vue 文件,如下:
<template></template>
<script setup></script>
<style lang="scss" scoped></style>
src/api/ # 接口层:按业务模块组织 API 请求与请求封装
├── modules/ # API 请求文件
└── request/ # Axios 封装与配置(请求拦截器和响应拦截器等)
⚠ 注意:api 接口文件禁止直接放在
src/api下
src/api/user.jssrc/api/modules/system/user.js、src/api/modules/menu/index.js、src/api/modules/login.jspinia-plugin-persistedstate 插件将 Pinia 状态持久化到 localStorage当前端需要使用 图标/字体图标/icons 时,必须遵循以下约定:
优先级:iconfont 图标 > Element Plus 图标 > UnoCSS 图标 > SVG 图标
src/assets/iconfont 下有无引入 iconfont 资源,优先使用 iconfont 的字体图标,文档链接:iconfontsrc/assets/svgs 目录下,使用 vite-svg-loader 加载器进行处理user-profile.svg、home.svgdevelopment
Pinia official Vue state management library, type-safe and extensible. Use when defining stores, working with state/getters/actions, or implementing store patterns in Vue apps.
development
NestJS best practices and architecture patterns for building production-ready applications. This skill should be used when writing, reviewing, or refactoring NestJS code to ensure proper patterns for modules, dependency injection, security, and performance.
development
用于初始化“全新的”前后端分离全栈项目脚手架与基础配置,默认目录结构为同仓库下的 `frontend/` + `backend/`。当用户表达要新建项目、初始化项目、搭建前后端分离仓库、创建 monorepo 全栈模板,或已经进入 `superteam` 模式并要求按 `fullstack-init + superteam` 流程启动一个新项目时,应优先使用本 skill。它适用于从零创建项目结构、根目录共享文件、前后端初始化流程与基础环境配置约定;不适用于现有项目中的功能开发、Bug 修复、单独初始化前端或后端、只调整 README / `.gitignore` / `.env.*`、或仅讨论技术方案而尚未真正开始初始化项目的场景。
development
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.