@maccesar/titools 2.5.1 → 2.6.1

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 (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +83 -5
  3. package/bin/titools.js +8 -0
  4. package/lib/commands/list.js +105 -0
  5. package/lib/config.js +1 -0
  6. package/package.json +1 -1
  7. package/skills/alloy-guides/SKILL.md +1 -1
  8. package/skills/alloy-howtos/SKILL.md +1 -1
  9. package/skills/purgetss/SKILL.md +1 -1
  10. package/skills/ti-api/SKILL.md +1 -1
  11. package/skills/ti-branding/SKILL.md +225 -0
  12. package/skills/ti-branding/assets/ic_launcher.xml +6 -0
  13. package/skills/ti-branding/references/android-adaptive-icons.md +85 -0
  14. package/skills/ti-branding/references/cleanup-legacy.md +112 -0
  15. package/skills/ti-branding/references/ios-appiconset.md +62 -0
  16. package/skills/ti-branding/references/master-input-guidelines.md +84 -0
  17. package/skills/ti-branding/references/notification-icons.md +63 -0
  18. package/skills/ti-branding/references/splash-screen-api.md +81 -0
  19. package/skills/ti-branding/references/ti-icon-paths.md +84 -0
  20. package/skills/ti-branding/references/tiapp-xml-snippets.md +92 -0
  21. package/skills/ti-branding/scripts/lib/cleanup-legacy.sh +230 -0
  22. package/skills/ti-branding/scripts/lib/deps.sh +58 -0
  23. package/skills/ti-branding/scripts/lib/gen-android-adaptive.sh +52 -0
  24. package/skills/ti-branding/scripts/lib/gen-android-legacy.sh +36 -0
  25. package/skills/ti-branding/scripts/lib/gen-ios.sh +30 -0
  26. package/skills/ti-branding/scripts/lib/gen-marketplace.sh +40 -0
  27. package/skills/ti-branding/scripts/lib/gen-notification.sh +34 -0
  28. package/skills/ti-branding/scripts/lib/gen-splash-icon.sh +31 -0
  29. package/skills/ti-branding/scripts/lib/prepare-master.sh +48 -0
  30. package/skills/ti-branding/scripts/lib/validate.sh +67 -0
  31. package/skills/ti-branding/scripts/ti-branding +462 -0
  32. package/skills/ti-expert/SKILL.md +1 -1
  33. package/skills/ti-guides/SKILL.md +1 -1
  34. package/skills/ti-howtos/SKILL.md +1 -1
  35. package/skills/ti-ui/SKILL.md +1 -1
@@ -0,0 +1,462 @@
1
+ #!/usr/bin/env bash
2
+ # ti-branding — generate icon and splash assets for Titanium SDK 13.x projects.
3
+ # Entry point. Parses args, validates, and delegates to lib/ scripts.
4
+
5
+ set -euo pipefail
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ LIB_DIR="$SCRIPT_DIR/lib"
9
+ ASSETS_DIR="$(cd "$SCRIPT_DIR/../assets" && pwd)"
10
+
11
+ # shellcheck source=lib/deps.sh
12
+ source "$LIB_DIR/deps.sh"
13
+ # shellcheck source=lib/validate.sh
14
+ source "$LIB_DIR/validate.sh"
15
+ # shellcheck source=lib/prepare-master.sh
16
+ source "$LIB_DIR/prepare-master.sh"
17
+ # shellcheck source=lib/gen-ios.sh
18
+ source "$LIB_DIR/gen-ios.sh"
19
+ # shellcheck source=lib/gen-android-adaptive.sh
20
+ source "$LIB_DIR/gen-android-adaptive.sh"
21
+ # shellcheck source=lib/gen-android-legacy.sh
22
+ source "$LIB_DIR/gen-android-legacy.sh"
23
+ # shellcheck source=lib/gen-marketplace.sh
24
+ source "$LIB_DIR/gen-marketplace.sh"
25
+ # shellcheck source=lib/cleanup-legacy.sh
26
+ source "$LIB_DIR/cleanup-legacy.sh"
27
+ # shellcheck source=lib/gen-notification.sh
28
+ source "$LIB_DIR/gen-notification.sh"
29
+ # shellcheck source=lib/gen-splash-icon.sh
30
+ source "$LIB_DIR/gen-splash-icon.sh"
31
+
32
+ # -----------------------------------------------------------------------------
33
+ # Defaults
34
+ # -----------------------------------------------------------------------------
35
+
36
+ MASTER=""
37
+ BG_COLOR="#FFFFFF"
38
+ PADDING=22
39
+ IOS_PADDING=8
40
+ WITH_NOTIFICATION=0
41
+ WITH_SPLASH_ICON=0
42
+ CLEANUP_LEGACY=0
43
+ AGGRESSIVE=0
44
+ OUTPUT=""
45
+ DRY_RUN=0
46
+ PROJECT_ROOT="$(pwd)"
47
+
48
+ # -----------------------------------------------------------------------------
49
+ # Colored output helpers
50
+ # -----------------------------------------------------------------------------
51
+
52
+ if [[ -t 1 ]]; then
53
+ C_RED=$'\033[31m'; C_GREEN=$'\033[32m'; C_YELLOW=$'\033[33m'
54
+ C_BLUE=$'\033[34m'; C_DIM=$'\033[2m'; C_BOLD=$'\033[1m'; C_RESET=$'\033[0m'
55
+ else
56
+ C_RED=''; C_GREEN=''; C_YELLOW=''; C_BLUE=''; C_DIM=''; C_BOLD=''; C_RESET=''
57
+ fi
58
+
59
+ log_info() { echo "${C_BLUE}ℹ${C_RESET} $*"; }
60
+ log_ok() { echo "${C_GREEN}✓${C_RESET} $*"; }
61
+ log_warn() { echo "${C_YELLOW}⚠${C_RESET} $*" >&2; }
62
+ log_err() { echo "${C_RED}✗${C_RESET} $*" >&2; }
63
+ log_step() { echo; echo "${C_BOLD}==>${C_RESET} $*"; }
64
+
65
+ export C_RED C_GREEN C_YELLOW C_BLUE C_DIM C_BOLD C_RESET
66
+ export -f log_info log_ok log_warn log_err log_step
67
+
68
+ # -----------------------------------------------------------------------------
69
+ # Usage
70
+ # -----------------------------------------------------------------------------
71
+
72
+ usage() {
73
+ cat <<'EOF'
74
+ ti-branding — generate branding assets for Titanium SDK 13.x projects.
75
+
76
+ USAGE:
77
+ ti-branding <master> [options]
78
+
79
+ ARGUMENTS:
80
+ <master> Path to master image (SVG or PNG ≥ 1024×1024).
81
+
82
+ OPTIONS:
83
+ --bg-color <hex> Background color for adaptive layer + iOS alpha flatten.
84
+ Default: #FFFFFF
85
+ --padding <pct> Android safe-zone padding per side (0–40). Default: 22
86
+ (Android official minimum is 19.44%.)
87
+ --ios-padding <pct> iOS/marketplace aesthetic padding per side (0–40).
88
+ Default: 8. iOS icons have no launcher mask — this
89
+ is purely breathing room around the logo.
90
+ --with-notification Also generate ic_stat_notify.png × 5 densities.
91
+ --with-splash-icon Also generate splash_icon.png × 5 densities (Android 12+).
92
+ --cleanup-legacy After generating (or standalone), remove legacy branding
93
+ artifacts detected via tiapp.xml analysis. Safe by default —
94
+ context-aware, always prints a plan before deleting.
95
+ --aggressive With --cleanup-legacy, also remove ldpi density folders
96
+ (<1% global market in 2026). Off by default.
97
+ --output <dir> Staging directory. Default: <project>/.ti-branding
98
+ --project <dir> Project root (default: current working directory).
99
+ --dry-run Print what would be generated without writing files.
100
+ -h, --help Show this help.
101
+
102
+ EXAMPLES:
103
+ ti-branding ./logo.svg
104
+ ti-branding ./logo.png --bg-color "#0B1326" --padding 22
105
+ ti-branding ./docs/snap-logo.svg --bg-color "#0B1326" --with-notification --with-splash-icon
106
+ EOF
107
+ }
108
+
109
+ # -----------------------------------------------------------------------------
110
+ # Parse args
111
+ # -----------------------------------------------------------------------------
112
+
113
+ while [[ $# -gt 0 ]]; do
114
+ case "$1" in
115
+ -h|--help) usage; exit 0 ;;
116
+ --bg-color) BG_COLOR="$2"; shift 2 ;;
117
+ --padding) PADDING="$2"; shift 2 ;;
118
+ --ios-padding) IOS_PADDING="$2"; shift 2 ;;
119
+ --with-notification) WITH_NOTIFICATION=1; shift ;;
120
+ --with-splash-icon) WITH_SPLASH_ICON=1; shift ;;
121
+ --cleanup-legacy) CLEANUP_LEGACY=1; shift ;;
122
+ --aggressive) AGGRESSIVE=1; shift ;;
123
+ --output) OUTPUT="$2"; shift 2 ;;
124
+ --project) PROJECT_ROOT="$2"; shift 2 ;;
125
+ --dry-run) DRY_RUN=1; shift ;;
126
+ --) shift; break ;;
127
+ -*) log_err "Unknown option: $1"; usage >&2; exit 2 ;;
128
+ *)
129
+ if [[ -z "$MASTER" ]]; then
130
+ MASTER="$1"; shift
131
+ else
132
+ log_err "Unexpected positional argument: $1"; exit 2
133
+ fi
134
+ ;;
135
+ esac
136
+ done
137
+
138
+ # -----------------------------------------------------------------------------
139
+ # Validate args
140
+ # -----------------------------------------------------------------------------
141
+
142
+ # Cleanup-only mode: master image is optional when --cleanup-legacy is set alone.
143
+ if [[ -z "$MASTER" && $CLEANUP_LEGACY -eq 0 ]]; then
144
+ log_err "Master image path is required (unless using --cleanup-legacy alone)."
145
+ usage >&2
146
+ exit 2
147
+ fi
148
+
149
+ if [[ -n "$MASTER" && ! -f "$MASTER" ]]; then
150
+ log_err "Master image not found: $MASTER"
151
+ exit 2
152
+ fi
153
+
154
+ # Resolve to absolute path
155
+ if [[ -n "$MASTER" ]]; then
156
+ MASTER="$(cd "$(dirname "$MASTER")" && pwd)/$(basename "$MASTER")"
157
+ fi
158
+ PROJECT_ROOT="$(cd "$PROJECT_ROOT" && pwd)"
159
+
160
+ if [[ "$PADDING" -lt 0 || "$PADDING" -gt 40 ]]; then
161
+ log_err "Padding must be between 0 and 40 (got: $PADDING)."
162
+ exit 2
163
+ fi
164
+
165
+ if [[ "$IOS_PADDING" -lt 0 || "$IOS_PADDING" -gt 40 ]]; then
166
+ log_err "iOS padding must be between 0 and 40 (got: $IOS_PADDING)."
167
+ exit 2
168
+ fi
169
+
170
+ if [[ ! "$BG_COLOR" =~ ^#[0-9A-Fa-f]{6}$ ]]; then
171
+ log_err "--bg-color must be a 6-digit hex like #0B1326 (got: $BG_COLOR)."
172
+ exit 2
173
+ fi
174
+
175
+ OUTPUT="${OUTPUT:-$PROJECT_ROOT/.ti-branding}"
176
+
177
+ # -----------------------------------------------------------------------------
178
+ # Detect project layout
179
+ # -----------------------------------------------------------------------------
180
+
181
+ PROJECT_TYPE="unknown"
182
+ if [[ -d "$PROJECT_ROOT/app" ]]; then
183
+ PROJECT_TYPE="alloy"
184
+ elif [[ -d "$PROJECT_ROOT/Resources" ]]; then
185
+ PROJECT_TYPE="classic"
186
+ fi
187
+
188
+ log_step "ti-branding — Titanium SDK 13.x"
189
+ log_info "Project: $PROJECT_ROOT ($PROJECT_TYPE)"
190
+ if [[ -n "$MASTER" ]]; then
191
+ log_info "Master: $MASTER"
192
+ log_info "Background: $BG_COLOR"
193
+ log_info "Padding: Android ${PADDING}% / iOS ${IOS_PADDING}% per side"
194
+ log_info "Staging: $OUTPUT"
195
+ fi
196
+ [[ $WITH_NOTIFICATION -eq 1 ]] && log_info "Extras: + notification icons"
197
+ [[ $WITH_SPLASH_ICON -eq 1 ]] && log_info "Extras: + Android 12+ splash icon"
198
+ [[ $CLEANUP_LEGACY -eq 1 ]] && log_info "Cleanup: --cleanup-legacy$([[ $AGGRESSIVE -eq 1 ]] && echo " --aggressive")"
199
+ [[ $DRY_RUN -eq 1 ]] && log_warn "DRY RUN — no files will be written"
200
+
201
+ # -----------------------------------------------------------------------------
202
+ # Cleanup-only mode — skip all generation steps
203
+ # -----------------------------------------------------------------------------
204
+
205
+ if [[ -z "$MASTER" && $CLEANUP_LEGACY -eq 1 ]]; then
206
+ log_step "Cleanup-only mode"
207
+ cleanup_legacy "$PROJECT_ROOT" "$PROJECT_TYPE" "$AGGRESSIVE" "$DRY_RUN"
208
+ exit 0
209
+ fi
210
+
211
+ if [[ "$PROJECT_TYPE" == "unknown" ]]; then
212
+ log_warn "Could not detect project layout. Expected 'app/' (Alloy) or 'Resources/' (Classic)."
213
+ log_warn "Assets will be generated under '$OUTPUT/standalone/' so you can copy them manually."
214
+ fi
215
+
216
+ # -----------------------------------------------------------------------------
217
+ # Pipeline
218
+ # -----------------------------------------------------------------------------
219
+
220
+ log_step "1/6 Checking dependencies"
221
+ check_deps "$MASTER"
222
+
223
+ log_step "2/6 Validating master"
224
+ validate_master "$MASTER"
225
+
226
+ log_step "3/6 Preparing masters (square for iOS, tight for Android)"
227
+ PREPARED_BASE="$OUTPUT/_master"
228
+ MASTER_SQUARE="${PREPARED_BASE}_square.png"
229
+ MASTER_TIGHT="${PREPARED_BASE}_tight.png"
230
+ if [[ $DRY_RUN -eq 0 ]]; then
231
+ mkdir -p "$OUTPUT"
232
+ prepare_master "$MASTER" "$PREPARED_BASE"
233
+ log_ok "Square master: $MASTER_SQUARE"
234
+ log_ok "Tight master: $MASTER_TIGHT"
235
+ else
236
+ log_info "[dry-run] would prepare: $MASTER_SQUARE + $MASTER_TIGHT"
237
+ fi
238
+
239
+ # Resolve target paths based on project layout
240
+ case "$PROJECT_TYPE" in
241
+ alloy) ANDROID_RES="$OUTPUT/app/platform/android/res" ;;
242
+ classic) ANDROID_RES="$OUTPUT/platform/android/res" ;;
243
+ *) ANDROID_RES="$OUTPUT/standalone/platform/android/res" ;;
244
+ esac
245
+ ROOT_STAGING="$OUTPUT"
246
+
247
+ log_step "4/6 Generating iOS master + marketplace artwork (square)"
248
+ if [[ $DRY_RUN -eq 0 ]]; then
249
+ gen_ios "$MASTER_TIGHT" "$BG_COLOR" "$IOS_PADDING" "$ROOT_STAGING"
250
+ gen_marketplace "$MASTER_TIGHT" "$BG_COLOR" "$IOS_PADDING" "$ROOT_STAGING"
251
+ else
252
+ log_info "[dry-run] would emit DefaultIcon-ios.png, iTunesConnect.png, MarketplaceArtwork.png"
253
+ fi
254
+
255
+ log_step "5/6 Generating Android adaptive + legacy launcher icons (tight)"
256
+ if [[ $DRY_RUN -eq 0 ]]; then
257
+ gen_android_adaptive "$MASTER_TIGHT" "$BG_COLOR" "$PADDING" "$ANDROID_RES"
258
+ gen_android_legacy "$MASTER_TIGHT" "$BG_COLOR" "$PADDING" "$ANDROID_RES"
259
+ cp "$ASSETS_DIR/ic_launcher.xml" "$ANDROID_RES/mipmap-anydpi-v26/ic_launcher.xml"
260
+ log_ok "Adaptive icon XML bind: $ANDROID_RES/mipmap-anydpi-v26/ic_launcher.xml"
261
+ else
262
+ log_info "[dry-run] would emit adaptive + legacy icons × 5 densities"
263
+ fi
264
+
265
+ if [[ $WITH_NOTIFICATION -eq 1 || $WITH_SPLASH_ICON -eq 1 ]]; then
266
+ log_step "6/6 Generating optional extras"
267
+ if [[ $WITH_NOTIFICATION -eq 1 && $DRY_RUN -eq 0 ]]; then
268
+ gen_notification "$MASTER_TIGHT" "$PADDING" "$ANDROID_RES"
269
+ elif [[ $WITH_NOTIFICATION -eq 1 ]]; then
270
+ log_info "[dry-run] would emit ic_stat_notify.png × 5 densities"
271
+ fi
272
+ if [[ $WITH_SPLASH_ICON -eq 1 && $DRY_RUN -eq 0 ]]; then
273
+ gen_splash_icon "$MASTER_TIGHT" "$ANDROID_RES"
274
+ elif [[ $WITH_SPLASH_ICON -eq 1 ]]; then
275
+ log_info "[dry-run] would emit splash_icon.png × 5 densities"
276
+ fi
277
+ else
278
+ log_step "6/6 (skipped — no optional extras requested)"
279
+ fi
280
+
281
+ if [[ $CLEANUP_LEGACY -eq 1 ]]; then
282
+ log_step "Cleanup legacy artifacts"
283
+ cleanup_legacy "$PROJECT_ROOT" "$PROJECT_TYPE" "$AGGRESSIVE" "$DRY_RUN"
284
+ fi
285
+
286
+ log_step "Done"
287
+ if [[ $DRY_RUN -eq 0 ]]; then
288
+ log_ok "All assets staged at: $OUTPUT"
289
+
290
+ # ---------------------------------------------------------------------------
291
+ # Post-generation notes (aclaraciones) — help the user understand what was
292
+ # made, how to adjust, and what tiapp.xml glue is still needed.
293
+ # ---------------------------------------------------------------------------
294
+
295
+ echo
296
+ echo "${C_BOLD}Notes on what was generated${C_RESET}"
297
+ echo
298
+ echo " • Brand color ${BG_COLOR} was baked into Android adaptive background layer"
299
+ echo " and iOS/marketplace flattened masters (Apple rejects alpha)."
300
+ echo " • Android padding: ${PADDING}% (logo fills $((100 - 2 * PADDING))% of each mipmap canvas)"
301
+ echo " • iOS padding: ${IOS_PADDING}% (logo fills $((100 - 2 * IOS_PADDING))% of DefaultIcon-ios and marketplace art)"
302
+ echo
303
+ echo " If the logo looks ${C_DIM}pegado / cramped${C_RESET}: re-run with higher padding"
304
+ echo " --padding ${C_YELLOW}25-30${C_RESET} (Android)"
305
+ echo " --ios-padding ${C_YELLOW}10-14${C_RESET} (iOS)"
306
+ echo
307
+ echo " If the logo looks ${C_DIM}too small / lost${C_RESET}: re-run with lower padding"
308
+ echo " --padding ${C_YELLOW}19${C_RESET} (Android spec floor)"
309
+ echo " --ios-padding ${C_YELLOW}4-6${C_RESET} (iOS)"
310
+
311
+ echo
312
+ echo "${C_BOLD}Configuration reminders${C_RESET}"
313
+ echo " ${C_DIM}The skill does NOT auto-create XML resource files or edit tiapp.xml.${C_RESET}"
314
+ echo " ${C_DIM}Every snippet below is optional — paste only what you need, after reviewing.${C_RESET}"
315
+ echo
316
+ echo " ${C_YELLOW}⚠${C_RESET} ${C_BOLD}tiapp.xml <application> tag may be self-closing${C_RESET}"
317
+ echo " If yours looks like:"
318
+ echo " ${C_DIM}<application android:icon=\"@mipmap/ic_launcher\" .../>${C_RESET}"
319
+ echo " You must expand it BEFORE adding children:"
320
+ echo " ${C_DIM}<application android:icon=\"@mipmap/ic_launcher\" ...>${C_RESET}"
321
+ echo " ${C_DIM} <meta-data .../>${C_RESET}"
322
+ echo " ${C_DIM}</application>${C_RESET}"
323
+ echo
324
+ echo " ${C_BOLD}1. iOS launch background${C_RESET} — under ${C_YELLOW}<ios>${C_RESET} in tiapp.xml:"
325
+ echo " ${C_DIM}Matches your --bg-color to the launch storyboard.${C_RESET}"
326
+ cat <<EOF
327
+ <ios>
328
+ <enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>
329
+ <default-background-color>${BG_COLOR}</default-background-color>
330
+ </ios>
331
+ EOF
332
+ echo
333
+ echo " ${C_BOLD}2. Android launcher icon${C_RESET} — under ${C_YELLOW}<android><manifest><application>${C_RESET}:"
334
+ echo " ${C_DIM}Required for the adaptive icon you just generated to be used.${C_RESET}"
335
+ cat <<'EOF'
336
+ <application android:icon="@mipmap/ic_launcher"
337
+ android:usesCleartextTraffic="false"/>
338
+ EOF
339
+
340
+ if [[ $WITH_SPLASH_ICON -eq 1 ]]; then
341
+ case "$PROJECT_TYPE" in
342
+ alloy) SPLASH_DIR="app/platform/android/res/values-v31" ;;
343
+ classic) SPLASH_DIR="platform/android/res/values-v31" ;;
344
+ *) SPLASH_DIR="platform/android/res/values-v31" ;;
345
+ esac
346
+
347
+ echo
348
+ echo " ${C_BOLD}3. Android 12+ splash screen — READ FIRST${C_RESET}"
349
+ echo
350
+ echo " ${C_YELLOW}Titanium SDK 13.x already generates a splash screen automatically${C_RESET}"
351
+ echo " ${C_YELLOW}from your launcher icon + <default-background-color>.${C_RESET} For most apps,"
352
+ echo " the default is GOOD: the logo centered on your brand color, mask-aware."
353
+ echo
354
+ echo " The ${C_DIM}splash_icon.png${C_RESET} × 5 densities were generated for ADVANCED users who"
355
+ echo " want a custom splash icon distinct from the launcher icon. Wiring it up"
356
+ echo " requires a theme override, which has two flavors:"
357
+ echo
358
+ echo " ${C_BOLD}Option A — Native platform (API 31+ only, no lib needed)${C_RESET}"
359
+ echo " ${C_DIM}Simpler. Works without adding any Gradle dependency. API <31 falls back${C_RESET}"
360
+ echo " ${C_DIM}to Titanium's default splash (your launcher icon).${C_RESET}"
361
+ echo " ${C_DIM}Create ${SPLASH_DIR}/splash_theme.xml:${C_RESET}"
362
+ cat <<EOF
363
+ <?xml version="1.0" encoding="utf-8"?>
364
+ <resources>
365
+ <style name="Theme.App.SplashScreen" parent="@android:style/Theme.DeviceDefault.NoActionBar">
366
+ <item name="android:windowSplashScreenBackground">${BG_COLOR}</item>
367
+ <item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
368
+ </style>
369
+ </resources>
370
+ EOF
371
+ echo
372
+ echo " ${C_BOLD}Option B — androidx.core:core-splashscreen (works API 21+)${C_RESET}"
373
+ echo " ${C_DIM}More complete (backward-compat, postSplashScreenTheme handoff). Requires${C_RESET}"
374
+ echo " ${C_DIM}adding the androidx.core:core-splashscreen library as a Gradle dep, which${C_RESET}"
375
+ echo " ${C_DIM}Titanium 13.x does NOT ship by default. To add it, create/edit${C_RESET}"
376
+ echo " ${C_DIM}app/platform/android/build.gradle with:${C_RESET}"
377
+ cat <<'EOF'
378
+ dependencies {
379
+ implementation 'androidx.core:core-splashscreen:1.0.1'
380
+ }
381
+ EOF
382
+ echo " ${C_DIM}Then ${SPLASH_DIR}/splash_theme.xml uses the library theme:${C_RESET}"
383
+ cat <<EOF
384
+ <?xml version="1.0" encoding="utf-8"?>
385
+ <resources>
386
+ <style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
387
+ <item name="windowSplashScreenBackground">${BG_COLOR}</item>
388
+ <item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
389
+ <item name="postSplashScreenTheme">@style/Theme.AppDerived</item>
390
+ </style>
391
+ </resources>
392
+ EOF
393
+ echo
394
+ echo " ${C_BOLD}Either Option A or B needs this meta-data${C_RESET}"
395
+ echo " ${C_DIM}under <android><manifest><application> in tiapp.xml:${C_RESET}"
396
+ cat <<'EOF'
397
+ <meta-data android:name="io.tidev.titanium.splash.theme"
398
+ android:value="@style/Theme.App.SplashScreen"/>
399
+ EOF
400
+ echo
401
+ echo " ${C_YELLOW}⚠ CRITICAL${C_RESET}: NEVER set android:theme=\"@style/Theme.App.SplashScreen\""
402
+ echo " on ${C_BOLD}<application>${C_RESET} or any ${C_BOLD}<activity>${C_RESET}. That breaks the ActionBar in every"
403
+ echo " screen. The ${C_BOLD}meta-data${C_RESET} above is the ONLY correct way to register a splash"
404
+ echo " theme in Titanium."
405
+ echo
406
+ echo " ${C_DIM}Skipping the splash theme entirely is a valid choice — the launcher icon${C_RESET}"
407
+ echo " ${C_DIM}already provides a perfectly good Android 12+ splash via Titanium's default.${C_RESET}"
408
+ fi
409
+
410
+ if [[ $WITH_NOTIFICATION -eq 1 ]]; then
411
+ case "$PROJECT_TYPE" in
412
+ alloy) COLORS_DIR="app/platform/android/res/values" ;;
413
+ classic) COLORS_DIR="platform/android/res/values" ;;
414
+ *) COLORS_DIR="platform/android/res/values" ;;
415
+ esac
416
+ echo
417
+ echo " ${C_BOLD}4. FCM notification icon + tint${C_RESET}"
418
+ echo " ${C_DIM}Only needed if you use firebase.cloudmessaging for push. The white-on-${C_RESET}"
419
+ echo " ${C_DIM}transparent icon was generated; you still need to wire it.${C_RESET}"
420
+ echo
421
+ echo " ${C_DIM}Create ${COLORS_DIR}/colors.xml (if missing) or merge into existing:${C_RESET}"
422
+ cat <<EOF
423
+ <?xml version="1.0" encoding="utf-8"?>
424
+ <resources>
425
+ <color name="notification_tint">${BG_COLOR}</color>
426
+ </resources>
427
+ EOF
428
+ echo
429
+ echo " ${C_DIM}Then under <android><manifest><application> in tiapp.xml:${C_RESET}"
430
+ cat <<'EOF'
431
+ <meta-data android:name="com.google.firebase.messaging.default_notification_icon"
432
+ android:resource="@drawable/ic_stat_notify"/>
433
+ <meta-data android:name="com.google.firebase.messaging.default_notification_color"
434
+ android:resource="@color/notification_tint"/>
435
+ EOF
436
+ fi
437
+
438
+ echo
439
+ echo "${C_BOLD}Next steps${C_RESET}"
440
+ echo
441
+ echo " 1. Preview in ${C_YELLOW}Preview.app${C_RESET} (never use ${C_DIM}open${C_RESET} without -a — triggers heavy editors)"
442
+ case "$PROJECT_TYPE" in
443
+ alloy)
444
+ echo " 2. If good, copy to project:"
445
+ echo " cp $OUTPUT/DefaultIcon-ios.png $OUTPUT/iTunesConnect.png $OUTPUT/MarketplaceArtwork.png $PROJECT_ROOT/"
446
+ echo " cp -R $OUTPUT/app/platform/android/res/. $PROJECT_ROOT/app/platform/android/res/"
447
+ ;;
448
+ classic)
449
+ echo " 2. If good, copy to project:"
450
+ echo " cp $OUTPUT/DefaultIcon-ios.png $OUTPUT/iTunesConnect.png $OUTPUT/MarketplaceArtwork.png $PROJECT_ROOT/"
451
+ echo " cp -R $OUTPUT/platform/android/res/. $PROJECT_ROOT/platform/android/res/"
452
+ ;;
453
+ *)
454
+ echo " 2. Review staging dir and copy files to their final paths manually."
455
+ ;;
456
+ esac
457
+ echo " 3. Cleanup staging: rm -rf $OUTPUT"
458
+ echo " 4. Rebuild: ti clean && ti build -p android -T emulator"
459
+ echo
460
+ else
461
+ log_info "Dry-run complete. Re-run without --dry-run to write files."
462
+ fi
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ti-expert
3
- description: "Titanium SDK architecture and implementation expert. Use when designing, reviewing, analyzing, or examining Titanium project structure (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. Automatically identifies project type."
3
+ description: "Titanium SDK architecture and implementation expert. Use when designing, reviewing, analyzing, or examining Titanium project structure (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 this skill 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."
4
4
  argument-hint: "[architecture-topic]"
