From 5c206ee82e739ce82550e3b177116c2e88aa634d Mon Sep 17 00:00:00 2001 From: JacobPEvans <20714140+JacobPEvans@users.noreply.github.com> Date: Tue, 3 Mar 2026 10:16:09 -0500 Subject: [PATCH 1/4] fix: replace jq != operator and add markdownlint troubleshooting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace .body != "" with (.body | length > 0) in resolve-pr-threads skills — Claude Code Bash tool escapes ! to \! breaking jq's != operator - Fix bash != in trigger-ai-reviews to avoid same issue - Add markdownlint pre-push hook auto-fix troubleshooting to rebase-pr skill (claude) --- git-workflows/skills/rebase-pr/SKILL.md | 14 ++++++++++++++ .../skills/resolve-pr-threads/SKILL.md | 3 ++- .../skills/resolve-pr-threads/rest-api-patterns.md | 2 +- .../skills/trigger-ai-reviews/SKILL.md | 4 +++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/git-workflows/skills/rebase-pr/SKILL.md b/git-workflows/skills/rebase-pr/SKILL.md index 0955862..b5297f7 100644 --- a/git-workflows/skills/rebase-pr/SKILL.md +++ b/git-workflows/skills/rebase-pr/SKILL.md @@ -178,3 +178,17 @@ Skip Steps 1–6. Go directly to Step 7 cleanup. **merge-base --is-ancestor exits non-zero:** Main moved while you were waiting for CI. Return to Step 2, re-sync main, re-fetch branch, re-rebase, force-push again, wait for CI, then retry merge. + +### Pre-Push Hook Auto-Fixes Files + +**Detection**: `git push` fails, hook output shows "files were modified by this hook" + +**Action**: Commit the auto-fixed files and retry the push: + +```bash +git add -A +git commit -m "style: apply pre-push hook auto-fixes" +git push --force-with-lease origin "$BRANCH" +``` + +This commonly occurs with release-please CHANGELOG.md entries that don't conform to markdownlint rules. diff --git a/github-workflows/skills/resolve-pr-threads/SKILL.md b/github-workflows/skills/resolve-pr-threads/SKILL.md index 460609b..b66982b 100644 --- a/github-workflows/skills/resolve-pr-threads/SKILL.md +++ b/github-workflows/skills/resolve-pr-threads/SKILL.md @@ -78,7 +78,7 @@ gh api "repos/{owner}/{repo}/issues/{number}/comments?since={lastCommitDate}" #### Step 1d: Fetch Review Body Comments Since Last Commit ```bash -gh api "repos/{owner}/{repo}/pulls/{number}/reviews" --jq '[.[] | select(.submitted_at > "{lastCommitDate}" and .body != "") | {id, body, author: .user.login, submitted_at}]' +gh api "repos/{owner}/{repo}/pulls/{number}/reviews" --jq '[.[] | select(.submitted_at > "{lastCommitDate}" and (.body | length > 0)) | {id, body, author: .user.login, submitted_at}]' ``` ### Step 2a: Group Related Threads @@ -212,3 +212,4 @@ Omit "Threads:" when zero threads; omit "Comments:" when zero comments. | REST reply fails | Invalid `databaseId` or permissions | Verify numeric databaseId (not node ID) and ensure token has required repo permissions (403 = permission issue) | | `since` filter returns all comments | Invalid date format | Verify ISO 8601 format | | Reviews endpoint returns empty | No reviews submitted | Proceed with threads only | +| `\!` in jq expression | Claude Code Bash escapes `!` | Use `(.x == y \| not)` or `.x \| length > 0` instead of `!=` | diff --git a/github-workflows/skills/resolve-pr-threads/rest-api-patterns.md b/github-workflows/skills/resolve-pr-threads/rest-api-patterns.md index af87758..b392028 100644 --- a/github-workflows/skills/resolve-pr-threads/rest-api-patterns.md +++ b/github-workflows/skills/resolve-pr-threads/rest-api-patterns.md @@ -73,7 +73,7 @@ Returns array of comments posted after the specified timestamp. ### Fetch Review Body Comments Since Last Commit ```bash -gh api "repos/{owner}/{repo}/pulls/{number}/reviews" --jq '[.[] | select(.submitted_at > "{lastCommitDate}" and .body != "") | {id, body, author: .user.login, submitted_at}]' +gh api "repos/{owner}/{repo}/pulls/{number}/reviews" --jq '[.[] | select(.submitted_at > "{lastCommitDate}" and (.body | length > 0)) | {id, body, author: .user.login, submitted_at}]' ``` The `--jq` filter is required because the reviews endpoint does not support server-side `?since=` filtering. diff --git a/github-workflows/skills/trigger-ai-reviews/SKILL.md b/github-workflows/skills/trigger-ai-reviews/SKILL.md index 48261f0..bbedd30 100644 --- a/github-workflows/skills/trigger-ai-reviews/SKILL.md +++ b/github-workflows/skills/trigger-ai-reviews/SKILL.md @@ -37,7 +37,9 @@ Verify the PR exists and is open: ```bash STATE=$(gh pr view "$PR_NUMBER" --json state --jq '.state') -if [ "$STATE" != "OPEN" ]; then +if [ "$STATE" = "OPEN" ]; then + : # continue +else echo "PR #$PR_NUMBER is $STATE — only open PRs can be reviewed" exit 1 fi From 9adcf2ccf390a912e2040d929dd0267146aaba7a Mon Sep 17 00:00:00 2001 From: JacobPEvans <20714140+JacobPEvans@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:17:50 -0500 Subject: [PATCH 2/4] fix(rebase-pr): use {branch} placeholder instead of "$BRANCH" shell variable Consistent with all other commands in the skill (lines 83, 99, 108-109, etc.) which use the {branch} placeholder format. (claude) --- git-workflows/skills/rebase-pr/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-workflows/skills/rebase-pr/SKILL.md b/git-workflows/skills/rebase-pr/SKILL.md index b5297f7..0255bee 100644 --- a/git-workflows/skills/rebase-pr/SKILL.md +++ b/git-workflows/skills/rebase-pr/SKILL.md @@ -188,7 +188,7 @@ re-rebase, force-push again, wait for CI, then retry merge. ```bash git add -A git commit -m "style: apply pre-push hook auto-fixes" -git push --force-with-lease origin "$BRANCH" +git push --force-with-lease origin {branch} ``` This commonly occurs with release-please CHANGELOG.md entries that don't conform to markdownlint rules. From 5bc0c6e71558a5bcda904d16a27c6baf64f28f82 Mon Sep 17 00:00:00 2001 From: JacobPEvans <20714140+JacobPEvans@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:17:55 -0500 Subject: [PATCH 3/4] refactor(trigger-ai-reviews): simplify PR state guard to || idiom Replace verbose if/else with : # continue body with the standard shell guard clause pattern. Functionally identical, avoids ! character. (claude) --- github-workflows/skills/trigger-ai-reviews/SKILL.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/github-workflows/skills/trigger-ai-reviews/SKILL.md b/github-workflows/skills/trigger-ai-reviews/SKILL.md index bbedd30..0d92ec1 100644 --- a/github-workflows/skills/trigger-ai-reviews/SKILL.md +++ b/github-workflows/skills/trigger-ai-reviews/SKILL.md @@ -37,12 +37,7 @@ Verify the PR exists and is open: ```bash STATE=$(gh pr view "$PR_NUMBER" --json state --jq '.state') -if [ "$STATE" = "OPEN" ]; then - : # continue -else - echo "PR #$PR_NUMBER is $STATE — only open PRs can be reviewed" - exit 1 -fi +[ "$STATE" = "OPEN" ] || { echo "PR #$PR_NUMBER is $STATE — only open PRs can be reviewed"; exit 1; } ``` ## Step 2: Trigger Claude From 002d911335b8de493c356dd22fcd97e11b983840 Mon Sep 17 00:00:00 2001 From: JacobPEvans <20714140+JacobPEvans@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:18:20 -0500 Subject: [PATCH 4/4] fix(resolve-pr-threads): use HTML entity for pipe in jq table examples Replace \| (backslash-pipe) inside backtick code spans with | (HTML entity) in the troubleshooting table. The \| notation rendered the backslash visibly in GitHub and produced invalid jq when copy-pasted. The HTML entity renders as a plain | in GitHub markdown while also satisfying markdownlint MD056 (table column count). (claude) --- github-workflows/skills/resolve-pr-threads/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github-workflows/skills/resolve-pr-threads/SKILL.md b/github-workflows/skills/resolve-pr-threads/SKILL.md index b66982b..6be2925 100644 --- a/github-workflows/skills/resolve-pr-threads/SKILL.md +++ b/github-workflows/skills/resolve-pr-threads/SKILL.md @@ -212,4 +212,4 @@ Omit "Threads:" when zero threads; omit "Comments:" when zero comments. | REST reply fails | Invalid `databaseId` or permissions | Verify numeric databaseId (not node ID) and ensure token has required repo permissions (403 = permission issue) | | `since` filter returns all comments | Invalid date format | Verify ISO 8601 format | | Reviews endpoint returns empty | No reviews submitted | Proceed with threads only | -| `\!` in jq expression | Claude Code Bash escapes `!` | Use `(.x == y \| not)` or `.x \| length > 0` instead of `!=` | +| `\!` in jq expression | Claude Code Bash escapes `!` | Use `(.x == y | not)` or `.x | length > 0` instead of `!=` |