@maccesar/titools 2.0.0

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 (120) hide show
  1. package/AGENTS-TEMPLATE.md +173 -0
  2. package/README.md +867 -0
  3. package/agents/ti-researcher.md +108 -0
  4. package/bin/titools.js +53 -0
  5. package/lib/commands/agents.js +126 -0
  6. package/lib/commands/install.js +188 -0
  7. package/lib/commands/uninstall.js +215 -0
  8. package/lib/commands/update.js +159 -0
  9. package/lib/config.js +119 -0
  10. package/lib/downloader.js +153 -0
  11. package/lib/installer.js +253 -0
  12. package/lib/platform.js +108 -0
  13. package/lib/symlink.js +142 -0
  14. package/lib/utils.js +270 -0
  15. package/package.json +67 -0
  16. package/skills/alloy-expert/SKILL.md +247 -0
  17. package/skills/alloy-expert/assets/ControllerAutoCleanup.js +182 -0
  18. package/skills/alloy-expert/references/alloy-structure.md +381 -0
  19. package/skills/alloy-expert/references/anti-patterns.md +133 -0
  20. package/skills/alloy-expert/references/code-conventions.md +469 -0
  21. package/skills/alloy-expert/references/contracts.md +280 -0
  22. package/skills/alloy-expert/references/controller-patterns.md +520 -0
  23. package/skills/alloy-expert/references/error-handling.md +484 -0
  24. package/skills/alloy-expert/references/examples.md +735 -0
  25. package/skills/alloy-expert/references/migration-patterns.md +298 -0
  26. package/skills/alloy-expert/references/patterns.md +448 -0
  27. package/skills/alloy-expert/references/performance-patterns.md +855 -0
  28. package/skills/alloy-expert/references/security-patterns.md +847 -0
  29. package/skills/alloy-expert/references/state-management.md +779 -0
  30. package/skills/alloy-expert/references/testing.md +872 -0
  31. package/skills/alloy-guides/SKILL.md +214 -0
  32. package/skills/alloy-guides/references/CLI_TASKS.md +243 -0
  33. package/skills/alloy-guides/references/CONCEPTS.md +191 -0
  34. package/skills/alloy-guides/references/CONTROLLERS.md +298 -0
  35. package/skills/alloy-guides/references/MODELS.md +1028 -0
  36. package/skills/alloy-guides/references/PURGETSS.md +56 -0
  37. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +242 -0
  38. package/skills/alloy-guides/references/VIEWS_STYLES.md +388 -0
  39. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +109 -0
  40. package/skills/alloy-guides/references/VIEWS_XML.md +558 -0
  41. package/skills/alloy-guides/references/WIDGETS.md +176 -0
  42. package/skills/alloy-howtos/SKILL.md +203 -0
  43. package/skills/alloy-howtos/references/best_practices.md +138 -0
  44. package/skills/alloy-howtos/references/cli_reference.md +253 -0
  45. package/skills/alloy-howtos/references/config_files.md +87 -0
  46. package/skills/alloy-howtos/references/custom_tags.md +147 -0
  47. package/skills/alloy-howtos/references/debugging_troubleshooting.md +101 -0
  48. package/skills/alloy-howtos/references/samples.md +167 -0
  49. package/skills/purgetss/SKILL.md +442 -0
  50. package/skills/purgetss/assets/purgetss.config.cjs +17 -0
  51. package/skills/purgetss/references/EXAMPLES.md +247 -0
  52. package/skills/purgetss/references/animation-system.md +1294 -0
  53. package/skills/purgetss/references/apply-directive.md +375 -0
  54. package/skills/purgetss/references/arbitrary-values.md +612 -0
  55. package/skills/purgetss/references/class-index.md +1350 -0
  56. package/skills/purgetss/references/cli-commands.md +948 -0
  57. package/skills/purgetss/references/configurable-properties.md +654 -0
  58. package/skills/purgetss/references/custom-rules.md +161 -0
  59. package/skills/purgetss/references/customization-deep-dive.md +722 -0
  60. package/skills/purgetss/references/dynamic-component-creation.md +489 -0
  61. package/skills/purgetss/references/grid-layout.md +455 -0
  62. package/skills/purgetss/references/icon-fonts.md +609 -0
  63. package/skills/purgetss/references/installation-setup.md +366 -0
  64. package/skills/purgetss/references/opacity-modifier.md +291 -0
  65. package/skills/purgetss/references/platform-modifiers.md +479 -0
  66. package/skills/purgetss/references/smart-mappings.md +42 -0
  67. package/skills/purgetss/references/titanium-resets.md +359 -0
  68. package/skills/purgetss/references/ui-ux-design.md +1526 -0
  69. package/skills/ti-guides/SKILL.md +94 -0
  70. package/skills/ti-guides/references/advanced-data-and-images.md +19 -0
  71. package/skills/ti-guides/references/alloy-cli-advanced.md +84 -0
  72. package/skills/ti-guides/references/alloy-data-mastery.md +29 -0
  73. package/skills/ti-guides/references/alloy-widgets-and-themes.md +19 -0
  74. package/skills/ti-guides/references/android-manifest.md +97 -0
  75. package/skills/ti-guides/references/app-distribution.md +258 -0
  76. package/skills/ti-guides/references/application-frameworks.md +377 -0
  77. package/skills/ti-guides/references/cli-reference.md +402 -0
  78. package/skills/ti-guides/references/coding-best-practices.md +102 -0
  79. package/skills/ti-guides/references/commonjs-advanced.md +134 -0
  80. package/skills/ti-guides/references/hello-world.md +100 -0
  81. package/skills/ti-guides/references/hyperloop-native-access.md +62 -0
  82. package/skills/ti-guides/references/javascript-primer.md +411 -0
  83. package/skills/ti-guides/references/reserved-words.md +36 -0
  84. package/skills/ti-guides/references/resources.md +183 -0
  85. package/skills/ti-guides/references/style-and-conventions.md +48 -0
  86. package/skills/ti-guides/references/tiapp-config.md +609 -0
  87. package/skills/ti-howtos/SKILL.md +174 -0
  88. package/skills/ti-howtos/references/android-platform-deep-dives.md +658 -0
  89. package/skills/ti-howtos/references/automation-fastlane-appium.md +95 -0
  90. package/skills/ti-howtos/references/buffer-codec-streams.md +140 -0
  91. package/skills/ti-howtos/references/cross-platform-development.md +348 -0
  92. package/skills/ti-howtos/references/debugging-profiling.md +543 -0
  93. package/skills/ti-howtos/references/extending-titanium.md +723 -0
  94. package/skills/ti-howtos/references/google-maps-v2.md +169 -0
  95. package/skills/ti-howtos/references/ios-map-kit.md +143 -0
  96. package/skills/ti-howtos/references/ios-platform-deep-dives.md +783 -0
  97. package/skills/ti-howtos/references/local-data-sources.md +301 -0
  98. package/skills/ti-howtos/references/location-and-maps.md +252 -0
  99. package/skills/ti-howtos/references/media-apis.md +210 -0
  100. package/skills/ti-howtos/references/notification-services.md +599 -0
  101. package/skills/ti-howtos/references/remote-data-sources.md +349 -0
  102. package/skills/ti-howtos/references/tutorials.md +502 -0
  103. package/skills/ti-howtos/references/using-modules.md +237 -0
  104. package/skills/ti-howtos/references/web-content-integration.md +307 -0
  105. package/skills/ti-howtos/references/webpack-build-pipeline.md +78 -0
  106. package/skills/ti-ui/SKILL.md +179 -0
  107. package/skills/ti-ui/references/accessibility-deep-dive.md +242 -0
  108. package/skills/ti-ui/references/animation-and-matrices.md +599 -0
  109. package/skills/ti-ui/references/application-structures.md +655 -0
  110. package/skills/ti-ui/references/custom-fonts-styling.md +579 -0
  111. package/skills/ti-ui/references/event-handling.md +393 -0
  112. package/skills/ti-ui/references/gestures.md +473 -0
  113. package/skills/ti-ui/references/icons-and-splash-screens.md +409 -0
  114. package/skills/ti-ui/references/layouts-and-positioning.md +462 -0
  115. package/skills/ti-ui/references/listviews-and-performance.md +619 -0
  116. package/skills/ti-ui/references/orientation.md +362 -0
  117. package/skills/ti-ui/references/platform-ui-android.md +635 -0
  118. package/skills/ti-ui/references/platform-ui-ios.md +469 -0
  119. package/skills/ti-ui/references/scrolling-views.md +252 -0
  120. package/skills/ti-ui/references/tableviews.md +568 -0
