.claude/skills/add-ai-endpoint/SKILL.md
Scaffold a Claude API powered endpoint with system prompt, structured output, token tracking, and rate limiting. Use when adding AI features like chatbot, matching, or text generation.
npx skillsauth add malhajri07/real-estate-CRM-project add-ai-endpointInstall 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.
Scaffolds a new AI-powered API endpoint backed by the Anthropic Claude API. Handles system prompt design, structured output parsing, token usage tracking, and per-user rate limiting.
Check AI service layer exists. Read apps/api/libs/ai-service.ts. If it doesn't exist, create it:
// Anthropic client singleton, retry logic, token tracker
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
Create the route file at apps/api/routes/ai-{feature}.ts:
authenticateToken middlewareclient.messages.create() with structured outputprompt_tokens, completion_tokens in ai_usage tableDesign the system prompt. Must include:
Add rate limiting. In the route:
ai_usage table: user's token count todayRegister the route in apps/api/index.ts:
import aiFeatureRoutes from "./routes/ai-{feature}";
app.use("/api/ai", aiFeatureRoutes);
Create react-query hook using /add-react-query for the frontend.
Add API key to .env:
ANTHROPIC_API_KEY=sk-ant-...
/typecheck passestesting
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.