Add a comment to a pull request
Adds a comment to a pull request with optional AI-generated content from conversation context.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-repo@fractary<pr_number> ["<comment>"] [--prompt "<instructions>"]claude-haiku-4-5<CRITICAL_RULES> YOU MUST:
YOU MUST NOT:
WHEN COMMANDS FAIL:
THIS COMMAND IS ONLY A ROUTER. </CRITICAL_RULES>
<WORKFLOW> 1. **Parse user input** - Extract pr_number (required) - Extract comment (optional if --prompt provided) - Parse optional arguments: --prompt - Validate: either comment or --prompt must be providedHandle --prompt argument (if provided)
--prompt is provided but comment is NOT provided:
--prompt are provided:
--prompt):
Build structured request
Invoke agent
Return response
<ARGUMENT_SYNTAX>
This command follows the space-separated argument syntax (consistent with work/repo plugin family):
Always use quotes for multi-word comments:
✅ /fractary-repo:pr-comment 456 "Looks great! Approving now."
✅ /fractary-repo:pr-comment 123 "Please add tests for edge cases"
❌ /fractary-repo:pr-comment 456 Looks great! Approving now.
Single-word comments don't require quotes:
✅ /fractary-repo:pr-comment 456 LGTM
✅ /fractary-repo:pr-comment 456 Approved
</ARGUMENT_SYNTAX>
<ARGUMENT_PARSING>
Required Arguments:
pr_number (number): PR number (e.g., 456, not "#456")Conditionally Required (at least one):
comment (string): Comment text, use quotes if multi-word - exact text to use as comment--prompt (string): Instructions for generating the comment from conversation context (use quotes). When provided without comment text, Claude will craft the comment using the current conversation plus these instructions.Comment vs Prompt:
comment provides the exact text to use as the PR comment--prompt provides instructions for Claude to generate the comment from conversation context--prompt refines it--prompt is provided, Claude generates the entire comment based on the conversation and instructionsMaps to: comment-pr
Example:
/fractary-repo:pr-comment 456 "LGTM! Approving."
→ Invoke agent with {"operation": "comment-pr", "parameters": {"pr_number": "456", "comment": "LGTM! Approving."}}
</ARGUMENT_PARSING>
<EXAMPLES> ## Usage Examples# Add comment
/fractary-repo:pr-comment 456 "Tested locally - works great!"
# Simple approval comment
/fractary-repo:pr-comment 456 LGTM
# Request changes
/fractary-repo:pr-comment 456 "Please add unit tests before merging"
# Generate review feedback from conversation context
/fractary-repo:pr-comment 456 --prompt "Summarize the code review feedback we discussed, including the security concern"
# Generate approval comment with context
/fractary-repo:pr-comment 456 --prompt "Post an approval comment mentioning the improvements we identified during review"
# Enhance comment with review details
/fractary-repo:pr-comment 456 "Great improvements!" --prompt "Add specific details about the refactoring we discussed"
</EXAMPLES>
<AGENT_INVOCATION>
CRITICAL: After parsing arguments, you MUST actually invoke the Task tool. Do NOT just describe what should be done.
How to invoke: Use the Task tool with these parameters:
Example Task tool invocation:
Task(
subagent_type="fractary-repo:repo-manager",
description="Add comment to PR #456",
prompt='{
"operation": "comment-pr",
"parameters": {
"pr_number": "456",
"comment": "LGTM! Approving."
}
}'
)
DO NOT:
<ERROR_HANDLING> Common errors to handle:
Missing PR number:
Error: pr_number is required
Usage: /fractary-repo:pr-comment <pr_number> <comment>
Missing comment:
Error: comment text is required
Usage: /fractary-repo:pr-comment <pr_number> <comment>
PR not found:
Error: Pull request not found: #999
Verify the PR number and try again
</ERROR_HANDLING>
<NOTES> ## Comment vs Review/fractary-repo:pr-review)This command works with:
Platform is configured via /fractary-repo:init and stored in .fractary/plugins/repo/config.json.
Related commands:
/fractary-repo:pr-create - Create PRs/fractary-repo:pr-review - Review PRs with approval/changes/fractary-repo:pr-merge - Merge PRs/fractary-repo:init - Configure repo plugin
</NOTES>