Agent skill · software engineering · affaan-m

springboot-patterns

Spring Boot architecture patterns, REST API design, layered services, data access, caching, async processing, and logging. Use for Java Spring Boot backend work.

Why this skill is useful

Provides specific Spring Boot architectural patterns and REST API design practices that the AI wouldn't reliably generate on its own.

What it needs

About 3k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.

What this skill does

Spring Boot 開発パターン スケーラブルで本番グレードのサービスのためのSpring BootアーキテクチャとAPIパターン。 REST API構造 リポジトリパターン(Spring Data JPA) トランザクション付きサービスレイヤー DTOと検証 例外ハンドリング キャッシング 構成クラスで@EnableCachingが必要です。 非同期処理 構成クラスで@EnableAsyncが必要です。 ロギング(SLF4J) ミドルウェア / フィルター ページネーションとソート エラー回復力のある外部呼び出し レート制限(Filter + Bucket4j) セキュリティノート: X-Forwarded-Forヘッダーはデフォルトでは信頼できません。クライアントがそれを偽装できるためです。 転送ヘッダーは次の場合のみ使用してください: 1. アプリが信頼できるリバースプロキシ(nginx、AWS ALBなど)の背後にある 2. ForwardedHeaderFilterをBeanとして登録済み 3. application propertiesでserver.forward-headers-strategy=NATIVEまたはFRAMEWORKを設定済み 4. プロキシがX-Forwarded-Forヘッダーを上書き(追加ではなく)するよう設定済み ForwardedHeaderFilterが適切に構成されている場合、request.getRemoteAddr()は転送ヘッダーから正しいクライアントIPを自動的に返します。この構成がない場合は、request.getRemoteAddr()を直接使用してください。これは直接接続IPを返し、唯一信頼できる値です。 バックグラウンドジョブ Springの@Scheduledを使用するか、キュー(Kafka、SQS、RabbitMQなど)と統合します。ハンドラーをべき等かつ観測可能に保ちます。 可観測性 構造化ロギング(JSON)via Logbackエンコーダー メトリクス: Micrometer + Prometheus/OTel トレーシング: Micrometer TracingとOpenTelemetryまたはBraveバックエンド 本番デフォルト コンストラクタインジェクションを優先、フィールドインジェクションを避ける RFC 7807エラーのためにspring.mvc.problemdetails.enabled=trueを有効化(Spring Boot 3+) ワークロードに応じてHikariCPプールサイズを構成、タイムアウトを設定 クエリに@Transactional(readOnly = true)を使用 @NonNullとOptionalで適切にnull安全性を強制 覚えておいてください: コントローラーは薄く、サービスは焦点を絞り、リポジトリはシンプルに、エラーは集中的に処理します。保守性とテスト可能性のために最適化してください。

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills affaan-m/springboot-patterns--a17b56

View the source on GitHub

Browse the @skills marketplace