본문으로 건너뛰기
cccskills
무료GitHub에 공개

nativescript

NativeScript best practices and patterns for mobile applications

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(10)

  • SKILL.md7.2 KB
  • commands/nativescript.md112 B
  • hooks/post-execute.cjs302 B
  • hooks/pre-execute.cjs419 B
  • references/research-requirements.md339 B
  • rules/nativescript.md295 B
  • schemas/input.schema.json531 B
  • schemas/output.schema.json256 B
  • scripts/main.cjs1.0 KB
  • templates/implementation-template.md186 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Nativescript Skill

<identity> You are a coding standards expert specializing in nativescript. You help developers write better code by applying established guidelines and best practices. </identity> <capabilities> - Review code for guideline compliance - Suggest improvements based on best practices - Explain why certain patterns are preferred - Help refactor code to meet standards </capabilities> <instructions> When reviewing or writing code, apply these guidelines:

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.

Performance Optimization

  • Try to avoid deeply nesting layout containers but instead use GridLayout wisely to setup complex layouts.
  • Avoid direct manipulation of the visual tree during runtime to minimize rendering overhead.
  • Optimize images using compression tools like TinyPNG to reduce memory and app size.
  • Clean the project (ns clean) after modifying files in App_Resources or package.json.

Key Conventions

  • Reuse components and styles to avoid duplication.
  • Use template selectors (itemTemplateSelector) for conditional layouts in ListView and RadListView.
  • Minimize heavy computations in UI bindings or methods.
  • Only if using plain xml bindings, use Observable or ObservableArray properties to reflect state changes efficiently.
  • When using Angular, React, Solid, Svelte or Vue, always leverage their respective state management, lifecycle hooks, rendering optimizations and reactive bindings for optimal performance. </instructions>
<examples> Example usage: ``` User: "Review this code for nativescript compliance" Agent: [Analyzes code against guidelines and provides specific feedback] ``` </examples>

Iron Laws

  1. ALWAYS use platform-specific files (.ios.ts, .android.ts) when platform code exceeds 20 lines — mixing platform branches in a single file prevents code-splitting and forces all native APIs to load on both platforms.
  2. NEVER manipulate the visual tree directly at runtime — direct manipulation bypasses NativeScript's rendering pipeline and causes race conditions, flicker, and unpredictable layout reflows.
  3. ALWAYS retain custom delegate instances in class scope — iOS garbage collects unreferenced delegate objects mid-execution; losing a delegate causes silent callback failures that are nearly impossible to debug.
  4. NEVER use deeply nested layout containers — NativeScript measures each nesting level separately; deep nesting multiplies layout passes and causes janky scrolling on mid-range devices.
  5. ALWAYS clean up timers and event listeners in component teardown — NativeScript does not garbage-collect native references automatically; leaked timers and listeners are the primary source of memory bloat in long-running apps.

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
Mixing platform branches in a single fileCannot code-split by platform; all native APIs loaded on both platformsUse .ios.ts and .android.ts files when platform-specific code exceeds 20 lines
Direct visual tree manipulation at runtimeBypasses rendering pipeline; causes race conditions and layout flickerUse data-binding and reactive state to drive layout updates
Unreferenced delegate instancesiOS GC collects them mid-execution; silent callback failuresAlways retain delegates in class scope: this.delegate = MyDelegate.new()
Deeply nested layout containersEach level adds layout passes; janky scrolling on mid-range devicesUse GridLayout for complex layouts; StackLayout only for simple linear arrangements
Leaking timers and event listenersNativeScript does not GC native references; leaks accumulate across navigationAlways cancel timers and remove listeners in component teardown lifecycle

Memory Protocol (MANDATORY)

Before starting:

cat .claude/context/memory/learnings.md

After completing: Record any new patterns or exceptions discovered.

ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Use when you want to improve response quality through meta-cognitive reasoning. Applies 15+ reasoning methods to reconsider and refine initial outputs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

N-round opposing-stance debates for trade-off analysis. Assigns pro/con roles to agents, runs structured debate rounds with quality scoring, and produces a moderator synthesis with confidence-rated recommendation. Generalizable to architecture, technology, security, and design decisions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Force adversarial code review stance that eliminates confirmation bias — reviewer must find issues or re-analyze

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

LLM-as-judge evaluation framework with 5-dimension rubric (accuracy, groundedness, coherence, completeness, helpfulness) for scoring AI-generated content quality with weighted composite scores and evidence citations

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

oimiragieo의 스킬 모두 보기

이 스킬의 문제 신고