Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix: address jq escaping and Step 5 dismissal ordering in CI skills (#1241)

worktrunk-bote79332c3f633
diff --git a/.claude/skills/pr-review/SKILL.md b/.claude/skills/pr-review/SKILL.md
index e56ddda27..947176e65 100644
--- a/.claude/skills/pr-review/SKILL.md
+++ b/.claude/skills/pr-review/SKILL.md
@@ -314,11 +314,13 @@ gh pr view <number> --json statusCheckRollup \
case of a long poll is wasted compute, not missed information.
- **A check failed** → if it's a flaky test or unrelated infrastructure
failure, no action needed. If the failure is related to the PR changes:
- 1. Dismiss the bot's approval if one exists (empty dismiss message). Skip
- if already dismissed — redundant dismissals create timeline noise.
- 2. Investigate the failure and post a follow-up review (COMMENT) with
+ 1. Investigate the failure and post a follow-up review (COMMENT) with
analysis, inline suggestions, and an offer to fix. Same rules as
- step 4 — no repeated points from previous reviews.
+ step 4 — no repeated points from previous reviews. **Post the analysis
+ first** — if the session times out before dismissing, a stale approval
+ (contradicted by red CI) is better than a bare dismissal with no context.
+ 2. Dismiss the bot's approval if one exists (empty dismiss message). Skip
+ if already dismissed — redundant dismissals create timeline noise.
### 6. Resolve handled suggestions
diff --git a/.claude/skills/running-in-ci/SKILL.md b/.claude/skills/running-in-ci/SKILL.md
index b66f77742..7f18bbf34 100644
--- a/.claude/skills/running-in-ci/SKILL.md
+++ b/.claude/skills/running-in-ci/SKILL.md
@@ -99,34 +99,23 @@ unused branches after the run).
## Shell Quoting in `gh` Commands
-Claude tends to mangle shell quoting in CI. Two common failure modes:
-
-1. **`$` in GraphQL queries** — `gh api graphql -f query='...$var...'` fails
- because Claude corrupts the `$` signs. Write queries to a temp file instead:
-
- ```bash
- cat > /tmp/query.graphql << 'GRAPHQL'
- query($owner: String!, $repo: String!, $name: String!) {
- repository(owner: $owner, name: $name) { ... }
- }
- GRAPHQL
-
- gh api graphql -F query=@/tmp/query.graphql -f owner="$OWNER" -f name="$NAME"
- ```
-
-2. **`!` in comment/body text** — `gh issue comment N --body "Thanks!"` gets
- over-escaped to `Thanks\!` because `!` is a bash history expansion character.
- Use a heredoc:
-
- ```bash
- gh issue comment N --body "$(cat <<'EOF'
- Comment text here — no escaping needed.
- EOF
- )"
- ```
-
-**General rule:** When a `gh` command argument contains `$` or `!`, use either
-a temp file (`-F field=@file`) or a heredoc with a quoted delimiter (`<<'EOF'`).
+Shell expansion corrupts `$` and `!` in command arguments. When a `gh` argument
+contains either character, write it to a temp file or heredoc variable first:
+
+```bash
+# GraphQL with $ — write query to a file, pass with -F
+cat > /tmp/query.graphql << 'GRAPHQL'
+query($owner: String!, $repo: String!) { ... }
+GRAPHQL
+gh api graphql -F query=@/tmp/query.graphql -f owner="$OWNER"
+
+# jq/body text with ! — capture in a heredoc variable
+jq_filter=$(cat <<'EOF'
+select(.status != "COMPLETED")
+EOF
+)
+gh api ... --jq "$jq_filter"
+```
## Atomic PRs