Use when writing acceptance criteria for a task - express each as an observable Given/When/Then that QA can execute, including negative cases
中文简介正在准备中。当前显示原文说明。
Use when adding a use case, port, repository or adapter in a Go service — where each piece goes, how errors and transactions cross layers, and how to check the import direction
中文简介正在准备中。当前显示原文说明。
安装前可以查看交给 AI 代理的指令内容。
get_repo_tree # look for domain/port/application/adapter-named folders
Follow the repository's own names for these folders (internal/core, internal/service, whatever it already uses) — don't rename them to match this skill. Never restructure a repository that is not hexagonal in a feature task. If the repo has no layering at all, follow its existing flat/package-by-feature style instead of introducing hexagonal boundaries unasked.
internal/port) describing what the application needs (repositories, clients) and offers (services).NewService(store port.Store, ...). No globals, no init()-time wiring (Uber: "Avoid init()", "Exit in Main").var _ port.TaskStore = (*PGTaskStore)(nil) next to the adapter's constructor — a missing method fails the build, not a runtime wiring panic.domain.ErrNotFound, domain.ErrConflict (sentinel errors the adapters translate into and the handler's central mapper translates out of).port.ProjectStore with Archive(ctx context.Context, id uuid.UUID) error.errors.Is(err, pgx.ErrNoRows) → domain.ErrNotFound; pgErr.Code == "23505" → domain.ErrConflict. This translation happens in the adapter, never in the handler or service.var _ port.ProjectStore = (*PGProjectStore)(nil) beside the constructor.Model the transaction boundary as a port, not a leaked *sql.Tx/pgx.Tx: port.TxRunner with WithinTx(ctx context.Context, fn func(ctx context.Context) error) error. The Postgres adapter puts the pgx.Tx into the returned ctx; repository adapters use the tx-in-context when present, falling back to the pool otherwise. The transaction boundary belongs to the use case (application layer), which decides what must commit together — never to a repository method.
Constructors are called from main/a wiring package only — no package-level mutable globals holding dependencies (Uber "Avoid Global State").
go list -deps ./internal/domain/... ./internal/application/... | grep -E '/internal/adapter|gofiber|jackc/pgx|database/sql'
Adjust the paths to the repo's actual package names. Must print nothing — any hit is a boundary violation.
gofiber/fiber, jackc/pgx, database/sql) anywhere under domain or application → boundary violation.*fiber.Ctx, *sql.Rows) instead of domain types.还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Use when writing acceptance criteria for a task - express each as an observable Given/When/Then that QA can execute, including negative cases
中文简介正在准备中。当前显示原文说明。
Use when the diff adds or changes an endpoint, resolver, RPC, job or query that takes an object id, a role check, a request binding or a tenant filter - BOLA/IDOR, function-level authorization, mass assignment and tenant scoping
中文简介正在准备中。当前显示原文说明。
Use on every UI change - semantic HTML, labels for controls, keyboard-navigable dialogs/menus, visible focus, and never color as the only signal
中文简介正在准备中。当前显示原文说明。
Use when a task changes any screen, form, dialog, menu or control - Lighthouse/axe scan of the changed screens, a keyboard walk, and the thresholds that fail a task
中文简介正在准备中。当前显示原文说明。
How to work a task returned with review, QA or UAT findings. Use when a task is in need_revision or PR review comments are in your context.
中文简介正在准备中。当前显示原文说明。
Use when the repository keeps its alerting in code, or a person asks for alerts outside TaskTrooper - PrometheusRule YAML, a Cloud Monitoring alert policy in Terraform, a Datadog monitor, each routed to TaskTrooper's alert ingest URL so it opens an incident here
中文简介正在准备中。当前显示原文说明。