Skip to content

review-pr: skill documents broken gh api flag syntax for review comments #1409

Closed

Description

@worktrunk-bot

Problem

The review-pr skill (Step 4, "Correct — inline suggestion on the line") documents posting multi-comment reviews using gh api with -f 'comments[0][path]=...' flag syntax. This syntax does not work — gh api converts array index notation into object keys, sending {"0": {"path": ...}} instead of [{"path": ...}]. GitHub rejects this with an "Invalid request" error.

The bot then has to recover by switching to a JSON payload with --input, wasting a tool call and tokens on each review that includes inline comments.

Evidence

Run: 22852797352
PR: #1408
Session log: 9e258e0f-553b-4f36-b787-8241342b426a.jsonl

Sequence:

  1. Bot constructs review with two inline comments using -f 'comments[0][path]=...' syntax (as documented in skill)
  2. GitHub API returns: "Invalid request. For 'properties/comments', {"0" => {"body" => ...
  3. Bot recovers by building a JSON payload file and using --input
  4. Second attempt succeeds

The skill itself shows this broken syntax at lines 336-344:

gh api "repos/$REPO/pulls/<number>/reviews" \
  --method POST \
  -f event=COMMENT \
  -f body="Summary of suggestions" \
  -f 'comments[0][path]=.claude/skills/example/SKILL.md' \
  -f 'comments[0][line]=3' \
  -f 'comments[0][body]=```suggestion ...'

Fix

Update the skill to use a JSON payload file with --input instead of -f flag syntax for review comments. This is the same approach the bot discovers on its own after the failure, and is consistent with the running-in-ci skill's guidance to use temp files for complex API payloads.

PR: (linked)

Activity

  1. added
    claude-behavior
    on Mar 9, 2026
  2. added a commit that references this issue on Mar 9, 2026
    98692a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions