package-swift-cleanup

Clean Package.swift files by removing obsolete dependencies and regenerating targets.

30|8|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/PacktPublishing/AI-Driven-Swift-Architecture --skill package-swift-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: package-swift-cleanup
Source: https://github.com/PacktPublishing/AI-Driven-Swift-Architecture/tree/main/Skills/package-swift-cleanup
Command: npx skills add https://github.com/PacktPublishing/AI-Driven-Swift-Architecture --skill package-swift-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Maintains accurate, self-consistent Package.swift configurations to reflect the true architecture, reducing drift between modules and dependencies.

Core Features & Use Cases

  • Classify dependencies into ExternalModule, Utility, and AbstractionModule to mirror architectural intent.
  • Represent Domain-Scoped Data Modules as targets and enums for a coherent, scalable package graph.
  • Cleanup obsolete dependencies, remove empty enums, and ensure Package.swift describes the current architecture across all feature packages.

Quick Start

Audit the repository for unused dependencies and execute the cleanup workflow to refresh Package.swift according to the current architecture.

Frequently Asked Questions about package-swift-cleanup

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

FAQPage Schema
How do I remove unused dependencies from a Swift Package.swift file?

To remove unused dependencies from a Package.swift file, you audit the repository for obsolete references and execute a cleanup workflow that regenerates targets and refreshes the configuration to reflect the current architecture.

What is the best way to maintain Package.swift alignment with a Clean Architecture in Swift?

Maintaining Package.swift alignment with Clean Architecture involves classifying dependencies into ExternalModule, Utility, and AbstractionModule types, ensuring the package graph accurately mirrors your architectural intent across multiple feature packages.

How do I refactor module graphs in a Swift package without breaking feature targets?

Refactoring module graphs requires regenerating targets within Package.swift to reflect the actual codebase, removing empty enums and obsolete dependencies to ensure configuration remains self-consistent across all feature packages.

Can I represent domain-scoped data modules as targets and enums in Package.swift?

Yes, you can represent Domain-Scoped Data Modules as targets and enums within Package.swift, creating a coherent and scalable package graph that explicitly encodes your architectural conventions.

When should I clean up obsolete dependencies and empty enums in my Swift package configuration?

You should clean up obsolete dependencies and empty enums when your codebase undergoes refactoring, ensuring Package.swift describes the current architecture accurately and reducing drift between modules and dependencies.