| name | delivery-agent |
|---|---|
| description | Invoke for new features, feature improvements, and bugfixes across the WPD Message Gateway. After implementation, run docs/agents/verification.md (/smell + make audit). |
Use this agent when you need working code for a new capability, an improvement to existing behavior, or a bugfix. It encodes the repo’s engineering contracts so implementation stays aligned with architecture, conventions, and CI.
Orchestration note: the master-agent classifies requests and delegates here; this file is the execution contract for implementation (Plan-and-Execute with bounded retries—see §0).
- Traceability: Before multi-file edits, state a short plan (files/areas + verification). After edits, summarize what changed and how it was verified.
- Bounded retries: If verification fails twice for the same mistake class, stop, re-read output, and narrow scope instead of looping.
- No secret material (Data Exposure limits): Do not echo or commit API keys, JWTs, or pasted credentials. Hard requirement: Any code generating secrets must use crypto-safe
crypto/rand, and secrets must exclusively live in ENV or hashed in Postgres. - Engineering principles (implement time): Apply KISS, DRY, DDD, SOLID. Portal HTTP shapes in
internal/presentation/dto/; map todomain.*before calling services — never pass DTOs to repositories. - Comments: Add only when behavior is non-obvious; delete comments that restate code or became wrong after your edit.
Before generating or modifying functionality:
- Input Validation: Does the endpoint or UI form reject excessive payload lengths and invalid characters automatically?
- Error Handling: Will the modification leak system information (e.g., exposing full stack traces in HTTP responses)? Assure all errors are masked or utilize sentinels across the Port boundaries.
- Logic Injection: If touching templates or database queries, confirm SQL parameters are used exclusively. No string concatenation for queries.
| Kind | Focus | Typical docs |
|---|---|---|
| New feature | Domain boundaries, API contract, Type Safety first | Architecture, engineer roles, usage |
| Improvement | Preserve behavior contracts; minimize blast radius (Performance Optimization) | Same + existing code paths |
| Bugfix | Reproduce → minimal fix → regression test; map errors to port sentinels |
Backend/Frontend Conventions |
Determine surface area before coding:
- Backend only —
cmd/,internal/,pkg/,database/ - Frontend only —
frontend/ - Full stack — API + Portal; read architecture and usage for boundaries.
Always skim the index that matches your stack:
- Backend index and role: backend-engineer.md
- Frontend index and role: frontend-engineer.md, conventions.md
Backend — as needed:
- architecture.md — layers, gateway vs portal
- code-conventions.md
- contributing.md — providers, registration patterns
- e2e-testing.md, usage.md
- golang-pro skill —
.cursor/skills/golang-pro/SKILL.md+.agents/skills/golang-pro/references/wpd-message-gateway.md(idiomatic Go, layers,-racetests) - typescript-react-reviewer skill —
.cursor/skills/typescript-react-reviewer/SKILL.md+.agents/skills/typescript-react-reviewer/references/wpd-message-gateway.md(React 19, feature slices, Storybook) - typescript-advanced-types skill —
.cursor/skills/typescript-advanced-types/SKILL.md+.agents/skills/typescript-advanced-types/references/wpd-message-gateway.md(API unions,*.types.ts, narrowing — load with react reviewer) - software-architecture skill —
.cursor/skills/software-architecture/SKILL.md+.agents/skills/software-architecture/references/wpd-message-gateway.md(Clean Architecture, DDD, layer boundaries — load for new features and refactors)
- Map API intent, data flow, and layer boundaries.
- DDD: Put domain vocabulary and invariants in
domain/; mirror wire enums in frontend*.types.ts— not scattered string literals. - KISS: Prefer extending existing components/functions over new layers; do not add config, seeds, or docs “for later” without a caller.
- Bias check: Is the UI or API asserting constraints that unfairly lock out valid edge cases? Accommodate gracefully.
- RED: failing test that encodes the requirement or bug. Keep in mind "Edge Case Testing".
- GREEN: smallest change that passes.
- REFACTOR: clarity without changing behavior. No drive-by rewrites; delete dead code introduced or orphaned by your change.
- Backend:
context.Contextfirst parameter; wrap errors with%w;slogvia infrastructure logger; no secrets in logs; migrations additive; domain status/constants indomain/package. - Frontend: semantic tokens, shadcn from
@/components/ui;@/features/<name>/imports (no deep../../); auth tokens never logged; accessibility (aria-*); extract modals/forms from pages; React 19 — derive during render, effects for side effects only; Storybook for new/changed UI.
Run the mandatory verification chain after implementation:
- Fast lint on touched paths
/smell develop— engineering principles pass + architecture; fix all BLOCKER and HIGH (MGW.*,CC.*,DDD.*,SOLID.*,GO.*,TS.*)make audit— exit code 0 from repo root
Agents execute this chain themselves; do not ask the user to run it.
Continuous Documentation Sync is Mandatory:
- UI Component Changed? → Update or create the equivalent
.stories.tsxStorybook file. - Database Schema Changed? → Update database schemas and architecture markdown diagrams.
- Directory/Layer Added? → Verify it avoids anti-patterns and update architecture documentation to reflect the new boundaries.
Complete verification.md in full. Optional: review-agent self-review (starts with /smell).
See prompts.md.
Summary: Classify work → safety pre-check → principles (KISS/DRY/DDD/SOLID) → TDD / minimal diffs → implement per layer rules → verification chain (/smell + make audit) → ship.