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

Mongodb Devrel Advisor

skill-mrlynn-claude-skills-mongodb-devrel-advisor · by mrlynn

Always-on conventions advisor for MongoDB DevRel projects providing architecture guidance, branding rules, naming conventions, database patterns, and security best practices

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

Install

$ agentstack add skill-mrlynn-claude-skills-mongodb-devrel-advisor

✓ 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 No
  • 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-mrlynn-claude-skills-mongodb-devrel-advisor)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo 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 Mongodb Devrel Advisor? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

mongodb-devrel-advisor

Trigger

Always active as background context. Use when making any architectural decision, choosing libraries, naming conventions, structuring code, or applying MongoDB branding in a DevRel project. This skill synthesizes the conventions from all other skills into a quick-reference guide.

> This is the glue. It doesn't build anything — it just keeps Claude honest about naming conventions, branding, and architecture decisions across all the other skills. — ML

Overview

This is the meta-skill — a pattern-aware advisor grounded in the actual decisions made across the MongoDB Hackathon Platform. Instead of generic best practices, it provides specific conventions that the DevRel team has validated through production use.

How to Use

This is a background context skill — it's always active and doesn't need to be explicitly invoked. Claude uses it automatically when making architectural decisions, choosing libraries, or applying MongoDB branding.

Reference Docs

  • references/naming-conventions.md — Complete naming rules for models, schemas, routes, files, roles
  • references/decision-matrix.md — Which DB driver, auth lib, UI framework, LLM, embedding model

Templates & Samples

  • assets/architecture-checklist.md — Pre-flight checklist for new features

Architecture Principles

Project Structure

  • App Router with (app) route group for layout isolation
  • src/lib/ for all server-side business logic
  • src/lib/db/models/ for Mongoose models
  • src/lib/db/schemas.ts for Zod validation schemas
  • src/lib/db/connection.ts for singleton DB connection
  • src/styles/ for theme files
  • src/components/shared-ui/ for reusable UI components
  • src/contexts/ for React context providers
  • src/types/ for TypeScript declarations

Server vs Client Components

  • Server components by default. Only add "use client" when the component uses hooks (useState, useEffect, useSession) or browser APIs.
  • Never import Mongoose in client components. It will crash the build.
  • Never import @/lib/auth in middleware.ts. It pulls in Node.js-only modules.

Naming Conventions

  • Models: PascalCase with I prefix for interface (IUser, IEvent), Model suffix for export (UserModel, EventModel)
  • Schemas: camelCase with create/update prefix (createEventSchema, updateEventSchema)
  • API routes: kebab-case paths (/api/admin/email-templates/[id]/test-send)
  • Files: kebab-case for utilities (admin-guard.ts, email-service.ts), PascalCase for components (ThemeRegistry.tsx)
  • Role types: snake_case (super_admin, organizer)

MongoDB Branding

Color Rules

| Token | Hex | Usage | |-------|-----|-------| | Spring Green | #00ED64 | Accent/CTA only. NEVER as background fill in dark mode | | Forest Green | #00684A | Primary in light mode | | Evergreen | #023430 | Primary dark variant | | Slate Blue | #001E2B | Dark mode page background, light mode text | | Blue | #006EFF | Secondary / interactive elements | | Purple | #B45AF2 | Accent (badges, highlights) | | Warning Yellow | #FFC010 | Warnings | | Error Red | #CF4520 | Errors |

Dark Mode Rules

  • Page background: #001E2B (Slate Blue)
  • Card surfaces: #0F2235 (dark navy, NOT green-tinted)
  • Primary buttons: Spring Green with Slate Blue text
  • Chips: Use rgba(0, 237, 100, 0.12) tint, not solid green
  • AppBar: Slate Blue background with 1px border rgba(255, 255, 255, 0.08)

