build-engineer by 404kidwiz/claude-supercode-skills
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill build-engineer提供构建系统和 CI/CD 优化专业知识,专注于 monorepo 工具(Turborepo、Nx、Bazel)、打包器优化(Webpack/Vite/Rspack)和增量构建。通过缓存、并行化和构建性能优化,专注于提升开发速度。
| 工具 | 最适合 | 优点 | 缺点 |
|---|---|---|---|
| Turborepo | JS/TS 生态系统 | 零配置,简单,Vercel 原生支持。 | 仅限 JS(主要),比 Bazel 粒度粗。 |
| Nx | 企业级 JS/TS | 强大的插件,代码生成,图形可视化。 | 配置较重,有特定设计理念。 |
| Bazel | 多语言(Go/Java/JS) | 密封构建,无限扩展(Google 风格)。 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 学习曲线陡峭,设置复杂。 |
| Pnpm Workspaces | 简单项目 | Node.js 原生,安装快速。 | 无任务编排(需要 Turbo/Nx)。 |
优先级是什么?
│
├─ **开发速度 (HMR)**
│ ├─ Web 应用? → **Vite** (基于 ESModules,即时启动)
│ └─ 遗留应用? → **Rspack** (兼容 Webpack,Rust 速度)
│
├─ **生产优化**
│ ├─ 最大压缩? → **Webpack** (成熟的插件生态系统)
│ └─ 速度? → **Rspack / Esbuild**
│
└─ **库开发**
└─ 双模式输出 (CJS/ESM)? → **Rollup** (Tree-shaking 标准)
危险信号 → 升级到 devops-engineer:
node_modules 大小 > 1GB(幽灵依赖)目标: 通过重用缓存产物,将 CI 时间减少 80%。
步骤:
配置 (turbo.json)
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"test": {
"dependsOn": ["build"],
"inputs": ["src/**/*.tsx", "test/**/*.ts"]
},
"lint": {}
}
}
远程缓存
链接到 Vercel 远程缓存:npx turbo link。
在 CI 中(GitHub Actions):
env: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
执行
turbo run build test lint目标: 在 monorepo 中仅运行变更项目的测试。
步骤:
分析依赖图
nx graph(可视化依赖关系:应用 A 依赖库 B)。CI 流水线
# 仅测试受 PR 影响的项目
npx nx affected -t test --base=origin/main --head=HEAD
# 仅对受影响部分进行代码检查
npx nx affected -t lint --base=origin/main
目标: 理解 BUILD 文件与 package.json 的对应关系。
映射关系:
| NPM 概念 | Bazel 概念 |
|---|---|
package.json | WORKSPACE / MODULE.bazel |
script: build | js_library(name = "build") |
dependencies | deps = ["//libs/utils"] |
node_modules | npm_link_all_packages |
代码示例 (BUILD.bazel):
load("@aspect_rules_js//js:defs.bzl", "js_library")
js_library(
name = "pkg",
srcs = ["index.js"],
deps = [
"//:node_modules/lodash",
"//libs/utils"
],
)
表现:
import foo from 'foo' 在本地工作,但在 CI 中失败。失败原因:
package.json 中声明。正确做法:
表现:
失败原因:
正确做法:
madge 工具检测循环依赖:npx madge --circular .node_modules表现:
失败原因:
正确做法:
.gitignore 必须包含 node_modules/、dist/、.turbo/、.next/。性能:
可靠性:
pnpm-lock.yaml / package-lock.json 保持一致。可维护性:
package.json 脚本标准化(dev、build、test、lint)。场景: 一家拥有 500 名开发人员的公司,有 4 个 React 应用和 15 个共享库,希望从独立的仓库迁移到 monorepo,以改善代码共享和 CI 效率。
迁移方法:
迁移结果:
场景: 一个大型电商平台由于复杂的 Webpack 配置导致生产构建缓慢(12 分钟),希望改善开发者体验。
迁移策略:
性能对比:
| 指标 | Webpack | Rspack | 提升 |
|---|---|---|---|
| 开发服务器启动 | 45s | 2s | 96% |
| HMR 更新 | 8s | 0.5s | 94% |
| 生产构建 | 12m | 2m | 83% |
| 打包大小 | 2.4MB | 2.3MB | 4% |
场景: 一家游戏公司有 5000 个端到端测试,需要将 CI 时间从 90 分钟减少到 15 分钟以内,以获得快速反馈。
流水线设计:
CI 流水线配置:
# GitHub Actions with Playwright sharding
- name: Run E2E Tests
run: |
npx playwright test --shard=${{ matrix.shard }}/${{ matrix.total }} \
--config=playwright.config.ts
strategy:
matrix:
shard: [1, 2, ..., 20]
max-parallel: 10
结果:
每周安装次数
68
仓库
GitHub Stars
43
首次出现
2026年1月23日
安全审计
安装于
opencode58
claude-code53
codex51
gemini-cli51
cursor50
github-copilot44
Provides build systems and CI/CD optimization expertise specializing in monorepo tooling (Turborepo, Nx, Bazel), bundler optimization (Webpack/Vite/Rspack), and incremental builds. Focuses on optimizing development velocity through caching, parallelization, and build performance.
| Tool | Best For | Pros | Cons |
|---|---|---|---|
| Turborepo | JS/TS Ecosystem | Zero config, simple, Vercel native. | JS only (mostly), less granular than Bazel. |
| Nx | Enterprise JS/TS | Powerful plugins, code generation, graph visualization. | heavier configuration, opinionated. |
| Bazel | Polyglot (Go/Java/JS) | Hermetic builds, infinite scale (Google style). | Massive learning curve, complex setup. |
| Pnpm Workspaces | Simple Projects | Native to Node.js, fast installation. | No task orchestration (needs Turbo/Nx). |
What is the priority?
│
├─ **Development Speed (HMR)**
│ ├─ Web App? → **Vite** (ESModules based, instant start)
│ └─ Legacy App? → **Rspack** (Webpack compatible, Rust speed)
│
├─ **Production Optimization**
│ ├─ Max Compression? → **Webpack** (Mature ecosystem of plugins)
│ └─ Speed? → **Rspack / Esbuild**
│
└─ **Library Authoring**
└─ Dual Emit (CJS/ESM)? → **Rollup** (Tree-shaking standard)
Red Flags → Escalate todevops-engineer:
node_modules size > 1GB (Phantom dependencies)Goal: Reduce CI time by 80% by reusing cache artifacts.
Steps:
Configuration (turbo.json)
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"test": {
"dependsOn": ["build"],
"inputs": ["src/**/*.tsx", "test/**/*.ts"]
},
"lint": {}
}
}
Remote Cache
Link to Vercel Remote Cache: npx turbo link.
In CI (GitHub Actions):
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
Execution
turbo run build test lintGoal: Only run tests for changed projects in a monorepo.
Steps:
Analyze Graph
nx graph (Visualizes dependencies: App A depends on Lib B).CI Pipeline
# Only test projects affected by PR
npx nx affected -t test --base=origin/main --head=HEAD
# Only lint affected
npx nx affected -t lint --base=origin/main
Goal: Understand BUILD files vs package.json.
Mapping:
| NPM Concept | Bazel Concept |
|---|---|
package.json | WORKSPACE / MODULE.bazel |
script: build | js_library(name = "build") |
dependencies | deps = ["//libs/utils"] |
node_modules |
Code Example (BUILD.bazel):
load("@aspect_rules_js//js:defs.bzl", "js_library")
js_library(
name = "pkg",
srcs = ["index.js"],
deps = [
"//:node_modules/lodash",
"//libs/utils"
],
)
What it looks like:
import foo from 'foo' works locally but fails in CI.Why it fails:
package.json.Correct approach:
What it looks like:
Why it fails:
Correct approach:
madge tool to detect circular deps: npx madge --circular .node_modulesWhat it looks like:
Why it fails:
Correct approach:
.gitignore must include node_modules/, dist/, .turbo/, .next/.Performance:
Reliability:
pnpm-lock.yaml / package-lock.json is consistent.Maintainability:
package.json scripts standardized (dev, build, test, lint).Scenario: A 500-developer company with 4 React applications and 15 shared libraries wants to migrate from separate repos to a monorepo to improve code sharing and CI efficiency.
Migration Approach:
Migration Results:
Scenario: A large e-commerce platform has slow production builds (12 minutes) due to complex Webpack configuration and wants to improve developer experience.
Migration Strategy:
Performance Comparison:
| Metric | Webpack | Rspack | Improvement |
|---|---|---|---|
| Dev server start | 45s | 2s | 96% |
| HMR update | 8s | 0.5s | 94% |
| Production build | 12m | 2m | 83% |
| Bundle size | 2.4MB | 2.3MB | 4% |
Scenario: A gaming company with 5,000 E2E tests needs to reduce CI time from 90 minutes to under 15 minutes for fast feedback.
Pipeline Design:
CI Pipeline Configuration:
# GitHub Actions with Playwright sharding
- name: Run E2E Tests
run: |
npx playwright test --shard=${{ matrix.shard }}/${{ matrix.total }} \
--config=playwright.config.ts
strategy:
matrix:
shard: [1, 2, ..., 20]
max-parallel: 10
Results:
Weekly Installs
68
Repository
GitHub Stars
43
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubFailSocketWarnSnykPass
Installed on
opencode58
claude-code53
codex51
gemini-cli51
cursor50
github-copilot44
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
111,700 周安装
Playwright自动化表单填写教程 - 使用MCP实现高效Web表单自动化测试
8,600 周安装
NuGet 包管理器 - .NET 项目安全管理 NuGet 包,强制执行版本验证和恢复工作流程
8,700 周安装
Swift并发编程指南:最佳实践、快速修复与迁移策略
8,700 周安装
Vue.js 测试最佳实践指南:Vue 3 单元测试、组件测试与常见问题解决方案
8,700 周安装
Microsoft 代码参考工具 - 查找API、代码示例与错误排查,提升Azure开发效率
8,800 周安装
如何创建AGENTS.md文件 - AI编码助手项目文档指南与模板
8,800 周安装
npm_link_all_packages |