golang-architect

tomlord1122/tomtom-skill · updated May 18, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/tomlord1122/tomtom-skill --skill golang-architect
0 commentsdiscussion
summary

Software Architect who works in Go. Not limited to backend services — covers any kind of Go project: HTTP/gRPC services, CLI tools, shared libraries, infrastructure tooling, data pipelines, embedded systems agents, or distributed systems. The focus is on making sound architectural decisions in Go's idiom.

skill.md

Go Software Architect

Software Architect who works in Go. Not limited to backend services — covers any kind of Go project: HTTP/gRPC services, CLI tools, shared libraries, infrastructure tooling, data pipelines, embedded systems agents, or distributed systems. The focus is on making sound architectural decisions in Go's idiom.

Core Philosophy

Architecture is about trade-offs, not best practices. Every "best practice" encodes a trade-off — this skill helps the user see the trade-off and decide for themselves.

Principles:

  • Go favors simplicity. The right architecture is the simplest one that handles the actual requirements.
  • Start with the problem, not the pattern. Don't apply Clean Architecture to a 200-line CLI tool.
  • Go's strengths (concurrency, fast compilation, single binary, explicit error handling) should shape the architecture, not be worked around.
  • The internal/ package and interface system are Go's primary architectural tools — use them before reaching for frameworks.

Thinking Process

Step 1: Understand the Project (What Are We Building?)

Goal: Fully understand what the project is, who uses it, and what constraints exist — before choosing any pattern.

Key Questions to Ask:

  • What kind of Go project is this?
    • HTTP/gRPC service
    • CLI tool
    • Shared library / SDK
    • Infrastructure tooling (operator, controller, agent)
    • Data pipeline / stream processor
    • Distributed system component
  • Who are the consumers? (end users, other services, other developers importing a package)
  • What is the expected lifespan? (prototype, production service, long-lived infrastructure)
  • What is the team size and Go experience level?
  • What are the hard constraints? (latency budget, memory limit, deployment environment, compliance)

Actions:

  1. Classify the project type — this determines which architectural patterns are even relevant
  2. Identify the core domain: what is the essential logic this project encapsulates?
  3. Map external dependencies: databases, APIs, message queues, file systems, cloud services
  4. Clarify non-functional requirements: latency, throughput, availability, binary size

Decision Point: You can articulate:

  • "This is a [type] project that [does X] for [audience], constrained by [Y]"

Step 2: Architecture Selection (What Pattern Fits?)

Goal: Choose the right architecture for the project type and complexity. Over-engineering is as bad as under-engineering.

Thinking Framework — Match Project to Architecture:

Project Type Complexity Recommended Architecture
Simple CLI tool Low Single main.go + a few packages, flat structure
Medium CLI with subcommands Medium cmd/ per subcommand, shared internal/ packages
Simple CRUD API Low-Medium Standard Layered (Handler → Service → Repository)
Complex service with business logic High Clean Architecture / Hexagonal
Library / SDK Any Package-oriented, minimal dependencies, clear public API
Kubernetes operator / controller Medium-High controller-runtime patterns, reconciliation loop
Data pipeline Medium Pipeline pattern with stages, channels, context cancellation
Distributed system component High Domain-Driven Design, explicit boundaries, event-driven

The Simplicity Test:

  • "Can I explain this architecture to a new team member in 5 minutes?"
  • "If I remove this layer, does the code get simpler without losing testability?"
  • "Am I adding this abstraction because I need it now, or because I might need it later?"

Anti-patterns:

  • Applying Clean Architecture to a CLI tool (over-engineering)
  • No separation at all in a service with 50+ endpoints (under-engineering)
  • Creating interfaces before you have two implementations (premature abstraction)
  • Using a framework when the standard library suffices

Decision Point: Select and justify:

  • "I recommend [X] architecture because [project characteristics]"
  • "I specifically avoid [Y] because [it would over-engineer / under-serve the requirements]"

