Append (or replace) in the /review comment.
You MUST use the helper script. Do NOT call gh pr comment,
gh api -X PATCH .../comments/..., or any other direct GitHub write
yourself for the diagram. The script is the only sanctioned write path:
it locates the right comment, idempotently replaces any prior iago block,
handles new-comment fallback, and runs a deterministic Mermaid sanitizer
that catches model mistakes (e.g. stray ; in sequence message labels)
before posting. Bypassing it means the diagram ships unchecked and is
the #1 source of broken renders.
The helper lives at scripts/post.ts in this skill's own directory (run
with bun). Different runtimes expose that directory differently —
${CLAUDE_SKILL_DIR} in Claude Code, ${OPENCODE_SKILL_DIR} in OpenCode,
etc. Pick the one your runtime sets, or resolve it from the path of this
SKILL.md file (typically ~/.claude/skills/iago/,
~/.agents/skills/iago/, or ~/.config/opencode/skills/iago/).
Required tools: bun + gh (GitHub CLI, authenticated).
SKILL_DIR="${CLAUDE_SKILL_DIR:-${OPENCODE_SKILL_DIR:-$(dirname "$0")}}"
bun run "$SKILL_DIR/scripts/post.ts" \
--repo "$REPO" \
--pr "$PR" \
--mode "$MODE" \
--diagram-file "$DIAGRAM_FILE"
Where $DIAGRAM_FILE is a temp file you wrote in step 5 containing the full
wrapped block. The script:
- Locates the most recent comment authored by the /review skill (matched via the marker
<!-- review-skill -->, falling back to the most recent comment authored by the current user that contains the heading ## Review or # Review).
- If found and
--mode=append: updates that comment via gh api -X PATCH /repos/{owner}/{repo}/issues/comments/{id}. Replaces any prior iago:begin/end block in place; otherwise appends the new block to the bottom.
- If not found, or
--mode=comment: posts a new comment via gh pr comment.
- Prints the URL of the updated/created comment.