fix(land-plan-docs): remove leading-if from idempotency recipe (gotcha #3)#208
Merged
Conversation
…#3) The "detect an existing PR before branching" section led its decision with a standalone `if [ -n "$EXISTING" ] ...` block. Claude Code matches a skill's `allowed-tools` (Bash(gh *), Bash(git *), Read) by the pipeline's FIRST token, and `if` is not allow-listed — so an unattended run could stall on a permission prompt (the same class fixed for the cleanup recipes in PR #206 / issue #182, which predated this block). Fold the null-check into the `gh pr list --jq` with `// empty` so the recipe leads with `gh` (covered by Bash(gh *)), and evaluate the existence decision in prose — mirroring how PR #206 resolved the cleanup recipes (command-leading leaves, predicate evaluated in prose). allowed-tools unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The
land-plan-docsskill's "Idempotency: detect an existing PR before branching" section led its decision with a standaloneif [ -n "$EXISTING" ] ...block. Claude Code matches a skill'sallowed-tools(Bash(gh *), Bash(git *), Read) by the pipeline's first token, andifis not allow-listed — so an unattended run could stall on a permission prompt.This is the same gotcha #3 class documented in
docs/solutions/integration-issues/land-plan-docs-gh-git-boundary-gotchas.md§3 and fixed for the cleanup recipes in #206 (issue #182). This idempotency block predated #206 and was left out of scope there.Fix
gh pr list --jqwith// empty, so the recipe leads withgh(covered byBash(gh *)).ifblock; evaluate the existence decision in prose — mirroring how fix: make land-* post-merge cleanup worktree-aware #206 resolved the cleanup recipes (command-leading leaves, predicate in prose).allowed-toolsunchanged (Bash(gh *), Bash(git *), Read).Verification
bun test→ 513 pass, 0 fail.allowed-toolsline byte-unchanged.Docs/skill-prompt only — no code changes.
🤖 Generated with Claude Code