All skills
psiace avatar

/modular-go

@f80ef5a
by Chojan Shangpsiace/skills172 stars
7

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.

Use this Skill: https://skilld.dev/gh/psiace/skills/modular-go

This session only. Nothing lands on disk.

referencesstate-flow.md

≈359 tokens on demand. Your agent reads this file only when SKILL.md points to it.

State Flow

Goals

  • Keep behavior deterministic and easy to reason about.
  • Make state ownership and lifecycle explicit.

Guidance

  • Prefer stateless functions for transformation, validation, and composition.
  • Pass dependencies and data explicitly; avoid global mutable state.
  • If state is unavoidable, model one-way transitions (init → advance → finalize) and prevent backward transitions.
  • Use XXXManager only for lifecycle-managed collections; expose operations by stable IDs.
  • Guard manager-owned mutable registries with explicit synchronization and narrow lock scope.
  • Pair shared resource acquisition with deterministic release paths.
  • Prefer shutdown through context.Context; expose Close() only when external contracts require it.

Error Design

  • Centralize error-to-wire conversion at request boundaries only.

Review Bullets

  • Can this logic be a pure function instead of a mutable object?
  • Are state transitions explicit and forward-only?
  • If a manager exists, are operations exposed by ID rather than direct member references?
  • Are lock boundaries explicit and narrow?
  • Is every acquired shared resource paired with a deterministic release path?
  • Is shutdown driven by context.Context instead of public Close() where possible?
  • Is error-to-wire conversion centralized at boundaries?

Source: SKILL.md on GitHub

No alerts8d4 checks · Risk SAFE
  • Gen Agent Trust Hub8d

    The skill provides architectural guidance for Go package design and does not contain any executable code or security risks.

  • Socket8d

    No alerts

  • Snyk8d

    Risk: LOW · No issues

  • Runlayer6mo

    6 files scanned · No issues

Signed by skilld at f80ef5a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Activeupdated 7 months ago

README badge

README badge for psiace/skills/modular-go