Typography

  • Font: Inter (similar to MongoDB's Euclid Circular A)
  • Headings: weight 600, negative letter-spacing for h1/h2
  • Buttons: weight 500, textTransform: "none" (never uppercase)
  • Use clamp() for responsive heading sizes

Component Styling

  • Card: borderRadius 12, subtle shadow, 1px divider border
  • Button: borderRadius 8, no box-shadow on contained, 10px 20px padding
  • Chip: borderRadius 6, weight 500
  • TextField: borderRadius 8, focus border = primary
  • Tab: no textTransform, weight 500

Database Patterns

Connection

  • Always call connectToDatabase() before any model operation in API routes
  • Use the singleton pattern with global cache (conn + promise)
  • Set bufferCommands: false to make connection failures explicit

Querying

  • Use .lean() for read-only queries (returns plain objects, 3-5x faster)
  • Use .select("+fieldName") to include fields marked select: false
  • Use .select("-fieldName") to exclude large fields (embeddings, long text)
  • Use .sort({ createdAt: -1 }) for reverse chronological by default

Writing

  • Use $addToSet for array additions (prevents duplicates)
  • Use $pull for array removals
  • Use .partial() on Zod schemas for update operations
  • Use { timestamps: true } on all schemas for automatic createdAt/updatedAt

Indexes

  • Always create indexes for frequently queried fields
  • Use compound indexes for common query patterns ({ tier: 1, status: 1 })
  • Use sparse: true for optional unique fields (landingPage.slug)
  • Use select: false + sparse indexes for security tokens
  • Use 2dsphere for geospatial coordinates

Security Patterns

Password & Token Security

  • Hash passwords with bcrypt (bcryptjs for Node.js compatibility)
  • Hash tokens (magic link, 2FA, email verification) with SHA-256 before storing
  • Mark sensitive fields with select: false in schema definitions
  • Use crypto.randomInt() for secure random generation (not Math.random())

Account Safety

  • Soft-delete users with deletedAt (never hard-delete)
  • Ban system with banned, bannedAt, bannedReason fields
  • Check ban/delete status during authentication
  • Rate-limit sensitive operations (login, 2FA, API endpoints)

API Security

  • Validate all inputs with Zod schemas
  • Check role before any mutation
  • Use errorResponse("Forbidden", 403) for unauthorized role
  • Use errorResponse("Unauthorized", 401) for missing session
  • Never expose internal error details to clients

Singleton Patterns

All expensive-to-create resources follow the same lazy initialization:

let instance: Type | null = null;
function getInstance(): Type {
  if (!instance) {
    instance = new Type(config);
  }
  return instance;
}

Applied to: Mongoose connection, Nodemailer transporter, OpenAI client, DigestFetch client.

Error Handling

API Routes

try {
  // auth check → connect → validate → operate → respond
} catch (error) {
  console.error("METHOD /api/path error:", error);
  return errorResponse("Internal server error", 500);
}

Fire-and-Forget

For non-critical operations (email, logging, embeddings):

sendEmail({...}).catch(() => {});
logAiUsage({...}); // Already never-throws internally

Rollback

For multi-step operations (Atlas provisioning):

try {
  // step 1, 2, 3...
} catch (error) {
  // rollback: delete created resources
  if (createdResource) {
    try { await deleteResource(createdResource.id); } catch { /* log only */ }
  }
  throw error;
}

Cross-References

| Need | Use Skill | |------|-----------| | New project from scratch | mongodb-nextjs-scaffold | | Authentication & roles | mongodb-rbac-middleware | | Sending emails | mongodb-email-system | | Atlas cluster management | mongodb-atlas-provisioning | | AI summarization, RAG | mongodb-ai-features | | Event/hackathon features | mongodb-event-platform | | Sponsor management | mongodb-partner-portal |

Decision Guide

"Which database driver?" → Mongoose. It provides schema validation, model guards for hot reload, middleware hooks, and population. The native driver is only better for raw aggregation-heavy workloads.

"Which auth library?" → NextAuth v5 (beta). JWT strategy for edge compatibility. Credential + magic link providers. Role embedded in JWT token.

"Which UI framework?" → MUI 7 with the MongoDB brand theme. Provides accessible components, dark mode via colorSchemes, and responsive breakpoints out of the box.

"Which embedding model?" → Voyage AI voyage-4-large for documents, same model (or voyage-4-lite) for queries. Same embedding space, different cost/quality tradeoffs.

"Which LLM for generation?" → OpenAI GPT-4-turbo for structured outputs. GPT-4o for general chat. Use the usage logger to track costs.

"How do I add a new role?" → Add to the UserRole type and schema enum in User model. Add to the appropriate role group in admin-guard.ts. Add route protection in middleware.ts. No migration needed — existing users won't have the new role.

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.