Skip to content

a-pavithraa/springboot-skills-marketplace / plugins/springboot-architecture/skills/creating-springboot-projects

creating-springboot-projects

Verified

Use when starting a new Spring Boot project or service: scaffolding or bootstrapping a backend, REST API, microservice or modular monolith; choosing how to structure it (layered, package-by-module, modular monolith, tomato, DDD-hexagonal); selecting Spring Boot 4 features; generating the base project with progen or Spring Initializr; or applying the bundled templates and references in this skill. Not for migrating existing projects or for isolated JPA/repository work without broader project-creation context.

assets/controller.java

View on GitHub
package {{PACKAGE}}.{{MODULE}}.rest;

import {{PACKAGE}}.{{MODULE}}.domain.*;
import {{PACKAGE}}.{{MODULE}}.domain.models.{{NAME}}VM;
import {{PACKAGE}}.{{MODULE}}.domain.vo.{{NAME}}Code;
import jakarta.validation.Valid;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static org.springframework.http.HttpStatus.CREATED;

/**
 * REST Controller template.
 *
 * Key principles:
 * - Use Value Objects in @PathVariable (requires Spring Converter)
 * - Validate with @Valid
 * - Delegate to services - no business logic here
 * - Return appropriate HTTP status codes
 */
@RestController
@RequestMapping("/api/{{MODULE}}")
class {{NAME}}Controller {
    private final {{NAME}}Service service;
    private final {{NAME}}QueryService queryService;

    {{NAME}}Controller({{NAME}}Service service, {{NAME}}QueryService queryService) {
        this.service = service;
        this.queryService = queryService;
    }

    // ==================== READ OPERATIONS ====================

    @GetMapping
    List<{{NAME}}VM> findAll() {
        return queryService.findAll();
    }

    @GetMapping("/active")
    List<{{NAME}}VM> findAllActive() {
        return queryService.findAllActive();
    }

    @GetMapping("/{code}")
    ResponseEntity<{{NAME}}VM> findByCode(@PathVariable {{NAME}}Code code) {
        return ResponseEntity.ok(queryService.getByCode(code));
    }

    // ==================== WRITE OPERATIONS ====================

    @PostMapping
    ResponseEntity<Create{{NAME}}Response> create(@RequestBody @Valid Create{{NAME}}Request request) {
        var cmd = new Create{{NAME}}Cmd(request.details());
        var code = service.create(cmd);
        return ResponseEntity.status(CREATED).body(new Create{{NAME}}Response(code.code()));
    }

    @PatchMapping("/{code}/activate")
    ResponseEntity<Void> activate(@PathVariable {{NAME}}Code code) {
        service.activate(code);
        return ResponseEntity.ok().build();
    }

    @PatchMapping("/{code}/deactivate")
    ResponseEntity<Void> deactivate(@PathVariable {{NAME}}Code code) {
        service.deactivate(code);
        return ResponseEntity.ok().build();
    }
}

// ============================================================
// REQUEST/RESPONSE DTOs
// ============================================================

// public record Create{{NAME}}Request(
//     @Valid {{NAME}}Details details
// ) {}

// public record Create{{NAME}}Response(String code) {}

// ============================================================
// SPRING CONVERTER - For @PathVariable binding
// ============================================================

// package {{PACKAGE}}.{{MODULE}}.rest.converters;
//
// @Component
// public class StringTo{{NAME}}CodeConverter implements Converter<String, {{NAME}}Code> {
//     @Override
//     public {{NAME}}Code convert(String source) {
//         return {{NAME}}Code.of(source);
//     }
// }
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall