scaffold-get-by-id

Scaffold a GetById endpoint with 404 handling, caching, and localization.

15|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/aalmada/BookStore --skill scaffold-get-by-id
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-get-by-id
Source: https://github.com/aalmada/BookStore/tree/main/.claude/skills/scaffold-get-by-id
Command: npx skills add https://github.com/aalmada/BookStore --skill scaffold-get-by-id

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the creation of a Get By ID endpoint to retrieve a single resource by its identifier, ensuring consistent behavior and reducing boilerplate code.

Core Features & Use Cases

  • GetById Endpoint Scaffolding: Generates the endpoint skeleton, routing, and DTO mapping for a specific resource.
  • Deterministic Behavior: Handles 404 responses when the resource is not found and supports localization-ready messages.
  • Performance Considerations: Integrates caching strategies to improve response times for repeated requests.
  • Use Case: When adding a new entity like Product, this skill scaffolds an API endpoint that returns the item by ID with proper error handling and localization.

Quick Start

Use the scaffold-get-by-id skill to generate the GetById endpoint for a specific resource, then wire it into ApiService and the client project.

Frequently Asked Questions about scaffold-get-by-id

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a Get By ID endpoint with caching and localization?

This skill scaffolds a Get By ID endpoint by updating resource endpoints via MapGet, using GetOrCreateLocalizedAsync followed by LoadAsync to integrate caching and localized response handling automatically.

What is the best way to handle deterministic 404 responses for a GetById API endpoint?

Handling deterministic 404 responses in a GetById endpoint is achieved by relying on a present projection and the GetByIdEndpoint template to ensure consistent not-found behavior and localized error messages.

How do I generate a GetById API endpoint that reduces boilerplate code?

Generating a GetById API endpoint that reduces boilerplate is done by applying this skill to a specific resource, which outputs the routing skeleton and DTO mapping directly into your ApiService endpoints file.

Do I need a projection present before scaffolding a Get By ID endpoint?

Yes, a projection must be present before scaffolding a Get By ID endpoint, as the implementation relies on that projection to fetch the single resource and map the DTO response correctly.

Where does the scaffold-get-by-id skill write the new MapGet endpoint code?

The scaffold-get-by-id skill writes the new MapGet endpoint code into src/BookStore.ApiService/Endpoints/{Resource}Endpoints.cs and references a template located at templates/GetByIdEndpoint.cs.