code-review
Reviews local changes, an open PR/MR, or a branch diff for bugs, security issues, and violations of the project's own coding…
Runs a structured design conversation — clarifies intent, proposes 2-3 approaches with trade-offs, iterates the design — and writes a user-approved engineering spec to docs/specs/ that /optimus:tdd auto-detects. No implementation happens until the spec is approved. With the
Claude Code
$ npx -y skills add oprogramadorreal/optimus-claude --skill brainstorm --agent claude-code
Codex
$ npx skills add oprogramadorreal/optimus-claude --skill brainstorm -a codex -y
Cursor
$ npx skills add oprogramadorreal/optimus-claude --skill brainstorm -a cursor -y
Gemini CLI
$ npx skills add oprogramadorreal/optimus-claude --skill brainstorm -a gemini-cli -y
GitHub Copilot
$ npx skills add oprogramadorreal/optimus-claude --skill brainstorm -a github-copilot -y
OpenCode
$ npx skills add oprogramadorreal/optimus-claude --skill brainstorm -a opencode -y
Windsurf
$ npx skills add oprogramadorreal/optimus-claude --skill brainstorm -a windsurf -y
description: >- Runs a structured design conversation — clarifies intent, proposes 2-3 approaches with trade-offs, iterates the design — and writes a user-approved engineering spec to docs/specs/ that /optimus:tdd auto-detects. No implementation happens until the spec is approved. With the scaffold argument, creates docs/product/ steering skeletons instead (never overwrites, authors no content). Recommends /optimus:init first. disable-model-invocation: true argument-hint: "[topic, JIRA key, or scaffold]"
Guide the user through a design conversation that produces a written, approved spec before any implementation begins.
**The hard gate: no implementation until the design is approved.** Do not invoke an implementation skill, write production code, or scaffold project structure until a spec is written and the user has approved it — even for seemingly simple tasks.
Resolve the target repo first: 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 — in a workspace, operate in the repo the user targets, asking which if ambiguous. Otherwise use `git rev-parse --show-toplevel`, including in a linked worktree or subdirectory. Both modes resolve paths from that root.
When invoked with the `scaffold` argument, or when the user asks to set up the docs-first steering cascade, run this flow instead of the design conversation:
1. Scaffold in the resolved repo root — a cascade outside the target repo never auto-loads as steering. 2. For each of `docs/product/product-context.md`, `mvp-prd.md`, and `tech-stack.md`: if it exists, never overwrite — skip it. If missing, copy the matching file from `$CLAUDE_PLUGIN_ROOT/skills/brainstorm/templates/product/` verbatim, creating `docs/product/` if needed. Write nothing else — no `docs/specs/` file (the design flow authors that later), nothing under `.claude/`. 3. **Emit skeletons with TODO markers only — author no product content (no personas, KPIs, business-value prose, or technology choices) and never fill a TODO; that is the human's job.** 4. Report created vs skipped files. Tell the user to fill the TODOs top-down (vision → MVP PRD → target stack), then run `/optimus:brainstorm` in a fresh conversation to design the first build.
If `.claude/CLAUDE.md` or `.claude/docs/coding-guidelines.md` is missing, recommend `/optimus:init` first; on the user's choice, continue with general best practices.
Load `.claude/CLAUDE.md` and `.claude/docs/coding-guidelines.md`, plus — only if present — the steering cascade `docs/product/product-context.md`, `mvp-prd.md`, and `tech-stack.md`. Steering informs the design; it is never the task itself or content to copy. Authoring boundary and precedence: `$CLAUDE_PLUGIN_ROOT/references/sdd-mapping.md`. In a monorepo, load the subproject's own `docs/` files (testing, architecture, styling) and shared guidelines from the root `.claude/docs/`.
Scan the project's directory structure, key modules, and existing patterns to ground the conversation in what actually exists.
Check for JIRA context before prompting the user:
1. Inline input containing a key matching `[A-Z][A-Z0-9]+-\d+` whose `docs/jira/<key>.md` exists → use that file's Goal and Acceptance Criteria as the brainstorm input. If the whole input is a bare key (`^[A-Z][A-Z0-9]+-\d+$`) with no such file, tell the user to run `/optimus:jira <KEY>` first, then gather intent normally. 2. No inline input and `docs/jira/` contains `.md` files → pick the one with the newest frontmatter `description-refresh-date` and offer it via AskUserQuestion (Use it / Ignore), noting when that date is over 7 days old that re-running `/optimus:jira` refreshes it. **Use it** consumes the file's Goal and Acceptance Criteria and skips the prompts below.
Otherwise use the inline description; if none, ask what to build or change. Distill input longer than ~3 sentences into a single-sentence goal and confirm it with the user.
Surface your key assumptions about scope, constraints, and expected behavior in reply text before the first clarifying question. Then ask at most 3 clarifying questions — a maximum, not a target; one per AskUserQuestion call, preferring multiple-choice — and skip them entirely when intent is already clear.
Explore the code the design will touch: relevant modules and conventions, dependencies and integration points, related tests. Then present 2-3 approaches (a third only if genuinely distinct), each with a name, a 2-3 sentence description, pros/cons, effort (Low / Medium / High), and alignment with existing patterns — plus a recommendation with a one-sentence rationale.
The user selects via AskUserQuestion, one option per approach with the recommendation marked. If they want to combine aspects or redirect, incorporate the feedback and present a revised approach before proceeding.
Develop a detailed design covering the spec template sections in Step 5, omitting those that don't apply. Include Scenarios when any signal applies — JIRA Acceptance Criteria, an intent naming a user-visible flow (end-user, cross-team, or regulatory), or clarifying answers describing observable outcomes — and omit them for internal refactors, infrastructure changes, and developer-only tooling. When including them, first read `$CLAUDE_PLUGIN_ROOT/skills/brainstorm/references/scenario-style.md` for Given/When/Then discipline — `/optimus:tdd` consumes each scenario as one Red-Green-Refactor cycle.
Present the design in conversation and iterate through an Approve / Adjust AskUserQuestion until the user approves.
Write to `docs/specs/YYYY-MM-DD-<topic-slug>.md` (lowercase hyphenated slug from the goal, max 5 words, matching `[a-z0-9]+(-[a-z0-9]+)*`; create `docs/specs/` if needed). If the file already exists, ask the user whet
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…
Compacts the current conversation into one self-contained, tool-agnostic handoff document at docs/handoffs/<slug>.md so any fresh…
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.