@maccesar/titools 2.2.4 → 2.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +23 -23
  2. package/agents/ti-pro.md +17 -17
  3. package/lib/commands/update.js +6 -14
  4. package/lib/downloader.js +17 -2
  5. package/package.json +1 -1
  6. package/skills/alloy-guides/SKILL.md +31 -31
  7. package/skills/alloy-guides/references/CONCEPTS.md +3 -3
  8. package/skills/alloy-guides/references/CONTROLLERS.md +1 -1
  9. package/skills/alloy-guides/references/MODELS.md +6 -6
  10. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +1 -1
  11. package/skills/alloy-guides/references/VIEWS_XML.md +1 -1
  12. package/skills/alloy-guides/references/WIDGETS.md +1 -1
  13. package/skills/alloy-howtos/SKILL.md +27 -27
  14. package/skills/alloy-howtos/references/best_practices.md +9 -9
  15. package/skills/alloy-howtos/references/cli_reference.md +14 -14
  16. package/skills/alloy-howtos/references/config_files.md +16 -16
  17. package/skills/alloy-howtos/references/custom_tags.md +16 -16
  18. package/skills/alloy-howtos/references/debugging_troubleshooting.md +11 -15
  19. package/skills/alloy-howtos/references/samples.md +19 -19
  20. package/skills/purgetss/SKILL.md +11 -1
  21. package/skills/purgetss/references/animation-system.md +1 -1
  22. package/skills/purgetss/references/cli-commands.md +3 -3
  23. package/skills/purgetss/references/customization-deep-dive.md +1 -1
  24. package/skills/purgetss/references/dynamic-component-creation.md +1 -1
  25. package/skills/purgetss/references/icon-fonts.md +4 -0
  26. package/skills/purgetss/references/installation-setup.md +8 -1
  27. package/skills/purgetss/references/migration-guide.md +4 -0
  28. package/skills/purgetss/references/tikit-components.md +193 -204
  29. package/skills/purgetss/references/ui-ux-design.md +1 -1
  30. package/skills/ti-expert/SKILL.md +78 -118
  31. package/skills/ti-expert/references/alloy-builtins.md +18 -18
  32. package/skills/ti-expert/references/alloy-structure.md +21 -21
  33. package/skills/ti-expert/references/anti-patterns.md +15 -15
  34. package/skills/ti-expert/references/cli-expert.md +15 -15
  35. package/skills/ti-expert/references/code-conventions.md +38 -38
  36. package/skills/ti-expert/references/contracts.md +8 -8
  37. package/skills/ti-expert/references/controller-patterns.md +14 -14
  38. package/skills/ti-expert/references/error-handling.md +11 -11
  39. package/skills/ti-expert/references/examples.md +12 -12
  40. package/skills/ti-expert/references/migration-patterns.md +24 -24
  41. package/skills/ti-expert/references/patterns.md +10 -10
  42. package/skills/ti-expert/references/performance-listview.md +16 -16
  43. package/skills/ti-expert/references/performance-optimization.md +41 -41
  44. package/skills/ti-expert/references/security-device.md +22 -22
  45. package/skills/ti-expert/references/security-fundamentals.md +19 -19
  46. package/skills/ti-expert/references/state-management.md +33 -33
  47. package/skills/ti-expert/references/testing-e2e-ci.md +25 -25
  48. package/skills/ti-expert/references/testing-unit.md +24 -24
  49. package/skills/ti-expert/references/theming.md +15 -15
  50. package/skills/ti-guides/SKILL.md +58 -60
  51. package/skills/ti-guides/references/advanced-data-and-images.md +33 -33
  52. package/skills/ti-guides/references/android-manifest.md +15 -15
  53. package/skills/ti-guides/references/app-distribution.md +70 -166
  54. package/skills/ti-guides/references/application-frameworks.md +96 -114
  55. package/skills/ti-guides/references/cli-reference.md +294 -294
  56. package/skills/ti-guides/references/coding-best-practices.md +42 -33
  57. package/skills/ti-guides/references/commonjs-advanced.md +57 -51
  58. package/skills/ti-guides/references/hello-world.md +36 -36
  59. package/skills/ti-guides/references/hyperloop-native-access.md +66 -66
  60. package/skills/ti-guides/references/javascript-primer.md +83 -101
  61. package/skills/ti-guides/references/reserved-words.md +9 -9
  62. package/skills/ti-guides/references/resources.md +75 -83
  63. package/skills/ti-guides/references/style-and-conventions.md +35 -28
  64. package/skills/ti-guides/references/tiapp-config.md +110 -74
  65. package/skills/ti-howtos/SKILL.md +88 -92
  66. package/skills/ti-howtos/references/android-platform-deep-dives.md +104 -104
  67. package/skills/ti-howtos/references/automation-fastlane-appium.md +39 -39
  68. package/skills/ti-howtos/references/buffer-codec-streams.md +60 -60
  69. package/skills/ti-howtos/references/cross-platform-development.md +115 -136
  70. package/skills/ti-howtos/references/debugging-profiling.md +167 -181
  71. package/skills/ti-howtos/references/extending-titanium.md +121 -121
  72. package/skills/ti-howtos/references/google-maps-v2.md +84 -82
  73. package/skills/ti-howtos/references/ios-map-kit.md +65 -60
  74. package/skills/ti-howtos/references/ios-platform-deep-dives.md +123 -123
  75. package/skills/ti-howtos/references/local-data-sources.md +79 -78
  76. package/skills/ti-howtos/references/location-and-maps.md +116 -120
  77. package/skills/ti-howtos/references/media-apis.md +87 -86
  78. package/skills/ti-howtos/references/notification-services.md +250 -260
  79. package/skills/ti-howtos/references/remote-data-sources.md +98 -93
  80. package/skills/ti-howtos/references/tutorials.md +226 -216
  81. package/skills/ti-howtos/references/using-modules.md +73 -102
  82. package/skills/ti-howtos/references/web-content-integration.md +101 -103
  83. package/skills/ti-howtos/references/webpack-build-pipeline.md +52 -44
  84. package/skills/ti-ui/SKILL.md +85 -85
  85. package/skills/ti-ui/references/accessibility-deep-dive.md +57 -57
  86. package/skills/ti-ui/references/animation-and-matrices.md +79 -79
  87. package/skills/ti-ui/references/application-structures.md +96 -99
  88. package/skills/ti-ui/references/custom-fonts-styling.md +99 -99
  89. package/skills/ti-ui/references/event-handling.md +58 -58
  90. package/skills/ti-ui/references/gestures.md +62 -64
  91. package/skills/ti-ui/references/icons-and-splash-screens.md +88 -88
  92. package/skills/ti-ui/references/layouts-and-positioning.md +87 -97
  93. package/skills/ti-ui/references/listviews-and-performance.md +107 -107
  94. package/skills/ti-ui/references/orientation.md +87 -88
  95. package/skills/ti-ui/references/platform-ui-android.md +87 -81
  96. package/skills/ti-ui/references/platform-ui-ios.md +63 -61
  97. package/skills/ti-ui/references/scrolling-views.md +29 -29
  98. package/skills/ti-ui/references/tableviews.md +56 -56
@@ -1,31 +1,31 @@
1
- # Titanium Alloy Anti-Patterns
1
+ # Titanium Alloy anti-patterns
2
2
 
3
- ## 1. Inline Styling Instead of TSS
3
+ ## 1. Inline styling instead of TSS
4
4
  **Symptom:** Using inline attributes like `backgroundColor="#fff"` directly in XML views.
5
5
  **Problem:** Inline attributes make theme changes impossible and scatter visual definitions across views.
6
6
  **Solution:** Define styles in TSS files using IDs or class selectors.
7
7
 
8
- ## 2. Fat Controllers
8
+ ## 2. Fat controllers
9
9
  **Symptom:** Controllers with 100+ lines handling logic, API, and UI.
10
10
  **Solution:** Delegate business logic to `lib/services/` and API calls to `lib/api/`.
11
11
 
12
- ## 3. Memory Leaks (Missing Cleanup)
12
+ ## 3. Memory leaks (Missing Cleanup)
13
13
  **Symptom:** Adding `Ti.App` or `Alloy.Collections` listeners without a `cleanup()` function.
14
14
  **Solution:** Always implement `$.cleanup = cleanup` and remove listeners there.
15
15
 
16
- ## 4. Direct Native Module Calls
16
+ ## 4. Direct native module calls
17
17
  **Symptom:** Calling `require('ti.module')` directly in a controller.
18
18
  **Solution:** Wrap it in a service in `lib/services/` (e.g., `audioService.js`).
19
19
 
20
- ## 5. Direct Controller Navigation
20
+ ## 5. Direct controller navigation
21
21
  **Symptom:** `Alloy.createController('name').getView().open()`.
22
22
  **Solution:** Use a Navigation Service to centralize `open/close` and trigger the `cleanup()` function automatically.
23
23
 
24
- ## 6. Complex Matrix Animations
24
+ ## 6. Complex matrix animations
25
25
  **Symptom:** Manual use of `Ti.UI.create2DMatrix()` for simple animations.
26
26
  **Solution:** Use `Ti.UI.createAnimation()` for opacity, transform, and duration-based animations. Reserve 2D Matrix for complex multi-property transforms.
27
27
 
28
- ## 7. Hardcoded Strings & Missing a11y
28
+ ## 7. Hardcoded strings & missing a11y
29
29
  **Symptom:** `text="Login"` instead of `text="L('login')"`, or missing `accessibilityLabel`.
30
30
  **Solution:** Always use i18n and accessibility properties.
31
31
 
@@ -35,9 +35,9 @@
35
35
 
36
36
  ---
37
37
 
38
- ## Titanium Layout Anti-Patterns
38
+ ## Titanium layout anti-patterns
39
39
 
40
- ## 9. Padding on Container Views
40
+ ## 9. Padding on container views
41
41
  **Symptom:** Setting `padding` on View, Window, ScrollView, or TableView.
42
42
  **Problem:** Base container elements don't support padding in Titanium.
43
43
  **Solution:** Use margins on children instead:
@@ -49,17 +49,17 @@
49
49
  "#childLabel": { left: 16, top: 16, right: 16 }
50
50
  ```
51
51
 
52
- ## 10. Redundant Composite Layout
52
+ ## 10. Redundant composite layout
53
53
  **Symptom:** Adding `layout: 'composite'` to Views.
54
54
  **Problem:** Composite (absolute positioning) is the DEFAULT layout. Setting it is redundant.
55
55
  **Solution:** Omit `layout` for composite, only specify `layout: 'horizontal'` or `layout: 'vertical'` when needed.
56
56
 
57
- ## 11. Using `lib/` Prefix in Require Statements
57
+ ## 11. Using `lib/` prefix in require statements
58
58
  **Symptom:** `const service = require('lib/services/picsum')`
59
59
  **Problem:** Alloy flattens the `lib/` folder during build. Files in `app/lib/services/` become `Resources/iphone/services/`.
60
60
  **Solution:** Omit the `lib/` prefix: `const service = require('services/picsum')`
61
61
 
62
- ## 12. Wrong Window ID in Controller
62
+ ## 12. Wrong window ID in controller
63
63
  **Symptom:** Using `$.index.open()` when the Window has `id="mainWindow"`.
64
64
  **Problem:** Alloy generates `$` references from XML IDs. If Window is `id="mainWindow"`, `$.index` doesn't exist.
65
65
  **Solution:** Match the ID: `$.mainWindow.open()`
@@ -69,7 +69,7 @@
69
69
  **Problem:** This API doesn't exist in Titanium. Causes "invalid method" error.
70
70
  **Solution:** Use `Ti.UI.createAlertDialog` for simple messages, or create custom toast views.
71
71
 
72
- ## 14. Using Nonexistent iOS Share APIs
72
+ ## 14. Using nonexistent iOS share APIs
73
73
  **Symptom:** `Ti.UI.iOS.createActivityPopover` or `alloy/social` with wrong methods.
74
74
  **Problem:** These APIs either don't exist or have changed. Causes runtime errors.
75
75
  **Solution:**
@@ -78,7 +78,7 @@
78
78
 
79
79
  ---
80
80
 
81
- ## Quick Reference Table
81
+ ## Quick reference table
82
82
 
83
83
  | Anti-Pattern | Why It Fails | Correct Approach |
84
84
  | ----------------------- | ------------------------ | --------------------- |
@@ -1,12 +1,12 @@
1
- # CLI Expert Strategies & TiNy
1
+ # CLI expert strategies & TiNy
2
2
 
3
3
  Mastering the command line is essential for a Titanium expert. This guide covers advanced workflows, optimization techniques, and the use of **TiNy (`tn`)** for efficient development.
4
4
 
5
- ## The Expert Workflow
5
+ ## The expert workflow
6
6
 
7
7
  An expert doesn't just run `ti build`. They optimize for speed, reliability, and automation.
8
8
 
9
- ### 1. The "Inner Loop" Optimization
9
+ ### 1. The "inner loop" optimization
10
10
  Reduce the time between writing code and seeing it on the device.
11
11
 
12
12
  - **LiveView**: Use `--liveview` for near-instant UI updates without full recompilation.
@@ -22,27 +22,27 @@ Reduce the time between writing code and seeing it on the device.
22
22
  ti build -p ios --skip-js-minify
23
23
  ```
24
24
 
25
- ### 2. Precise Cleaning
25
+ ### 2. Precise cleaning
26
26
  Don't use `ti clean` as a first resort (it's slow).
27
27
  - **Targeted Clean**: If Alloy isn't reflecting changes, try deleting `Resources/` and `build/` manually or use `ti clean -p <platform>`.
28
- - **Pre-Production**: Always run a full `ti clean` before a production/App Store build to ensure no stale assets are included.
28
+ - **Pre-Production**: Always run a full `ti clean` before a production/App Store build to make sure no stale assets are included.
29
29
 
30
- ### 3. Advanced Debugging
30
+ ### 3. Advanced debugging
31
31
  - **Trace Logging**: Use `--log-level trace` when a build fails for mysterious reasons (e.g., a broken hook or native module issue).
32
32
  - **Build Logs**: Check `build/build.log` for the full output of the last build process.
33
33
 
34
34
  ---
35
35
 
36
- ## TiNy (`tn`): The Expert's Power Tool
36
+ ## TiNy (`tn`): the expert's power tool
37
37
 
38
38
  **TiNy** is a modern CLI wrapper for Titanium SDK that drastically reduces keystrokes and manages complex build configurations through "recipes".
39
39
 
40
- ### Why Experts Use TiNy
40
+ ### Why experts use TiNy
41
41
  - **Speed**: `tn ios` vs `ti build -p ios -T simulator`.
42
- - **Consistency**: Recipes ensure every team member builds with the same flags.
42
+ - **Consistency**: Recipes make sure every team member builds with the same flags.
43
43
  - **Device Management**: Easily target specific simulators/emulators by name.
44
44
 
45
- ### Quick Start
45
+ ### Quick start
46
46
  1. **Install**: `npm install -g tn`
47
47
  2. **Repo**: https://github.com/jasonkneen/tn
48
48
  3. **Generate Recipes**: Detect all connected devices/simulators.
@@ -55,7 +55,7 @@ Don't use `ti clean` as a first resort (it's slow).
55
55
  tn pixel-8-pro-api-34
56
56
  ```
57
57
 
58
- ### Expert Recipes
58
+ ### Expert recipes
59
59
  Recipes can be flags or options. Multiple recipes can be combined.
60
60
 
61
61
  | Command | Expansion |
@@ -66,7 +66,7 @@ Recipes can be flags or options. Multiple recipes can be combined.
66
66
  | `tn playstore` | `--android --target dist-playstore` |
67
67
  | `tn watch` | `--ios --launch-watch-app` |
68
68
 
69
- ### Customizing Your Workflow
69
+ ### Customizing your workflow
70
70
  - **Save Global Recipe**:
71
71
  ```bash
72
72
  tn save my-debug --ios --simulator --log-level trace --skip-js-minify
@@ -76,7 +76,7 @@ Recipes can be flags or options. Multiple recipes can be combined.
76
76
  tn project save release --playstore --keystore ./android/release.keystore
77
77
  ```
78
78
 
79
- ### Composition & Placeholders
79
+ ### Composition & placeholders
80
80
  You can use `%s` as a placeholder in recipes for values:
81
81
  ```bash
82
82
  tn save ci -b --pp-uuid <UUID> --distribution-name "<NAME>" --ah --installr --installr-release-notes %s
@@ -87,7 +87,7 @@ tn ci "Fixed login bug"
87
87
 
88
88
  ---
89
89
 
90
- ## Automation Integration
90
+ ## Automation integration
91
91
 
92
92
  Experts automate their builds using `package.json` scripts, often combining `ti` or `tn` with other tools.
93
93
 
@@ -103,7 +103,7 @@ Experts automate their builds using `package.json` scripts, often combining `ti`
103
103
 
104
104
  ---
105
105
 
106
- ## Pro-Tips
106
+ ## Pro-tips
107
107
  - **SDK Switching**: Use `-s <version>` to test your app against a specific SDK version without changing your global default.
108
108
  - **Sim Focus**: Use `--no-sim-focus` if you want to keep your editor in focus while the simulator launches in the background.
109
109
  - **Concurrent Builds**: You can often build for iOS and Android simultaneously in different terminal tabs if your machine has the resources.
@@ -1,6 +1,6 @@
1
- # TSS Styling & Code Conventions
1
+ # TSS styling & code conventions
2
2
 
3
- ## Module System: CommonJS (NOT ES6 modules)
3
+ ## Module system: CommonJS (NOT ES6 modules)
4
4
 
5
5
  Titanium uses **CommonJS** for modules. Do NOT use ES6 `import`/`export`:
6
6
 
@@ -14,7 +14,7 @@ import { Navigation } from 'services/navigation'
14
14
  export const Navigation = { /* ... */ }
15
15
  ```
16
16
 
17
- ## ES6+ Features (Non-Module)
17
+ ## ES6+ features (Non-Module)
18
18
 
19
19
  Use `const`, `let`, destructuring, and template literals. Prefer arrow functions for callbacks and traditional functions for main logic.
20
20
 
@@ -25,7 +25,7 @@ const loadUserData = (userId) => {
25
25
  }
26
26
  ```
27
27
 
28
- ## No Semicolons
28
+ ## No semicolons
29
29
  Omit semicolons at the end of lines (ASI handles it).
30
30
 
31
31
  ```javascript
@@ -35,7 +35,7 @@ const name = user.name
35
35
 
36
36
  ## Styling with TSS
37
37
 
38
- ### TSS File Organization
38
+ ### TSS file organization
39
39
 
40
40
  Every controller can have a matching TSS file. Alloy also supports a global `app.tss`.
41
41
 
@@ -49,11 +49,11 @@ app/styles/
49
49
  ```
50
50
 
51
51
  **Style cascade (priority low → high):**
52
- 1. `app.tss` global base styles
53
- 2. `<controller>.tss` controller-specific styles
52
+ 1. `app.tss` , global base styles
53
+ 2. `<controller>.tss` , controller-specific styles
54
54
  3. Theme overrides (`app/themes/<name>/styles/`)
55
55
 
56
- ### Selector Types
56
+ ### Selector types
57
57
 
58
58
  ```tss
59
59
  /* Element selector — applies to ALL elements of this type */
@@ -79,7 +79,7 @@ app/styles/
79
79
  | Class (`".card"`) | Reusable patterns (3+ uses) | Cards, buttons, inputs |
80
80
  | ID (`"#name"`) | Unique element positioning | Specific layout needs |
81
81
 
82
- ### Class Selectors in XML
82
+ ### Class selectors in XML
83
83
 
84
84
  ```xml
85
85
  <!-- Combine multiple classes -->
@@ -91,7 +91,7 @@ app/styles/
91
91
 
92
92
  Classes defined in `app.tss` are available in every controller. Classes in `<controller>.tss` are only available in that controller.
93
93
 
94
- ### ID + Class Combined
94
+ ### ID + class combined
95
95
 
96
96
  When an element has both an ID and classes, properties merge with ID taking priority:
97
97
 
@@ -108,7 +108,7 @@ When an element has both an ID and classes, properties merge with ID taking prio
108
108
  <Button id="saveButton" class="btn-primary" title="L('save')" />
109
109
  ```
110
110
 
111
- ### Building a Design System in app.tss
111
+ ### Building a design system in app.tss
112
112
 
113
113
  Define reusable style classes for consistency:
114
114
 
@@ -162,7 +162,7 @@ Define reusable style classes for consistency:
162
162
  }
163
163
  ```
164
164
 
165
- ### Complete Example
165
+ ### Complete example
166
166
 
167
167
  ```xml
168
168
  <!-- views/feature/list.xml -->
@@ -188,15 +188,15 @@ Define reusable style classes for consistency:
188
188
  }
189
189
  ```
190
190
 
191
- ### Titanium Layout Rules
191
+ ### Titanium layout rules
192
192
 
193
- - Three layout modes: `layout: 'horizontal'`, `layout: 'vertical'`, and composite (default no `layout` needed)
194
- - NO padding on container Views use margins on children instead
193
+ - Three layout modes: `layout: 'horizontal'`, `layout: 'vertical'`, and composite (default , no `layout` needed)
194
+ - NO padding on container Views , use margins on children instead
195
195
  - `width: Ti.UI.FILL` fills available space, `width: Ti.UI.SIZE` wraps content
196
196
  - `height: Ti.UI.SIZE` is essential for vertical layouts with dynamic content
197
197
  - Use percentage widths (`width: '50%'`) for proportional column layouts
198
198
 
199
- ## Platform & Device Modifiers
199
+ ## Platform & device modifiers
200
200
  Use TSS platform modifiers instead of writing conditional logic in controllers.
201
201
 
202
202
  ```tss
@@ -205,7 +205,7 @@ Use TSS platform modifiers instead of writing conditional logic in controllers.
205
205
  "#header[formFactor=tablet]": { top: 80 }
206
206
  ```
207
207
 
208
- ## applyProperties() Pattern
208
+ ## applyProperties() pattern
209
209
  Use `applyProperties()` to batch UI updates and minimize bridge crossings for properties not managed by classes.
210
210
 
211
211
  ```javascript
@@ -215,7 +215,7 @@ $.nameLabel.applyProperties({
215
215
  })
216
216
  ```
217
217
 
218
- ## ListView Templates
218
+ ## ListView templates
219
219
  Always use templates for performance. Never create views dynamically inside list rows.
220
220
 
221
221
  ```javascript
@@ -228,7 +228,7 @@ function renderUsers(users) {
228
228
  }
229
229
  ```
230
230
 
231
- ## Memory Cleanup
231
+ ## Memory cleanup
232
232
  Always remove listeners to avoid memory leaks. Implement a `cleanup` function.
233
233
 
234
234
  ```javascript
@@ -238,7 +238,7 @@ function cleanup() {
238
238
  }
239
239
  ```
240
240
 
241
- ## i18n and Accessibility (a11y)
241
+ ## i18n and accessibility (a11y)
242
242
  Use `L()` for all text and always include `accessibilityLabel` for interactive elements.
243
243
 
244
244
  ```xml
@@ -246,7 +246,7 @@ Use `L()` for all text and always include `accessibilityLabel` for interactive e
246
246
  <ImageView image="/images/user.png" accessibilityLabel="User Profile Picture" />
247
247
  ```
248
248
 
249
- ## Percentage-Based Layouts
249
+ ## Percentage-based layouts
250
250
  Use percentage widths in TSS for responsive column layouts.
251
251
 
252
252
  ```xml
@@ -262,9 +262,9 @@ Use percentage widths in TSS for responsive column layouts.
262
262
  "#colRight": { width: '33.33%', backgroundColor: '#3b82f6' }
263
263
  ```
264
264
 
265
- ## Naming Conventions
265
+ ## Naming conventions
266
266
 
267
- ### Files and Folders
267
+ ### Files and folders
268
268
  ```
269
269
  app/
270
270
  ├── controllers/
@@ -286,7 +286,7 @@ app/
286
286
  │ └── settings.xml
287
287
  ```
288
288
 
289
- ### Variables and Functions
289
+ ### Variables and functions
290
290
  ```javascript
291
291
  // Constants: UPPER_SNAKE_CASE
292
292
  const API_BASE_URL = 'https://api.example.com'
@@ -317,7 +317,7 @@ function onSearchChange(e) { /* ... */ }
317
317
  function _calculateTotal(items) { /* ... */ }
318
318
  ```
319
319
 
320
- ### Classes and Services
320
+ ### Classes and services
321
321
  ```javascript
322
322
  // Classes: PascalCase
323
323
  class UserService {
@@ -332,7 +332,7 @@ function createHTTPClient(config) { /* ... */ }
332
332
  function createAnimationController() { /* ... */ }
333
333
  ```
334
334
 
335
- ### Events and Constants
335
+ ### Events and constants
336
336
  ```javascript
337
337
  // Event names: namespace:action format
338
338
  const Events = {
@@ -350,9 +350,9 @@ const ErrorCodes = {
350
350
  }
351
351
  ```
352
352
 
353
- ## Import/Export Patterns
353
+ ## Import/Export patterns
354
354
 
355
- ### Named Exports (Preferred)
355
+ ### Named exports (Preferred)
356
356
  ```javascript
357
357
  // lib/api/userApi.js
358
358
  exports.getUser = async function(id) { /* ... */ }
@@ -363,7 +363,7 @@ exports.deleteUser = async function(id) { /* ... */ }
363
363
  const { getUser, updateUser } = require('api/userApi')
364
364
  ```
365
365
 
366
- ### Default Export (For Classes/Singletons)
366
+ ### Default export (For Classes/Singletons)
367
367
  ```javascript
368
368
  // lib/services/logger.js
369
369
  class Logger {
@@ -378,7 +378,7 @@ module.exports = new Logger()
378
378
  const logger = require('services/logger')
379
379
  ```
