add-endpoint

Add a REST endpoint to a Spring Boot 4 project via a spec-first workflow.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/dprice-dev/claude-java-skills --skill add-endpoint-dprice-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-endpoint
Source: https://github.com/dprice-dev/claude-java-skills/tree/main/.claude/skills/add-endpoint
Command: npx skills add https://github.com/dprice-dev/claude-java-skills --skill add-endpoint-dprice-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adds a new REST endpoint to an existing Spring Boot 4 codebase without breaking the existing quality gates, by forcing a spec-first workflow and generating the correct artifacts across controller, service, and every test layer.

Core Features & Use Cases

  • Spec-driven development: Extends src/main/resources/openapi/api.yaml with the path, operation, schemas, and examples before writing Java, ensuring the controller contract matches the OpenAPI spec.
  • End-to-end implementation workflow: Generates OpenAPI interfaces/DTOs, implements service and controller glue, and wires everything into the existing architecture.
  • Five-layer test pyramid: Creates/updates unit tests (service + controller), component @WebMvcTest, minimal E2E verification, acceptance scenario(s), and Pact interactions so the new endpoint stays verifiably correct.

Quick Start

Ask the skill to add your new endpoint by providing the OpenAPI path + operation details you want in api.yaml, and then proceed to implement the service and controller plus all required tests through ./gradlew check.

Frequently Asked Questions about add-endpoint

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

FAQPage Schema
How do I add a new REST endpoint to a Spring Boot 4 project using a spec-first OpenAPI workflow?

To add a new REST endpoint spec-first, you extend the existing `openapi/api.yaml` with paths, schemas, and examples, then generate interfaces and DTOs before implementing the service and controller layers. This ensures the controller contract matches the OpenAPI spec exactly.

What tests are required when adding a REST API operation to an existing Spring Boot codebase?

Adding a REST API operation requires a five-layer test pyramid: unit tests for service and controller, `@WebMvcTest` component tests, E2E verification, acceptance scenarios, and Pact interactions. All tests must pass via `./gradlew check` to maintain quality gates.

Can I use this spec-first approach if my Spring Boot project does not have OpenAPI codegen configured?

No, this spec-first workflow requires an existing Spring Boot 4 project that already has OpenAPI codegen and the test pyramid in place. The `openapi/api.yaml` file must already exist to extend it with new operations and generate the required interfaces.

What is spec-first API development and how does it work with Spring Boot controllers?

Spec-first API development defines the HTTP contract in `openapi/api.yaml` with operationId, schemas, and examples before writing Java code. OpenAPI codegen then generates the interfaces and DTOs, which the Spring Boot controller implements to guarantee contract compliance.

How do I update an OpenAPI spec to generate DTOs and interfaces for a new HTTP resource?

You update `openapi/api.yaml` by adding the new path, operation, operationId, schemas, and examples. Running OpenAPI codegen then generates the required interfaces and DTOs, which you wire into the service and controller layers to complete the REST endpoint implementation.

Why does my Spring Boot build fail when adding a REST endpoint without Pact tests?

Adding a REST endpoint requires Pact contract interactions alongside unit, component, E2E, and acceptance tests. The spec-first workflow enforces this five-layer test pyramid and requires `./gradlew check` to pass, ensuring the new endpoint stays verifiably correct across all layers.