
Swift anti pattern guard
Flags outdated Swift patterns like ObservableObject and NavigationView and suggests modern
Swift anti pattern guard is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 20
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Swift anti pattern guard
This skill guides an agent through reviewing Swift code for legacy patterns across the observation family, GCD main-queue calls, NavigationView and Core Data. For each match it reports the file, the pattern and a modern replacement such as @Observable, @MainActor, NavigationStack or SwiftData.
The workflow is a grep pass over the target path with ripgrep, grouping findings by file and explaining why each pattern hurts concurrency, state invalidation or maintenance. Fixes are meant to be minimal and local, and the skill warns against rewriting whole modules or drive-by refactors without review.
It expects a Swift codebase and a shell with ripgrep available. The guidance is advisory and aligns with the repository's own deployment targets and conventions.
When your agent uses it
Use when reviewing Swift code for outdated patterns, modernizing a project, running architecture health checks, or grepping for ObservableObject, DispatchQueue.main, NavigationView, or Core Data.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (2 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the swift-modern-dev plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add pstuart/pstuart
/plugin install swift-modern-dev@pstuartOr copy only this skill to ~/.claude/skills/swift-anti-pattern-guard:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/swift-anti-pattern-guard &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-anti-pattern-guard" ~/.claude/skills/swift-anti-pattern-guard &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/swift-anti-pattern-guard inside it instead.
Copy the skill folder to ~/.agents/skills/swift-anti-pattern-guard to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/swift-anti-pattern-guard &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-anti-pattern-guard" ~/.agents/skills/swift-anti-pattern-guard &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/swift-anti-pattern-guard inside it instead.
Copy the skill folder to ~/.cursor/skills/swift-anti-pattern-guard to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/swift-anti-pattern-guard &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-anti-pattern-guard" ~/.cursor/skills/swift-anti-pattern-guard &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/swift-anti-pattern-guard inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/pstuart/pstuart.git --path plugins/swift-modern-dev/skills/swift-anti-pattern-guardOr copy the folder to ~/.gemini/skills/swift-anti-pattern-guard yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/swift-anti-pattern-guard:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pstuart/pstuart.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/swift-anti-pattern-guard &&
cp -R "$tmp/plugins/swift-modern-dev/skills/swift-anti-pattern-guard" ~/.copilot/skills/swift-anti-pattern-guard &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/swift-anti-pattern-guard inside it instead.
Get the folder:
git clone --depth 1 https://github.com/pstuart/pstuart.gitThen copy pstuart/plugins/swift-modern-dev/skills/swift-anti-pattern-guard into your agent's skills folder as swift-anti-pattern-guard. Agents that support SKILL.md read one folder per skill.
What it does
- Observation pattern detection
- Finds ObservableObject, @Published and related property wrappers and suggests @Observable replacements.
- Main queue migration
- Flags DispatchQueue.main calls and recommends @MainActor or MainActor.run alternatives.
- Navigation modernization
- Identifies NavigationView usage and points to NavigationStack or NavigationSplitView.
- Core Data review
- Spots Core Data types and suggests SwiftData equivalents while preserving existing persistence.
- Grep-based scan
- Runs a ripgrep command across Swift files to collect all forbidden tokens in a path.
Good for
- Review my Swift project for outdated ObservableObject usage
- Find DispatchQueue.main calls and suggest @MainActor replacements
- Check whether my app still uses NavigationView
- Audit Core Data usage and outline a SwiftData path
- Run an architecture health check on this Swift codebase
Swift anti pattern guard FAQ
What does Swift anti pattern guard need to run?
It uses ripgrep over Swift files in the target path, so ripgrep needs to be available in the environment.
Does Swift anti pattern guard change my code automatically?
No. It is advisory, reports findings with replacements, and suggests minimal fixes rather than rewriting whole modules.
Which patterns does Swift anti pattern guard check?
Phase one covers the observation family, GCD main queue calls, NavigationView and Core Data types.
When does Swift anti pattern guard trigger?
When reviewing Swift code for outdated patterns, modernizing a project, running architecture health checks, or grepping for the listed tokens.
How do I install Swift anti pattern guard in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/swift-anti-pattern-guard to use it in all your projects, or to .claude/skills/swift-anti-pattern-guard in one project. Or install the swift-modern-dev plugin, which includes it: /plugin marketplace add pstuart/pstuart, then /plugin install swift-modern-dev@pstuart.
Does Swift anti pattern guard run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Swift anti pattern guard?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Swift anti pattern guard?
The closest alternatives to Swift anti pattern guard are Swift modern architecture, Axiom modernize, Axiom analyze swiftui performance, Axiom swift simplifier and Axiom swift.
Where this comes from
- Description: from the skill's own SKILL.md.
More from pstuart/pstuart

Reports git state, activity and build evidence across every project in a folder
- Open source
- 20 GitHub stars
- Developer tools

Checks web pages against WCAG 2.1 AA contrast, labels, keyboard and ARIA rules
- Open source
- 20 GitHub stars
- Developer tools

Guides an AI agent through building and reviewing Nuxt 4 apps with the app/ layout
- Open source
- 20 GitHub stars
- Developer tools

Walks an agent through a web application security audit checklist and report
- Open source
- 20 GitHub stars
- Security

Guides an agent to style Nuxt and Vue UIs with Tailwind CSS 4 utilities and @theme tokens
- Open source
- 20 GitHub stars
- Developer tools

Guides an agent to write and review strict TypeScript in Vue, Nuxt and Node code
- Open source
- 20 GitHub stars
- Developer tools


