From titools
Use when working with PurgeTSS, Titanium's utility-first styling toolkit — styling, reviewing, analyzing, or examining Titanium UI with utility classes, configuring config.cjs, creating dynamic components with $.UI.create(), building animations, grid layouts, icon fonts, or TSS styles. AUTO-DETECT: If purgetss/ folder or purgetss/config.cjs exists, invoke BEFORE writing ANY styling code. PurgeTSS classes look like Tailwind but are NOT Tailwind — verify every class exists. Never use padding on Views (use margins on children), never use flexbox classes, never write manual TSS when a utility class exists.
How this skill is triggered — by the user, by Claude, or both
Slash command
/titools:purgetss [class-name][class-name]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Utility-first styling toolkit for Titanium/Alloy mobile apps.
assets/purgetss.config.cjsreferences/EXAMPLES.mdreferences/animation-advanced.mdreferences/animation-system.mdreferences/app-branding.mdreferences/appearance-module.mdreferences/apply-directive.mdreferences/arbitrary-values.mdreferences/class-categories.mdreferences/class-index.mdreferences/cli-commands.mdreferences/configurable-properties.mdreferences/custom-fonts.mdreferences/custom-rules.mdreferences/customization-deep-dive.mdreferences/dynamic-component-creation.mdreferences/grid-layout.mdreferences/icon-fonts.mdreferences/installation-setup.mdreferences/ios-large-titles.mdUtility-first styling toolkit for Titanium/Alloy mobile apps.
The SKILL.md alone is an index of references. The detail you need to give accurate answers lives in the reference files. Reading this SKILL.md is not enough.
| Task involves | Required reading |
|---|---|
| Choosing utility classes | references/class-index.md |
| Layout (horizontal/vertical/composite, grid) | references/grid-layout.md, references/ui-ux-design.md |
| Dynamic components in controllers | references/dynamic-component-creation.md |
| Custom values / arbitrary syntax | references/arbitrary-values.md |
Platform-specific styles (ios:, android:) | references/platform-modifiers.md |
| Dark/Light mode | references/semantic-colors.md, references/appearance-module.md |
| Apply directive / class extraction | references/apply-directive.md |
| Animations | references/animation-system.md |
Every utility class you suggest and every styling pattern you describe MUST be backed by a citation in the form:
[source: references/<file>.md]
Example: "Use wh-12 to set width and height to 48px [source: references/class-index.md]"
If you write a claim without having read the reference that backs it,
prepend FROM_MEMORY (unverified): to that claim. Do not hide it.
class-index.md️ℹ️ AUTO-DETECTS PURGETSS PROJECTS This skill automatically detects PurgeTSS usage when invoked and provides utility-first styling guidance.
Detection occurs automatically - no manual command needed.
PurgeTSS project indicators:
purgetss/folderpurgetss/config.cjsconfiguration filepurgetss/styles/utilities.tssutility classesapp/styles/app.tss(auto-generated)Behavior based on detection:
- PurgeTSS detected → Provides PurgeTSS-specific guidance, recommends utility classes, suggests
$.UI.create()for dynamic components- Not detected → Does NOT suggest PurgeTSS utility classes, does NOT recommend
$.UI.create(), does NOT reference PurgeTSS-specific patterns
purgetss create 'name' or purgetss init for existing projectsapp.tsspurgetss/config.cjs./purgetss/
├─ fonts/ # Custom font files (.ttf, .otf)
├─ styles/
│ ├─ definitions.css # For VS Code IntelliSense
│ └─ utilities.tss # All PurgeTSS utility classes
└─ config.cjs # Theme configuration
./app/styles/
├─ app.tss # AUTO-GENERATED - DO NOT EDIT DIRECTLY
└─ _app.tss # YOUR CUSTOM STYLES (persists across runs)
app.tss vs _app.tss⚠️ CRITICAL: app.tss IS AUTO-GENERATED
app.tssis ALWAYS regenerated every time the app compiles.PurgeTSS scans ALL XMLs and Controllers for utility classes, then generates a fresh
app.tsscontaining only the classes actually used.NEVER edit
app.tssdirectly - your changes WILL be overwritten on the next build.
️ℹ️ THE
_app.tssBACKUP FILE On first run, PurgeTSS backs up your originalapp.tssto_app.tss.
_app.tssis your custom styles file - it persists across all PurgeTSS runs.Every build, PurgeTSS:
- Scans XMLs and Controllers for used classes
- Regenerates
app.tssfrom scratch- Copies
_app.tsscontent into the generatedapp.tssBetter approach: define custom classes in
config.cjsinstead of_app.tss.
🚨 ALWAYS CHECK
app.tssFOR ERRORS At the end of every generatedapp.tss, look for this section:// Unused or unsupported classes // .my-typo-class // .non-existent-utilityThese are classes used in your XMLs or Controllers that have NO definition anywhere:
- Not in
utilities.tss(generated from PurgeTSS utilities)- Not in
_app.tss(your custom styles)- Not in any other
.tssfile in thestyles/folderThis means:
- You have a typo in your class name
- You're using a class that doesn't exist in PurgeTSS
- You need to define the class in
_app.tssorconfig.cjsAs part of any analysis, ALWAYS check the end of
app.tssand report any unused/unsupported classes to the user!
utilities.tss Works️ℹ️ UTILITIES.TSS REGENERATION
./purgetss/styles/utilities.tsscontains ALL available PurgeTSS utility classes.It regenerates when
./purgetss/config.cjschanges - this is where you define:
- Custom colors
- Custom spacing scales
- Ti Element styles
- Any project-specific utilities
If a class appears in "Unused or unsupported classes" in
app.tss, it means it's truly not defined anywhere - not even in yourconfig.cjscustomizations.
purgetss create 'MyApp' -d -v fa
# -d: Install dev dependencies (ESLint, Tailwind)
# -v: Copy icon fonts (fa, mi, ms, f7)
💡 NEW PROJECT: Clean Up Default app.tss For new projects created with
purgetss create, the defaultapp/styles/app.tsscontains a large commented template.You can safely DELETE this file - PurgeTSS will regenerate it on the first build with only the classes you actually use, and create a clean
_app.tssbackup.This prevents carrying around unnecessary commented code and ensures a fresh start.
$.UI.create() for Dynamic Components💡 RECOMMENDED FOR DYNAMIC COMPONENTS When creating components dynamically in Controllers, use
$.UI.create()instead ofTi.UI.create()to get full PurgeTSS utility class support:// ✅ RECOMMENDED - Full PurgeTSS support const view = $.UI.create('View', { classes: ['w-screen', 'h-auto', 'bg-white', 'rounded-lg'] }) // ❌ AVOID - No PurgeTSS classes const view = Ti.UI.createView({ width: Ti.UI.FILL, height: Ti.UI.SIZE, backgroundColor: '#ffffff', borderRadius: 8 })See Dynamic Component Creation for complete guide.
NEVER delete any existing .tss files (like index.tss, detail.tss) or other project files without explicit user consent.
How to handle migration to PurgeTSS:
.tss files..tss files for specific styles, respect that choice and only use PurgeTSS for new or requested changes.🚨 FLEXBOX CLASSES DO NOT EXIST The following are NOT supported:
- ❌
flex,flex-row,flex-col- ❌
justify-between,justify-center,justify-start,justify-end- ❌
items-centerfor alignment (exists but setswidth/height: FILL)Use Titanium layouts instead:
- ✅
horizontal- Children left to right- ✅
vertical- Children top to bottom- ✅ Omit layout class - Defaults to
composite(absolute positioning)💡 CRITICAL: Understanding Layout Composition When building complex UIs, carefully choose the layout mode for each container:
vertical- Stack elements top to bottom (most common):<ScrollView class="vertical"> <View class="mb-4">Item 1</View> <View class="mb-4">Item 2</View> <View>Item 3</View> </ScrollView>
horizontal- Arrange elements left to right:<View class="horizontal w-screen"> <Label text="Left" /> <View class="w-screen" /> <!-- Spacer --> <Label text="Right" /> </View>
composite(default) - Absolute positioning withtop,left, etc.:<View class="h-screen w-screen"> <View class="wh-12 absolute left-0 top-0 bg-red-500" /> <View class="wh-12 absolute bottom-0 right-0 bg-blue-500" /> </View>Common Issue: If you see elements appearing in unexpected positions (e.g., a header bar "behind" content), check if parent containers have conflicting layout modes. Each container's layout affects its direct children only.
🚨 CRITICAL: Platform-Specific Properties Require Modifiers Using
Ti.UI.iOS.*orTi.UI.Android.*properties WITHOUT platform modifiers causes cross-platform compilation failures.WRONG - Adds iOS code to Android (causes failure):
// ❌ BAD - Adds Ti.UI.iOS to Android project "#mainWindow": { statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT }CORRECT - Use platform modifiers in TSS:
// ✅ GOOD - Only adds to iOS "#mainWindow[platform=ios]": { statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT }OR use PurgeTSS platform modifier classes:
<!-- ✅ GOOD - Platform-specific classes --> <Window class="ios:status-bar-light android:status-bar-dark">Properties that ALWAYS require platform modifiers:
- iOS:
statusBarStyle,modalStyle,modalTransitionStyle,systemButton- Android:
actionBarconfiguration- ANY
Ti.UI.iOS.*,Ti.UI.Android.*constantWhen suggesting platform-specific code:
- Check if user's project supports that platform
- ALWAYS use
[platform=ios]or[platform=android]TSS modifier- OR use PurgeTSS platform classes like
ios:bg-blue-500
For complete reference on platform modifiers, see Platform Modifiers.
p- padding classes: Titanium does NOT support a native padding property on View, Window, ScrollView, or TableView. Always use margins on children (m-) to simulate internal spacing.SIZE: Use w-screen/h-screen to fill space when needed.rounded-full: To get a perfect circle, use rounded-full-XX (where XX is the width/height of the square element).rounded-full-XX includes size: These classes already set width, height, and borderRadius. Do not add w-XX h-XX/wh-XX unless you need to override.m-xx on FILL elements: Adding m-4 to a w-screen element pins it to all four edges (top, bottom, left, right). This will stretch the component vertically to fill the parent unless you explicitly add h-auto (Ti.UI.SIZE) to constrain it to its content.w-XX + h-XX → wh-XX: If both width and height use the same scale value, prefer a single wh-XX (order doesn't matter: w-10 h-10 and h-10 w-10 are equivalent).wh- shortcuts: PurgeTSS provides a complete scale of combined width/height utilities:
wh-0 to wh-96 (e.g., wh-16 sets both to 64px).wh-1/2, wh-3/4, up to wh-11/12 for proportional sizing.wh-auto (explicit SIZE), wh-full (100%), and wh-screen (FILL).w- and h- classes improves XML readability and reduces generated TSS size.💡 LAYOUT TIP: EDGE PINNING If opposite margins cause a
Label,Button, orSwitchto stretch unexpectedly, it is due to Titanium's Edge Pinning rule (2 opposite pins = computed dimension). This applies to any component whose default size isTi.UI.SIZE.
mt-*+mb-*ormy-*can stretch the component vertically. Addh-auto.ml-*+mr-*ormx-*can stretch the component horizontally. Addw-auto.- If margins affect both axes, use
wh-autoto forceSIZEfor both width and height.<!-- WRONG: my-1 creates vertical pins → Switch stretches to fill parent height --> <Switch class="my-1 mr-2" /> <!-- CORRECT: h-auto prevents vertical stretch --> <Switch class="my-1 mr-2 h-auto" /> <Label class="my-1 ml-2 h-auto" text="Option" />
composite class explicitly - That's the default, use horizontal/vertical when neededw-(100px), bg-(#ff0000) - NO square bracketsmode: 'all' required in config.cjs for Ti Elements stylingkebab-case: .my-class, IDs use camelCase: #myIdWRONG:
<View class="flex-row justify-between"> <!-- Flexbox doesn't exist -->
<View class="p-4"> <!-- No padding on Views -->
<View class="composite"> <!-- Never add composite explicitly -->
CORRECT:
<View class="horizontal">
<View class="m-4"> <!-- Use margins on children -->
<View> <!-- Omit layout = composite by default -->
WRONG (Dynamic Components):
// Manual styling with Ti.UI.create()
const view = Ti.UI.createView({
width: Ti.UI.FILL,
backgroundColor: '#fff',
borderRadius: 8
})
CORRECT (Dynamic Components):
// PurgeTSS classes with $.UI.create()
const view = $.UI.create('View', {
classes: ['w-screen', 'bg-white', 'rounded-lg']
})
🚨 CRITICAL: VERIFY CLASSES BEFORE SUGGESTING NEVER guess or hallucinate classes based on other CSS Frameworks knowledge!
PurgeTSS shares naming with some CSS Frameworks but has DIFFERENT classes for Titanium. Always verify a class exists before suggesting it.
Check if it's a KNOWN anti-pattern
flex-row, justify-between, p-4 on Views (p-* not supported on Views)Check the Class Index
keyboard-type-*, return-key-type-* have dedicated classesSearch the project when unsure
# Search for a class pattern in the project's utilities.tss
grep -E "keyboard-type-" ./purgetss/styles/utilities.tss
grep -E "return-key-type-" ./purgetss/styles/utilities.tss
grep -E "^'bg-" ./purgetss/styles/utilities.tss
After making changes
app.tss for "Unused or unsupported classes" section at the end| Has Classes in PurgeTSS | Does NOT Have Classes |
|---|---|
keyboard-type-email | hintText (use attribute) |
return-key-type-next | passwordMask (use attribute) |
text-center | autocorrect (use attribute) |
bg-blue-500 | autocapitalization (use attribute) |
w-screen | flex-row → use horizontal |
wh-16 | justify-between → use margins |
rounded-lg | w-full → use w-screen |
m-4, gap-4 | p-4 on View → use m-4 on children |
💡 TIP When in doubt, prefer using the search command above to verify. It's better to spend 5 seconds verifying than suggesting a class that doesn't exist and will appear in the "unused classes" warning.
Load these only when needed:
$.UI.create() and Alloy.createStyle() for creating components in Controllers (READ FIRST for dynamic components)semantic command (v7.6.0)purgetss commandsti.ui.defaultunit in tiapp.xml interprets the unitless numeric values PurgeTSS writes (foundational concept for spacing, sizes, typography)semantic command + runtime usage for Light/Dark mode (v7.6.0)brand command for launcher icons, adaptive, iOS 18+ Dark/Tinted, marketplace assets (v7.6.0)images command for Android res-*dpi + iPhone @1x/@2x/@3x UI images (v7.6.0)build-fonts command for Google Fonts, brand typefaces, and community icon fonts (.ttf + .css)icon-library install flow + recreating removed libraries💡 TEXT FONTS (Google Fonts, Roboto, etc.) For text fonts, see Custom Fonts.
For complete WRONG vs CORRECT examples including:
$.UI.create() and Alloy.createStyle()See EXAMPLES.md and Dynamic Component Creation
For tasks beyond styling, use these complementary skills:
| Task | Use This Skill |
|---|---|
| Project architecture, services, controllers | ti-expert |
| Complex UI components, ListViews, gestures | ti-ui |
| Alloy MVC concepts, data binding, TSS syntax | alloy-guides |
| Native features (camera, location, push) | ti-howtos |
npx claudepluginhub maccesar/titools --plugin titoolsProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.