Help us improve
Share bugs, ideas, or general feedback.
From bb-channel
前端项目技术栈与工具链强制约束——默认技术栈统一为 Vue 3 + TypeScript + Vite + Tailwind CSS,包管理器统一为 bun(禁用 npm / yarn / pnpm)。TRIGGER when:新建前端项目、编辑 package.json / vite.config.* / tailwind.config.* / tsconfig.json / .vue / .ts / .tsx 文件、运行前端构建或安装命令、用户提到"前端"/"vue"/"vite"/"tailwind"/"npm install"/"yarn add"/"pnpm" 等场景。
npx claudepluginhub 0xbb2b/skills --plugin bb-channelHow this skill is triggered — by the user, by Claude, or both
Slash command
/bb-channel:frontend-vue-constraintsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
适用于:**所有前端项目**——含新建项目、为既有项目添加功能、升级或迁移工具链。
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Compacts the current conversation into a handoff document for another agent to continue the work, with suggested skills and redacted sensitive info.
Share bugs, ideas, or general feedback.
适用于:所有前端项目——含新建项目、为既有项目添加功能、升级或迁移工具链。
核心理念:统一技术栈降低跨项目认知负担。 偏离默认栈必须有明确业务理由并经用户确认,不接受"个人偏好"作为偏离依据。
TRIGGER(命中任一即应应用本约束):
package.json、bun.lockbvite.config.ts / vite.config.jstailwind.config.ts / tailwind.config.jstsconfig.json / tsconfig.*.json*.vue、*.ts、*.tsx(前端项目内)index.html(Vite 项目根入口)SKIP(以下情况本约束不适用):
新建前端项目,统一使用以下技术栈,不接受个人偏好替代:
| 维度 | 默认选择 |
|---|---|
| 框架 | Vue 3 |
| 语言 | TypeScript |
| 构建工具 | Vite |
| CSS | Tailwind CSS |
| 包管理器 | bun |
<script setup>)作为默认风格.js / .jsx)作为前端源文件strict: true(含 strictNullChecks、noImplicitAny 等)*.vue 文件 <script> 必须带 lang="ts"@apply 堆叠以下替代方案禁止使用,除非有明确业务必要并经用户确认:
| 不得使用 | 应使用 | 原因 |
|---|---|---|
| Vue 2 | Vue 3 | Vue 2 已 EOL,Composition API 是主流 |
| 纯 JavaScript(无类型) | TypeScript | 类型安全、IDE 体验、重构友好 |
| webpack / rollup 直配 | Vite | HMR 速度、配置复杂度、开箱即用 |
| styled-components / emotion / 手写 SCSS 体系 | Tailwind CSS | 设计系统一致性、原子类心智模型 |
| Vuex | Pinia | Vue 3 官方推荐,TS 支持更好 |
| npm / yarn / pnpm | bun | 速度、统一工具链(详见第 3 节) |
如确需引入额外方案,必须先与用户确认,并在 PR 描述中写明:
所有前端项目必须使用 bun 作为包管理器和脚本运行工具。
npm / yarn / pnpm 一律禁止用于前端项目:
npm install <pkg> / npm run <script> / npx <cmd>yarn add <pkg> / yarn <script> / yarn dlx <cmd>pnpm add <pkg> / pnpm <script> / pnpm dlx <cmd>| 操作 | bun 命令 |
|---|---|
| 安装所有依赖 | bun install |
| 添加依赖 | bun add <pkg> |
| 添加 dev 依赖 | bun add -d <pkg> |
| 移除依赖 | bun remove <pkg> |
| 升级依赖 | bun update <pkg> |
| 运行脚本 | bun run <script> |
| 执行临时命令 | bunx <cmd>(等价于 npx) |
| 跑测试 | bun test(Bun 内置)或 bun run test |
bun.lockb 进版本控制package-lock.json / yarn.lock / pnpm-lock.yaml(发现立即删除)当用户说 "npm install X" / "yarn add X" / "pnpm add X" 时,Agent 应:
bun add X 执行dependency-version-policy skill(先查官方最新版本,不凭记忆填写)。git-workflow-discipline skill(分支策略、PR 三段式等)。新建项目时推荐使用 Vite 官方脚手架:
# 创建 Vue 3 + TS 项目
bun create vite@latest <project-name> -- --template vue-ts
# 进入项目并安装依赖
cd <project-name>
bun install
# 添加 Tailwind CSS(按官方 Vite 集成指南)
bun add -d tailwindcss @tailwindcss/vite
# 后续配置 vite.config.ts 与全局 css,详见 https://tailwindcss.com/docs/installation/using-vite
# 启动 dev server
bun run dev
⚠️ 实际依赖版本号必须按
dependency-version-policyskill 要求先查官方最新版本再写入,不要凭记忆。
新建前端项目或为前端项目添加依赖前,对照以下清单:
bun.lockb 已提交,无其他 lockfile 残留