gen-endpoint

gen-endpoint is a command for Claude Code from hmake98/nestjs-starter. It costs 0 tokens per session (501 once invoked), scanned A, original, MIT.

A command for adding an API endpoint to an existing controller in a TypeScript web application. An API endpoint is a defined URL and HTTP action that other software can call.

In plain words
What is it for?
Use it when adding GET, POST, PUT, PATCH, or DELETE routes, including their request and response data types and access rules.
Why use it?
It provides a checklist for fitting the new endpoint into the project's existing patterns for authentication, roles, request data, responses, documentation, and translations.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it when adding GET, POST, PUT, PATCH, or DELETE routes, including their request and response data types and access rules.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hmake98/nestjs-starter/gen-endpoint
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/hmake98/nestjs-starter

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gen-endpoint

README.md
[![agentmods](https://agentmods.dev/badge/commands/hmake98/nestjs-starter/gen-endpoint/github.svg)](https://agentmods.dev/commands/hmake98/nestjs-starter/gen-endpoint)
Your own site
<a href="https://agentmods.dev/commands/hmake98/nestjs-starter/gen-endpoint"><img src="https://agentmods.dev/badge/commands/hmake98/nestjs-starter/gen-endpoint/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gen-endpoint

Your own site · 80×15
<a href="https://agentmods.dev/commands/hmake98/nestjs-starter/gen-endpoint"><img src="https://agentmods.dev/badge/commands/hmake98/nestjs-starter/gen-endpoint.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 501 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00501
Opus 5.5 $0.00000 $0.00200
Sonnet 5.5 $0.00000 $0.00100
Haiku 4.5 $0.00000 $0.00050

Measured 2mo ago against content hash bd588f3730f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gen-endpoint scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/gen-endpoint.md · 39 lines

What it actually says

Add a new API endpoint to an existing controller: $ARGUMENTS

Read these files first:

  • src/modules/user/controllers/user.public.controller.ts — public endpoint pattern
  • src/modules/user/controllers/user.admin.controller.ts — admin endpoint pattern
  • src/common/doc/decorators/doc.api-endpoint.decorator.ts — @ApiEndpoint options
  • src/common/request/decorators/auth-user.decorator.ts — @AuthUser usage
  • src/common/request/decorators/roles.decorator.ts — @AllowedRoles usage
  • src/common/response/dtos/response.generic.dto.ts — generic response shape

Determine from the arguments:

  • Which controller file to modify
  • HTTP method (GET / POST / PUT / PATCH / DELETE)
  • Route path and params
  • Whether it needs auth (@ApiBearerAuth), role restriction (@AllowedRoles), or is public (@PublicRoute)
  • Request body DTO (create if it doesn't exist)
  • Response DTO (create if it doesn't exist, extend the base response DTO)

For every new endpoint:

  1. Controller method — add to the correct controller with:

    • @ApiEndpoint({ summary: '...', serialization: ResponseDto, messageKey: '<domain>.success.<action>' })
    • Correct HTTP decorator (@Get, @Post, @Put, @Patch, @Delete)
    • @Param, @Body, @Query decorators as needed
    • @AuthUser() user: IAuthUser if it needs the authenticated user
  2. Service method — add to the corresponding service:

    • Throws HttpException with i18n key and HttpStatus for all error cases
    • Returns the response DTO type
    • Uses assertExists private helper for existence pre-checks
  3. DTOs — if new ones are needed:

    • Input DTOs: class-validator decorators + @ApiProperty
    • Response DTOs: extend base response DTO, @Expose() on each field
  4. i18n message key — remind me to add the messageKey value to the translations file

After adding the endpoint also tell me: does the corresponding service method need a new repository method? If so, describe what it should look like following src/common/database/repositories/user.repository.ts.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 39 lines · 0 tokens per session scan A bd588f3730f2

Subscribe to this mod's changes

gen-endpoint is a command published in the GitHub repository hmake98/nestjs-starter (64 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 501 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

gen-endpoint compared with commands from other repositories

gen-endpoint next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
gen-endpointhmake98/nestjs-starterCommand645mo agoMITA0Claude Code
node-microservice-buildervanessamarely/ai-playbook-repositoCommand23mo agoMITA0Claude Code, Cursor
nxt-api-routemertjane/awesome-claude-commandsCommand28mo agoMITA37Claude Code
gen-ts-api-codezhanyoulin456/seevin-claude-pluginsCommand49mo agoMITA9Claude Code
checklistgithub/spec-kitCommand148kyesterdayMITA13Claude Code
clarifygithub/spec-kitCommand148kyesterdayMITA27Claude Code
specifygithub/spec-kitCommand148kyesterdayMITA13Claude Code