Workflow Slash Commands
OpenCode Multi-Agent ships with a suite of high-leverage workflow slash commands.
Command Overview
| Command | Category | What it does |
|---|---|---|
/prd <topic> | SDD Lifecycle | Scaffold & draft Product Requirements Document in docs/prd/ |
/adr [new|supersede|tree|check|migrate|mode] | Architecture | Architecture Decision Record management: automated drafting, supersede lifecycle, DAG graph, link audits, bidirectional migrations & hierarchy mode switches |
/adr compaction · /adr context · /adr check --compaction | ADR | Read-only analysis; explicit summary/consolidation with native cost/review Ask, bounded retrieval and optional archive/restore. See ADR compaction. |
/plan <topic> | SDD Lifecycle | Scaffold & draft phased Implementation Plan in docs/plan/ with automatic PRD & ADR linking |
/impl [task] | SDD Lifecycle | Execute test-driven code implementation & verification adhering to specifications |
/sdd [status|handoff|help] | SDD Lifecycle | Specification-Driven Development lifecycle navigator & session handoff (/sdd handoff) |
/grill-me <topic> | Brainstorming | Socratic interview that rigorously pressure-tests a plan or design |
/dev <requirement> [--plan] [--sdd[="prd,adr,plan"]] [--plan-review[=1|2]] [--code-review[=1|2]] [--qa] [--fast] [--max-rounds=N] [--auto-advisor[=full|lite|off]] | Dev Flow | Dev Compositor: single-pass pipeline engine — spec depth (--plan / --sdd), plan review, code review (1|2), and QA flags compose your pipeline; --auto-advisor overrides the advisor mode for this run only (bare = full); presets dev-quick/dev-plan/dev-review are fixed flag sets over this engine (see /dev Compositor) |
/dev-quick <task> [--review] [--max-rounds=N] | Dev Flow | Quick-Dev Zero-Review Fast Track: Lowest-cost Flash-tier coding + dynamic domain persona injection (instant delivery; optional --review triggers single audit, alias /dev-flash; no-depth-flag preset of /dev — see Five Dev Flows) |
/dev-plan <requirement> [--review] [--max-rounds=N] | Dev Flow | Plan-Dev Plan-First Development: Socratic clarification + architect plan + domain-routed implementation, with optional single review on demand (--plan preset of /dev, see Five Dev Flows) |
/dev-review <task> [--max-rounds=N] | Dev Flow | Review-Dev Mission-Critical Dual-Review Loop: Domain-routed coding + dual flagship review + Advisor consensus arbitration with full-stack multi-stage staging (--code-review=2 preset of /dev, see Five Dev Flows) |
/dev-ultra <objective> [--max-rounds=N] [--max-phases=N] | Dev Flow | Ultra-Dev Autonomous Multi-Phase Track: End-to-end autonomous execution — decomposes large objectives into phases, each with tiered review, context compaction, git-commit isolation, one max final gate, and --resume support (see Five Dev Flows) |
/dev-prud <requirement> [--top=N] [--max-rounds=N] | Dev Flow | FMEA-front-loaded development: Socratic clarification + pre-implementation risk register (SEV×PROB ranked, top-N) that drives planning, implementation, and register-audited verification (see Prudent Development) |
/dev-deep <requirement> [--auto] [--retry=N] [--budget=N] [--resume] | Dev Flow | Deep-Dev Mine-First Deep-Task Track: for requirements too vague to write acceptance criteria (code OR analysis) — 6-part requirement mining → gated task-tree planning → node-wise execution with fixed retry/replan brakes → delivery with audit trail & recovery card; --resume[=<slug>] continues from per-task checkpoints .ocp/dev-deep/<slug>.md — parallel-run safe (see Deep-Task Protocol). Standalone protocol, NOT a /dev preset |
/review-fix-loop [scope] [--max-rounds=N] | Quality Loop | Automated review-verify-fix-re-review loop until zero P0/P1 issues. Scope: last commit, HEAD~N, branch, PR, or uncommitted changes |
/clean-dead-code [changes|commit <ref>|<base>..<head>|pr <n|url>|all] [--focus=..] [--cats=..] [--paths=..] [--exclude=..] [--report-only] [--approve=R1,R2] | Quality Loop | Evidence-graded dead-code sweep & cleanup — scans uncommitted changes, a commit/PR/range, or the whole project; --focus "payment checkout" (or trailing free text) narrows findings to one feature's code area. Natural-language arguments are fine — prose intent (scope, focus, even flags) is normalized and confirmed once before anything runs. Covers unused declarations, unreachable code, orphan files, unused deps, dead config, orphan resources. Report first; the user approves every deletion and every uncertain finding. Deletions land as small verifiable, individually revertible batches |
/git-merge <source> <target> [--dry-run] [--no-verify] [--squash] [--no-ff] [--continue] [--abort] | Git Workflow | Stock git merge, agent as the resolver: syncs target to origin (--ff-only; divergence halts), guard-backs up, then merges — git auto-merges everything it can, and only conflicted files get hands-on semantic resolution with target HEAD as the authoritative baseline. One clean commit → --squash; otherwise no flag (merge commit keeps both sides' topology) |
/git-pick <source> <target> <commit>... [--all] [--dry-run] [--no-verify] [--continue] [--skip] [--abort] | Git Workflow | Stock git cherry-pick, agent as the resolver: copies selected commits — or with --all every non-merge commit unique to source — in reverse topological order, resolving per commit against target as the baseline. Each result is a new ordinary commit (never a merge commit); source history is unchanged |
/git-rebase <source> <target> [--dry-run] [--no-verify] [--continue] [--skip] [--abort] | Git Workflow | Stock git rebase, agent as the resolver: replays all of source's unique commits onto target's HEAD for a linear history — syncs target, guard-backs up both tips, resolves each stopped commit semantically, then fast-forwards target. Rewrites source: updating an already-pushed source needs git push --force-with-lease, your call |
/git-pull [--rebase] [--dry-run] [--no-verify] [--abort] | Git Workflow | Safe upstream sync for the current branch: git pull --ff-only first, rewriting nothing; diverged → guard backup, then delegate to the git-merge protocol with the fetched upstream as source. --rebase replays local commits onto the remote tip instead. No --squash — squashing published branch history is never legitimate |
/git-push [--rebase|--merge] [--dry-run] [--no-verify] [--force-with-lease] [--abort] | Git Workflow | Safe push for the current branch: fetches the configured upstream and tries ordinary git push; a confirmed non-fast-forward rejection → guard backup, reconcile through merge or rebase, verify, and retry. Auth, policy, hook, network, and semantic conflicts halt; plain --force is forbidden |
/improve-loop [subject] [--max-rounds=N] [--target=N] | Score Loop | Score-driven improvement loop: score → analyze → fix/refactor → verify → re-score until structural ceiling, stall, or max rounds. Triggers verification-honesty scoring (Rules 5–7) every round |
/goal [text] | Goal Execution | Structured goal execution protocol with audit-friendly checklists and mechanically checkable stop conditions |
/handoff [focus] | Session State | Compacts current session state into a git-safe handoff bundle (.ocp/handoffs/) and outputs a paste-ready opener for a fresh session |
/adr guard [on|off|reset|status](别名 /adr-guard) | Quality Gate | Project-level ADR commit gate: enforces architecture decision records on feat: and refactor: commits |
/e2e-adopt [dry|status] | Quality Governance | Adopts the E2E red-line policy into project docs (docs/e2e-redline.md + AGENTS.md section): risk-graded tiers, ask-before-E2E confirmation loop, coverage mandate — docs governance, no runtime gate |
/env-guard [on|off|status] | Security Gate | Project-level secret leak prevention: blocks reading or leaking .env files to external tools |
/deepseek-anchor [on|off|status] | Model Engine | DeepSeek V4/Pro reasoning depth anchor: prevents reasoning degradation and gates tools during deliberation |
/auto-advisor [off|lite|full] | Intelligence | Toggle auto-advisor mode (off, lite recommendations, full factual auto-answers) |
/md-to-pdf <file.md> [output.pdf] | Publishing | Export Markdown to high-res A4 PDFs with 300 DPI Mermaid diagrams, CSS themes & --doctor diagnostics |
/md-to-docx <file.md> [output.docx] | Publishing | Export Markdown to publication-grade Word (.docx) with pure TS engine, dual fonts & Mermaid rendering |
/project (or init/index/sync subcommand) | Project Setup | init|index|sync subcommands scaffold project baseline files (.ocp/ocp.json etc.) and trigger CodeGraph / GitNexus indexing. Bare /project opens the interactive wizard menu (toggles MCP services & plugins via visual terminal UI) |
/memory [note|status|on|off] (+ /memory-summarize [focus]) | Project Memory | Project-level memory in two scopes: /memory note "<lesson>" writes to .ocp/memory/public.md (committed, PR-reviewed); --private writes to private.md (gitignored, current-user-only). The LLM can also call the memory_note tool when it discovers a reusable rule — that tool defaults to private (ADR-2.0.2#01), so team-shared entries need an explicit scope: "public". /memory status also warns when public.md would not reach the team — both when it is git-ignored (can never ship) and when it is merely untracked (passes every ignore check, still local until someone stages it). /memory-summarize [focus] reviews the current session and writes durable lessons. Both files inject under [PROJECT MEMORY] (AGENTS.md authoritative). 16k-char cap per section → pointer block. |
/profile | TUI Wizard | Open model profile picker: easily switch or customize Auto / Ultimate / Performance / Economy / Lightweight tiers |
/provider | TUI Wizard | Open provider wizard: configure credentials (baseURL / apiKey) and manage model catalogs |
/disconnect [id|--all] | TUI Wizard | Disconnect a provider credential — bare opens the connections wizard; <id> jumps straight to confirm; --all asks once for every connection |
/usage [session|agent|model|all] | Observability | Token/cost usage with tabbed dimensions (session / agent / model) — 1/2/3 or ←→ to switch, ↑/↓ to scroll |
The five
/git-*commands share one doctrine: preflight halts instead of cleaning up after you,--ff-onlytarget sync where applicable,guard/backups, baseline-first conflict resolution, a per-hunk confidence self-check that escalates to@advisorand hands uncertain hunks to you rather than guessing, verify-once honesty, and a redacted hash-chained audit trail in.git/ocp-*-reports/on every invocation. Full doctrine, flag matrix and failure catalog: Git Workflows.
Example: review-fix-loop
> /review-fix-loop last commit
→ @code-review-fast finds P0/P1 issues; qualifying L3 routes add one compact capability-selected graph evidence pass before @code-review
→ Verifies each finding (reads code, traces data flow, checks upstream guards)
→ If false positive → skipped only after @advisor confirms
→ If confirmed BUG → @<domain-dev> fixes each verified issue
→ @code-review-fast re-reviews; the final Cleared gate uses max @code-review
→ Repeats until clean or max rounds reached (default: 5)
→ Summary output: verdict + stats
> /review-fix-loop HEAD~3 --max-rounds=8
→ Same flow, up to 8 rounds (good for larger diffs)