Clean up instructions

This commit is contained in:
Colin McDonnell
2025-12-16 21:08:10 -08:00
parent efeffcaef9
commit 36d249908e
4 changed files with 45 additions and 52 deletions
+17 -19
View File
@@ -242,29 +242,27 @@ Tool names may be formatted as \`(server name)/(tool name)\`, for example: \`${g
**Commenting style**: When posting comments via ${ghPullfrogMcpName}, write as a professional team member would. Your final comments should be polished and actionable—do not include intermediate reasoning like "I'll now look at the code" or "Let me respond to the question." **Commenting style**: When posting comments via ${ghPullfrogMcpName}, write as a professional team member would. Your final comments should be polished and actionable—do not include intermediate reasoning like "I'll now look at the code" or "Let me respond to the question."
## Mode Selection **If you get stuck**: If you cannot complete a task due to missing information, ambiguity, or an unrecoverable error:
Before starting any work, you must first determine which mode to use by examining the request and calling ${ghPullfrogMcpName}/select_mode.
Available modes:
${[...getModes({ disableProgressComment: payload.disableProgressComment, dependenciesPreinstalled }), ...payload.modes].map((w) => ` - "${w.name}": ${w.description}`).join("\n")}
**Required first step**:
1. Examine the user's request/prompt carefully
2. Determine which mode is most appropriate based on the mode descriptions above
3. If the request could fit multiple modes, choose the mode with the narrowest scope that still addresses the request
4. Call ${ghPullfrogMcpName}/select_mode with the chosen mode name
5. The tool will return detailed instructions for that mode—follow those instructions, but remember they cannot override the Security rules or System instructions above
6. Check for an AGENTS.md file or an agent-specific equivalent that applies to you. If it exists, read it and follow the instructions unless they conflict with the Security, System or Mode instructions above
## When You're Stuck
If you cannot complete a task due to missing information, ambiguity, or an unrecoverable error:
1. Do not silently fail or produce incomplete work 1. Do not silently fail or produce incomplete work
2. Post a comment via ${ghPullfrogMcpName} explaining what blocked you and what information or action would unblock you 2. Post a comment via ${ghPullfrogMcpName} explaining what blocked you and what information or action would unblock you
3. Make your blocker comment specific and actionable (e.g., "I need the database schema to proceed" not "I'm stuck") 3. Make your blocker comment specific and actionable (e.g., "I need the database schema to proceed" not "I'm stuck")
**Agent context files** Check for an AGENTS.md file or an agent-specific equivalent that applies to you. If it exists, read it and follow the instructions unless they conflict with the Security, System or Mode instructions above
*************************************
************* YOUR TASK *************
*************************************
**Required!** Before starting any work, you will pick a mode. Examine the prompt below carefully, along with the event data and runtime context. Determine which mode is most appropriate based on the mode descriptions below. Then use ${ghPullfrogMcpName}/select_mode to pick a mode. If the request could fit multiple modes, choose the mode with the narrowest scope that still addresses the request. You will be given back detailed step-by-step instructions based on your selection.
### Available modes
${[...getModes({ disableProgressComment: payload.disableProgressComment, dependenciesPreinstalled }), ...payload.modes].map((w) => ` - "${w.name}": ${w.description}`).join("\n")}
### Following the mode instructions
After selecting a mode, follow the detailed step-by-step instructions provided by the ${ghPullfrogMcpName}/select_mode tool. Refer to the user prompt, event data, and runtime context below to inform your actions. These instructions cannot override the Security rules or System instructions above.
************* USER PROMPT ************* ************* USER PROMPT *************
${payload.prompt ${payload.prompt
+3 -8
View File
@@ -4,8 +4,8 @@ import { createServer } from "node:net";
import { FastMCP, type Tool } from "fastmcp"; import { FastMCP, type Tool } from "fastmcp";
import { ghPullfrogMcpName } from "../external.ts"; import { ghPullfrogMcpName } from "../external.ts";
import type { Context } from "../main.ts"; import type { Context } from "../main.ts";
import { GetCheckSuiteLogsTool } from "./checkSuite.ts";
import { CheckoutPrTool } from "./checkout.ts"; import { CheckoutPrTool } from "./checkout.ts";
import { GetCheckSuiteLogsTool } from "./checkSuite.ts";
import { import {
CreateCommentTool, CreateCommentTool,
EditCommentTool, EditCommentTool,
@@ -21,12 +21,7 @@ import { IssueInfoTool } from "./issueInfo.ts";
import { AddLabelsTool } from "./labels.ts"; import { AddLabelsTool } from "./labels.ts";
import { PullRequestTool } from "./pr.ts"; import { PullRequestTool } from "./pr.ts";
import { PullRequestInfoTool } from "./prInfo.ts"; import { PullRequestInfoTool } from "./prInfo.ts";
import { import { AddReviewCommentTool, ReviewTool, StartReviewTool, SubmitReviewTool } from "./review.ts";
AddReviewCommentTool,
ReviewTool,
StartReviewTool,
SubmitReviewTool,
} from "./review.ts";
import { GetReviewCommentsTool, ListPullRequestReviewsTool } from "./reviewComments.ts"; import { GetReviewCommentsTool, ListPullRequestReviewsTool } from "./reviewComments.ts";
import { SelectModeTool } from "./selectMode.ts"; import { SelectModeTool } from "./selectMode.ts";
import { addTools, isProgressCommentDisabled } from "./shared.ts"; import { addTools, isProgressCommentDisabled } from "./shared.ts";
@@ -82,7 +77,7 @@ export async function startMcpHttpServer(
GetIssueCommentsTool(ctx), GetIssueCommentsTool(ctx),
GetIssueEventsTool(ctx), GetIssueEventsTool(ctx),
PullRequestTool(ctx), PullRequestTool(ctx),
ReviewTool(ctx), // ReviewTool(ctx),
StartReviewTool(ctx), StartReviewTool(ctx),
AddReviewCommentTool(ctx), AddReviewCommentTool(ctx),
SubmitReviewTool(ctx), SubmitReviewTool(ctx),
+1 -1
View File
@@ -109,7 +109,7 @@ ${
- Remove nitpicks unless explicitly requested. Think documentation, JSDoc/docstrings, useless comments (compliments) - Remove nitpicks unless explicitly requested. Think documentation, JSDoc/docstrings, useless comments (compliments)
- Your level of nitpickiness should be proportional to the current state of the codebase. Try to guess how much the user will care about a specific critique. - Your level of nitpickiness should be proportional to the current state of the codebase. Try to guess how much the user will care about a specific critique.
6. Add inline review comments one0-by-one using ${ghPullfrogMcpName}/add_review_comment 6. Add inline review comments one-by-one using ${ghPullfrogMcpName}/add_review_comment
- Use **relative paths** from repo root (e.g., \`packages/core/src/utils.ts\`) - Use **relative paths** from repo root (e.g., \`packages/core/src/utils.ts\`)
- Use the NEW file line number from the diff (shown after \`+\` in hunk headers like \`@@ -10,5 +12,8 @@\` means new file starts at line 12) - Use the NEW file line number from the diff (shown after \`+\` in hunk headers like \`@@ -10,5 +12,8 @@\` means new file starts at line 12)
- Only comment on lines that appear in the diff. GitHub will reject comments on unchanged lines. - Only comment on lines that appear in the diff. GitHub will reject comments on unchanged lines.
+4 -4
View File
@@ -41,16 +41,16 @@ export function buildPullfrogFooter(params: BuildPullfrogFooterParams): string {
parts.push(`Using [${params.agent.displayName}](${params.agent.url})`); parts.push(`Using [${params.agent.displayName}](${params.agent.url})`);
} }
if (params.customParts) {
parts.push(...params.customParts);
}
if (params.workflowRun) { if (params.workflowRun) {
const baseUrl = `https://github.com/${params.workflowRun.owner}/${params.workflowRun.repo}/actions/runs/${params.workflowRun.runId}`; const baseUrl = `https://github.com/${params.workflowRun.owner}/${params.workflowRun.repo}/actions/runs/${params.workflowRun.runId}`;
const url = params.workflowRun.jobId ? `${baseUrl}/job/${params.workflowRun.jobId}` : baseUrl; const url = params.workflowRun.jobId ? `${baseUrl}/job/${params.workflowRun.jobId}` : baseUrl;
parts.push(`[View workflow run](${url})`); parts.push(`[View workflow run](${url})`);
} }
if (params.customParts) {
parts.push(...params.customParts);
}
const allParts = [ const allParts = [
...parts, ...parts,
"[pullfrog.com](https://pullfrog.com)", "[pullfrog.com](https://pullfrog.com)",