Skip to content

[project-dina #24] [diberry/squad] You have 3 approved PRs that need merge conflict resolution and PR readiness pro... #136

@diberry

Description

@diberry

Dispatched from project-dina

Parent issue: diberry/project-dina#24
Dispatched by: Kermit (Lead/PM)

Task

You have 3 approved PRs that need merge conflict resolution and PR readiness processing.
DO NOT TOUCH ANY OTHER PRS OR ISSUES.

Process in this order: bradygaster#813bradygaster#826bradygaster#827

For each PR:

  1. Check out the PR branch
  2. Rebase onto origin/dev to resolve merge conflicts
  3. Follow the COMPLETE PR lifecycle skill below — every step, in order
  4. Post a status comment on the PR when it passes all gates

SKILL (follow every step):

name: dina-bradygaster-squad-pr-requirements
description: |
Full PR lifecycle for Dina's PRs on bradygaster/squad — from code-complete
through Copilot review to Brady-ready. Ordered workflow, not just a checklist.
USE FOR: PR readiness checks on bradygaster/squad, dispatch prompts that
open or maintain PRs on upstream, Ralph sweep of open upstream PRs
DO NOT USE FOR: fork PR pipeline (diberry/squad), other repos
INVOKES: gh, github-mcp-server (PR review comments, check runs, commits)
allowed-tools: [powershell, gh, github-mcp-server-pull_request_read]
metadata:
confidence: medium
domain: pr-quality
repo: bradygaster/squad

bradygaster/squad — PR Lifecycle Requirements

Dina's PRs on bradygaster/squad follow this ordered workflow from
code-complete to Brady-ready. Execute steps in order — later steps
depend on earlier ones.

Workflow (execute in order)

Step 1. Squash to Single Commit

When implementation work is complete, squash all commits into one with a
clear conventional commit message.

git rebase -i origin/dev
# mark all but first as "squash"
git push --force-with-lease

Check:

gh pr view <N> --repo bradygaster/squad --json commits --jq '.commits | length'

Expected: 1

Step 2. File Audit — No Prohibited Files

The PR must NOT contain any of these file categories:

  • .squad/ files — squad state is branch-local, never upstream
  • docs/proposals/ files — proposals stay in project-dina or fork
  • Merge conflict markers — no <<<<<<< in any file

Check:

gh pr view <N> --repo bradygaster/squad --json files --jq '.files[].path' | Select-String -Pattern '\.squad/|docs/proposals/'

Expected: no output. If matches found, remove those files from the commit.

Fix: Remove prohibited files, amend the commit, force-push:

git rm --cached .squad/whatever docs/proposals/whatever
git commit --amend --no-edit
git push --force-with-lease

Step 3. Changeset File Present

Every PR must include a changeset file in .changeset/ describing the
change for the changelog. If one doesn't exist, create it.

Check:

gh pr view <N> --repo bradygaster/squad --json files --jq '.files[].path' | Select-String '.changeset/'

Expected: at least one .changeset/*.md file.

Create if missing:

# In the repo root:
npx changeset
# Or manually create .changeset/<random-id>.md with:
# ---
# "@bradygaster/squad-cli": patch
# ---
# 
# Brief description of the change

Amend the commit and force-push after adding.

Step 4. Update from Base Branch

Rebase onto latest dev. No merge conflicts. No "behind by N commits."

git fetch origin dev
git rebase origin/dev
git push --force-with-lease

Check:

gh pr view <N> --repo bradygaster/squad --json mergeStateStatus --jq '.mergeStateStatus'

Expected: CLEAN or HAS_HOOKS. If BEHIND, DIRTY, or BLOCKED — rebase.

Step 5. Move Out of Draft

Once squashed, clean, and rebased — mark the PR as ready for review.
This triggers Copilot's automated review.

gh pr ready <N> --repo bradygaster/squad

Step 6. Wait for Copilot Review

After moving out of draft, Copilot will automatically review the PR.
This can take up to 10 minutes. Do not proceed until the Copilot
review appears.

Poll for review (check every 60s, up to 10 min):

$pr = <N>; $repo = "bradygaster/squad"
for ($i = 0; $i -lt 10; $i++) {
    $reviews = gh api "repos/$repo/pulls/$pr/reviews" --jq '[.[] | select(.user.login == "copilot-pull-request-reviewer[bot]" or .user.type == "Bot")] | length'
    if ([int]$reviews -gt 0) { Write-Host "✅ Copilot review received"; break }
    Write-Host "⏳ Waiting for Copilot review... ($($i+1)/10)"
    Start-Sleep 60
}

Step 7. Resolve All Copilot Review Threads

Address every comment Copilot made. For each thread:

  1. Read the comment — understand what Copilot flagged
  2. Fix in code if the feedback is valid
  3. Resolve the thread via GitHub UI or GraphQL:
    gh api graphql -f query='mutation { resolveReviewThread(input: {threadId: "THREAD_NODE_ID"}) { thread { isResolved } } }'
    

If the comment is not applicable, reply with a brief explanation and
resolve. Never leave threads unresolved.

Check all threads resolved:
Use github-mcp-server-pull_request_read with method: "get_review_comments"
and verify all threads have isResolved: true.

After fixing issues: amend the single commit, force-push, and re-check
that squash is still 1 commit.

Step 8. Keep Branch Up to Date (again)

If you amended the commit in Step 7, rebase again to ensure you're
still current with dev.

git fetch origin dev
git rebase origin/dev
git push --force-with-lease

Step 9. All CI Checks Pass

Every CI check must be green. This includes:

  • Build
  • Lint / type checking
  • All tests (unit, integration)
  • Repo-specific gates (changelog gate, export validation, PR readiness)

Check:

gh pr checks <N> --repo bradygaster/squad

Expected: all checks pass. Zero failures, zero pending.

If checks fail after your Step 7 amendments, fix, amend, force-push,
and wait for CI to re-run.

Step 10. Final Validation

Run the full check:

$pr = <N>; $repo = "bradygaster/squad"

# 1. Single commit
$commits = gh pr view $pr --repo $repo --json commits --jq '.commits | length'
Write-Host "Commits: $commits $(if ($commits -eq '1') {''} else {''})"

# 2. No prohibited files
$bad = gh pr view $pr --repo $repo --json files --jq '.files[].path' | Select-String '\.squad/|docs/proposals/'
Write-Host "Prohibited files: $(if ($bad) {'' + $bad} else {'✅ none'})"

# 3. Changeset present
$cs = gh pr view $pr --repo $repo --json files --jq '.files[].path' | Select-String '.changeset/'
Write-Host "Changeset: $(if ($cs) {''} else {'❌ missing'})"

# 4. Merge state
$state = gh pr view $pr --repo $repo --json mergeStateStatus --jq '.mergeStateStatus'
Write-Host "Merge state: $state $(if ($state -eq 'CLEAN') {''} else {''})"

# 5. CI checks
Write-Host "`nCI Checks:"
gh pr checks $pr --repo $repo

# 6. Not draft
$draft = gh pr view $pr --repo $repo --json isDraft --jq '.isDraft'
Write-Host "`nDraft: $(if ($draft -eq 'false') {'✅ ready'} else {'❌ still draft'})"

All ✅ → PR is ready for Brady's review. Leave it alone until he looks.

When to Apply This Skill

  • Before requesting review: Run the full validation. All green → ready.
  • In dispatch prompts: Include this workflow in any prompt that creates
    upstream PRs. The dispatched agent must follow Steps 1–10 in order.
  • In Ralph sweeps: When Ralph checks upstream PRs by diberry, validate
    gates. If any fail, fix before notifying Brady.
  • After Copilot re-reviews: If you push new changes and Copilot
    re-reviews, go back to Step 7 and repeat through Step 10.

Anti-Patterns

  • ❌ Moving out of draft before squashing (triggers Copilot review on messy history)
  • ❌ Not waiting for Copilot review (proceeding before the 10-min window)
  • ❌ Resolving Copilot threads without fixing the code
  • ❌ Leaving .squad/ or docs/proposals/ files in the PR
  • ❌ Missing changeset file (changelog gate will fail)
  • ❌ Requesting Brady's review with failing CI
  • ❌ Leaving 2+ commits ("I'll squash later")
  • ❌ Skipping any gate because "it's just a docs PR" — all gates apply equally

SPECIFIC CONTEXT:

After processing all 3 PRs:

  1. Post a summary comment on diberry/project-dina#24 listing each PR's status
  2. Close diberry/squad child issue when done

CRITICAL RULES:

  • DO NOT touch any other PRs or issues
  • DO NOT merge PRs — only get them to Brady-ready state
  • After coming out of draft, WAIT UP TO 10 MINUTES for Copilot review before proceeding
  • Resolve ALL Copilot review threads before declaring ready

This issue was created by project-dina's dispatch process. Report status here; Kermit will sync back to the parent issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a membersquad:fidoAssigned to FIDO (Quality Owner)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions