markdowntown-backend

Enforce consistent API routes, Prisma models, and server-side validation in Next.js App Router.

Updated Dec 31, 2025
One-click install
npx skills add https://github.com/joelklabo/markdowntown-cli --skill markdowntown-backend
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: markdowntown-backend
Source: https://github.com/joelklabo/markdowntown-cli/tree/main/codex/skills/markdowntown-backend
Command: npx skills add https://github.com/joelklabo/markdowntown-cli --skill markdowntown-backend

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill centralizes patterns and guardrails for editing backend API routes, Prisma schemas/migrations, and server-side validation to prevent broken endpoints, inconsistent data models, and insecure request handling.

Core Features & Use Cases

  • API route guidance: Ensure Next.js App Router handlers use requireSession, consistent NextResponse JSON shapes, and explicit status codes.
  • Prisma & migrations: Advise schema changes, migration creation, client generation, and caller updates to keep data integrity.
  • Validation, rate limiting & cache: Reuse shared validators, apply rate limits and abuse logging, and perform safe cache tag revalidation after mutations.
  • Use Case: Update a sections API route to add create/list endpoints while preserving auth gating, validation, Prisma writes, and correct cache invalidation.

Quick Start

Update the sections API route to add create and list endpoints with requireSession, rate limiting, input validation, Prisma writes, and safe cache tag revalidation.

Frequently Asked Questions about markdowntown-backend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add API endpoints in Next.js App Router while keeping authentication and Prisma database writes secure?

To secure Next.js App Router API handlers, apply explicit requireSession auth checks, reuse shared server-side validation helpers, and execute Prisma writes to ensure data integrity during feature development and refactors.

What is the safest way to handle cache revalidation after data mutations in a Next.js backend?

Safe cache revalidation after data mutations requires explicit cache tag invalidation. This ensures updated Prisma data is accurately reflected in responses without serving stale content to API consumers.

How do I apply rate limiting and server-side validation to Next.js API routes?

Apply rate limiting and server-side validation to Next.js API routes by reusing shared validation helpers, implementing abuse logging, and returning deterministic NextResponse JSON shapes with explicit status codes.

Does Prisma schema migration require client generation when updating backend API routes?

Yes, Prisma schema migrations require client generation. Updating backend API routes safely means advising schema changes, creating migrations, generating the client, and updating callers to maintain data integrity.

What's the best way to prevent broken endpoints and inconsistent data models when refactoring a Next.js backend?

The best way to prevent broken endpoints during refactoring is enforcing consistent API route guardrails: require explicit auth checks, deterministic NextResponse JSON responses, and shared validation helpers across all handlers.