@kood/claude-code 0.6.4 → 0.6.6

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.
@@ -2,58 +2,43 @@
2
2
  description: 현재 세션에서 수정한 파일만 커밋 후 푸시
3
3
  ---
4
4
 
5
- @../instructions/multi-agent/coordination-guide.md
6
- @../instructions/multi-agent/execution-patterns.md
7
-
8
5
  # Git Session Command
9
6
 
10
- > @git-operator 에이전트를 사용하여 현재 세션 파일만 선택적으로 커밋하고 푸시.
7
+ > 현재 세션 파일만 선택적으로 커밋하고 푸시.
11
8
 
12
9
  ---
13
10
 
14
- <critical_requirements>
11
+ <scripts>
15
12
 
16
- ## ⚠️ CRITICAL: 작업 시작 전 필수 확인
13
+ ## 사용 가능한 스크립트
17
14
 
18
- **이 커맨드는 반드시 @git-operator 에이전트를 사용해야 합니다.**
15
+ | 스크립트 | 용도 |
16
+ |----------|------|
17
+ | `.claude/scripts/git/git-info.sh` | 상태 + diff 요약 출력 |
18
+ | `.claude/scripts/git/git-commit.sh "msg" [files]` | Co-Authored-By 포함 커밋 |
19
+ | `.claude/scripts/git/git-push.sh` | 안전한 푸시 |
20
+ | `.claude/scripts/git/git-clean-check.sh` | clean 여부 확인 |
19
21
 
20
- ### MANDATORY: Task 도구로 @git-operator 호출
22
+ </scripts>
21
23
 
22
- ```typescript
23
- Task({
24
- subagent_type: 'git-operator',
25
- description: '세션 파일만 커밋 후 푸시',
26
- prompt: `
27
- 세션 커밋 모드:
28
- - 현재 세션 관련 파일만 선택적 커밋
29
- - 반드시 푸시 (git push)
30
- - 이전 세션의 미완성 작업은 제외
31
- `
32
- })
33
- ```
24
+ ---
25
+
26
+ <workflow>
34
27
 
35
- **❌ 절대 금지:**
36
- - Bash 도구로 git 명령 직접 실행
37
- - @git-operator 없이 커밋/푸시 수행
38
- - 커맨드 내에서 직접 파일 분석
28
+ ## 워크플로우
39
29
 
40
- **✅ 필수:**
41
- - Task 도구로 @git-operator 에이전트 호출
42
- - 모든 git 작업을 에이전트에 위임
43
- - 현재 세션 파일만 선택
30
+ ```bash
31
+ # 1. 상태 확인
32
+ .claude/scripts/git/git-info.sh
44
33
 
45
- ---
34
+ # 2. 현재 세션 파일만 선택하여 커밋
35
+ .claude/scripts/git/git-commit.sh "feat: 로그인 기능" src/auth/login.ts src/auth/logout.ts
46
36
 
47
- **진행 자가 점검:**
48
- ```text
49
- □ Task 도구 사용 준비?
50
- □ @git-operator 에이전트로 작업 위임?
51
- □ Bash로 git 직접 실행 안 함?
37
+ # 3. 푸시
38
+ .claude/scripts/git/git-push.sh
52
39
  ```
53
40
 
54
- **⚠️ 위 체크리스트를 통과하지 않으면 작업을 시작하지 마세요.**
55
-
56
- </critical_requirements>
41
+ </workflow>
57
42
 
58
43
  ---
59
44
 
@@ -80,31 +65,19 @@ Task({
80
65
 
81
66
  ---
82
67
 
83
- <workflow>
84
-
85
- 1. 모든 변경사항 분석
86
- 2. **현재 세션 관련 파일만 선택**
87
- 3. 논리적 단위로 그룹핑
88
- 4. 각 그룹별 커밋
89
- 5. git push 실행
90
-
91
- </workflow>
92
-
93
- ---
94
-
95
68
  <example>
96
69
 
97
70
  ```bash
98
71
  # 상황: 로그인 기능 작업 중, 이전 프로필 기능은 미완성
99
72
 
100
- git status
73
+ .claude/scripts/git/git-info.sh
101
74
  # modified: src/auth/login.ts (현재 세션)
102
75
  # modified: src/auth/logout.ts (현재 세션)
103
76
  # modified: src/profile/edit.ts (이전 세션)
104
77
 
105
78
  # ✅ 로그인 관련만 커밋
106
- git add src/auth/login.ts src/auth/logout.ts && git commit -m "feat: 로그인/로그아웃 기능 추가"
107
- git push
79
+ .claude/scripts/git/git-commit.sh "feat: 로그인/로그아웃 기능 추가" src/auth/login.ts src/auth/logout.ts
80
+ .claude/scripts/git/git-push.sh
108
81
  ```
109
82
 
110
83
  </example>
@@ -4,70 +4,47 @@ allowed-tools: Task
4
4
  argument-hint: [파일/디렉토리 경로...]
5
5
  ---
6
6
 
7
- @../instructions/multi-agent/coordination-guide.md
8
- @../instructions/multi-agent/execution-patterns.md
9
-
10
7
  # Lint Fix Command
11
8
 
12
- > @lint-fixer 에이전트를 사용하여 tsc/eslint 오류를 자동으로 수정.
9
+ > tsc/eslint 오류를 자동으로 수정.
13
10
 
14
11
  ---
15
12
 
16
- <critical_requirements>
13
+ <scripts>
17
14
 
18
- ## ⚠️ CRITICAL: 작업 시작 전 필수 확인
15
+ ## 사용 가능한 스크립트
19
16
 
20
- **이 커맨드는 반드시 @lint-fixer 에이전트를 사용해야 합니다.**
17
+ | 스크립트 | 용도 |
18
+ |----------|------|
19
+ | `.claude/scripts/lint/lint-check.sh` | tsc + eslint 병렬 검사 |
20
+ | `.claude/scripts/lint/lint-file.sh [files]` | 특정 파일만 검사 |
21
21
 
22
- ### MANDATORY: Task 도구로 @lint-fixer 호출
22
+ </scripts>
23
23
 
24
- ```typescript
25
- Task({
26
- subagent_type: 'lint-fixer',
27
- description: 'tsc/eslint 오류 수정',
28
- prompt: `
29
- $ARGUMENTS 처리:
30
- ${$ARGUMENTS ? `특정 경로: ${$ARGUMENTS}` : '전체 프로젝트 검사'}
31
-
32
- 수행할 작업:
33
- 1. tsc + eslint 병렬 검사
34
- 2. 오류 분류 (간단/복잡)
35
- 3. TodoWrite로 오류 목록 생성
36
- 4. 간단한 오류: 즉시 수정
37
- 5. 복잡한 오류: Sequential Thinking으로 분석 후 수정
38
- 6. 전체 재검사로 완료 확인
39
- `
40
- })
41
- ```
24
+ ---
42
25
 
43
- **❌ 절대 금지:**
44
- - Bash 도구로 tsc/eslint 직접 실행 후 수동 수정
45
- - @lint-fixer 없이 오류 수정
46
- - 커맨드 내에서 직접 오류 분석/수정
26
+ <workflow>
47
27
 
48
- **✅ 필수:**
49
- - Task 도구로 @lint-fixer 에이전트 호출
50
- - 모든 lint 작업을 에이전트에 위임
51
- - 에이전트가 자동으로 간단/복잡 판단 후 처리
28
+ ## 워크플로우
52
29
 
53
- **@lint-fixer 에이전트 장점:**
54
- - 간단한 오류는 즉시 수정 (Sequential Thinking 불필요)
55
- - 복잡한 오류만 Sequential Thinking 사용 (효율적)
56
- - TodoWrite로 진행 상황 자동 추적
57
- - 우선순위 자동 정렬 (타입 오류 → 린트 오류)
30
+ ### 전체 검사
58
31
 
59
- ---
32
+ ```bash
33
+ # 1. 병렬 검사 (tsc + eslint 동시)
34
+ .claude/scripts/lint/lint-check.sh
60
35
 
61
- **진행 자가 점검:**
62
- ```text
63
- □ Task 도구 사용 준비?
64
- □ @lint-fixer 에이전트로 작업 위임?
65
- □ Bash로 tsc/eslint 직접 실행 안 함?
36
+ # 2. 오류 수정 후 재검사
37
+ .claude/scripts/lint/lint-check.sh
66
38
  ```
67
39
 
68
- **⚠️ 체크리스트를 통과하지 않으면 작업을 시작하지 마세요.**
40
+ ### 특정 파일 검사
69
41
 
