Get agent skills for Swift, SwiftUI, Swift Testing, and more
If you’re building apps with agents such as Codex or Claude, this article is for you – I’m going to show you to use agent skills to make them smarter, so they write better code, faster.
We’ll look at how to install and use these agent skills in Xcode, Claude Code, Codex, Gemini, and more. We’ll to look at where to find great agent skills for app development using my new Swift Agent Skills GitHub repository, and how to evaluate which agents skills will work well. And I’m also going to show you how agent skills are different from AGENTS files, and why you might want both.
The result will be that using AI to write, review, or test code will be so much better, whether you’re using SwiftUI, Swift concurrency, SwiftData, Swift Testing, or something else.
If you missed my previous video about how to build apps with AI, I suggest you start there – it walks you through using Xcode, Claude Code, Codex, and more, with lots of tips for getting the most from Xcode, configuring your terminal, getting the most from ChatGPT, and more.
If you’d prefer to watch this as a video, you can find it below. Alternatively, scroll past the video to read the article instead.
Still here? Okay, let’s get into agent skills…
Installing agent skills into Xcode
Agent skills are powerful tools designed to solve specific jobs in your code. I’ve written agent skills to improve your SwiftUI code, to make the most of Swift Testing, to optimize your Swift concurrency code, and even to make sure you’re using SwiftData effectively – each skill does one thing, and does it well.
Before we get into how agent skills work, I want you to see them in action because they are really transformative.
If you’re installing skills from the command line for tools like Claude Code or Codex, it’s easy. But when using Xcode, it might take a few more steps.
First, make sure you have Xcode set up to use agentic coding. Again, I made a whole video about that previously, but the short version is to open up Xcode’s Settings, select the Intelligence tab, then configure one or both of the built-in agents, or add your own if you prefer.
That sets up support for Xcode to talk to Claude and Codex directly, which means we can now integrate our skills.
This is where things take two directions depending on your goal, so I’ll show you both, starting with the easiest approach first.
The first step is to find the agent skill you want. For example, you might want to use my SwiftUI agent skill, which helps write and improve any kind of SwiftUI project.
So, you need to open that URL in your browser, and look for the install instructions. It should look like this:
npx skills add https://github.com/twostraws/swiftui-agent-skill --skill swiftui-pro
That’s a terminal command you need to run, so open the Terminal app on your Mac and run it. It will ask:
- Which agents you want to install to. You’ll notice the default set includes Codex. If you want to add Claude Code, use the arrow keys to move down and press Space to select it. Hit return to continue.
- Whether it should be installed in your current project or globally, so it works everywhere. Both are good options, but you’ll probably find globally more useful.
- Whether it should copy the skill individually in lots of places, or use a symlink. The symlink approach means the skill only exists once on your computer, and other places just reference the original copy, so it’s preferred.
- Then press return one last time to confirm your settings and install the skill.
That one installation process now means the skill is available in Claude Code, in both the command line app and the desktop app; in Codex, again in both the command line app and the desktop app; but also in Codex for Xcode.
It doesn’t work in Claude for Xcode, so if you’re using Claude there some additional instructions.
But if you’re in one of the other context, you’re all set – all you need to do is restart the app, e.g. quit and relaunch Xcode or Codex, and the skill is available.
Even better, if you want to update your installed skills in the future, you can do it all with one command:
npx skills update
I’ll show you how to use the skill in a minute, but first let’s handle the exception: making the skill work with Claude inside Xcode.
Right now at least, Claude likes to have its own folder for skills, and Apple has a documentation page up about setting up coding intelligence where it’s mentioned.
You need to scroll way down the page until you come to a section currently titled “Customize the Codex and Claude Agent environments”, where they tell you how to add skills and other files to your agents.
The directory want is this one: ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig. You can open that in Finder by pressing Cmd+Shift+G and pasting in that path.
This is where you need to copy in any custom Claude configuration you want to use.
You’ll see a similar folder for Codex, but you might notice its skills folder is actually empty – Codex is intelligently reading the shared install we made using the terminal command, which is helpful.
The Claude folder doesn’t have a “skills” subfolder, but we can make one ourselves. And now go back to the GitHub repository for the skill you want, and press Code > Download Zip.
You should then extract that zip and open it up using Finder. You’ll probably see things like the README.md file inside there, but what you care about is the folder that contains SKILL.md – that’s the skill itself.
For my SwiftUI skill, it’s just called “swiftui-pro”, so you would copy that into the skills folder you made a moment ago, then relaunch Xcode. And that’s it – whether you’re using Codex or Claude, the skill is now installed and ready to use.
To try it out, open a SwiftUI project, activate the Coding Assistant in Xcode (Cmd+0) and ask your preferred agent to use the skill. For example, you might say this:
“Use the SwiftUI Pro skill to review this project.”
The agent will start by reading the current project you have. If it’s a small project that will take only 10 seconds or so, but larger projects will take more time to break up and understand.
It will then load the skill, and work through the skill’s instructions. My SwiftUI Pro skill has a range of instructions around review things like performance, replacing deprecated API, fixing VoiceOver problems, and more – it’s a comprehensive skill that’s designed to make every project better.
Important: Agents can also proactively choose to load skills if they think it will be helpful, even if you hadn’t specifically asked for it.
While it works you might see the agent chat away to itself as it picks up results from the skill, but when it finishes you should see a summary of things to address. It won’t necessarily be exhaustive, but it will be a great starting point – you’ll have a whole bunch of things you can fix yourself or ask the agent to fix, at which point you can run the skill again.
What do agent skills actually do?
If you take another look at the GitHub repository for your agent skill, you’ll see it’s really just a collection of Markdown – it’s just plain text giving advice to whatever AI tool is reading your code.
What skills do is provide clear advice about things AI tools are bad at. These tools are already trained on most of Swift and SwiftUI, they’ve already scanned through hundreds of millions of lines of code and documentation, and so they understand the basics of using this stuff already.
The best skills teach agents what they don’t know. That might be things where the AI has limited training data, such as unusual or rarely used API. It’s also true of very new API, which right now is pretty much everything from iOS 26 – they haven’t seen much iOS 26 code, so they are much more likely to make mistakes.
Skills also cover things like deprecated code, code that’s often used wrongly, common mistakes that AI tools make, and more. But it’s all just Markdown, so you can and should read through the skill for yourself to see what you think.
All skills start out with this SKILL.md file, which starts with a tiny little header describing the skill and what it’s used for. By default, that little header is all the agent reads – it ignores the whole rest of the skill until it’s actually used.
This makes skills extremely efficient. Only when the skill is activated is the rest of SKILL.md read in. And you’ll notice this file isn’t the whole skill – far from it. SKILL.md will usually reference other Markdown files inside the skill, where each reference file covers one specific part of the skill.
This allows your AI agent to read only the part it actually needs. So, if you were using my SwiftUI Pro skill and asked it to review your accessibility, it would only read the accessibility.md file. This is what makes skills both fast and efficient to run.
Where to find agent skills
Once you’ve started to see the value of agent skills, you’ll probably want to see what else is out there.
Well, the good news is that there are quite a few – I have made four myself already:
Each of those are free, and will help supercharge your app development.
But there are others from around the community, so to make them all easier to find I made a GitHub repository bringing them together: Swift Agent Skills
If you go there you can find other SwiftUI skills, there are App Store skills, accessibility skills, and more. All specialized to do one task really well, so they should do a great job. I’m sure the list will grow over time too!
Now, you might wonder how to choose a skill when there are several available, and it’s actually pretty straightforward.
First, make sure you trust the author of the skill. You might have seen there’s a big “Important Safety Note” title on my Swift Agent Skills, and it’s there for a reason: these skills adjust the way agents behave, so if you’ve granted your agent permission to work in your project and you’ve installed a malicious skill, it might actually cause problems for you – be careful, read the skill’s contents yourself, and always check the author.
Second, decide whether the skill’s contents are actually useful. Remember, AI agents are already trained on vast amounts of Swift, SwiftUI, and more, so if skills repeat existing knowledge you’re just wasting time and resources.
I’ve seen skills out there try and teach agents basic async/await usage with Swift concurrency – that stuff has been around for five years now, so the agent already knows that. These kinds of skills are not useful, and will just waste time.
The problem here is that some folks are using AI to write agent skills, which is pointless. Agent skills work best when they cover things agents don’t already know, which by definition means they can’t write them.
So, look for skills that teach things agents very new API, recent deprecations, surprise corner cases, unusual behaviors, and more.
I want to give you two specific examples, so you can see what I mean.
First, in my SwiftUI Pro agent skill, I explain to the agent that using + to join two Text views together is deprecated – I show the bad code and show the correct code instead.
And second, in my SwiftData Pro agent skill, I explain to the agent that there are dangerous predicates that will compile cleanly but crash.
These are both fairly common things for agents to write, but both are a bad idea.
In fact, I asked Claude to review my agent skills after I had written them, because it’s really great at spotting typos, Markdown mistakes, and similar. And Claude actually tried to remove the rule about the + deprecation, because it was convinced the rule was wrong.
In reality, the rule is correct, it’s just that agents aren’t trained on the changes so they get it wrong – and that’s the value of good skills.
So, read through the skills you find and look for yourself. If you see lots of discussion of old code or basics that any agent already knows, it’s almost certainly not helpful.
By the way, you might enjoy Stewart Lynch’s video where he uses a free OpenAI account to see how much code can be written without paying – it’s not a lot, but it saves you paying for another subscription!
Agent skills vs agents files
Last but not least, I want to talk about another way you can help your agents get smarter, which is with an AGENTS.md file.
You’ve seen how skills get installed into your agent, then used on demand – only that tiny slice of text at the start of SKILL.md gets read until the skill is triggered.
This makes them very efficient with resources – behind the scenes the agent has a limited window of memory it can hold at once, known as its context window. When it’s reading your code and your prompts, that eats into the context window. When it activates your skill, that eats into the context window too. And eventually the context window runs out of space, and your agent has to compact the conversation – it summarizes all the important details, uses that summary to start a new conversation, then forgets everything else that didn’t make the cut.
This is why it’s so important for skills not to waste space talking about things the agents already know, because they just eat into your context window for no benefit – if a skill is outlining basic things like SwiftUI API that has been around since 2019, it’s burning your context window and slowing you down, not providing value.
An alternative to skills is called AGENTS.md, which is usually one flat Markdown file containing instructions for your agent to follow at all times. This file gets loaded in immediately, and is always present – you don’t need to ask for it to be use, it’s just applied automatically.
On the positive side, this means all code your agents write will automatically fit the style you want – they are always active, always being referenced, and always being applied.
On the negative side, this means the contents of the AGENTS.md file will usually be shorter and simpler than skills, because they try to take up as little of your context window as possible.
I wrote a fantastic AGENTS.md file for Swift developers, which you can download and use for free. If you place this into your project’s directory, it will be picked up automatically. Once again, Claude is a little different – you need to name the file CLAUDE.md in order for it to work.
Make sure you restart your agent after installed the file, so it’s read fully.
You don’t need to do anything special to use your AGENTS.md file – just start running prompts, and it will activate automatically. If you want it to work everywhere, you can copy it into the correct ~/Library/Developer/Xcode/CodingAssistant/ folder from earlier, as either AGENTS.md (for Codex) or CLAUDE.md for Claude.
If you want to be sure it’s working, just trying putting something really obvious in there, such as “Always put the prefix ABC before any struct or class names,” then try it out – you should see that rule being respected, so you know it’s definitely working.
Again, these AGENTS.md files are just Markdown, so read them carefully before trusting them – you might learn something!
Anyway, that’s it for agent skills and agent files. You’ve seen how to install and use them, where to find great agent skills for your work, and how you might want to consider AGENTS.md files – the two aren’t mutually exclusive.
0 Comments
Log in to join the conversation.No comments yet. Be the first to share your thoughts.