← 返回
内容创作 中文

Swift Architecture Skill

Agent Skill for Swift architecture design and implementation patterns, with architecture-specific playbooks and review checklists. Use when designing new fea...
代理技能,用于Swift架构设计与实现模式,提供针对特定架构的 playbook 和审查清单,适用于设计新功能时...
efremidze
内容创作 clawhub v0.3.1 1 版本 99902.5 Key: 无需
★ 0
Stars
📥 1,025
下载
💾 42
安装
1
版本
#latest

概述

Swift Architecture Skill

Overview

Use this skill to pick the best Swift architecture playbook for SwiftUI/UIKit codebases and apply it to the user’s task.

Workflow

Step 1: Analyze the Request Context

Before selecting an architecture, capture:

  • task type (new feature, refactor, PR review, debugging)
  • UI stack (SwiftUI, UIKit, or mixed)
  • scope (single screen, multi-screen, app-wide)
  • existing conventions to preserve

Step 2: Select the Architecture

If the user explicitly names an architecture, treat it as the initial candidate and run a fit check before committing:

  • validate against UI stack fit (SwiftUI/UIKit/mixed), state complexity, effect orchestration needs, team familiarity, and existing codebase conventions
  • if it fits, proceed with the requested architecture
  • if it mismatches key constraints, explicitly explain the mismatch and recommend the closest-fit alternative from references/selection-guide.md
  • if the user still insists on a mismatched architecture, proceed with a risk-mitigated plan and state the risks up front

When no architecture is named, load references/selection-guide.md and infer the best fit from stated constraints (state complexity, team familiarity, testing goals, effect orchestration needs, and framework preferences). Explain the recommendation briefly.

Architecture reference mapping:

  • MVVM → references/mvvm.md
  • MVI → references/mvi.md
  • TCA → references/tca.md
  • Clean Architecture → references/clean-architecture.md
  • VIPER → references/viper.md
  • Reactive → references/reactive.md

Step 3: Analyze Existing Codebase (When Applicable)

When code already exists:

  • detect current architecture and DI style
  • note concurrency model (async/await, Combine, GCD, mixed)
  • align recommendations to local conventions

Step 4: Produce Concrete Deliverables

Read the selected architecture reference and convert its guidance into deliverables tailored to the user's request:

  • File and module structure: directory layout with file names specific to the feature
  • State and dependency boundaries: concrete types, protocols, and injection points
  • Async strategy: cancellation, actor isolation, and error paths
  • Testing strategy: what to test, how to stub dependencies, and example test structure
  • Migration path (for refactors): incremental steps to move from current to target architecture
  • UI stack adaptation: where SwiftUI and UIKit guidance should differ for the chosen architecture

Step 5: Validate with Checklist

End with the architecture-specific PR review checklist from the reference file, adapted to the user's feature.

Output Requirements

  • Keep recommendations scoped to the requested feature or review task.
  • Prefer protocol-based dependency injection and explicit state modeling.
  • Flag anti-patterns found in existing code and provide direct fixes.
  • Include cancellation and error handling in all async flows.
  • For explicit architecture requests, include a short fit result (fit or mismatch) with 1-2 reasons.
  • For mismatch cases, include one closest-fit alternative and why it better matches the stated constraints.
  • When writing code, include only the patterns relevant to the task — do not dump entire playbooks.
  • Treat reference snippets as illustrative by default; add full compile scaffolding only if the user asks for runnable code.
  • Ask only minimum blocking questions; otherwise proceed with explicit assumptions stated up front.
  • When reviewing PRs, use the architecture-specific checklist and call out specific violations with line-level fixes.

版本历史

共 1 个版本

  • v0.3.1 当前
    2026-03-29 07:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Swift Patterns

efremidze
审查、重构或构建 SwiftUI 功能,确保状态管理正确、现代 API 使用、视图组合最优、导航模式以及性能优化
★ 0 📥 208
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 136,547
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 861 📥 200,188