view-composition

Organize SwiftUI views using @ViewBuilder computed properties and naming conventions.

32|10|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/moasq/nanowave --skill view-composition
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: view-composition
Source: https://github.com/moasq/nanowave/tree/main/internal/orchestration/skills/ui/view-composition
Command: npx skills add https://github.com/moasq/nanowave --skill view-composition

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenge of organizing and structuring SwiftUI views to improve readability, maintainability, and reusability, especially in larger codebases.

Core Features & Use Cases

  • Modular View Design: Encourages breaking down complex views into smaller, manageable @ViewBuilder computed properties.
  • Code Organization: Provides clear guidelines on when to extract view components into separate structs or files based on size, reusability, or state management needs.
  • Naming Conventions: Establishes consistent naming patterns for view sections and action buttons to enhance code clarity.
  • Use Case: When building a detailed settings screen in a SwiftUI app, use this Skill to ensure each section (e.g., Account, Notifications, Privacy) is a distinct @ViewBuilder property, making the overall body a clean outline.

Quick Start

Apply the view composition rules to refactor the provided UserProfileView code.

Frequently Asked Questions about view-composition

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize SwiftUI views for better maintainability in large codebases?

To improve SwiftUI view maintainability, break complex views into smaller @ViewBuilder computed properties and extract reusable components into separate structs or files based on complexity and state management needs.

What is the best way to structure a complex SwiftUI settings screen?

The best way to structure a SwiftUI settings screen is to make each section a distinct @ViewBuilder computed property, keeping the main body property as a clean, readable outline of the overall UI layout.

When should I extract a SwiftUI view component into a separate file or struct?

You should extract a SwiftUI view component into a separate struct or file when the component requires independent state management, reaches a size that reduces readability, or needs to be reused across multiple screens.

How do @ViewBuilder computed properties help with SwiftUI code organization?

@ViewBuilder computed properties help SwiftUI code organization by allowing developers to modularize complex view hierarchies into smaller, manageable sections without creating entirely new view structs, keeping the main body clean.

Does this SwiftUI view composition approach require any specific external dependencies?

This SwiftUI view composition approach requires no external dependencies, relying entirely on native Swift features like @ViewBuilder computed properties and standard view structs to enforce code organization and naming conventions.