Files
tsl-devkit/skills/thirdparty/ui-ux-pro-max/data/stacks/swiftui.csv
T
csh 3d83740f88 Squashed 'docs/standards/playbook/' changes from c3f8137..25d895d
25d895d 🐛 fix(gitea_workflow): clean up temp repos after job steps
2bc3b11 🐛 fix(gitea_workflow): clean up temporary repo dirs in workflows
98c3f30 📝 docs(agent_rules): allow plan execution on current branch
16c7230 📝 docs(prompts): define custom verify layering
8efc4dd 🐛 fix(skills): quote commit-message description
bc8498f 🐛 fix(ci): install tomli for gitea tests
55cda3b 🐛 fix(tests): report missing toml parser clearly
c0729c7 🐛 fix(playbook): import Optional for cli compatibility
63e24bf 📦 deps(skills): sync thirdparty skills
d2f9356 🐛 fix(ci): isolate gitea workflow repos
588b81d 🐛 fix(ci): inline gitea workflow bootstrap
e0b1c3a ♻️ refactor(skills): standardize first-party skill contracts
2c5050d ♻️ refactor(skills): rename repo skills source dir
f049dfb 📦 deps(skills): drop duplicate first-party superpowers skills
234b335  feat(workflow): add superpowers planning and execution state tracking
c1702a6 📝 docs(markdown): format tracked markdown and drop stale templates
2325409 📝 docs(markdown): clarify optional markdownlint usage
214c44e 🔧 chore(markdown): add markdownlint baseline and lint fixes
a22b324 📝 docs(templates): add execution and memory-bank prompt templates
223a797 📝 docs(templates): update README for Claude Code and current features
4ac8672 📝 docs: simplify README + platform-agnostic tools + auto-create local rules
2431c9d 📝 docs: add claude_md config and use cross-platform paths
d64b248 📝 docs: fix README.md inaccuracies and add Claude Code info
c8d6bf2 🐛 fix(playbook): use relative paths in CLAUDE.md when not at project root
6518f0f  feat(playbook): auto-create CLAUDE.md with path discovery
6ec9a45  feat(skills): add skill_link symlink support + platform-agnostic prompt
9f8b6b5 📝 docs: update README and config example for Claude Code support
79cff6c 📝 docs(skills): add Claude Code platform support
452c6f5  feat(playbook): auto-inject AGENTS.md into CLAUDE.md
e1dbf3c 🐛 fix(skills): remove dual-path from commit-message skill
f3a7259 🔧 chore(ci): use prepare_repo.sh in both workflows
da08212 🔧 chore(ci): extract prepare_repo.sh and clean up workflows
7ade85e 🗑️ remove(tsl): drop syntax_book/, data/ source and build script
f94dba0 ♻️ refactor(skills): update playbook.py and tests for thirdparty/ layout
b3df412 ♻️ refactor(skills): separate thirdparty skills into thirdparty/ subdirectory
64950e7 📦 deps(skills): sync thirdparty skills
a2e3cb0  feat(playbook): add no_backup deploy controls
8609d59 🐛 fix(docs): repair reference catalog source links
956da11 🐛 fix(playbook): publish hidden ci test fixes
3f67754 📦 deps(skills): sync thirdparty skills
08ca87b 📦 deps(skills): add karpathy thirdparty sync
96b705b 📝 docs(tsl): rebuild canonical syntax and routing manual
3ed5052 📦 deps(skills): sync thirdparty skills
60108dd 📦 deps(skills): sync thirdparty skills
da85d4e 🐛 fix(thirdparty): prune nested project snapshots
a2a697e 📦 deps(skills): sync thirdparty skills
9df610a 🐛 fix(thirdparty): exclude duplicated superpowers skills
33dd5bb 🐛 fix(thirdparty): preserve optional manifest fields
91b0ea7 🐛 fix(thirdparty): preserve manifest during snapshot update
2e26f98 🔧 chore(thirdparty): generalize skills sync pipeline
5b9c1e3 📦 deps(skills): sync superpowers
2f2d34a 📝 docs(readme): normalize subtree command spacing
62db7db 🐛 fix(ci): serialize superpowers update and sync
3463223 🐛 fix(ci): use literal superpowers sync paths
48f6de8 📦 deps(skills): sync superpowers
4b23529 🔧 chore(ci): merge superpowers update and sync workflow
a56d75b 📦 deps(skills): sync superpowers
84bcefa 🔧 chore(ci): use ci[bot] commit author name
00a07e5 📦 deps(skills): sync superpowers
7b84daf 🐛 fix(templates): enforce main loop progress tracking
51373d7 🔧 chore(ci): automate superpowers sync workflow
eaaa39c 🐛 fix(ci): prevent stale superpowers sync from restoring skills block
79755c6 📦 deps(skills): sync superpowers
836d878 📦 deps(skills): sync superpowers
8216c9f 📦 deps(skills): sync superpowers
9439505 🐛 fix(playbook): address reported repo issues

