06-architecture-ddd

06-architecture-ddd is a cursor rule for Cursor from movebrickschi/harness-engineering-mcp. It costs 394 tokens per session, scanned A, original, MIT.

Rules for organising software into four layers—interface, application, domain, and infrastructure—and for modelling business concepts using domain-driven design.

In plain words
What is it for?
Use them when designing or reviewing a layered application or domain model. They guide dependencies, entities, value objects, aggregate roots, domain services, and choices such as builders, factories, strategies, state machines, and event-based patterns.
Why use it?
They prevent unrelated parts of the system from depending on each other in unsafe ways. They also keep core business logic independent from databases, APIs, and message queues.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use them when designing or reviewing a layered application or domain model. They guide dependencies, entities, value objects, aggregate roots, domain services, and choices such as builders, factories, strategies, state machines, and event-based patterns.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/movebrickschi/harness-engineering-mcp/06-architecture-ddd
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/movebrickschi/harness-engineering-mcp

Made for: Cursor.

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 06-architecture-ddd

README.md
[![agentmods](https://agentmods.dev/badge/rules/movebrickschi/harness-engineering-mcp/06-architecture-ddd/github.svg)](https://agentmods.dev/rules/movebrickschi/harness-engineering-mcp/06-architecture-ddd)
Your own site
<a href="https://agentmods.dev/rules/movebrickschi/harness-engineering-mcp/06-architecture-ddd"><img src="https://agentmods.dev/badge/rules/movebrickschi/harness-engineering-mcp/06-architecture-ddd/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 06-architecture-ddd

Your own site · 80×15
<a href="https://agentmods.dev/rules/movebrickschi/harness-engineering-mcp/06-architecture-ddd"><img src="https://agentmods.dev/badge/rules/movebrickschi/harness-engineering-mcp/06-architecture-ddd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 394 This file is loaded in full into every session.
When invoked 394 The same file — it is already loaded in full.
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.00394 $0.00394
Opus 5.5 $0.00158 $0.00158
Sonnet 5.5 $0.00079 $0.00079
Haiku 4.5 $0.00039 $0.00039

Measured 3mo ago against content hash f06c7735147e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

06-architecture-ddd 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 3mo 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.

assets/rules/06-architecture-ddd.mdc · 41 lines

What it actually says

架构分层与DDD设计原则

分层架构

严格遵循四层架构,禁止跨层调用:

Controller(接口层) → Application(编排层) → Domain(核心业务) → Infrastructure(技术实现)
层 职责 允许依赖
Controller 参数校验、协议转换、路由 Application
Application 用例编排、事务管理、DTO转换 Domain
Domain 核心业务逻辑、领域模型、领域服务 无外部依赖
Infrastructure 数据库访问、外部API、消息队列 Domain(通过Port接口)

关键约束:Domain层禁止依赖Infrastructure层,通过端口(Port)和适配器(Adapter)解耦。

DDD建模要素

  • Entity:有唯一标识的领域对象,生命周期内可变
  • Value Object:无标识、不可变,通过属性值判等
  • Aggregate Root:聚合的入口,外部只能通过聚合根访问内部对象
  • Domain Service:跨聚合的业务逻辑,不属于任何单一实体

设计模式优先策略

  • 复杂对象创建 → Builder模式
  • 多态创建 → Factory Method
  • 多重if-else → Strategy策略模式
  • 状态流转 → State状态机模式
  • 异步流程 → CQRS + Event Sourcing(视场景复杂度而定)
  • 优先组合,避免继承复用代码
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. 3mo ago First seen · 41 lines · 394 tokens per session scan A f06c7735147e

Subscribe to this mod's changes

06-architecture-ddd is a cursor rule published in the GitHub repository movebrickschi/harness-engineering-mcp (2 stars, last pushed 6mo ago), licensed MIT. It adds 394 tokens to every session, about $0.0016 per session on Opus 5.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-31.

Related

06-architecture-ddd compared with cursor rules from other repositories

06-architecture-ddd next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
06-architecture-dddmovebrickschi/harness-engineering-mcpCursor rule26mo agoMITA394Cursor
djangosanjeed5/awesome-cursor-rules-mdcCursor rule3.6k12d agoCC0-1.0A2,043Cursor
api-property-optionality-hygienenovuhq/novuCursor rule40ktodaynoneA0Cursor
cursormrwogu/promptscriptCursor rule3264d agoMITA53Cursor
pythonPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A734Cursor
gosupertokens/create-supertokens-appCursor rule249d agoApache-2.0A0Cursor
ehs-ims-conventionsSafetyMP/Autonomous-EHS-ManagementCursor rule96d agoApache-2.0A722Cursor