Skip to content

Commit 75bfae4

Browse files
committed
remove unused SecurityAlertWorkflowPrompt and RepositorySetupWorkflowPrompt
1 parent a00aa4d commit 75bfae4

File tree

2 files changed

+3
-108
lines changed

2 files changed

+3
-108
lines changed

pkg/github/tools.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
4646
toolsets.NewServerResourceTemplate(GetRepositoryResourceCommitContent(getClient, getRawClient, t)),
4747
toolsets.NewServerResourceTemplate(GetRepositoryResourceTagContent(getClient, getRawClient, t)),
4848
toolsets.NewServerResourceTemplate(GetRepositoryResourcePrContent(getClient, getRawClient, t)),
49-
).AddPrompts(
50-
toolsets.NewServerPrompt(RepositorySetupWorkflowPrompt(t)),
51-
)
49+
)
5250
issues := toolsets.NewToolset("issues", "GitHub Issues related tools").
5351
AddReadTools(
5452
toolsets.NewServerTool(GetIssue(getClient, t)),
@@ -108,9 +106,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
108106
AddReadTools(
109107
toolsets.NewServerTool(GetCodeScanningAlert(getClient, t)),
110108
toolsets.NewServerTool(ListCodeScanningAlerts(getClient, t)),
111-
).AddPrompts(
112-
toolsets.NewServerPrompt(SecurityAlertWorkflowPrompt(t)),
113-
)
109+
)
114110
secretProtection := toolsets.NewToolset("secret_protection", "Secret protection related tools, such as GitHub Secret Scanning").
115111
AddReadTools(
116112
toolsets.NewServerTool(GetSecretScanningAlert(getClient, t)),
@@ -120,9 +116,7 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
120116
AddReadTools(
121117
toolsets.NewServerTool(GetDependabotAlert(getClient, t)),
122118
toolsets.NewServerTool(ListDependabotAlerts(getClient, t)),
123-
).AddPrompts(
124-
toolsets.NewServerPrompt(SecurityAlertWorkflowPrompt(t)),
125-
)
119+
)
126120

