| name | antigravity-root |
| description | Enterprise-grade iOS development workflow for TTBaseUIKit-powered apps. Cross-functional product analysis | MVVM-C Architecture | UIKit + SwiftUI | TTViewCodable | TTBaseSUI | xcodebuild CLI Verification | Zero Regression | iOS 14+ |
| version | 2.3.0 |
| date_updated | 2026-05-30 |
| risk | safe |
| source | internal |
| loadLevel | always |
| tags | ["ttbaseuikit","ios","mvvm-c","uikit","swiftui","ttbasesui","antigravity","routing","multilingual"] |
Antigravity — TTBaseUIKit AI Agents
Enterprise-grade iOS development skill set for TTBaseUIKit-powered apps.
MVVM-C Architecture | UIKit + SwiftUI | TTViewCodable | TTBaseSUI | SUIBaseView Navigation
xcodebuild CLI Verification | Zero Regression | iOS 14+
Skill Sets
| Skill | Description | Commands |
|---|
/ttb-init | Project initialization: MVVM-C structure, TTBaseUIKitConfig, localization, TTBDebugPlus. Run FIRST. | 5 |
/ttb-uikit | UIKit full-stack: screen, list, form, cell, customview, api, coordinator, viewmodel | 8 |
/ttb-swiftui | SwiftUI full-stack: TTBaseSUI screens/views and Native SwiftUI screens/views | 6 |
/ttb-native-swiftui-components | Native SwiftUI reusable components: 20 components with TTBaseUIKit tokens. 100% standard SwiftUI. No TTBaseSUI wrappers. | 20 |
/ttb-bugfix | Systematic bug fixing: root cause analysis, minimal fix, zero regression | 1 |
/ttb-refactor | Migrate raw UIKit to TTBaseUIKit, TTViewCodable adoption, TTBaseSUI adoption, clean MVVM separation | 2 |
/ttb-audit | Performance, accessibility, localization audits with FCR compliance scoring | 3 |
/ttb-shared | Shared resources: rules, phases, references, scripts, fragments, templates, registry | — |
Auto-Routing Contract
Antigravity routes by semantic intent first, not exact keyword matching. Exact /ttb-* commands still win immediately.
| Prompt intent | English examples | Vietnamese examples | Route |
|---|
| API/service/endpoint | generate api, build endpoint, auth api | tạo api, tao api, viết api, api login | /ttb-uikit-api |
| UIKit artifact | build UIKit screen, create cell, viewmodel callbacks | tạo màn hình UIKit, tao cell, tao viewmodel | /ttb-uikit-* |
| SwiftUI artifact | SwiftUI screen, SUIBaseView list | tạo màn hình SwiftUI, danh sách SwiftUI | /ttb-sui-* |
| Native component | native SwiftUI button, rating component | tao button, tao card, tao rating | /ttb-native-* |
| Bugfix | fix crash, debug regression | sửa lỗi, sua loi, crash khi tap | /ttb-bugfix |
| Refactor | clean up, migrate raw UIKit | dọn code, tái cấu trúc, thay raw UIKit | /ttb-refactor |
| Audit | performance audit, FCR score | kiểm tra hiệu năng, chấm điểm FCR | /ttb-audit-* |
Routing sources:
- Machine-readable manifest:
ttb-skill-shared/routing/intent-manifest.json
- Human-readable router:
ttb-skill-shared/routing/intent-router.md
- Multilingual aliases:
ttb-skill-shared/routing/multilingual-aliases.json
- Workflow contract:
ttb-skill-shared/workflows/ttb-workflow-standard.md
Confidence policy:
| Confidence | Action |
|---|
>= 0.78 | Auto-route |
0.55-0.77 | Ask one focused clarification |
< 0.55 | Load shared resources and ask for goal/framework/artifact |
Mandatory Preflight Execution Gate
Before any skill generates code, refactors, migrates, modifies files, creates architecture, updates workflows, updates UI, updates navigation, changes dependencies, or changes business logic, it must run:
ttb-skill-shared/fragments/ttb-preflight-execution-gate.frag.md
ttb-skill-shared/fragments/ttb-cross-functional-analysis-gate.frag.md for feature updates, new features, and bug fixes
ttb-skill-shared/templates/ttb-clarification-survey.md when clarification is required
The gate is mandatory for every root skill, domain skill, prompt, workflow, and template.
Required phase order:
- Requirement Analysis
- Context Validation
- Ambiguity Detection
- Missing Information Detection
- Survey / Clarification Phase
- Confidence Evaluation
- Execution Approval
Execution confidence policy:
| Confidence | Action |
|---|
90-100 | Execute directly and state key assumptions |
70-89 | Execute only when assumptions are low-risk and explicitly documented |
<70 | Do not execute; ask a concise multiple-choice survey first |
Architecture-critical or business-critical uncertainty caps execution confidence at 69. Examples: unknown target module, unclear UIKit vs SwiftUI direction, missing API contract, unclear navigation behavior, incomplete business logic, unclear localization format, or conflict with existing project conventions.
Multilingual requirement parsing is required. Treat Vietnamese, English, mixed-language prompts, diacritic-free Vietnamese, and light typos as valid intent signals, including tao man login, create login screen, màn login có api chưa, and push qua detail screen.
Cross-Functional Product Analysis
For every existing feature update, new feature, bug fix, regression, UX flow change, business logic change, or architecture change:
- Analyze the request as Product Owner, Business Analyst, UX/UI Designer, Solution Architect, Senior Developer, and QA.
- Survey the current codebase and propose optimal implementation directions across business value, architecture, UI/UX, performance, scalability, maintainability, testing, security, release, and operations.
- Compare viable alternatives with pros/cons and recommend the best option grounded in the existing TTBaseUIKit project constraints.
- After analysis, ask at least 5 value-expansion questions that could improve user flow, interactions, adjacent features, feedback states, observability, accessibility, or QA coverage.
- If the request is ambiguous or incomplete, stop before design/development and ask at least 6 clarification questions covering business, UX, data, API, security, performance, edge cases, and real production scenarios.
- Apply relevant product, UX/UI, architecture, development, QA, release, observability, and operations best practices before implementation.
Architecture
┌──────────────────────────────────────────────────────────────┐
│ AppCoordinator │
│ ┌─────────────┬─────────────┬─────────────┬──────────┐ │
│ │TabCoordinator│TabCoordinator│TabCoordinator│ │ │
│ └──────┬──────┴──────┬──────┴──────┬──────┘ │ │
│ │ │ │ │ │
│ ┌──────▼──────┐ ┌────▼────┐ ┌─────▼─────┐ │ │
│ │ Feature │ │ Feature │ │ Feature │ │ │
│ │ Coordinator │ │Coordinator│ │ Coordinator│ │ │
│ └──────┬──────┘ └────┬─────┘ └─────┬─────┘ │ │
│ │ │ │ │ │
│ ┌──────▼──────────────▼──────────────▼─────┐ │ │
│ │ ViewController (UIKit) │ │ │
│ │ or SwiftUI Screen │ │ │
│ │ + TTViewCodable / SUIBaseView │ │ │
│ └──────┬──────────────────┬──────────────────┘ │ │
│ │ │ │ │
│ ┌──────▼──────┐ ┌───────▼──────────┐ │ │
│ │ ViewModel │ │ TTBaseUIKit │ │ │
│ │ (MVVM) │ │ Components │ │ │
│ └──────┬──────┘ └───────┬──────────┘ │ │
│ │ │ │ │
│ ┌──────▼─────────────────▼─────┐ │ │
│ │ RequestAPI │ │ │
│ │ (URLSession + Codable) │ │ │
│ └───────────────────────────────┘ │ │
└──────────────────────────────────────────────────────────────┘
TTBaseUIKit Design System:
┌─────────────┬────────────────┬────────────┬──────────────────┐
│ TTView │ TTSize │ TTFont │ TTBaseUIKitConfig │
│ (UIColor) │ (CGFloat) │ (CGFloat) │ (singleton) │
└─────────────┴────────────────┴────────────┴──────────────────┘
SwiftUI Navigation Pattern (MANDATORY)
All SwiftUI screens MUST use SUIBaseView as the screen wrapper and TTBaseNavigationLink for navigation between screens. This is non-negotiable for TTBaseUIKit apps.
struct HomeScreen: View {
@StateObject private var vm = HomeViewModel()
var body: some View {
SUIBaseView(
backType: .SWIFTUI,
title: XText("App.Home.Nav.Title"),
type: .DEFAULT,
isHiddenTabbar: true,
backAction: {}
) {
}
.onAppear { vm.fetchData() }
}
}
TTBaseNavigationLink(destination: {
DetailScreen(item: item)
}, label: {
ItemCardView(item: item)
.pAll(TTSize.P_CONS_DEF)
.bg(byDef: TTView.viewBgCellColor.toColor())
.corner(byDef: TTSize.CORNER_PANEL)
.baseShadow()
}, isAnimation: true)
Three-Tier SwiftUI Approach
| Tier | When | Components |
|---|
| Tier 1 — TTBaseSUI | Component already exists | TTBaseSUI* wrappers → /ttb-sui-* |
| Tier 2 — SUIBaseView + TTBaseNavigationLink | Navigation between screens | Mandatory pattern |
| Tier 3 — Native SwiftUI + tokens | TTBaseSUI lacks component | Text, Button, VStack + tokens → /ttb-native-* |
Rule: Prefer TTBaseSUI. Only fallback to Native SwiftUI when TTBaseSUI has no equivalent.
Activation
Activate by saying:
| Scenario | Activate |
|---|
| Init project, setup project | /ttb-init — Run FIRST |
| Build UIKit screen, list, form, cell | /ttb-uikit-* |
| Build SwiftUI screen (TTBaseSUI or native) | /ttb-sui-* or /ttb-native-* |
| Build native SwiftUI reusable component | /ttb-native-* |
| Fix bug, debug, crash | /ttb-bugfix |
| Refactor, clean up code | /ttb-refactor |
| Audit performance, accessibility, localization | /ttb-audit-* |
| Rules, phases, references | /ttb-shared |
Quick Start
1. Activate: "init project" → /ttb-init ← Run FIRST
2. Activate: "build a UIKit screen" → /ttb-uikit
3. Activate: "build a SwiftUI screen" → /ttb-sui-screen
4. Activate: "build a native SwiftUI component" → /ttb-native-button
5. Activate: "fix bug" → /ttb-bugfix
6. Activate: "refactor" → /ttb-refactor
7. Activate: "audit" → /ttb-audit
11 Iron Laws (MANDATORY)
- iOS 14+ ONLY — never use iOS 15+/16+/17+ APIs without
@available
- TTBaseUIKit COMPONENTS — never use raw UIKit when TTBaseUIKit exists
- TTViewCodable MVVM — UIKit views must use TTViewCodable protocol
- TTBaseSUI FOR SWIFTUI — use TTBaseSUI* wrappers for SwiftUI
- SUIBaseView WRAPPER — every SwiftUI screen must use
SUIBaseView
- TTBaseNavigationLink — every navigation between screens uses
TTBaseNavigationLink
- MVVM SEPARATION — ViewModel never imports UIKit/SwiftUI
- xcodebuild CLI IS LAW — use
xcodebuild command, not Cmd+B
- ZERO REGRESSION — every change verified against existing code
- ANTI-LOOP: MAX 3 ROUNDS — 3 build failures → stop, document errors
- POST-BUILD VERIFICATION IS MANDATORY — after every skill workflow:
BUILD SUCCEEDED
Full Iron Laws: ttb-skill-shared/fragments/ttb-iron-laws.frag.md
Code Generation Marker
Every generated file must have this marker comment:
Full marker template: ttb-skill-shared/fragments/ttb-marker.frag.md
Post-Build Verification (MANDATORY)
After every skill workflow completes, run Phase 6 verification:
bash ttb-skill-shared/scripts/ttb-verify.sh
bash ttb-skill-shared/scripts/ttb-compliance-check.sh
5-Layer Verification Stack
| Layer | Check |
|---|
| Layer 1 | Xcode Project Integrity — all .swift files in project.pbxproj |
| Layer 2 | xcodebuild CLI — BUILD SUCCEEDED |
| Layer 3 | Rules Compliance — iOS 14+, TTBaseUIKit, tokens, closures |
| Layer 4 | Regression Guard — existing code not broken |
| Layer 5 | FCR 7-Dimension Score — ≥ 85 to pass |
Anti-Loop: Max 3 build attempts. 3 failures → STOP, document errors.
FCR 7-Dimension Compliance Score
| Dimension | Weight | Check |
|---|
| iOS 14+ API | 15% | No iOS 15+/16+/17+ APIs |
| TTBaseUIKit Compliance | 20% | All components, no raw UIKit |
| Config Tokens | 15% | TTView/TTSize/TTFont everywhere |
| MVVM Separation | 15% | ViewModel pure, VC thin |
| Closure Safety | 15% | [weak self] everywhere |
| Localization | 10% | XText/XTextU with Localizable.strings |
| Code Quality | 10% | MARK sections, naming, style |
Score >= 85: READY
Score 70-84: NEEDS FIX
Score < 70: BLOCKED
Token Budget
| Category | Tokens/Session |
|---|
| Root + Shared SKILL.md | ~1,500 |
| Iron Laws fragment | ~240 |
| Marker fragment | ~40 |
| Domain skill (UIKit/SwiftUI) | ~3,000 |
| On-demand prompts | ~500-2,000 each |
| Verify scripts (runtime, zero tokens) | 0 |
| Total per session | ~5,000-7,000 |
| Before optimization (v1.0) | ~12,000-15,000 |
| Savings | ~50-55% |
Progressive Loading
Skills use loadLevel metadata to minimize context bloat:
| loadLevel | When | Examples |
|---|
always | Load on every session start | Root SKILL.md, shared rules |
domain | Load when domain is detected | UIKit, SwiftUI, Bugfix skills |
on-demand | Load only when explicitly triggered | Audit, Refactor, Native Components |
See full registry: ttb-skill-registry.md
Directory Structure
Agents/Antigravity/
├── SKILL.md ← Root workflow
├── README.md / README-VI.md / VERSION.md
├── AUDIT-REPORT.md ← Optimization audit
├── export.sh ← Archive builder
│
├── ttb-skill-init/ ← Project initialization (RUN FIRST)
│ ├── SKILL.md
│ └── prompts/
│ ├── ttb-skill-init.prompt.md
│ ├── ttb-skill-init-structure.prompt.md
│ ├── ttb-skill-init-ttbaseui-kit.prompt.md
│ ├── ttb-skill-init-localization.prompt.md
│ └── ttb-skill-init-debug.prompt.md
│
├── ttb-skill-uikit/ ← UIKit skill set (8 commands)
│ ├── SKILL.md
│ └── ttb-skill-*.prompt.md
│
├── ttb-skill-swiftui/ ← SwiftUI skill set (6 commands)
│ ├── SKILL.md
│ ├── ttb-skill-sui-screen.prompt.md
│ ├── ttb-skill-sui-view.prompt.md
│ ├── ttb-skill-sui-list.prompt.md
│ ├── ttb-skill-sui-viewmodel.prompt.md
│ ├── ttb-skill-native-screen.prompt.md
│ ├── ttb-skill-native-view.prompt.md
│ └── ttb-ref-ttbasesui.md
│
├── ttb-skill-native-swiftui-components/ ← Native SwiftUI components (20 commands)
│ ├── SKILL.md
│ ├── refs/
│ │ └── ttb-ref-native-design-tokens.md
│ └── ttb-skill-native-*.prompt.md ← 20 component files
│
├── ttb-skill-bugfix/ ← Bug fix workflow
│ ├── SKILL.md
│ └── ttb-skill-bugfix.prompt.md
│
├── ttb-skill-refactor/ ← Refactor workflow
│ ├── SKILL.md
│ └── ttb-skill-refactor.prompt.md
│
├── ttb-skill-audit/ ← Audit workflows (3 commands)
│ ├── SKILL.md
│ ├── ttb-skill-audit-performance.prompt.md
│ ├── ttb-skill-audit-accessibility.prompt.md
│ └── ttb-skill-audit-localization.prompt.md
│
└── ttb-skill-shared/ ← Shared resources
├── SKILL.md
├── ttb-skill-registry.md ← compatibility shim
├── routing/
│ ├── intent-manifest.json
│ ├── multilingual-aliases.json
│ ├── intent-router.md
│ └── router-examples.md
├── workflows/
│ └── ttb-workflow-standard.md
├── scripts/
│ ├── ttb-verify.sh
│ ├── ttb-compliance-check.sh
│ └── ttb-precheck.sh
├── fragments/
│ ├── ttb-iron-laws.frag.md
│ └── ttb-marker.frag.md
├── rules/
│ ├── ttb-rule-anti-patterns.md
│ ├── ttb-rule-coding-standards.md
│ ├── ttb-rule-memory-leaks.md
│ └── ttb-rule-comments.md
├── phases/
│ ├── ttb-phase-feature-research.md
│ ├── ttb-phase-feature-spec.md
│ ├── ttb-phase-implementation.md
│ ├── ttb-phase-code-review.md
│ └── ttb-phase-verify.md
└── refs/
├── ttb-ref-ttbaseuikit.md
├── ttb-ref-ttbasesui.md
├── ttb-ref-config-tokens.md
├── ttb-ref-ios14-compatibility.md
├── ttb-ref-swiftui-performance.md
├── ttb-ref-swiftui-architecture.md
└── ttb-ref-navigation.md ← NEW: Navigation pattern reference
Config Tokens
TTView.viewBgColor
TTView.textDefColor
TTView.buttonBgDef
TTView.iconColor
TTView.notificationBgSuccess
TTView.notificationBgWarning
TTView.notificationBgError
TTSize.P_CONS_DEF
TTSize.P_L
TTSize.CORNER_RADIUS
TTSize.CORNER_PANEL
TTSize.H_BUTTON
TTFont.HEADER_H
TTFont.TITLE_H
TTFont.SUB_TITLE_H
⚠️ Critical Token Warnings
The following tokens DO NOT EXIST in TTBaseUIKit. Always use alternatives:
| ❌ DO NOT USE | ✅ USE INSTEAD |
|---|
XView | TTView |
XSize | TTSize |
XFont | TTFont |
TTView.colorSuccess | TTView.notificationBgSuccess |
TTView.colorWarning | TTView.notificationBgWarning |
TTView.colorError | TTView.notificationBgError |
TTView.buttonBgHighlight | Calculate manually (.withAlphaComponent) |
TTView.buttonBgWarring | TTView.buttonBgWar |
TTView.buttonBgDisable | TTView.buttonBgDis |
TTView.textThirdTitleColor | TTView.textSubTitleColor |
TTView.viewBgSecondaryColor | TTView.viewBgColor |
TTView.separatorColor | TTView.lineDefColor |
TTView.iconPrimaryColor | TTView.iconColor |
TTSize.P_XXL | TTSize.P_CONS_DEF * 4 (32pt) |
TTSize.SIZE_SUPER_HEADER | TTFont.HEADER_SUPER_H |
Resources
Version: 2.3.0 | Date: 2026-05-30
Changelog: v2.3.0 — Added cross-functional product analysis gate, option exploration, 5 value-expansion questions, and 6-question ambiguity clarification gate. v2.2.0 — Added semantic intent routing, EN/VI mixed-language aliases, confidence thresholds, routing manifest, workflow standard contract, and registry deduplication shim. v2.1.0 — Added mandatory SUIBaseView + TTBaseNavigationLink as Iron Laws #5-#6. Added critical token warnings section. Added three-tier SwiftUI approach. Added navigation ref to directory structure. Fixed XView/XSize/XFont references throughout. Added ttb-rule-comments to shared resources. Bumped all skill versions to v2.0.0 for consistency.