From titools
Use when designing, reviewing, analyzing, or examining Titanium SDK architecture and implementation (Alloy or Classic) — creating controllers/views/services, choosing models vs collections, implementing communication patterns, handling memory cleanup, testing, auditing code, migrating legacy apps, or building adaptive/responsive layouts for tablets, foldables, and large screens. AUTO-DETECT: If tiapp.xml exists, invoke BEFORE making architectural decisions, creating new controllers/views, or restructuring code. Titanium has its own patterns for navigation (NavigationWindow, TabGroup), memory management, and event handling that differ from web frameworks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/titools:ti-expert [architecture-topic][architecture-topic]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Practical architecture and implementation guidance for Titanium SDK apps (Alloy and Classic). Focus on maintainability, clear boundaries, and low-friction testing.
assets/ControllerAutoCleanup.jsreferences/adaptive-layouts.mdreferences/alloy-builtins.mdreferences/alloy-structure.mdreferences/anti-patterns.mdreferences/architecture-tiers.mdreferences/cli-expert.mdreferences/code-conventions.mdreferences/contracts.mdreferences/controller-patterns.mdreferences/error-handling.mdreferences/examples.mdreferences/migration-patterns.mdreferences/patterns.mdreferences/performance-listview.mdreferences/performance-optimization.mdreferences/security-device.mdreferences/security-fundamentals.mdreferences/state-management.mdreferences/testing-e2e-ci.mdPractical architecture and implementation guidance for Titanium SDK apps (Alloy and Classic). Focus on maintainability, clear boundaries, and low-friction testing.
️ℹ️ Auto-detects Alloy vs Classic projects This skill detects project type automatically and tailors guidance.
Alloy indicators:
app/folder (MVC structure)app/views/,app/controllers/foldersalloy.jmkorconfig.jsonfilesClassic indicators:
Resources/folder withapp.jsat root- No
app/folder structureBehavior:
- Alloy detected: provides Alloy MVC patterns and Backbone.js guidance
- Classic detected: avoids Alloy-only patterns and recommends Classic options or migration
- Unknown: asks the user to clarify the project type
lib/api, lib/services, lib/actions, lib/repositories, lib/helpers)cleanup() pattern for memory managementChoose the appropriate tier based on project complexity:
index.js.$ object throughout the file.app/lib/ using a flat technical-type organization.require() services.$.cleanup = cleanup.ServiceRegistry.$ object. They receive a "Scoped UI" object containing only relevant IDs.service context.Detailed examples and full implementation samples are available in: Architectural Tiers Detail
lib (for example: api, services, actions, repositories, helpers, policies, providers).lib flat and predictable: lib/<type>/<file>.js only.lib/services/auth/session/login.js.controllers/, views/, styles/) and avoid unnecessary depth.const/let, destructuring, template literalsapplyProperties() callsapplyProperties(): batch UI updates to reduce bridge crossings$.cleanup = cleanup🚨 Critical: platform-specific properties require modifiers Using
Ti.UI.iOS.*orTi.UI.Android.*properties without platform modifiers breaks cross-platform builds.Example of the damage:
// Wrong: adds Ti.UI.iOS to Android project "#mainWindow": { statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT }Correct: always use platform modifiers
// Correct: only adds to iOS "#mainWindow[platform=ios]": { statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT }Properties that always need platform modifiers:
- iOS:
statusBarStyle,modalStyle,modalTransitionStyle, anyTi.UI.iOS.*- Android:
actionBarconfiguration, anyTi.UI.Android.*constantAvailable modifiers:
[platform=ios],[platform=android],[formFactor=handheld],[formFactor=tablet],[if=Alloy.Globals.customVar]For more platform-specific patterns, see the
ti-uiskill.
Titanium layout system:
layout: 'horizontal', layout: 'vertical', and composite (default, no layout needed)width: Ti.UI.FILL fills available space (preferred), width: '100%' = 100% of parentheight: Ti.UI.SIZE wraps content, height: Ti.UI.FILL fills available spaceKey builtins: OS_IOS/OS_ANDROID (compile-time), Alloy.CFG (config.json), Alloy.Globals (shared state), $.args (controller params), $.destroy() (cleanup bindings), platform="ios" / formFactor="tablet" (XML conditionals).
For the complete reference with examples, see Alloy builtins and globals.
| Question | Answer |
|---|---|
| How to create a new Alloy project? | ti create -t app --alloy (not --classic + alloy new) |
| Fastest way to build? | tn <recipe> (using TiNy CLI wrapper) |
| Controller > 100 lines? | Extract to Tier 2 (Services) |
| More than 50 IDs in XML? | Use Tier 3 (ID Scoping) |
| Where does API call go? | lib/api/ |
| Where does business logic go? | lib/services/ |
How deep should lib folders be? | One level: lib/<type>/<file>.js |
| Where do I store auth tokens? | Keychain (iOS) / KeyStore (Android) via service |
| Models or Collections? | Collections for API data, Models for SQLite persistence |
| Ti.App.fireEvent or EventBus? | Always EventBus (Backbone.Events) |
| Direct navigation or service? | Always Navigation service (auto cleanup) |
| Inline styles or TSS files? | Always TSS files (per-controller + app.tss for global) |
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub maccesar/titools --plugin titools