Skip to content

Commit e04ea4a

Browse files
committed
CLDSRV-880 Fix formatting bugs in Claude review-pr skill
Three changes: 1. Suggestion blocks now use heredoc (-F body=@- with <<'COMMENT_BODY') instead of $'...' quoting. The old $'...' approach broke when suggestion content contained single quotes, producing literal \n text. Heredoc handles any content safely. 2. Summary comments ban markdown headings. The old version didn't mention this, so the model used ## Review Summary with <br>, which GitHub rendered as giant bold text. Now it explicitly says "No markdown headings — they render as giant bold text" and shows a flat bullet list format. 3. Simpler overall — removed the verbose bullet list of rules, the $'...' example, and the redundant formatting explanations.
1 parent a4314a8 commit e04ea4a

File tree

1 file changed

+19
-59
lines changed

1 file changed

+19
-59
lines changed

.claude/skills/review-pr/SKILL.md

Lines changed: 19 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -86,75 +86,35 @@ Parse `$ARGUMENTS` to extract the repo and PR number:
8686
8787
#### Part A: Inline file comments
8888
89-
For each specific issue, post a comment on the exact file and line:
89+
For each issue, post a comment on the exact file and line. Keep comments short (1-3 sentences), end with `— Claude Code`. Use line numbers from the **new version** of the file.
9090
91+
**Without suggestion block** — single-line command, `<br>` for line breaks:
9192
```bash
92-
gh api -X POST \
93-
-H "Accept: application/vnd.github+json" \
94-
"repos/<owner/repo>/pulls/<number>/comments" \
95-
-f body="Your comment<br><br>— Claude Code" \
96-
-f path="path/to/file" \
97-
-F line=<line_number> \
98-
-f side="RIGHT" \
99-
-f commit_id="<headRefOid>"
93+
gh api -X POST -H "Accept: application/vnd.github+json" "repos/<owner/repo>/pulls/<number>/comments" -f body="Issue description.<br><br>— Claude Code" -f path="file" -F line=42 -f side="RIGHT" -f commit_id="<headRefOid>"
10094
```
10195

102-
**The command must stay on a single bash line.** Never use newlines in
103-
bash commands — use `<br>` for line breaks in comment bodies. Never put
104-
`<br>` inside code blocks or suggestion blocks.
105-
106-
Each inline comment must:
107-
108-
- Be short and direct — say what's wrong, why it's wrong, and how to
109-
fix it in 1-3 sentences
110-
- No filler, no complex words, no long explanations
111-
- When the fix is a concrete line change (not architectural), include
112-
a GitHub suggestion block so the author can apply it in one click:
113-
114-
````text
115-
```suggestion
116-
corrected-line-here
117-
```
118-
````
119-
120-
Only suggest when you can show the exact replacement. For
121-
architectural or design issues, just describe the problem.
122-
Example with a suggestion block:
123-
124-
```bash
125-
gh api ... -f body=$'Missing the update.\
126-
<br><br>\n```suggestion\n\
127-
/plugin update shared-guidelines@hub\n\
128-
/plugin update scality-skills@hub\n\
129-
```\n<br><br>— Claude Code' ...
130-
```
131-
132-
- When the comment contains a suggestion block, use `$'...'` quoting
133-
with `\n` for code fence boundaries. Escape single quotes as `\'`
134-
(e.g., `don\'t`)
135-
- End with: `— Claude Code`
136-
137-
Use the line number from the **new version** of the file (the line
138-
number you'd see after the PR is merged), which corresponds to the
139-
`line` parameter in the GitHub API.
96+
**With suggestion block** — use a heredoc (`-F body=@-`) so code renders correctly:
97+
```bash
98+
gh api -X POST -H "Accept: application/vnd.github+json" "repos/<owner/repo>/pulls/<number>/comments" -F body=@- -f path="file" -F line=42 -f side="RIGHT" -f commit_id="<headRefOid>" <<'COMMENT_BODY'
99+
Issue description.
140100
141-
#### Part B: Summary comment
101+
```suggestion
102+
first line of suggested code
103+
second line of suggested code
104+
```
142105
143-
```bash
144-
gh pr comment <number> --repo <owner/repo> \
145-
--body "LGTM<br><br>Review by Claude Code"
106+
— Claude Code
107+
COMMENT_BODY
146108
```
147109

148-
**The command must stay on a single bash line.** Never use newlines in
149-
bash commands — use `<br>` for line breaks in comment bodies.
110+
Only suggest when you can show the exact replacement. For architectural or design issues, just describe the problem.
150111

151-
Do not describe or summarize the PR. For each issue, state the problem
152-
on one line, then list one or more suggestions below it:
112+
#### Part B: Summary comment
153113

154-
```text
155-
- <issue>
156-
- <suggestion>
157-
- <suggestion>
114+
Single-line command, `<br>` for line breaks. No markdown headings — they render as giant bold text. Flat bullet list only:
115+
116+
```bash
117+
gh pr comment <number> --repo <owner/repo> --body "- file:line — issue<br>- file:line — issue<br><br>Review by Claude Code"
158118
```
159119

160120
If no issues: just say "LGTM". End with: `Review by Claude Code`

0 commit comments

Comments
 (0)