lombok
БесплатноБез исполняемых скриптовНе проверенProject Lombok for reducing Java boilerplate. Covers annotations for getters, setters, constructors, builders, logging, and more. Based on production patterns…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Project Lombok
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:lombokfor comprehensive documentation.
Maven Configuration
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<optional>true</optional>
</dependency>
<!-- For MapStruct compatibility -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-mapstruct-binding</artifactId>
<version>0.2.0</version>
</dependency>
Common Annotations
@Data (All-in-One)
@Data
public class User {
private Long id;
private String name;
private String email;
}
// Generates:
// - @Getter for all fields
// - @Setter for all non-final fields
// - @ToString
// - @EqualsAndHashCode
// - @RequiredArgsConstructor
@Getter / @Setter
public class User {
@Getter @Setter
private String name;
@Getter // Read-only
private final String email;
@Setter(AccessLevel.PROTECTED)
private String internalId;
}
@NoArgsConstructor / @AllArgsConstructor / @RequiredArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
public class User {
private Long id;
private String name;
}
@RequiredArgsConstructor
public class UserService {
private final UserRepository userRepository; // Included in constructor
private final UserMapper userMapper; // Included in constructor
private String cacheName; // NOT included
}
@Builder
@Data
@Builder
public class User {
private Long id;
private String name;
private String email;
@Builder.Default
private UserStatus status = UserStatus.ACTIVE;
}
// Usage
User user = User.builder()
.name("John")
.email("[email protected]")
.build();
// With toBuilder for updates
User updated = user.toBuilder()
.name("Jane")
.build();
@Value (Immutable)
@Value
public class UserResponse {
Long id;
String name;
String email;
LocalDateTime createdAt;
}
// Generates:
// - All fields are private final
// - @AllArgsConstructor
// - @Getter (no setters)
// - @ToString
// - @EqualsAndHashCode
Entity Pattern
@Entity
@Table(name = "users")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EntityListeners(AuditingEntityListener.class)
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String name;
@Column(unique = true, nullable = false)
private String email;
@Enumerated(EnumType.STRING)
@Builder.Default
private UserStatus status = UserStatus.ACTIVE;
@CreatedDate
@Column(updatable = false)
private LocalDateTime createdAt;
@LastModifiedDate
private LocalDateTime updatedAt;
// Exclude from toString/equals for performance
@ToString.Exclude
@EqualsAndHashCode.Exclude
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "department_id")
private Department department;
}
Service Pattern with Constructor Injection
@Service
@RequiredArgsConstructor
@Slf4j
public class UserServiceImpl implements UserService {
private final UserRepository userRepository;
private final UserMapper userMapper;
private final PasswordEncoder passwordEncoder;
@Override
public UserResponse create(CreateUserRequest dto) {
log.info("Creating user: {}", dto.getEmail());
User user = userMapper.toEntity(dto);
return userMapper.toResponse(userRepository.save(user));
}
}
Logging
@Slf4j // SLF4J logger
public class UserService {
public void process() {
log.info("Processing...");
log.debug("Debug info: {}", data);
log.error("Error occurred", exception);
}
}
@Log4j2 // Log4j2 logger
@CommonsLog // Apache Commons Logging
@JBossLog // JBoss Logging
DTO Pattern
// Request DTO
@Data
public class CreateUserRequest {
@NotBlank
private String name;
@Email
private String email;
@Size(min = 8)
private String password;
}
// Response DTO (immutable)
@Value
@Builder
public class UserResponse {
Long id;
String name;
String email;
UserStatus status;
LocalDateTime createdAt;
}
@Cleanup
public void readFile(String path) throws IOException {
@Cleanup InputStream in = new FileInputStream(path);
// in.close() called automatically
}
@SneakyThrows
@SneakyThrows // Wraps checked exception
public String readConfig() {
return Files.readString(Path.of("config.json"));
}
@Synchronized
public class Counter {
@Synchronized
public void increment() {
// Thread-safe
}
}
@With (Immutable Updates)
@Value
@With
public class Point {
int x;
int y;
}
Point p1 = new Point(1, 2);
Point p2 = p1.withX(5); // Point(5, 2)
Key A
Установить lombok в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWriteEditFAQ
Что делает скилл lombok?
Project Lombok for reducing Java boilerplate. Covers annotations for getters, setters, constructors, builders, logging, and more. Based on production patterns from castellino and gestionale-presenze projects. USE WHEN: user mentions "lombok", "@Data", "@Builder", "@Slf4j", asks about "boilerplate reduction", "getters/setters", "@RequiredArgsConstructor", "@Value" DO NOT USE FOR: Java language features - use `java` skill instead DO NOT USE FOR: MapStruct integration - use `mapstruct` skill DO NOT USE FOR: Spring annotations - use `backend-spring-boot` skill
Как установить скилл lombok?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл lombok запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic