Automated summary
Step-by-step convention guide for adding a new API endpoint to the BookingSystem.Api project (DTO, service, controller, authorization, tests).
Strengths
- Explicit ordered sequence (DTOs → service → controller → authorization → tests) that makes the work repeatable
- Includes a concrete rule for concurrent read-then-write flows, returning a distinguishable conflict outcome instead of throwing
- States the expected status codes (Ok/Created/Conflict/NotFound) and forbids a bare 500 for a predictable outcome
- Requires xUnit tests for happy and error paths, plus a concurrency test modeled on ConcurrencyTests.cs
Limitations
- Tightly coupled to one project's architecture and file names (BookingSystem.Api), so it is not directly reusable elsewhere
- Does not spell out the exact shape of DTOs, services or the conditional-update pattern; you must read the existing code
- The optional frontend step is vague and assumes the api() helper already exists in frontend/app.js
Use it when adding or changing an endpoint in BookingSystem.Api and you want the change to follow the repository's existing conventions.
Avoid it for a different project or stack, or for tasks unrelated to endpoint creation such as schema redesign, CI setup or documentation.
Security analysis
SafeThis is a pure procedural/editorial guideline document describing how to add an endpoint in a .NET codebase. It declares no tools, contains no executable commands beyond standard `dotnet build && dotnet test` verification, and performs no network, filesystem-destructive, obfuscated, or exfiltration actions. No prompt-injection or instruction-override attempts were present in the content.
No concerns found
How this analysis is madeExamples
Add a POST /api/bookings/{id}/cancel endpoint to BookingSystem.Api, following the project conventions.Add an admin-only GET endpoint that lists all bookings for a given slot, with authorization and tests.Add an endpoint that reassigns a booking to another slot, make it safe against concurrent writes, and cover it with a concurrency test.name: add-booking-endpoint description: Use when adding a new API endpoint to BookingSystem.Api, to keep controller/service/DTO/test structure consistent with the rest of the codebase.
Adding a new endpoint to BookingSystem.Api
Follow this sequence so new endpoints match the codebase's conventions (see CLAUDE.md):
- DTOs first. Add request/response
recordtypes to the relevant file inDTOs/(e.g.BookingDtos.cs). Never expose an EF entity directly from a controller. - Service method. If the endpoint does anything beyond a simple CRUD read, add the
logic to the matching interface + implementation in
Services/(e.g.IBookingService/BookingService), not directly in the controller.- If the new logic reads then writes state that another request could also be
writing concurrently, do NOT use a plain read-then-write. Use an atomic
conditional
UPDATE ... WHERE(seeBookingService.CreateBookingAsync) or an EF Core concurrency token, and return a distinguishable "conflict" outcome rather than throwing.
- If the new logic reads then writes state that another request could also be
writing concurrently, do NOT use a plain read-then-write. Use an atomic
conditional
- Controller action. Thin method: model-bind the request DTO, call the service,
map the result to the response DTO / appropriate status code
(
Ok/Created/Conflict/NotFound— never a bare 500 for an expected outcome like "lost the race"). - Authorization. Add
[Authorize](already on the controller by default) and[Authorize(Roles = Roles.Admin)]on the action if it's an admin-only operation. - Test. Add an xUnit test in
BookingSystem.Testsfor the happy path and for the conflict/error path. If the endpoint touches shared mutable state (like a booking or slot), add or extend a concurrency test modeled onConcurrencyTests.cs: fire several requests withTask.WhenAlland assert exactly one wins. - Frontend (optional). If the endpoint needs a UI, add a small function to
frontend/app.jsfollowing the existingapi()helper pattern — no new frontend framework or build step.
Run dotnet build && dotnet test before considering the change done.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/add-a-bookingsystem-api-endpoint-mvda873q/download' --output '.skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q/SKILL.md.part' && mv '.skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q/SKILL.md.part' '.skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q/SKILL.md' && test -s '.skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/add-booking-endpoint' && cp -R '.skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q' '.claude/skills/add-booking-endpoint'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q'openskills read 'add-a-bookingsystem-api-endpoint-mvda873q'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/add-a-bookingsystem-api-endpoint-mvda873q/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.