git-subtree-dir: docs/standards/playbook
git-subtree-split: 25d895d8b3f56624ccfe99ad7289e9eb49e0f316
2026-05-24 13:04:14 +08:00

11 KiB

1NoCategoryGuidelineDescriptionDoDon'tCode GoodCode BadSeverityDocs URL
21ViewsUse struct for viewsSwiftUI views are value typesstruct MyView: Viewclass MyView: Viewstruct ContentView: View { var body: some View }class ContentView: ViewHighhttps://developer.apple.com/documentation/swiftui/view
32ViewsKeep views small and focusedSingle responsibility for each viewExtract subviews for complex layoutsLarge monolithic viewsExtract HeaderView FooterView500+ line View structMedium
43ViewsUse body computed propertybody returns the view hierarchyvar body: some View { }func body() -> some Viewvar body: some View { Text("Hello") }func body() -> TextHigh
54ViewsPrefer composition over inheritanceCompose views using ViewBuilderCombine smaller viewsInheritance hierarchiesVStack { Header() Content() }class SpecialView extends BaseViewMedium
65StateUse @State for local stateSimple value types owned by view@State for view-local primitives@State for shared data@State private var count = 0@State var sharedData: ModelHighhttps://developer.apple.com/documentation/swiftui/state
76StateUse @Binding for two-way dataPass mutable state to child views@Binding for child input@State in child for parent data@Binding var isOn: Bool$isOn to pass bindingMediumhttps://developer.apple.com/documentation/swiftui/binding
87StateUse @StateObject for reference typesObservableObject owned by view@StateObject for view-created objects@ObservedObject for owned objects@StateObject private var vm = ViewModel()@ObservedObject var vm = ViewModel()Highhttps://developer.apple.com/documentation/swiftui/stateobject
98StateUse @ObservedObject for injected objectsReference types passed from parent@ObservedObject for injected dependencies@StateObject for injected objects@ObservedObject var vm: ViewModel@StateObject var vm: ViewModel (injected)Highhttps://developer.apple.com/documentation/swiftui/observedobject
109StateUse @EnvironmentObject for shared stateApp-wide state injection@EnvironmentObject for global stateProp drilling through views@EnvironmentObject var settings: SettingsPass settings through 5 viewsMediumhttps://developer.apple.com/documentation/swiftui/environmentobject
1110StateUse @Published in ObservableObjectAutomatically publish property changes@Published for observed propertiesManual objectWillChange calls@Published var items: [Item] = []var items: [Item] { didSet { objectWillChange.send() } }Medium
1211ObservableUse @Observable macro (iOS 17+)Modern observation without Combine@Observable class for view modelsObservableObject for new projects@Observable class ViewModel { }class ViewModel: ObservableObjectMediumhttps://developer.apple.com/documentation/observation
1312ObservableUse @Bindable for @ObservableCreate bindings from @Observable@Bindable var vm for bindings@Binding with @Observable@Bindable var viewModel$viewModel.name with @ObservableMedium
1413LayoutUse VStack HStack ZStackStandard stack-based layoutsStacks for linear arrangementsGeometryReader for simple layoutsVStack { Text() Image() }GeometryReader for vertical listMediumhttps://developer.apple.com/documentation/swiftui/vstack
1514LayoutUse LazyVStack LazyHStack for listsLazy loading for performanceLazy stacks for long listsRegular stacks for 100+ itemsLazyVStack { ForEach(items) }VStack { ForEach(largeArray) }Highhttps://developer.apple.com/documentation/swiftui/lazyvstack
1615LayoutUse GeometryReader sparinglyOnly when needed for sizingGeometryReader for responsive layoutsGeometryReader everywhereGeometryReader for aspect ratioGeometryReader wrapping everythingMedium
1716LayoutUse spacing and padding consistentlyConsistent spacing throughout appDesign system spacing valuesMagic numbers for spacing.padding(16) or .padding().padding(13), .padding(17)Low
1817LayoutUse frame modifiers correctlySet explicit sizes when needed.frame(maxWidth: .infinity)Fixed sizes for responsive content.frame(maxWidth: .infinity).frame(width: 375)Medium
1918ModifiersOrder modifiers correctlyModifier order affects renderingBackground before padding for full coverageWrong modifier order.padding().background(Color.red).background(Color.red).padding()High
2019ModifiersCreate custom ViewModifiersReusable modifier combinationsViewModifier for repeated stylingDuplicate modifier chainsstruct CardStyle: ViewModifier.shadow().cornerRadius() everywhereMediumhttps://developer.apple.com/documentation/swiftui/viewmodifier
2120ModifiersUse conditional modifiers carefullyAvoid changing view identityif-else with same view typeConditional that changes view identityText(title).foregroundColor(isActive ? .blue : .gray)if isActive { Text().bold() } else { Text() }Medium
2221NavigationUse NavigationStack (iOS 16+)Modern navigation with type-safe pathsNavigationStack with navigationDestinationNavigationView for new projectsNavigationStack { }NavigationView { } (deprecated)Mediumhttps://developer.apple.com/documentation/swiftui/navigationstack
2322NavigationUse navigationDestinationType-safe navigation destinations.navigationDestination(for:)NavigationLink(destination:).navigationDestination(for: Item.self)NavigationLink(destination: DetailView())Medium
2423NavigationUse @Environment for dismissProgrammatic navigation dismissal@Environment(\.dismiss) var dismisspresentationMode (deprecated)@Environment(\.dismiss) var dismiss@Environment(\.presentationMode)Low
2524ListsUse List for scrollable contentBuilt-in scrolling and stylingList for standard scrollable contentScrollView + VStack for simple listsList { ForEach(items) { } }ScrollView { VStack { ForEach } }Lowhttps://developer.apple.com/documentation/swiftui/list
2625ListsProvide stable identifiersUse Identifiable or explicit idIdentifiable protocol or id parameterIndex as identifierForEach(items) where Item: IdentifiableForEach(items.indices, id: \.self)High
2726ListsUse onDelete and onMoveStandard list editingonDelete for swipe to deleteCustom delete implementation.onDelete(perform: delete).onTapGesture for deleteLow
2827FormsUse Form for settingsGrouped input controlsForm for settings screensManual grouping for formsForm { Section { Toggle() } }VStack { Toggle() }Lowhttps://developer.apple.com/documentation/swiftui/form
2928FormsUse @FocusState for keyboardManage keyboard focus@FocusState for text field focusManual first responder handling@FocusState private var isFocused: BoolUIKit first responderMediumhttps://developer.apple.com/documentation/swiftui/focusstate
3029FormsValidate input properlyShow validation feedbackReal-time validation feedbackSubmit without validationTextField with validation stateTextField without error handlingMedium
3130AsyncUse .task for async workAutomatic cancellation on view disappear.task for view lifecycle asynconAppear with Task.task { await loadData() }onAppear { Task { await loadData() } }Mediumhttps://developer.apple.com/documentation/swiftui/view/task(priority:_:)
3231AsyncHandle loading statesShow progress during async operationsProgressView during loadingEmpty view during loadif isLoading { ProgressView() }No loading indicatorMedium
3332AsyncUse @MainActor for UI updatesEnsure UI updates on main thread@MainActor on view modelsManual DispatchQueue.main@MainActor class ViewModelDispatchQueue.main.asyncMedium
3433AnimationUse withAnimationAnimate state changeswithAnimation for state transitionsNo animation for state changeswithAnimation { isExpanded.toggle() }isExpanded.toggle()Lowhttps://developer.apple.com/documentation/swiftui/withanimation(_:_:)
3534AnimationUse .animation modifierApply animations to views.animation(.spring()) on viewManual animation timing.animation(.easeInOut)CABasicAnimation equivalentLow
3635AnimationRespect reduced motionCheck accessibility settingsCheck accessibilityReduceMotionIgnore motion preferences@Environment(\.accessibilityReduceMotion)Always animate regardlessHigh
3736PreviewUse #Preview macro (Xcode 15+)Modern preview syntax#Preview for view previewsPreviewProvider protocol#Preview { ContentView() }struct ContentView_Previews: PreviewProviderLow
3837PreviewCreate multiple previewsTest different states and devicesMultiple previews for statesSingle preview only#Preview("Light") { } #Preview("Dark") { }Single preview configurationLow
3938PreviewUse preview dataDedicated preview mock dataStatic preview dataProduction data in previewsItem.preview for previewFetch real data in previewLow
4039PerformanceAvoid expensive body computationsBody should be fast to computePrecompute in view modelHeavy computation in bodyvm.computedValue in bodyComplex calculation in bodyHigh
4140PerformanceUse Equatable viewsSkip unnecessary view updatesEquatable for complex viewsDefault equality for all viewsstruct MyView: View EquatableNo Equatable conformanceMedium
4241PerformanceProfile with InstrumentsMeasure before optimizingUse SwiftUI InstrumentsGuess at performance issuesProfile with InstrumentsOptimize without measuringMedium
4342AccessibilityAdd accessibility labelsDescribe UI elements.accessibilityLabel for contextMissing labels.accessibilityLabel("Close button")Button without labelHighhttps://developer.apple.com/documentation/swiftui/view/accessibilitylabel(_:)-1d7jv
4443AccessibilitySupport Dynamic TypeRespect text size preferencesScalable fonts and layoutsFixed font sizes.font(.body) with Dynamic Type.font(.system(size: 16))High
4544AccessibilityUse semantic viewsProper accessibility traitsCorrect accessibilityTraitsWrong semantic meaningButton for actions Image for displayImage that acts like buttonMedium
4645TestingUse ViewInspector for testingThird-party view testingViewInspector for unit testsUI tests onlyViewInspector assertionsOnly XCUITestMedium
4746TestingTest view modelsUnit test business logicXCTest for view modelSkip view model testingTest ViewModel methodsNo unit testsMedium
4847TestingUse preview as visual testPreviews catch visual regressionsMultiple preview configurationsNo visual verificationPreview different statesSingle preview onlyLow
4948ArchitectureUse MVVM patternSeparate view and logicViewModel for business logicLogic in ViewObservableObject ViewModel@State for complex logicMedium
5049ArchitectureKeep views dumbViews display view model stateView reads from ViewModelBusiness logic in Viewview.items from vm.itemsComplex filtering in ViewMedium
5150ArchitectureUse dependency injectionInject dependencies for testingInitialize with dependenciesHard-coded dependenciesinit(service: ServiceProtocol)let service = RealService()Medium