annotation-order

Order Spring and Lombok annotations across class, field, method, and parameter levels.

Updated Jan 11, 2026
One-click install
npx skills add https://github.com/gykk16/spring-skeleton --skill annotation-order
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: annotation-order
Source: https://github.com/gykk16/spring-skeleton/tree/main/.omc/skills/annotation-order
Command: npx skills add https://github.com/gykk16/spring-skeleton --skill annotation-order

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures consistent and maintainable code by providing a clear, standardized order for applying annotations in Spring applications, reducing potential conflicts and improving readability.

Core Features & Use Cases

  • Framework Annotation Prioritization: Guides the placement of Spring, JPA, and validation annotations before Lombok annotations.
  • Layer-Specific Guidance: Offers specific ordering examples for Entities, Controllers, Services, Repositories, Configurations, and DTOs.
  • Use Case: When developing a new Spring Boot microservice, developers can consult this Skill to immediately understand the correct annotation hierarchy for their entities and controllers, preventing common ordering mistakes.

Quick Start

Use the annotation-order skill to understand the correct placement of Spring and Lombok annotations on a Kotlin entity.

Frequently Asked Questions about annotation-order

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

FAQPage Schema
What is the best way to order Spring annotations on a Kotlin entity?

The best way to order Spring annotations on a Kotlin entity is to prioritize framework annotations over Lombok annotations. This standardized convention ensures maintainability and reduces potential annotation conflicts.

How do I standardize Spring annotation ordering across different application layers?

To standardize Spring annotation ordering across application layers, apply layer-specific guidance for Entities, Controllers, Services, Repositories, Configurations, and DTOs. This ensures consistent code structure throughout your Spring Boot microservice.

Should Spring and JPA annotations be placed before Lombok annotations?

Yes, Spring, JPA, and validation annotations should be placed before Lombok annotations. This framework annotation prioritization prevents common ordering mistakes and improves overall code readability.

Does this annotation ordering convention apply to both class-level and field-level annotations?

Yes, this convention applies to class-level, field-level, method-level, and parameter-level annotations. It provides specific ordering examples across various Spring components to ensure consistent application.

Why does annotation ordering matter in Spring Boot microservices?

Annotation ordering matters in Spring Boot microservices because it ensures consistent, maintainable code and reduces potential annotation conflicts. A clear, standardized order improves readability and prevents common development mistakes.