agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when building Spring Boot services. Covers dependency injection, transaction boundaries, JPA performance, configuration, validation, and testing slices. Trigger on "LazyInitializationException", "@Transactional not working", "n+1 queries with jpa", "spring tests are slow".
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill spring-boot --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill spring-boot -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill spring-boot -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill spring-boot -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill spring-boot -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill spring-boot -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill spring-boot -a windsurf -y
name: spring-boot description: Use when building Spring Boot services. Covers dependency injection, transaction boundaries, JPA performance, configuration, validation, and testing slices. Trigger on "LazyInitializationException", "@Transactional not working", "n+1 queries with jpa", "spring tests are slow". Do not use for general Java or Kotlin language questions — see the java-kotlin skill. metadata: category: backend version: 1.0.0 tags: [spring, java, jpa, transactions, testing]
Build Spring Boot services with correct transaction boundaries and a JPA layer that does not issue a hundred queries to render a list. Spring's defaults are safe; its abstractions hide the cost of getting them wrong.
1. **Use constructor injection** — Field injection with `@Autowired` hides dependencies and makes the class untestable without a container. 2. **Place `@Transactional` at the service layer** — Not on the repository (too narrow, one transaction per call) and not on the controller (too wide, the transaction spans view rendering). 3. **Fetch deliberately** — Every association is `LAZY`. Then use an entity graph or a fetch join for the specific query that needs it, and a DTO projection for read-only views. 4. **Validate configuration at startup** — `@ConfigurationProperties` with `@Validated`. A missing property should prevent boot, not surface as a null at runtime. 5. **Test in slices** — `@DataJpaTest` for repositories against Testcontainers, `@WebMvcTest` for controllers with mocked services, `@SpringBootTest` only for the handful of genuine end-to-end paths.
**Fetch join with a projection, avoiding both N+1 and over-fetching:**
public interface OrderRepository extends JpaRepository<Order, UUID> {
@Query("""
select new com.example.orders.OrderSummary(
o.id, c.name, size(o.lines), sum(l.priceCents * l.quantity))
from Order o
join o.customer c
join o.lines l
where o.status = :status
group by o.id, c.name
""")
List<OrderSummary> findSummaries(@Param("status") OrderStatus status);
}**Transaction boundary at the service, HTTP call outside it:**
@Service
@RequiredArgsConstructor
public class RefundService {
private final OrderRepository orders;
private final PaymentGateway gateway;
@Transactional(rollbackFor = Exception.class)
public Refund record(UUID orderId, long amountCents, String gatewayRefundId) {
Order order = orders.findById(orderId).orElseThrow(OrderNotFound::new);
order.applyRefund(amountCents, gatewayRefundId); // invariants live in the entity
return order.latestRefund();
}
// The network call happens outside any transaction.
public Refund refund(UUID orderId, long amountCents) {
String gatewayRefundId = gateway.refund(orderId, amountCents);
return record(orderId, amountCents, gatewayRefundId);
}
}A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.