domain-lens

domain-lens is a command for Claude Code from andkirby/markdown-ticket. It costs 0 tokens per session (3,044 once invoked), scanned A, original, MIT.

A short domain-driven design review that identifies business boundaries and rules in an existing codebase. Domain-driven design is a way to structure software around the business problems it represents.

In plain words
What is it for?
Use it before building features with business logic, changing a domain model, or integrating complex modules. It writes a concise review for the relevant change ticket.
Why use it?
It brings important business constraints into architectural decisions without prescribing a particular file structure or coding pattern.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Part of the mdt plugin — 1 skill, 16 commands, 5 agents, 1 hook shipped together

Good fit Use it before building features with business logic, changing a domain model, or integrating complex modules. It writes a concise review for the relevant change ticket.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/andkirby/markdown-ticket/domain-lens
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.

Clone the repo
git clone --depth 1 https://github.com/andkirby/markdown-ticket

Made for: Claude Code.

Or install mdt, the plugin that ships this one along with the rest of its 1 skill, 16 commands, 5 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for domain-lens

README.md
[![agentmods](https://agentmods.dev/badge/commands/andkirby/markdown-ticket/domain-lens.svg)](https://agentmods.dev/commands/andkirby/markdown-ticket/domain-lens)
Your own site
<a href="https://agentmods.dev/commands/andkirby/markdown-ticket/domain-lens"><img src="https://agentmods.dev/badge/commands/andkirby/markdown-ticket/domain-lens.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,044 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.03044
Opus 5 $0.00000 $0.01522
Sonnet 5 $0.00000 $0.00609
Haiku 4.5 $0.00000 $0.00304

Measured 7d ago against content hash 60c0a6bee277, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

domain-lens 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 7d 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.

prompts/mdt/commands/domain-lens.md · 409 lines

How it starts

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

MDT Domain Lens (v3)

Surface strategic DDD constraints before architectural decisions. Output is intentionally minimal — principles only, not prescriptions.

Core Principle: Identify domain boundaries and invariants that should constrain structural decisions downstream. All analysis MUST be grounded in actual codebase — no invented code terms.

User Input

$ARGUMENTS

Session Context

Use {TICKETS_PATH} in all file path templates below (if it's not defined read ticketsPath key from .mdt-config.toml).

Output

Creates {TICKETS_PATH}/{CR-KEY}/domain.md (concise)

When to Use

CR Type Use Domain Lens?
New feature with business logic ✅ Yes
Complex integration across modules ✅ Yes
Domain model changes ✅ Yes
Simple CRUD ❌ Skip
Refactoring / Tech-debt ❌ Use /mdt:domain-audit instead
Infrastructure / Config ❌ Skip
Bug fix ❌ Skip

What This Is NOT

  • ❌ Class/file structure recommendations (architecture's job)
  • ❌ Verbose domain model documentation
  • ❌ Pattern prescriptions ("use repository pattern")
  • ❌ Implementation guidance
  • ❌ Invented code terms from CR descriptions

Execution Steps

Step 1: Load Context

  1. mdt-all:get_cr with mode="full" — abort if CR doesn't exist
  2. Load {TICKETS_PATH}/{CR-KEY}/requirements.md if exists
  3. Extract list of affected artifacts from CR

Step 2: Ground in Codebase

Critical: All domain analysis MUST be grounded in actual code.

If CR lists affected artifacts:

  1. Read each artifact file
  2. Extract actual class/interface/type names
  3. Note actual structure and relationships
  4. Build vocabulary of real code terms

Grounding Rules:

  • "Code Term" column MUST use actual identifiers from codebase
  • If concept is new (no code exists yet), mark as (new)
  • Do NOT invent code terms from CR descriptions
  • If CR describes something like "Three-Strategy Configuration", search for actual implementation before mapping
  • If unsure whether code exists, search codebase before claiming

Read the full file on GitHub · 409 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. 7d ago First seen · 409 lines · 0 tokens per session scan A 60c0a6bee277

Subscribe to this mod's changes

domain-lens is a command published in the GitHub repository andkirby/markdown-ticket (5 stars, last pushed 21d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,044 tokens. 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-31.