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.
git clone --depth 1 https://github.com/dcloudio/uni-app-x-ai-rulesWrote 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/rules/dcloudio/uni-app-x-ai-rules/uts)<a href="https://agentmods.dev/rules/dcloudio/uni-app-x-ai-rules/uts"><img src="https://agentmods.dev/badge/rules/dcloudio/uni-app-x-ai-rules/uts/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/rules/dcloudio/uni-app-x-ai-rules/uts"><img src="https://agentmods.dev/badge/rules/dcloudio/uni-app-x-ai-rules/uts.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.15908 |
| Opus 5.5 | $0.00000 | $0.06363 |
| Sonnet 5.5 | $0.00000 | $0.03182 |
| Haiku 4.5 | $0.00000 | $0.01591 |
Grade A, and why
uts 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 1mo 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 — 2,462 lines — stays where its author put it; the contents beside it link to each section on GitHub.
uts 和 ts 的差异
ts 虽然有类型,但类型要求不严格。而 uts 为了编译为原生语言,是完全的强类型。
另外为了确保跨平台、高性能,uts 通过规范约束了 ts 中过于灵活而影响开发正确性或者给运行时带来不必要额外开销的特性。
本文罗列了在 uts 跨端开发时限制的 ts 特性,并提供了重构代码的建议。
uni-app x下uts编译器目前已知的一些问题
uni-app x下部分运行错误的说明
概述
强制使用静态类型
静态类型是 uts 最重要的特性之一。如果程序采用静态类型,即所有类型在编译时都是已知的,那么开发者就能够容易理解代码中使用了哪些数据结构。 同时,由于所有类型在程序实际运行前都是已知的,编译器可以提前验证代码的正确性,从而可以减少运行时的类型检查,有助于提升性能。
基于上述考虑,uts 中的 any 类型与 ts 中的 any 并不一样,它是一个根据目标平台自动适配的跨端类型,通常用于表示"任意的非空类型", 在使用时仍需类型转换后才能访问具体类型的方法和属性。
不支持结构化类型系统
结构化类型系统(structural typing)是 ts 的一个特性,它意味着类型的兼容性和等价性是基于类型的结构(即它们的属性和方法); 而在跨端开发时,uts 采用名义类型系统(nominal typing),类型兼容性检查基于类型名称和显式的继承/实现关系。 即使两个类型具有完全相同的结构,如果没有显式的继承/实现关系,它们也不能互相赋值。 这与 Kotlin 、Swift 、ArkTS 等静态语言的类型系统保持一致,有助于确保类型安全和代码的可维护性。
约束说明
1. 核心语言特性
不支持 undefined @uts110111119
级别: 错误
错误码: UTS110111119
不支持 undefined。所有变量必须赋值初始化后才能使用。如果需要使用空,请使用 null。 undefined 在 ts 中有很多场景,一个未初始化赋值的变量、一个未传入的方法参数、对象上不存在的属性,都会返回 undefined。
| 描述 | UTS-TS | UTS-ArkTS | UTS-Kotlin | UTS-Swift |
|---|---|---|---|---|
| 适用版本 | 4.75 | 4.75 | 4.75 | 4.75 |
| 约束状态 | x | x | √ | √ |
TypeScript写法:
// TypeScript 可以使用 undefined
let value: string | undefined;
if (value == undefined) {
console.log("未定义");
}
function test(param?: string) {
if (param == undefined) {
console.log("参数未传");
}
}
UTS正确写法:
// UTS 使用 null 替代 undefined
let value: string | null = null; //必须先赋值后使用,哪怕赋值为null。否则Android平台会报编译错误:error: Variable 'value' must be initialized
if (value == null) {
console.log("未定义");
}
function test(param: string | null) {
if (param == null) {
console.log("参数未传");
}
}
条件语句必须使用布尔类型 @uts110111120
级别: 错误
错误码: UTS110111120
所有条件语句(if、while、do-while、三元运算符、for 循环的条件部分)必须使用布尔类型作为条件。不支持 ts 中的隐式类型转换和 truthy/falsy 值。
| 描述 | UTS-TS | UTS-ArkTS | UTS-Kotlin | UTS-Swift |
|---|---|---|---|---|
| 适用版本 | 4.75 | 4.75 | 4.75 | 4.75 |
| 约束状态 | x | x | √ | √ |
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.
- 1mo ago First seen · 2,462 lines · 15,908 tokens per session scan A d1c1db442d00
uts is a cursor rule published in the GitHub repository dcloudio/uni-app-x-ai-rules (32 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 15,908 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-09-01.
Other cursor rules, from other repositories
gradle
Enforce modern Gradle build practices for Java and Android projects, focusing on Kotlin DSL, modularity, version catalogs, and performance optimizations.
compose-coroutines
Compose scroll/coroutine patterns — prevent programmatic scroll from being mistaken for user scroll, cancellation-safe flag resets.
android-viewmodel
Android ViewModel conventions — StateFlow, repository abstraction, coroutines, no LiveData.
trove-swift
Swift 6 and SwiftUI coding conventions for iOS development. Auto-activates when working with Swift files. Covers @Observable, async/await, NavigationStack, Swift Testing, and accessibility.
technical-stack
These rules guide the AI assistant when generating or modifying code in MagicTheOfflining, a React Native offline MTG deck viewer.
flutter-development-guidelines-cursorrules-prompt-file
Cursor rule "flutter-development-guidelines-cursorrules-prompt-file" from XD3an/awesome-ai-coding-all-in-one, covering code style and structure, directory structure under /lib, naming conventions, import and using dart.