@yeongjaeyou/claude-code-config 0.18.2 → 0.18.4

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.
@@ -17,138 +17,163 @@ Automatically fix and push until CodeRabbit review comments reach zero.
17
17
  | Limit | Value | Purpose |
18
18
  |-------|-------|---------|
19
19
  | MAX_ITERATIONS | 10 | Prevent infinite loops |
20
- | POLL_TIMEOUT | 300s | Wait for CodeRabbit analysis |
20
+ | POLL_TIMEOUT | 300s | Wait for checks to complete |
21
21
  | POLL_INTERVAL | 30s | Status check frequency |
22
22
 
23
- ## Workflow (2-API Design)
23
+ ## Workflow
24
24
 
25
25
  ```
26
- ┌─────────────────────────────────────────────────────────────┐
27
- │ 1. Init → 2. Wait (Status API) → 3. Check (GraphQL) → 4. Fix
28
-
29
- └──────────── push & loop ───────────────┘
30
- └─────────────────────────────────────────────────────────────┘
26
+ ┌───────────────────────────────────────────────────────────────┐
27
+ │ 1. Init
28
+
29
+ ┌─────────────────────────────────────────────────────────┐
30
+ │ │ 2. Wait for All Checks (gh pr checks) │ │
31
+ │ │ ↓ │ │
32
+ │ │ 3. Check Unresolved Threads (GraphQL) │ │
33
+ │ │ ↓ │ │
34
+ │ │ 4. Fix, Commit, Push │ │
35
+ │ │ ↓ │ │
36
+ │ │ [loop back to 2 until resolved or max iterations] │ │
37
+ │ └─────────────────────────────────────────────────────────┘ │
38
+ │ ↓ │
39
+ │ 5. Output result │
40
+ └───────────────────────────────────────────────────────────────┘
31
41
  ```
32
42
 
33
43
  ### Step 1: Initialize
34
44
 
35
45
  ```bash
36
- # Get PR info
37
46
  PR_NUMBER=${ARGUMENTS:-$(gh pr view --json number -q .number 2>/dev/null)}
38
47
  REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
39
- SHA=$(gh pr view $PR_NUMBER --json commits --jq '.commits[-1].oid')
40
-
41
48
  ITERATION=1
49
+ MAX_ITERATIONS=10
42
50
  ```
43
51
 
44
- ### Step 2: Wait for CodeRabbit (Status API)
52
+ ### Step 2: Wait for All Checks
45
53
 
46
- CodeRabbit uses Commit Status API, not Check Runs.
54
+ `gh pr checks`로 CodeRabbit과 Actions 상태를 번에 확인.
47
55
 
48
56
  ```bash
49
- wait_for_coderabbit() {
50
- local sha=$1 elapsed=0
57
+ wait_for_all_checks() {
58
+ local elapsed=0
51
59
 
52
60
  while [ $elapsed -lt 300 ]; do
53
- STATE=$(gh api repos/$REPO/commits/$sha/status \
54
- --jq '.statuses[] | select(.context=="CodeRabbit") | .state' 2>/dev/null)
55
-
56
- case "$STATE" in
57
- success) return 0 ;; # Review complete
58
- pending) ;; # Still analyzing
59
- *) # No status yet or error
60
- # Check if CodeRabbit review exists at all
61
- HAS_REVIEW=$(gh pr view $PR_NUMBER --json reviews \
62
- --jq '[.reviews[] | select(.author.login | contains("coderabbit"))] | length')
63
- [ "$HAS_REVIEW" -gt 0 ] && return 0
64
- ;;
65
- esac
66
-
67
- sleep 30
68
- elapsed=$((elapsed + 30))
61
+ CHECKS=$(gh pr checks $PR_NUMBER 2>/dev/null)
62
+
63
+ # pending/in_progress 있으면 대기
64
+ if echo "$CHECKS" | grep -qiE "pending|in_progress|running"; then
65
+ sleep 30
66
+ elapsed=$((elapsed + 30))
67
+ continue
68
+ fi
69
+
70
+ # fail 있으면 에러 (CodeRabbit fail은 제외 - 리뷰 코멘트가 있다는 의미)
71
+ if echo "$CHECKS" | grep -v "CodeRabbit" | grep -qi "fail"; then
72
+ return 2 # CI failed
73
+ fi
74
+
75
+ return 0 # All checks completed
69
76
  done
70
77
 
71
78
  return 1 # Timeout
72
79
  }
73
-
74
- wait_for_coderabbit "$SHA" || {
75
- echo "REVIEW_SKIPPED: CodeRabbit not responding within timeout"
76
- exit 0
77
- }
78
80
  ```
