go-mental-model

Enforce a three-layer Go architecture with bounded data flow and minimal indirection.

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/OlegHQ/claude-config --skill go-mental-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-mental-model
Source: https://github.com/OlegHQ/claude-config/tree/main/go-skills-plugin/skills/go-mental-model
Command: npx skills add https://github.com/OlegHQ/claude-config --skill go-mental-model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go codebases often accumulate complexity due to excessive indirection and unclear data flow. The Go Mental Model provides principles to simplify reasoning, reduce cognitive load, and promote clean, maintainable code before writing code.

Core Features & Use Cases

  • Indirection budgeting: keep layers minimal (Handler → Service → Repository) to aid traceability.
  • Code locality and readability: encourage single-package boundaries and explicit interfaces.
  • Onboarding and design reviews: fast evaluation of trade-offs and readability during feature design and PR reviews.

Quick Start

Organize a new Go feature into a three-layer structure with clear responsibilities and minimal indirection.

Frequently Asked Questions about go-mental-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce Go code complexity and excessive indirection?

Reduce Go code complexity by enforcing a bounded data flow with a strict three-layer architecture (Handler → Service → Repository). This structure limits indirection, keeps data flow traceable, and clarifies code readability before implementation.

What is the best way to structure a Go feature for maintainability?

The best way to structure Go features for maintainability is organizing them into a three-layer architecture: Handler, Service, and Repository. This enforces clear responsibilities, single-package boundaries, and explicit interfaces to minimize cognitive load.

How do I evaluate architectural trade-offs during Go code reviews?

Evaluate Go code review trade-offs by applying indirection budgeting and checking code locality. Ensure the implementation adheres to concise interfaces and explicit documentation of architectural decisions to maintain readability and bounded data flow.

Can I use this mental model for onboarding new developers to a Go codebase?

Yes, you can use this model for onboarding developers to a Go codebase. It provides fast evaluation of feature design trade-offs and relies on a strict Handler → Service → Repository structure to make data flow traceable and readable.

Why does my Go codebase have high cognitive load and unclear data flow?

Go codebases suffer high cognitive load and unclear data flow due to excessive indirection and lack of bounded architectural layers. Applying single-package boundaries, concise interfaces, and a Handler → Service → Repository pattern resolves this.