一键导入
tdd-patterns
TDD workflow, per-layer test types, naming conventions, and test fixture patterns for Spring Boot. Use when writing or reviewing tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
TDD workflow, per-layer test types, naming conventions, and test fixture patterns for Spring Boot. Use when writing or reviewing tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Scaffold a new domain feature with TDD order (entity -> test -> service -> test -> controller -> test)
새 Spring Boot 멀티모듈 프로젝트의 기초 세팅(common shared kernel + Gradle/Docker/CI 골격)을 깔아주는 스킬. 시스템 설계 문서 기반 구현 시작 시 가장 먼저 발동. 핵심 골격만 포함 — `BusinessException`/`ErrorCodeBase`/`ApiResponse`/`GlobalExceptionHandler`/`BaseEntity` + JPA/CORS/OpenAPI configs. Kafka/Outbox/QueryDSL 같은 도메인 특화 패턴은 별도 llm-wiki에서 끌어다 쓴다.
Design partner mode for system design practice. Activated when the user wants to design a new system (chat, notification, news feed, URL shortener, etc.). Sets up topic directory, copies the mock-interview template, loads the matching problem from sysdesign-question-bank, marks the topic as active in .omx/state/, and conducts a back-and-forth Clarifying → High Level → Drill Down conversation, updating <topic>/System-Design-Document/mock-interview.md immediately as each decision lands. Uses Alex Xu Vol.1's canned numbers as the starting point (book-first), user adjusts. NOT an interview — the user drives, this skill is a design collaborator with a calculator (back-of- envelope, latency estimation via auto-injected sysdesign-frameworks) and a reference book (sysdesign-question-bank).
Scaffold a minimum-viable implementation of a designed system. Activated when the user is ready to write code. Reads sdd.md (or falls back to mock-interview.md), determines the smallest component subset that lets the design's NFRs be testable (NOT a full production build — single-region, in-memory or single-container infra, no CDN, no multi-region), asks the user for the language/framework stack (default Spring Boot + PostgreSQL + Kafka per project's existing skill set), then scaffolds <topic>/source/ with per-service directories, a docker-compose.yml that brings everything up locally, and test-results/ scaffolding for functional / load / failure tests. The point is verification of design assumptions, not production.
Promote a filled mock-interview.md into a formal Software Design Document (sdd.md) following the IEEE 1016 / Atlassian / Google design-doc style. Activated when the user says they are ready to write the SDD. Reads the topic's mock-interview.md AND the topic's conversation log files (which capture the back-and-forth detail not preserved in the structured mock-interview), then asks the user the SDD-specific questions that mock-interview doesn't cover (Constraints, ADRs, Risk Register, Rollout, Testing strategy). Writes sdd.md incrementally as decisions land.
TDD workflow, per-layer test types, naming conventions, and test fixture patterns for Spring Boot. Use when writing or reviewing tests.
| name | tdd-patterns |
| description | TDD workflow, per-layer test types, naming conventions, and test fixture patterns for Spring Boot. Use when writing or reviewing tests. |
| triggers | ["tdd","test first","red green refactor","@test","junit5","mockito mock","testcontainers","단위 테스트","통합 테스트"] |
Note: The
tddkeyword may also trigger OMC's built-in TDD skill. This overlap is acceptable — the OMC built-in provides general TDD guidance while this skill provides project-specific layer test patterns and fixture conventions.
| Layer | Test Type | Framework | What to Test | What to Mock |
|---|---|---|---|---|
| Entity/Domain | Unit | JUnit 5 | Invariants, validation, state transitions, equality | Nothing |
| Domain Service | Unit | JUnit 5 + Mockito | Business logic, cross-aggregate rules | Repository interfaces |
| Application Service | Unit | JUnit 5 + Mockito | Orchestration, DTO conversion, event publishing | Repository, domain services, infra |
| Application Service | Integration | @SpringBootTest + Testcontainers | Full flow with real DB | External APIs only |
| Controller | Slice | @WebMvcTest | Request mapping, validation, serialization | Application service |
| Repository | Slice | @DataJpaTest + Testcontainers | Custom queries, projections | Nothing |
Pattern: should_{expected_behavior}_when_{condition}
| Example |
|---|
should_create_order_when_valid_request |
should_throw_exception_when_insufficient_stock |
should_return_empty_when_product_not_found |
should_publish_event_when_order_placed |
| Pattern | When | How |
|---|---|---|
| Builder/Factory | Domain objects | OrderFixture.aValidOrder().withStatus(PENDING).build() |
@Sql | DB state setup | @Sql("/test-data/orders.sql") |
| Testcontainers | Integration tests needing Kafka/PostgreSQL/ES | @Container static PostgreSQLContainer<?> |
@MockBean | Spring slice tests | Mock application service in controller test |
| ArgumentCaptor | Verify event publishing | ArgumentCaptor<OrderCreatedEvent> |
OrderService -> OrderServiceTestsrc/test/java mirrors src/main/java package structure@Tag("integration")@Nested for grouping related scenarios