AI Skill StudioAI Skill Studio
Skill Library
Presets:

Target Standard & File Format

AI Agent Rules & Skills
Context Shields & Privacy (Ignore Files)
Integrations & Machine Documentation
AI Governance & Multi-Agent Planning Suite

Identity & Activation Rules

3 chips
Scoped domain keywords evaluated in real time
api-routescode-auditsrefactoring
Suggested Chips:

Technology Stack Context

Engineering Philosophy

Flexible & Adaptable

Architectural & Code Quality Conventions

Less rigid & configurable

Agent Behavioral Guardrails

Select active rules
Security & Trust Boundaries
Always included
  • Untrusted Content Is Data
  • Encoded Payloads
  • Least-Privilege File Access
  • Confirm Irreversible Actions
  • Secret Handling
  • Validation Failures
  • Conflicting Requests

Step-by-Step Workflow Procedures

Frontend · Windsurf Cascade

Next.js 16 App Router Windsurf Cascade Rules

Generate Windsurf Cascade rules for Next.js 16 App Router in .windsurf/rules/, with the stack's conventions and checks.

Path
.windsurf/rules/nextjs-16.md
Loads
Per-rule trigger
Format
Markdown with frontmatter (.md)
Used by
Windsurf Cascade
All Windsurf presets and how <rule-name>.md works

What this file tells the agent

Windsurf's Cascade agent reads rules from .windsurf/rules/. This rule gives Cascade the Next.js 16 App Router conventions, commands and patterns to avoid, so its edits follow the stack instead of generic or outdated defaults.

  • Enforce React Server Components (RSC) by default; restrict 'use client' strictly to interactive leaf components.
  • Mutate state exclusively via Server Actions with Zod safeParse validation.
  • Await the async request APIs (cookies(), headers(), params, searchParams); Next.js 16 removed the sync forms.
  • Avoid pages/ directory conventions or legacy getServerSideProps.
  • Colocate loading.tsx and error.tsx for dynamic route segments.

Code to avoid, and what to write instead

The rule steers the agent away from the left and toward the right.

avoid
"use client";
export function SaveItem() {
  const submit = async (e: any) => {
    e.preventDefault();
    await fetch("/api/items", { method: "POST", body: JSON.stringify({ title: "Test" }) });
  };
  return <button onClick={submit}>Save</button>;
}
write instead
"use server";
import { z } from "zod";
import { db } from "@/lib/db";

const Schema = z.object({ title: z.string().min(3) });

export async function createItem(formData: FormData) {
  const parsed = Schema.safeParse(Object.fromEntries(formData));
  if (!parsed.success) return { ok: false, errors: parsed.error.flatten().fieldErrors };
  await db.item.create({ data: parsed.data });
  return { ok: true };
}

Install it in one command

  1. 01

    Go to your project root

    The file goes at .windsurf/rules/nextjs-16.md, relative to the root.

  2. 02

    Download the file

    Run the command on the right. It downloads this preset and writes the file.

  3. 03

    Make sure it gets used

    Cascade reads rules in .windsurf/rules/ and applies this one according to its trigger.

$ mkdir -p ".windsurf/rules" && curl -fsSL "https://www.devscratchpad.tech/api/raw/windsurf-rules/nextjs-16" -o ".windsurf/rules/nextjs-16.md"

writes .windsurf/rules/nextjs-16.md

path

.windsurf/rules/nextjs-16.md

To write the file from your own code instead, use Read your code or Convert Legacy Rules in the editor above.

Questions

Where do I save this Windsurf rule?
Save it as .windsurf/rules/nextjs-16.md in your project. Cascade picks up rules in that folder automatically.
When does Windsurf apply this rule?
According to the trigger in its frontmatter: always on, on a glob match, when Cascade decides the description fits the task, or when you @-mention it.