70
- </critical_requirements>
42
+ ```bash
43
+ # 특정 파일만
44
+ .claude/scripts/lint/lint-file.sh src/utils/api.ts src/components/Button.tsx
45
+ ```
46
+
47
+ </workflow>
71
48
 
72
49
  ---
73
50
 
@@ -1,129 +1,52 @@
1
1
  ---
2
- description: 배포 전 typecheck/lint/build 검증 및 수정. ultrathink + sequential thinking 필수 사용.
3
- allowed-tools: Bash(tsc:*, npx:*, yarn:*, npm:*, pnpm:*), Read, Edit, mcp__sequential-thinking__sequentialthinking
2
+ description: 배포 전 typecheck/lint/build 검증 및 수정.
3
+ allowed-tools: Bash, Read, Edit, mcp__sequential-thinking__sequentialthinking
4
4
  argument-hint: [파일/디렉토리 경로...]
5
5
  ---
6
6
 
7
- @../instructions/multi-agent/coordination-guide.md
8
- @../instructions/multi-agent/execution-patterns.md
9
-
10
7
  # Pre-Deploy Command
11
8
 
12
- > 배포 전 typecheck/lint/build Sequential Thinking으로 검증하고 수정
9
+ > 배포 전 typecheck/lint/build 검증
13
10
 
14
11
  ---
15
12
 
16
- <forbidden>
13
+ <scripts>
17
14
 
18
- | 분류 | 금지 |
19
- |------|------|
20
- | **회피** | 오류 무시하고 배포, `any` 타입, `@ts-ignore`, `eslint-disable` 남발 |
21
- | **전략** | 여러 오류 동시 수정, build 생략, 오류 메시지만 보고 급하게 수정 |
22
- | **분석** | Sequential Thinking 없이 수정 |
15
+ ## 사용 가능한 스크립트
16
+
17
+ | 스크립트 | 용도 |
18
+ |----------|------|
19
+ | `.claude/scripts/deploy/deploy-check.sh` | 전체 검증 (tsc + eslint + build) |
20
+ | `.claude/scripts/deploy/build-run.sh` | build만 실행 |
21
+ | `.claude/scripts/lint/lint-check.sh` | tsc + eslint 병렬 검사 |
22
+ | `.claude/scripts/pm/pm-detect.sh` | package manager 감지 |
23
23
 
24
- </forbidden>
24
+ </scripts>
25
25
 
26
26
  ---
27
27
 
28
- <agent_usage>
28
+ <workflow>
29
29
 
30
- ## @deployment-validator Agent 활용
30
+ ## 워크플로우
31
31
 
32
- **언제 사용:**
33
- - PR 생성 전 전체 검증
34
- - 배포 전 품질 보증
35
- - CI/CD 전 로컬 검증
32
+ ### 전체 검증 (권장)
36
33
 
37
- **호출 방법:**
38
34
  ```bash
39
- @deployment-validator
40
- # 또는 자연어
41
- "배포 준비 완료 체크해줘"
42
- "pre-deploy 검증해줘"
35
+ # 한 번에 tsc + eslint + build 검증
36
+ .claude/scripts/deploy/deploy-check.sh
43
37
  ```
44
38
 
45
- **장점:**
46
- - typecheck + lint + build 전체 자동화
47
- - Build 실패 시 Sequential Thinking으로 원인 자동 분석
48
- - 배포 가능 여부 최종 판단
49
- - 독립적 context에서 실행 (메인 작업 병렬 가능)
50
-
51
- **직접 검증 vs Agent:**
52
-
53
- | 상황 | 권장 방법 |
54
- |------|----------|
55
- | 빠른 개발 중 | 직접 검증 (command) |
56
- | PR 생성 전 | @deployment-validator |
57
- | 배포 전 최종 확인 | @deployment-validator |
58
- | CI/CD 전 로컬 확인 | @deployment-validator |
59
- | 자동화된 검증 | @deployment-validator |
39
+ ### 단계별 검증
60
40
 
61
- ---
62
-
63
- ## @security-reviewer Agent 활용
64
-
65
- **언제 사용:**
66
- - 배포 전 보안 취약점 검토
67
- - 코드 변경 후 보안 검증
68
- - 인증/권한/데이터 처리 로직 추가 시
69
-
70
- **호출 방법:**
71
41
  ```bash
72
- @security-reviewer
73
- # 또는 자연어
74
- "배포 전 보안 검토해줘"
75
- "보안 취약점 체크해줘"
76
- ```
42
+ # 1. lint 검사
43
+ .claude/scripts/lint/lint-check.sh
77
44
 
