You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instructions=append(instructions, "Link issues to PRs using 'closes #123' or 'fixes #123' in PR descriptions.")
24
-
}
25
-
26
21
// Base instruction with context management
27
22
baseInstruction:="The GitHub MCP Server provides GitHub API tools. GitHub API responses can overflow context windows. Strategy: 1) Always prefer 'search_*' tools over 'list_*' tools when possible - search tools return filtered results, 2) Process large datasets in batches rather than all at once, 3) For summarization tasks, fetch minimal data first, then drill down into specifics, 4) When analyzing multiple items (issues, PRs, etc), process in groups of 5-10 to manage context."
return"PR review workflow: Use 'create_pending_pull_request_review' → 'add_comment_to_pending_review' → 'submit_pending_pull_request_review' for complex reviews with line-specific comments."
40
-
case"actions":
41
-
return"CI/CD debugging: Use 'get_job_logs' with 'failed_only=true' and 'return_content=true' for immediate log analysis. Use 'rerun_failed_jobs' instead of 'rerun_workflow_run' to save resources."
42
35
case"issues":
43
36
return"Issue workflow: Check 'list_issue_types' first for organizations to use proper issue types. Use 'search_issues' before creating new issues to avoid duplicates. Always set 'state_reason' when closing issues."
44
-
case"repos":
45
-
return"File operations: Use 'get_file_contents' to check if file exists before 'create_or_update_file'. Always specify 'sha' parameter when updating existing files. Use 'push_files' for multiple file operations in single commit."
46
37
case"notifications":
47
38
return"Notifications: Filter by 'participating' for issues/PRs you're involved in. Use 'mark_all_notifications_read' with repository filters to avoid marking unrelated notifications."
48
-
case"gists":
49
-
return"Gists: Use 'list_gists' with 'since' parameter to find recent gists. Specify 'public=false' for private gists in 'create_gist'."
50
39
case"discussions":
51
40
return"Discussions: Use 'list_discussion_categories' to understand available categories before creating discussions. Filter by category for better organization."
52
41
default:
53
42
return""
54
43
}
55
44
}
56
45
57
-
58
46
// contains checks if a slice contains a specific string
0 commit comments