api-route-procedures
Installation
SKILL.md
Rule
Extract a procedure the first time a "resolve + guard" check would otherwise be copy-pasted into a second route handler for the same resource.
The shape
// src/lib/procedures.ts
import { postRepo } from "@/lib/repos";
import { server } from "@/server";
import { z } from "pumice.js";
const OWNER_SCOPED_METHODS = ["get", "post", "patch", "delete"] as const;
type OwnerScopedMethod = (typeof OWNER_SCOPED_METHODS)[number];