swift-code-reviewer-skill 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/CHANGELOG.md +31 -6
  2. package/README.md +70 -482
  3. package/SKILL.md +55 -5
  4. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,11 +5,25 @@ All notable changes to the Swift Code Reviewer Agent Skill will be documented in
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.1.1] - 2026-03-24
9
+
10
+ ### Fixed
11
+
12
+ - Replace `install-skill.sh` with the correct installer for this skill (previously contained the XcodeBuildMCP installer by mistake)
13
+ - Add `uninstall` command support to `install-skill.sh`
14
+
15
+ ## [1.1.0] - 2026-03-16
16
+
17
+ ### Added
18
+
19
+ - increase adjusts from Dimillian skill and more scenarios to cover
20
+
8
21
  ## [1.0.0] - 2026-02-10
9
22
 
10
23
  ### Added
11
24
 
12
25
  #### Core Functionality
26
+
13
27
  - **Four-phase review workflow**: Context Gathering → Analysis → Report Generation → Delivery
14
28
  - **Multi-layer analysis** across 6 core categories:
15
29
  - Swift Best Practices (Swift 6+ concurrency, error handling, optionals)
@@ -20,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
20
34
  - Project-Specific Standards (.claude/CLAUDE.md integration)
21
35
 
22
36
  #### Review Capabilities
37
+
23
38
  - **GitHub PR reviews** via `gh` CLI integration
24
39
  - **GitLab MR reviews** via `glab` CLI integration
25
40
  - **Git diff analysis** for uncommitted changes
@@ -28,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
28
43
  - **Project standards validation** via .claude/CLAUDE.md
29
44
 
30
45
  #### Feedback System
46
+
31
47
  - **Severity classification**: Critical, High, Medium, Low
32
48
  - **Positive feedback** for good practices
33
49
  - **Refactoring suggestions** for improvements
@@ -36,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
36
52
  - **Prioritized action items** for structured follow-up
37
53
 
38
54
  #### Reference Documentation (7,700+ lines)
55
+
39
56
  - **review-workflow.md** (1,131 lines): Complete review process and git integration
40
57
  - **swift-quality-checklist.md** (928 lines): Swift 6+ patterns and best practices
41
58
  - **swiftui-review-checklist.md** (909 lines): SwiftUI state management and modern APIs
@@ -46,12 +63,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
46
63
  - **custom-guidelines.md** (852 lines): Project standards integration guide
47
64
 
48
65
  #### Integration Features
66
+
49
67
  - **swift-best-practices skill** integration for Swift 6+ language patterns
50
68
  - **swiftui-expert-skill** integration for SwiftUI best practices
51
69
  - **swiftui-performance-audit** integration for performance analysis
52
70
  - **Independent operation** with comprehensive built-in checklists
53
71
 
54
72
  #### Platform Support
73
+
55
74
  - Swift 6.0+
56
75
  - iOS 17+, macOS 14+, watchOS 10+, tvOS 17+, visionOS 1+
57
76
  - GitHub and GitLab integration
@@ -68,6 +87,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
68
87
  ### Features in Detail
69
88
 
70
89
  #### Swift Quality Checks
90
+
71
91
  - Actor isolation and MainActor usage
72
92
  - Sendable conformance validation
73
93
  - Data race prevention
@@ -78,6 +98,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
78
98
  - Swift API Design Guidelines compliance
79
99
 
80
100
  #### SwiftUI Checks
101
+
81
102
  - @Observable pattern adoption (iOS 17+)
82
103
  - Property wrapper selection guide
83
104
  - NavigationStack vs NavigationView
@@ -88,6 +109,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
109
  - Accessibility compliance
89
110
 
90
111
  #### Performance Checks
112
+
91
113
  - View update optimization
92
114
  - Equatable conformance for ViewModels
93
115
  - ForEach identity stability
@@ -98,6 +120,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
98
120
  - Retain cycle prevention
99
121
 
100
122
  #### Security Checks
123
+
101
124
  - Keychain usage for credentials
102
125
  - Biometric authentication
103
126
  - HTTPS enforcement
@@ -109,6 +132,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
109
132
  - Sensitive data logging prevention
110
133
 
111
134
  #### Architecture Checks
135
+
112
136
  - MVVM pattern validation
113
137
  - Repository pattern implementation
114
138
  - Dependency injection verification
@@ -119,6 +143,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
119
143
  - Code organization (MARK comments, extensions)
120
144
 
121
145
  #### Project Standards
146
+
122
147
  - .claude/CLAUDE.md parsing and validation
123
148
  - Custom architecture pattern validation
124
149
  - Design system compliance (colors, fonts, spacing)
@@ -129,6 +154,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
129
154
  ### Templates and Examples
130
155
 
131
156
  #### Positive Feedback Templates
157
+
132
158
  - Modern API adoption
133
159
  - Architecture excellence
134
160
  - Code quality
@@ -137,12 +163,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
137
163
  - Security awareness
138
164
 
139
165
  #### Issue Report Templates
166
+
140
167
  - Critical issues (security, crashes, data races)
141
168
  - High priority (performance, anti-patterns)
142
169
  - Medium priority (code quality, documentation)
143
170
  - Low priority (style, suggestions)
144
171
 
145
172
  #### Refactoring Suggestions
173
+
146
174
  - Extract subview
147
175
  - Simplify complex logic
148
176
  - Extract reusable component
@@ -151,18 +179,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
151
179
  ### Example Review Reports
152
180
 
153
181
  Provided complete examples for:
182
+
154
183
  - Reviewing uncommitted changes
155
184
  - Reviewing against project standards
156
185
  - Pull request reviews
157
186
  - File-specific reviews
158
187
  - Multi-file reviews
159
188
 
160
- ## [1.1.0] - 2026-03-16
161
-
162
- ### Added
163
-
164
- - increase adjusts from Dimillian skill and more scenarios to cover
165
-
166
189
  ## [Unreleased]
167
190
 
168
191
  ### Planned Features
@@ -187,6 +210,7 @@ Provided complete examples for:
187
210
 
