Apply software design principles across architecture and implementation using deterministic decision workflows, SOLID checks, structural patterns, and anti-pattern detection; use when reviewing designs, refactoring modules, or resolving maintainability and coupling risks.
Does it follow best practices?
Evaluation — 99%
↑ 1.01xAgent success when using this tile
Validation for skill structure
Presenters accept data from use cases and format it for presentation. They create view models with strings, booleans, and pre-formatted values - nothing left for the view to compute.
Incorrect (view does formatting):
// View component does formatting - logic spread across UI
function InvoiceView({ invoice }: { invoice: Invoice }) {
// Formatting logic in view
const formattedDate = new Date(invoice.dueDate).toLocaleDateString('en-US', {
month: 'long',
day: 'numeric',
year: 'numeric'
})
const formattedTotal = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: invoice.currency
}).format(invoice.total / 100)
const statusColor = invoice.status === 'paid' ? 'green'
: invoice.status === 'overdue' ? 'red'
: 'yellow'
const daysOverdue = invoice.status === 'overdue'
? Math.floor((Date.now() - new Date(invoice.dueDate).getTime()) / 86400000)
: 0
return (
<div>
<span style={{ color: statusColor }}>{invoice.status.toUpperCase()}</span>
<span>Due: {formattedDate}</span>
<span>Total: {formattedTotal}</span>
{daysOverdue > 0 && <span>{daysOverdue} days overdue</span>}
</div>
)
}Correct (presenter formats, view renders):
// presenter/InvoicePresenter.ts
interface InvoiceViewModel {
invoiceNumber: string
status: string
statusColor: 'green' | 'yellow' | 'red'
dueDate: string
total: string
overdueMessage: string | null
}
class InvoicePresenter {
present(invoice: InvoiceResult, locale: string): InvoiceViewModel {
return {
invoiceNumber: `INV-${invoice.id.padStart(6, '0')}`,
status: invoice.status.toUpperCase(),
statusColor: this.getStatusColor(invoice.status),
dueDate: this.formatDate(invoice.dueDate, locale),
total: this.formatMoney(invoice.total, invoice.currency, locale),
overdueMessage: this.getOverdueMessage(invoice)
}
}
private getStatusColor(status: string): 'green' | 'yellow' | 'red' {
const colors = { paid: 'green', pending: 'yellow', overdue: 'red' }
return colors[status] || 'yellow'
}
private formatDate(date: Date, locale: string): string {
return new Intl.DateTimeFormat(locale, {
month: 'long', day: 'numeric', year: 'numeric'
}).format(date)
}
private getOverdueMessage(invoice: InvoiceResult): string | null {
if (invoice.status !== 'overdue') return null
const days = this.calculateDaysOverdue(invoice.dueDate)
return `${days} day${days !== 1 ? 's' : ''} overdue`
}
}
// view/InvoiceView.tsx - Humble, just renders
function InvoiceView({ vm }: { vm: InvoiceViewModel }) {
return (
<div>
<span style={{ color: vm.statusColor }}>{vm.status}</span>
<span>Due: {vm.dueDate}</span>
<span>Total: {vm.total}</span>
{vm.overdueMessage && <span>{vm.overdueMessage}</span>}
</div>
)
}Benefits:
Reference: Clean Architecture - Presenters and Humble Objects
Install with Tessl CLI
npx tessl i pantheon-ai/software-design-principlesevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
references