Strategic architecture, tactical design, and testable code principles (SOLID, Clean Architecture, Design Patterns, Testable Design)
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
A TypeScript monorepo has two modules with a circular import error:
src/modules/payments/payment-service.ts
import { NotificationService } from '../notifications/notification-service';
export class PaymentService {
private notifier = new NotificationService();
async processPayment(userId: string, amount: number): Promise<void> {
// ... process payment
await this.notifier.sendPaymentConfirmation(userId, amount);
}
}src/modules/notifications/notification-service.ts
import { PaymentService } from '../payments/payment-service';
export class NotificationService {
private paymentService = new PaymentService();
async sendPaymentConfirmation(userId: string, amount: number): Promise<void> {
const history = await this.paymentService.getHistory(userId);
// format and send notification with history
}
}The circular import is: PaymentService → NotificationService → PaymentService.
Produce:
REFACTOR.md explaining the root cause and the approach taken to break the cycleclean-architecture
evals
references
design-patterns
solid-principles
testable-design