Opinionated Nextjs Patterns
pproenca/dot-skills
Opinionated, backend-agnostic Next.js 16 (App Router) architecture — authorization at the data layer, server-side loading with cache()+Promise.all, mutations through next-safe-action + typed route…
API route implementation patterns with RLS, Zod validation, and error handling.
$ npx skills add bybren-llc/safe-agentic-workflow --skill api-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install bybren-llc/safe-agentic-workflow api-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/bybren-llc/safe-agentic-workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/api-patterns .claude/skills/api-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "api-patterns" agent skill from https://github.com/bybren-llc/safe-agentic-workflow/tree/main/.claude/skills/api-patterns into .claude/skills/api-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "api-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/bybren-llc/safe-agentic-workflow/tree/main/.claude/skills/api-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add bybren-llc/safe-agentic-workflow --skill api-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install bybren-llc/safe-agentic-workflow api-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bybren-llc/safe-agentic-workflow.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/api-patterns .agents/skills/api-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "api-patterns" agent skill from https://github.com/bybren-llc/safe-agentic-workflow/tree/main/.claude/skills/api-patterns into .agents/skills/api-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "api-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add bybren-llc/safe-agentic-workflow --skill api-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install bybren-llc/safe-agentic-workflow api-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bybren-llc/safe-agentic-workflow.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/api-patterns .cursor/skills/api-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "api-patterns" agent skill from https://github.com/bybren-llc/safe-agentic-workflow/tree/main/.claude/skills/api-patterns into .cursor/skills/api-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "api-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/bybren-llc/safe-agentic-workflow.git --path .claude/skills/api-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add bybren-llc/safe-agentic-workflow --skill api-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install bybren-llc/safe-agentic-workflow api-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bybren-llc/safe-agentic-workflow.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/api-patterns .gemini/skills/api-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "api-patterns" agent skill from https://github.com/bybren-llc/safe-agentic-workflow/tree/main/.claude/skills/api-patterns into .gemini/skills/api-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "api-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install bybren-llc/safe-agentic-workflow api-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add bybren-llc/safe-agentic-workflow --skill api-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/bybren-llc/safe-agentic-workflow.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/api-patterns .github/skills/api-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "api-patterns" agent skill from https://github.com/bybren-llc/safe-agentic-workflow/tree/main/.claude/skills/api-patterns into .github/skills/api-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "api-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add bybren-llc/safe-agentic-workflow --skill api-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install bybren-llc/safe-agentic-workflow api-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/bybren-llc/safe-agentic-workflow.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/api-patterns .opencode/skills/api-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "api-patterns" agent skill from https://github.com/bybren-llc/safe-agentic-workflow/tree/main/.claude/skills/api-patterns into .opencode/skills/api-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "api-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
api-patternsAPI route implementation patterns with RLS, Zod validation, and error handling.
API Patterns is an agent skill from bybren-llc/safe-agentic-workflow. API route implementation patterns with RLS, Zod validation, and error handling. Use when creating API routes, implementing endpoints, or adding server-side validation.
Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `README.md`).
It sits in Backend & APIs, covering Forms and validation and Backend development. It works with Zod. The repository describes itself as: SAW — SAFe Agentic Workflow AI Agent Harness for Multi-Agent Team Workflows Built on SAFe methodology (Scaled Agile Framework), adapted for AI agent teams (Now With AI-DLC!)… The licence is MIT.
Read from SKILL.md and the folder at commit 26ca58b. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadGrepGlobFrom allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and markdown).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
API Patterns loads about 1.6k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 201 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from bybren-llc/safe-agentic-workflow at commit 26ca58b, republished under its MIT licence (© bybren-llc). 201 words, ~1,556 tokens.
.claude/skills/api-patterns/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Route to existing API patterns and provide checklists for safe, validated API route implementation. All API routes MUST use RLS context helpers—see rls-patterns skill.
Invoke this skill when:
| Pattern | Location | Purpose |
|---|---|---|
| User Context API | patterns_library/api/user-context-api.md | User-scoped operations |
| Admin Context API | patterns_library/api/admin-context-api.md | Admin-scoped operations |
| Zod Validation | patterns_library/api/zod-validation-api.md | Request/response validation |
| Webhook Handler | patterns_library/api/webhook-handler.md | Webhook processing |
| Bonus Content | patterns_library/api/bonus-content-delivery.md | Protected content delivery |
// FORBIDDEN: Direct Prisma calls (bypass RLS)
const users = await prisma.user.findMany();
// Must use: withUserContext, withAdminContext, or withSystemContext
// FORBIDDEN: Missing authentication check
export async function GET(req: Request) {
return getUserData(); // No auth check!
}
// FORBIDDEN: Unvalidated user input
const { userId } = await req.json();
// Must validate with Zod schema
// FORBIDDEN: Generic error responses
return new Response("Error", { status: 500 });
// Must use structured error response// CORRECT: RLS context + auth check
export async function GET(req: Request) {
const { userId } = await auth();
if (!userId) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const data = await withUserContext(prisma, userId, async (client) => {
return client.user.findUnique({ where: { user_id: userId } });
});
return NextResponse.json(data);
}
// CORRECT: Zod validation
const schema = z.object({
email: z.string().email(),
name: z.string().min(1),
});
const result = schema.safeParse(body);
if (!result.success) {
return NextResponse.json(
{ error: "Validation failed", details: result.error.flatten() },
{ status: 400 },
);
}Before ANY API route:
await auth() from ClerkwithUserContext/withAdminContext/withSystemContext)return NextResponse.json({ data, success: true }, { status: 200 });return NextResponse.json(
{
error: "Human-readable error message",
code: "ERROR_CODE",
details: optional_details,
},
{ status: 400 | 401 | 403 | 404 | 500 },
);| Code | When to Use |
|---|---|
| 200 | Success |
| 201 | Created (POST) |
| 400 | Bad request / validation error |
| 401 | Not authenticated |
| 403 | Forbidden (authenticated but not authorized) |
| 404 | Resource not found |
| 500 | Server error |
import { auth } from "@clerk/nextjs/server";
import { NextResponse } from "next/server";
import { z } from "zod";
import { withUserContext } from "@/lib/rls-helpers";
import { prisma } from "@/lib/prisma";
// Request validation schema
const RequestSchema = z.object({
// Define expected fields
});
export async function POST(req: Request) {
try {
// 1. Authenticate
const { userId } = await auth();
if (!userId) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
// 2. Parse and validate request
const body = await req.json();
const result = RequestSchema.safeParse(body);
if (!result.success) {
return NextResponse.json(
{ error: "Validation failed", details: result.error.flatten() },
{ status: 400 },
);
}
// 3. Execute with RLS context
const data = await withUserContext(prisma, userId, async (client) => {
return client.resource.create({ data: result.data });
});
// 4. Return success response
return NextResponse.json({ data, success: true }, { status: 201 });
} catch (error) {
console.error("API error:", error);
return NextResponse.json(
{ error: "Internal server error" },
{ status: 500 },
);
}
}For documenting new endpoints:
## Endpoint: POST /api/resource
### Description
Creates a new resource for the authenticated user.
### Authentication
Required: Clerk session
### Request Body
| Field | Type | Required | Description |
| ----- | ------ | -------- | ------------- |
| name | string | Yes | Resource name |
| type | string | No | Resource type |
### Response
**Success (201)**:
\`\`\`json
{ "data": { "id": 1, "name": "..." }, "success": true }
\`\`\`
**Error (400)**:
\`\`\`json
{ "error": "Validation failed", "details": {...} }
\`\`\`
### RLS Context
Uses `withUserContext` - user can only access own resources.© bybren-llc, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in .claude/skills/api-patterns of bybren-llc/safe-agentic-workflow.
Open the folder on GitHubat commit 26ca58b
API Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| API Patterns this skillbybren-llc/safe-agentic-workflow | 421 | — | ~1.6k | Automated safety check: Pass | MIT | |
| Opinionated Nextjs Patternspproenca/dot-skills | 214 | — | ~3k | Automated safety check: Pass | MIT | |
| Backend Dev Guidelineslitefuse/litefuse | 100 | 1 repos | ~5.8k | Automated safety check: Pass | Custom licence | |
| Typescript SecurityHoangNguyen0403/agent-skills-standard | 570 | — | ~817 | Automated safety check: Notes | MIT | |
| Nestjs Drizzle Crud Generatorgiuseppe-trisciuoglio/developer-kit | 355 | — | ~1.3k | Automated safety check: Notes | MIT | |
| Form Validationvibeeval/vibecosystem | 531 | — | ~3k | Automated safety check: Pass | MIT |
pproenca/dot-skills
Opinionated, backend-agnostic Next.js 16 (App Router) architecture — authorization at the data layer, server-side loading with cache()+Promise.all, mutations through next-safe-action + typed route…
litefuse/litefuse
Comprehensive backend development guide for Litefuse's Next.js 14/tRPC/Express/TypeScript monorepo.
HoangNguyen0403/agent-skills-standard
Secure server-side TypeScript input, auth tokens, and injection boundaries.
giuseppe-trisciuoglio/developer-kit
Generates complete CRUD modules for NestJS applications with Drizzle ORM.
vibeeval/vibecosystem
React Hook Form + Zod integration, multi-step forms, optimistic validation, server-side error mapping, and file upload patterns.
coollabsio/coolify
A skill your agent uses for any task or question involving Livewire.
bybren-llc/safe-agentic-workflow
Agent assignment matrix, blocker escalation, and TDM coordination patterns. Use when assigning work to specialist agents, managing blockers across agents…
bybren-llc/safe-agentic-workflow
API route implementation patterns with RLS, validation, and error handling. Use when creating API routes, implementing CRUD endpoints, adding server-side…
bybren-llc/safe-agentic-workflow
Documentation templates for ADRs, runbooks, architecture docs, and knowledge transfer documents. Use when creating Architecture Decision Records, writing…
bybren-llc/safe-agentic-workflow
Deployment workflows, pre-deploy validation, smoke testing, and rollback procedures. Use when deploying to staging or production, running smoke tests…
bybren-llc/safe-agentic-workflow
Frontend patterns for modern web frameworks, component libraries, auth flows, and analytics. Use when building UI components, creating pages, implementing…
bybren-llc/safe-agentic-workflow
Advanced git operations including rebase, bisect, cherry-pick, and conflict resolution. Use when rebasing feature branches, debugging with bisect…
Works with
API route implementation patterns with RLS, Zod validation, and error handling. API Patterns is an agent skill from bybren-llc/safe-agentic-workflow. API route implementation patterns with RLS, Zod validation, and error handling.
API Patterns fits situations like: creating API routes; implementing endpoints; adding server-side validation.
Run `npx skills add bybren-llc/safe-agentic-workflow --skill api-patterns -a claude-code`. Or copy the skill folder (.claude/skills/api-patterns in bybren-llc/safe-agentic-workflow) into .claude/skills/api-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add bybren-llc/safe-agentic-workflow --skill api-patterns -a codex`. Or copy the skill folder (.claude/skills/api-patterns in bybren-llc/safe-agentic-workflow) into .agents/skills/api-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bybren-llc/safe-agentic-workflow --skill api-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-patterns, .gemini/skills/api-patterns, .github/skills/api-patterns and .opencode/skills/api-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: API Patterns is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Grep, Glob.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
API Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.6k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with API Patterns: Opinionated Nextjs Patterns (pproenca/dot-skills, 214 stars), Backend Dev Guidelines (litefuse/litefuse, 100 stars), Typescript Security (HoangNguyen0403/agent-skills-standard, 570 stars) and Nestjs Drizzle Crud Generator (giuseppe-trisciuoglio/developer-kit, 355 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
bybren-llc (a GitHub organization) maintains it in bybren-llc/safe-agentic-workflow, which has 421 GitHub stars. The repository holds 42 skills in this directory. The repository was last updated on July 20, 2026.
Source: bybren-llc/safe-agentic-workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.