swift-code-reviewer-skill 1.0.0

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.
package/bin/install.js ADDED
@@ -0,0 +1,173 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ const SKILL_NAME = 'swift-code-reviewer-skill';
8
+
9
+ // Colors for terminal output
10
+ const colors = {
11
+ reset: '\x1b[0m',
12
+ bright: '\x1b[1m',
13
+ green: '\x1b[32m',
14
+ yellow: '\x1b[33m',
15
+ blue: '\x1b[34m',
16
+ red: '\x1b[31m',
17
+ cyan: '\x1b[36m'
18
+ };
19
+
20
+ function log(message, color = colors.reset) {
21
+ console.log(`${color}${message}${colors.reset}`);
22
+ }
23
+
24
+ function copyRecursive(src, dest) {
25
+ const stats = fs.statSync(src);
26
+
27
+ if (stats.isDirectory()) {
28
+ if (!fs.existsSync(dest)) {
29
+ fs.mkdirSync(dest, { recursive: true });
30
+ }
31
+
32
+ const entries = fs.readdirSync(src);
33
+ for (const entry of entries) {
34
+ copyRecursive(path.join(src, entry), path.join(dest, entry));
35
+ }
36
+ } else {
37
+ fs.copyFileSync(src, dest);
38
+ }
39
+ }
40
+
41
+ function install() {
42
+ log('\n Swift Code Reviewer Skill Installer', colors.cyan + colors.bright);
43
+ log(' ====================================\n', colors.cyan);
44
+
45
+ // Determine paths
46
+ const homeDir = os.homedir();
47
+ const skillsDir = path.join(homeDir, '.claude', 'skills');
48
+ const targetDir = path.join(skillsDir, SKILL_NAME);
49
+
50
+ // Find package root (where SKILL.md is located)
51
+ let packageRoot = __dirname;
52
+ while (!fs.existsSync(path.join(packageRoot, 'SKILL.md'))) {
53
+ const parent = path.dirname(packageRoot);
54
+ if (parent === packageRoot) {
55
+ log(' Error: Could not find SKILL.md in package', colors.red);
56
+ process.exit(1);
57
+ }
58
+ packageRoot = parent;
59
+ }
60
+
61
+ // Check if Claude Code skills directory exists
62
+ if (!fs.existsSync(skillsDir)) {
63
+ log(` Creating skills directory: ${skillsDir}`, colors.yellow);
64
+ fs.mkdirSync(skillsDir, { recursive: true });
65
+ }
66
+
67
+ // Check for existing installation
68
+ if (fs.existsSync(targetDir)) {
69
+ log(` Updating existing installation at:`, colors.yellow);
70
+ log(` ${targetDir}\n`, colors.yellow);
71
+ fs.rmSync(targetDir, { recursive: true, force: true });
72
+ } else {
73
+ log(` Installing to:`, colors.blue);
74
+ log(` ${targetDir}\n`, colors.blue);
75
+ }
76
+
77
+ // Create target directory
78
+ fs.mkdirSync(targetDir, { recursive: true });
79
+
80
+ // Files to copy
81
+ const filesToCopy = [
82
+ 'SKILL.md',
83
+ 'README.md',
84
+ 'LICENSE',
85
+ 'CONTRIBUTING.md',
86
+ 'CHANGELOG.md'
87
+ ];
88
+
89
+ // Directories to copy
90
+ const dirsToCopy = ['references'];
91
+
92
+ // Copy files
93
+ for (const file of filesToCopy) {
94
+ const src = path.join(packageRoot, file);
95
+ const dest = path.join(targetDir, file);
96
+
97
+ if (fs.existsSync(src)) {
98
+ fs.copyFileSync(src, dest);
99
+ log(` Copied: ${file}`, colors.green);
100
+ }
101
+ }
102
+
103
+ // Copy directories
104
+ for (const dir of dirsToCopy) {
105
+ const src = path.join(packageRoot, dir);
106
+ const dest = path.join(targetDir, dir);
107
+
108
+ if (fs.existsSync(src)) {
109
+ copyRecursive(src, dest);
110
+ log(` Copied: ${dir}/`, colors.green);
111
+ }
112
+ }
113
+
114
+ // Success message
115
+ log('\n Installation complete!', colors.green + colors.bright);
116
+ log('\n The skill is now available in Claude Code.', colors.reset);
117
+ log(' Use it by asking Claude to:', colors.reset);
118
+ log('\n - "Review this PR"', colors.cyan);
119
+ log(' - "Review LoginView.swift"', colors.cyan);
120
+ log(' - "Review my uncommitted changes"', colors.cyan);
121
+ log(' - "Check if this follows our coding standards"\n', colors.cyan);
122
+
123
+ log(` Skill location: ${targetDir}`, colors.blue);
124
+ log(' Documentation: https://github.com/Viniciuscarvalho/swift-code-reviewer-skill\n', colors.blue);
125
+ }
126
+
127
+ function uninstall() {
128
+ log('\n Uninstalling Swift Code Reviewer Skill', colors.yellow + colors.bright);
129
+ log(' ======================================\n', colors.yellow);
130
+
131
+ const homeDir = os.homedir();
132
+ const targetDir = path.join(homeDir, '.claude', 'skills', SKILL_NAME);
133
+
134
+ if (fs.existsSync(targetDir)) {
135
+ fs.rmSync(targetDir, { recursive: true, force: true });
136
+ log(` Removed: ${targetDir}`, colors.green);
137
+ log('\n Uninstallation complete!\n', colors.green + colors.bright);
138
+ } else {
139
+ log(' Skill not found. Nothing to uninstall.\n', colors.yellow);
140
+ }
141
+ }
142
+
143
+ function showHelp() {
144
+ log('\n Swift Code Reviewer Skill', colors.cyan + colors.bright);
145
+ log(' =========================\n', colors.cyan);
146
+ log(' Usage: npx swift-code-reviewer-skill [command]\n', colors.reset);
147
+ log(' Commands:', colors.bright);
148
+ log(' (none) Install the skill to ~/.claude/skills/', colors.reset);
149
+ log(' uninstall Remove the skill from ~/.claude/skills/', colors.reset);
150
+ log(' help Show this help message\n', colors.reset);
151
+ log(' Examples:', colors.bright);
152
+ log(' npx swift-code-reviewer-skill', colors.cyan);
153
+ log(' npx swift-code-reviewer-skill uninstall\n', colors.cyan);
154
+ }
155
+
156
+ // Parse command line arguments
157
+ const args = process.argv.slice(2);
158
+ const command = args[0];
159
+
160
+ switch (command) {
161
+ case 'uninstall':
162
+ case 'remove':
163
+ uninstall();
164
+ break;
165
+ case 'help':
166
+ case '--help':
167
+ case '-h':
168
+ showHelp();
169
+ break;
170
+ default:
171
+ install();
172
+ break;
173
+ }
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "swift-code-reviewer-skill",
3
+ "version": "1.0.0",
4
+ "description": "Claude Code skill for comprehensive Swift/SwiftUI code reviews with multi-layer analysis",
5
+ "keywords": [
6
+ "claude",
7
+ "claude-code",
8
+ "skill",
9
+ "swift",
10
+ "swiftui",
11
+ "code-review",
12
+ "ios",
13
+ "macos",
14
+ "apple"
15
+ ],
16
+ "author": "Vinicius Carvalho",
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/Viniciuscarvalho/swift-code-reviewer-skill.git"
21
+ },
22
+ "homepage": "https://github.com/Viniciuscarvalho/swift-code-reviewer-skill#readme",
23
+ "bugs": {
24
+ "url": "https://github.com/Viniciuscarvalho/swift-code-reviewer-skill/issues"
25
+ },
26
+ "bin": {
27
+ "swift-code-reviewer-skill": "./bin/install.js"
28
+ },
29
+ "files": [
30
+ "bin/",
31
+ "references/",
32
+ "SKILL.md",
33
+ "README.md",
34
+ "LICENSE",
35
+ "CONTRIBUTING.md",
36
+ "CHANGELOG.md"
37
+ ],
38
+ "engines": {
39
+ "node": ">=16.0.0"
40
+ }
41
+ }