structure-swift-sources

Reorganize Swift source trees and split oversized files by line-count thresholds.

6|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/gaelic-ghost/socket --skill structure-swift-sources
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: structure-swift-sources
Source: https://github.com/gaelic-ghost/socket/tree/main/plugins/apple-dev-skills/skills/structure-swift-sources
Command: npx skills add https://github.com/gaelic-ghost/socket --skill structure-swift-sources

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires PyYAML, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Swift repositories often become difficult to maintain when source files grow too large, layout lacks feature‑layer organization, headers are missing or inconsistent, and TODO/FIXME comments clutter the codebase.

Core Features & Use Cases

  • File splitting: Detects oversized Swift files and splits them according to configurable line‑count thresholds.
  • Layout normalization: Reorganizes files into feature‑and‑layer directories for Swift packages or Xcode projects.
  • Header and ledger cleanup: Normalizes structured block‑comment headers and extracts TODO/FIXME entries into ledger files.

Quick Start

Run the structure‑swift‑sources skill on my Swift project to reorganize files, split large sources, and normalize headers.

Frequently Asked Questions about structure-swift-sources

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

FAQPage Schema
How do I split oversized Swift files in my Xcode project?

Split oversized Swift files by applying configurable line-count thresholds that detect and divide large sources. This skill reorganizes Swift source trees for Xcode app projects and Swift packages.

What is the best way to reorganize a Swift package into a feature-layer directory layout?

Reorganize a Swift package by applying layout normalization that sorts files into feature-and-layer directories. This restructuring improves maintainability for Swift packages and mixed repositories.

How do I normalize block-comment headers and extract TODO comments in Swift?

Normalize Swift headers and extract TODO comments by applying structured block-comment policies and moving TODO/FIXME entries into ledger files, standardizing source file headers and removing codebase clutter.

Does the structure-swift-sources skill require any other formatting tools to run?

Yes, using this skill requires the format-swift-sources skill to establish baseline formatting before reorganizing files. It then uses internal scripts to enforce split thresholds, header policies, and TODO ledger extraction.

Can I use this Swift file splitter on mixed repositories containing both Swift packages and Xcode projects?

Yes, you can use this Swift file splitter on mixed repositories. It reorganizes source trees, splits large files, and normalizes headers across Swift packages, Xcode app projects, and mixed repository layouts.