# Li Lance Android Seraphim Framework Golang Architecture

> Golang Architecture

- Skill: `tomevault-io/li-lance-android-seraphim-framework-golang-architecture` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/li-lance-android-seraphim-framework-golang-architecture`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/li-lance-android-seraphim-framework-golang-architecture/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/li-lance-android-seraphim-framework-golang-architecture

---


# Golang Architecture

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

## Principles

- **Clean Architecture**: Inner layers (Domain) rely on nothing. Outer layers (Adapters) rely on
  inner.
- **Project Layout**: Follow standard Go layout (`cmd`, `internal`, `pkg`).
- **Dependency Injection**: Pass dependencies via constructors. Avoid global singletons.
- **Package Oriented Design**: Organize by feature/domain, not by layer.
- **Interface Segregation**: Define interfaces where they are _used_ (consumer side).

## Implementation Workflow

1. **Set up project layout** — Use `cmd/` for entry points, `internal/` for private packages, `pkg/`
   for shared libraries.
2. **Define domain layer** — Inner-most layer with zero external dependencies.
3. **Build use cases** — Depend only on Domain interfaces.
4. **Implement adapters** — Outer layer depends on UseCase/Domain. Contains HTTP handlers, DB repos,
   etc.
5. **Wire in main** — Compose the full dependency graph in `main.go`.

See [constructor injection and wiring examples](references/clean-arch.md)

## Verification Checklist

- [ ] No global singletons or package-level mutable variables
- [ ] Dependencies explicitly passed via constructors
- [ ] Interfaces defined at the consumer side
- [ ] `internal/domain` has zero external dependencies
- [ ] Dependencies wired together in `main.go`

## Anti-Patterns

- **No global singletons**: Use DI; avoid package-level mutable variables.
- **No layer violations**: Domain must not import from adapter/infrastructure layers.
- **No god services**: Split into single-responsibility components.

## References

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

---
> Source: [li-lance/android-seraphim-framework](https://github.com/li-lance/android-seraphim-framework) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->

