.claude/skills/add-api-route/SKILL.md
Scaffold a new Express API route file with JWT auth, org-isolation middleware, zod validation, Prisma queries, and standard error handling. Use when the user asks to "add an API endpoint", "create a route", or "expose X over HTTP".
npx skillsauth add malhajri07/real-estate-CRM-project add-api-routeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a new route file under apps/api/routes/ that follows the project's conventions. Org isolation is non-negotiable — every route handler must apply injectOrgFilter (reads) or injectWriteFilter (writes) unless the user is WEBSITE_ADMIN.
commissions)/api/commissions)/add-prisma-model first)apps/api/routes/leads.ts (post-E2 conventions: org isolation, calculated fields, batch endpoints).apps/api/routes/{name}.ts containing:
import { Router } from "express" + authenticateToken + injectOrgFilter/injectWriteFilterimport { z } from "zod" for request validationconsole.error + 500 fallbackres.json(...) with consistent shape (data, or array)apps/api/index.ts (or apps/api/server.ts) under the chosen path.req.user.organizationId from JWT (never accept it from body)where: { organizationId: req.user.organizationId }/typecheck then /audit-org-isolation to verify scoping.Aqarkom_Knowledge/Architecture/API Routes.md under the matching domain.req.body.organizationId used (security risk)/typecheck passes/audit-org-isolation shows zero violationsinjectOrgFilter "just for an admin endpoint" — gate by role insteadleads.tstesting
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
tools
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
data-ai
Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
tools
Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.