.agents/commands/comet/send-code-review-slack.md
Command: cursor send-code-review-slack
Send a formatted Slack message to the #code-review channel with PR information, Jira ticket, test environment link, and optional component summaries (FE, BE, Python, TypeScript). Automatically extracts information from the GitHub PR for the current branch.
This workflow will:
ghcr.io/korotovsky/slack-mcp-server)[OPIK-1234]) or prompted if not foundghcr.io/korotovsky/slack-mcp-server)
SLACK_MCP_XOXP_TOKEN (User OAuth Token) to post messages as your authenticated user account.agents/docs/SLACK_MCP_SETUP.md for complete setup instructionsget_file_contents for comet-ml/opik
If unavailable, respond with: "This command needs GitHub MCP configured. Set MCP config/env, run
make cursor(Cursor) ormake claude(Claude CLI), then retry."
Stop here.
channels_list to test availability (from ghcr.io/korotovsky/slack-mcp-server)limit: 1) so that both public and private channels can be returnedSLACK_MCP_XOXP_TOKEN (User OAuth Token) to post messages as your authenticated user accountmcp-server --transport stdio in the Docker args and have the conversations_add_message tool enabled (e.g., via SLACK_MCP_ADD_MESSAGE_TOOL=true) so the final send step can succeed"Slack MCP is not available. Please configure Slack MCP according to
.agents/docs/SLACK_MCP_SETUP.mdand restart Cursor IDE." Stop here.
comet-ml/opik"No open PR found for this branch. Please provide the PR link manually:"
Extract Jira ticket from PR title:
[OPIK-\d+] or [issue-\d+] or [NA]OPIK-1234 from [OPIK-1234] [BE] feat(api): add trace request validation endpoint)OPIK-\d+ patternhttps://comet-ml.atlassian.net/browse/{TICKET} (e.g., https://comet-ml.atlassian.net/browse/OPIK-1234)Extract Baz approved status (optional):
Extract test environment link from PR description and comments:
gh api, always use --paginate to ensure all results are fetched:
# Issue comments (general PR comments, including deployment bot messages)
gh api repos/comet-ml/opik/issues/{pr_number}/comments --paginate
# Review comments (inline code comments)
gh api repos/comet-ml/opik/pulls/{pr_number}/comments --paginate
Why pagination is required: GitHub API returns 30 items per page by default. Opik PRs regularly exceed this — 17 CI test group comments + deployment bot comments + reviewer comments can push past 30 total. Without
--paginate, the deployment bot comment with the test environment link may end up on page 2 and get silently missed.
https://pr-XXXX.dev.comet.com or https://test.opik.com)https://pr-*.dev.comet.com, https://test.opik.com, https://*.opik.com, or any https:// URLExtract component summaries from PR description:
FE summary:
[FE] tag in PR descriptionBE summary:
[BE] tag in PR descriptionPython summary:
TypeScript summary:
[TS] tag in PR descriptionStore extracted information: Keep all extracted and prompted values for message formatting
"Would you like to customize the message? (Enter any additional text to prepend/append, or press Enter to use default message):"
Use PR link: Use the PR URL extracted from Step 2 (or provided manually)
Build message text according to the template:
Hi team,
Please review the following PR:
{{user_customization_text_if_provided}}
:jira_epic: jira link: {{Jira_URL}}
:github: pr link: {{PR_link}}
:test_tube: test env link: {{test_env}}
{{baz_approved_status_if_available}}
:react: fe summary (optional): {{description_in_one_line}}
:java: be summary (optional): {{description_in_one_line}}
:python: python summary (optional): {{description_in_one_line}}
:typescript: typescript summary (optional): {{description_in_one_line}}
Message structure:
https://comet-ml.atlassian.net/browse/OPIK-1234)Only include optional fields that were provided (skip empty ones)
Format example:
Hi team,
Please review the following PR:
:jira_epic: jira link: https://comet-ml.atlassian.net/browse/OPIK-1234
:github: pr link: https://github.com/comet-ml/opik/pull/1234
:test_tube: test env link: https://test.opik.com
:react: fe summary (optional): Added new metrics dashboard UI
:java: be summary (optional): Implemented metrics aggregation endpoint
:typescript: typescript summary (optional): Added TypeScript SDK support for metrics
Note about videos: Slack has limitations on sending videos directly. Videos should be added to the PR description, and the link can be shared in Slack. For easier communication with the product team, consider using the cursor generate-code-review-slack-command command to generate a copiable Slack command that you can edit before sending (allowing you to add @ mentions, media links, and final proof editing).
conversations_add_message from ghcr.io/korotovsky/slack-mcp-serverSLACK_MCP_XOXP_TOKEN (User OAuth Token) configured according to .agents/docs/SLACK_MCP_SETUP.mdmcp-server --transport stdio in the Docker args (required for MCP protocol)SLACK_MCP_ADD_MESSAGE_TOOL=true environment variable (required to enable the tool - disabled by default for safety)channel_id: #code-review (channel name starting with # or channel ID)payload: The formatted message text (the complete message with all fields)content_type: text/markdown (optional, defaults to text/markdown)conversations_add_message tool is disabled by default. Add SLACK_MCP_ADD_MESSAGE_TOOL=true to Docker args and restart Cursor (see .agents/docs/SLACK_MCP_SETUP.md)SLACK_MCP_XOXP_TOKEN configuration (should start with xoxp-) - see .agents/docs/SLACK_MCP_SETUP.md#code-review exists and you have accesschat:write scope is configured in User Token Scopes (see .agents/docs/SLACK_MCP_SETUP.md)ghcr.io/korotovsky/slack-mcp-server:latest.agents/docs/SLACK_MCP_SETUP.md and Cursor IDE has been restartedDisplay confirmation:
"✅ Slack message sent successfully to #code-review channel"
Show message preview: Display the formatted message that was sent
Provide next steps: Remind user to check Slack channel for delivery
.agents/docs/SLACK_MCP_SETUP.mddocker --version)docker pull ghcr.io/korotovsky/slack-mcp-server:latestconversations_add_message tool is available from ghcr.io/korotovsky/slack-mcp-servermcp-server --transport stdio is included in Docker args (see .agents/docs/SLACK_MCP_SETUP.md)SLACK_MCP_ADD_MESSAGE_TOOL=true is set in Docker args (see .agents/docs/SLACK_MCP_SETUP.md)SLACK_MCP_XOXP_TOKEN configuration (should start with xoxp- for user token) - see .agents/docs/SLACK_MCP_SETUP.mdchat:write scope in User Token Scopes (not Bot Token Scopes) - see .agents/docs/SLACK_MCP_SETUP.mddocker psdocker pull ghcr.io/korotovsky/slack-mcp-server:latest#code-review existschat:write scope in User Token Scopes (see .agents/docs/SLACK_MCP_SETUP.md)OPIK-1234) and re-promptThe command is successful when:
SLACK_MCP_XOXP_TOKEN (User OAuth Token)conversations_add_message MCP tool (posts as user account)ghcr.io/korotovsky/slack-mcp-server) for sending messages
.agents/docs/SLACK_MCP_SETUP.mdSLACK_MCP_XOXP_TOKEN (User OAuth Token) - messages are posted as your authenticated user accountconversations_add_message tool with channel_id and payload parameterschannels_list tool to verify MCP availabilitymcp-server --transport stdio in Docker args for proper MCP protocol communicationSLACK_MCP_ADD_MESSAGE_TOOL=true to enable the toolxoxp- and requires chat:write scope in User Token Scopes#code-review channel.agents/docs/SLACK_MCP_SETUP.md for detailed setup)cursor generate-code-review-slack-command to generate a copiable command that you can edit before sending (allowing you to add @ mentions, media links, and final proof editing)# 1. Configure Slack MCP according to .agents/docs/SLACK_MCP_SETUP.md
# - Follow the complete setup guide for configuring the Slack MCP server
# - Add your User OAuth Token (xoxp-...) to the Docker args
# - Ensure 'mcp-server --transport stdio' is included in Docker args
# - Ensure 'SLACK_MCP_ADD_MESSAGE_TOOL=true' is set to enable the tool
# 2. Restart Cursor IDE to load the MCP configuration
# 3. Run command (on a branch with an open PR)
cursor send-code-review-slack
### Example with Missing Information
If some information cannot be extracted from PR, the command will prompt:
```bash
cursor send-code-review-slack
# Found PR: https://github.com/comet-ml/opik/pull/1234
# Extracted Jira ticket: OPIK-1234
# Test environment link not found in PR. Enter test environment link (e.g., https://test.opik.com): https://test.opik.com
# Frontend summary not found in PR. Enter frontend summary (one line, optional - press Enter to skip): [Enter pressed - skipped]
# Backend summary not found in PR. Enter backend summary (one line, optional - press Enter to skip): Implemented metrics endpoint
# Python summary not found in PR. Enter Python summary (one line, optional - press Enter to skip): [Enter pressed - skipped]
# TypeScript summary not found in PR. Enter TypeScript summary (one line, optional - press Enter to skip): [Enter pressed - skipped]
# Would you like to customize the message? (Enter any additional text to prepend/append, or press Enter to use default message): [Enter pressed - using default]
End Command