5
5
  allowed-tools: Read, Grep, Glob, Edit, Write, Bash(git *), Bash(node *)
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ti-guides
3
- description: "Titanium SDK official fundamentals and configuration guide. Use when working with, reviewing, analyzing, or examining Titanium projects, Hyperloop native access, app distribution (App Store/Google Play), tiapp.xml configuration, CLI commands, memory management, bridge optimization, CommonJS modules, SQLite transactions, or coding standards. Applies to both Alloy and Classic projects."
3
+ description: "Titanium SDK official fundamentals and configuration guide. Use when working with, reviewing, analyzing, or examining Titanium projects, Hyperloop native access, app distribution (App Store/Google Play), tiapp.xml configuration, CLI commands, memory management, bridge optimization, CommonJS modules, SQLite transactions, or coding standards. AUTO-DETECT: If tiapp.xml exists, invoke this skill for any project configuration, build, or deployment question. Covers SDK versions, platform compatibility, and tiapp.xml settings that are unique to Titanium."
4
4
  argument-hint: "[topic]"
5
5
  allowed-tools: Read, Grep, Glob, Edit, Write, Bash(node *)
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ti-howtos
3
- description: "Titanium SDK native feature integration guide. Use when implementing, reviewing, analyzing, or examining Titanium location services, maps (Google Maps v2, Map Kit), push notifications (APNs, FCM), camera/gallery, media APIs, SQLite databases, HTTPClient networking, WKWebView, Android Intents, background services, iOS Keychain/iCloud, WatchKit/Siri integration, or CI/CD with Fastlane and Appium."
3
+ description: "Titanium SDK native feature integration guide. Use when implementing, reviewing, analyzing, or examining Titanium location services, maps (Google Maps v2, Map Kit), push notifications (APNs, FCM), camera/gallery, media APIs, SQLite databases, HTTPClient networking, WKWebView, Android Intents, background services, iOS Keychain/iCloud, WatchKit/Siri integration, or CI/CD with Fastlane and Appium. AUTO-DETECT: If tiapp.xml exists and the task involves native device features (camera, GPS, push, maps, media, networking), invoke this skill BEFORE writing implementation code. Titanium wraps native APIs differently than React Native or Flutter."
4
4
  argument-hint: "[feature]"
