brainstorm
Runs a structured design conversation — clarifies intent, proposes 2-3 approaches with trade-offs, iterates the design — and…
Creates or updates a pull request (GitHub) or merge request (GitLab) for the current branch in the Conventional PR format — intent, summary, changes, rationale, and test plan. Pushes the branch if needed (asks before any force-push) and captures the implementation conversation's
Claude Code
$ npx -y skills add oprogramadorreal/optimus-claude --skill pr --agent claude-code
Codex
$ npx skills add oprogramadorreal/optimus-claude --skill pr -a codex -y
Cursor
$ npx skills add oprogramadorreal/optimus-claude --skill pr -a cursor -y
Gemini CLI
$ npx skills add oprogramadorreal/optimus-claude --skill pr -a gemini-cli -y
GitHub Copilot
$ npx skills add oprogramadorreal/optimus-claude --skill pr -a github-copilot -y
OpenCode
$ npx skills add oprogramadorreal/optimus-claude --skill pr -a opencode -y
Windsurf
$ npx skills add oprogramadorreal/optimus-claude --skill pr -a windsurf -y
description: Creates or updates a pull request (GitHub) or merge request (GitLab) for the current branch in the Conventional PR format — intent, summary, changes, rationale, and test plan. Pushes the branch if needed (asks before any force-push) and captures the implementation conversation's intent into the PR description. Use when a feature branch is ready for review or to refresh an existing PR/MR description. disable-model-invocation: true
This skill never commits working-tree changes — it only pushes existing commits and manages the PR/MR.
If `git rev-parse --is-inside-work-tree` does not return `true`, read `$CLAUDE_PLUGIN_ROOT/skills/init/references/multi-repo-detection.md` and apply it. When it returns `true`, resolve the repository root with `git rev-parse --show-toplevel`, including in a linked worktree or subdirectory. In a detected workspace:
**Verify git state** (stop gates):
1. Not inside a git repository → inform the user and stop. 2. Default-branch detection (reference above) fails → "Could not detect the default branch. Ensure `origin` is configured and has been fetched." Stop. 3. On the default branch → "You're on the default branch (`<branch>`). Switch to a feature branch first." Stop.
Read `$CLAUDE_PLUGIN_ROOT/skills/pr/references/platform-detection.md` and apply the **Platform Detection Algorithm**. Unknown platform → inform the user and stop.
Apply the reference's **CLI Verification** section. If the CLI is missing, offer to install it per its **CLI Installation** section (ask: **Install** / **Cancel**). On Cancel or install failure → provide manual installation instructions and stop. Installed but unauthenticated → "Run `gh/glab auth login` to authenticate, then re-run `/optimus:pr`." Stop.
If the branch is not on the remote (`git ls-remote --heads origin <branch>`): with no commits on the branch → "No commits on this branch yet. Commit your changes first." Stop. Otherwise `git push -u origin <branch>`.
If the branch is on the remote with unpushed commits, check divergence first: `git rev-list --count HEAD..origin/<branch>`
Check for an existing PR/MR:
Open PR/MR → save its `baseRefName` / `target_branch` as the **target branch** and go to Step 6 (Update Flow). Closed/merged or none → Step 5 (Create Flow).
Default branch: on GitHub, `gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'` is authoritative over Step 1's local detection (local `origin/HEAD` may be stale); on GitLab, use Step 1's detection.
Gather the branch's commits and diff vs `origin/<default-branch>`. No commits ahead → "This branch has no changes compared to `<default-branch>`." Stop.
Classify into one of three states before generating content:
1. **Conversation context** — this conversation implemented the branch: Edit/Write/NotebookEdit calls touched files in the diff, or the conversation discussed the problem, design decisions, or non-goals. A `## TDD Summary` block with `### Behaviors Implemented` (literal, case-sensitive — emitted by `/optimus:tdd`) is a strong state-1 signal; apply the population rule below. 2. **Existing PR body has `## Intent`** (Update Flow only — see the detection rule in the template). 3. **None** — when uncertain, prefer this state over fabricating. Ask (AskUserQuestion "Intent capture"): **Add intent now** → have the user reply with Problem / Scope / Non-goals / Key decisions on separate lines in a plain message (blank lines skip a sub-field); **Skip** → omit the section entirely, no stub.
Suppress the state-3 prompt in states 1 and 2.
Read `$CLAUDE_PLUGIN_ROOT/skills/pr/references/pr-template.md` and generate a title and body. Populate `## Intent` from the conversation (state 1) or the user's reply (state 3), including only sub-fields the source actually answers.
**TDD Summary population rule** — when a `## TDD Summary` block is present, fill the body from the summary block:
Runs a structured design conversation — clarifies intent, proposes 2-3 approaches with trade-offs, iterates the design — and…
Reviews local changes, an open PR/MR, or a branch diff for bugs, security issues, and violations of the project's own coding…
Stages, commits, and optionally pushes local changes with a Conventional Commits message — always previews and confirms first,…
Runs an iterative auto-fix loop on a chosen target — review, refactor, or coverage — dispatching the base skill into fresh…
Prunes and consolidates the project's auto-memory to keep it minimal — deletes stale, wrong, or redundant memories, merges…
Runs a Gauntlet Loop: turns an ambitious goal into a builder/critic prompt judged against a concrete quality bar, confirms with…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.