78
- **장점:**
79
- - OWASP Top 10 자동 검토
80
- - 시크릿 노출 탐지 (API 키, 비밀번호 하드코딩)
81
- - 입력 검증 체크 (SQL Injection, XSS, CSRF)
82
- - 인증/권한 로직 검증
83
- - 독립적 context에서 실행 (메인 작업 병렬 가능)
84
-
85
- **검토 범위:**
86
- - SQL Injection: Prisma raw query 사용 시
87
- - XSS: HTML/dangerouslySetInnerHTML 사용 시
88
- - CSRF: POST/PUT/DELETE 엔드포인트
89
- - 인증: middleware 누락 여부
90
- - 시크릿: .env 변수 하드코딩 여부
91
- - 입력 검증: Zod validator 누락 여부
92
-
93
- ---
94
-
95
- ## @build-fixer Agent 활용
96
-
97
- **언제 사용:**
98
- - 빌드/타입 오류 다수 발생
99
- - 빠른 자동 수정 필요
100
- - 반복적인 타입 오류 일괄 수정
101
-
102
- **호출 방법:**
103
- ```bash
104
- @build-fixer
105
- # 또는 자연어
106
- "빌드 오류 수정해줘"
107
- "타입 오류 자동 수정해줘"
45
+ # 2. 오류 수정 후 build
46
+ .claude/scripts/deploy/build-run.sh
108
47
  ```
109
48
 
110
- **장점:**
111
- - 최소 diff로 오류 수정
112
- - 언어 자동 감지 (TypeScript, Python, Go 등)
113
- - 여러 오류 효율적 처리
114
- - Sequential Thinking 자동 적용
115
- - 독립적 context에서 실행
116
-
117
- **직접 수정 vs Agent:**
118
-
119
- | 상황 | 권장 방법 |
120
- |------|----------|
121
- | 1-2개 단순 오류 | 직접 수정 (command) |
122
- | 5개+ 반복적 오류 | @build-fixer |
123
- | 리팩토링 후 다수 오류 | @build-fixer |
124
- | 라이브러리 업그레이드 후 | @build-fixer |
125
-
126
- </agent_usage>
49
+ </workflow>
127
50
 
128
51
  ---
129
52
 
@@ -4,15 +4,29 @@ allowed-tools: Bash, Read, Edit
4
4
  argument-hint: <new-version | +1 | +minor | +major>
5
5
  ---
6
6
 
7
- @../instructions/multi-agent/coordination-guide.md
8
- @../instructions/multi-agent/execution-patterns.md
9
-
10
7
  # Version Update Command
11
8
 
12
9
  프로젝트 전체 버전을 업데이트하고 커밋.
13
10
 
14
11
  **인수**: $ARGUMENTS
15
12
 
13
+ ---
14
+
15
+ <scripts>
16
+
17
+ ## 사용 가능한 스크립트
18
+
19
+ | 스크립트 | 용도 |
20
+ |----------|------|
21
+ | `.claude/scripts/version/version-find.sh` | 버전 파일 탐색 (package.json + .version()) |
22
+ | `.claude/scripts/version/version-bump.sh <current> <type>` | 새 버전 계산 |
23
+ | `.claude/scripts/git/git-commit.sh "msg" [files]` | 커밋 |
24
+ | `.claude/scripts/git/git-push.sh` | 푸시 |
25
+
26
+ </scripts>
27
+
28
+ ---
29
+
16
30
  <version_rules>
17
31
 
18
32
  | 인수 | 동작 | 예시 |
@@ -24,39 +38,27 @@ argument-hint: <new-version | +1 | +minor | +major>
24
38
 
25
39
  </version_rules>
26
40
 
27
- <workflow>
28
-
29
- 1. **버전 파일 탐색**
30
- ```bash
31
- # package.json 찾기 (root 또는 monorepo packages/)
32
- fd -t f 'package.json' -E node_modules
41
+ ---
33
42
 
34
- # 버전 코드 찾기 (.version() 패턴)
35
- rg "\.version\(['\"]" --type ts --type js -l
36
- ```
43
+ <workflow>
37
44
 
38
- 2. **현재 버전 확인** (병렬 읽기)
39
- - 발견된 package.json 파일들
40
- - 버전 코드 포함 파일들
45
+ ## 워크플로우
41
46
 
42
- 3. **새 버전 계산**
47
+ ```bash
48
+ # 1. 버전 파일 탐색
49
+ .claude/scripts/version/version-find.sh
43
50
 
44
- 4. **모든 파일 Edit로 업데이트**
51
+ # 2. 현재 버전 확인 (package.json 읽기)
45
52
 
46
- 5. **스테이징**
47
- ```bash
48
- git add <발견된-버전-파일들>
49
- ```
53
+ # 3. 새 버전 계산
54
+ .claude/scripts/version/version-bump.sh 1.2.3 +1
55
+ # 1.2.4
50
56
 
51
- 6. **커밋**
52
- ```bash
53
- git commit -m "chore: 버전 X.X.X로 업데이트"
54
- ```
57
+ # 4. 모든 파일 Edit로 업데이트
55
58
 
56
- 7. **완료 확인**
57
- ```bash
58
- git status
59
- ```
59
+ # 5. 커밋
60
+ .claude/scripts/git/git-commit.sh "chore: 버전 1.2.4로 업데이트" package.json packages/*/package.json
61
+ ```
60
62
 
61
63
  </workflow>
62
64
 
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env bash
2
+ # build-run.sh - Package manager 감지 후 build 실행
3
+ # Usage: ./build-run.sh
4
+
5
+ set -euo pipefail
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ PM_DIR="$SCRIPT_DIR/../pm"
9
+
10
+ # Package manager 감지
11
+ PM=$("$PM_DIR/pm-detect.sh")
12
+
13
+ echo "=== Building with $PM ==="
14
+
15
+ # Build 실행
16
+ case "$PM" in
17
+ bun)
18
+ bun run build
19
+ ;;
20
+ pnpm)
21
+ pnpm run build
22
+ ;;
23
+ yarn)
24
+ yarn build
25
+ ;;
26
+ npm)
27
+ npm run build
28
+ ;;
29
+ *)
30
+ echo "Error: Unknown package manager: $PM" >&2
31
+ exit 1
32
+ ;;
33
+ esac
34
+
35
+ echo ""
36
+ echo "✓ Build completed successfully"
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env bash
2
+ # deploy-check.sh - 배포 전 전체 검증 (tsc + eslint + build)
3
+ # Usage: ./deploy-check.sh
4
+ # 검사 실패 시 조기 종료
5
+
6
+ set -euo pipefail
7
+
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ LINT_DIR="$SCRIPT_DIR/../lint"
10
+
11
+ echo "=========================================="
12
+ echo " Pre-Deploy Verification"
13
+ echo "=========================================="
14
+
15
+ # 스크립트 존재 검증
16
+ if [ ! -x "$LINT_DIR/lint-check.sh" ]; then
17
+ echo "Error: lint-check.sh not found or not executable" >&2
18
+ exit 1
19
+ fi
20
+ if [ ! -x "$SCRIPT_DIR/build-run.sh" ]; then
21
+ echo "Error: build-run.sh not found or not executable" >&2
22
+ exit 1
23
+ fi
24
+
25
+ # Step 1: Lint 검사 (tsc + eslint 병렬)
26
+ echo ""
27
+ echo "[1/2] Running lint checks..."
28
+ "$LINT_DIR/lint-check.sh"
29
+
30
+ # Step 2: Build
31
+ echo ""
32
+ echo "[2/2] Running build..."
33
+ "$SCRIPT_DIR/build-run.sh"
34
+
35
+ echo ""
36
+ echo "=========================================="
37
+ echo " ✓ All checks passed - Ready to deploy"
38
+ echo "=========================================="
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env bash
2
+ # git-all.sh - 모든 변경사항 add + commit + push (단순 케이스)
3
+ # Usage: ./git-all.sh "커밋 메시지"
4
+ # WARNING: git add -A 사용 - 민감 파일(.env 등) 포함 주의
5
+
6
+ set -euo pipefail
7
+
8
+ # Git 저장소 확인
9
+ if ! git rev-parse --git-dir > /dev/null 2>&1; then
10
+ echo "Error: Not a git repository"
11
+ exit 1
12
+ fi
13
+
14
+ if [ -z "$1" ]; then
15
+ echo "Usage: $0 \"commit message\""
16
+ exit 1
17
+ fi
18
+
19
+ COMMIT_MSG="$1"
20
+
21
+ # 빈 메시지 체크
22
+ if [ -z "$(echo "$COMMIT_MSG" | xargs)" ]; then
23
+ echo "Error: Commit message cannot be empty" >&2
24
+ exit 1
25
+ fi
26
+
27
+ # 변경사항 확인
28
+ if [ -n "$(git status --porcelain)" ]; then
29
+ # 민감 파일 검증
30
+ SENSITIVE=$(git status --porcelain | grep -E '^\?\?.*\.(env|pem|key|secret|credentials)' || true)
31
+ if [ -n "$SENSITIVE" ]; then
32
+ echo "ERROR: Sensitive files detected:" >&2
33
+ echo "$SENSITIVE" >&2
34
+ echo "" >&2
35
+ echo "Please use git-commit.sh with specific files instead" >&2
36
+ exit 1
37
+ fi
38
+
39
+ echo "=== Adding all changes ==="
40
+ git add -A
41
+
42
+ echo "=== Committing ==="
43
+ git commit -m "$COMMIT_MSG"
44
+
45
+ echo "=== Pushing ==="
46
+ BRANCH=$(git branch --show-current)
47
+ if ! git rev-parse --abbrev-ref "@{upstream}" >/dev/null 2>&1; then
48
+ git push -u origin "$BRANCH"
49
+ else
50
+ git push
51
+ fi
52
+
53
+ echo "Done: All changes committed and pushed"
54
+ else
55
+ echo "No changes to commit"
56
+ exit 0
57
+ fi
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env bash
2
+ # git-clean-check.sh - Working directory clean 여부 확인
3
+ # Usage: ./git-clean-check.sh [--quiet]
4
+ # Exit 0: clean, Exit 1: dirty
5
+
6
+ set -uo pipefail
7
+
8
+ # Git 저장소 확인
9
+ if ! git rev-parse --git-dir > /dev/null 2>&1; then
10
+ echo "Error: Not a git repository"
11
+ exit 1
12
+ fi
13
+
14
+ QUIET=false
15
+ if [ "${1:-}" = "--quiet" ]; then
16
+ QUIET=true
17
+ fi
18
+
19
+ if [ -n "$(git status --porcelain)" ]; then
20
+ if [ "$QUIET" = false ]; then
21
+ echo "Working directory is DIRTY"
22
+ echo ""
23
+ git status --short
24
+ fi
25
+ exit 1
26
+ else
27
+ if [ "$QUIET" = false ]; then
28
+ echo "Working directory is CLEAN"
29
+ fi
30
+ exit 0
31
+ fi
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env bash
2
+ # git-commit.sh - 커밋 실행
3
+ # Usage: ./git-commit.sh "커밋 메시지" [files...]
4
+ # files 미지정 시 staged files만 커밋
5
+
6
+ set -euo pipefail
7
+
8
+ # Git 저장소 확인
9
+ if ! git rev-parse --git-dir > /dev/null 2>&1; then
10
+ echo "Error: Not a git repository"
11
+ exit 1
12
+ fi
13
+
14
+ if [ -z "$1" ]; then
15
+ echo "Usage: $0 \"commit message\" [files...]"
16
+ echo " files: 커밋할 파일들 (미지정 시 staged files만)"
17
+ exit 1
18
+ fi
19
+
20
+ COMMIT_MSG="$1"
21
+
22
+ # 빈 메시지 체크
23
+ if [ -z "$(echo "$COMMIT_MSG" | xargs)" ]; then
24
+ echo "Error: Commit message cannot be empty" >&2
25
+ exit 1
26
+ fi
27
+
28
+ shift
29
+ FILES_PROVIDED=$#
30
+
31
+ # 파일 지정된 경우 add
32
+ if [ $FILES_PROVIDED -gt 0 ]; then
33
+ git add "$@"
34
+ fi
35
+
36
+ # staged 파일 확인
37
+ if git diff --cached --quiet; then
38
+ if [ $FILES_PROVIDED -eq 0 ]; then
39
+ echo "Error: No staged changes to commit"
40
+ echo "Tip: Stage files with 'git add' or pass files as arguments"
41
+ else
42
+ echo "Error: No changes in specified files"
43
+ echo "Tip: Check if files exist and have modifications"
44
+ fi
45
+ exit 1
46
+ fi
47
+
48
+ # 커밋
49
+ git commit -m "$COMMIT_MSG"
50
+
51
+ echo "Committed successfully"