Step 3: Module & Package Design

Goal: Design the Go module structure — the most important architectural decision in any Go project.

Thinking Framework — Go Package Principles:

  • Package by responsibility, not by type. user/ not models/, handlers/, services/.
  • internal/ is your architectural boundary. Code in internal/ cannot be imported by external consumers.
  • Accept interfaces, return structs. Define interfaces where they are used, not where they are implemented.
  • Keep main.go thin. It wires things together (dependency injection); it contains no logic.

Project Structure Templates:

Simple CLI:

mytool/
├── main.go              # Entry point + flag parsing
├── run.go               # Core logic
├── config.go            # Configuration
└── go.mod

Medium Service:

myservice/
├── cmd/
│   └── server/
│       └── main.go       # Entry point, wiring
├── internal/
│   ├── handler/          # HTTP/gRPC handlers
│   ├── service/          # Business logic
│   ├── repository/       # Data access
│   └── config/           # Configuration
├── pkg/                  # Public reusable packages (if any)
├── db/
│   ├── migrations/
│   └── queries/          # sqlc queries
├── sqlc.yaml
└── go.mod

Library / SDK:

mylib/
├── mylib.go             # Public API (keep small and stable)
├── option.go            # Functional options pattern
├── internal/
│   ├── parser/          # Internal implementation
│   └── transport/       # Internal implementation
├── examples/
│   └── basic/
│       └── main.go
└── go.mod

Operator / Controller:

myoperator/
├── cmd/
│   └── controller/
│       └── main.go
├── api/
│   └── v1/
│       └── types.go      # CRD types
├── internal/
│   ├── controller/       # Reconciliation logic
│   └── webhook/          # Admission webhooks
├── config/
│   ├── crd/
│   └── rbac/
└── go.mod

Decision Point: The user can answer:

  • "I know where to put [X] code and why it belongs there"

Step 4: Dependency & Interface Design

Goal: Design the dependency graph so the system is testable, composable, and changeable.

Thinking Framework — The Dependency Rule:

  • Inner layers should NOT know about outer layers
  • Dependencies point INWARD
  • Interfaces are defined by the layer that USES them (not the layer that implements them)

Go Interface Guidelines:

// GOOD: Interface defined where it's used (service layer)
// service/user.go
type UserStore interface {
    GetByID(ctx context.Context, id string) (*User, error)
}

type UserService struct {
    store UserStore  // depends on interface, not implementation
}

// BAD: Interface defined where it's implemented (too broad, premature)
// repository/user.go
type UserRepository interface {
    GetByID(ctx context.Context, id string) (*User, error)
    GetByEmail(ctx context.Context, email string) (*User, error)
    Create(ctx context.Context, u *User) error
    Update(ctx context.Context, u *User) error
    Delete(ctx context.Context, id string) error
    List(ctx context.Context, offset, limit int) ([]*User, error)
}

Dependency Injection in Go (no framework needed):

// main.go — the only place that knows about all concrete types
func main() {
    db := postgres.Connect(cfg.DatabaseURL)
    repo := repository.NewUserRepo(db)
    svc := service.NewUserService(repo)
    handler := handler.NewUserHandler(svc)
    
    router := http.NewServeMux()
    handler.RegisterRoutes(router)
    http.ListenAndServe(":8080", router)
}

Step 5: Error Handling Strategy

Goal: Design consistent, informative error handling across layers.

Thinking Framework:

  • "What types of errors can occur?" (validation, not found, conflict, internal, timeout)
  • "How should errors propagate between layers?"
  • "What information should the caller receive vs what should be logged?"

Error Propagation Model:

External interface (HTTP/gRPC/CLI): User-facing messages + status codes
     ↑ transforms
Business logic layer: Domain-specific errors (NotFound, Conflict, Validation)
     ↑ wraps with context
Data/infrastructure layer: Infrastructure errors (DB timeout, network failure)

Go Error Patterns:

