用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/edfenton/claude-skills --skill mern-std命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Scaffold a pnpm + Turborepo MERN monorepo with Next.js, tooling, tests, CI, and optional GitHub repo creation.
Configure GitHub repository security with branch protection, Dependabot, security scanning, and CI workflows. Integrates with mern-scaffold, nean-scaffold, and iOS projects.
Harden a Vercel deployment with security headers, CSP, bot protection, and deployment configuration
正在显示 SKILL.md
基于 SOC 职业分类
| name | mern-std |
| description | Coding standards for MERN Next.js apps in a pnpm monorepo. |
Ensure consistent, maintainable code. Complements stack, security, and NFR skills.
apps/web/ # Next.js app
src/
app/ # Next.js app router (pages, layouts, API routes)
api/**/route.ts # API route handlers
page.tsx # Pages
layout.tsx # Layouts
components/ # React components
lib/ # Utilities
server/ # Server-only utilities
db/models/ # Mongoose models
packages/shared/ # Zod schemas, types, utilities
Important: All app router files MUST be in apps/web/src/app/, never in apps/web/app/.
Next.js with --src-dir expects the app directory inside src/.
apps/web depends on packages/shared via workspace:*process.env directly in app code; use the env modulepackages/sharedz.infer<typeof Schema> — don't duplicate interfacesSegment config exports (revalidate, dynamic, runtime, etc.) must be literal values, not imported constants:
// CORRECT - literal number
export const revalidate = 3600;
// WRONG - imported constant (fails in Next.js 16+)
import { REVALIDATE_SECONDS } from '@/config';
export const revalidate = REVALIDATE_SECONDS;
This is a Next.js static analysis requirement.
timestamps: true$ and . keys) before querieskebab-casePascalCase.tsxcamelCase.tsTDD is mandatory — see /shared-tdd for the red-green-refactor workflow and evidence requirements.
Test command: pnpm test
| Source | Test |
|---|---|
apps/web/src/components/Feature.tsx | apps/web/src/components/__tests__/Feature.test.tsx |
apps/web/src/lib/helper.ts | apps/web/src/lib/__tests__/helper.test.ts |
apps/web/src/app/api/foo/route.ts | apps/web/src/app/api/foo/__tests__/route.test.ts |
packages/shared/src/schemas/foo.ts | packages/shared/src/schemas/foo.test.ts |
For significant code changes, briefly note:
For detailed patterns and examples, see reference/mern-std-reference.md