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
The Main component is the lowest-level, dirtiest component. It creates all factories, strategies, and global facilities, then hands control to high-level abstractions. Treat it as a plugin that can be swapped.
Incorrect (Main mixed with application logic):
// main.go
func main() {
db := connectDatabase()
// Business logic in main
http.HandleFunc("/orders", func(w http.ResponseWriter, r *http.Request) {
var order Order
json.NewDecoder(r.Body).Decode(&order)
// Validation logic
if order.Total < 0 {
http.Error(w, "Invalid total", 400)
return
}
// Direct database calls
db.Exec("INSERT INTO orders ...")
// Response formatting
json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
})
http.ListenAndServe(":8080", nil)
}
// Cannot test without starting HTTP server
// Cannot run with different databaseCorrect (Main as composition root):
// main.go - Production entry point
func main() {
app := bootstrap(ProductionConfig{
DatabaseURL: os.Getenv("DATABASE_URL"),
Port: os.Getenv("PORT"),
})
app.Run()
}
// bootstrap.go - Composition root
func bootstrap(config Config) *Application {
// Create infrastructure
db := postgres.NewConnection(config.DatabaseURL)
// Create repositories (implement domain interfaces)
orderRepo := postgres.NewOrderRepository(db)
userRepo := postgres.NewUserRepository(db)
// Create use cases (depend on interfaces)
placeOrder := usecases.NewPlaceOrderUseCase(orderRepo)
getOrders := usecases.NewGetOrdersUseCase(orderRepo)
// Create controllers (call use cases)
orderController := controllers.NewOrderController(placeOrder, getOrders)
// Wire up HTTP routes
router := http.NewRouter()
router.POST("/orders", orderController.Create)
router.GET("/orders", orderController.List)
return &Application{
Router: router,
Port: config.Port,
}
}
// main_test.go - Test entry point
func TestMain(t *testing.T) {
app := bootstrap(TestConfig{
DatabaseURL: "memory://", // In-memory for tests
Port: "0", // Random port
})
// Test against app
}
// main_dev.go - Development entry point
func main() {
app := bootstrap(DevConfig{
DatabaseURL: "localhost:5432",
Port: "3000",
})
app.RunWithHotReload()
}Benefits:
Reference: Clean Architecture - The Main Component
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