79
81
 
80
82
  ### Step 3: Check Unresolved Threads (GraphQL)
81
83
 
82
- Single query for count + content. This is the ground truth.
84
+ CodeRabbit 리뷰 코멘트 미해결 건수 확인. This is the ground truth.
83
85
 
84
86
  ```bash
85
- GRAPHQL_QUERY='
86
- query($owner: String!, $repo: String!, $pr: Int!) {
87
- repository(owner: $owner, name: $repo) {
88
- pullRequest(number: $pr) {
89
- reviewThreads(first: 100) {
90
- nodes {
91
- isResolved
92
- path
93
- line
94
- comments(first: 1) {
95
- nodes {
96
- author { login }
97
- body
87
+ check_unresolved_threads() {
88
+ RESULT=$(gh api graphql -f query='query {
89
+ repository(owner: "'"${REPO%/*}"'", name: "'"${REPO#*/}"'") {
90
+ pullRequest(number: '"$PR_NUMBER"') {
91
+ reviewThreads(first: 100) {
92
+ nodes {
93
+ isResolved
94
+ path
95
+ line
96
+ comments(first: 1) {
97
+ nodes {
98
+ author { login }
99
+ body
100
+ }
98
101
  }
99
102
  }
100
103
  }
101
104
  }
102
105
  }
103
- }
104
- }'
106
+ }')
105
107
 
106
- # Filter: unresolved + coderabbit + not nitpick
107
- JQ_FILTER='[.data.repository.pullRequest.reviewThreads.nodes[] |
108
- select(.isResolved == false) |
109
- select(.comments.nodes[0].author.login | contains("coderabbit")) |
110
- select(.comments.nodes[0].body | (contains("<!-- nitpick -->") or contains("[nitpick]")) | not)]'
108
+ # Filter: unresolved + coderabbit + not nitpick
109
+ UNRESOLVED=$(echo "$RESULT" | jq '[.data.repository.pullRequest.reviewThreads.nodes[] |
110
+ select(.isResolved == false) |
111
+ select(.comments.nodes[0].author.login | ascii_downcase | contains("coderabbit")) |
112
+ select(.comments.nodes[0].body | (contains("[nitpick]") or contains("nitpick")) | not)]')
111
113
 
112
- RESULT=$(gh api graphql -f query="$GRAPHQL_QUERY" \
113
- -f owner="${REPO%/*}" -f repo="${REPO#*/}" -F pr="$PR_NUMBER")
114
+ UNRESOLVED_COUNT=$(echo "$UNRESOLVED" | jq 'length')
114
115
 
115
- UNRESOLVED=$(echo "$RESULT" | jq "$JQ_FILTER | length")
116
+ # Extract comments for fixing
117
+ COMMENTS=$(echo "$UNRESOLVED" | jq -r '.[] |
118
+ "### File: \(.path):\(.line)\n\n\(.comments.nodes[0].body)\n\n---\n"')
119
+ }
120
+ ```
116
121
 
117
- if [ "$UNRESOLVED" -eq 0 ]; then
118
- echo "REVIEW_COMPLETE: all comments resolved"
119
- exit 0
120
- fi
122
+ ### Step 4: Fix, Commit, Push
121
123
 
122
- # Extract comments for fixing
123
- COMMENTS=$(echo "$RESULT" | jq -r "$JQ_FILTER | .[] |
124
- \"### File: \(.path):\(.line)\n\n\(.comments.nodes[0].body)\n\n---\n\"")
124
+ ```bash
125
+ fix_and_push() {
126
+ # For each comment: analyze and fix
127
+ # Follow code-review.md guidelines for auto-fix vs manual
128
+
129
+ # After fixes applied:
130
+ if [ -z "$(git status --porcelain)" ]; then
131
+ return 1 # No changes made
132
+ fi
133
+
134
+ git add -u
135
+ git commit -m "fix: address CodeRabbit review (iteration $ITERATION)"
136
+ git push
137
+ }
125
138
  ```
