1---2name: li-lance-android-seraphim-framework-golang-architecture3description: Golang Architecture4---56# Golang Architecture78## **Priority: P0 (CRITICAL)**910## Principles1112- **Clean Architecture**: Inner layers (Domain) rely on nothing. Outer layers (Adapters) rely on13 inner.14- **Project Layout**: Follow standard Go layout (`cmd`, `internal`, `pkg`).15- **Dependency Injection**: Pass dependencies via constructors. Avoid global singletons.16- **Package Oriented Design**: Organize by feature/domain, not by layer.17- **Interface Segregation**: Define interfaces where they are _used_ (consumer side).1819## Implementation Workflow20211. **Set up project layout** — Use `cmd/` for entry points, `internal/` for private packages, `pkg/`22 for shared libraries.232. **Define domain layer** — Inner-most layer with zero external dependencies.243. **Build use cases** — Depend only on Domain interfaces.254. **Implement adapters** — Outer layer depends on UseCase/Domain. Contains HTTP handlers, DB repos,26 etc.275. **Wire in main** — Compose the full dependency graph in `main.go`.2829See [constructor injection and wiring examples](references/clean-arch.md)3031## Verification Checklist3233- [ ] No global singletons or package-level mutable variables34- [ ] Dependencies explicitly passed via constructors35- [ ] Interfaces defined at the consumer side36- [ ] `internal/domain` has zero external dependencies37- [ ] Dependencies wired together in `main.go`3839## Anti-Patterns4041- **No global singletons**: Use DI; avoid package-level mutable variables.42- **No layer violations**: Domain must not import from adapter/infrastructure layers.43- **No god services**: Split into single-responsibility components.4445## References4647- [Standard Project Layout](references/project-layout.md)48- [Clean Architecture Layers](references/clean-arch.md)4950---51> Source: [li-lance/android-seraphim-framework](https://github.com/li-lance/android-seraphim-framework) — distributed by [TomeVault](https://tomevault.io).52<!-- tomevault:4.0:skill_md:2026-06-16 -->
Run npx skillmds@latest add tomevault-io/li-lance-android-seraphim-framework-golang-architecture in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Golang Architecture It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.