Governs the PR lifecycle by running pipelines, enforcing gates, and automating pull request generation.

Install

mkdir -p .claude/skills/ai-pr && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18563" && unzip -o skill.zip -d .claude/skills/ai-pr && rm skill.zip

Installs to .claude/skills/ai-pr

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Creates and updates pull requests with governance: runs the commit pipeline, enforces pre-push gates, generates structured PR body from spec, watches and fixes CI until merged. Trigger for 'open a PR', 'submit this for review', 'I am ready for review', 'merge this into main', 'draft PR', 'update the PR'. Not for commit-only flows; use /ai-commit instead. Not for narrative review; use /ai-review instead.
406 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Execute commit pipeline and pre-push gates
  • Generate structured PR bodies from specifications
  • Watch and fix CI pipeline status
  • Automate branch creation and slug generation
  • Sync documentation and architecture intent

How it works

The agent runs a multi-step pipeline that includes auto-branching, gate orchestration, and concurrent documentation updates before creating or updating a pull request.

Inputs & outputs

You give it
Code changes and spec.md specification
You get back
Pull request with governed documentation and CI validation

When to use ai-pr

  • Opening a new pull request
  • Submitting code for review
  • Merging features into main branch
  • Updating PR documentation

About this skill

PR Workflow

Governed PR creation: full commit pipeline, pre-push gates, structured PR (summary + test plan), auto-complete with squash merge and branch deletion.

Canonical chain step brainstorm → plan → build → pr: runs the commit pipeline internally, so the operator does NOT run /ai-commit first (/ai-commit is the off-chain WIP-only skill, no PR).

/ai-pr                  # full pipeline + create or update PR
/ai-pr --draft          # open as draft (no review request)
/ai-pr review           # request review on existing PR
/ai-pr update           # refresh PR body + push amended commit

Process

In order: decision preamble (resolve once), Steps 0-6b (inline commit pipeline), the concurrent docs + pre-push block (Step 8), then PR create, consolidate, and watch through Step 18.

Decision preamble (resolve once, before Step 0; later steps read, never re-decide)

FlagDetectEffect
draft?--draftskip review request, consolidation (Step 15b), watch loop
existing_pr?gh pr list --head <branch> / az repos pr list finds a PRextend, never overwrite
placeholder_spec?spec.md == # No active specskip spec ops + consolidation, fall back to label-based PR body

Steps 0-6: Inline Commit Pipeline

  1. Auto-branch from main/master: infer type (feat/, fix/, chore/, docs/, refactor/), generate slug via python3 .ai-engineering/scripts/branch_slug.py --prefix <type>, then git checkout -b <output>.
  2. Work-item context (opt): spec.md frontmatter refs → commit body trailers (Refs: AB#101, #45); only close_on_pr items, never features.
  3. Instinct consolidation: if .ai-engineering/observations/observations.yml exists, run /ai-session-watch --review before committing.
  4. Stage selectively (git add <file>...). git add -A only when explicitly requested. Exclude generated files, secrets, large binaries.
  5. Run gate orchestrator: ai-eng gate run --cache-aware --json --mode=local. The 2-wave collector (Wave 1 fixers serial → Wave 2 checkers parallel) emits .ai-engineering/state/gate-findings.json (schema v1); Wave 1 re-stages the safe S_pre & M_post intersection (D-105-09; disable via --no-auto-stage or manifest gates.pre_commit.auto_stage: false).
  6. Handle gate: exit 0 → continue. Exit non-zero → STOP, fix root cause, re-run. Publish-window override: ai-eng risk accept-all .ai-engineering/state/gate-findings.json --justification "<reason>" --spec <id> --follow-up "<plan>" (see .ai-engineering/reference/risk-acceptance-flow.md).
  7. Docs gate inside the orchestrator is mandatory; see .ai-engineering/reference/gate-policy.md for the local fast-slice + CI authoritative split.

6b. Verify gate (mandatory)

Before proceeding to commit pipeline, check whether ai-verify has run on the current changeset this session. If no verify outcome exists (no prior ai-verify dispatch on this branch), dispatch ai-verify inline and wait for completion. Log the auto-dispatch as a framework_operation. Never skip this gate — it is the safety net for direct /ai-pr invocations outside the canonical chain.

7. Concurrent dispatch — docs + pre-push gate (3 lanes)

Docs subagents and the pre-push gate run in parallel — wall-clock = max(docs, pre-push), NOT sum. Docs are produced and staged BEFORE PR creation so the description stays coherent.

  1. Read flags from .ai-engineering/manifest.yml (documentation.auto_update, external_portal).
  2. Compute diff oncegit diff main...HEAD. Pass to both docs agents.
  3. Dispatch 3 concurrent lanes, block on max(lane1, lane2, lane3):
    • Lane 1 — docs A1: /ai-docs changelog + /ai-docs readme (if enabled).
    • Lane 2 — docs A2: /ai-docs solution-intent-sync (if architecture changed) + /ai-docs docs-portal + /ai-docs docs-quality-gate. Zero uncovered items required.
    • Lane 3 — pre-push gate: dispatched concurrently here; Step 10 owns the full description. Do not restate the gate command in both places.
  4. Stage all docs files produced by lanes 1-2 BEFORE PR creation. spec-104 NG-7 forbids deferring docs to a separate commit — regulated audience requires clean audit history.

9. Pre-push gate (canonical description; concurrent Lane 3 of step 7)

ai-eng gate run --cache-aware --json --mode=local runs Wave 1 fixers (ruff formatruff check --fixspec verify --fix) in parallel with Wave 2 checkers (gitleaks protect --staged, ty check src/, pytest -m smoke, ai-eng validate, docs gate). CI uses --mode=ci (adds semgrep, pip-audit, full pytest matrix). Non-zero exit → parse gate-findings.json, report, STOP; resolve or accept via ai-eng risk accept-all (see .ai-engineering/reference/risk-acceptance-flow.md).

10. Work item context

Read .ai-engineering/manifest.yml work_items and spec.md frontmatter refs (yaml shape: features never close; user_stories/tasks/bugs/issues close on PR merge).

11. Spec operations (PR body)

If .ai-engineering/specs/spec.md is non-placeholder: read spec.md + plan.md to generate the PR description; run ai-eng spec verify --fix; update spec.md/plan.md to reflect ACTUAL scope; use the updated content for the PR body (Summary from spec, Test Plan from plan). Consolidation does NOT happen here — per D-167-07 it runs pre-merge on the feature branch in Step 15b, so the archive + slot-clear ride this same PR (no separate follow-up chore PR).

12. Work item references

If frontmatter has refs:

  • close_on_pr items (user_stories, tasks, bugs, issues): GitHub Closes #N per line; Azure AB#NNN (auto-closes on merge).
  • never_close items (features): Related: AB#100 only — NEVER close features (absolute rule).
  • No refs: fall back to spec-label-based linking.

13. Commit, push, detect VCS, find existing PR

Compose the commit subject deterministically (spec-139 M8 D-139-06): derive the description from the current .ai-engineering/specs/plan.md task title (grep -m1 '^- \[ \] ' .ai-engineering/specs/plan.md) and pass it via python3 .ai-engineering/scripts/commit_compose.py --type <type> [--task X.Y] --desc "$TASK_TITLE". --desc is mandatory; the legacy <DESC> placeholder fallback is deprecated for the PR pipeline. Push to current branch (block on main/master). Detect provider via manifest.yml providers.vcs.primary, fallback to git remote get-url origin parsing (github.comgh, dev.azure.comaz repos). Find existing PR with gh pr list --head <branch> or az repos pr list --source-branch <branch>.

14. Create or update PR

Runs after the 3-lane block resolves so the body is coherent (CHANGELOG/README staged, gate passed). Compose body deterministically: python3 .ai-engineering/scripts/pr_body_compose.py reads .ai-engineering/specs/spec.md frontmatter (summary: field — mandatory per spec-139 M8 D-139-06 after the 2026-06-16 cutover) plus plan.md [ ] rows and emits Summary, Test Plan, Work Items, Checklist sections.

  • summary: present → Summary composed without any LLM call.
  • Legacy specs lacking the field fall back to --bullets-prompt "<llm-bullets>" plus an advisory to backfill summary:. Do NOT pass --bullets-prompt when the spec already declares summary:.
  • The PR body (## Summary and every composed section) is a deterministic machine artifact — a carve-out emitted exactly as pr_body_compose.py renders it. The value lens applies only to the operator-facing status report (Step 16), never to the PR body, commit messages, or gate verdicts.

New: gh pr create --title "<t>" --body "<b>" or az repos pr create --source-branch <b> --target-branch <t> --title "<t>" --description "<b>".

Existing (extend, NEVER overwrite): read existing body; if ## Additional Changes exists, append a ### <date> / <commit-range> sub-heading underneath; otherwise append \n\n---\n\n## Additional Changes first. Update via gh pr edit or az repos pr update.

14b. Consolidate on the feature branch (pre-merge, D-167-07)

Runs after Step 15 (PR number N known), before Step 16 auto-complete; skip for --draft (a draft is not merging — consolidate on promotion, else it sits SHIPPED while open). If .ai-engineering/specs/spec.md is non-placeholder, resolve the numeric id from its frontmatter spec: (canonical spec-NNN, not the slug — D-153-01) and run python .ai-engineering/scripts/spec_lifecycle.py mark_shipped <spec-NNN> N <branch> directly — NOT via _shared/consolidate-spec.md, whose SHIPPED-precondition guard would reject the still-IN_PROGRESS pre-merge spec (marking it SHIPPED as the ship-PR opens is the intent). It walks state→SHIPPED, appends the 7-col _history.md row, snapshots spec.md+plan.md into archive/spec-NNN-<slug>/, clears both to placeholders, and emits the audit event. Then git add the archived+cleared files, commit chore(spec-NNN): consolidate (archive + clear live slot), and push so the open PR updates. Fail-open: a write failure logs, never blocks. Consolidation rides the PR regardless of gh/az/web-UI merge — no separate chore PR; the same handler stays manual via /ai-pr --consolidate-spec, and /ai-branch-cleanup reconcile_merged is now a no-op backstop.

15. Board sync + enable auto-complete

For new PRs with refs: invoke /ai-board sync in_review <ref> for each non-never_close ref (fail-open: never block on failure). Then enable auto-complete: gh pr merge --auto --squash --delete-branch or az repos pr update --id <id> --auto-complete true --squash true --delete-source-branch true.

16. Watch and fix until merge

Auto-complete only queues the merge — CI must pass first. The Step 15b consolidation commit is already on the branch, so the CI run the loop watches is the FINAL commit set — and it runs against the idle # No active spec slot (D-167-07); every spec.md-


Content truncated.

When not to use it

  • Not for commit-only flows
  • Not for narrative review

Prerequisites

gitleaks

Limitations

  • Requires spec.md for structured PR body generation
  • Requires specific gate orchestrator exit codes
  • Requires clean audit history for documentation

How it compares

Unlike manual PR creation, this skill enforces a mandatory commit pipeline and pre-push security gates to ensure code quality before submission.

Compared to similar skills

ai-pr side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
ai-pr (this skill)09dNo flagsAdvanced
update-major-deps01moNo flagsAdvanced
github-actions-templates73moNo flagsIntermediate
toolhive-release13moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by arcasilesgroup

View all by arcasilesgroup

ai-docs

arcasilesgroup

Manages the documentation lifecycle: CHANGELOG, README, solution-intent architecture docs, external docs portals, and documentation quality gates. Auto-invoked by /ai-pr. Trigger for 'update the changelog', 'the README is stale', 'document this feature', 'docs portal needs updating', 'did we documen

00

ai-code

arcasilesgroup

Writes production code that satisfies stack-context standards on the first pass: interface-first design, backward-compatibility checks, lightweight self-review. Trigger for 'implement this', 'write the code for', 'add X to Y', 'build this function', 'make this work'. Not for tests; use /ai-test inst

00

ai-learn

arcasilesgroup

Extracts lessons from merged PR review feedback by analyzing what reviewers caught, identifying missed checks, and writing entries directly to LESSONS.md. Trigger for 'the AI keeps doing X wrong', 'learn from this PR', 'what patterns did reviewers catch', 'update our standards from feedback'. Not fo

00

ai-media

arcasilesgroup

Generates images, videos, and audio via AI models (fal-ai MCP): cheap iteration models, expensive production finals, cost-estimate before generation. Trigger for 'generate an image', 'create a thumbnail', 'make a voiceover', 'AI video', 'text to speech for'. Not for design composition; use /ai-visua

00

ai-issue

arcasilesgroup

Creates a project work-item (issue / task / story) on the user's configured board: routes by manifest `work_items.provider` (GitHub Projects v2 or Azure DevOps), composes title + body + labels, attaches to the active board, and confirms a clickable link. Trigger for 'open an issue', 'file a bug', 'c

00

ai-design

arcasilesgroup

Designs user interfaces and design systems for web, mobile, CLI, and documentation-heavy experiences: aesthetic direction, color palettes, typography, spatial composition, information architecture. Trigger for 'design this page', 'create a design system', 'what style should we use', 'UI for this fea

00

Search skills

Search the agent skills registry