380
380
 
381
- ### Mixed Exports
381
+ ### Mixed exports
382
382
  ```javascript
383
383
  // lib/services/eventBus.js
384
384
  const _ = require('alloy/underscore')._
@@ -411,7 +411,7 @@ exports.orderApi = require('./orderApi').orderApi
411
411
  const { userApi, productApi } = require('api')
412
412
  ```
413
413
 
414
- ### CommonJS Compatibility
414
+ ### CommonJS compatibility
415
415
  ```javascript
416
416
  // When using native modules that use require()
417
417
  const SomeNativeModule = require('ti.somemodule')
@@ -424,7 +424,7 @@ exports.nativeService = {
424
424
  }
425
425
  ```
426
426
 
427
- ## Async/Promise Patterns
427
+ ## Async/Promise patterns
428
428
 
429
429
  ### Async/Await (Preferred)
430
430
  ```javascript
@@ -454,7 +454,7 @@ async function loadData() {
454
454
  }
455
455
  ```
456
456
 
457
- ### Parallel Requests
457
+ ### Parallel requests
458
458
  ```javascript
459
459
  // When requests are independent - run in parallel
460
460
  async function loadDashboard() {
@@ -468,7 +468,7 @@ async function loadDashboard() {
468
468
  }
469
469
  ```
470
470
 
471
- ### Sequential with Dependencies
471
+ ### Sequential with dependencies
472
472
  ```javascript
473
473
  // When each request depends on the previous
474
474
  async function processOrder(cartId) {
@@ -485,7 +485,7 @@ async function processOrder(cartId) {
485
485
  }
486
486
  ```
487
487
 
488
- ### Error Handling with Specific Catches
488
+ ### Error handling with specific catches
489
489
  ```javascript
490
490
  async function login(email, password) {
491
491
  try {
@@ -508,7 +508,7 @@ async function login(email, password) {
508
508
  }
509
509
  ```
510
510
 
511
- ### Converting Callbacks to Promises
511
+ ### Converting callbacks to promises
512
512
  ```javascript
513
513
  // Wrap Ti.Network.createHTTPClient in Promise
514
514
  function httpGet(url) {
@@ -544,7 +544,7 @@ function takePhoto() {
544
544
  }
545
545
  ```
546
546
 
547
- ### Debouncing Async Operations
547
+ ### Debouncing async operations
548
548
  ```javascript
549
549
  // Useful for search, auto-save, etc.
550
550
  let searchTimeout = null
@@ -575,7 +575,7 @@ function cleanup() {
575
575
  }
576
576
  ```
577
577
 
578
- ### Retry Pattern
578
+ ### Retry pattern
579
579
  ```javascript
580
580
  async function fetchWithRetry(fn, maxRetries = 3) {
581
581
  let lastError
@@ -1,8 +1,8 @@
1
- # Layer Contracts & Interfaces
1
+ # Layer contracts & interfaces
2
2
 
3
3
  Contracts define the input/output specifications between layers, ensuring consistent communication and easy testing.
4
4
 
5
- ## API Layer Contracts
5
+ ## API layer contracts
6
6
 
7
7
  ```javascript
8
8
  // lib/api/userApi.js
@@ -73,7 +73,7 @@ exports.userApi = {
73
73
  }
74
74
  ```
75
75
 
76
- ## Service Layer Contracts
76
+ ## Service layer contracts
77
77
 
78
78
  ```javascript
79
79
  // lib/services/authService.js
@@ -123,7 +123,7 @@ exports.AuthService = {
123
123
  }
124
124
  ```
125
125
 
126
- ## Controller Contracts
126
+ ## Controller contracts
127
127
 
128
128
  Document expected inputs and outputs for each controller:
129
129
 
@@ -167,7 +167,7 @@ function init() {
167
167
  $.cleanup = cleanup
168
168
  ```
169
169
 
170
- ## Navigation Service Contract
170
+ ## Navigation service contract
171
171
 
172
172
  ```javascript
173
173
  // lib/services/navigation.js
@@ -210,7 +210,7 @@ exports.Navigation = {
210
210
  }
211
211
  ```
212
212
 
213
- ## Helper Contracts
213
+ ## Helper contracts
214
214
 
215
215
  ```javascript
216
216
  // lib/helpers/formatters.js
@@ -242,7 +242,7 @@ exports.Formatters = {
242
242
  }
243
243
  ```
244
244
 
