OpenParable
Skip to content
← Back to skills

Common Vue Init

Development
common-vue-init

Common Vue Init is an Agent Skill for development published in the bage2014/study repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Vue项目初始化技能,快速创建Vue前端项目

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/bage2014/study/blob/HEAD/study-ai-skills/skills/common-vue-init/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/common-vue-init, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Vue 项目初始化技能

功能描述

快速创建 Vue 项目结构,支持 Vue 3 + Vite + TypeScript 配置。

何时使用

  • 创建新的 Vue 前端项目
  • 快速搭建前端项目骨架
  • 标准化前端项目结构

核心功能

  • 生成 Vue 3 + Vite 项目结构
  • 配置 TypeScript
  • 集成 TailwindCSS
  • 创建组件模板
  • 配置 ESLint 和 Prettier

输入参数

参数类型必填说明
projectNameString是项目名称
packageManagerString否包管理器(npm/yarn/pnpm,默认 npm)
withTypeScriptBoolean否是否使用 TypeScript(默认 true)
withTailwindBoolean否是否集成 TailwindCSS(默认 true)
featuresArray否额外功能(router/pinia/axios等)

输出格式

{
  "status": "SUCCESS",
  "projectName": "my-vue-app",
  "packageManager": "npm",
  "withTypeScript": true,
  "withTailwind": true,
  "filesCreated": [
    "package.json",
    "vite.config.ts",
    "tsconfig.json",
    "src/App.vue",
    "src/main.ts",
    "src/components/"
  ],
  "nextSteps": [
    "cd my-vue-app",
    "npm install",
    "npm run dev"
  ]
}

使用流程

  1. 指定项目名称
  2. 选择包管理器和语言
  3. 添加所需功能
  4. 生成项目结构

最佳实践

  • 使用 pnpm 作为包管理器(更快、更节省空间)
  • 集成 Pinia 进行状态管理
  • 使用 Axios 进行 HTTP 请求

配置要求

vite.config.ts 示例

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src')
    }
  }
})

扩展指南

支持添加自定义模板和插件。

触发条件