@@ -32,18 +32,65 @@ Analyze the changes made thoroughly and consider multiple ways to present them c
32
32
!git status
33
33
!git commit -m "Implement feature for issue #$ARGUMENTS"
34
34
35
- 2 . ** Push to Remote**
35
+ 2 . ** Fork Detection and Repository Analysis**
36
+ - Use ` get_fork_info() ` to check if current repository is a fork
37
+ - If it's a fork, identify the upstream repository for PR creation
38
+ - Determine the correct target repository (fork vs upstream)
39
+
40
+ 3 . ** Push to Remote**
36
41
!git push -u origin HEAD
37
42
38
- 3 . ** Create Pull/Merge Request**
39
- Use ` create_merge_request() ` to create the PR/MR with:
43
+ 4 . ** Create Pull/Merge Request with Fork Support**
44
+ Use ` create_merge_request() ` to create the PR/MR with enhanced fork support:
45
+
46
+ ** For Fork-to-Upstream PRs:**
47
+ - Source branch: ` username:branch-name ` format (automatically detected)
48
+ - Target repository: Upstream repository (parent)
49
+ - Target branch: Usually ` main ` or ` master `
50
+
51
+ ** For Same-Repository PRs:**
52
+ - Source branch: ` branch-name ` format (current behavior)
53
+ - Target repository: Current repository
54
+ - Target branch: As specified or default
55
+
56
+ ** PR Parameters:**
40
57
- Craft a descriptive title linking to issue
41
58
- Create comprehensive description that clearly explains the solution
42
59
- ** IMPORTANT** : In the description, use the full issue URL from ` .claude/issue-$ARGUMENTS-*.md ` instead of just ` #$ARGUMENTS `
43
60
- Extract the URL using: ` grep "URL:" .claude/issue-$ARGUMENTS-*.md | head -1 | cut -d' ' -f2 `
44
61
- Consider appropriate labels and reviewers
45
62
46
- 4 . ** PR Description Template**
63
+ 5 . ** Fork Workflow Examples**
64
+
65
+ ** Example 1: Fork-to-Upstream PR**
66
+ ```
67
+ # Check if current repo is a fork
68
+ get_fork_info("github", "myuser/upstream-project")
69
+
70
+ # If it's a fork, create PR to upstream
71
+ create_merge_request(
72
+ platform="github",
73
+ project_id="upstream-owner/upstream-project", # Target upstream repo
74
+ source_branch="myuser:feature-branch", # Fork branch reference
75
+ target_branch="main", # Upstream main branch
76
+ title="Fix issue #123: Add new feature",
77
+ description="Implements feature as requested in issue..."
78
+ )
79
+ ```
80
+
81
+ ** Example 2: Same-Repository PR (existing behavior)**
82
+ ```
83
+ create_merge_request(
84
+ platform="github",
85
+ project_id="myuser/my-project",
86
+ source_branch="feature-branch", # Simple branch name
87
+ target_branch="main",
88
+ title="Fix issue #123: Add new feature",
89
+ description="Implements feature as requested in issue..."
90
+ )
91
+ ```
92
+
93
+ 6 . ** PR Description Template**
47
94
```
48
95
## Summary
49
96
Implements [feature description] as requested in issue #$ARGUMENTS
@@ -60,13 +107,24 @@ Analyze the changes made thoroughly and consider multiple ways to present them c
60
107
Closes #$ARGUMENTS
61
108
```
62
109
63
- 5 . ** Final Steps**
110
+ 7 . ** Available Fork MCP Tools**
111
+
112
+ ** New Tools for Fork Management:**
113
+ - ` create_fork(platform, project_id, **kwargs) ` - Create a fork of a repository
114
+ - ` get_fork_info(platform, project_id) ` - Check fork status and get parent info
115
+ - ` list_forks(platform, project_id) ` - List forks of a repository (basic implementation)
116
+
117
+ ** Enhanced Existing Tools:**
118
+ - ` create_merge_request() ` - Now supports cross-repository PRs with ` owner:branch ` format
119
+ - All existing MCP tools work seamlessly with fork workflows
120
+
121
+ 8 . ** Final Steps**
64
122
- Link PR to original issue (use ` update_issue() ` to close issue if needed)
65
123
- Request code review via ` get_merge_request_details() ` for tracking
66
124
- Monitor CI/CD pipeline
67
125
- Address review feedback
68
126
69
- 6 . ** Complete Issue Documentation**
127
+ 9 . ** Complete Issue Documentation**
70
128
- Save final PR details to ` .claude/issue-$ARGUMENTS-*.md `
71
129
- Mark workflow as completed in the documentation
72
130
- Issue document now serves as complete project history for this feature
0 commit comments