nuke-migrate
Skill này làm gì
Skill này hướng dẫn việc nâng cấp một app Apple đang dùng thư viện tải ảnh Nuke lên phiên bản 14. Nó dành cho lập trình viên thấy lỗi build sau khi nâng cấp hoặc cần cập nhật thư viện.
Khi nào nên dùng
- ✓Khi bạn nâng phiên bản thư viện ảnh Nuke trong một app Apple.
- ✓Khi nâng cấp Nuke không biên dịch được và bạn cần các bước thay thế.
- ✓Khi bạn muốn gỡ NukeExtensions hoặc code Combine cũ khỏi app.
Liên kết skill
https://github.com/kean/Nuke/blob/main/skills/nuke-migrate/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Nâng cấp app iPhone của tôi từ Nuke 13 lên Nuke 14 và kiểm tra những đoạn code vẫn biên dịch được nhưng không còn hoạt động đúng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill kiểm tra phiên bản và các nền tảng đích của app, liệt kê các đoạn code rủi ro mà trình biên dịch sẽ không báo, rồi cập nhật từng chỗ theo từng bước.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Migrating to Nuke 14
The compiler finds most of this migration, and its errors name the replacements. What it can't find is the dangerous part: code that keeps compiling and stops working. A green build doesn't mean the migration is done. Follow the steps in order.
1. Check that the app can move
grep -A6 '"identity" : "nuke"' Package.resolved *.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
grep -rnE 'IPHONEOS_DEPLOYMENT_TARGET|\.iOS\(' --include='*.pbxproj' --include='Package.swift' .
git ls-remote --tags https://github.com/kean/Nuke 'refs/tags/14.*'
If there's no Package.resolved, read the version from Package.swift. Nuke 14 needs iOS 16, tvOS 16, macOS 13, watchOS 9, or visionOS 1, and Xcode 26.0 with Swift 6.2. If the app deploys to something lower, stop and ask. The choice is between raising the target and staying on 13.x, which still gets fixes, and it isn't yours to make.
If the app is on 12.x or earlier, read From Nuke 12 or earlier as well.
2. List what the compiler won't report
Do this before you touch the dependency, and keep the list. Every hit gets resolved in step 5, whatever the build says.
# Every conformance to the pipeline delegate
grep -rnE 'ImagePipeline\.Delegate|ImagePipelineDelegate' --include='*.swift' .
# `nil` passed to a LazyImage modifier, and modifiers that take an optional
grep -rnE '\.(processors|priority)\(' --include='*.swift' .
# Error text that reaches people, and errors matched by type in NukeUI callbacks
grep -rn 'localizedDescription' --include='*.swift' .
grep -rnE 'onCompletion|onFailure|\.result|state\.error' --include='*.swift' .
# Views that start playing animations, and repeated loads that used to restart the task
grep -rnE 'LazyImage\(|LazyImageView|FetchImage|onStart' --include='*.swift' .
# Anything that plays, parses, or inspects the encoded data of an image
grep -rnE 'container\.data|imageContainer\?*\.data|\.type == \.gif|Gifu|FLAnimatedImage|SwiftyGif|SDAnimatedImage|makeImageView' --include='*.swift' .
# Queues and prefetchers set by hand, and decoders of your own
grep -rnE 'maxConcurrentRequestCount|ImageDecoding\b|isAsynchronous' --include='*.swift' .
The search can't see through a typealias, or a signature split over lines. Open each file and read it.
3. Update the dependency
from: "14.0.0" doesn't match a prerelease. If the tags from step 1 only have betas, pin one:
.package(url: "https://github.com/kean/Nuke", exact: "14.0.0-beta.1")
In an Xcode project, change the version rule of the package, and remove the Package.resolved entry if it won't update. The product names are the same.
4. Fix what the compiler reports
Widely used removed APIs have a stub, and the compiler error says what to do: follow it. @available(*, unavailable) stubs can't cover a removed enum case or a property of a removed type, and those are in this table.
| Nuke 13 | Nuke 14 |
|---|---|
Nuke_ImageDisplaying, nuke_display(image:data:) |
ImageDisplaying, nuke_display(_ container: ImageContainer?) |
ImagePipelineDelegate |
ImagePipeline.Delegate |
imageId, .imageIdKey |
imageID |
.scaleKey, .thumbnailKey |
request.scale, request.thumbnail |
A userInfo dictionary with those keys |
A var request with the properties set. It no longer needs userInfo |
maximumDecodedImageSize |
ImageRequest.ThumbnailOptions, per request |
ImageRequest(url:, userInfo:) |
request.userInfo = … on a var |
imagePublisher(with:) |
image(for:), or imageTask(with:) and task.previews |
FetchImage.load(publisher) |
load { try await … } |
case .started in a delegate |
imageTaskDidStart(_:pipeline:) |
Float(displayScale) for scale or maxPixelSize |
Remove the conversion, they're CGFloat |
@ObservedObject var progress: FetchImage.Progress |
let progress: ImageTask.Progress, or read state.progress in place |
state.error as? ImagePipeline.Error |
state.error, which is typed |
lazyImageView.imageTask = … |
Read-only. Call cancel() or reset() |
dataCache.flush(for: key) |
await dataCache.flush(), which writes everything |
dataCache.queue |
Removed. Use await dataCache.flush() to wait for writes |
dataCache.flush(), dataCache.sweep() |
await them, so the caller becomes async, and so do its callers |
[String: Any] for coreImageFilter(name:parameters:identifier:) |
`[Stri |
Câu hỏi thường gặp
Build xanh có nghĩa là nâng cấp đã xong không?
Không. Skill nói rằng một build thành công không chứng minh quá trình chuyển đổi đã hoàn tất.
Nuke 14 cần những phiên bản nền tảng nào?
Skill liệt kê iOS 16, tvOS 16, macOS 13, watchOS 9 hoặc visionOS 1, cùng Xcode 26.
Nếu app của tôi dùng phiên bản cũ hơn thì sao?
Skill có một phần riêng cho việc nâng cấp từ Nuke 12 trở về trước.
Chi tiết
Mô tả gốc của tác giả
Upgrade an app to Nuke 14 from Nuke 13 or earlier. Use when bumping the Nuke, NukeUI, or NukeExtensions dependency, when a Nuke upgrade doesn't compile, or when asked to replace NukeExtensions, Combine publishers, or a hand-written GIF view with current Nuke APIs. Finds what the compiler can't report, such as pipeline delegate methods that compile and are never called.
repo: kean/Nuke
Độ phổ biến
- Sao GitHub
- 8.7k
- Vị trí xếp hạng
- #12332
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
Skill tương tự
android-clean-architecture
280kGiúp agent của bạn tổ chức dự án Android hiệu quả, cấu trúc code để việc bảo trì và phát triển tính năng mới dễ dàng hơn.
compose-multiplatform-patterns
280kGiúp agent của bạn dùng các mẫu Compose Multiplatform và Jetpack Compose trong dự án KMP, gồm trạng thái, điều hướng, giao diện và hiệu năng.
dart-flutter-patterns
280kGiúp agent của bạn viết code cho ứng dụng Dart và Flutter. Agent dùng các mẫu hiện đại để tạo ứng dụng vững chắc và dễ quản lý.