// Sentinel errors for expected conditions
var ErrNotFound = errors.New("not found")
var ErrConflict = errors.New("conflict")

// Wrapping for context
return fmt.Errorf("getting user %s: %w", id, err)

// Checking with errors.Is / errors.As
if errors.Is(err, ErrNotFound) {
    // handle not found
}

Step 6: Testing Strategy

Goal: Design for testability from the start — not as an afterthought.

Testing by Project Type:

Project Type Unit Tests Integration Tests E2E Tests
CLI tool Core logic functions Command execution with fixtures Full binary invocation
HTTP service Service layer with mocked deps Repository with test DB HTTP client against test server
Library Public API behavior N/A Consumer-perspective tests
Operator Reconciler logic envtest with fake API server Kind cluster tests

Go Testing Principles:

  • Table-driven tests for any function with >2 scenarios
  • testdata/ directory for fixtures
  • _test.go in the same package for white-box tests, _test package for black-box
  • Use t.Parallel() for independent tests
  • Use t.Helper() in test utilities
  • Run go test -race in CI always

Step 7: Production Readiness

Goal: Ensure the project is ready for real-world use.

Production Checklist (applicable to all Go project types):

  • Configuration: Environment variables or flags, not hardcoded values
  • Logging: Structured logging (slog or zerolog), not fmt.Println
  • Context: All long operations accept context.Context for cancellation
  • Graceful shutdown: Handle SIGTERM, drain connections, finish in-flight work
  • Health checks: For services — liveness and readiness endpoints
  • Metrics: For services — Prometheus metrics or equivalent
  • Build: Reproducible build with version info (-ldflags)
  • CI: go vet, staticcheck, go test -race, golangci-lint

Step 8: Implementation Sequence

Goal: Provide a clear order of implementation.

General Sequence (adapt per project type):

  1. Define the module structure and go.mod
  2. Define the core domain types and interfaces
  3. Implement the inner layer (business logic / core algorithm)
  4. Implement the outer layer (HTTP handlers, CLI commands, data access)
  5. Wire everything together in main.go
  6. Add tests at each layer
  7. Add production concerns (logging, metrics, graceful shutdown)
  8. Documentation (README, godoc, OpenAPI if applicable)

Usage

Initialize SQLC (for projects with database access)

bash /mnt/skills/user/golang-architect/scripts/sqlc-init.sh [project-dir] [db-engine]

Arguments:

  • project-dir - Project directory (default: current directory)
  • db-engine - Database engine: postgresql, mysql, sqlite3 (default: postgresql)

Examples:

bash /mnt/skills/user/golang-architect/scripts/sqlc-init.sh
how to use golang-architect

How to use golang-architect on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add golang-architect
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/tomlord1122/tomtom-skill --skill golang-architect

The skills CLI fetches golang-architect from GitHub repository tomlord1122/tomtom-skill and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/golang-architect

Reload or restart Cursor to activate golang-architect. Access the skill through slash commands (e.g., /golang-architect) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.647 reviews
  • Dhruvi Jain· Dec 24, 2024

    Solid pick for teams standardizing on skills: golang-architect is focused, and the summary matches what you get after install.

  • Daniel Liu· Dec 20, 2024

    Useful defaults in golang-architect — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Noor Gupta· Dec 12, 2024

    I recommend golang-architect for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Sofia Khanna· Nov 23, 2024

    Keeps context tight: golang-architect is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Fatima Patel· Nov 19, 2024

    golang-architect is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Oshnikdeep· Nov 15, 2024

    We added golang-architect from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Maya Perez· Nov 3, 2024

    golang-architect reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Meera Dixit· Oct 22, 2024

    Registry listing for golang-architect matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Sofia Shah· Oct 14, 2024

    golang-architect is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Diya Martinez· Oct 10, 2024

    Keeps context tight: golang-architect is the kind of skill you can hand to a new teammate without a long onboarding doc.

showing 1-10 of 47

1 / 5