architecture

architecture is a command for Claude Code from Awesome-Embedded-Learning-Studio/CFDesktop. It costs 0 tokens per session (1,000 once invoked), scanned A, original, MIT.

A code-review command for checking whether a C++ project follows a defined three-layer architecture. It checks which parts of the code may depend on the base, user-interface, and desktop layers.

In plain words
What is it for?
Use it to review selected files or folders, inspect include statements, map dependencies to layers, and identify violations of the project's base, UI, and desktop rules.
Why use it?
It finds forbidden dependencies, such as low-level code importing desktop or interface code. This helps keep responsibilities separated and prevents changes in one layer from spreading inappropriately.

Command for Claude Code

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 commands/awesome-embedded-learning-studio/cfdesktop/architecture
Clone the repo
git clone --depth 1 https://github.com/Awesome-Embedded-Learning-Studio/CFDesktop

Made for: Claude Code.

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/commands/awesome-embedded-learning-studio/cfdesktop/architecture.svg)](https://agentmods.dev/commands/awesome-embedded-learning-studio/cfdesktop/architecture)
Your own site
<a href="https://agentmods.dev/commands/awesome-embedded-learning-studio/cfdesktop/architecture"><img src="https://agentmods.dev/badge/commands/awesome-embedded-learning-studio/cfdesktop/architecture.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 1,000 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.00000 $0.01000
Opus 5 $0.00000 $0.00500
Sonnet 5 $0.00000 $0.00200
Haiku 4.5 $0.00000 $0.00100

Measured 3d ago against content hash 5165ffa66e1d, 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 3d 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.

.claude/commands/architecture.md · 98 lines

How it starts

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

/architecture — 架构一致性守护

检查代码是否符合 CFDesktop 三层架构规则。

层级定义

Layer 1: base/ (基础层)

  • 路径: base/
  • CMake targets: cfbase, cfbase_headers, cfbase_cpu, cfbase_memory, cfbase_gpu, cfbase_network, cfbase_console
  • 允许依赖: Qt6::Core, OS APIs (POSIX, Win32)
  • 职责: 硬件探测、工具库、平台抽象
  • 禁止: 不可感知 UI 或桌面环境概念

Layer 2: ui/ (UI 框架层)

  • 路径: ui/
  • CMake targets: cfui, cf_ui_base, cf_ui_core, cf_ui_widget_material, cf_ui_components_material
  • 允许依赖: Qt6::Core, Qt6::Gui, CFDesktop::base
  • 职责: Material Design 3 组件、主题引擎、动画框架
  • 禁止: 不可感知桌面环境或窗口管理概念

Layer 3: desktop/ (桌面环境层)

  • 路径: desktop/
  • CMake targets: CFDesktop_shared, CFDesktopMain, CFDesktopUi, cffilesystem, cfconfig, cflogger
  • 允许依赖: Qt6::Core, Qt6::Gui, Qt6::Widgets, cfbase, cflogger, cfui
  • 职责: 桌面环境实现、窗口管理、显示后端、配置管理

依赖规则 (STRICT)

base/  →  禁止 include ui/ 或 desktop/ 的任何头文件
ui/    →  禁止 include desktop/ 的任何头文件
desktop/ → 可以 include ui/ 和 base/ 的头文件

检查流程

Step 1: 确定审查范围

根据用户指定的模块/文件/目录,确定需要检查的文件列表。

Step 2: 检查 #include 指令

对每个源文件和头文件:

  1. 提取所有 #include
  2. 将每个 include 映射到其所属层级 (base/ui/desktop/外部)
  3. 标记任何向上依赖(低层级 include 高层级)

检测模式

  • base 层违规: #include 匹配 ui/desktop/cfuiCFDesktop
  • ui 层违规: #include 匹配 desktop/CFDesktop_shared

Step 3: 检查 CMake 依赖

对每个 CMakeLists.txt

  1. 检查 target_link_libraries 只引用同层或更低层
  2. base: 只允许 Qt 和系统库
  3. ui: Qt + CFDesktop::base
  4. desktop: Qt + cfbase + cfui + 自身静态库

Step 4: 检查接口驱动设计

  • 抽象接口应在 components/include/ 目录
  • 具体实现在 platform/private/ 目录
  • 运行时平台选择使用工厂模式
  • 行为变化使用策略模式

Step 5: 检查平台抽象隔离

平台特定代码必须隔离在 private/<platform>_impl/ 目录中:

  • base/system/*/private/linux_impl/ — Linux 实现
  • base/system/*/private/win_impl/ — Windows 实现
  • desktop/ui/platform/windows/ — Windows 桌面后端
  • desktop/ui/platform/linux_wsl/ — Linux/WSL 后端

共享代码(ui/core, ui/widget, base/include)中不得出现平台特定代码。

输出格式 (中文)

# 架构一致性报告: <scope>

## 依赖关系图
(ASCII 图示实际依赖关系)

## 违规项
| 文件 | 行号 | 违规类型 | 说明 |
|------|------|----------|------|

## 符合项
(确认观察到的正确模式)

## 建议修改
(针对每个违规的具体修复方案)

Read the full file on GitHub · 98 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. 3d ago First seen · 98 lines · 0 tokens per session scan A 5165ffa66e1d

Subscribe to this mod's changes

architecture is a command published in the GitHub repository Awesome-Embedded-Learning-Studio/CFDesktop (10 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,000 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.