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-1/

{
  "context": "Tests whether the agent restructures a blog API into proper Go project layout with cmd/internal, layered architecture, domain package, environment config, Makefile, and test files alongside source.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "cmd/ entry point",
      "description": "main.go is in cmd/<name>/ with dependency wiring only -- no handler logic or SQL",
      "max_score": 7
    },
    {
      "name": "internal/ for all packages",
      "description": "All application code is inside internal/ (handler, service, repository, domain, config)",
      "max_score": 8
    },
    {
      "name": "Handler layer separated",
      "description": "HTTP handlers in internal/handler/ with Handler struct, route registration, and response helpers",
      "max_score": 7
    },
    {
      "name": "Service layer with interfaces",
      "description": "Business logic in internal/service/ with PostService and/or CommentService. Service defines repository interface.",
      "max_score": 8
    },
    {
      "name": "Repository layer",
      "description": "Database code in internal/repository/ or internal/store/, separate from handlers",
      "max_score": 6
    },
    {
      "name": "Domain types package",
      "description": "Post, Comment, and request types are in internal/domain/ or internal/model/ with no external dependencies",
      "max_score": 6
    },
    {
      "name": "Domain error types",
      "description": "Error types (NotFound, Validation) defined in domain package with HTTP status codes",
      "max_score": 6
    },
    {
      "name": "Centralized writeError",
      "description": "writeError or similar function maps domain errors to HTTP responses in one place",
      "max_score": 5
    },
    {
      "name": "Config from environment",
      "description": "Configuration loaded from env vars with defaults in internal/config/",
      "max_score": 6
    },
    {
      "name": "Makefile",
      "description": "Makefile with at least build, test, run targets",
      "max_score": 5
    },
    {
      "name": "Tests alongside source",
      "description": "Test files are in same directory as source (e.g., internal/service/posts_test.go), not a separate tests/ dir",
      "max_score": 7
    },
    {
      "name": "Table-driven tests",
      "description": "At least one test uses table-driven pattern with t.Run",
      "max_score": 5
    },
    {
      "name": "go.mod",
      "description": "go.mod exists with module path",
      "max_score": 4
    },
    {
      "name": ".gitignore",
      "description": ".gitignore includes bin/, .env, Go build artifacts",
      "max_score": 3
    },
    {
      "name": "Middleware registered",
      "description": "Route registration includes middleware for logging and/or recovery",
      "max_score": 4
    },
    {
      "name": "Graceful shutdown",
      "description": "main.go handles signals for graceful shutdown",
      "max_score": 4
    }
  ]
}

evals

scenario-1

criteria.json

task.md

tile.json