agentleFS
BenknightdarkBenknightdark/neo-skills/skills/neo-swift-ui/SKILL.md

neo-swift-ui

Skill7 starsChanged 6 months agoMITView on GitHub

Use this skill when building, debugging, refactoring, or reviewing SwiftUI apps or views for iOS 16+ and related Apple platforms. Trigger for NavigationStack, Observation/state flow, view composition, previews, performance, accessibility, and SwiftUI architecture.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow SwiftUI core principles to write concise, declarative Swift code.

    line 31
  2. Very specific:

    Use Grid, ViewThatFits, or custom Layout protocols to implement complex layouts.

    line 32
  3. Very specific:

    Check for "God Views" (views with excessive logic or body content) and suggest splitting them.

    line 35
  4. Very specific:

    Ensure @State and @Binding are used correctly to avoid unnecessary view refreshes.

    line 36
  5. Distinctive:

    Verify that the UI remains fluid and adheres to Apple's Human Interface Guidelines (HIG).

    line 37
  6. Very specific:

    Declarative Style: Keep the view tree structure clear and avoid writing complex logic within body.

    line 58
  7. Very specific:

    Preview Guidelines: Use the #Preview macro for rapid development, testing across multiple environment settings (Dark Mode, different …

    line 60
  8. Distinctive:

    Type Safety: Prefer strongly typed navigation paths and environment keys.

    line 61
  9. Distinctive:

    Ensure code compiles without warnings and uses the best available APIs for the target version.

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Modern SwiftUI (iOS 16+) Expert Skill

Trigger On

  • The user asks to write, debug, refactor, or review SwiftUI code.
  • The target project version is iOS 16 or higher (utilizing features like NavigationStack, Grid, etc.).
  • Development involves state management (@State, @Observable), custom layouts, or animations.

Workflow

  1. Perceive (Version and Environment Awareness):
    • Confirm if the deployment target is iOS 16+.
    • Identify the current state management paradigm (traditional ObservableObject vs. modern @Observable).
    • Assess the usage of navigation components (check if deprecated NavigationView is still in use).
  2. Reason (Planning Phase):
    • Plan the view hierarchy to maximize reusability and minimize redundant body computations.
    • Enforce the use of NavigationStack or NavigationSplitView for navigation needs.
    • Select the correct data flow tools based on data lifecycle (State, Binding, Environment).
  3. Act (Execution Phase):
    • Follow SwiftUI core principles to write concise, declarative Swift code.
    • Use Grid, ViewThatFits, or custom Layout protocols to implement complex layouts.
    • Leverage modern modifiers (e.g., .sheet with detents).
  4. Validate (Standard Validation):
    • Check for "God Views" (views with excessive logic or body content) and suggest splitting them.
    • Ensure @State and @Binding are used correctly to avoid unnecessary view refreshes.
    • Verify that the UI remains fluid and adheres to Apple's Human Interface Guidelines (HIG).

Feature Roadmap (SwiftUI Evolution)

iOS 13.0 - 15.0 (Foundation Era)

  • Declarative Syntax: Core View protocol and body property.
  • State Management: @State, @Binding, @ObservedObject, @EnvironmentObject.
  • Basic Containers: VStack, HStack, ZStack, List.
  • Legacy Navigation: NavigationView and NavigationLink.

iOS 16.0 - 17.0 (Modern Era)

  • NavigationStack: Decoupled and data-driven navigation pattern.
  • Observation Framework: @Observable macro (Swift 5.9+) replacing ObservableObject.
  • Advanced Layouts: Grid, ViewThatFits, and Layout protocol.
  • Swift Charts: Native data visualization framework.

iOS 18.0+ (Latest Features)

  • SwiftUI Animations: New phase-based and keyframe-based animation APIs.
  • Interaction Enhancements: Improved Scroll View controls and gesture handling.

Coding Standards

  • Declarative Style: Keep the view tree structure clear and avoid writing complex logic within body.
  • Modularity: Split subviews into independent structs instead of computed properties.
  • Preview Guidelines: Use the #Preview macro for rapid development, testing across multiple environment settings (Dark Mode, different locales).
  • Type Safety: Prefer strongly typed navigation paths and environment keys.

Deliver

  • Version-Optimized Code: Provide code utilizing iOS 16+ features (e.g., NavigationStack, presentationDetents).
  • Modular View Components: Deconstruct large views into single-responsibility, reusable components.
  • Modern State Management: Prioritize the @Observable pattern for projects supporting Swift 5.9+.

Validate

  • Ensure code compiles without warnings and uses the best available APIs for the target version.
  • Validate view body execution efficiency, ensuring no side effects are included.
  • Confirm that data flow follows the unidirectional flow principle whenever possible.

Documentation

Official References

Internal References

  • SwiftUI Coding Style and Naming Conventions
  • SwiftUI Anti-Patterns and Best Practices
  • Modern SwiftUI Patterns Guide

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.