coding-best-practices

coding-best-practices is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 55 tokens per session (2,515 once invoked), scanned A, original, MIT.

A Swift and iOS code-review guide focused on modern language practices, Apple platform conventions, architecture, and code quality.

In plain words
What is it for?
Reviewing Swift code, checking SwiftUI and architecture patterns, assessing the data layer, refactoring, and finding possible performance or quality improvements.
Why use it?
It helps identify unclear, outdated, or unnecessarily risky code before it becomes harder to maintain or change.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; positional $N argument.

Part of the apple-skills plugin — 147 skills shipped together , and of apple-skills

Good fit Reviewing Swift code, checking SwiftUI and architecture patterns, assessing the data layer…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/coding-best-practices
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rshankras/claude-code-apple-skills --skill coding-best-practices
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 147 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for coding-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/coding-best-practices.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/coding-best-practices)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/coding-best-practices"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/coding-best-practices.svg" alt="Measured on agentmods" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,515 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.02515
Opus 5 $0.00028 $0.01257
Sonnet 5 $0.00011 $0.00503
Haiku 4.5 $0.00006 $0.00251

Measured 3d ago against content hash ba795cee3279, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

coding-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ios/coding-best-practices/SKILL.md · 307 lines

How it starts

The opening of the file, as written. The whole thing — 307 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Coding Best Practices Skill

Reviews Swift/iOS code for adherence to modern Swift idioms, Apple platform best practices, architecture patterns, and code quality standards.

When This Skill Activates

Use this skill when the user:

  • Asks for code review or code quality check
  • Mentions "best practices", "clean code", or "refactoring"
  • Wants to improve existing code
  • Requests architecture or design pattern review
  • Asks about Swift idioms or modern patterns
  • Wants performance optimization suggestions

Review Process

1. Identify Scope

  • If user specifies files/classes, review those
  • Otherwise, ask which areas to focus on or review recent changes
  • Prioritize ViewModels, business logic, and data layer over simple views

2. Load Reference Patterns

Before starting the review, familiarize yourself with the reference patterns by reading the following files in .claude/skills/coding-best-practices/:

  • swift-patterns.md - Optionals, type safety, collections, error handling, naming
  • swiftui-patterns.md - State management, view composition, performance
  • architecture-patterns.md - MVVM, code organization, memory management, security
  • coredata-patterns.md - Core Data best practices, fetching, saving, relationships

3. Review Categories

Apply these review categories based on the code type:

For All Code:

  • Swift language idioms (optionals, type safety, collections)
  • Naming conventions
  • Error handling
  • Memory management

For SwiftUI Code:

  • State management (@State, @Observable + @Bindable; legacy @StateObject / @ObservedObject pre-iOS 17)
  • View composition and performance
  • MVVM separation

For ViewModels:

  • Business logic placement
  • MVVM architecture adherence
  • Testability (dependency injection)

For Core Data Code:

  • Context management
  • Save/fetch patterns
  • Relationship handling
  • CloudKit integration

4. Review Output Format

Provide review in this structure:

✅ Strengths Found
  • List well-implemented patterns
  • Highlight good practices
  • Acknowledge clean code sections

Read the full file on GitHub · 307 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 307 lines · 55 tokens per session scan A ba795cee3279

Subscribe to this mod's changes

coding-best-practices is a skill published in the GitHub repository rshankras/claude-code-apple-skills (701 stars, last pushed 1mo ago), licensed MIT. It adds 55 tokens to every session and 2,515 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories