nativescript

nativescript is a cursor rule for coding agents from claire-gong-18/awesome-cursorrules. It costs 705 tokens per session, scanned A, original, from a forked repository, CC0-1.0.

A set of coding guidelines for NativeScript, a framework for building mobile apps with JavaScript or TypeScript.

In plain words
What is it for?
Structuring NativeScript projects, naming components and variables, and handling platform-specific native code.
Why use it?
It helps keep shared code and iOS- or Android-specific code organized consistently.

Cursor rule

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/claire-gong-18/awesome-cursorrules/nativescript
Clone the repo
git clone --depth 1 https://github.com/claire-gong-18/awesome-cursorrules

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 nativescript

README.md
[![agentmods](https://agentmods.dev/badge/rules/claire-gong-18/awesome-cursorrules/nativescript.svg)](https://agentmods.dev/rules/claire-gong-18/awesome-cursorrules/nativescript)
Your own site
<a href="https://agentmods.dev/rules/claire-gong-18/awesome-cursorrules/nativescript"><img src="https://agentmods.dev/badge/rules/claire-gong-18/awesome-cursorrules/nativescript.svg" alt="Measured on agentmods" height="20"></a>
Per session 705 This file is loaded in full into every session.
When invoked 705 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin fork From a forked repository.
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.00705 $0.00705
Opus 5 $0.00352 $0.00352
Sonnet 5 $0.00141 $0.00141
Haiku 4.5 $0.00071 $0.00071

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

Security

Grade A, and why

nativescript 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.

rules-new/nativescript.mdc · 43 lines

How it starts

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

NativeScript Best Practices

Code Style and Structure

  • Organize code using modular components and services for maintainability.
  • Use platform-specific files (.ios.ts, .android.ts) when code exceeds 20 platform-specific lines.
  • When creating custom native code, use a folder structure like custom-native/index.ios.ts, custom-native/index.android.ts, custom-native/common.ts, custom-native/index.d.ts to keep platform-specific code organized and easy to import with single import elsewhere, replacing custom-native with the name of the custom code.

Naming Conventions

  • Prefix platform-specific variables with ios or android (e.g., iosButtonStyle).
  • Name custom components and styles descriptively (primaryButtonStyle, userProfileView).

Usage

  • Use @NativeClass() when extending native classes when needed
  • For iOS, when extending native classes, always use static ObjCProtocols = [AnyUIKitDelegate]; to declare custom delegates if a delegate is required or used.
  • For iOS, always retain custom delegate instances to prevent garbage collection. For example, let delegate = MyCustomDelegate.new() as MyCustomDelegate, and ensure it is retained in the class scope.
  • Favor __ANDROID__ and __APPLE__ for conditional platform code with tree-shaking.
  • Track and clean up all timers (setTimeout, setInterval) to avoid memory leaks.

UI and Styling

  • Always TailwindCSS as the CSS Framework using "@nativescript/tailwind": "^2.1.0" for consistent styling paired with "tailwindcss": "~3.4.0".
  • Add ios: and android: style variants for platform-specific styling, addVariant('android', '.ns-android &'), addVariant('ios', '.ns-ios &');
  • darkMode: ['class', '.ns-dark']
  • Leverage GridLayout or StackLayout for flexible, responsive layouts. Place more emphasis on proper GridLayout usage for complex layouts but use StackLayout for simpler, linear arrangements.
  • Use visibility: 'hidden' for elements that should not affect layout when hidden.

Read the full file on GitHub · 43 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 · 43 lines · 705 tokens per session scan A f6dd71293797

Subscribe to this mod's changes

nativescript is a cursor rule published in the GitHub repository claire-gong-18/awesome-cursorrules (0 stars, last pushed 1y ago), licensed CC0-1.0. It adds 705 tokens to every session, about $0.0035 per session on Opus 5. A static security scan graded it A with 0 findings. It comes from a forked repository.