Skip to content

Commit 58ef8c3

Browse files
committed
claude: optimize prompt for tools usage patterns
1 parent 195efd9 commit 58ef8c3

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.claude/skills/review/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: review
33
description: Code review a pull request for Redpanda Connect, checking Go patterns, tests, component architecture, and commit policy
44
argument-hint: "[pr-number]"
55
disable-model-invocation: true
6-
allowed-tools: mcp__github__pull_request_review_write, mcp__github__add_comment_to_pending_review, mcp__github__add_issue_comment, Bash(gh pr view *), Bash(gh pr diff *), Bash(git log *), Bash(git show *), Bash(git diff *), Read, Glob, Grep, Task,
6+
allowed-tools: mcp__github__pull_request_review_write, mcp__github__add_comment_to_pending_review, mcp__github__add_issue_comment, Bash(gh pr view *), Bash(gh pr diff *), Bash(git log *), Bash(git show *), Read, Glob, Grep, Task,
77
---
88

99
Code review pull request $ARGUMENTS for Redpanda Connect. If no PR was specified, resolve the current branch's PR with `gh pr view --json number -q .number`.

.github/workflows/claude-code-review.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ jobs:
6161
**Assumptions:**
6262
- All tools are functional and will work without error. Do not test tools or make exploratory calls. Make sure this is clear to every subagent that is launched.
6363
- Only call a tool if it is required to complete the task. Every tool call should have a clear purpose.
64+
65+
**INIT: Setup**
66+
- Create a todo list before starting.
67+
- Use gh CLI to fetch PR data (e.g., `gh pr view`, `gh pr diff`). Do not use web fetch.
68+
- Use `gh pr diff <number>` as the primary review input. Do NOT read full source files unless the diff context is insufficient to evaluate an issue (e.g., you need surrounding code, imports, or pattern context across the file).
69+
- Use `gh pr view <number> --json files` to list changed files if needed.
70+
- Do NOT use `git diff origin/main` — the checkout is shallow and `origin/main` is unavailable.
71+
- Read `.claude/agents/godev.md` and `.claude/agents/tester.md` exactly once at the start for reference. Do not re-read them.
6472
6573
**STEP 1: Commit Policy Validation**
6674
@@ -111,19 +119,16 @@ jobs:
111119
- General code quality concerns (e.g., lack of test coverage, general security issues) unless explicitly required in CLAUDE.md
112120
- Issues mentioned in CLAUDE.md but explicitly silenced in the code (e.g., via a lint ignore comment)
113121
114-
Notes:
115-
- Use gh CLI to fetch PR data (e.g., `gh pr view`, `gh pr diff`). Do not use web fetch.
122+
**STEP 3: Post Summary Comment**
123+
116124
- Use `mcp__github_comment__update_claude_comment` for summary comments. Use `mcp__github_inline_comment__create_inline_comment` for inline comments.
117-
- Create a todo list before starting.
118125
- You must cite and link each issue in inline comments (e.g., if referring to a CLAUDE.md, include a link to it).
119126
- Links must follow this exact format for GitHub Markdown rendering: `https://github.com/redpanda-data/connect/blob/[full-sha]/path/file.ext#L[start]-L[end]`
120127
- Full git SHA required (not abbreviated, not a command like `$(git rev-parse HEAD)`)
121128
- `#L` notation after filename
122129
- Line range format: `L[start]-L[end]`
123130
- Include at least 1 line of context before and after
124131
125-
**STEP 3: Post Summary Comment**
126-
127132
After completing STEP 1 and STEP 2, post a SINGLE summary comment using `mcp__github_comment__update_claude_comment` with exactly this format:
128133
129134
---

0 commit comments

Comments
 (0)