CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/separation-of-concerns

Enforce strict three-layer architecture: thin HTTP routes, pure service logic with domain errors, isolated data access with dependency injection.

94

1.08x
Quality

93%

Does it follow best practices?

Impact

97%

1.08x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

thin-route-handlers.jsonverifiers/

{
  "instruction": "Keep route handlers thin — only parse input, call service, map errors, return response",
  "relevant_when": "Agent is building API routes that interact with a database or contain business logic",
  "context": "Route handlers should: (1) parse/destructure input from req.body/params/query into plain objects, (2) perform basic input shape validation, (3) call a service function with plain data, (4) catch domain errors and map to HTTP status codes, (5) format and return the response. Database queries, business rules, calculations, and side effects belong in other layers.",
  "sources": [
    {
      "type": "file",
      "filename": "skills/separation-of-concerns/SKILL.md",
      "tile": "tessl-labs/separation-of-concerns@0.1.3"
    }
  ],
  "checklist": [
    {
      "name": "no-sql-in-routes",
      "rule": "Route handler files do not contain SQL queries, ORM query builders, or direct database client calls",
      "relevant_when": "Agent writes route handlers that need data"
    },
    {
      "name": "routes-call-service",
      "rule": "Route handlers delegate all business logic and data operations to service or store functions, passing plain data not req/res",
      "relevant_when": "Agent implements API endpoints with logic beyond simple CRUD"
    },
    {
      "name": "no-business-logic-in-routes",
      "rule": "Route handlers do not contain business rule validation, calculations, state transitions, or conditional logic beyond input shape checks",
      "relevant_when": "Agent implements API endpoints with complex logic"
    },
    {
      "name": "no-side-effects-in-routes",
      "rule": "Route handlers do not directly trigger side effects like sending emails, publishing events, or calling external APIs — these belong in services",
      "relevant_when": "Agent implements endpoints that have side effects"
    }
  ]
}

tile.json