Borrowing it
Nothing to install: this file belongs to Awesome-Embedded-Learning-Studio/CFDesktop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Awesome-Embedded-Learning-Studio/CFDesktop/main/.claude/commands/cross-platform.mdgit clone --depth 1 https://github.com/Awesome-Embedded-Learning-Studio/CFDesktopWrote 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.
[](https://agentmods.dev/commands/awesome-embedded-learning-studio/cfdesktop/cross-platform)<a href="https://agentmods.dev/commands/awesome-embedded-learning-studio/cfdesktop/cross-platform"><img src="https://agentmods.dev/badge/commands/awesome-embedded-learning-studio/cfdesktop/cross-platform/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.
<a href="https://agentmods.dev/commands/awesome-embedded-learning-studio/cfdesktop/cross-platform"><img src="https://agentmods.dev/badge/commands/awesome-embedded-learning-studio/cfdesktop/cross-platform.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00920 |
| Opus 5.5 | $0.00000 | $0.00368 |
| Sonnet 5.5 | $0.00000 | $0.00184 |
| Haiku 4.5 | $0.00000 | $0.00092 |
Grade A, and why
cross-platform 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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/cross-platform — 跨平台兼容性检查
检查代码的跨平台兼容性,确保正确的平台抽象和隔离。
触发方式
/cross-platform <模块路径>— 检查跨平台兼容性- Review 流程内部调用
支持平台
| 平台 | API | 编译器 |
|---|---|---|
| Windows 10/11 | Win32, DWM | MSVC, MinGW |
| Linux/WSL | POSIX, X11, Wayland | GCC, Clang |
| Embedded ARM | EGLFS, LinuxFB (规划中) | GCC交叉编译 |
检查流程
Step 1: 条件编译检查
合法的平台宏 (优先使用)
Q_OS_WIN— Windows 平台 (Qt 宏,首选)Q_OS_LINUX— Linux 平台 (Qt 宏,首选)Q_OS_MAC— macOS 平台 (Qt 宏)_WIN32/_MSC_VER— Windows 特定低层代码(可接受)WIN32— CMake 级别(可接受)
禁止的宏
__linux__— 应使用Q_OS_LINUX__APPLE__— 应使用Q_OS_MAC#ifdef _WIN64— 应使用Q_OS_WIN
路径处理
- 硬编码路径分隔符 (
"\"或"/") — 应使用QDir/QFileInfo - 硬编码行尾 — 应使用
QFile自动处理 - 硬编码临时目录 — 应使用
QStandardPaths
Step 2: 平台抽象目录结构检查
验证平台特定代码的隔离模式:
正确模式 (base/system/):
base/system/cpu/
├── cfcpu.h ← 公共头文件(平台无关接口)
├── cfcpu.cpp ← 公共实现(调用 host.h)
└── private/
├── cpu_host.h ← 平台选择器
├── linux_impl/ ← Linux 实现
│ └── cpu_linux.cpp
└── win_impl/ ← Windows 实现
└── cpu_win.cpp
正确模式 (desktop/ui/platform/):
desktop/ui/platform/
├── interface.h ← 平台无关接口
├── windows/ ← Windows 实现
└── linux_wsl/ ← Linux/WSL 实现
Step 3: 共享层纯度检查
以下位置禁止包含平台特定代码:
ui/core/— 主题引擎ui/widget/— MD3 控件ui/components/— 动画框架base/include/base/— 工具头文件
平台特定代码必须隔离在:
base/system/*/private/desktop/ui/platform/windows/desktop/ui/platform/linux_wsl/
Step 4: DLL 导出宏检查
验证正确的导出宏使用:
- base:
CF_BASE_EXPORT - ui:
CF_UI_EXPORT - desktop:
CF_DESKTOP_EXPORT
每个导出宏应处理 Windows __declspec 和 Linux __attribute__((visibility))。
Step 5: 输出报告 (中文)
# 跨平台兼容性报告: <scope>
## 条件编译检查
### 使用的平台宏
| 文件 | 行号 | 宏 | 合规 |
|------|------|-----|------|
### 不符合规范的宏
(需修改的项,含建议替换)
## 平台抽象层检查
### 正确隔离的代码
- ...
### 泄漏到共享层的平台代码
- ...
## 路径处理检查
- 合规项: ...
- 违规项: ...
## DLL 导出检查
- 合规项: ...
- 缺失导出宏: ...
## 修复建议
(按优先级排列的具体修改方案)
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.
- 2mo ago First seen · 117 lines · 0 tokens per session scan A c062de354cec
cross-platform is a command published in the GitHub repository Awesome-Embedded-Learning-Studio/CFDesktop (11 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 920 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.
Other commands, from other repositories
devkit.typescript.code-review
Provides comprehensive TypeScript monorepo code review for Nx workspaces including NestJS backend, React web, and React Native mobile apps. Use when reviewing architecture, boundaries, security, performance, CI/CD and Nx-specific practices.
rtos
Design a FreeRTOS or Zephyr task structure with sized IPC, a priority inversion walk, stack budgets, and failure-mode timing.
review-uv-script
Review uv Python script for PEP 723 compliance and best practices.
package-review
Review the current Python package for best-practice violations — project structure, pyproject.toml, typing, testing, CI/CD, documentation, versioning, API design, packaging, security, and developer experience.
rust-review
Lightweight Rust code review using clippy.
list
List all GUI-Anything harnesses in the current repository.