package/README.md ADDED
@@ -0,0 +1,867 @@
1
+ # titools - Titanium CLI for AI Coding Assistants
2
+
3
+ A comprehensive CLI that transforms your coding assistant into a **Titanium SDK expert**. Install skills, agents, and documentation for Titanium SDK, Alloy MVC, and PurgeTSS development.
4
+
5
+ ## Compatible Platforms
6
+
7
+ | Platform | Status | Installation Path |
8
+ | --------------------------------------------------------- | ------------------ | ------------------- |
9
+ | [Claude Code](https://claude.ai/claude-code) | ✅ Fully Compatible | `~/.claude/skills/` |
10
+ | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | ✅ Fully Compatible | `~/.gemini/skills/` |
11
+ | [Codex CLI](https://developers.openai.com/codex/cli/) | ✅ Fully Compatible | `~/.codex/skills/` |
12
+
13
+ All three platforms use the same **Agent Skills open standard**: a `SKILL.md` file with YAML frontmatter.
14
+
15
+ ---
16
+
17
+ ## Quick Install
18
+
19
+ ### NPM Package (Recommended)
20
+
21
+ ```bash
22
+ npm install -g @maccesar/titools
23
+ ```
24
+
25
+ This installs the `titools` CLI command globally:
26
+
27
+ ```bash
28
+ # Install skills and agents
29
+ titools install
30
+
31
+ # Add AGENTS.md/CLAUDE.md to your project
32
+ titools agents
33
+
34
+ # Update to the latest version
35
+ titools update
36
+
37
+ # Show version
38
+ titools --version
39
+ ```
40
+
41
+ **What it installs:**
42
+ - ✅ All 7 titanium-* skills
43
+ - ✅ ti-researcher agent
44
+ - ✅ Automatic documentation generation
45
+
46
+ **Why use NPM?**
47
+ - ✅ Cross-platform support (macOS, Linux, Windows)
48
+ - ✅ No sudo required
49
+ - ✅ Easy version management
50
+ - ✅ Simple updates with `titools update`
51
+
52
+ ---
53
+
54
+ ### Legacy Bash Installer
55
+
56
+ **Note:** The bash installer (`install.sh`) is maintained for backward compatibility but NPM installation is recommended.
57
+
58
+ ```bash
59
+ curl -fsSL https://raw.githubusercontent.com/macCesar/titools/main/legacy/install.sh | bash
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Usage
65
+
66
+ ### titools install
67
+
68
+ Installs Titanium skills and agents globally:
69
+ - ✅ All 7 titanium-* skills
70
+ - ✅ ti-researcher agent
71
+ - ✅ AGENTS-TEMPLATE.md (template for documentation generation)
72
+
73
+ ### One-Line Install (same as Option 2)
74
+
75
+ ```bash
76
+ curl -fsSL https://raw.githubusercontent.com/macCesar/titools/main/legacy/install.sh | bash
77
+ ```
78
+
79
+ Auto-detects installed LLMs and creates a centralized installation with symlinks to detected platforms:
80
+
81
+ ```
82
+ Titanium SDK Skills Installer
83
+
84
+ ✓ Claude Code detected
85
+ ✓ Gemini CLI detected
86
+ ✓ Codex CLI detected
87
+
88
+ This installer:
89
+ 1. Installs skills to ~/.agents/skills/ (central location)
90
+ 2. Installs agents to ~/.claude/agents/ (Claude Code)
91
+ 3. Creates symlinks in detected AI CLI directories
92
+
93
+ Select platform to install:
94
+
95
+ a) All detected platforms
96
+ 1) Claude Code only
97
+ 2) Gemini CLI only
98
+ 3) Codex CLI only
99
+ q) Quit
100
+ ```
101
+
102
+ ### Using npx skills (Skills Only)
103
+
104
+ You can also install **only the skills** using the `skills` CLI:
105
+
106
+ ```bash
107
+ npx skills add macCesar/titools
108
+ ```
109
+
110
+ **Note:** This installs only skills (no agents, no `titools agents` command). For the complete experience, use the full NPM installation above.
111
+
112
+ ### Verify Installation
113
+
114
+ **Check titools version:**
115
+ ```bash
116
+ titools --version
117
+ # Should show: v2.0.0
118
+ ```
119
+
120
+ **Check central location:**
121
+ ```bash
122
+ ls ~/.agents/skills/
123
+ # Should show: alloy-expert, purgetss, ti-ui, ti-howtos, ti-guides, alloy-guides, alloy-howtos
124
+ ```
125
+
126
+ **Claude Code (skills):**
127
+ ```bash
128
+ ls -la ~/.claude/skills/
129
+ # Should show symlinks pointing to ~/.agents/skills/
130
+ ```
131
+
132
+ **Claude Code (agents):**
133
+ ```bash
134
+ ls -la ~/.claude/agents/
135
+ # Should show: ti-researcher.md
136
+ ```
137
+
138
+ **Gemini CLI:**
139
+ ```bash
140
+ gemini skills list
141
+ ```
142
+
143
+ **Codex CLI:**
144
+ ```bash
145
+ # Type /skills in Codex or use $ to mention a skill
146
+ ```
147
+
148
+ ---
149
+
150
+ ## AGENTS.md: Boost AI Performance to 100%
151
+
152
+ ### ⚠️ Claude Code Users: Use CLAUDE.md
153
+
154
+ **Claude Code specifically looks for `CLAUDE.md`** (not `AGENTS.md`).
155
+
156
+ The `titools agents` command detects if you use Claude Code and creates `CLAUDE.md` automatically:
157
+
158
+ ```bash
159
+ cd /path/to/your/titanium/project
160
+ titools agents
161
+
162
+ # The command will ask:
163
+ # Which AI assistant are you using?
164
+ # 1) Claude Code (creates CLAUDE.md)
165
+ # 2) Gemini CLI (creates GEMINI.md)
166
+ # 3) Cursor/Copilot (creates AGENTS.md)
167
+ ```
168
+
169
+ The content is identical - only the filename differs per AI assistant.
170
+
171
+ ---
172
+
173
+ ### How AGENTS.md/CLAUDE.md Works
174
+
175
+ | Approach | Pass Rate |
176
+ | ---------------- | --------- |
177
+ | No documentation | 53% |
178
+ | Skills only | 53-79% |
179
+ | **AGENTS.md** | **100%** |
180
+
181
+ **Why it works:**
182
+ - **No decision point** - Information is always present, no need to invoke skills
183
+ - **Consistent availability** - Available in every turn, not async-loaded
184
+ - **No ordering issues** - No "read docs first vs explore project first" dilemma
185
+
186
+ ### How to Install AGENTS.md
187
+
188
+ After installing titools, add AGENTS.md to your Titanium project:
189
+
190
+ ```bash
191
+ cd /path/to/your/titanium/project
192
+
193
+ # If using NPM installation:
194
+ titools agents
195
+ ```
196
+
197
+ The `titools agents` command will:
198
+ 1. Verify this is a Titanium project (checks for `tiapp.xml`)
199
+ 2. Detect your Titanium SDK version
200
+ 3. Create `AGENTS.md`/`CLAUDE.md`/`GEMINI.md` with a compressed 8KB documentation index
201
+ 4. Intelligently merge if file already exists (removes old block, adds new one)
202
+
203
+ **Priority Logic:** If multiple AI files exist (CLAUDE.md, GEMINI.md, AGENTS.md), the command updates all of them automatically:
204
+ - CLAUDE.md has highest priority (Claude Code users)
205
+ - GEMINI.md has medium priority (Gemini CLI users)
206
+ - AGENTS.md has lowest priority (Cursor/Copilot users)
207
+
208
+ ### What AGENTS.md Contains
209
+
210
+ ```
211
+ [Titanium SDK Docs Index]|root: ~/.agents/skills
212
+ |IMPORTANT: Prefer retrieval-led reasoning over pre-training-led reasoning
213
+ |alloy-expert/references:{alloy-structure.md,anti-patterns.md,...}
214
+ |purgetss/references:{animation-system.md,class-index.md,...}
215
+ |ti-ui/references:{layouts-and-positioning.md,listviews-and-performance.md,...}
216
+ ...
217
+ ```
218
+
219
+ The index points to all reference documentation, so your AI assistant can quickly retrieve accurate information without relying on potentially outdated training data.
220
+
221
+ ### Version Notice
222
+
223
+ AGENTS.md is based on the **latest Titanium SDK documentation**. If your project uses an older version, the command will detect and warn you about potential API differences.
224
+
225
+ ---
226
+
227
+ ## How to Use AGENTS.md/CLAUDE.md
228
+
229
+ Once installed, the AI assistant automatically reads the documentation index in every conversation. Just ask natural questions about Titanium development:
230
+
231
+ ### Example Prompts
232
+
233
+ **General Architecture:**
234
+ ```
235
+ "How should I structure a new Alloy app with authentication?"
236
+ "What's the best pattern for navigation between screens?"
237
+ ```
238
+
239
+ **PurgeTSS Styling:**
240
+ ```
241
+ "Create a product card with PurgeTSS: image, title, price, and buy button"
242
+ "How do I use the 12-column grid system in PurgeTSS?"
243
+ "Why does my build fail with platform-specific properties?"
244
+ ```
245
+
246
+ **UI Components:**
247
+ ```
248
+ "Create a ListView with custom templates for performance"
249
+ "Implement pull-to-refresh on a ScrollView"
250
+ ```
251
+
252
+ **Native Features:**
253
+ ```
254
+ "Implement push notifications for iOS and Android"
255
+ "How do I handle GPS location in the background?"
256
+ ```
257
+
258
+ **Debugging:**
259
+ ```
260
+ "Why is my ListView scrolling poorly?"
261
+ "I'm getting 'Alloy is not defined' in my lib file. How do I fix it?"
262
+ ```
263
+
264
+ ---
265
+
266
+ ## How Skills Work with AGENTS.md
267
+
268
+ **AGENTS.md** provides always-available context (the documentation index).
269
+ **Skills** provide specialized, on-demand expertise.
270
+
271
+ Together they work seamlessly:
272
+
273
+ | Your Question | AGENTS.md Provides | Skills Activate |
274
+ | ------------------------------- | ------------------------------- | ----------------------------- |
275
+ | "Create a login screen" | Context about project structure | `alloy-expert`, `purgetss` |
276
+ | "Optimize ListView performance" | Points to docs location | `ti-ui` reads specific files |
277
+ | "Implement push notifications" | API reference paths | `ti-howtos` provides workflow |
278
+
279
+ **You don't need to explicitly invoke skills** - the AI detects when to use them based on your question.
280
+
281
+ ---
282
+
283
+ ## Skills Overview
284
+
285
+ | Skill | Purpose | Best For |
286
+ | ---------------- | ----------------------------- | --------------------------------------- |
287
+ | **alloy-expert** | Architecture + Implementation | Starting point for most tasks |
288
+ | **purgetss** | Utility-first styling | UI styling and animations |
289
+ | **ti-ui** | UI/UX patterns | Complex layouts, ListViews, platform UI |
290
+ | **ti-howtos** | Native feature integration | Location, Push, Media, Platform APIs |
291
+ | **ti-guides** | SDK fundamentals | Hyperloop, distribution, configuration |
292
+ | **alloy-guides** | Alloy MVC reference | Models, Views, Controllers, Widgets |
293
+ | **alloy-howtos** | Alloy CLI & debugging | Project setup, CLI commands, errors |
294
+
295
+ > **Note:** `ti-guides`, `ti-howtos`, `ti-ui`, `alloy-guides`, and `alloy-howtos` are based on **official Titanium SDK and Alloy documentation**. `alloy-expert` and `purgetss` are opinionated and reflect personal coding conventions (biased toward PurgeTSS).
296
+
297
+ ---
298
+
299
+ ## Agents (Claude Code Only)
300
+
301
+ In addition to skills, this repository includes **sub-agents** for Claude Code. Sub-agents run in isolated contexts and are ideal for research tasks that produce verbose output.
302
+
303
+ ### ti-researcher
304
+
305
+ **Deep-dive research specialist that preloads all 7 titanium-\* skills.**
306
+
307
+ | Aspect | Details |
308
+ | -------------------- | -------------------------------------------- |
309
+ | **Location** | `~/.claude/agents/ti-researcher.md` |
310
+ | **Model** | Sonnet (comprehensive analysis) |
311
+ | **Tools** | Read-only (Read, Grep, Glob) |
312
+ | **Preloaded Skills** | All 7 titanium-\* skills injected at startup |
313
+
314
+ **When to use the agent vs skills:**
315
+
316
+ | Use Case | Use This | Why |
317
+ | ---------------------------- | ---------------------------------- | ---------------------------------------------------- |
318
+ | Quick inline reference | `/alloy-expert`, `/purgetss`, etc. | Runs in main conversation, interactive |
319
+ | Analyzing an entire codebase | `ti-researcher` agent | Isolates verbose output, cross-references all skills |
320
+ | Multi-feature research | `ti-researcher` agent | Preloads all skills for comprehensive answers |
321
+ | Step-by-step implementation | Skills directly | Task-oriented guidance |
322
+ | Architecture review | `ti-researcher` agent | Read-only analysis across all documentation |
323
+
324
+ **Example prompts for the agent:**
325
+
326
+ ```
327
+ "Use the ti-researcher agent to analyze this Alloy codebase's architecture"
328
+ "Research how to implement location + push + background sync together in Titanium"
329
+ "Compare ListView vs TableView for my use case with PurgeTSS styling"
330
+ "Review this Titanium mobile app and identify anti-patterns"
331
+ ```
332
+
333
+ > **Tip**: For automatic activation, include words like "Titanium", "Alloy", or "mobile app" in your prompt to ensure the specialized agent is used instead of generic code analysis.
334
+
335
+ **Key difference:**
336
+ - **Skills** = Interactive help during development (inline, conversational)
337
+ - **Agents** = Isolated research tasks (returns summary, keeps verbose output separate)
338
+
339
+ ---
340
+
341
+ ## How Skills Work
342
+
343
+ Skills are **automatically activated** based on your questions. Just ask naturally:
344
+
345
+ ```
346
+ "Create a login screen with email validation and animations"
347
+ ```
348
+
349
+ The AI will automatically use:
350
+ - `alloy-expert` → Architecture and controller structure
351
+ - `purgetss` → Styling classes and animations (if PurgeTSS detected)
352
+ - `ti-howtos` → Secure token storage
353
+
354
+ **You don't need to call skills explicitly** - the AI reads skill descriptions and loads the appropriate knowledge when needed.
355
+
356
+ ### Project Detection
357
+
358
+ All skills now include **automatic project detection** to ensure compatibility:
359
+
360
+ | Skill | What It Detects | How It Works |
361
+ | ---------------- | --------------------- | ------------------------------------------------------------- |
362
+ | **purgetss** | PurgeTSS installation | Checks for `purgetss/` folder, `config.cjs`, `utilities.tss` |
363
+ | **alloy-expert** | Alloy vs Classic | Checks for `app/` (Alloy) vs `Resources/` (Classic) structure |
364
+ | **alloy-guides** | Alloy projects | Checks for `app/views/`, `app/controllers/` |
365
+ | **alloy-howtos** | Alloy projects | Checks for `alloy.jmk`, `config.json` |
366
+ | **ti-ui** | Titanium projects | Checks for `tiapp.xml` (both Alloy & Classic) |
367
+ | **ti-guides** | Titanium projects | Checks for `tiapp.xml` (both Alloy & Classic) |
368
+ | **ti-howtos** | Titanium projects | Checks for `tiapp.xml` (both Alloy & Classic) |
369
+
370
+ **Why this matters:**
371
+ - PurgeTSS suggestions are **only provided** if PurgeTSS is installed
372
+ - Alloy-specific patterns are **only suggested** for Alloy projects
373
+ - Classic Titanium projects won't receive inappropriate Alloy advice
374
+
375
+ ### Skill Hierarchy
376
+
377
+ `alloy-expert` acts as the **orchestrator**, delegating to specialized skills when needed:
378
+
379
+ ```
380
+ ┌─────────────────┐
381
+ │ alloy-expert │
382
+ │ (Start Here) │
383
+ └────────┬────────┘
384
+
385
+ ┌────────────────────┼────────────────────┐
386
+ │ │ │
387
+ ▼ ▼ ▼
388
+ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
389
+ │ purgetss │ │ ti-ui │ │ ti-howtos │
390
+ │ (Styling) │ │ (UI/UX) │ │ (Native) │
391
+ └───────────────┘ └───────────────┘ └───────────────┘
392
+ │ │ │
393
+ └────────────────────┼────────────────────┘
394
+
395
+ ┌────────────────────┼────────────────────┐
396
+ │ │ │
397
+ ▼ ▼ ▼
398
+ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
399
+ │ ti-guides │ │ alloy-guides │ │ alloy-howtos │
400
+ │ (SDK) │ │ (MVC) │ │ (CLI) │
401
+ └───────────────┘ └───────────────┘ └───────────────┘
402
+ ```
403
+
404
+ ---
405
+
406
+ ## Skill Details
407
+
408
+ ### alloy-expert
409
+
410
+ **The primary skill for Titanium Alloy development.** Start here for most tasks.
411
+
412
+ **When it activates:**
413
+ - Designing project structure
414
+ - Implementing controllers, views, services
415
+ - Choosing data strategies (Models vs Collections)
416
+ - Writing clean ES6+ code
417
+ - Memory management and cleanup patterns
418
+ - Performance optimization
419
+ - Security patterns
420
+ - Migrating legacy apps
421
+
422
+ **Example prompts:**
423
+ ```
424
+ "How should I structure a new Titanium Alloy app with authentication?"
425
+ "Create a user service that fetches data from an API"
426
+ "What's the best pattern for navigation between screens?"
427
+ "How do I prevent memory leaks in my controllers?"
428
+ "Migrate this classic Titanium code to modern Alloy patterns"
429
+ ```
430
+
431
+ **Key features:**
432
+ - PurgeTSS rules built-in (correct classes)
433
+ - Quick decision matrix for common questions
434
+ - 13 reference guides for deep dives
435
+ - Delegates to specialized skills when needed
436
+
437
+ ---
438
+
439
+ ### purgetss
440
+
441
+ **Utility-first styling toolkit for Titanium/Alloy.**
442
+
443
+ **When it activates:**
444
+ - Setting up PurgeTSS in a project
445
+ - Complex layouts (Grid system)
446
+ - Declarative animations (`<Animation>` component)
447
+ - Icon fonts (Font Awesome, Material Icons)
448
+ - Custom color palettes
449
+ - Platform-specific styling
450
+ - config.cjs configuration
451
+
452
+ **Example prompts:**
453
+ ```
454
+ "Set up PurgeTSS in my existing Alloy project"
455
+ "Create a responsive 12-column grid layout"
456
+ "Add a fade-in animation when my view appears"
457
+ "Configure custom colors in config.cjs"
458
+ "How do I use Font Awesome 7 icons?"
459
+ "Style this button differently on iOS vs Android"
460
+ ```
461
+
462
+ **Critical rules:**
463
+ - **Platform-specific properties REQUIRE modifiers** (e.g., `[platform=ios]`) to prevent cross-platform build failures
464
+ - NO flexbox (`flex-row`, `justify-between`) → use `horizontal`/`vertical`
465
+ - NO `w-full` → use `w-screen`
466
+ - NO `p-*` on Views → use `m-*` on children
467
+ - Arbitrary values use parentheses: `w-(100px)`, NOT `w-[100px]`
468
+
469
+ ---
470
+
471
+ ### ti-ui
472
+
473
+ **UI/UX expert for layouts and platform components.**
474
+
475
+ **When it activates:**
476
+ - Layout systems (composite, vertical, horizontal)
477
+ - ListView/TableView optimization
478
+ - Event handling and bubbling
479
+ - Animations and transforms
480
+ - Gestures (swipe, pinch, longpress)
481
+ - Orientation handling
482
+ - App icons and splash screens
483
+ - Android Action Bar / iOS Navigation patterns
484
+ - Accessibility (VoiceOver, TalkBack)
485
+
486
+ **Example prompts:**
487
+ ```
488
+ "Create a high-performance ListView with custom templates"
489
+ "Handle swipe gestures on table rows"
490
+ "Set up app icons for all iOS and Android densities"
491
+ "Implement pull-to-refresh on a ScrollView"
492
+ "Make my app accessible for VoiceOver users"
493
+ "Configure the Android Action Bar with custom menu items"
494
+ ```
495
+
496
+ **Key rules:**
497
+ - NO `Ti.UI.SIZE` in ListView items (causes jerky scrolling)
498
+ - Prefer ListView over TableView for large datasets
499
+ - Use `dp` units for cross-platform consistency
500
+ - Remove global listeners on pause
501
+
502
+ ---
503
+
504
+ ### ti-howtos
505
+
506
+ **Native feature integration expert.**
507
+
508
+ **When it activates:**
509
+ - Location services and Maps
510
+ - Push notifications (APNs/FCM)
511
+ - Local notifications
512
+ - Camera and Gallery
513
+ - Audio/Video playback
514
+ - File system operations
515
+ - SQLite databases
516
+ - HTTPClient networking
517
+ - WebView integration
518
+ - Android Intents and Services
519
+ - iOS Background Services, iCloud, Keychain
520
+ - Core Motion, WatchKit
521
+
522
+ **Example prompts:**
523
+ ```
524
+ "Implement battery-efficient GPS tracking"
525
+ "Set up push notifications for iOS and Android"
526
+ "Capture and resize photos from the camera"
527
+ "Download files with progress indicator"
528
+ "Store sensitive data in iOS Keychain"
529
+ "Create an Android background service"
530
+ "Integrate with Apple Watch using WatchKit"
531
+ ```
532
+
533
+ **Key rules:**
534
+ - Always handle both `onload` and `onerror` for HTTPClient
535
+ - Always close database handles and result sets
536
+ - Use `imageAsResized` to avoid memory exhaustion
537
+ - Configure proper permissions in tiapp.xml
538
+
539
+ ---
540
+
541
+ ### ti-guides
542
+
543
+ **SDK fundamentals and advanced configuration.**
544
+
545
+ **When it activates:**
546
+ - Hyperloop native access
547
+ - Native module development
548
+ - App distribution (Play Store, App Store)
549
+ - tiapp.xml configuration
550
+ - CLI commands and options
551
+ - Memory and bridge optimization
552
+ - CommonJS module patterns
553
+ - Coding best practices
554
+
555
+ **Example prompts:**
556
+ ```
557
+ "Access native iOS APIs using Hyperloop"
558
+ "Configure tiapp.xml for production build"
559
+ "Prepare my app for Google Play submission"
560
+ "Create a native Android module"
561
+ "Optimize bridge crossings for better performance"
562
+ "What are the reserved words I should avoid?"
563
+ ```
564
+
565
+ ---
566
+
567
+ ### alloy-guides
568
+
569
+ **Complete Alloy MVC framework reference.**
570
+
571
+ **When it activates:**
572
+ - MVC architecture concepts
573
+ - Backbone.js models and collections
574
+ - Data binding patterns
575
+ - XML markup elements
576
+ - TSS styling syntax
577
+ - Widget development
578
+ - Sync adapters (sql, properties)
579
+ - Migrations
580
+
581
+ **Example prompts:**
582
+ ```
583
+ "Explain how Alloy data binding works"
584
+ "Create a model with SQLite adapter"
585
+ "Bind a collection to a TableView"
586
+ "Build a reusable widget"
587
+ "What's the TSS syntax for platform-specific styles?"
588
+ "How does the Alloy compilation process work?"
589
+ ```
590
+
591
+ ---
592
+
593
+ ### alloy-howtos
594
+
595
+ **Alloy CLI, configuration, and debugging.**
596
+
597
+ **When it activates:**
598
+ - Alloy CLI commands (new, generate, compile)
599
+ - Configuration files (alloy.jmk, config.json)
600
+ - Debugging compilation errors
601
+ - Conditional views
602
+ - Custom XML tags
603
+ - Best practices and naming conventions
604
+ - Backbone.Events patterns
605
+
606
+ **Example prompts:**
607
+ ```
608
+ "Generate a new model with CLI"
609
+ "Configure alloy.jmk build hooks"
610
+ "Fix 'No app.js found' error"
611
+ "Create conditional views based on user state"
612
+ "Build a custom XML tag without widgets"
613
+ "Set up Backbone.Events for global communication"
614
+ ```
615
+
616
+ **Key rules:**
617
+ - Use Backbone.Events instead of Ti.App.fireEvent
618
+ - Never use double underscore prefixes (`__foo`)
619
+ - Access config at runtime with `Alloy.CFG.yourKey`
620
+
621
+ ---
622
+
623
+ ## Usage Examples
624
+
625
+ ### Starting a New Project
626
+ ```
627
+ "I'm starting a new Titanium Alloy app for a food delivery service.
628
+ Help me set up the project structure."
629
+ ```
630
+
631
+ ### UI Development
632
+ ```
633
+ "Create a product listing screen with:
634
+ - Pull-to-refresh
635
+ - Infinite scroll pagination
636
+ - Image caching
637
+ - Swipe-to-delete"
638
+ ```
639
+
640
+ ### API Integration
641
+ ```
642
+ "Build a complete authentication flow:
643
+ - Login/Register screens
644
+ - JWT token management
645
+ - Secure storage
646
+ - Auto-refresh tokens"
647
+ ```
648
+
649
+ ### Performance Optimization
650
+ ```
651
+ "My app is slow. The ListView scrolls poorly and
652
+ the app uses too much memory. Help me optimize it."
653
+ ```
654
+
655
+ ### Migration
656
+ ```
657
+ "I have a legacy Titanium classic app from 2015.
658
+ Help me migrate it to modern Alloy with PurgeTSS."
659
+ ```
660
+
661
+ ### Platform-Specific Features
662
+ ```
663
+ "Implement Apple Sign-In for iOS and Google Sign-In for Android"
664
+ ```
665
+
666
+ ### Debugging
667
+ ```
668
+ "I'm getting 'Alloy is not defined' in my lib file. How do I fix it?"
669
+ ```
670
+
671
+ ### Codebase Analysis (Using Agent)
672
+ ```
673
+ "Use the ti-researcher agent to analyze this project:
674
+ - Review the overall architecture
675
+ - Identify memory leak patterns
676
+ - Check for PurgeTSS anti-patterns
677
+ - Suggest improvements"
678
+ ```
679
+
680
+ ---
681
+
682
+ ## Best Practices
683
+
684
+ ### 1. Be Specific
685
+ Instead of: "Make a list"
686
+ Try: "Create a ListView with user avatars, names, and swipe actions"
687
+
688
+ ### 2. Provide Context
689
+ Instead of: "Fix the error"
690
+ Try: "I'm getting this error when compiling: [error message]. Here's my code: [code]"
691
+
692
+ ### 3. Ask for Architecture First
693
+ For complex features, start with:
694
+ "How should I architect a real-time chat feature?"
695
+ Then follow up with implementation details.
696
+
697
+ ### 4. Mention Constraints
698
+ "Build a settings screen. Must work offline and sync when connected."
699
+
700
+ ### 5. Reference Existing Code
701
+ "Here's my current controller. How can I improve memory management?"
702
+
703
+ > **More examples:** See [Example Prompts](docs/EXAMPLE-PROMPTS.md) for detailed prompts that test each skill's capabilities.
704
+
705
+ ---
706
+
707
+ ## Skill Contents Summary
708
+
709
+ | Skill | SKILL.md | References |
710
+ | ------------ | ----------------------------- | ----------------------------------------------------- |
711
+ | alloy-expert | Architecture + Implementation | 14 files (patterns, testing, security, assets, etc.) |
712
+ | purgetss | Setup + Critical Rules | 17 files (grid, animations, icons, class-index, etc.) |
713
+ | ti-ui | UI Rules + Platform Diffs | 13 files (layouts, lists, gestures, etc.) |
714
+ | ti-howtos | Integration Workflow | 12 files (location, media, maps, automation, etc.) |
715
+ | ti-guides | Core Workflow | 10 files (hyperloop, distribution, etc.) |
716
+ | alloy-guides | MVC Quick Start | 10 files (models, views, widgets, etc.) |
717
+ | alloy-howtos | Best Practices | 6 files (CLI, config, debugging, etc.) |
718
+
719
+ ---
720
+
721
+ ## Troubleshooting
722
+
723
+ ### Skill Not Activating?
724
+
725
+ If the AI doesn't seem to use Titanium knowledge:
726
+ 1. Mention "Titanium" or "Alloy" explicitly in your prompt
727
+ 2. Be more specific about what you're building
728
+ 3. Reference the technology stack
729
+ 4. Try explicit invocation: "Use the purgetss skill for styling questions"
730
+
731
+ ### Getting Wrong Suggestions?
732
+
733
+ If the AI suggests patterns you don't use (e.g., PurgeTSS when you're not using it):
734
+ 1. The skill may not have detected your project type correctly
735
+ 2. Explicitly mention your stack: "I'm using Classic Titanium, not Alloy"
736
+ 3. Be more specific about what you're building
737
+
738
+ ### PurgeTSS Not Detected?
739
+
740
+ If the purgetss skill doesn't activate for your PurgeTSS project:
741
+ 1. Verify `purgetss/` folder exists in project root
742
+ 2. Check that `purgetss/config.cjs` exists
743
+ 3. Mention "PurgeTSS" explicitly in your prompt
744
+
745
+ ### Wrong Advice?
746
+
747
+ If the AI suggests incorrect patterns (like flexbox):
748
+ 1. Remind it you're using PurgeTSS
749
+ 2. Reference the correct pattern from memory
750
+ 3. Ask to check the PurgeTSS rules
751
+
752
+ ### Need More Detail?
753
+
754
+ Ask the AI to:
755
+ ```
756
+ "Show me the reference documentation for ListView performance"
757
+ "What does the alloy-expert skill say about memory cleanup?"
758
+ ```
759
+
760
+ ---
761
+
762
+ ## AGENTS.md Troubleshooting
763
+
764
+ ### AGENTS.md Not Working?
765
+
766
+ If your AI assistant doesn't seem to use the AGENTS.md information:
767
+ 1. Verify AGENTS.md exists in your project root
768
+ 2. Check that your AI assistant supports AGENTS.md (Claude Code does)
769
+ 3. Try explicitly referencing it: "Check the AGENTS.md documentation for this"
770
+
771
+ ### ti-docs-index / titools agents Command Not Found?
772
+
773
+ If the command is not found:
774
+
775
+ **NPM installation:**
776
+ 1. Verify NPM installation: `npm list -g @maccesar/titanium-skills`
777
+ 2. Check if command exists: `which titools`
778
+ 3. Re-run: `npm install -g @maccesar/titanium-skills`
779
+
780
+ **Bash installation:**
781
+ 1. Verify full installation was used (not `npx skills add`)
782
+ 2. Check if command exists: `which ti-docs-index`
783
+ 3. Re-run installer: `curl -fsSL https://raw.githubusercontent.com/macCesar/titools/main/legacy/install.sh | bash`
784
+
785
+ ### Version Mismatch Warning?
786
+
787
+ If you see a version mismatch warning:
788
+ 1. Check your Titanium SDK version: `grep -A 1 "<sdk-version>" tiapp.xml`
789
+ 2. AGENTS.md is based on the latest documentation
790
+ 3. Be cautious when using newer APIs in older projects
791
+ 4. Consult official docs for your version: https://titaniumsdk.com/guide
792
+
793
+ ---
794
+
795
+ ## Uninstall
796
+
797
+ ```bash
798
+ npm uninstall -g @maccesar/titools
799
+ ```
800
+
801
+ Then manually remove the installed files:
802
+
803
+ ```bash
804
+ # Remove skill symlinks from all platforms
805
+ rm -rf ~/.claude/skills/{alloy-expert,purgetss,ti-ui,ti-howtos,ti-guides,alloy-guides,alloy-howtos}
806
+ rm -rf ~/.gemini/skills/{alloy-expert,purgetss,ti-ui,ti-howtos,ti-guides,alloy-guides,alloy-howtos}
807
+ rm -rf ~/.codex/skills/{alloy-expert,purgetss,ti-ui,ti-howtos,ti-guides,alloy-guides,alloy-howtos}
808
+
809
+ # Remove agent from Claude Code
810
+ rm -f ~/.claude/agents/ti-researcher.md
811
+
812
+ # Remove Titanium SDK skills from central directory
813
+ rm -rf ~/.agents/skills
814
+ ```
815
+
816
+ **Note:** AGENTS.md/CLAUDE.md/GEMINI.md files in your projects are NOT removed automatically. To remove them from a specific project:
817
+
818
+ ```bash
819
+ rm -f /path/to/your/project/AGENTS.md
820
+ rm -f /path/to/your/project/CLAUDE.md
821
+ rm -f /path/to/your/project/GEMINI.md
822
+ ```
823
+ ```
824
+
825
+ **Note:** AGENTS.md/CLAUDE.md/GEMINI.md files in your projects are NOT removed automatically. To remove them from a specific project:
826
+
827
+ ```bash
828
+ rm -f /path/to/your/project/AGENTS.md
829
+ rm -f /path/to/your/project/CLAUDE.md
830
+ rm -f /path/to/your/project/GEMINI.md
831
+ ```
832
+
833
+ ---
834
+
835
+ ## Contributing
836
+
837
+ 1. Fork the repository
838
+ 2. Improve SKILL.md or reference files
839
+ 3. Test with your preferred AI coding assistant
840
+ 4. Submit a pull request
841
+
842
+ ### Guidelines
843
+ - Keep SKILL.md concise (<500 lines)
844
+ - Use progressive disclosure (details in references)
845
+ - Include concrete examples
846
+ - Test with real sessions
847
+
848
+ ---
849
+
850
+ ## Credits
851
+
852
+ Created by **César Estrada** ([@macCesar](https://github.com/macCesar)), creator of [PurgeTSS](https://github.com/macCesar/purgeTSS).
853
+
854
+ ## License
855
+
856
+ MIT License - Free to use, modify, and distribute.
857
+
858
+ ---
859
+
860
+ ## Resources
861
+
862
+ - [Titanium SDK](https://titaniumsdk.com/)
863
+ - [PurgeTSS](https://purgetss.com/)
864
+ - [TiDev Community](https://tidev.io/)
865
+ - [Claude Code Skills](https://docs.anthropic.com/en/docs/claude-code)
866
+ - [Gemini CLI Skills](https://geminicli.com/docs/cli/skills/)
867
+ - [Codex CLI Skills](https://developers.openai.com/codex/skills/)