127121
notifications := toolsets.NewToolset("notifications", "GitHub Notifications related tools").
128122
AddReadTools(

pkg/github/workflow_prompts.go

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -135,102 +135,3 @@ func IssueInvestigationWorkflowPrompt(t translations.TranslationHelperFunc) (too
135135
}, nil
136136
}
137137
}
138-
139-
// SecurityAlertWorkflowPrompt provides guided workflow for managing security alerts
140-
func SecurityAlertWorkflowPrompt(t translations.TranslationHelperFunc) (tool mcp.Prompt, handler server.PromptHandlerFunc) {
141-
return mcp.NewPrompt("SecurityAlertWorkflow",
142-
mcp.WithPromptDescription(t("PROMPT_SECURITY_ALERT_WORKFLOW_DESCRIPTION", "Convert security alerts into trackable issues and assign to appropriate resources")),
143-
mcp.WithArgument("owner", mcp.ArgumentDescription("Repository owner"), mcp.RequiredArgument()),
144-
mcp.WithArgument("repo", mcp.ArgumentDescription("Repository name"), mcp.RequiredArgument()),
145-
mcp.WithArgument("alertType", mcp.ArgumentDescription("Type of alerts to process: dependabot, code_scanning, or secret_scanning")),
146-
), func(_ context.Context, request mcp.GetPromptRequest) (*mcp.GetPromptResult, error) {
147-
owner := request.Params.Arguments["owner"]
148-
repo := request.Params.Arguments["repo"]
149-
alertType := "dependabot"
150-
if t, exists := request.Params.Arguments["alertType"]; exists {
151-
alertType = fmt.Sprintf("%v", t)
152-
}
153-
154-
messages := []mcp.PromptMessage{
155-
{
156-
Role: "system",
157-
Content: mcp.NewTextContent("You are a security management assistant helping to process security alerts and convert them into actionable work items. You should examine alerts, create tracking issues for important ones, and assign appropriate work to Copilot where suitable."),
158-
},
159-
{
160-
Role: "user",
161-
Content: mcp.NewTextContent(fmt.Sprintf("I need to process %s security alerts for %s/%s. Please help me convert critical alerts into trackable issues and assign work appropriately.", alertType, owner, repo)),
162-
},
163-
{
164-
Role: "assistant",
165-
Content: mcp.NewTextContent(fmt.Sprintf("I'll help you process %s alerts for %s/%s systematically. Let me examine the alerts, identify critical ones, and create appropriate tracking issues.", alertType, owner, repo)),
166-
},
167-
{
168-
Role: "user",
169-
Content: mcp.NewTextContent("Great! Please prioritize by severity and create issues for critical/high priority alerts. For straightforward dependency updates, consider assigning to Copilot. For complex security issues, create detailed issues for human review."),
170-
},
171-
{
172-
Role: "assistant",
173-
Content: mcp.NewTextContent("Perfect approach! I'll:\n\n1. List and examine the security alerts\n2. Prioritize by severity (critical/high first)\n3. Create detailed tracking issues\n4. Assign simple dependency updates to Copilot\n5. Flag complex security issues for human review\n\nLet me start by examining the alerts."),
174-
},
175-
}
176-
return &mcp.GetPromptResult{
177-
Messages: messages,
178-
}, nil
179-
}
180-
}
181-
182-
// RepositorySetupWorkflowPrompt provides guided workflow for setting up new repositories
183-
func RepositorySetupWorkflowPrompt(t translations.TranslationHelperFunc) (tool mcp.Prompt, handler server.PromptHandlerFunc) {
184-
return mcp.NewPrompt("RepositorySetupWorkflow",
185-
mcp.WithPromptDescription(t("PROMPT_REPOSITORY_SETUP_WORKFLOW_DESCRIPTION", "Guide through setting up a new repository with initial content and structure")),
186-
mcp.WithArgument("repoName", mcp.ArgumentDescription("Name for the new repository"), mcp.RequiredArgument()),
187-
mcp.WithArgument("description", mcp.ArgumentDescription("Repository description")),
188-
mcp.WithArgument("private", mcp.ArgumentDescription("Whether repository should be private (true/false)")),
189-
), func(_ context.Context, request mcp.GetPromptRequest) (*mcp.GetPromptResult, error) {
190-
repoName := request.Params.Arguments["repoName"]
191-
description := ""
192-
if d, exists := request.Params.Arguments["description"]; exists {
193-
description = fmt.Sprintf("%v", d)
194-
}
195-
private := "false"
196-
if p, exists := request.Params.Arguments["private"]; exists {
197-
private = fmt.Sprintf("%v", p)
198-
}
199-
200-
messages := []mcp.PromptMessage{
201-
{
202-
Role: "system",
203-
Content: mcp.NewTextContent("You are a repository setup assistant helping to create and configure new GitHub repositories with best practices. You should guide through creating the repository, setting up initial structure, and establishing good development workflows."),
204-
},
205-
{
206-
Role: "user",
207-
Content: mcp.NewTextContent(fmt.Sprintf("I want to create a new repository called '%s'%s%s. Please help me set it up with proper initial structure.", repoName, func() string {
208-
if description != "" {
209-
return fmt.Sprintf(" with description '%s'", description)
210-
}
211-
return ""
212-
}(), func() string {
213-
if private == "true" {
214-
return " (private repository)"
215-
}
216-
return ""
217-
}())),
218-
},
219-
{
220-
Role: "assistant",
221-
Content: mcp.NewTextContent(fmt.Sprintf("I'll help you create and set up the '%s' repository with a proper initial structure. Let me guide you through the process step by step.", repoName)),
222-
},
223-
{
224-
Role: "user",
225-
Content: mcp.NewTextContent("Perfect! Please:\n1. Create the repository\n2. Set up a development branch\n3. Add essential files (README, .gitignore, etc.)\n4. Create an initial pull request to establish the workflow\n\nLet me know what type of project this is so you can suggest appropriate templates."),
226-
},
227-
{
228-
Role: "assistant",
229-
Content: mcp.NewTextContent("Excellent plan! I'll create a well-structured repository with:\n\n Repository creation\n Development branch setup\n Essential files (README, .gitignore, etc.)\n Initial PR workflow\n\nWhat type of project is this? (e.g., JavaScript/Node.js, Python, Go, documentation, etc.) This will help me suggest the right templates and structure."),
230-
},
231-
}
232-
return &mcp.GetPromptResult{
233-
Messages: messages,
234-
}, nil
235-
}
236-
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy