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.
npx agentmods add rules/wangqiqi/cursor-ai-rules/platform_adaptergit clone --depth 1 https://github.com/wangqiqi/cursor-ai-rulesWhat 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 | $0.02698 | $0.02698 |
| Opus 5 | $0.01349 | $0.01349 |
| Sonnet 5 | $0.00540 | $0.00540 |
| Haiku 4.5 | $0.00270 | $0.00270 |
Grade A, and why
platform_adapter 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 2d 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 — 424 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🌐 跨平台适配器 (Cross-platform Adapter)
版本: v4.3.0 | 最后更新: {{GENERATION_TIME}} | 作者: wangqiqi (https://github.com/wangqiqi)
🎯 核心使命 (Core Mission)
跨平台适配器统一管理.cursor规则体系在不同操作系统间的适配逻辑,确保:
- 命令兼容性:自动选择适合当前平台的命令和参数
- 路径规范化:统一处理不同操作系统的路径格式
- 环境适配:根据操作系统特征调整行为和配置
- 错误处理:平台特定的错误信息和恢复策略
🔍 平台检测 (Platform Detection)
操作系统识别 (OS Identification)
# 自动检测当前操作系统
detect_platform() {
case "$(uname -s)" in
Linux*) PLATFORM="linux";;
Darwin*) PLATFORM="macos";;
CYGWIN*|MINGW*|MSYS*) PLATFORM="windows";;
*) PLATFORM="unknown";;
esac
# Windows特殊处理:检测是否在WSL环境中
if [[ "$PLATFORM" == "linux" ]] && [[ -n "$WSL_DISTRO_NAME" ]]; then
PLATFORM="wsl"
fi
echo "$PLATFORM"
}
平台特征矩阵 (Platform Feature Matrix)
{
"platform_features": {
"linux": {
"shell": "bash",
"path_separator": "/",
"case_sensitive": true,
"permissions": "unix",
"package_manager": ["apt", "yum", "dnf", "pacman"],
"line_ending": "LF"
},
"macos": {
"shell": "zsh",
"path_separator": "/",
"case_sensitive": false,
"permissions": "unix",
"package_manager": ["brew", "port"],
"line_ending": "LF"
},
"windows": {
"shell": "powershell",
"path_separator": "\\",
"case_sensitive": false,
"permissions": "windows",
"package_manager": ["choco", "winget", "scoop"],
"line_ending": "CRLF"
},
"wsl": {
"shell": "bash",
"path_separator": "/",
"case_sensitive": true,
"permissions": "unix",
"package_manager": ["apt"],
"line_ending": "LF",
"special_features": ["windows_integration"]
}
}
}
💻 命令适配 (Command Adaptation)
核心命令映射 (Core Command Mapping)
interface CommandMapping {
[command: string]: {
linux: string;
macos: string;
windows: string;
wsl?: string;
};
}
const commandMappings: CommandMapping = {
"get_timestamp": {
linux: "date '+%Y-%m-%d %H:%M:%S %Z'",
macos: "date '+%Y-%m-%d %H:%M:%S %Z'",
windows: "powershell -Command \"Get-Date -Format 'yyyy-MM-dd HH:mm:ss zzz'\"",
wsl: "date '+%Y-%m-%d %H:%M:%S %Z'"
},
"get_user_name": {
linux: "git config --get user.name",
macos: "git config --get user.name",
windows: "git config --get user.name",
wsl: "git config --get user.name"
},
"get_user_email": {
linux: "git config --get user.email",
macos: "git config --get user.email",
windows: "git config --get user.email",
wsl: "git config --get user.email"
},
"list_directory": {
linux: "ls -la",
macos: "ls -la",
windows: "powershell -Command \"Get-ChildItem -Force\"",
wsl: "ls -la"
},
"create_directory": {
linux: "mkdir -p",
macos: "mkdir -p",
windows: "powershell -Command \"New-Item -ItemType Directory -Force\"",
wsl: "mkdir -p"
}
};
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.
- 2d ago First seen · 424 lines · 2,698 tokens per session scan A a1c304792722
platform_adapter is a cursor rule published in the GitHub repository wangqiqi/cursor-ai-rules (15 stars, last pushed 3mo ago), licensed MIT. It adds 2,698 tokens to every session, about $0.0135 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.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.