188
211
  ## Version History Summary
189
212
 
213
+ - **1.1.1** (2026-03-24): Fix incorrect `install-skill.sh` (was XcodeBuildMCP installer)
190
214
  - **1.1.0** (2026-03-16): Increase adjusts from Dimillian skill and more scenarios to cover
191
215
  - **1.0.0** (2026-02-10): Initial release with comprehensive review capabilities
192
216
 
@@ -216,6 +240,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on proposing changes.
216
240
  ---
217
241
 
218
242
  **Note**: This skill follows [Semantic Versioning](https://semver.org/):
243
+
219
244
  - **MAJOR**: Incompatible API changes
220
245
  - **MINOR**: Backward-compatible functionality additions
221
246
  - **PATCH**: Backward-compatible bug fixes
package/README.md CHANGED
@@ -1,545 +1,155 @@
1
1
  # Swift Code Reviewer Agent Skill
2
2
 
3
3
  [![GitHub Sponsors](https://img.shields.io/github/sponsors/Viniciuscarvalho?style=social)](https://github.com/sponsors/Viniciuscarvalho)
4
+ [![npm version](https://img.shields.io/npm/v/swift-code-reviewer-skill)](https://www.npmjs.com/package/swift-code-reviewer-skill)
4
5
 
5
- A comprehensive code review skill for Claude that performs multi-layer analysis of Swift and SwiftUI code, combining Apple's best practices with project-specific coding standards.
6
+ A code review skill for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) that performs multi-layer analysis of Swift and SwiftUI code, combining Apple's best practices with your project-specific coding standards.
6
7
 
7
- ## Features
8
-
9
- - 🔍 **Multi-Layer Analysis**: Combines Swift 6+ best practices, SwiftUI patterns, performance optimization, and security checks
10
- - 📋 **Project-Aware Reviews**: Reads `.claude/CLAUDE.md` to validate against project-specific standards and architecture patterns
11
- - 🎯 **Comprehensive Feedback**: Provides Critical/High/Medium/Low severity issues, positive feedback, and refactoring suggestions
12
- - 🔗 **Skill Integration**: Leverages existing `swift-best-practices`, `swiftui-expert-skill`, and `swiftui-performance-audit` skills
13
- - 📊 **Actionable Output**: Structured reports with file:line references, code examples, and prioritized action items
14
- - 🚀 **Platform Support**: Works with GitHub PRs, GitLab MRs, and local git changes
15
-
16
- ## What It Reviews
17
-
18
- ### Swift Quality
19
-
20
- - **Concurrency Safety**: Actor isolation, MainActor usage, Sendable conformance, data race prevention
21
- - **Error Handling**: Typed throws, Result types, proper error propagation
22
- - **Optionals**: Safe unwrapping, guard statements, no force unwraps
23
- - **Access Control**: Explicit access modifiers, minimal API surface
24
- - **Naming**: Swift API Design Guidelines compliance
25
-
26
- ### SwiftUI Patterns
27
-
28
- - **State Management**: @Observable, @State, @Binding, @Environment usage
29
- - **Property Wrappers**: Correct wrapper selection for each use case
30
- - **Modern APIs**: NavigationStack, .task, latest SwiftUI features
31
- - **View Composition**: Extracted subviews, ViewBuilder patterns
32
- - **Accessibility**: Labels, hints, Dynamic Type support
33
-
34
- ### Performance
35
-
36
- - **View Optimization**: Unnecessary updates, Equatable conformance
37
- - **ForEach Performance**: Stable identity, lazy loading
38
- - **Layout Efficiency**: GeometryReader usage, layout thrash
39
- - **Resource Management**: Image loading, memory leaks, async patterns
40
-
41
- ### Security & Safety
42
-
43
- - **Input Validation**: Sanitization, bounds checking, type safety
44
- - **Sensitive Data**: Keychain storage, biometric authentication, secure logging
45
- - **Network Security**: HTTPS enforcement, certificate pinning, API key protection
46
- - **Permissions**: Privacy descriptions, permission timing, graceful handling
47
-
48
- ### Architecture
49
-
50
- - **Pattern Compliance**: MVVM, MVI, TCA adherence
51
- - **Dependency Injection**: Constructor injection, protocol-based dependencies
52
- - **Code Organization**: File structure, MARK comments, logical grouping
53
- - **Testability**: Unit test coverage, mock usage, test structure
54
-
55
- ### Project Standards
56
-
57
- - **Custom Guidelines**: Validates against `.claude/CLAUDE.md` rules
58
- - **Design System**: Color palette, typography, spacing token usage
59
- - **Error Patterns**: Custom error type conformance
60
- - **Testing Requirements**: Coverage thresholds, testing patterns
61
-
62
- ## Installation
63
-
64
- ### Option 1: NPX (Recommended)
65
-
66
- The fastest way to install — always fetches the latest version, no cloning or manual updates required:
8
+ ## Quick Start
67
9
 
68
10
  ```bash
69
11
  npx swift-code-reviewer-skill
70
12
  ```
71
13
 
72
- This automatically installs the skill to `~/.claude/skills/swift-code-reviewer-skill/`
73
-
74
- > **Tip:** Running `npx swift-code-reviewer-skill` again at any time will update to the latest version automatically.
75
-
76
- To uninstall:
77
-
78
- ```bash
79
- npx swift-code-reviewer-skill uninstall
80
- ```
81
-
82
- ### Option 2: Clone This Repository
83
-
84
- ```bash
85
- # Clone the skill
86
- git clone https://github.com/Viniciuscarvalho/swift-code-reviewer-skill.git ~/.claude/skills/swift-code-reviewer-skill
87
-
88
- # The skill is now ready to use!
89
- ```
90
-
91
- ### Option 3: Manual Installation
92
-
93
- 1. Create the skill directory:
94
-
95
- ```bash
96
- mkdir -p ~/.claude/skills/swift-code-reviewer-skill/references
97
- ```
98
-
99
- 2. Download the files from this repository into the directory
100
-
101
- 3. Restart Claude or reload skills
102
-
103
- ### Verify Installation
14
+ That's it. The skill is installed and ready to use. Run it again anytime to update to the latest version.
104
15
 
105
- ```bash
106
- ls ~/.claude/skills/swift-code-reviewer-skill/
107
- # Should show: SKILL.md, README.md, references/, and more
108
- ```
16
+ > No cloning, no manual setup. NPX always fetches the latest version automatically.
109
17
 
110
18
  ## Usage
111
19
 
112
20
  ![Swift Code Reviewer in action](assets/demo.png)
113
21
 
114
- ### Basic Usage
115
-
116
- The skill automatically activates when you ask Claude to review Swift/SwiftUI code:
22
+ Just ask Claude to review your code:
117
23
 
118
24
  ```
119
25
  Review this PR
120
-
121
26
  Review LoginView.swift
122
-
123
- Review my uncommitted changes
124
-
125
- Check if this follows our coding standards
126
- ```
127
-
128
- ### Review Specific Files
129
-
130
- ```
131
- Review UserProfileView.swift
132
- ```
133
-
134
- **What it does:**
135
-
136
- 1. Reads `.claude/CLAUDE.md` for project standards
137
- 2. Analyzes the file against all quality dimensions
138
- 3. Provides structured feedback with severity levels
139
- 4. Includes positive feedback and refactoring suggestions
140
-
141
- ### Review Git Changes
142
-
143
- ```
144
27
  Review my uncommitted changes
145
- ```
146
-
147
- **What it does:**
148
-
149
- 1. Runs `git diff` to identify changes
150
- 2. Analyzes modified files
151
- 3. Focuses on changed lines for efficiency
152
- 4. Generates comprehensive review report
153
-
154
- ### Review Pull Requests (GitHub)
155
-
156
- ```
157
- Review PR #123
158
- ```
159
-
160
- **What it does:**
161
-
162
- 1. Fetches PR details using `gh pr view 123`
163
- 2. Gets diff using `gh pr diff 123`
164
- 3. Reads all changed files for context
165
- 4. Generates detailed review with file:line references
166
-
167
- ### Review Merge Requests (GitLab)
168
-
169
- ```
170
- Review MR #456
171
- ```
172
-
173
- **What it does:**
174
-
175
- 1. Fetches MR details using `glab mr view 456`
176
- 2. Gets diff and changed files
177
- 3. Performs multi-layer analysis
178
- 4. Generates actionable feedback
179
-
180
- ### Review Against Custom Standards
181
-
182
- ```
183
- Review LoginViewModel.swift against our coding standards
184
- ```
185
-
186
- **What it does:**
187
-
188
- 1. Reads `.claude/CLAUDE.md` and related architecture docs
189
- 2. Extracts project-specific rules
190
- 3. Validates code against both Apple and project standards
191
- 4. Reports compliance and violations
192
-
193
- ### Review Multiple Files
194
-
195
- ```
196
28
  Review all ViewModels in the Features folder
29
+ Check if this follows our coding standards
197
30
  ```
198
31
 
199
- **What it does:**
200
-
201
- 1. Finds all matching files
202
- 2. Analyzes each against architecture patterns
203
- 3. Provides file-by-file review
204
- 4. Summarizes common patterns and issues
205
-
206
- ## How It Works
207
-
208
- The skill follows a **four-phase workflow**:
209
-
210
- ### Phase 1: Context Gathering
211
-
212
- 1. **Read Project Guidelines**
213
- - Loads `.claude/CLAUDE.md` if it exists
214
- - Reads related architecture documents
215
- - Extracts custom coding standards
216
-
217
- 2. **Identify Review Scope**
218
- - Determines files to review (user-specified, git diff, PR/MR)
219
- - Categorizes changes by type (UI, logic, tests)
220
-
221
- 3. **Gather Context**
222
- - Reads all files completely
223
- - Understands broader context
224
- - Identifies component relationships
225
-
226
- ### Phase 2: Automated Analysis
227
-
228
- Runs parallel checks across **six core categories**:
229
-
230
- 1. **Swift Best Practices** (leverages `swift-best-practices` skill)
231
- - Concurrency safety and actor isolation
232
- - API design and naming conventions
233
- - Swift 6+ feature adoption
234
-
235
- 2. **SwiftUI Quality** (leverages `swiftui-expert-skill`)
236
- - State management patterns
237
- - Modern API usage
238
- - View composition
239
-
240
- 3. **Performance** (leverages `swiftui-performance-audit`)
241
- - View update optimization
242
- - ForEach performance
243
- - Resource management
244
-
245
- 4. **Security & Safety**
246
- - Force unwrap detection
247
- - Sensitive data handling
248
- - Network security
249
-
250
- 5. **Architecture & Maintainability**
251
- - Pattern compliance
252
- - Dependency injection
253
- - Testability
32
+ The skill automatically activates, reads your `.claude/CLAUDE.md` for project standards, and generates a structured report with severity levels, code examples, and prioritized action items.
254
33
 
255
- 6. **Project-Specific Standards**
256
- - `.claude/CLAUDE.md` compliance
257
- - Design system usage
258
- - Custom error patterns
259
-
260
- ### Phase 3: Report Generation
261
-
262
- 1. **Categorizes findings** by severity (Critical, High, Medium, Low)
263
- 2. **Includes positive feedback** for good practices
264
- 3. **Adds refactoring suggestions** for improvements
265
- 4. **Groups by file** and category
266
- 5. **Provides code examples** for all issues
267
-
268
- ### Phase 4: Delivery
269
-
270
- Generates a structured markdown report:
34
+ ### Example Output
271
35
 
272
36
  ```markdown
273
37
  # Code Review Report
274
38
 
275
39
  ## Summary
276
40
 
277
- - Files Reviewed: 5
278
- - Critical: 0
279
- - High: 2
280
- - Medium: 5
281
- - Low: 3
282
- - Positive Feedback: 8
283
-
284
- ## Detailed Findings
285
-
286
- ### File: LoginView.swift
41
+ - Files Reviewed: 3 | Critical: 0 | High: 1 | Medium: 2 | Low: 1
287
42
 
288
- #### Positive Feedback
289
-
290
- 1. Excellent use of @Observable for state management
43
+ ## File: LoginViewModel.swift
291
44
 
292
- #### 🟡 High Priority
45
+ **Excellent Modern API Usage** (line 12)
293
46
 
294
- 1. Force unwrap detected at line 89 (potential crash)
47
+ - Using @Observable instead of ObservableObject
295
48
 
296
- #### 💡 Refactoring Suggestions
49
+ 🟡 **Force Unwrap Detected** (line 89)
50
+ Current: `let user = repository.currentUser!`
51
+ Fix:
52
+ guard let user = repository.currentUser else {
53
+ logger.error("No current user")
54
+ return
55
+ }
297
56
 
298
- 1. Consider extracting login form into separate view
57
+ 🔴 **Violates Design System Standard** (line 45)
58
+ Current: `.foregroundColor(.blue)`
59
+ Fix: `.foregroundColor(AppColors.primary)`
299
60
 
300
61
  ## Prioritized Action Items
301
62
 
302
- [Must fix, should fix, consider items]
63
+ 1. [Must fix] Remove force unwrap at line 89
64
+ 2. [Should fix] Use design system colors at line 45
303
65
  ```
304
66
 
305
- ## Review Report Structure
306
-
307
- ### Severity Levels
308
-
309
- | Severity | Icon | Description | Response Time |
310
- | ------------ | ---- | --------------------------------------------------- | ----------------------- |
311
- | **Critical** | 🔴 | Security vulnerabilities, crashes, data races | Must fix before merge |
312
- | **High** | 🟡 | Performance issues, anti-patterns, major violations | Should fix before merge |
313
- | **Medium** | 🟠 | Code quality, documentation, minor violations | Fix in current sprint |
314
- | **Low** | 🔵 | Style, suggestions, minor improvements | Consider for future |
315
-
316
- ### Feedback Types
317
-
318
- **Positive Feedback** ✅
67
+ ## What It Reviews
319
68
 
320
- - Acknowledges good practices
321
- - Highlights excellent implementations
322
- - Recognizes proper patterns
69
+ | Category | Checks |
70
+ | --------------------- | --------------------------------------------------------------------------------------------------------- |
71
+ | **Swift Quality** | Concurrency safety, actor isolation, Sendable, error handling, optionals, access control, naming |
72
+ | **SwiftUI Patterns** | @Observable, state management, property wrappers, NavigationStack, .task, view composition, accessibility |
73
+ | **Performance** | View updates, Equatable, ForEach identity, GeometryReader, lazy loading, memory leaks |
74
+ | **Security** | Keychain, input validation, HTTPS, certificate pinning, API key protection, sensitive data logging |
75
+ | **Architecture** | MVVM/MVI/TCA compliance, dependency injection, code organization, testability |
76
+ | **Project Standards** | `.claude/CLAUDE.md` rules, design system, custom error patterns, testing requirements |
323
77
 
324
- **Issues** 🔴🟡🟠🔵
78
+ ### Severity Levels
325
79
 
326
- - File and line references
327
- - Code examples (before/after)
328
- - Specific fixes with explanations
329
- - Links to documentation
80
+ | Icon | Severity | Action |
81
+ | ---- | -------- | ----------------------- |
82
+ | 🔴 | Critical | Must fix before merge |
83
+ | 🟡 | High | Should fix before merge |
84
+ | 🟠 | Medium | Fix in current sprint |
85
+ | 🔵 | Low | Consider for future |
330
86
 
331
- **Refactoring Suggestions** 💡
87
+ ## Platform Support
332
88
 
333
- - Proactive improvements
334
- - Modernization opportunities
335
- - Code simplification ideas
89
+ - Works with **GitHub PRs** (`gh`), **GitLab MRs** (`glab`), and **local git changes**
90
+ - Swift 6.0+ | iOS 17+ | macOS 14+ | watchOS 10+ | tvOS 17+ | visionOS 1+
336
91
 
337
92
  ## Project-Specific Standards
338
93
 
339
- The skill reads `.claude/CLAUDE.md` to understand your project's:
94
+ Add a `.claude/CLAUDE.md` to your project and the skill will validate against your rules:
340
95
 
341
- - Architecture pattern (MVVM, MVI, TCA, etc.)
342
- - Dependency injection approach
343
- - Error handling patterns
344
- - Testing requirements
345
- - Design system guidelines
346
- - Navigation patterns
347
- - Custom naming conventions
348
-
349
- ### Example .claude/CLAUDE.md
350
-
351
- ````markdown
352
- # MyApp Coding Standards
96
+ ```markdown
97
+ # MyApp Standards
353
98
 
354
99
  ## Architecture
355
100
 
356
- We use **MVVM with Coordinators**:
357
-
358
101
  - ViewModels MUST use @Observable (iOS 17+)
359
102
  - All dependencies MUST be injected via constructor
360
103
  - Views MUST NOT contain business logic
361
104
 
362
- ## Error Handling
363
-
364
- All errors MUST conform to AppError:
365
-
366
- ```swift
367
- protocol AppError: Error {
368
- var message: String { get }
369
- var code: Int { get }
370
- }
371
- ```
372
- ````
373
-
374
105
  ## Design System
375
106
 
376
107
  - Use AppColors enum ONLY
377
108
  - Use AppFonts enum ONLY
378
- - Use AppSpacing for all padding
379
109
 
380
110
  ## Testing
381
111
 
382
112
  - Minimum coverage: 80%
383
113
  - All ViewModels MUST have unit tests
384
-
385
- ```
386
-
387
- The skill will validate your code against these standards and report violations.
388
-
389
- ## Reference Documentation
390
-
391
- The skill includes comprehensive reference guides:
392
-
393
- - **review-workflow.md**: Step-by-step review process and git commands
394
- - **swift-quality-checklist.md**: Swift 6+ concurrency, error handling, optionals
395
- - **swiftui-review-checklist.md**: State management, property wrappers, modern APIs
396
- - **performance-review.md**: View optimization, ForEach performance, layout efficiency
397
- - **security-checklist.md**: Input validation, sensitive data, network security
398
- - **architecture-patterns.md**: MVVM, Repository, DI, Use Case, Coordinator patterns
399
- - **feedback-templates.md**: Review comment templates and severity guidelines
400
- - **custom-guidelines.md**: How to parse and validate `.claude/CLAUDE.md`
401
-
402
- ## Integration with Other Skills
403
-
404
- This skill **leverages** three foundational skills:
405
-
406
- ### swift-best-practices
407
- For Swift 6+ language patterns, concurrency, and API design
408
- - Loads when reviewing Swift language usage
409
- - References: `concurrency.md`, `swift6-features.md`, `api-design.md`
410
-
411
- ### swiftui-expert-skill
412
- For SwiftUI state management and modern APIs
413
- - Loads when reviewing SwiftUI views
414
- - References: `state-management.md`, `modern-apis.md`, `view-composition.md`
415
-
416
- ### swiftui-performance-audit
417
- For performance analysis
418
- - Loads when performance concerns identified
419
- - Runs focused audit on performance-sensitive paths
420
-
421
- **Note**: These skills should be installed separately for full functionality, but the code reviewer works independently with its own comprehensive checklists.
422
-
423
- ## Examples
424
-
425
- ### Example 1: Review Uncommitted Changes
426
-
427
- **Input:**
428
114
  ```
429
115
 
430
- Review my uncommitted changes
116
+ ## Alternative Installation
431
117
 
432
- ````
118
+ <details>
119
+ <summary>Clone this repository</summary>
433
120
 
434
- **Output:**
435
- ```markdown
436
- # Code Review Report
437
-
438
- ## Summary
439
- - Files Reviewed: 3
440
- - Critical: 0
441
- - High: 1
442
- - Medium: 2
443
- - Low: 1
444
- - Positive Feedback: 5
445
-
446
- ## File: LoginViewModel.swift
447
-
448
- ✅ **Excellent Modern API Usage** (line 12)
449
- - Using @Observable instead of ObservableObject
450
- - Clean, modern pattern for iOS 17+
451
-
452
- 🟡 **Force Unwrap Detected** (line 89)
453
- **Severity**: High
454
- **Issue**: Force unwrapping can crash if data is nil
455
-
456
- Current Code:
457
- ```swift
458
- let user = repository.currentUser!
459
- ````
460
-
461
- Recommended Fix:
462
-
463
- ```swift
464
- guard let user = repository.currentUser else {
465
- logger.error("No current user")
466
- return
467
- }
121
+ ```bash
122
+ git clone https://github.com/Viniciuscarvalho/swift-code-reviewer-skill.git ~/.claude/skills/swift-code-reviewer-skill
468
123
  ```
469
124
 
470
- ```
125
+ </details>
471
126
 
472
- ### Example 2: Review Against Project Standards
127
+ <details>
128
+ <summary>Manual installation</summary>
473
129
 
474
- **Input:**
130
+ ```bash
131
+ mkdir -p ~/.claude/skills/swift-code-reviewer-skill/references
475
132
  ```
476
133
 
477
- Review LoginView.swift against our coding standards
478
-
479
- ````
134
+ Download the files from this repository into the directory, then restart Claude.
480
135
 
481
- **Output:**
482
- ```markdown
483
- # Project Standards Review
484
-
485
- ## .claude/CLAUDE.md Compliance
136
+ </details>
486
137
 
487
- ✅ **Architecture Adherence**
488
- - Follows MVVM pattern correctly
489
- - No business logic in view
490
- - Dependencies injected properly
491
-
492
- 🔴 **Violates Design System Standard** (line 45)
493
- **Project Guideline**: "Use AppColors enum ONLY. No hardcoded colors"
494
-
495
- Current Code:
496
- ```swift
497
- .foregroundColor(.blue) // ❌ Hardcoded
498
- ````
499
-
500
- Expected Code:
501
-
502
- ```swift
503
- .foregroundColor(AppColors.primary) // ✅ Design system
504
- ```
505
-
506
- Reference: .claude/CLAUDE.md:Design System
138
+ <details>
139
+ <summary>Uninstall</summary>
507
140
 
141
+ ```bash
142
+ npx swift-code-reviewer-skill uninstall
508
143
  ```
509
144
 
510
- ## Requirements
511
-
512
- - Claude Code CLI
513
- - Git (for reviewing diffs and PRs)
514
- - Optional: `gh` CLI for GitHub integration
515
- - Optional: `glab` CLI for GitLab integration
516
- - Swift 6.0+
517
- - iOS 17+, macOS 14+, watchOS 10+, tvOS 17+, or visionOS 1+
145
+ </details>
518
146
 
519
- ## Limitations
520
-
521
- - Cannot execute code or run tests (static analysis only)
522
- - Cannot access external systems or APIs
523
- - Limited to analyzing provided code or git-accessible code
524
- - Cannot detect runtime issues requiring execution
525
- - Performance analysis based on patterns, not profiling data
147
+ ## Integration with Other Skills
526
148
 
527
- For runtime analysis, use Instruments or other profiling tools alongside this skill.
149
+ This skill optionally leverages **swift-best-practices**, **swiftui-expert-skill**, and **swiftui-performance-audit** for deeper analysis. It works independently with its own comprehensive checklists.
528
150
 
529
151
  ## Contributing
530
152
 
531
- Contributions are welcome! Here's how you can help:
532
-
533
- 1. **Report Issues**: Found a bug or have a suggestion? Open an issue
534
- 2. **Improve Checklists**: Add new patterns or update existing checks
535
- 3. **Add Examples**: Contribute real-world review examples
536
- 4. **Update Documentation**: Improve clarity and add use cases
537
- 5. **Add Templates**: Create new feedback templates
538
-
539
- ### Development
540
-
541
- To modify the skill:
542
-
543
153
  1. Edit `SKILL.md` for main skill logic
544
154
  2. Update reference files in `references/` for specific checklists
545
155
  3. Test with real Swift/SwiftUI code
@@ -547,34 +157,12 @@ To modify the skill:
547
157
 
548
158
  ## License
549
159
 
550
- MIT License - See [LICENSE](LICENSE) file for details
551
-
552
- ## Acknowledgments
553
-
554
- - Inspired by Apple's Swift API Design Guidelines
555
- - Leverages best practices from the Swift and SwiftUI communities
556
- - Built on top of Claude's code analysis capabilities
557
- - Designed to complement existing Swift development skills
558
-
559
- ## Support
560
-
561
- - **Issues**: [GitHub Issues](https://github.com/Viniciuscarvalho/swift-code-reviewer-skill/issues)
562
- - **Discussions**: [GitHub Discussions](https://github.com/Viniciuscarvalho/swift-code-reviewer-skill/discussions)
563
-
564
- ## Version History
565
-
566
- ### 1.0.0 (2026-02-10)
567
- - Initial release
568
- - Comprehensive Swift 6+ and SwiftUI review capabilities
569
- - Project-specific standards integration
570
- - Multi-layer analysis (6 categories)
571
- - Structured feedback with all severity levels
572
- - Integration with existing skills
573
- - 7,700+ lines of comprehensive documentation
160
+ MIT License - See [LICENSE](LICENSE) file for details.
574
161
 
575
162
  ---
576
163
 
577
164
  **Made with ❤️ for the Swift community**
578
165
 
579
- If this skill helps improve your code reviews, please ⭐️ star the repository!
580
- ```
166
+ If this skill helps your code reviews, please star the repository!
167
+
168
+ - [Issues](https://github.com/Viniciuscarvalho/swift-code-reviewer-skill/issues) | [Discussions](https://github.com/Viniciuscarvalho/swift-code-reviewer-skill/discussions)
package/SKILL.md CHANGED
@@ -30,6 +30,7 @@ Use this skill when you need to:
30
30
  - Provide structured feedback to team members
31
31
 
32
32
  **Trigger patterns:**
33
+
33
34
  - "Review this PR"
34
35
  - "Review [filename].swift"
35
36
  - "Review my changes"
@@ -69,6 +70,7 @@ The skill follows a **four-phase workflow** to ensure comprehensive and actionab
69
70
  Execute checks across **six core categories**:
70
71
 
71
72
  #### 1. Swift Best Practices
73
+
72
74
  Reference: `swift-best-practices` skill knowledge base
73
75
 
74
76
  - **Concurrency Safety**
@@ -91,6 +93,7 @@ Reference: `swift-best-practices` skill knowledge base
91
93
  - Proper use of optionals
92
94
 
93
95
  #### 2. SwiftUI Quality
96
+
94
97
  Reference: `swiftui-expert-skill` knowledge base
95
98
 
96
99
  - **State Management**
@@ -118,6 +121,7 @@ Reference: `swiftui-expert-skill` knowledge base
118
121
  - Keyboard navigation
119
122
 
120
123
  #### 3. Performance
124
+
121
125
  Reference: `swiftui-performance-audit` knowledge base
122
126
 
123
127
  - **View Optimization**
@@ -256,7 +260,7 @@ Reference: `swiftui-performance-audit` knowledge base
256
260
  - Comparison with project guidelines
257
261
 
258
262
  3. **Provide Context**
259
- - Explain *why* something is an issue
263
+ - Explain _why_ something is an issue
260
264
  - Reference best practices or standards
261
265
  - Suggest specific fixes with examples
262
266
  - Link to learning resources
@@ -266,6 +270,7 @@ Reference: `swiftui-performance-audit` knowledge base
266
270
  ### 1. Swift Language Quality
267
271
 
268
272
  **What to Check:**
273
+
269
274
  - Concurrency patterns (actors, async/await, Sendable)
270
275
  - Error handling (typed throws, Result type)
271
276
  - Optionals handling (avoid force unwrapping)
@@ -279,6 +284,7 @@ Reference: `swiftui-performance-audit` knowledge base
279
284
  ### 2. SwiftUI Patterns
280
285
 
281
286
  **What to Check:**
287
+
282
288
  - Property wrapper selection and usage
283
289
  - State management patterns
284
290
  - View lifecycle understanding
@@ -292,6 +298,7 @@ Reference: `swiftui-performance-audit` knowledge base
292
298
  ### 3. Performance Optimization
293
299
 
294
300
  **What to Check:**
301
+
295
302
  - View update optimization
296
303
  - ForEach identity and performance
297
304
  - Heavy work in view body
@@ -305,6 +312,7 @@ Reference: `swiftui-performance-audit` knowledge base
305
312
  ### 4. Security & Safety
306
313
 
307
314
  **What to Check:**
315
+
308
316
  - Force unwrap detection (`!`, `as!`, `try!`)
309
317
  - Input validation and sanitization
310
318
  - Sensitive data handling (passwords, tokens)
@@ -318,6 +326,7 @@ Reference: `swiftui-performance-audit` knowledge base
318
326
  ### 5. Architecture & Design
319
327
 
320
328
  **What to Check:**
329
+
321
330
  - MVVM, MVI, TCA, or other architecture compliance
322
331
  - Dependency injection patterns
323
332
  - Separation of concerns
@@ -331,6 +340,7 @@ Reference: `swiftui-performance-audit` knowledge base
331
340
  ### 6. Project-Specific Standards
332
341
 
333
342
  **What to Check:**
343
+
334
344
  - `.claude/CLAUDE.md` compliance
335
345
  - Custom architecture patterns
336
346
  - Design system usage
@@ -345,9 +355,11 @@ Reference: `swiftui-performance-audit` knowledge base
345
355
  This skill **references** (not duplicates) three foundational skills for domain expertise:
346
356
 
347
357
  ### 1. swift-best-practices
358
+
348
359
  **When to Use:** Reviewing Swift language usage, concurrency patterns, API design, or Swift 6+ migration
349
360
 
350
361
  **What it Provides:**
362
+
351
363
  - Swift 6+ concurrency patterns (actors, async/await, Sendable)
352
364
  - API design guidelines compliance
353
365
  - Availability pattern validation
@@ -355,14 +367,17 @@ This skill **references** (not duplicates) three foundational skills for domain
355
367
  - Modern Swift feature adoption
356
368
 
357
369
  **How to Leverage:**
370
+
358
371
  - Read `~/.claude/skills/swift-best-practices/references/concurrency.md` for concurrency checks
359
372
  - Reference `swift6-features.md` for Swift 6 migration patterns
360
373
  - Use `api-design.md` for naming and parameter validation
361
374
 
362
375
  ### 2. swiftui-expert-skill
376
+
363
377
  **When to Use:** Reviewing SwiftUI views, state management, or UI code
364
378
 
365
379
  **What it Provides:**
380
+
366
381
  - State management patterns (@Observable, @State, @Binding)
367
382
  - Modern SwiftUI API guidance (iOS 17+, macOS 14+)
368
383
  - View composition best practices
@@ -370,14 +385,17 @@ This skill **references** (not duplicates) three foundational skills for domain
370
385
  - Accessibility patterns
371
386
 
372
387
  **How to Leverage:**
388
+
373
389
  - Read `~/.claude/skills/swiftui-expert-skill/references/state-management.md` for property wrapper checks
374
390
  - Reference `modern-apis.md` for deprecation detection
375
391
  - Use `view-composition.md` for component structure validation
376
392
 
377
393
  ### 3. swiftui-performance-audit
394
+
378
395
  **When to Use:** Performance concerns identified or mentioned in PR description
379
396
 
380
397
  **What it Provides:**
398
+
381
399
  - View update optimization patterns
382
400
  - ForEach performance analysis
383
401
  - Layout thrash detection
@@ -385,14 +403,17 @@ This skill **references** (not duplicates) three foundational skills for domain
385
403
  - Memory management
386
404
 
387
405
  **How to Leverage:**
406
+
388
407
  - Read `~/.claude/skills/swiftui-performance-audit/SKILL.md` for performance audit workflow
389
408
  - Reference performance-specific checks when reviewing view code
390
409
  - Apply recommendations from the skill to performance-sensitive paths
391
410
 
392
411
  ### 4. swiftui-ui-patterns
412
+
393
413
  **When to Use:** Reviewing navigation architecture, sheet/modal routing, TabView setup, theming, async state management, focus handling, or API client patterns
394
414
 
395
415
  **What it Provides:**
416
+
396
417
  - Navigation architecture (route enums, RouterPath, centralized navigationDestination)
397
418
  - Sheet/modal routing (item-driven sheets, SheetDestination enum)
398
419
  - TabView with independent per-tab navigation history
@@ -402,11 +423,13 @@ This skill **references** (not duplicates) three foundational skills for domain
402
423
  - Lightweight API client pattern (closure-based structs, `.live()` / `.mock()` factories)
403
424
 
404
425
  **How to Leverage:**
426
+
405
427
  - Read `~/.claude/skills/swiftui-ui-patterns/references/navigation.md` for route enum and RouterPath checks
406
428
  - Reference `sheets-modals.md` for sheet routing validation
407
429
  - Use `theming.md` for semantic color enforcement
408
430
 
409
431
  **Integration Strategy:**
432
+
410
433
  1. Load relevant reference files from these skills as needed
411
434
  2. Apply their checklist items to the review
412
435
  3. Reference their documentation in feedback
@@ -415,6 +438,7 @@ This skill **references** (not duplicates) three foundational skills for domain
415
438
  ## Platform Support
416
439
 
417
440
  ### GitHub Pull Requests
441
+
418
442
  Use `gh` CLI for fetching PR data:
419
443
 
420
444
  ```bash
@@ -432,6 +456,7 @@ gh pr view <PR-number> --json comments
432
456
  ```
433
457
 
434
458
  ### GitLab Merge Requests
459
+
435
460
  Use `glab` CLI for fetching MR data:
436
461
 
437
462
  ```bash
@@ -449,6 +474,7 @@ glab mr note list <MR-number>
449
474
  ```
450
475
 
451
476
  ### Local Git Changes
477
+
452
478
  For uncommitted changes or manual review:
453
479
 
454
480
  ```bash
@@ -469,10 +495,11 @@ git show <commit-hash>
469
495
 
470
496
  The review report follows this structure:
471
497
 
472
- ```markdown
498
+ ````markdown
473
499
  # Code Review Report
474
500
 
475
501
  ## Summary
502
+
476
503
  - **Files Reviewed**: X
477
504
  - **Total Findings**: Y
478
505
  - **Critical**: 0
@@ -483,6 +510,7 @@ The review report follows this structure:
483
510
  - **Refactoring Suggestions**: 4
484
511
 
485
512
  ## Executive Summary
513
+
486
514
  [Brief overview of the changes and overall code quality]
487
515
 
488
516
  ---
@@ -492,6 +520,7 @@ The review report follows this structure:
492
520
  ### File: Sources/Features/Login/LoginView.swift
493
521
 
494
522
  #### ✅ Positive Feedback
523
+
495
524
  1. **Excellent State Management** (line 23)
496
525
  - Proper use of @Observable for view model
497
526
  - Clean separation of concerns
@@ -501,11 +530,13 @@ The review report follows this structure:
501
530
  - Proper async/await integration
502
531
 
503
532
  #### 🔴 Critical Issues
533
+
504
534
  1. **Data Race Risk** (line 67)
505
535
  - **Severity**: Critical
506
536
  - **Category**: Concurrency
507
537
  - **Issue**: Mutable state accessed from multiple actors without synchronization
508
538
  - **Fix**:
539
+
509
540
  ```swift
510
541
  // Before
511
542
  class LoginViewModel {
@@ -518,14 +549,17 @@ The review report follows this structure:
518
549
  @Published var isLoading = false
519
550
  }
520
551
  ```
552
+
521
553
  - **Reference**: swift-best-practices/references/concurrency.md
522
554
 
523
555
  #### 🟡 High Priority
556
+
524
557
  1. **Force Unwrap Detected** (line 89)
525
558
  - **Severity**: High
526
559
  - **Category**: Safety
527
560
  - **Issue**: Force unwrapping optional can cause crash
528
561
  - **Fix**:
562
+
529
563
  ```swift
530
564
  // Before
531
565
  let user = fetchUser()!
@@ -536,9 +570,11 @@ The review report follows this structure:
536
570
  return
537
571
  }
538
572
  ```
573
+
539
574
  - **Reference**: Project coding standard (.claude/CLAUDE.md:45)
540
575
 
541
576
  #### 💡 Refactoring Suggestions
577
+
542
578
  1. **Extract Subview** (lines 120-150)
543
579
  - Consider extracting login form into separate view
544
580
  - Improves testability and reusability
@@ -548,20 +584,24 @@ The review report follows this structure:
548
584
  ## Prioritized Action Items
549
585
 
550
586
  ### Must Fix (Critical/High)
587
+
551
588
  1. [ ] Fix data race in LoginViewModel.swift:67
552
589
  2. [ ] Remove force unwrap in LoginView.swift:89
553
590
 
554
591
  ### Should Fix (Medium)
592
+
555
593
  1. [ ] Add documentation to public APIs
556
594
  2. [ ] Improve error handling in NetworkService.swift
557
595
 
558
596
  ### Consider (Low)
597
+
559
598
  1. [ ] Refactor login form into separate view
560
599
  2. [ ] Add more unit tests for edge cases
561
600
 
562
601
  ---
563
602
 
564
603
  ## Positive Patterns Observed
604
+
565
605
  - Excellent use of @Observable for state management
566
606
  - Consistent adherence to project architecture (MVVM)
567
607
  - Comprehensive accessibility support
@@ -569,14 +609,16 @@ The review report follows this structure:
569
609
  - Good test coverage for core functionality
570
610
 
571
611
  ## References
612
+
572
613
  - [Swift Best Practices](~/.claude/skills/swift-best-practices/SKILL.md)
573
614
  - [SwiftUI Expert Guide](~/.claude/skills/swiftui-expert-skill/SKILL.md)
574
615
  - [Project Coding Standards](.claude/CLAUDE.md)
575
- ```
616
+ ````
576
617
 
577
618
  ## How to Use
578
619
 
579
620
  ### Example 1: Review Specific File
621
+
580
622
  ```
581
623
  User: "Review UserProfileView.swift"
582
624
 
@@ -588,6 +630,7 @@ Steps:
588
630
  ```
589
631
 
590
632
  ### Example 2: Review Git Changes
633
+
591
634
  ```
592
635
  User: "Review my uncommitted changes"
593
636
 
@@ -600,6 +643,7 @@ Steps:
600
643
  ```
601
644
 
602
645
  ### Example 3: Review Pull Request
646
+
603
647
  ```
604
648
  User: "Review PR #123"
605
649
 
@@ -613,6 +657,7 @@ Steps:
613
657
  ```
614
658
 
615
659
  ### Example 4: Review Against Custom Guidelines
660
+
616
661
  ```
617
662
  User: "Review LoginViewModel.swift against our coding standards"
618
663
 
@@ -625,6 +670,7 @@ Steps:
625
670
  ```
626
671
 
627
672
  ### Example 5: Review Multiple Files
673
+
628
674
  ```
629
675
  User: "Review all ViewModels in the Features folder"
630
676
 
@@ -637,6 +683,7 @@ Steps:
637
683
  ```
638
684
 
639
685
  ### Example 6: Review Navigation / Routing Code
686
+
640
687
  ```
641
688
  User: "Review our navigation setup and routing code"
642
689
 
@@ -664,16 +711,19 @@ Steps:
664
711
  This skill includes the following reference materials:
665
712
 
666
713
  ### Core References
714
+
667
715
  - **review-workflow.md**: Detailed step-by-step review process, git commands, and diff parsing strategies
668
716
  - **feedback-templates.md**: Templates for positive/negative comments, severity classification guidelines
669
717
 
670
718
  ### Quality Checklists
719
+
671
720
  - **swift-quality-checklist.md**: Swift 6+ concurrency, error handling, optionals, access control, naming
672
721
  - **swiftui-review-checklist.md**: Property wrappers, state management, modern APIs, view composition
673
722
  - **performance-review.md**: View updates, ForEach optimization, layout efficiency, resource management
674
723
  - **security-checklist.md**: Input validation, sensitive data, keychain, network security
675
724
 
676
725
  ### Architecture & Customization
726
+
677
727
  - **architecture-patterns.md**: MVVM, MVI, TCA patterns, dependency injection, testing strategies
678
728
  - **custom-guidelines.md**: How to read and parse .claude/CLAUDE.md and project-specific standards
679
729
 
@@ -692,7 +742,7 @@ This skill includes the following reference materials:
692
742
  3. **Be Specific and Actionable**
693
743
  - Include exact file:line references
694
744
  - Provide code examples for fixes
695
- - Explain *why* something is an issue
745
+ - Explain _why_ something is an issue
696
746
  - Link to relevant documentation
697
747
 
698
748
  4. **Prioritize by Severity**
@@ -725,6 +775,6 @@ For runtime analysis, recommend using Instruments or other profiling tools.
725
775
 
726
776
  ## Version
727
777
 
728
- **Version**: 1.1.0
778
+ **Version**: 1.1.1
729
779
  **Last Updated**: 2026-03-16
730
780
  **Compatible with**: Swift 6+, SwiftUI (iOS 17+, macOS 14+, watchOS 10+, tvOS 17+, visionOS 1+)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swift-code-reviewer-skill",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Claude Code skill for comprehensive Swift/SwiftUI code reviews with multi-layer analysis",
5
5
  "keywords": [
6
6
  "claude",