@su-record/vibe 0.4.2 → 0.4.3

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 (2) hide show
  1. package/bin/vibe +82 -0
  2. package/package.json +1 -1
package/bin/vibe CHANGED
@@ -208,6 +208,7 @@ function showHelp() {
208
208
 
209
209
  Commands:
210
210
  vibe init [project] Initialize vibe in current/new project
211
+ vibe update Update vibe settings (commands, rules, hooks)
211
212
  vibe help Show this message
212
213
  vibe version Show version
213
214
 
@@ -231,6 +232,82 @@ Workflow:
231
232
  `);
232
233
  }
233
234
 
235
+ // 프로젝트 업데이트
236
+ async function update() {
237
+ try {
238
+ const projectRoot = process.cwd();
239
+ const vibeDir = path.join(projectRoot, '.vibe');
240
+ const claudeDir = path.join(projectRoot, '.claude');
241
+
242
+ if (!fs.existsSync(vibeDir)) {
243
+ console.log('❌ vibe 프로젝트가 아닙니다. 먼저 vibe init을 실행하세요.');
244
+ return;
245
+ }
246
+
247
+ console.log('🔄 vibe 업데이트 중...\n');
248
+
249
+ // .claude/commands 업데이트
250
+ const commandsDir = path.join(claudeDir, 'commands');
251
+ ensureDir(commandsDir);
252
+ const sourceDir = path.join(__dirname, '../.claude/commands');
253
+ copyDirContents(sourceDir, commandsDir);
254
+ console.log(' ✅ 슬래시 커맨드 업데이트 완료 (7개)\n');
255
+
256
+ // .agent/rules/ 업데이트
257
+ const rulesSource = path.join(__dirname, '../.agent/rules');
258
+ const rulesTarget = path.join(projectRoot, '.agent/rules');
259
+ copyDirRecursive(rulesSource, rulesTarget);
260
+ console.log(' ✅ 코딩 규칙 업데이트 완료 (.agent/rules/)\n');
261
+
262
+ // .claude/agents/ 업데이트
263
+ const agentsDir = path.join(claudeDir, 'agents');
264
+ ensureDir(agentsDir);
265
+ const agentsSourceDir = path.join(__dirname, '../.claude/agents');
266
+ copyDirContents(agentsSourceDir, agentsDir);
267
+ console.log(' ✅ 서브에이전트 업데이트 완료 (.claude/agents/)\n');
268
+
269
+ // settings.local.json에 hooks 병합
270
+ const settingsPath = path.join(claudeDir, 'settings.local.json');
271
+ const hooksTemplate = path.join(__dirname, '../templates/hooks-template.json');
272
+
273
+ if (fs.existsSync(hooksTemplate)) {
274
+ const vibeHooks = JSON.parse(fs.readFileSync(hooksTemplate, 'utf-8'));
275
+
276
+ if (fs.existsSync(settingsPath)) {
277
+ // 기존 설정에 hooks 병합
278
+ const existingSettings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
279
+
280
+ if (!existingSettings.hooks) {
281
+ existingSettings.hooks = vibeHooks.hooks;
282
+ fs.writeFileSync(settingsPath, JSON.stringify(existingSettings, null, 2));
283
+ console.log(' ✅ Hooks 설정 추가 완료\n');
284
+ } else {
285
+ console.log(' ℹ️ Hooks 설정 이미 존재\n');
286
+ }
287
+ } else {
288
+ // 새로 생성
289
+ fs.copyFileSync(hooksTemplate, settingsPath);
290
+ console.log(' ✅ Hooks 설정 생성 완료\n');
291
+ }
292
+ }
293
+
294
+ const packageJson = require('../package.json');
295
+ console.log(`
296
+ ✅ vibe 업데이트 완료! (v${packageJson.version})
297
+
298
+ 업데이트된 항목:
299
+ - 슬래시 커맨드 (7개)
300
+ - 코딩 규칙 (.agent/rules/)
301
+ - 서브에이전트 (.claude/agents/)
302
+ - Hooks 설정
303
+ `);
304
+
305
+ } catch (error) {
306
+ console.error('❌ 업데이트 실패:', error.message);
307
+ process.exit(1);
308
+ }
309
+ }
310
+
234
311
  // 버전 정보
235
312
  function showVersion() {
236
313
  const packageJson = require('../package.json');
@@ -243,6 +320,10 @@ switch (command) {
243
320
  init(args[1]);
244
321
  break;
245
322
 
323
+ case 'update':
324
+ update();
325
+ break;
326
+
246
327
  case 'version':
247
328
  case '-v':
248
329
  case '--version':
@@ -262,6 +343,7 @@ switch (command) {
262
343
 
263
344
  사용 가능한 명령어:
264
345
  vibe init 프로젝트 초기화
346
+ vibe update 설정 업데이트
265
347
  vibe help 도움말
266
348
  vibe version 버전 정보
267
349
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@su-record/vibe",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Vibe - Claude Code exclusive SPEC-driven AI coding framework",
5
5
  "bin": {
6
6
  "vibe": "./bin/vibe"