Token导航 LogoToken导航

Agent Skill · 研究检索

golang-ddd(Go DDD 搜索)

golang-ddd 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

golang-ddd 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 54,843。

总安装 494周安装 21GitHub Stars 1下载 173核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:golang-ddd(Go DDD 搜索)
来源仓库:https://github.com/baotoq/agent-skills
仓库路径:skills/golang-ddd
安装命令:
npx skills add https://github.com/baotoq/agent-skills --skill golang-ddd
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/baotoq/agent-skills --skill golang-ddd

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

Go DDD 技能指导 Go 语言中领域驱动设计的战术模式实现,使用组合、接口等 Go 原生范式。适用于在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。

安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。golang-ddd 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/golang-ddd

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/baotoq/agent-skills --skill golang-ddd;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

golang-ddd 怎么安装?

在终端执行 npx skills add https://github.com/baotoq/agent-skills --skill golang-ddd。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

golang-ddd 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

golang-ddd 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

golang-ddd 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

golang-ddd 用的人多吗?

公开数据是累计安装 494 次,近一周安装 21 次,下载 173 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

golang-ddd 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
golang-ddd

Go DDD 搜索 · 本页

4941只读未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

DDD Tactical Design Patterns in Go

Purpose

To guide implementation of Domain-Driven Design tactical patterns in idiomatic Go. This skill covers Entities, Value Objects, Aggregates, Repositories, Domain Services, Domain Events, Factories, and Specifications using Go-native idioms (composition over inheritance, interfaces, unexported fields, functional options).

When to Use This Skill

  • Implementing domain models with rich business logic in Go
  • Designing aggregate boundaries and consistency rules
  • Creating repository interfaces and infrastructure implementations
  • Building event-driven domain models
  • Structuring a Go project following DDD layered architecture
  • Reviewing domain code for DDD pattern adherence

Core Principles

  1. Go idioms first - No Java-style OOP. Use composition, interfaces, and package boundaries
  2. Unexported fields - All entity/aggregate fields lowercase; expose through getters and behavior methods
  3. Pointer receivers for entities - Mutable domain objects use *T receivers
  4. Value receivers for value objects - Immutable types use T receivers
  5. Factory functions - Use NewX() constructors to enforce invariants at creation
  6. Interface in domain, implementation in infrastructure - Repository interfaces live with aggregates
  7. One package per aggregate - Each aggregate root gets its own package under internal/domain/
  8. Context propagation - Pass context.Context as first parameter in repository and service methods

Project Structure

internal/
├── domain/                     # Domain layer (no external deps)
│   ├── customer/               # One package per aggregate
│   │   ├── customer.go         # Aggregate root entity
│   │   ├── repository.go       # Repository interface
│   │   ├── email.go            # Value objects
│   │   ├── events.go           # Domain events
│   │   └── errors.go           # Domain errors
│   ├── order/
│   │   ├── order.go
│   │   ├── repository.go
│   │   ├── item.go             # Child entity
│   │   └── money.go            # Value object
│   └── shared/                 # Shared kernel
│       ├── events.go           # Event interface
│       └── specification.go    # Generic specification
│
├── application/                # Application services (orchestration)
│   ├── command/
│   │   └── place_order.go
│   └── query/
│       └── get_customer.go
│
└── infrastructure/             # Technical implementations
    ├── postgres/
    │   ├── customer_repo.go
    │   └── order_repo.go
    └── eventbus/
        └── in_memory.go

Dependency rule: Domain has zero imports from application or infrastructure. Dependencies point inward.

Pattern Quick Reference

PatternGo IdiomReceiverIdentity
EntityStruct + pointer receiver*TBy ID
Value ObjectType alias or struct + value receiverTBy value
Aggregate RootEntity + unexported children*TBy ID
RepositoryInterface in domain packageN/AN/A
Domain ServiceStateless struct with deps*T or funcN/A
Domain EventImmutable structT (value)By name+time
FactoryNewX() functionN/AN/A
SpecificationGeneric interface IsSatisfiedBy(T) boolT or *TN/A

Implementation Workflow

When implementing a new aggregate or domain concept:

  1. Define value objects - Create self-validating types for domain primitives (Email, Money, Address)
  2. Define entities - Create types with identity, unexported fields, and behavior methods
  3. Define aggregate root - Designate one entity as root; enforce all invariants through its methods
  4. Define repository interface - Place interface in same package as aggregate root
  5. Define domain events - Create immutable event structs for significant state changes
  6. Implement infrastructure - Create repository implementations in infrastructure/ package
  7. Wire application layer - Create command/query handlers that orchestrate domain operations

Pattern Details

For detailed implementation guides with full code examples, see:

  • references/entities-and-value-objects.md - Entities, Value Objects, and Factories
  • references/aggregates-and-repositories.md - Aggregates, Repositories, and Domain Services
  • references/events-and-specifications.md - Domain Events and Specifications
  • references/anti-patterns.md - Common mistakes and how to avoid them

Entities

Entities have unique identity and mutable state. Use unexported fields, pointer receivers, and factory functions.

type Order struct {
    id        uuid.UUID
    status    Status
    items     []Item
    createdAt time.Time
}

func NewOrder(customerID uuid.UUID) (*Order, error) {
    return &Order{
        id:        uuid.New(),
        status:    StatusDraft,
        items:     make([]Item, 0),
        createdAt: time.Now(),
    }, nil
}

func (o *Order) AddItem(product ProductID, qty int, price Money) error {
    if o.status != StatusDraft {
        return ErrOrderNotDraft
    }
    o.items = append(o.items, NewItem(product, qty, price))
    return nil
}

Value Objects

Immutable types validated at creation. Use value receivers. Return new instances for operations.

type Money struct {
    amount   int64
    currency string
}

func NewMoney(amount int64, currency string) (Money, error) {
    if currency == "" {
        return Money{}, ErrInvalidCurrency
    }
    return Money{amount: amount, currency: currency}, nil
}

func (m Money) Add(other Money) (Money, error) {
    if m.currency != other.currency {
        return Money{}, ErrCurrencyMismatch
    }
    return Money{amount: m.amount + other.amount, currency: m.currency}, nil
}

Aggregates

Aggregate roots enforce invariants across child entities. All mutations go through the root.

func (o *Order) Place() error {
    if len(o.items) == 0 {
        return ErrEmptyOrder
    }
    if o.status != StatusDraft {
        return ErrOrderNotDraft
    }
    o.status = StatusPlaced
    o.events = append(o.events, NewOrderPlacedEvent(o.id, o.Total()))
    return nil
}

Repositories

Interface in domain, implementation in infrastructure. One repository per aggregate root.

// domain/order/repository.go
type Repository interface {
    Find(ctx context.Context, id uuid.UUID) (*Order, error)
    Save(ctx context.Context, order *Order) error
    Update(ctx context.Context, id uuid.UUID, fn func(*Order) error) error
}

Domain Events

Immutable structs collected by aggregates, published by application layer.

type OrderPlaced struct {
    orderID    uuid.UUID
    total      Money
    occurredAt time.Time
}

func (o *Order) PullEvents() []Event {
    events := o.events
    o.events = nil
    return events
}

Domain Services

Stateless operations spanning multiple aggregates. Domain logic only, no orchestration.

type TransferService struct {
    accountRepo account.Repository
}

func (s *TransferService) Transfer(ctx context.Context, from, to uuid.UUID, amount Money) error {
    // Load aggregates, validate domain rules, coordinate changes
}

Specifications

Composable business rules using Go generics.

type Specification[T any] interface {
    IsSatisfiedBy(T) bool
}

func And[T any](specs ...Specification[T]) Specification[T] { /* ... */ }
func Or[T any](specs ...Specification[T]) Specification[T]  { /* ... */ }
func Not[T any](spec Specification[T]) Specification[T]     { /* ... */ }

Key Rules

  • Never expose aggregate internals - No public fields, no getters that return mutable child collections
  • No setters - Replace SetStatus() with domain methods like Place(), Cancel(), Ship()
  • Reference other aggregates by ID - Never hold direct pointers to other aggregate roots
  • Reconstitution factories - Create separate Reconstruct() functions for loading from DB (bypass validation)
  • Domain errors - Define sentinel errors (var ErrNotFound = errors.New(...)) per aggregate package
  • Accept interfaces, return structs - Repository parameters use interfaces; factories return concrete types

References

Detailed guides with full code examples are in the references/ directory.

平台分布

Codex

38.56%
按下载量换算67

Claude

28.66%
按下载量换算50

Cursor

19.38%
按下载量换算34

Gemini CLI

9.63%
按下载量换算17

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills