Skip to content
Agentmart
Submit a tool

domain-entity-guardrails

Enforce strict typing and explicit optionality in domain entities and value objects.

Skill by ernesto2108

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ernesto2108-domain-entity-guardrails

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Enforce strict typing and explicit optionality in domain entities and value objects. Use when creating or modifying domain structs, reviewing domain layer code, or detecting pointer fields, `any` types, or `sql.Null*` in domain models.

Use cases: backend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/domain-entity-guardrails

What's inside

Skill name
domain-entity-guardrails
Description
Enforce strict typing and explicit optionality in domain entities and value objects. Use when creating or modifying domain structs, reviewing domain layer code, or detecting pointer fields, `any` types, or `sql.Null*` in domain models.
License
MIT
Instructions
37 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

Prevent fragile domain models by enforcing strict typing and explicit optionality.

Use when:
- creating or modifying domain entities or value objects
- mapping DB/HTTP DTOs into domain models
- reviewing domain layer code in a clean architecture project

## Detection

Before applying rules, locate the project's domain layer:
1. If `<vault>/01-project/context.md` exists, use it to find domain paths
2. Otherwise search for common patterns: `internal/**/domain/`, `src/domain/`, `pkg/domain/`, `lib/domain/`
3. Apply rules to any struct/type in the identified domain directories

## Rules

- avoid `any`/`interface{}` in domain entities
- avoid pointer fields in domain entities (`*string`, `*int`, `*time.Time`, etc.)
- do NOT introduce `Optional*` wrapper types in domain entities
- model optional semantics with concrete zero values (e.g., empty string, `0`, `time.Time{}`) and document that convention in code comments when needed
- represent JSON payloads with concrete types; prefer `json.RawMessage` at boundaries unless a strict schema exists
- prefer enums/value objects over free-form strings for constrained fields
- keep domain models persistence-agnostic (no `sql.Null*` in domain)

## Checklist Before Finishing

1. Search for `any` in changed domain files
2. Search for pointer fields in changed domain structs
3. Confirm optional semantics use zero-value conventions (no `Optional*` wrappers)
4. Run `gofmt` on edited files

## Output

- If a rule is violated: list file + field + proposed fix
- If all pass: report "domain guardrails OK"

From ernesto2108/forge, MIT.

More from ernesto2108/forge

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Apr 3, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ernesto2108

Cite this page

domain-entity-guardrails skill. Agent Mart. https://agentmart.dev/skills/ernesto2108-domain-entity-guardrails (last updated 2026-10-24)