swiftui-view-composition
Reviews SwiftUI view structure, composition, and animations — extracting subviews, button actions, TextField/TextEditor, Tab selection,
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Reviews SwiftUI view structure, composition, and animations — extracting subviews, button actions, TextField/TextEditor, Tab selection,
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | swiftui-view-composition |
| description | Reviews SwiftUI view structure, composition, and animations — extracting subviews, button actions, TextField/TextEditor, Tab selection, |
View structs (each in its own file) over breaking body into computed properties or methods that return some View, even with @ViewBuilder. This is so important it's worth stating twice.body properties; break them into extracted subviews.private helper some View properties is acceptable when they (a) belong to the same concern as body and (b) would fit cleanly inline at an acceptable length. Otherwise, extract..task(), .onAppear(), or anywhere in body.Use TextField with axis: .vertical (and optionally .lineLimit(5...)) instead of TextEditor, unless a full-screen editing experience is needed — TextField supports placeholder text.
Pass actions directly when possible:
// Good
Button("Label", systemImage: "plus", action: myAction)
// Avoid
Button("Label", systemImage: "plus") { myAction() }
For rendering SwiftUI views to images, use ImageRenderer rather than UIGraphicsImageRenderer.
Use #Preview { ... } macros, not the legacy PreviewProvider protocol.
With TabView(selection:), bind to an enum, not an Int / String:
Tab("Home", systemImage: "house", value: .home) { HomeView() }
Prefer the @Animatable macro over hand-rolling animatableData. It adds Animatable conformance and synthesizes the property. Mark properties that should not animate (Booleans, ints, etc.) with @AnimatableIgnored.
Never use animation(_:) without a value-to-watch. Always: .animation(.bouncy, value: score).
Chain animations using the completion: closure on withAnimation, not multiple withAnimation calls with delays:
Button("Animate Me") {
withAnimation {
scale = 2
} completion: {
withAnimation {
scale = 1
}
}
}
This guidance is adapted from the SwiftUI Pro agent skill by Paul Hudson (MIT-licensed).
Searches public and structured sources for a target company (A-share, HK, US, or private) and produces a Chinese rough-read gate or structured research report. Optimized for price-first company screening: valuation gate, bottom type, red flags, business snapshot, financial quality, and whether the company deserves deeper research. Every quantitative claim must be traceable to a logged source. Use when researching a listed company, supplier, customer, competitor, or acquisition target.
Generates Chinese patent disclosure packages from invention notes, prior-art references, and optional Notion context. Use when researching patent background, drafting disclosure sections, or running an end-to-end patent disclosure workflow.
Designs intuitive Python library APIs following principles of simplicity, consistency, and discoverability. Handles API evolution, deprecation, breaking changes, and error handling. Use when designing new library APIs, reviewing existing APIs for improvements, or managing API versioning and deprecations.
Builds command-line interfaces for Python libraries using Click or Typer. Includes command groups, argument handling, progress bars, shell completion, and CLI testing with CliRunner. Use when adding CLI functionality to a library or building standalone command-line tools.
Improves Python library code quality through ruff linting, mypy type checking, Pythonic idioms, and refactoring. Use when reviewing code for quality issues, adding type hints, configuring static analysis tools, or refactoring Python library code.
Builds and manages open source Python library communities including CONTRIBUTING.md, CODE_OF_CONDUCT.md, issue/PR templates, contributor recognition, and GitHub automation. Use when setting up community infrastructure, improving contributor experience, or managing project governance.