ti-guides
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTitanium SDK guide expert
Titanium SDK 指南专家
Use this skill to keep Titanium projects aligned with TiDev standards for stability, performance, and cross-platform behavior.
使用此技能可确保Titanium项目符合TiDev的稳定性、性能及跨平台行为标准。
Project detection
项目检测
:::info Auto-detects Titanium projects
This skill auto-detects Titanium projects. No manual command is needed.
Titanium project indicator:
- file (definitive indicator)
tiapp.xml
Applies to both:
- Alloy projects (folder)
app/ - Classic projects (folder)
Resources/
Behavior:
- If a Titanium project is detected, provide official Titanium SDK guidance, memory management best practices, and app distribution help.
- If not detected, say this skill is only for Titanium projects. :::
:::info 自动检测Titanium项目
此技能可自动检测Titanium项目,无需手动命令。
Titanium项目标识:
- 文件(明确标识)
tiapp.xml
同时适用于:
- Alloy项目(文件夹)
app/ - Classic项目(文件夹)
Resources/
行为说明:
- 若检测到Titanium项目,将提供官方Titanium SDK指导、内存管理最佳实践及应用分发相关帮助。
- 若未检测到,说明此技能仅适用于Titanium项目。 :::
Core workflow
核心工作流程
- Validate the project follows a modular pattern (CommonJS or Alloy).
- Ensure global listeners are removed and heavy objects are nulled during cleanup.
- Cache frequently accessed native properties to reduce bridge crossings.
- Use Hyperloop for specialized native functionality and handle casting and threading correctly.
- Use transactions for database work and manage image memory footprints.
- 验证项目遵循模块化模式(CommonJS或Alloy)。
- 确保在清理阶段移除全局监听器并将大型对象置空。
- 缓存频繁访问的原生属性以减少桥接调用次数。
- 使用Hyperloop实现特殊原生功能,并正确处理类型转换和线程问题。
- 数据库操作使用事务,并管理图片内存占用。
Procedural rules
流程规则
- Always remove and
Ti.Applisteners during controller cleanup.Ti.Geolocation - Do not access or
Ti.Platforminside loops. Store values in local variables.Ti.DisplayCaps - Concatenate Hyperloop selectors accurately (for example, ->
addAttribute:value:range:).addAttributeValueRange - Close resultsets and database handles after every transaction block.
- 控制器清理阶段务必移除和
Ti.App监听器。Ti.Geolocation - 请勿在循环内访问或
Ti.Platform,应将值存储在局部变量中。Ti.DisplayCaps - 准确拼接Hyperloop选择器(例如,->
addAttribute:value:range:)。addAttributeValueRange - 每个事务块结束后关闭结果集和数据库句柄。
Reference guides
参考指南
- Hello World (references/hello-world.md): project creation, structure, and getting started with Alloy or Classic Titanium.
- JavaScript Primer (references/javascript-primer.md): JavaScript fundamentals, learning resources, best practices, and ES6+ features.
- Application Frameworks (references/application-frameworks.md): Alloy vs Classic Titanium, architectural patterns, and framework selection.
- Coding Best Practices (references/coding-best-practices.md): memory leaks, bridge efficiency, event naming, security, and lazy loading.
- CommonJS Advanced (references/commonjs-advanced.md): stateful modules, caching, ES6+ support, and antipatterns.
- Advanced Data & Images (references/advanced-data-and-images.md): SQLite transactions and image memory optimization.
- Hyperloop Native Access (references/hyperloop-native-access.md): Objective-C/Swift/Java syntax, casting, debugging, XIB/Storyboards.
- Style & Conventions (references/style-and-conventions.md): naming standards and formatting rules.
- Reserved Words (references/reserved-words.md): ECMAScript, iOS, and Alloy reserved keywords to avoid.
- Alloy CLI Reference (references/alloy-cli-advanced.md): extract-i18n, code generation, and build hooks.
- Alloy Data Mastery (references/alloy-data-mastery.md): sync adapters, data binding, and Backbone collections.
- Alloy Widgets & Themes (references/alloy-widgets-and-themes.md): widget structure, styling priorities, and theming.
- Android Manifest (references/android-manifest.md): custom AndroidManifest.xml, permissions, and manifest merge.
- App Distribution (references/app-distribution.md): Google Play (APK/AAB), App Store (IPA), certificates, provisioning, and deployment.
- tiapp.xml Configuration (references/tiapp-config.md): complete reference for tiapp.xml and timodule.xml, including all elements, properties, and platform-specific settings.
- CLI Reference (references/cli-reference.md): Titanium CLI commands, options, tasks, configuration, and build processes.
- Resources (references/resources.md): community support, modules, sample code, Slack, and learning materials.
- Hello World(references/hello-world.md):项目创建、结构及Alloy或Classic Titanium入门。
- JavaScript Primer(references/javascript-primer.md):JavaScript基础、学习资源、最佳实践及ES6+特性。
- Application Frameworks(references/application-frameworks.md):Alloy与Classic Titanium对比、架构模式及框架选择。
- Coding Best Practices(references/coding-best-practices.md):内存泄漏、桥接效率、事件命名、安全及懒加载。
- CommonJS Advanced(references/commonjs-advanced.md):有状态模块、缓存、ES6+支持及反模式。
- Advanced Data & Images(references/advanced-data-and-images.md):SQLite事务及图片内存优化。
- Hyperloop Native Access(references/hyperloop-native-access.md):Objective-C/Swift/Java语法、类型转换、调试、XIB/Storyboards。
- Style & Conventions(references/style-and-conventions.md):命名规范及格式规则。
- Reserved Words(references/reserved-words.md):需避免使用的ECMAScript、iOS及Alloy保留关键字。
- Alloy CLI Reference(references/alloy-cli-advanced.md):extract-i18n、代码生成及构建钩子。
- Alloy Data Mastery(references/alloy-data-mastery.md):同步适配器、数据绑定及Backbone集合。
- Alloy Widgets & Themes(references/alloy-widgets-and-themes.md):组件结构、样式优先级及主题设置。
- Android Manifest(references/android-manifest.md):自定义AndroidManifest.xml、权限及清单合并。
- App Distribution(references/app-distribution.md):Google Play(APK/AAB)、App Store(IPA)、证书、配置文件及部署。
- tiapp.xml Configuration(references/tiapp-config.md):tiapp.xml及timodule.xml完整参考,包括所有元素、属性及平台特定设置。
- CLI Reference(references/cli-reference.md):Titanium CLI命令、选项、任务、配置及构建流程。
- Resources(references/resources.md):社区支持、模块、示例代码、Slack及学习资料。
Related skills
相关技能
For tasks beyond SDK fundamentals, use these complementary skills:
| Task | Use this skill |
|---|---|
| Project architecture, services, patterns | |
| Native features (location, push, media) | |
| Alloy CLI, configuration, debugging | |
| UI layouts, ListViews, gestures | |
若需处理SDK基础之外的任务,可使用以下补充技能:
| 任务 | 使用技能 |
|---|---|
| 项目架构、服务、模式 | |
| 原生功能(定位、推送、媒体) | |
| Alloy CLI、配置、调试 | |
| UI布局、ListView、手势 | |
Response format
响应格式
- Technical recommendation: cite the specific TiDev best practice.
- Optimized implementation: provide modern ES6+ code without semicolons.
- Rationale: briefly explain the performance or memory impact.
- 技术建议:引用TiDev的具体最佳实践。
- 优化实现:提供现代ES6+代码(无分号)。
- 原理说明:简要解释对性能或内存的影响。