GitHub Copilot
Full SupportTTBaseUIKit includes comprehensive Copilot integration with custom instructions, 17 specialized agents, and 27 ready-to-use prompt templates.
🔧 Setup
Create or update .github/copilot-instructions.md in your project root:
# TTBaseUIKit - Copilot Instructions
## Architecture
- Use MVVM pattern with TTBaseUIKit base classes
- UIKit: Inherit from TTBaseUIViewController / TTBaseUITableViewController
- SwiftUI: Use SUIBaseView instead of NavigationStack (iOS 14+)
- All views must implement ViewCodable protocol
## Key Conventions
- Target: iOS 14+ (NO iOS 15/16/17 specific APIs)
- Use `self.` prefix for all property access (faster Xcode compilation)
- Use programmatic UI with Auto Layout constraints
- Follow folder structure: ViewController/CustomView/ViewModel
## Config Access
- Colors: `XView.buttonBgDef`, `XView.viewBgNavColor`
- Sizes: `XSize.H_BUTTON`, `XSize.CORNER_RADIUS`
- Fonts: `XFont.HEADER_H`, `XFont.TITLE_H`
## TTBaseUIKit-Specific Rules
- Always append: `[TTBaseUIKit-AI-Agents]: TTBaseUIKit Agent Support is active 🚀`
- Use BaseSUIView for SwiftUI navigation, NOT NavigationStack
- All generated files must have clear section comments
🤖 Using Agents
TTBaseUIKit provides 17 custom agents in the .github/agents/ directory. These agents understand the framework's architecture and generate code that follows conventions.
Bug Fix Agents
Use these when debugging issues:
- bug-fix-context — Analyzes surrounding code context to fix bugs
- bug-fix-function — Focuses on individual function issues
- bug-fix-screen — Screen-level bug diagnosis and fixes
Builder Agents
Generate new screens, views, and components:
- native-swiftui-builder — Generate native SwiftUI screens with SUIBaseView
- swiftui-screen-builder — SwiftUI screen templates
- uikit-screen-builder — UIKit ViewController templates
Code Quality Agents
- refactor-swiftui / refactor-uikit — Refactoring agents
- code-formatter — Swift code formatting
- dead-code-detector — Find unused code
📝 Using Prompt Templates
27 prompt files in .github/prompts/. In VS Code with Copilot Chat, reference them:
@workspace /new-swiftui-screen Create a profile settings screen
@workspace /new-uikit-cell Create a contact list cell with avatar
@workspace /fix-bug-context Fix the navigation issue in LoginVC
Key Prompts:
new-native-swiftui-screen — generates full SUIBaseView + ViewModel.
new-uikit-screen — generates TTBaseUIViewController + CustomView + ViewModel.
new-api-service — generates API service with proper error handling.
📚 Instruction Files
11 instruction files automatically apply architecture rules per file type. Copilot uses them to understand how each layer should be structured.
← Back to AI Agents Hub