원클릭으로
uw-analyze-service
Use when analyzing business logic, use cases, service orchestration, and data transformation including DTOs and mappers
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when analyzing business logic, use cases, service orchestration, and data transformation including DTOs and mappers
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use after unwind:uw-plan to EXECUTE the rebuild — interview the user about scope/order/target, dispatch technology-agnostic per-layer builder agents that reproduce the [MUST] contracts in the target stack, hold rebuild state in a local file, and maintain a source→target verification graph that measures completeness. Supports a loop-until-verified mode.
Use to visually explore the rebuild knowledge graph. Builds and launches the Unwind dashboard (React + React Flow + ELK) pointed at docs/unwind/rebuild-graph.json with coverage, priority, and contract views.
Optional. Publish the Unwind dashboard to the scanned project's GitHub Pages gh-pages branch so it's viewable at https://<owner>.github.io/<repo>/unwind/. Builds the dashboard at the correct sub-path and commits it into an `unwind/` subdir — never blatting an existing gh-pages branch. Confirms the target, then pushes.
Use when dispatched by unwind:uw-build to rebuild ONE layer/slice of a codebase in the target stack. Technology-agnostic builder that reproduces the layer's [MUST] contracts (API surface, data model, business rules) as idiomatic target-stack code and records the source→target mapping for verification.
Use when starting any reverse engineering task - establishes how to find and use Unwind skills for codebase analysis, service mapping, and documentation
Use after layer analysis is complete to interview the user about the rebuild strategy (target stack, what to keep vs rebuild, phasing, risk) and generate a data-grounded REBUILD-PLAN.md that records those decisions.
| name | uw-analyze-service |
| description | Use when analyzing business logic, use cases, service orchestration, and data transformation including DTOs and mappers |
| allowed-tools | ["Read","Grep","Glob","Bash(mkdir:*, ls:*)","Write(docs/unwind/**)","Edit(docs/unwind/**)"] |
Output: docs/unwind/layers/service-layer/ (folder with index.md + section files)
Principles: See analysis-principles.md - completeness, machine-readable, link to source, no commentary, incremental writes.
docs/unwind/layers/service-layer/
├── index.md # Overview, service count, dependency graph
├── services.md # Service class definitions
├── dtos.md # Data transfer objects
├── mappers.md # Mapping logic
├── formulas.md # Business calculations [MUST]
└── clients.md # External client integrations
For large codebases (20+ services), split by domain:
docs/unwind/layers/service-layer/
├── index.md
├── users-domain.md
├── orders-domain.md
└── ...
Step 1: Setup
mkdir -p docs/unwind/layers/service-layer/
Write initial index.md:
# Service Layer
## Sections
- [Services](services.md) - _pending_
- [DTOs](dtos.md) - _pending_
- [Mappers](mappers.md) - _pending_
- [Formulas](formulas.md) - _pending_
- [External Clients](clients.md) - _pending_
## Summary
_Analysis in progress..._
Step 2: Analyze and write services.md
services.md immediatelyindex.mdStep 3: Analyze and write dtos.md
dtos.md immediatelyindex.mdStep 4: Analyze and write mappers.md
mappers.md immediatelyindex.mdStep 5: Analyze and write formulas.md
formulas.md immediatelyindex.mdStep 6: Analyze and write clients.md (if applicable)
clients.md immediatelyindex.mdStep 7: Finalize index.md Add dependency graph and final counts
# Service Layer
## Services
### UserService
[UserService.java](https://github.com/owner/repo/blob/main/src/service/UserService.java)
```java
@Service
@RequiredArgsConstructor
public class UserService {
private final UserRepository userRepository;
private final PasswordEncoder passwordEncoder;
private final EmailService emailService;
@Transactional
public User createUser(CreateUserRequest request) {
if (userRepository.existsByEmail(request.email())) {
throw new DuplicateEmailException(request.email());
}
User user = new User(request.email(), passwordEncoder.encode(request.password()));
user = userRepository.save(user);
emailService.sendWelcome(user);
return user;
}
@Transactional(readOnly = true)
public User getUser(Long id) {
return userRepository.findById(id)
.orElseThrow(() -> new UserNotFoundException(id));
}
}
[Continue for ALL services...]
public record CreateUserRequest(
@NotBlank @Email String email,
@NotBlank @Size(min = 8) String password,
@NotBlank String name
) {}
public record UserResponse(
Long id,
String email,
String name,
UserStatus status,
Instant createdAt
) {}
[Continue for ALL DTOs...]
@Mapper(componentModel = "spring")
public interface UserMapper {
UserResponse toResponse(User user);
@Mapping(target = "id", ignore = true)
@Mapping(target = "status", constant = "ACTIVE")
User toEntity(CreateUserRequest request);
}
@Component
public class StripeClient {
@Retryable(maxAttempts = 3, backoff = @Backoff(delay = 1000))
public PaymentResult charge(String token, Money amount) {
// Stripe API call
}
}
graph TD
UserService --> UserRepository
UserService --> PasswordEncoder
UserService --> EmailService
OrderService --> OrderRepository
OrderService --> UserService
OrderService --> PaymentService
PaymentService --> StripeClient
## Additional Requirements
### Formula Documentation [MUST]
For every calculation or business formula:
1. **Document with exact source reference:**
```markdown
### Cost Calculation [MUST]
**Source:** `snapshot-operations.ts:186`
```typescript
total = periods[rate.interval] * rate.rate * fteBasis * allocation * holidayPercentage
2. **Document ALL edge cases and conditional logic:**
```markdown
### Rate Interval Edge Cases [MUST]
| Interval | Formula | Note |
|----------|---------|------|
| hours | workingDays * 8 * rate * fte * allocation | 8 hours/day hardcoded |
| days | workingDays * rate * fte * allocation | Standard |
| weeks | ceil(workingDays/5) * rate * fte * allocation | Rounds up |
| months | rate * fte * allocation | **NO period multiplier** |
| years | (workingDays/365) * rate * fte * allocation | Prorated |
### Constants [MUST]
| Constant | Value | Location |
|----------|-------|----------|
| hoursPerDay | 8 | builder.ts:185 |
| daysInYear | 365 | builder.ts:208 |
Document any fallback chains or resolution hierarchies:
### Rate Resolution Chain [MUST]
1. **Primary:** supplier + employmentType + roleLevel + calendar + branch
2. **Fallback:** supplier + calendar + branch (null employmentType/roleLevel)
3. **Missing:** Logged to missingRates array, uses 0
Note where transactions begin/end and any batch processing patterns.
Every service, function, and formula must have a [MUST], [SHOULD], or [DON'T] tag in its heading.
Default categorizations for service layer:
Example:
### BudgetBuilder [MUST]
### CostCalculation formula [MUST]
### RateResolutionChain [MUST]
### CacheService [SHOULD]
See analysis-principles.md section 9 for full tagging rules.
If docs/unwind/layers/service-layer/ exists, compare current state and add ## Changes Since Last Review section to index.md.