Skip to content
Back to skills

Swift Package Pro

ASecurity

Reviews Swift Package Manager libraries for public API design, module organization, dependency hygiene, and modern SPM features. Use when reading, writing, or reviewing Swift packages.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 27, 2026
ai-agentsswiftapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add kelvinkosbab/AppBootstrapAI --skill swift-package-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Swift Package Pro?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Swift Package Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kelvinkosbab-swift-package-pro/badge)](https://www.skillsdirectory.com/skills/kelvinkosbab-swift-package-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: swift-package-pro
description: Reviews Swift Package Manager libraries for public API design, module organization, dependency hygiene, and modern SPM features. Use when reading, writing, or reviewing Swift packages.
license: MIT
metadata:
  author: Kelvin Kosbab
  version: "1.0"
---

Review Swift Package Manager libraries for sound public API design, clean module organization, and modern SPM features. Report only genuine problems - do not nitpick or invent issues.

Review process:

1. Validate `Package.swift` structure and target organization using `references/module-organization.md`.
1. Check public API surface for correct access control using `references/public-api.md`.
1. Verify `public import` vs `import` usage matches `InternalImportsByDefault` rules using `references/public-api.md`.
1. Check resource handling for `.process` vs `.copy` correctness using `references/resources.md`.
1. Validate semantic versioning, `@available`, and deprecation patterns using `references/versioning.md`.
1. Check inter-module dependency graph for cycles or unnecessary coupling using `references/module-organization.md`.

If doing a partial review, load only the relevant reference files.


## Core Instructions

- Target Swift 6.0 or later with `.swiftLanguageMode(.v6)`.
- Prefer `InternalImportsByDefault` to make import visibility explicit and prevent accidental dependency re-export.
- Public API is a contract — adding a `public` declaration is easy, removing it is a breaking change. Default to `internal`.
- Each module should have a single, well-defined responsibility. Flag modules that mix unrelated concerns.
- Avoid third-party dependencies in foundational utility packages — they become transitive burdens for every consumer.
- Use `path:` parameters in `Package.swift` to define a per-module directory layout (`{Module}/Sources/`, `{Module}/Tests/`) — flat `Sources/` and `Tests/` directories don't scale.


## Output Format

Organize findings by file. For each issue:

1. State the file and relevant line(s).
2. Name the rule being violated.
3. Show a brief before/after code fix.

Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.

Example output:

### CoreUI/Sources/Spacing.swift

**Line 7: Unnecessary `public import` — `Foundation` types do not appear in this file's public API.**

```swift
// Before
public import Foundation

// After
import Foundation
```

### Package.swift

**Line 42: Target uses flat `Sources/Foo` path — prefer per-module directory layout.**

```swift
// Before
.target(name: "Foo", path: "Sources/Foo")

// After
.target(name: "Foo", path: "Foo/Sources")
```

### Summary

1. **Public API hygiene (high):** Three files mark `public import Foundation` unnecessarily — change to `import` to silence compiler warnings.
2. **Organization (medium):** `Package.swift` uses flat layout — migrate to per-module directories for scalability.

End of example.


## References

- `references/module-organization.md` — Target structure, per-module directory layout, helper functions, dependency graphs.
- `references/public-api.md` — Access control, `public import` vs `import`, `InternalImportsByDefault`, API stability.
- `references/resources.md` — Bundle resources, `.process` vs `.copy`, `Bundle.module`, SPM limitations (.xcdatamodeld).
- `references/versioning.md` — Semantic versioning, `@available`, `@_spi`, deprecation, breaking change checklist.

Files in this skill

  • SKILL.md3.4 KB
  • references/module-organization.md2.4 KB
  • references/public-api.md2.5 KB
  • references/resources.md2.4 KB
  • references/versioning.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.