Skip to content
Back to skills

Architecture 1

ASecurity

Standards for structural design, Clean Architecture, and project layout in Golang.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
designgosqldatabase

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill architecture-1 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Architecture 1?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Architecture 1
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-architecture-1/badge)](https://www.skillsdirectory.com/skills/david-li0406-architecture-1)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Architecture
description: Standards for structural design, Clean Architecture, and project layout in Golang.
metadata:
  labels: [golang, architecture, clean-arch, project-layout, ddd]
  triggers:
    files: ['go.mod', 'internal/**']
    keywords:
      [architecture, structure, folder layout, clean arch, dependency injection]
---

# Golang Architecture Standards

## **Priority: P0 (CRITICAL)**

## Principles

- **Clean Architecture**: Separate concerns. Inner layers (Domain) rely on nothing. Outer layers (Adapters) rely on Inner.
- **Project Layout**: Follow standard Go project layout (`cmd`, `internal`, `pkg`).
- **Dependency Injection**: Explicitly pass dependencies via constructors. Avoid global singletons.
- **Package Oriented Design**: Organize by feature/domain, not by layer (avoid `controllers/`, `services/` at root).
- **Interface Segregation**: Define interfaces where they are _used_ (Consumer implementation).

## Standard Project Layout

- `cmd/`: Application entry points (e.g., `cmd/server/main.go`).
- `internal/`: Private application code. Not importable by other modules.
  - `internal/domain/`: Entities, Business Rules (Pure Go, no heavy imports).
  - `internal/usecase/`: Application Logic (Interactors).
  - `internal/adapter/`: Database, HTTP, GRPC adapters.
- `pkg/`: Library code ok to use by external applications.
- `configs/`: Configuration files.

## Guidelines

- **Use Constructors**: `NewService(repo Repository) *Service`.
- **Inversion of Control**: Service depends on `Repository` interface, not `SQLRepository` struct.
- **Wire up in Main**: Main function composes the dependency graph.

## References

- [Standard Project Layout](references/project-layout.md)
- [Clean Architecture Layers](references/clean-arch.md)

Files in this skill

  • SKILL.md1.7 KB
  • references/clean-arch.md1.4 KB
  • references/project-layout.md1.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…