Skip to content

Instantly share code, notes, and snippets.

@narthur
Last active January 1, 2026 16:51
Show Gist options
  • Select an option

  • Save narthur/e6812cba5a963bec1c18bf0ebc472035 to your computer and use it in GitHub Desktop.

Select an option

Save narthur/e6812cba5a963bec1c18bf0ebc472035 to your computer and use it in GitHub Desktop.
Warp Saved Prompts

PR Extractor - Warp AI Saved Prompt

You are helping me extract small, self-contained changes from a larger feature branch into separate PRs.

Prerequisites

This workflow uses helper scripts. Ensure these are installed and in your PATH:

  • pr-extract-context - Gathers branch context (base branch, rebase status, diff stats)
  • pr-extract-rebase - Safely rebases current branch

Your Task

  1. Gather context: Run pr-extract-context to get:

    • Base branch name (main/master/development)
    • Current branch name
    • Rebase status (commits behind)
    • Diff statistics
    • Changed files summary
  2. Analyze the diff: Run git --no-pager diff origin/<base-branch> to see detailed changes

  3. Identify one small change: Find a single, self-contained change that could be its own PR.

    Target PR size: Aim for changes affecting 1-3 files or fewer than 50 lines of changes (additions + deletions combined). Smaller is better for quick reviews.

    Prioritize changes that are:

    • Non-breaking
    • Independent of other changes
    • Low-risk (e.g., config updates, .gitignore additions, documentation, formatting, dependency updates)
    • Can be merged without the rest of the branch
  4. Explain your selection: Briefly describe:

    • What the change is
    • Why it's a good candidate for extraction
    • What files are affected
  5. Provide numbered options:

    [If rebase is needed, show this option first:] Option 0: Rebase first (RECOMMENDED)

    • Run: pr-extract-rebase
    • This will safely rebase the current branch onto the latest base branch
    • After rebasing, re-run this prompt to extract PRs

    Option 1: Create the PR automatically

    • Run git commands to:
      • Create new branch from origin/<base-branch> (use appropriate prefix: chore/, docs/, fix/, etc.)
      • Apply the identified changes (use appropriate method):
        • For whole file changes: git checkout - -- <file>
        • For partial file changes: Provide specific instructions to manually edit or use git add -p
        • For new files: Show exact commands to create/modify the file
      • Commit with descriptive conventional commit message (include Co-Authored-By: Warp <agent@warp.dev>)
      • Push and create PR: git push -u origin <branch-name> && gh pr create -fd
    • Generate and show me the complete git commands to:
      • Create a new branch from origin/<base-branch> (use appropriate prefix: chore/, docs/, fix/, etc.)
      • Apply only the identified changes
      • Commit with a descriptive message (include Co-Authored-By: Warp <agent@warp.dev>)
      • Push and create a PR using gh pr create -fd

    Option 2: Suggest a different change

    • Find another small, standalone change from the diff

    Option 3: Show me the specific diff

    • Show only the diff for the files involved in the identified change

    Option 4: List all potential extractions

    • Provide a numbered list of all small changes that could become separate PRs

Important Guidelines

  • Use the helper scripts for consistency and safety
  • If helper scripts aren't available, fall back to manual git commands
  • Branch names should be descriptive and use conventional prefixes (chore/, docs/, fix/, feat/, refactor/, etc.)
  • Commit messages should follow conventional commits format
  • Always include the Co-Authored-By: Warp <agent@warp.dev> trailer
  • If files need to be created/modified (like .gitignore), show the exact commands needed

Example Output Format

Identified Change: [Brief description]

Rebase Status: [Show number of commits behind if > 0, or "✓ Up to date" if not behind]

Why this is a good candidate: [1-2 sentence explanation]

Files affected: [List of files]

Your options:

[If behind base branch:] 0. Rebase first (RECOMMENDED) - Update branch with latest changes

  1. Create PR automatically - I'll generate the complete git workflow
  2. Suggest different change - I'll find another extraction candidate
  3. Show specific diff - I'll show just this change's diff
  4. List all candidates - I'll show all possible extractions

[If up to date:]

  1. Create PR automatically - I'll generate the complete git workflow
  2. Suggest different change - I'll find another extraction candidate
  3. Show specific diff - I'll show just this change's diff
  4. List all candidates - I'll show all possible extractions

What would you like to do?

PR Feedback Review Workflow

You are helping me efficiently review and address code feedback. I have these commands available:

  • pr-feedback --limit 1 - retrieves the next piece of feedback (outputs feedback_id, thread_id, and details)
  • resolve-feedback <feedback_id> - marks a feedback item as resolved
  • pr-comment <thread-id> [comment-text] - posts a comment directly on the feedback thread

I also have GitHub CLI (gh) available for creating issues.

WORKFLOW:

  1. Run pr-feedback --limit 1 to get the next feedback item (note the thread-id from the output)
  2. Provide a brief summary of the feedback in 1-2 sentences
  3. Analyze the feedback and determine what changes (if any) are needed
  4. Make any necessary code changes to address the feedback
  5. Add or update tests as needed to cover the changes or verify the fix
  6. Update WARP.md files throughout the project to reflect:
    • New patterns or conventions learned from the feedback
    • Important decisions or trade-offs made
    • Architectural insights or design principles discovered
    • Any gotchas or pitfalls to avoid in related code
  7. Provide a clear explanation of:
    • What you did (or didn't do)
    • Why you made those decisions
    • Any trade-offs or considerations
    • What tests were added/updated (if applicable)
    • What WARP.md updates were made (if applicable)
  8. Present numbered options for next steps, such as:
    • Commit changes, push, and resolve feedback
    • Resolve feedback without committing (if no changes needed)
    • Create a follow-up issue, comment on the feedback with the issue link, then resolve
    • Skip this feedback and move to next
    • Discuss further before deciding
    • [Include other relevant options as appropriate]

CREATING FOLLOW-UP ISSUES:

When I choose to create a follow-up issue, you should:

  1. Create an issue using: gh issue create --title "title" --body "body"
  2. Extract the issue number and URL from the response
  3. Post a comment on the feedback thread using: pr-comment <thread-id> "[Warp AI] Created follow-up issue: <issue-url>"
  4. After commenting, resolve the feedback with resolve-feedback <feedback_id>
  5. Continue to the next feedback item

The follow-up issue should include:

  • A clear title summarizing the work needed
  • Context from the original feedback
  • Why this is being deferred (if applicable)
  • Any relevant code references or links

COMMENT FORMAT:

All comments posted to feedback threads must be prepended with "[Warp AI]" to identify them as AI-generated. Use this format:

pr-comment <thread-id> "[Warp AI] comment content here"

EXECUTION:

After I select an option by number, execute that choice and continue to the next feedback item. Keep this cycle going until all feedback is addressed or I ask to stop.

Begin by retrieving the first feedback item now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment