Org api route

From Melvynx/benchmarks · View interactive version

Org api route is an AI agent skill from the GitHub repository Melvynx/benchmarks. Create or update organization-scoped public `/api/v1/*` routes backed by Better Auth API keys in NowStack. Use for API-key route work, org API actions/queries, API-key settings UI, public API docs, and future endpoint patterns that must resolve an organization from an API key.

How to use this skill

Skill file

Org API Route

Build public API endpoints scoped to the organization that owns the API key.

Keep route files tiny, keep auth and org resolution centralized, and document

each endpoint as its own page.

Read First

Before editing, read:

Architecture

Response Shape

results before sending JSON.

Documentation Rules

then replace the generated template with endpoint-specific content.

endpoints on the same page.

API-Key Settings UI

inline one-time-key card under the page header.

link labeled Docs.

API Key CRUD Learning

@better-auth/api-key@1.6.10 can throw dynamic module import unsupported

when its create/delete endpoint permission path runs inside a Convex mutation.

For organization API-key settings:

Workflow

  1. Add or update the internal orgApiQuery.
  2. Add or update the public orgApiAction.
  3. Add or update the src/routes/api/v1/* route with createPublicApiHandler.
  4. Add or update exactly one docs page per endpoint.
  5. Update API-key settings UI only when the discoverability surface changes.
  6. Update CHANGELOG.md.
  7. Run pnpm ts, pnpm lint:ci, pnpm test:ci, and pnpm build when route

behavior or docs are touched.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.