CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/go-project-structure

Go project structure -- cmd/internal layout, handler/service/repository layers, Makefile, config from environment, domain error types, test placement, dependency injection

90

1.02x
Quality

84%

Does it follow best practices?

Impact

100%

1.02x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsonevals/scenario-4/

{
  "context": "Tests whether the agent builds a Go task queue service as a reference implementation with proper project structure, layered architecture, domain types, multiple test files alongside source code, and comprehensive Makefile.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "cmd/ entry point with constructor DI",
      "description": "main.go is in cmd/<name>/ and chains constructor calls (NewRepo -> NewService -> NewHandler) with no business logic",
      "max_score": 8
    },
    {
      "name": "internal/ directory for all packages",
      "description": "All application code is inside internal/ -- handler, service, repository, domain, config",
      "max_score": 7
    },
    {
      "name": "Handler layer with route registration",
      "description": "internal/handler/ has Handler struct with service dependencies injected, RegisterRoutes method, and endpoint handlers",
      "max_score": 7
    },
    {
      "name": "Service layer defines repository interface",
      "description": "internal/service/ has TaskService with business logic. Defines TaskRepository interface consumed by the service.",
      "max_score": 8
    },
    {
      "name": "Repository implements interface",
      "description": "internal/repository/ has concrete TaskRepo that implements the repository interface",
      "max_score": 6
    },
    {
      "name": "Domain models with constants",
      "description": "internal/domain/ has Task struct, TaskStatus constants (pending/processing/completed/failed), TaskType constants or validation",
      "max_score": 6
    },
    {
      "name": "Domain error types",
      "description": "AppError, NotFoundError, ValidationError, and ConflictError in domain package with HTTP status mapping",
      "max_score": 6
    },
    {
      "name": "Config from environment",
      "description": "internal/config/ loads PORT, DATABASE_URL, and other settings from env with defaults",
      "max_score": 6
    },
    {
      "name": "Comprehensive Makefile",
      "description": "Makefile has build, run, test, lint, fmt, and tidy targets. Test uses -race flag.",
      "max_score": 6
    },
    {
      "name": "Service test file alongside source",
      "description": "internal/service/tasks_test.go (or similar) exists in same directory as service code",
      "max_score": 7
    },
    {
      "name": "Handler test file alongside source",
      "description": "A *_test.go file exists in internal/handler/ directory",
      "max_score": 5
    },
    {
      "name": "Table-driven tests with multiple cases",
      "description": "Tests use table-driven pattern with at least 3 test cases and t.Run subtests",
      "max_score": 6
    },
    {
      "name": "go.mod present",
      "description": "go.mod exists with module path",
      "max_score": 4
    },
    {
      "name": ".gitignore",
      "description": ".gitignore includes bin/, .env, coverage artifacts",
      "max_score": 3
    },
    {
      "name": "Graceful shutdown",
      "description": "main.go handles OS signals for graceful server shutdown",
      "max_score": 4
    }
  ]
}

evals

tile.json