Create structured implementation plans for Symfony features with clear steps, dependencies, and acceptance criteria
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Transform brainstorming results into actionable implementation plans.
# Implementation Plan: [Feature Name]
## Summary
[1-2 sentence description of what we're building]
## Scope
- IN: [What's included]
- OUT: [What's explicitly excluded]
## Dependencies
- [Required packages]
- [Existing services/entities to modify]
- [External services]
## Entities
### New Entity: Order
```php
#[ORM\Entity]
class Order
{
#[ORM\Id]
#[ORM\Column(type: 'uuid')]
private Uuid $id;
#[ORM\ManyToOne(targetEntity: User::class)]
private User $customer;
#[ORM\Column(type: 'string', enumType: OrderStatus::class)]
private OrderStatus $status;
#[ORM\OneToMany(targetEntity: OrderItem::class, mappedBy: 'order')]
private Collection $items;
}
orders OneToMany relation
### 3. Services & Handlers
```markdown
## Services
### OrderService
- `createOrder(User $user, array $items): Order`
- `calculateTotal(Order $order): Money`
- `validateStock(Order $order): bool`
### Message Handlers
### ProcessOrderHandler
- Triggered by: `ProcessOrder` message
- Actions:
1. Validate stock
2. Reserve items
3. Dispatch `OrderProcessed` event
## API Endpoints
### POST /api/orders
- Request: `{items: [{productId, quantity}]}`
- Response: `201 Created` with Order resource
- Security: `ROLE_USER`
### GET /api/orders/{id}
- Response: Order resource
- Security: Owner or `ROLE_ADMIN`
## Implementation Steps
### Phase 1: Foundation
1. [ ] Create `OrderStatus` enum
2. [ ] Create `Order` entity with migrations
3. [ ] Create `OrderItem` entity with migrations
4. [ ] Add relation to `User` entity
5. [ ] Run migrations
### Phase 2: Business Logic
6. [ ] Create `OrderService`
7. [ ] Create `ProcessOrder` message
8. [ ] Create `ProcessOrderHandler`
9. [ ] Write unit tests for service
### Phase 3: API
10. [ ] Configure API Platform resource
11. [ ] Add security voters
12. [ ] Write functional tests
### Phase 4: Integration
13. [ ] Connect to payment service
14. [ ] Add email notifications
15. [ ] End-to-end testing
## Acceptance Criteria
- [ ] User can create order with multiple items
- [ ] Order total is calculated correctly
- [ ] Stock is validated before processing
- [ ] Only owner can view their orders
- [ ] Admin can view all orders
- [ ] Order status transitions are validated
- [ ] Email sent on order confirmation
## Risks
| Risk | Probability | Impact | Mitigation |
|------|-------------|--------|------------|
| Stock race condition | Medium | High | Use database locking |
| Payment failure | Low | High | Implement retry with Messenger |
| Performance on large orders | Low | Medium | Batch processing |
# Plan: [Entity] CRUD
## Entities
- [Entity] with fields: [list]
## Steps
1. [ ] Create entity + migration
2. [ ] Create Foundry factory
3. [ ] Configure API Platform resource
4. [ ] Add validation constraints
5. [ ] Add security voter
6. [ ] Write tests
# Plan: [Job Name]
## Messages
- [MessageName]: [trigger description]
## Handlers
- [HandlerName]: [processing steps]
## Steps
1. [ ] Create message class
2. [ ] Create handler
3. [ ] Configure routing in messenger.yaml
4. [ ] Add retry strategy
5. [ ] Write tests with in-memory transport
# Plan: [Service] Integration
## External Service
- API: [URL/docs]
- Auth: [method]
- Rate limits: [limits]
## Steps
1. [ ] Create HTTP client service
2. [ ] Create DTOs for requests/responses
3. [ ] Implement retry logic
4. [ ] Add circuit breaker
5. [ ] Write tests with mocked responses