245
- ## Event Bus Contract
245
+ ## Event bus contract
246
246
 
247
247
  ```javascript
248
248
  // lib/services/eventBus.js
@@ -271,7 +271,7 @@ exports.Events = {
271
271
  }
272
272
  ```
273
273
 
274
- ## Contract Enforcement Tips
274
+ ## Contract enforcement tips
275
275
 
276
276
  1. **Always validate `$.args`** at controller initialization
277
277
  2. **Use TypeScript JSDoc** for IDE autocompletion and error detection
@@ -1,15 +1,15 @@
1
- # Alloy Controller Patterns
1
+ # Alloy controller patterns
2
2
 
3
- ## Titanium Layout Rules
3
+ ## Titanium layout rules
4
4
 
5
5
  - Use `layout: 'horizontal'` for left-to-right
6
6
  - Use `layout: 'vertical'` for top-to-bottom
7
- - Omit `layout` for composite (absolute positioning the default)
7
+ - Omit `layout` for composite (absolute positioning, the default)
8
8
  - Use margins on children instead of padding on parent
9
9
 
10
10
  > For a complete View + TSS + Controller example, see the Quick Start in SKILL.md.
11
11
 
12
- ## Animation Usage
12
+ ## Animation usage
13
13
 
14
14
  Use `Ti.UI.createAnimation()` for UI transitions.
15
15
 
@@ -36,7 +36,7 @@ function hide(callback) {
36
36
  }
37
37
  ```
38
38
 
39
- ## Dynamic Styling
39
+ ## Dynamic styling
40
40
 
41
41
  To change styles dynamically, use `applyProperties()` to batch updates.
42
42
 
@@ -49,7 +49,7 @@ function setStatus(isActive) {
49
49
  }
50
50
  ```
51
51
 
52
- ## Percentage-Based Layouts
52
+ ## Percentage-based layouts
53
53
 
54
54
  Use percentage widths in TSS for responsive column layouts.
55
55
 
@@ -66,7 +66,7 @@ Use percentage widths in TSS for responsive column layouts.
66
66
  "#colRight": { height: 80, width: '33.33%', backgroundColor: '#dbeafe' }
67
67
  ```
68
68
 
69
- ## Controller Lifecycle Patterns
69
+ ## Controller lifecycle patterns
70
70
 
71
71
  Show init, focus, blur, close lifecycle:
72
72
  ```javascript
@@ -102,7 +102,7 @@ function cleanup() {
102
102
  $.cleanup = cleanup
103
103
  ```
104
104
 
105
- ## Form Handling Patterns
105
+ ## Form handling patterns
106
106
 
107
107
  ```xml
108
108
  <!-- views/user/edit.xml -->
@@ -206,7 +206,7 @@ function setLoading(isLoading) {
206
206
  }
207
207
  ```
208
208
 
209
- ## Loading State Patterns
209
+ ## Loading state patterns
210
210
 
211
211
  ```xml
212
212
  <!-- Skeleton loading pattern -->
@@ -261,7 +261,7 @@ async function loadData() {
261
261
  }
262
262
  ```
263
263
 
264
- ## Modal and Dialog Patterns
264
+ ## Modal and dialog patterns
265
265
 
266
266
  ```javascript
267
267
  // AlertDialog
@@ -325,7 +325,7 @@ function openModal(route, params) {
325
325
  }
326
326
  ```
327
327
 
328
- ## TabGroup Pattern
328
+ ## Tabgroup pattern
329
329
 
330
330
  ```xml
331
331
  <!-- views/main.xml -->
@@ -366,7 +366,7 @@ function updateNotificationBadge(count) {
366
366
  }
367
367
  ```
368
368
 
369
- ## NavigationWindow Pattern (iOS)
369
+ ## Navigationwindow pattern (iOS)
370
370
 
371
371
  ```xml
372
372
  <!-- views/index.xml -->
@@ -403,7 +403,7 @@ function closeWindow(window, animated = true) {
403
403
  }
404
404
  ```
405
405
 
406
- ## SearchBar with ListView
406
+ ## Searchbar with ListView
407
407
 
408
408
  ```xml
409
409
  <!-- views/contacts/list.xml -->
@@ -501,7 +501,7 @@ function cleanup() {
501
501
  $.cleanup = cleanup
502
502
  ```
503
503
 
504
- ## Pull-to-Refresh Pattern
504
+ ## Pull-to-refresh pattern
505
505
 
506
506
  ```xml
507
507
  <ListView id="listView">