modular-go

Practical guidance for Go package design with minimal public APIs, single-responsibility boundaries, stateless-first flow, one-way state transitions, and orchestration-to-capability separation. Use when creating, refactoring, or reviewing Go architecture, package boundaries, interfaces, handlers, managers, builders, and execution flows.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "modular-go" with this command: npx skills add psiace/skills/psiace-skills-modular-go

modular-go

Concise guidance for designing Go packages that stay small, focused, and easy to evolve.

Purpose and Triggers

  • Use for Go package design, refactoring, and code review.
  • Focus on API boundaries, state modeling, and flow decomposition.
  • Use when deciding the right abstraction level: local helper, utility package, manager, or builder.
  • Prefer explicit boundaries over convenience exports.

Design Principles

  1. Every export is a promise — keep the public surface minimal and intentional.
  2. One package, one responsibility you can explain in one sentence.
  3. Depth over breadth — narrow interfaces that hide rich implementations outlast wide, shallow ones.
  4. Stateless by default — treat mutable state as liability that must justify its lifecycle cost.
  5. Split along responsibility seams, not file size — every new boundary must earn its indirection cost.
  6. Orchestration tells the story; capability methods do the work.
  7. Boundaries are translation layers — convert errors, types, and protocols at the edges, not in core logic.
  8. Choose the smallest abstraction that solves the real problem; resist premature generalization.
  9. Lifecycle is a first-class design concern — design shutdown paths alongside startup paths.

Workflow

  1. Define one package responsibility.
  2. Expose one obvious primary entry point (type, interface, or function).
  3. Keep helpers local by default; extract to xxxutil only for real cross-package reuse.
  4. Keep transport handlers focused on protocol mapping and delegate behavior to injected dependencies.
  5. Compose orchestration from focused functions, with short stage-intent comments.
  6. Re-evaluate boundaries when a package can no longer be explained in one sentence.
  7. Re-check against the reference checklists before merge.

Topics

TopicGuidanceReference
Module BoundaryExpose minimal API and separate deep vs wide interfacesreferences/module-boundary.md
State FlowUse stateless functions and one-shot state objectsreferences/state-flow.md
OrchestrationUse a single public executor and internal helpersreferences/orchestration.md
gRPC PracticesKeep handlers as thin translators; isolate transport from domainreferences/grpc-practices.md
Review ChecklistRun a fast architecture sanity check before mergereferences/review-checklist.md

References

  • Reference files are intentionally short and task-focused.
  • Source links are listed in each reference file frontmatter urls.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

piglet

No summary provided by upstream source.

Repository SourceNeeds Review
General

fast-rust

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

friendly-python

No summary provided by upstream source.

Repository SourceNeeds Review
General

OpenClaw Skill Growth

Make OpenClaw Skills observable, diagnosable, and safely improvable over time. Use this when the user wants to maintain many SKILL.md files, inspect repeated...

Registry SourceRecently Updated
211Profile unavailable