packtpublishing/ai-driven-swift-architecture/spm-to-tuist
Claude Code and agent skill by packtpublishing/ai-driven-swift-architecture
- community
Checking that the SKILL.md file is still in the repository.
Migrates a generative, enum-driven Swift Package Manager (SPM) modular architecture to Tuist while preserving architectural invariants and meta-structure.
Install
npx vskill@latest install packtpublishing/ai-driven-swift-architecture/spm-to-tuistSKILL.md
Intent
Migrate a Swift Package Manager (SPM) project to Tuist without losing its generative architecture model.
The existing SPM setup is not flat. Targets and products are derived from enums, and dependencies are strongly typed through helper abstractions. This migration must preserve not only module boundaries, but also the architectural meta-model.
Architectural Invariants
The following constraints must remain true after migration:
- Each enum case represents exactly one module.
- Each module produces exactly one product.
- Each module has a corresponding test target.
- Dependency direction rules must remain enforced.
- Abstraction modules must remain dependency-free (except explicitly allowed external modules).
- Utilities must not introduce upward coupling.
- No circular dependencies may be introduced.
- Folder conventions must remain intact.
Step 1 — Introduce Tuist Alongside SPM
Create a Project.swift file next to your existing Package.swift file.
Example minimal Project.swift:
Important distinctions:
- You now import
ProjectDescriptioninstead ofPackageDescription. - You export a
Projectinstance instead of aPackageinstance. - The modeling primitives mirror Xcode concepts (targets, schemes, build phases, etc.).
Next, create a Tuist.swift file at the root of the project:
The presence of Tuist.swift defines the root of the Tuist project and enables configuration.
At this stage, Swift Package Manager still governs the build. Tuist has been introduced but has not yet taken ownership of the structure.
Step 2 — Preserve the Generative Model
The current SPM configuration encodes architecture using enum-driven generation.
Example:
Targets and products are derived from:
Dependencies are expressed through typed helpers:
The Tuist migration must preserve:
- The enum-driven module definition pattern.
- The strongly-typed dependency helpers.
- The one-to-one mapping between enum cases and targets.
- The separation between abstraction, utility, and internal dependencies.
Flattening this structure into manually written targets is not acceptable.
Migration Strategy
The migration must follow these phases:
- Introduce Tuist without removing SPM.
- Recreate the enum-driven model in Tuist manifests.
- Map each enum case to a Tuist target.
- Recreate dependency helpers (abstraction, utility, internal).
- Preserve test target conventions.
- Validate the dependency graph.
- Remove Package.swift only after structural equivalence is verified.
Required Skill Behavior
The Skill must instruct the AI agent to:
- Analyze existing enum-driven package definitions.
- Detect module-generation patterns.
- Preserve meta-structure during transformation.
- Recreate architectural constraints inside Tuist manifests.
- Reject migrations that flatten or weaken dependency rules.
Validation
After migration:
- Run
tuist install - Run
tuist generate - Build the project
- Execute tests
- Run
tuist graph - Ensure no new dependency violations exist
The migration is complete only if architectural invariants and meta-structure are preserved.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingSkills/spm-to-tuist/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/packtpublishing/ai-driven-swift-architecture/spm-to-tuist)