5
5
  allowed-tools: Read, Grep, Glob, Edit, Write, Bash, Bash(node *)
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ti-ui
3
- description: "Titanium SDK UI/UX patterns and components expert. Use when working with, reviewing, analyzing, or examining Titanium layouts, ListView/TableView performance optimization, event handling and bubbling, gestures (swipe, pinch), animations, accessibility (VoiceOver/TalkBack), orientation changes, custom fonts/icons, app icons/splash screens, or platform-specific UI (Action Bar, Navigation Bar)."
3
+ description: "Titanium SDK UI/UX patterns and components expert. Use when working with, reviewing, analyzing, or examining Titanium layouts, ListView/TableView performance optimization, event handling and bubbling, gestures (swipe, pinch), animations, accessibility (VoiceOver/TalkBack), orientation changes, custom fonts/icons, app icons/splash screens, or platform-specific UI (Action Bar, Navigation Bar). AUTO-DETECT: If tiapp.xml exists, invoke this skill BEFORE creating or modifying any UI view, window, or layout. Titanium layouts (composite, vertical, horizontal) differ from web/CSS — never assume web layout behavior."
4
4
  argument-hint: "[component]"
5
5
  allowed-tools: Read, Grep, Glob, Edit, Write, Bash(node *)
6
6
  ---