@yeongjaeyou/claude-code-config 0.18.1 → 0.18.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.
@@ -75,6 +75,11 @@ You are a code review expert reviewing work in progress.
75
75
  ### CLAUDE.md
76
76
  [Project guidelines]
77
77
 
78
+ ### Work Guidelines
79
+ Read and follow: .claude/guidelines/work-guidelines.md
80
+ If .claude/rules/ exists, also read relevant rule files for module-specific guidance.
81
+ (Use your file access to read these files directly)
82
+
78
83
  ### Directory Structure
79
84
  [tree output]
80
85
 
@@ -105,6 +110,14 @@ You are a code review expert reviewing work in progress.
105
110
 
106
111
  ### Summary
107
112
  [1-2 sentence conclusion]
113
+
114
+ ### Beyond the Question (Evidence-Based)
115
+ If you identify improvements beyond the direct question:
116
+ - Alternative approaches FOUND IN this codebase (with file:line)
117
+ - Architectural patterns ALREADY USED that could apply
118
+ - Potential optimizations BASED ON actual code analysis
119
+
120
+ DO NOT suggest generic best practices without codebase evidence.
108
121
  ```
109
122
 
110
123
  ### 2. Parse Response
@@ -79,6 +79,11 @@ You are a code review expert reviewing work in progress.
79
79
  ### CLAUDE.md
80
80
  [Project guidelines]
81
81
 
82
+ ### Work Guidelines
83
+ Read and follow: .claude/guidelines/work-guidelines.md
84
+ If .claude/rules/ exists, also read relevant rule files for module-specific guidance.
85
+ (Use your file access to read these files directly)
86
+
82
87
  ### Directory Structure
83
88
  [tree output]
84
89
 
@@ -109,6 +114,14 @@ You are a code review expert reviewing work in progress.
109
114
 
110
115
  ### Summary
111
116
  [1-2 sentence conclusion]
117
+
118
+ ### Beyond the Question (Evidence-Based)
119
+ If you identify improvements beyond the direct question:
120
+ - Alternative approaches FOUND IN this codebase (with file:line)
121
+ - Architectural patterns ALREADY USED that could apply
122
+ - Potential optimizations BASED ON actual code analysis
123
+
124
+ DO NOT suggest generic best practices without codebase evidence.
112
125
  ```
113
126
 
114
127
  ### 2. Parse Response
@@ -92,6 +92,10 @@ council_member:
92
92
  context: "why this is relevant"
93
93
  caveats: # optional
94
94
  - "potential limitation or edge case"
95
+ beyond_question: # optional, evidence-based only
96
+ - insight: "improvement opportunity"
97
+ evidence: "file:line or codebase reference"
98
+ rationale: "why this is relevant to the question context"
95
99
  # Round 2+ additional fields
96
100
  gaps:
97
101
  - "aspect not fully addressed"
@@ -103,6 +107,14 @@ council_member:
103
107
  - Sub-agents that fail to follow this schema will have their results flagged
104
108
  - Missing required fields trigger re-query in next round
105
109
 
110
+ **Beyond the Question (Evidence-Based Only):**
111
+ Council members may suggest improvements beyond the direct question, but ONLY with:
112
+ - Specific file:line references from the codebase
113
+ - Evidence from actual code analysis
114
+ - Clear connection to the question context
115
+
116
+ Generic best practices without codebase evidence are NOT accepted.
117
+
106
118
  ---
107
119
 
108
120
  ## Context Gathering (Before Round 1)
@@ -118,6 +130,8 @@ Model-specific guidelines (project root):
118
130
  - ./CLAUDE.md (Claude Opus/Sonnet)
119
131
  - ./AGENTS.md (Codex)
120
132
  - ./gemini.md (Gemini)
133
+ - .claude/guidelines/work-guidelines.md (All models - style and response guidelines)
134
+ - .claude/rules/*.md (All models - module-specific rules, if directory exists)
121
135
  ```
122
136
 
123
137
  **Conditional Code Exploration:**
@@ -235,6 +249,7 @@ Task(model="opus", subagent_type="general-purpose", run_in_background: true):
235
249
 
236
250
  ## Guidelines
237
251
  Read and follow ./CLAUDE.md project guidelines.
252
+ Read and follow: .claude/guidelines/work-guidelines.md for style guidelines.
238
253
  You have access to MCP tools. Use them actively to gather accurate information.
239
254
 
240
255
  ## Question
@@ -257,7 +272,8 @@ Task(model="opus", subagent_type="general-purpose", run_in_background: true):
257
272
  **Claude Sonnet:**
258
273
  ```
259
274
  Task(model="sonnet", subagent_type="general-purpose", run_in_background: true):
260
- prompt: [Same structure as Opus]
275
+ prompt: [Same structure as Opus, including:
276
+ Read and follow: .claude/guidelines/work-guidelines.md for style guidelines.]
261
277
  ```
262
278
 
263
279
  **Codex:**
@@ -275,6 +291,7 @@ Task(subagent_type="general-purpose", run_in_background: true):
275
291
 
276
292
  ## Guidelines
277
293
  Read and follow ./AGENTS.md project guidelines.
294
+ Read and follow: .claude/guidelines/work-guidelines.md for style guidelines.
278
295
  You have access to MCP tools. Use them actively to gather accurate information.
279
296
 
280
297
  ## Question
@@ -308,6 +325,7 @@ Task(subagent_type="general-purpose", run_in_background: true):
308
325
 
309
326
  ## Guidelines
310
327
  Read and follow ./gemini.md project guidelines.
328
+ Read and follow: .claude/guidelines/work-guidelines.md for style guidelines.
311
329
  You have access to MCP tools. Use them actively to gather accurate information.
312
330
 
313
331
  ## Question
@@ -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 |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeongjaeyou/claude-code-config",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "Claude Code CLI custom commands, agents, and skills",
5
5
  "bin": {
6
6
  "claude-code-config": "./bin/cli.js"