manutej/luxor-claude-marketplace3 files

Spring Boot Development

Comprehensive Spring Boot development skill covering auto-configuration, dependency injection, REST APIs, Spring Data, security, and enterprise Java applications

Specification
Skill ID
manutej/luxor-claude-marketplace/spring-boot-development
Publisher
manutej
Repository
luxor-claude-marketplace
Installs
0
Files
3
Synced
Sep 23, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

manutej/luxor-claude-marketplace/spring-boot-developmentInstalls these files
  • EXAMPLES.md
  • README.md
  • SKILL.md

What this skill tells the agent

Spring Boot Development Skill

This skill provides comprehensive guidance for building modern Spring Boot applications using auto-configuration, dependency injection, REST APIs, Spring Data, Spring Security, and enterprise Java patterns based on official Spring Boot documentation.

When to Use This Skill

Use this skill when:

  • Building enterprise REST APIs and microservices
  • Creating web applications with Spring MVC
  • Developing data-driven applications with JPA and databases
  • Implementing authentication and authorization with Spring Security
  • Building production-ready applications with actuator and monitoring
  • Creating scalable backend services with Spring Boot
  • Migrating from traditional Spring to Spring Boot
  • Developing cloud-native applications
  • Building event-driven systems with messaging
  • Creating batch processing applications

Core Concepts

Auto-Configuration

Spring Boot automatically configures your application based on the dependencies you have added to the project. This reduces boilerplate configuration significantly.

How Auto-Configuration Works:

@SpringBootApplication
public class MyApplication {
    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }
}

The @SpringBootApplication annotation is a combination of:

  • @Configuration: Tags the class as a source of bean definitions
  • @EnableAutoConfiguration: Enables Spring Boot's auto-configuration mechanism
  • @ComponentScan: Enables component scanning in the current package and sub-packages

Conditional Auto-Configuration:

@Configuration
@ConditionalOnClass(DataSource.class)
@ConditionalOnProperty(name = "spring.datasource.url")
public class DataSourceAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public DataSource dataSource() {
        return DataSourceBuilder.create().build();
    }
}

Customizing Auto-Configuration:

// Exclude specific auto-configurations
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class MyApplication {
    // ...
}

// Or in application.properties
// spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration

Dependency Injection

Spring's IoC (Inversion of Control) container manages object creation and dependency injection.

Constructor Injection (Recommended):

@Service
public class UserService {

    private final UserRepository userRepository;
    private final EmailService emailService;

    // Constructor injection - recommended approach
    public UserService(UserRepository userRepository, EmailService emailService) {
        this.userRepository = userRepository;
        this.emailService = emailService;
    }

    public User createUser(User user) {
        User saved = userRepository.save(user);
        emailService.sendWelcomeEmail(saved);
        return saved;
    }
}

Field Injection (Not Recommended):

@Service
public class UserService {

    @Autowired  // Avoid field injection
    private UserRepository userRepository;

    // Difficult to test and creates tight coupling
}

Setter Injection (Optional Dependencies):

@Service
public class UserService {

    private UserRepository userRepository;
    private EmailService emailService;

    @Autowired
    public void setUserRepository(UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    @Autowired(required = false)
    public void setEmailService(EmailService emailService) {
        this.emailService = emailService;
    }
}

Component Stereotypes:

@Component  // Generic component
public class MyComponent { }

@Service    // Business logic layer
public class MyService { }

@Repository // Data access layer
public class MyRepository { }

@Controller // Presentation layer (web)
public class MyController { }

@RestController // REST API controller
public class MyRestController { }

Spring Web (REST APIs)

Build RESTful web services with Spring MVC annotations.

Basic REST Controller:

@RestController
@RequestMapping("/api/users")
public class UserController {

    private final UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    @GetMapping
    public List<User> getAllUsers() {
        return userService.findAll();
    }

    @GetMapping("/{id}")
    public ResponseEntity<User> getUserById(@PathVariable Long id) {
        return userService.findById(id)
            .map(ResponseEntity::ok)
            .orElse(ResponseEntity.notFound().build());
    }

    @PostMapping
    public ResponseEntity<User> createUser(@RequestBody @Valid User user) {
        User created = userService.save(user);
        URI location = ServletUriComponentsBuilder
            .fromCurrentRequest()
            .path("/{id}")
            .buildAndExpand(created.getId())
            .toUri();
        return ResponseEntity.created(location).body(created);
    }

    @PutMapping("/{id}")
    public ResponseEntity<User> updateUser(@PathVariable Long id,
                                          @RequestBody @Valid User user) {
        return userService.update(id, user)
            .map(ResponseEntity::ok)
            .orElse(ResponseEntity.notFound().build());
    }

    @DeleteMapping("/{id}")
    public ResponseEntity<Void> deleteUser(@PathVariable Long id) {
        if (userService.delete(id)) {
            return ResponseEntity.noContent().build();
        }
        return ResponseEntity.notFound().build();
    }
}

Request Mapping Variations:

@RestController
@RequestMapping("/api/products")
public class ProductController {

    // Query parameters
    @GetMapping("/search")
    public List<Product> search(@RequestParam String name,
                               @RequestParam(required = false) String category) {
        return productService.search(name, category);
    }

    // Multiple path variables
    @GetMapping("/categories/{categoryId}/products/{productId}")
    public Product getProductInCategory(@PathVariable Long categoryId,
                                       @PathVariable Long productId) {
        return productService.findInCategory(categoryId, productId);
    }

    // Request headers
    @GetMapping("/{id}")
    public Product getProduct(@PathVariable Long id,
                             @RequestHeader("Accept-Language") String language) {
        return productService.find(id, language);
    }

    // Matrix variables
    @GetMapping("/{id}")
    public Product getProductWithMatrix(@PathVariable Long id,
                                       @MatrixVariable Map<String, String> filters) {
        return productService.findWithFilters(id, filters);
    }
}

Response Handling:

@RestController
@RequestMapping("/api/orders")
public class OrderController {

    // Return different status codes
    @PostMapping
    public ResponseEntity<Order> createOrder(@RequestBody Order order) {
        Order created = orderService.create(order);
        return ResponseEntity.status(HttpStatus.CREATED).body(created);
    }

    // Custom headers
    @GetMapping("/{id}")
    public ResponseEntity<Order> getOrder(@PathVariable Long id) {
        Order order = orderService.findById(id);
        return ResponseEntity.ok()
            .header("X-Order-Version", order.getVersion().toString())
            .body(order);
    }

    // No content response
    @DeleteMapping("/{id}")
    public ResponseEntity<Void> deleteOrder(@PathVariable Long id) {
        orderService.delete(id);
        return ResponseEntity.noContent().build();
    }
}

Spring Data JPA

Spring Data JPA provides repository abstractions for database access.

Entity Definition:

@Entity
@Table(name = "users")
public class User {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

Use this skill in a project

Open any RiverX project, search the Skills panel for manutej/luxor-claude-marketplace/spring-boot-development, and install it in one click.

Use this skill