xxf-coding-style

Enforce Swift coding standards for file organization and naming conventions.

6|1|Updated May 22, 2025
One-click install
npx skills add https://github.com/NBXXF/xxf_ios --skill xxf-coding-style
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xxf-coding-style
Source: https://github.com/NBXXF/xxf_ios/tree/main/skills/xxf-coding-style
Command: npx skills add https://github.com/NBXXF/xxf_ios --skill xxf-coding-style

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This coding standard addresses the drift in Swift codebases by enforcing disciplined file organization, disciplined extension separation, and consistent naming, ensuring maintainability and scalability across iOS projects.

Core Features & Use Cases

  • One-core-type-per-file enforcement: each Swift type (class/struct/enum/protocol) lives in its own file to improve navigation and review.
  • Dedicated extensions per responsibility: extensions are split into separate files by feature or protocol, reducing merged diffs and improving readability.
  • Consistency in naming and access control: promotes upperCamelCase for types, lowerCamelCase for members, final by default, private by default, and safe optional handling.
  • Documentation mindset: all public APIs and significant members must carry documentation comments to support onboarding and code comprehension.
  • Use cases: a new feature team adopting this standard will incrementally refactor existing files, create new modules with clean separations, and enforce builds with lint checks.

Quick Start

Start by applying the file organization rules to your next module and splitting the main type and its extensions into dedicated files.

Frequently Asked Questions about xxf-coding-style

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

FAQPage Schema
How do I enforce Swift coding standards for file organization and extension separation?

To enforce Swift coding standards, apply a one-core-type-per-file rule and split extensions into dedicated files by feature or protocol. This separation reduces merged diffs and improves code navigation and readability across iOS projects.

What are the best practices for Swift naming conventions and access control in iOS projects?

Best practices for Swift naming conventions dictate using upperCamelCase for types and lowerCamelCase for members. For access control, declare classes as final and members as private by default to ensure safe scoping and maintainability.

Can I use these Swift coding standards to integrate CI checks for consistent code quality?

Yes, these Swift coding standards can be integrated into CI checks to maintain consistent code quality. The guide serves as a reference for developers to enforce file organization, documentation, and safe coding practices during builds.

When do I need to add documentation comments for Swift APIs?

You need to add documentation comments for Swift APIs when declaring public interfaces and significant members. This documentation mindset supports onboarding and code comprehension across the iOS project.

Does this Swift coding standard require safe optional handling and final classes by default?

Yes, this Swift coding standard requires safe optional handling and final classes by default. Promoting these practices along with private scoping ensures safe coding and prevents unintended inheritance across iOS modules.