算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
swift-review【设计与创意】Reviews Swift/Xcode codebases, pull requests, local changes, or individual files against Swift best practices including Google's Swift Style Guide, Apple's API Design Guidelines, build performance, memory management, and testing standards. Use this skill whenever the user asks to review Swift code, audit a Swift PR, check Swift style, review an Xcode…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Review Swift code against industry best practices drawn from Google's Swift Style Guide, Apple's API Design Guidelines, Apple's performance and memory documentation, and real-world patterns from Apple's open-source projects.
Figure out what to review based on the user's request:
| Request | How to get the code |
|---|---|
| "Review this PR" / PR URL | gh pr diff <number> or read the diff |
| "Review my changes" | git diff (unstaged) and git diff --cached (staged) |
| "Review this file" / path | Read the file(s) directly |
| "Review the codebase" | Glob for **/*.swift files, prioritize by size/complexity |
| Xcode project review | Also check *.xcodeproj, Package.swift, build settings |
When reviewing diffs, always read surrounding context (the full file or function) to understand intent — don't review isolated hunks.
Work through these categories in order. For each finding, cite the file, line, and the specific guideline being violated. Skip categories that don't apply to the scope.
Read references/api-design.md for the complete rules.
Key checks:
UpperCamelCase, everything else uses lowerCamelCasex.insert(y, at: z)greeting not string-ed/-ing conventionisEmpty, isValidmake-able/-ible for capabilitiesmin, max, URL)Read references/code-style.md for the complete rules.
Key checks:
// comments only, never /* */let/var declaration@testable// MARK: comments to organize type members[Element], dictionaries [Key: Value], optionals T?Read references/swift-patterns.md for the complete rules.
Key checks:
guard for early exits instead of nested if blocksfor-where instead of for + single if bodyOptional over sentinel values (-1, empty string)!) without a comment explaining the invariant@IBOutlet and test fixturesinternallet over var when value doesn't changestruct, enum) over class when no identity neededget when read-onlyRead references/performance.md for the complete rules.
Key checks:
AnyObject, Any — prefer concrete or generic types@objc or dynamic unless needed for Objective-C interopfinal on classes not designed for inheritance (enables compiler optimizations)Read references/memory-management.md for the complete rules.
Key checks:
[weak self] or [unowned self] appropriatelyweak preferred over unowned unless lifetime is guaranteedweak vardeinit or on memory warningsNSCache with count/cost limits; deterministic
maps or non-discardable data may use bounded dictionariesRead references/testing.md for the complete rules.
Key checks:
test_<condition>_<expectedResult>setUp() / tearDown() used for shared fixtures, not duplicated in every testKey checks:
/// doc comments with summary, parameters, returns, throws/** */ block comment syntaxParameter, Returns, Throws tags in that orderKey checks:
@Sendable closures don't capture mutable stateMainActor for UI updatesnonisolated used intentionallyasync let, TaskGroup) preferred over unstructured Task {}Structure the review as:
## Summary
<1-2 sentence overall assessment>
## Findings
### Critical
<issues that will cause bugs, crashes, or data loss>
### Important
<style violations, performance issues, missing tests>
### Suggestions
<minor improvements, alternative approaches>
## What's Done Well
<2-3 things the code does right — always include this>
For each finding, include:
Sources/Auth/TokenManager.swift:42Keep findings actionable. Don't flag things that are clearly intentional project conventions unless they cause real problems.