@yeongjaeyou/claude-code-config 0.5.2 → 0.6.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/.claude/guidelines/cv-guidelines.md +13 -13
- package/bin/cli.js +71 -69
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
# CV Guidelines
|
|
2
2
|
|
|
3
|
-
Computer Vision
|
|
3
|
+
Best practices for Computer Vision tasks.
|
|
4
4
|
|
|
5
|
-
## BGR vs RGB
|
|
5
|
+
## BGR vs RGB Color Format
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Key Point**: OpenCV uses BGR, matplotlib uses RGB. When annotating with OpenCV-based libraries like supervision, keep the image in BGR format and convert to RGB only right before displaying with matplotlib.
|
|
8
8
|
|
|
9
9
|
```python
|
|
10
|
-
#
|
|
10
|
+
# Correct pattern
|
|
11
11
|
img = cv2.imread(path) # BGR
|
|
12
|
-
img = annotator.annotate(img, detections) # BGR
|
|
13
|
-
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #
|
|
12
|
+
img = annotator.annotate(img, detections) # Keep BGR
|
|
13
|
+
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # Convert just before display
|
|
14
14
|
plt.imshow(img)
|
|
15
15
|
|
|
16
|
-
#
|
|
16
|
+
# Wrong pattern (causes color inversion)
|
|
17
17
|
img = cv2.imread(path)
|
|
18
|
-
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) #
|
|
19
|
-
img = annotator.annotate(img, detections) #
|
|
18
|
+
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # Too early
|
|
19
|
+
img = annotator.annotate(img, detections) # BGR colors on RGB image -> inverted
|
|
20
20
|
plt.imshow(img)
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
## Ultralytics WandB
|
|
23
|
+
## Ultralytics WandB Integration
|
|
24
24
|
|
|
25
|
-
Ultralytics YOLO
|
|
25
|
+
Ultralytics YOLO has WandB disabled by default.
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
yolo settings wandb=True #
|
|
29
|
-
yolo settings wandb=False #
|
|
28
|
+
yolo settings wandb=True # Enable
|
|
29
|
+
yolo settings wandb=False # Disable
|
|
30
30
|
```
|
package/bin/cli.js
CHANGED
|
@@ -8,44 +8,45 @@ const readline = require('readline');
|
|
|
8
8
|
const pkg = require('../package.json');
|
|
9
9
|
const args = process.argv.slice(2);
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
const INSTALL_FOLDERS = ['commands', 'agents', 'skills'];
|
|
11
|
+
// Installation target folders (non-user data only)
|
|
12
|
+
const INSTALL_FOLDERS = ['commands', 'agents', 'skills', 'guidelines'];
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// Parse options
|
|
15
15
|
const isGlobal = args.includes('--global') || args.includes('-g');
|
|
16
16
|
const showHelp = args.includes('--help') || args.includes('-h');
|
|
17
17
|
const showVersion = args.includes('--version') || args.includes('-v');
|
|
18
18
|
|
|
19
|
-
//
|
|
19
|
+
// Version output
|
|
20
20
|
if (showVersion) {
|
|
21
21
|
console.log(pkg.version);
|
|
22
22
|
process.exit(0);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// Help output
|
|
26
26
|
if (showHelp) {
|
|
27
27
|
console.log(`
|
|
28
28
|
Claude Code Config v${pkg.version}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
npx @yeongjaeyou/claude-code-config [
|
|
30
|
+
Usage:
|
|
31
|
+
npx @yeongjaeyou/claude-code-config [options]
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
-g, --global
|
|
35
|
-
-h, --help
|
|
36
|
-
-v, --version
|
|
33
|
+
Options:
|
|
34
|
+
-g, --global Global install (~/.claude/)
|
|
35
|
+
-h, --help Show help
|
|
36
|
+
-v, --version Show version
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
npx @yeongjaeyou/claude-code-config #
|
|
40
|
-
npx @yeongjaeyou/claude-code-config --global #
|
|
38
|
+
Examples:
|
|
39
|
+
npx @yeongjaeyou/claude-code-config # Install to current project
|
|
40
|
+
npx @yeongjaeyou/claude-code-config --global # Global install
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
- commands/
|
|
44
|
-
- agents/
|
|
45
|
-
- skills/
|
|
42
|
+
Installed folders:
|
|
43
|
+
- commands/ : Slash commands
|
|
44
|
+
- agents/ : Custom agents
|
|
45
|
+
- skills/ : Skills (reusable tool collections)
|
|
46
|
+
- guidelines/ : Shared guidelines
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
--global
|
|
48
|
+
Note:
|
|
49
|
+
With --global install, existing user data (settings.json, history.jsonl, etc.) is preserved.
|
|
49
50
|
`);
|
|
50
51
|
process.exit(0);
|
|
51
52
|
}
|
|
@@ -56,14 +57,14 @@ const dest = isGlobal
|
|
|
56
57
|
: path.join(process.cwd(), '.claude');
|
|
57
58
|
|
|
58
59
|
/**
|
|
59
|
-
*
|
|
60
|
-
* @param {string} question -
|
|
61
|
-
* @returns {Promise<string>} -
|
|
60
|
+
* Ask user a question and get answer
|
|
61
|
+
* @param {string} question - Question content
|
|
62
|
+
* @returns {Promise<string>} - User answer
|
|
62
63
|
*/
|
|
63
64
|
function askQuestion(question) {
|
|
64
|
-
//
|
|
65
|
+
// Detect non-interactive environment (CI/CD, pipelines, etc.)
|
|
65
66
|
if (!process.stdin.isTTY) {
|
|
66
|
-
console.log('
|
|
67
|
+
console.log('Non-interactive environment detected. Using default (merge).');
|
|
67
68
|
return Promise.resolve('merge');
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -81,8 +82,8 @@ function askQuestion(question) {
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
/**
|
|
84
|
-
*
|
|
85
|
-
* @returns {string[]} -
|
|
85
|
+
* Check existing installation folders
|
|
86
|
+
* @returns {string[]} - List of existing folders
|
|
86
87
|
*/
|
|
87
88
|
function checkExistingFolders() {
|
|
88
89
|
const existing = [];
|
|
@@ -96,22 +97,22 @@ function checkExistingFolders() {
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
/**
|
|
99
|
-
*
|
|
100
|
-
* @param {string} src -
|
|
101
|
-
* @param {string} dst -
|
|
102
|
-
* @param {boolean} mergeMode -
|
|
100
|
+
* Copy folder recursively
|
|
101
|
+
* @param {string} src - Source path
|
|
102
|
+
* @param {string} dst - Destination path
|
|
103
|
+
* @param {boolean} mergeMode - Whether to use merge mode
|
|
103
104
|
*/
|
|
104
105
|
function copyFolder(src, dst, mergeMode = false) {
|
|
105
106
|
if (!fs.existsSync(src)) {
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
//
|
|
110
|
+
// Create destination folder
|
|
110
111
|
if (!fs.existsSync(dst)) {
|
|
111
112
|
try {
|
|
112
113
|
fs.mkdirSync(dst, { recursive: true });
|
|
113
114
|
} catch (err) {
|
|
114
|
-
throw new Error(
|
|
115
|
+
throw new Error(`Failed to create folder: ${dst} - ${err.message}`);
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
|
|
@@ -124,21 +125,21 @@ function copyFolder(src, dst, mergeMode = false) {
|
|
|
124
125
|
if (entry.isDirectory()) {
|
|
125
126
|
copyFolder(srcPath, dstPath, mergeMode);
|
|
126
127
|
} else {
|
|
127
|
-
//
|
|
128
|
+
// In merge mode, keep existing files
|
|
128
129
|
if (mergeMode && fs.existsSync(dstPath)) {
|
|
129
130
|
continue;
|
|
130
131
|
}
|
|
131
132
|
try {
|
|
132
133
|
fs.copyFileSync(srcPath, dstPath);
|
|
133
134
|
} catch (err) {
|
|
134
|
-
throw new Error(
|
|
135
|
+
throw new Error(`Failed to copy file: ${srcPath} -> ${dstPath} - ${err.message}`);
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
/**
|
|
141
|
-
*
|
|
142
|
+
* Selectively copy installation target folders
|
|
142
143
|
* @param {string} mode - 'merge' | 'overwrite'
|
|
143
144
|
*/
|
|
144
145
|
function installFolders(mode) {
|
|
@@ -152,12 +153,12 @@ function installFolders(mode) {
|
|
|
152
153
|
continue;
|
|
153
154
|
}
|
|
154
155
|
|
|
155
|
-
//
|
|
156
|
+
// In overwrite mode, delete existing folder before copying
|
|
156
157
|
if (!mergeMode && fs.existsSync(dstFolder)) {
|
|
157
158
|
try {
|
|
158
159
|
fs.rmSync(dstFolder, { recursive: true });
|
|
159
160
|
} catch (err) {
|
|
160
|
-
throw new Error(
|
|
161
|
+
throw new Error(`Failed to delete folder: ${dstFolder} - ${err.message}`);
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
|
|
@@ -166,7 +167,7 @@ function installFolders(mode) {
|
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
/**
|
|
169
|
-
*
|
|
170
|
+
* Main function
|
|
170
171
|
*/
|
|
171
172
|
async function main() {
|
|
172
173
|
console.log('');
|
|
@@ -174,90 +175,91 @@ async function main() {
|
|
|
174
175
|
console.log('==================');
|
|
175
176
|
console.log('');
|
|
176
177
|
|
|
177
|
-
//
|
|
178
|
+
// Check source folder exists
|
|
178
179
|
if (!fs.existsSync(source)) {
|
|
179
|
-
console.error('
|
|
180
|
+
console.error('Error: Source .claude/ folder not found.');
|
|
180
181
|
process.exit(1);
|
|
181
182
|
}
|
|
182
183
|
|
|
183
|
-
//
|
|
184
|
+
// Display installation location
|
|
184
185
|
if (isGlobal) {
|
|
185
|
-
console.log('
|
|
186
|
+
console.log('Global install mode: Installing to ~/.claude/');
|
|
186
187
|
} else {
|
|
187
|
-
console.log('
|
|
188
|
+
console.log('Local install mode: Installing to current directory.');
|
|
188
189
|
}
|
|
189
|
-
console.log(
|
|
190
|
+
console.log(`Install path: ${dest}`);
|
|
190
191
|
console.log('');
|
|
191
192
|
|
|
192
|
-
//
|
|
193
|
+
// Create destination folder if not exists
|
|
193
194
|
if (!fs.existsSync(dest)) {
|
|
194
195
|
try {
|
|
195
196
|
fs.mkdirSync(dest, { recursive: true });
|
|
196
197
|
} catch (err) {
|
|
197
|
-
console.error(
|
|
198
|
-
console.error(
|
|
198
|
+
console.error(`Error: Cannot create destination folder: ${dest}`);
|
|
199
|
+
console.error(`Details: ${err.message}`);
|
|
199
200
|
process.exit(1);
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
|
|
203
|
-
//
|
|
204
|
+
// Check existing installation folders
|
|
204
205
|
const existingFolders = checkExistingFolders();
|
|
205
206
|
let installMode = 'overwrite';
|
|
206
207
|
|
|
207
208
|
if (existingFolders.length > 0) {
|
|
208
|
-
console.log('
|
|
209
|
+
console.log('Existing installation folders found:');
|
|
209
210
|
existingFolders.forEach(folder => {
|
|
210
211
|
console.log(` - ${folder}/`);
|
|
211
212
|
});
|
|
212
213
|
console.log('');
|
|
213
214
|
|
|
214
215
|
if (isGlobal) {
|
|
215
|
-
console.log('(
|
|
216
|
+
console.log('(User data will be preserved: settings.json, history.jsonl, etc.)');
|
|
216
217
|
console.log('');
|
|
217
218
|
}
|
|
218
219
|
|
|
219
|
-
console.log('
|
|
220
|
-
console.log(' [m] merge -
|
|
221
|
-
console.log(' [o] overwrite -
|
|
222
|
-
console.log(' [c] cancel -
|
|
220
|
+
console.log('Installation options:');
|
|
221
|
+
console.log(' [m] merge - Add new files only (keep existing)');
|
|
222
|
+
console.log(' [o] overwrite - Overwrite above folders only');
|
|
223
|
+
console.log(' [c] cancel - Cancel installation');
|
|
223
224
|
console.log('');
|
|
224
225
|
|
|
225
|
-
const answer = await askQuestion('
|
|
226
|
+
const answer = await askQuestion('Choose (m/o/c) [default: m]: ');
|
|
226
227
|
|
|
227
228
|
if (answer === 'c' || answer === 'cancel') {
|
|
228
|
-
console.log('
|
|
229
|
+
console.log('Installation cancelled.');
|
|
229
230
|
process.exit(0);
|
|
230
231
|
} else if (answer === 'o' || answer === 'overwrite') {
|
|
231
232
|
installMode = 'overwrite';
|
|
232
233
|
console.log('');
|
|
233
|
-
console.log('
|
|
234
|
+
console.log('Installing in overwrite mode...');
|
|
234
235
|
} else {
|
|
235
|
-
//
|
|
236
|
+
// Default: merge (empty, 'm', 'merge', etc.)
|
|
236
237
|
installMode = 'merge';
|
|
237
238
|
console.log('');
|
|
238
|
-
console.log('
|
|
239
|
+
console.log('Installing in merge mode (keeping existing files)...');
|
|
239
240
|
}
|
|
240
241
|
}
|
|
241
242
|
|
|
242
|
-
//
|
|
243
|
+
// Install folders
|
|
243
244
|
installFolders(installMode);
|
|
244
245
|
|
|
245
246
|
console.log('');
|
|
246
|
-
console.log('.claude/
|
|
247
|
+
console.log('.claude/ folder installed successfully!');
|
|
247
248
|
console.log('');
|
|
248
|
-
console.log('
|
|
249
|
-
console.log(' - commands/
|
|
250
|
-
console.log(' - agents/
|
|
251
|
-
console.log(' - skills/
|
|
249
|
+
console.log('Installed:');
|
|
250
|
+
console.log(' - commands/ : Slash commands');
|
|
251
|
+
console.log(' - agents/ : Custom agents');
|
|
252
|
+
console.log(' - skills/ : Skills (reusable tool collections)');
|
|
253
|
+
console.log(' - guidelines/ : Shared guidelines');
|
|
252
254
|
console.log('');
|
|
253
255
|
|
|
254
256
|
if (isGlobal) {
|
|
255
|
-
console.log('
|
|
256
|
-
console.log('
|
|
257
|
+
console.log('Global installation complete.');
|
|
258
|
+
console.log('Claude Code commands are now available in all projects.');
|
|
257
259
|
}
|
|
258
260
|
}
|
|
259
261
|
|
|
260
262
|
main().catch((error) => {
|
|
261
|
-
console.error('
|
|
263
|
+
console.error('Error:', error.message);
|
|
262
264
|
process.exit(1);
|
|
263
265
|
});
|