بنقرة واحدة
new-route
Scaffold a new Express API route with validation, auth middleware, test, and server.js registration
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Scaffold a new Express API route with validation, auth middleware, test, and server.js registration
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Run the universal button emulator simulator with preset scenarios for testing elevator integration logic
Pre-flight validation checklist before deploying Accelerate Robotics to production
Preview a SQLite schema change and its impact before applying it to a production database
استنادا إلى تصنيف SOC المهني
| name | new-route |
| description | Scaffold a new Express API route with validation, auth middleware, test, and server.js registration |
User says something like "add a /api/<thing> endpoint" or "I need a new route for X."
/api/reportsIf the user hasn't specified, ask before scaffolding.
Read existing routes — src/routes/inquiries.js is the canonical example for a route that handles both public and admin methods with validation and rate limiting.
Create the route file at src/routes/<name>.js:
const express = require('express') + routerdb from ../db/database if neededrequireAuth from ../middleware/auth for admin routesRegister in src/server.js:
const reportRoutes = require('./routes/reports');
app.use('/api/reports', reportRoutes);
Place near the other app.use('/api/...') calls.
If rate-limited, wrap the public verbs only — see how inquiries handles POST-only rate limiting.
If the route writes to the DB and needs a new table, update src/db/database.js and docs/20-architecture/database-schema.md. Follow .claude/rules/database-migrations.md.
Write tests in tests/integration/<name>.test.js:
Run tests — they must pass before committing.
Update docs — add the new endpoint to docs/20-architecture/api-reference.md.
Wiring verification — follow .claude/rules/wiring-verification.md. Actually hit the endpoint with curl or the browser, not just "it compiles."
server.js — the file exists but is unreachable/api/... that's not rate-limited even though it's public-facingescapeHtml()