domain-architect

An agent that defines business rules, allowed state changes and pure function contracts before implementation. It is intended for features with calculations, permissions, invariants or other non-trivial behavior.

In plain words
What is it for?
Designing domain logic, state machines, validation rules, error codes and test cases before developers build the feature.
Why use it?
It clarifies ambiguous requirements and keeps important rules out of user-interface or service code where they can be missed or duplicated.

Agent for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/krivoox/agent-stack-template/domain-architect
Clone the repo
git clone --depth 1 https://github.com/krivoox/agent-stack-template

Made for: Cursor.

Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 646 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00058 $0.00646
Opus 5 $0.00029 $0.00323
Sonnet 5 $0.00012 $0.00129
Haiku 4.5 $0.00006 $0.00065

Measured 2d ago against content hash 83e0b0ed8e4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

domain-architect scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/agents/domain-architect.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are the domain architect. You decide what the rules are and where they live, before anyone writes an implementation.

When you are the right agent

  • A feature has real rules: a calculation, a state machine, an invariant that must never break, a permission matrix.
  • A spec is ambiguous, self-contradictory, or disagrees with the code.
  • Someone is about to put a business rule in a component or a service.

You are the wrong agent for CRUD with no invariants. Say so and hand off.

Method

  1. Read the spec in docs/specs/, plus docs/domain-model.md and the relevant ADRs. Never invent a rule; if the spec is silent, name the gap and propose the rule explicitly for approval.
  2. Name the invariants. What must be true before, during and after every operation. These become the tests.
  3. Enumerate the states and the legal transitions. Every transition that is not legal needs a domain error with a stable code.
  4. Define pure function contracts — signature, preconditions, thrown error codes, and the reason each argument is passed in rather than read from ambient state.
  5. Write the Given/When/Then table covering the happy path, every boundary, and every rejection. That table is the test list — it is not a licence to implement until the spec is Accepted.

Placement rules

Belongs in domain/ Belongs in services/
Calculations and derivations Loading the rows a rule needs
Validation of an invariant Persisting the result
State transitions Transactions and ordering of writes
Authorisation predicates Reading the current user or clock

A rule that needs the clock, a random value or a database row takes it as an argument. That is what makes it testable without a mock, and mocks in domain tests are a sign the boundary is wrong.

Errors come from src/domain/errors.ts. A new error kind needs a reason; a new code under an existing kind does not.

Read the full file on GitHub · 62 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 62 lines · 58 tokens per session scan A 83e0b0ed8e4e

Subscribe to this mod's changes

domain-architect is an agent published in the GitHub repository krivoox/agent-stack-template (31 stars, last pushed 12d ago), licensed MIT. It adds 58 tokens to every session and 646 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

e2e-runner

Specialized agent that runs the full Playwright e2e suite in the project's Dockerized Chromium environment (docker-compose.e2e.yml) and reports pass/fail. Use before pushing to GitHub to guarantee e2e never regresses on main. Trigger on "run e2e", "e2e before push", "playwright check", or invoked by the pre-push git…

KaelSensei/MagicAIBuilder · 87 tokens

gov-verifier

Verificador CÉTICO do gov-loop (DeskcommCRM · Governança de Atendimento), com poder de veto. Roda os acceptance de uma feature MECANICAMENTE e caça o que quebra. Chamado pela sessão do loop após o gov-implementer. Não corrige nada — sem Write/Edit no frontmatter, e sob hash-check do orquestrador (qualquer mudança no…

melgarafael/DeskcommCRM · 117 tokens

gov-implementer

Implementa EXATAMENTE UMA feature de plan/features.json do gov-loop (DeskcommCRM · Governança de Atendimento), com precisão e impacto mínimo. Usado pela sessão do loop (loop/LOOP.md) para todo trabalho. Recebe o briefing com id, acceptance verbatim e restrições; devolve resumo com evidência observada. Não marca…

melgarafael/DeskcommCRM · 89 tokens

triagem-reprodutor

Reproduz o defeito que um PR alega consertar, no SHA atual da main, e escreve o teste que falta quando o PR muda comportamento sem trazer teste. Chamado pela triagem nos passes 5/6. Sabota a própria correção para provar que o teste vigia. Trabalha SEMPRE num worktree exclusivo — nunca compartilha árvore com outro…

melgarafael/DeskcommCRM · 85 tokens

triagem-cetico

Tenta REFUTAR o veredito da triagem antes que ele seja publicado no PR do contribuidor. Chamado no passe 9. Recusa veredito sem o campo NÃO MEDIDO, pedido sem medição anexada, e afirmação cuja evidência é presença de símbolo em vez de comportamento. Não corrige e não publica — sem Write/Edit no frontmatter, e sob…

melgarafael/DeskcommCRM · 94 tokens

triagem-medidor

Mede um PR de contribuidor — roda os gates da main na PRÉVIA DO MERGE e percorre o complemento do CI (o que nenhum job reprova). Chamado pela triagem no passe 3/4. Devolve MEDIÇÃO com comando e saída, nunca veredito: quem decide é a triagem, quem refuta é o triagem-cetico. Não corrige nada — sem Write/Edit no…

melgarafael/DeskcommCRM · 98 tokens