agentleFS
kelvinkosbabkelvinkosbab/KozBon/.claude/skills/swift-package-pro/SKILL.md

swift-package-pro

Skill5 starsChanged 11 days agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check manifest mechanics (tools version, platforms, Swift settings, dependency pins, Package.resolved, plugins) using …

    line 15
  2. Very specific:

    Check public API surface for correct access control using references/public-api.md.

    line 16
  3. Very specific:

    Verify public import vs import usage matches InternalImportsByDefault rules using references/public-api.md.

    line 17
  4. Very specific:

    Check resource handling for .process vs .copy correctness using references/resources.md.

    line 18
  5. Very specific:

    Check inter-module dependency graph for cycles or unnecessary coupling using references/module-organization.md.

    line 20
  6. Distinctive:

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

    line 22
  7. Very specific:

    Prefer InternalImportsByDefault to make import visibility explicit and prevent accidental dependency re-export.

    line 28
  8. Distinctive:

    Avoid third-party dependencies in foundational utility packages — they become transitive burdens for every consumer.

    line 31
  9. Very specific:

    Use path: parameters in Package.swift to define a per-module directory layout ({Module}/Sources/, {Module}/Tests/) — flat Sources/ and …

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.
  2. Check manifest mechanics (tools version, platforms, Swift settings, dependency pins, Package.resolved, plugins) using references/manifest-conventions.md.
  3. Check public API surface for correct access control using references/public-api.md.
  4. Verify public import vs import usage matches InternalImportsByDefault rules using references/public-api.md.
  5. Check resource handling for .process vs .copy correctness using references/resources.md.
  6. Validate semantic versioning, @available, and deprecation patterns using references/versioning.md.
  7. 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.

// Before
public import Foundation

// After
import Foundation

Package.swift

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

// 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/manifest-conventions.md — Full Package.swift conventions: tools version, platforms, products, makeTargets(), Swift settings and upcoming features, dependencies, Package.resolved, path overrides, test targets, build plugins.
  • 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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.