AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Mern Std

skill-edfenton-claude-skills-mern-std · by edfenton

Coding standards for MERN Next.js apps in a pnpm monorepo.

No reviews yet
0 installs
42 views
0.0% view→install

Install

$ agentstack add skill-edfenton-claude-skills-mern-std

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-edfenton-claude-skills-mern-std)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Mern Std? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Purpose

Ensure consistent, maintainable code. Complements stack, security, and NFR skills.

Monorepo structure

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:*
  • Feature-specific components live under the feature folder

Key conventions

Environment

  • Never access process.env directly in app code; use the env module

Schemas and types

  • Define request/response schemas in packages/shared
  • Infer types from zod: z.infer — don't duplicate interfaces
  • Reuse schemas across client and server

API route handlers

  • Validate input with zod at boundary
  • Consistent JSON envelope for responses
  • Safe error mapping (no stack traces to clients)
  • Pagination for list endpoints (cursor or offset)
  • Rate limiting on auth/expensive endpoints

Next.js segment configuration

Segment 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.

Mongoose

  • Explicit schemas with timestamps: true
  • Indexes defined with comments explaining why
  • Sanitize user input (reject $ and . keys) before queries

Naming

  • Folders: kebab-case
  • React components: PascalCase.tsx
  • Utilities: camelCase.ts
  • Named exports for utilities; default exports allowed for React components

Testing requirements

TDD is mandatory — see /shared-tdd for the red-green-refactor workflow and evidence requirements.

Test command: pnpm test

What to test

  • Unit tests for: validation helpers, sanitization helpers, non-trivial business logic
  • Component tests for: user interactions, conditional rendering
  • API tests for: request validation, response format, error cases
  • Playwright for critical user journeys only

Test file conventions

| 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 |

Output

For significant code changes, briefly note:

  • Any deviation from these standards and why

Reference

For detailed patterns and examples, see reference/mern-std-reference.md

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.