一键导入
ttb-skill-refactor
Refactor TTBaseUIKit code: migrate to TTViewCodable, replace raw UIKit with TTBaseUIKit, TTBaseSUI adoption, clean MVVM separation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Refactor TTBaseUIKit code: migrate to TTViewCodable, replace raw UIKit with TTBaseUIKit, TTBaseSUI adoption, clean MVVM separation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
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+
Code audits for TTBaseUIKit apps: performance, accessibility, localization. FCR compliance scoring.
Systematic bug fixing workflow for TTBaseUIKit apps: root cause analysis, fix strategy, xcodebuild verify, zero regression.
TTBaseUIKit project initialization skill: scaffold MVVM-C folder structure, setup TTBaseUIKitConfig, configure localization, integrate TTBDebugPlus. Run BEFORE any other TTBaseUIKit skill.
Build reusable native SwiftUI UI components using 100% standard SwiftUI primitives with TTBaseUIKit design tokens, localization, chainable modifiers, and project architecture rules. NO TTBaseSUI wrappers. iOS 14+.
Shared resources for all TTBaseUIKit skills: routing, workflows, cross-functional analysis, rules, phases, references, anti-patterns, coding standards, and verification.
| name | ttb-skill-refactor |
| description | Refactor TTBaseUIKit code: migrate to TTViewCodable, replace raw UIKit with TTBaseUIKit, TTBaseSUI adoption, clean MVVM separation. |
| version | 2.3.0 |
| date_updated | 2026-05-30 |
| risk | safe |
| source | internal |
| loadLevel | domain |
| tags | ["refactor","migration","ttviewcodable","ttbasesui","cleanup","routing"] |
Enterprise-grade refactoring workflow for TTBaseUIKit apps. Zero Functional Change | TTViewCodable | TTBaseSUI | MVVM-C
Before this skill generates code, refactors, migrates, modifies files, creates architecture, updates UI/navigation, changes dependencies, updates workflows, or changes business logic, run the shared gate:
ttb-skill-shared/fragments/ttb-preflight-execution-gate.frag.mdttb-skill-shared/fragments/ttb-cross-functional-analysis-gate.frag.md when refactor scope touches feature behavior, UX flow, architecture, or bug preventionttb-skill-shared/templates/ttb-clarification-survey.md when confidence is below thresholdRequired phase order: Requirement Analysis -> Context Validation -> Ambiguity Detection -> Missing Information Detection -> Survey / Clarification -> Confidence Evaluation -> Execution Approval.
Execution thresholds:
| Confidence | Action |
|---|---|
90-100 | Execute directly and state key assumptions |
70-89 | Execute only with documented low-risk assumptions |
<70 | Do not execute; ask a concise survey first |
Cap confidence at 69 when target module, architecture direction, UIKit/SwiftUI choice, navigation behavior, API/business logic, localization format, state management, dependency info, or ownership is unclear. Parse English, Vietnamese, mixed-language, diacritic-free Vietnamese, and light typos before scoring.
When refactor scope is tied to feature updates, bug prevention, architecture changes, or user-visible flow changes, analyze as Product Owner, Business Analyst, UX/UI Designer, Solution Architect, Senior Developer, and QA. Compare options across business value, architecture, UI/UX, performance, scalability, maintainability, security, testing, and operations; ask at least 5 value-expansion questions after analysis. If requirements are ambiguous/incomplete, ask at least 6 clarification questions before design/development.
input:
required: [refactor_goal, affected_files_or_module, behavior_to_preserve]
optional: [target_pattern, migration_constraints, verification_command]
output:
artifacts: [migration_plan, changed_files, before_after_notes, verification_report]
completion_gate: "zero behavior change + build/compliance verification"
confidence:
auto_route: ">= 0.78 for refactor/cleanup/migration/raw UIKit replacement intents"
clarify: "0.55-0.77 when prompt mixes bugfix and cleanup"
fallback:
default: "If behavior is broken, run ttb-skill-bugfix first. If user only wants scoring, route to audit."
Multilingual aliases: refactor, clean up code, migrate to TTViewCodable, replace raw UIKit, dọn code, don code, tái cấu trúc, giam trung lap.
Anti-patterns: do not add new features during refactor; do not change behavior silently; do not migrate across unrelated modules in one step.
| Command | Scope |
|---|---|
/ttb-refactor-uikit | UIKit → TTViewCodable, TTBaseUIKit |
/ttb-refactor-swiftui | Native SwiftUI → TTBaseSUI |
See ttb-skill-refactor.prompt.md for detailed steps:
| Phase | Focus |
|---|---|
| 1 | MVVM Separation — ViewModel purity |
| 2 | TTViewCodable Adoption |
| 3 | Component Replacement — TTBaseUIKit |
| 4 | Constraint Refactoring — token usage |
| 5 | Handler Refactoring — closures |
See ttb-skill-refactor.prompt.md for detailed steps:
| Phase | Focus |
|---|---|
| 1 | Component Migration — TTBaseSUI wrappers |
| 2 | Modifier Migration — token-based styling |
| 3 | iOS 14+ Compliance — API compatibility |
| 4 | View Composition — extract subviews |
ttb-skill-shared/rules/ttb-rule-anti-patterns.md — Full anti-pattern referencettb-skill-shared/rules/ttb-rule-coding-standards.md — Coding conventionsttb-skill-shared/rules/ttb-rule-memory-leaks.md — Memory leak detectionttb-skill-shared/refs/ttb-ref-ttbaseuikit.md — TTBaseUIKit API referencettb-skill-shared/refs/ttb-ref-ttbasesui.md — TTBaseSUI component referencettb-skill-shared/refs/ttb-ref-ios14-compatibility.md — iOS 14 API guideSee ttb-skill-refactor.prompt.md for the complete REFACTOR REPORT template.
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 standardized routing contract, EN/VI refactor aliases, input/output schema, confidence guidance, and fallback strategy. v2.0.0 — Version bump, Iron Laws, critical token warnings, and shared resource alignment.