architecture

architecture is a cursor rule for Cursor from Takt365/Takt.Wpf. It costs 579 tokens per session, scanned A, original, MIT.

A project rule describing a Clean Architecture structure, where the user interface depends on application logic, which depends on domain rules and then infrastructure. It defines the responsibilities and file locations of each layer.

In plain words
What is it for?
Guiding where code belongs, how project layers may depend on one another, and how services, views, repositories, and shared utilities should be organised.
Why use it?
It prevents code from bypassing architectural boundaries, such as the user interface calling database or external-service code directly.

Cursor rule 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 rules/takt365/takt.wpf/architecture
Clone the repo
git clone --depth 1 https://github.com/Takt365/Takt.Wpf

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 architecture

README.md
[![agentmods](https://agentmods.dev/badge/rules/takt365/takt.wpf/architecture.svg)](https://agentmods.dev/rules/takt365/takt.wpf/architecture)
Your own site
<a href="https://agentmods.dev/rules/takt365/takt.wpf/architecture"><img src="https://agentmods.dev/badge/rules/takt365/takt.wpf/architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 579 This file is loaded in full into every session.
When invoked 579 The same file — it is already loaded in full.
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.00579 $0.00579
Opus 5 $0.00290 $0.00290
Sonnet 5 $0.00116 $0.00116
Haiku 4.5 $0.00058 $0.00058

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

Security

Grade A, and why

architecture 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 4d 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/rules/architecture.mdc · 77 lines

What it actually says

架构规范

分层架构原则

项目采用 Clean Architecture(清洁架构),依赖方向只能向下:

Fluent (表现层) -> Application (应用层) -> Domain (领域层) -> Infrastructure (基础设施层) -> Common (通用层)

项目命名空间前缀Takt.*

文件位置

  • 表现层:@src/Takt.Fluent/
  • 应用层:@src/Takt.Application/
  • 领域层:@src/Takt.Domain/
  • 基础设施层:@src/Takt.Infrastructure/
  • 通用层:@src/Takt.Common/

各层职责

Takt.Fluent (表现层)

  • 职责: UI展示、用户交互、视图逻辑
  • 包含: Views, ViewModels, UI Services, Helpers, Models
  • 示例: @src/Takt.Fluent/Views/MainWindow.xaml, @src/Takt.Fluent/ViewModels/MainWindowViewModel.cs

Takt.Application (应用层)

  • 职责: 业务逻辑编排、应用服务
  • 包含: Services, DTOs, Mappers
  • 示例: @src/Takt.Application/Services/

Takt.Domain (领域层)

  • 职责: 领域模型、业务规则
  • 包含: Entities, Repository Interfaces
  • 示例: @src/Takt.Domain/Entities/

Takt.Infrastructure (基础设施层)

  • 职责: 数据访问、外部服务集成
  • 包含: Data Access, Repository Implementation
  • 示例: @src/Takt.Infrastructure/Data/

Takt.Common (通用层)

  • 职责: 共享组件、工具类
  • 包含: Logging, Helpers, Results
  • 示例: @src/Takt.Common/Logging/

禁止事项

  • ❌ 表现层不能直接调用基础设施层
  • ❌ 不能跨层调用
  • ❌ 不能违反依赖方向

代码示例

// ✅ 正确:ViewModel 调用应用层服务
public class UserViewModel : ViewModelBase
{
    private readonly IHbtUserService _userService;  // 应用层接口
    
    public UserViewModel(IHbtUserService userService)
    {
        _userService = userService;
    }
}

// ❌ 错误:ViewModel 直接调用基础设施层
public class UserViewModel : ViewModelBase
{
    private readonly IUserRepository _repository;  // ❌ 基础设施层
}
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. 4d ago First seen · 77 lines · 579 tokens per session scan A a75753862a89

Subscribe to this mod's changes

architecture is a cursor rule published in the GitHub repository Takt365/Takt.Wpf (17 stars, last pushed 8mo ago), licensed MIT. It adds 579 tokens to every session, about $0.0029 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.