Pr

From rajitsaha/100xprism · View interactive version

Pr is an AI agent skill from the GitHub repository rajitsaha/100xprism. Create a GitHub Pull Request with full AI review. Human approves and merges.

How to use this skill

Skill file

PR — Create Pull Request with AI Review

Create a GitHub Pull Request with full AI review. Human approves and merges — do NOT merge automatically; always stop after PR creation and AI review.

Step 0 — Smart default: ensure feature branch

PROJECT_ROOT=$(git rev-parse --show-toplevel)
cd "$PROJECT_ROOT"
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
DEFAULT_BRANCH="${DEFAULT_BRANCH:-main}"
CURRENT_BRANCH=$(git branch --show-current)

If on the default branch: Run the branch workflow first to create a feature branch. Then continue.

If on a feature branch: Continue with PR creation.


Phase 1 — Pre-flight

Run the gate workflow. All gates must pass before creating a PR (Gates 1–3 always; Gates 4–5 when applicable).

If any gate fails → STOP. Fix issues first. Do NOT create a PR with failing gates.


Phase 2 — Push branch

git push -u origin "$CURRENT_BRANCH"

Phase 3 — Generate PR content

Title

Body

Generate from the diff against the default branch:

git log "$DEFAULT_BRANCH"..HEAD --oneline
git diff "$DEFAULT_BRANCH"...HEAD --stat

Structure the body as:

## Summary
- [2-3 bullet points describing what changed and why]

## Changes
- [list of key files/areas modified]

## Test plan
- [ ] [How this was tested]
- [ ] [What to verify during review]

## Related issues
[Auto-detected from commit messages: "fixes #42", "closes #13", etc.]

Phase 4 — Create PR

gh pr create \
  --title "<generated title>" \
  --body "<generated body>" \
  --base "$DEFAULT_BRANCH" \
  --head "$CURRENT_BRANCH"

Capture the PR number and URL from the output.


Phase 5 — AI Review

Review the full diff and post findings as a PR comment.

What to review

# Get the full diff for review
git diff "$DEFAULT_BRANCH"...HEAD

Analyze the diff across 5 categories:

1. Code quality

2. Spec compliance

3. Security

4. Test coverage

5. Breaking changes

Post review as PR comment

gh pr comment <PR_NUMBER> --body "<review content>"

Review format:

## 100x Dev — AI Review

### Summary
[1-2 sentence overall assessment]

### Findings

#### Critical (must fix before merge)
- [file:line] [description]

#### Important (should fix)
- [file:line] [description]

#### Minor (consider fixing)
- [file:line] [description]

### Checklist
- [ ] All critical findings addressed
- [ ] Tests cover new code paths
- [ ] No secrets in diff
- [ ] No breaking changes (or documented)

### Verdict: ✅ APPROVE / ⚠️ CHANGES REQUESTED / ❌ BLOCK

If no issues found:

## 100x Dev — AI Review

### Summary
Clean implementation. No issues found.

### Verdict: ✅ APPROVE

Phase 6 — Stop (Human-in-the-Loop)

DO NOT MERGE. Print the PR summary and stop — merge is the human's responsibility.

PULL REQUEST CREATED
PR:      #<number> — <title>
Branch:  <branch> → <default_branch>
Review:  AI review posted ✅ | Gate: ✅ all passed
URL:     <pr_url>
STATUS:  Awaiting human approval. DO NOT auto-merge.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.