126
139
 
127
- ### Step 4: Fix, Commit, Loop
140
+ ### Main Loop
128
141
 
129
142
  ```bash
130
- # For each comment: analyze and fix
131
- # Follow code-review.md guidelines for auto-fix vs manual
132
-
133
- # After fixes applied:
134
- if [ -z "$(git status --porcelain)" ]; then
135
- echo "REVIEW_COMPLETE: no changes needed"
136
- exit 0
137
- fi
138
-
139
- git add -u
140
- git commit -m "fix: address CodeRabbit review (iteration $ITERATION)"
141
- git push
142
-
143
- ITERATION=$((ITERATION + 1))
144
- [ $ITERATION -gt 10 ] && {
145
- echo "REVIEW_INCOMPLETE: max iterations (10) reached, $UNRESOLVED comments remaining"
146
- exit 1
147
- }
143
+ while [ $ITERATION -le $MAX_ITERATIONS ]; do
144
+ # Step 2: Wait for all checks
145
+ wait_for_all_checks
146
+ WAIT_RESULT=$?
147
+
148
+ if [ $WAIT_RESULT -eq 1 ]; then
149
+ echo "REVIEW_SKIPPED: checks not completing within timeout"
150
+ exit 0
151
+ elif [ $WAIT_RESULT -eq 2 ]; then
152
+ echo "REVIEW_BLOCKED: CI checks failed"
153
+ exit 1
154
+ fi
155
+
156
+ # Step 3: Check unresolved threads
157
+ check_unresolved_threads
158
+
159
+ if [ "$UNRESOLVED_COUNT" -eq 0 ]; then
160
+ echo "REVIEW_COMPLETE: all comments resolved"
161
+ exit 0
162
+ fi
163
+
164
+ # Step 4: Fix and push
165
+ # ... fix logic here using COMMENTS ...
166
+
167
+ fix_and_push || {
168
+ echo "REVIEW_COMPLETE: no changes needed"
169
+ exit 0
170
+ }
171
+
172
+ ITERATION=$((ITERATION + 1))
173
+ done
148
174
 
149
- # Update SHA and loop back to Step 2
150
- SHA=$(git rev-parse HEAD)
151
- # Go to Step 2
175
+ echo "REVIEW_INCOMPLETE: max iterations ($MAX_ITERATIONS) reached, $UNRESOLVED_COUNT comments remaining"
176
+ exit 1
152
177
  ```
153
178
 
154
179
  ## Output Format
@@ -158,8 +183,10 @@ End with exactly one of:
158
183
  | Output | Meaning |
159
184
  |--------|---------|
160
185
  | `REVIEW_COMPLETE: all comments resolved` | Success |
186
+ | `REVIEW_COMPLETE: no changes needed` | No fixes required |
161
187
  | `REVIEW_INCOMPLETE: max iterations reached, N comments remaining` | Hit limit |
162
- | `REVIEW_SKIPPED: CodeRabbit not responding within timeout` | No review |
188
+ | `REVIEW_SKIPPED: checks not completing within timeout` | Timeout |
189
+ | `REVIEW_BLOCKED: CI checks failed` | CI failure |
163
190
 
164
191
  ## Fix Guidelines
165
192
 
@@ -175,4 +202,4 @@ Read `.claude/commands/code-review.md` for:
175
202
  | PR not found | Exit with error |
176
203
  | API rate limit | Increase interval, retry |
177
204
  | Git push failed | Report and stop |
178
- | GraphQL error | Fall back to pr view |
205
+ | CI checks failed | Exit with REVIEW_BLOCKED |
@@ -11,8 +11,6 @@ Break down large work items into manageable, independent issues. Follow project
11
11
  1. Check issue numbers: Run `gh issue list` to view current issue numbers
12
12
  2. **Discover available components**:
13
13
  - Scan `.claude/agents/` for custom agents (read YAML frontmatter)
14
- - Scan `.claude/skills/` for available skills (read SKILL.md)
15
- - Check `.mcp.json` for configured MCP servers
16
14
  - Detect test frameworks (jest.config.*, pytest.ini, vitest.config.*, pyproject.toml, etc.)
17
15
  3. **Check TDD applicability** (if user hasn't specified):
18
16
  - Analyze work type: code implementation vs docs/infra/config
@@ -80,16 +78,12 @@ Examples (vary by project, for reference only):
80
78
  **Execution strategy**:
81
79
  - **Pattern**: main-only | sequential | parallel | delegation
82
80
  - **Delegate to**: (delegation only) agent name
83
- - **Skills**: [discovered skills, or none]
84
- - **MCP**: [discovered MCP servers, or none]
85
81
 
86
82
  **Execution diagram**:
87
83
  ```
88
84
  +------+
89
85
  | main |
90
86
  +------+
91
- Skills: none
92
- MCP: none
93
87
  ```
94
88
 
95
89
  **References** (optional):
@@ -102,36 +96,34 @@ MCP: none
102
96
 
103
97
  ### Component Discovery
104
98
 
105
- Before decomposing issues, scan for available components:
99
+ Before decomposing issues, scan for available agents:
106
100
  - **Agents**: `.claude/agents/*.md` (extract name, description from YAML frontmatter)
107
- - **Skills**: `.claude/skills/*/SKILL.md` (extract name, description from YAML frontmatter)
108
- - **MCP**: `.mcp.json` (extract server names and purposes)
109
101
 
110
102
  ### Execution Patterns
111
103
 
112
104
  ```
113
105
  Pattern A: main-only
114
- +------+ Skills: /code-explorer, /xlsx
115
- | main | MCP: serena, context7
106
+ +------+
107
+ | main |
116
108
  +------+
117
109
 
118
110
  Pattern B: sequential
119
- +---------+ +------+ Skills: ...
120
- | explore | --> | main | MCP: ...
111
+ +---------+ +------+
112
+ | explore | --> | main |
121
113
  +---------+ +------+
122
114
 
123
115
  Pattern C: parallel
124
116
  +---------+
125
117
  | explore |--+
126
- +---------+ | +------+ Skills: ...
127
- | explore |--+->| main | MCP: ...
118
+ +---------+ | +------+
119
+ | explore |--+->| main |
128
120
  +---------+ | +------+
129
121
  | explore |--+
130
122
  +---------+
131
123
 
132
124
  Pattern D: delegation
133
- +------+ +----------------+ Skills: ...
134
- | main | --> | python-pro | MCP: serena
125
+ +------+ +----------------+
126
+ | main | --> | python-pro |
135
127
  +------+ | web-researcher |
136
128
  +----------------+
137
129
 
@@ -156,22 +148,16 @@ Always include an ASCII diagram in the issue body to visualize the execution flo
156
148
  +------+
157
149
  | main |
158
150
  +------+
159
- Skills: /code-review
160
- MCP: serena
161
151
 
162
152
  // delegation
163
153
  +------+ +--------------------+
164
154
  | main | --> | deepfake-cv-expert |
165
155
  +------+ +--------------------+
166
- Skills: none
167
- MCP: none
168
156
 
169
157
  // sequential
170
158
  +---------+ +------+
171
159
  | explore | --> | main |
172
160
  +---------+ +------+
173
- Skills: ...
174
- MCP: ...
175
161
  ```
176
162
 
177
163
  ---
@@ -53,6 +53,7 @@ Act as an expert developer who systematically analyzes and resolves GitHub issue
53
53
 
54
54
  7. **Resolve Issue**: Spawn sub-agents to modify code and implement features according to the plan.
55
55
  - **If TDD enabled** (marker detected in Step 1):
56
+ - **Reference**: See `feature-planner` skill for detailed TDD methodology
56
57
  1. 🔴 RED: Write failing tests first based on requirements
57
58
  2. 🟢 GREEN: Implement minimal code to pass tests
58
59
  3. 🔵 REFACTOR: Clean up while keeping tests green
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeongjaeyou/claude-code-config",
3
- "version": "0.18.2",
3
+ "version": "0.18.4",
4
4
  "description": "Claude Code CLI custom commands, agents, and skills",
5
5
  "bin": {
6
6
  "claude-code-config": "./bin/cli.js"