CommandsTutorialFeatures
Merlin AI Code Review

Deep Dive: Merlin AI Code Review's 19 Slash Commands and When to Use Each

March 14, 2025·10 min read·Merlin AI Code Review Team

Merlin AI Code Review ships with 19 slash commands that cover the full spectrum of code review automation. Beyond the basic /review, each command is purpose-built for a specific scenario. Here's when and why to use each one.

Core review commands

/review

The foundational command. Runs a full AI code review on the current PR, posting inline comments with severity ratings and a summary. Triggered automatically on PR open if configured in CI; trigger manually to re-review after changes.

text
@merlin /review

/security

A dedicated security-focused pass: OWASP top-10, secret detection, insecure cryptography, authentication bypasses, SSRF. Run this on every PR targeting main/release branches, or automatically in CI alongside /review.

/approve

AI-assisted verdict. Re-reviews the PR in its current state and posts either an approval (if no blocking issues remain) or a request for changes (listing remaining issues). Useful as a final check before merging.

Documentation commands

/describe

Generates a structured PR title and description based on the diff. Includes: what changed, why it changed, and what reviewers should focus on. Run on PRs where authors skipped writing a description.

/add_doc

Generates docstrings/comments for changed public functions and posts them as GitHub suggestion blocks. One-click to apply. Run before merge to enforce documentation standards without manual effort.

/docs [mode]

Full documentation generation. Modes: readme, api, adr (Architecture Decision Record), module, wiki, auto (auto-detects appropriate format).

text
@merlin /docs readme # update README
@merlin /docs adr # generate an ADR for this change
@merlin /docs api # generate API documentation

Code improvement commands

/improve [focus]

Suggests code improvements as GitHub suggestion blocks — ready to apply with one click. Optionally focus on a specific area:

text
@merlin /improve # general improvements
@merlin /improve error handling # focus on error handling
@merlin /improve performance # focus on performance

/test

Generates unit tests for changed code. Posts them as a PR comment — copy-paste or adapt to your test framework. Run when a PR adds logic without corresponding tests.

/coverage

Analyses which files changed in the PR lack test coverage. Posts a summary highlighting uncovered code paths. Useful for enforcing coverage standards before merge.

Understanding commands

/explain [target]

Explains what the PR does in plain English. Pass an optional file or function name to focus the explanation.

text
@merlin /explain # explain the whole PR
@merlin /explain src/auth/jwt.rs # explain a specific file

/ask <question>

Ask any question about the PR diff. Merlin AI Code Review answers with a PR comment using context from the diff and (if RAG enabled) the wider codebase.

text
@merlin /ask Is this change thread-safe?
@merlin /ask Why does this function return early on line 42?
@merlin /ask What are the performance implications of this approach?

Project management commands

/generate_labels

Auto-generates and applies labels based on diff content and PR size. Labels like security, breaking-change, tests, documentation, size/large.

/update_changelog

Prepends a changelog entry to CHANGELOG.md in conventional format and commits it. Run before merging feature PRs to maintain an up-to-date changelog automatically.

/commit_message

Generates three conventional commit message options for the PR. Useful for squash merges where a clean commit message matters.

/similar_issue

Finds open issues in the same repo similar to the changes in this PR and posts a table. Useful for catching duplicate work or linking PRs to tracked issues.

Integration commands

/snyk

Scans changed dependencies against the Snyk vulnerability database. Requires SNYK_TOKEN env var.

/link_jira

Finds related Jira issues and posts links as a PR comment. Useful for teams that track work in Jira and want automatic cross-linking.

/link_linear

Finds related Linear issues and links them. For Linear-using teams, this replaces manual issue linking.

/triage

Finds similar open issues on CodeTriage for the changed packages. Useful for open-source maintainers assessing whether a PR addresses tracked community issues.