Clarify shell guidance and delegation checklists
Standardize orchestrator/subagent instructions on the MCP shell tool and format mode guidance as explicit checklists to make delegation flows easier to follow. Bump the action package version to 0.0.171 for this release. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
pullfrog[bot]
parent
2017922780
commit
e2d8dfeebf
@@ -136400,7 +136400,7 @@ var subagentSystemPreamble = `You are a focused subagent. Complete the task auto
|
||||
|
||||
Your tools are limited to:
|
||||
- **File operations**: \`${ghPullfrogMcpName}/file_read\`, \`file_write\`, \`file_edit\`, \`file_delete\`, \`list_directory\`. Native file tools (Read, Write, StrReplace, etc.) are disabled \u2014 use the MCP versions.
|
||||
- **Shell**: \`${ghPullfrogMcpName}/bash\` (if available). Use this for local git operations (\`git add\`, \`git commit\`, \`git diff\`, \`git log\`, \`git status\`), running tests, builds, and linters.
|
||||
- **Shell**: \`${ghPullfrogMcpName}/shell\` (if available). Use this for local git operations (\`git add\`, \`git commit\`, \`git diff\`, \`git log\`, \`git status\`), running tests, builds, and linters.
|
||||
- **Read-only GitHub**: \`get_pull_request\`, \`get_issue\`, \`get_issue_comments\`, \`get_issue_events\`, \`get_review_comments\`, \`list_pull_request_reviews\`, \`get_check_suite_logs\`, \`get_commit_info\`.
|
||||
- **Output**: \`${ghPullfrogMcpName}/upload_file\`, \`${ghPullfrogMcpName}/set_output\`.
|
||||
|
||||
@@ -141611,7 +141611,7 @@ function buildTaskResult(label, effort, subagent, error49) {
|
||||
function DelegateTool(ctx) {
|
||||
return tool({
|
||||
name: "delegate",
|
||||
description: "Delegate research, local coding tasks, and codebase investigations to subagents. Accepts an array of tasks that run in parallel \u2014 use this to fan out work (e.g. reviewing different areas of a PR simultaneously). Each subagent receives ONLY the instructions you provide (plus a system preamble enforcing set_output). Use select_mode first to get guidance on how to craft instructions. Subagents have file operations, bash, read-only GitHub tools (PR/issue info, review comments, check suite logs), and upload_file. They have NO git/checkout tools (would conflict between parallel subagents), NO dependency tools, and NO GitHub-write tools (commenting, reviews, labels, issues). All state-mutating and user-facing operations are your responsibility as orchestrator.",
|
||||
description: "Delegate research, local coding tasks, and codebase investigations to subagents. Accepts an array of tasks that run in parallel \u2014 use this to fan out work (e.g. reviewing different areas of a PR simultaneously). Each subagent receives ONLY the instructions you provide (plus a system preamble enforcing set_output). Use select_mode first to get guidance on how to craft instructions. Subagents have file operations, shell, read-only GitHub tools (PR/issue info, review comments, check suite logs), and upload_file. They have NO git/checkout tools (would conflict between parallel subagents), NO dependency tools, and NO GitHub-write tools (commenting, reviews, labels, issues). All state-mutating and user-facing operations are your responsibility as orchestrator.",
|
||||
parameters: DelegateParams,
|
||||
execute: execute(async (params) => {
|
||||
if (ctx.toolState.selfSubagentId) {
|
||||
@@ -143746,11 +143746,8 @@ var SelectModeParams = type({
|
||||
function resolveMode(modes2, modeName) {
|
||||
return modes2.find((m) => m.name.toLowerCase() === modeName.toLowerCase()) ?? null;
|
||||
}
|
||||
function defaultGuidance(mode) {
|
||||
return `Delegate a subagent for this "${mode.name}" task via the \`tasks\` array. Craft a self-contained prompt that includes all context the subagent needs. Subagents have file ops, bash, and read-only GitHub tools \u2014 but NO git/checkout, dependency, GitHub-write, or remote-mutating tools. All state-mutating and user-facing operations are your responsibility as orchestrator.`;
|
||||
}
|
||||
var modeGuidance = {
|
||||
Build: `For Build tasks, consider a multi-phase approach:
|
||||
Build: `### Checklist
|
||||
|
||||
1. **plan phase** (optional, for complex tasks): delegate a subagent to analyze the requirements, read AGENTS.md and relevant code, and produce a step-by-step implementation plan. Include \`${ghPullfrogMcpName}/set_output\` with the plan so it returns to you. Use mini or auto effort. You can also use \`ask_question\` for codebase questions/investigations.
|
||||
|
||||
@@ -143765,7 +143762,7 @@ var modeGuidance = {
|
||||
- instruct the subagent to plan its approach before writing code: identify which files need to change, key design decisions, and edge cases. for non-trivial changes, consider whether there's a more elegant approach before committing to implementation.
|
||||
- testing expectations: run relevant tests/lints before committing
|
||||
- pre-commit quality check: instruct the subagent to review its own diff before committing \u2014 verify only intended changes are present, no debug artifacts or commented-out code remain, and no unrelated files were modified. the change should be clean enough that a senior engineer would approve it without hesitation. for non-trivial changes, ask whether there's a simpler way to achieve the same result.
|
||||
- commit locally via bash (\`git add . && git commit -m "..."\`)
|
||||
- commit locally via shell (\`git add . && git commit -m "..."\`)
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with a concise summary including the branch name (this is how results get back to you)
|
||||
|
||||
4. **review phase** (optional, for non-trivial changes): before pushing, delegate a review subagent to check the pending diff. Use \`ask_question\` for quick spot-checks, or delegate a full Review subagent for high-stakes changes. This catches issues before they're public.
|
||||
@@ -143775,30 +143772,32 @@ var modeGuidance = {
|
||||
- create a PR via \`${ghPullfrogMcpName}/create_pull_request\`
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with the final summary including PR link
|
||||
|
||||
### Notes
|
||||
|
||||
For simple, well-defined tasks, a single build subagent is sufficient \u2014 skip the plan and review phases.
|
||||
|
||||
Your subagent receives ONLY what you write. Include file paths, constraints, conventions, and any context from AGENTS.md or the codebase directly in the prompt. Subagents have file ops, bash, and read-only GitHub tools \u2014 but NO git/checkout, dependency, GitHub-write, or remote-mutating tools.`,
|
||||
AddressReviews: `Delegate a single subagent to address PR review feedback.
|
||||
Your subagent receives ONLY what you write. Include file paths, constraints, conventions, and any context from AGENTS.md or the codebase directly in the prompt. Subagents have file ops, shell, and read-only GitHub tools \u2014 but NO git/checkout, dependency, GitHub-write, or remote-mutating tools.`,
|
||||
AddressReviews: `### Checklist
|
||||
|
||||
Before delegating, checkout the PR branch yourself via \`${ghPullfrogMcpName}/checkout_pr\` \u2014 subagents have no git/checkout tools.
|
||||
1. Before delegating, checkout the PR branch yourself via \`${ghPullfrogMcpName}/checkout_pr\` \u2014 subagents have no git/checkout tools.
|
||||
|
||||
Include in its prompt:
|
||||
2. Include in its prompt:
|
||||
- instruct it to fetch review comments via \`${ghPullfrogMcpName}/get_review_comments\` (subagents have read-only GitHub tools)
|
||||
- for each comment: understand the feedback, make the code change, and record what was done
|
||||
- test changes, then review the diff before committing \u2014 verify only intended changes are present, no debug artifacts remain, and the changes are clean enough that a senior engineer would approve without hesitation
|
||||
- commit locally via bash (\`git add . && git commit -m "..."\`)
|
||||
- commit locally via shell (\`git add . && git commit -m "..."\`)
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with a JSON object: \`{ "summary": "...", "replies": [{ "comment_id": 123, "thread_id": "...", "reply": "Fixed by ..." }, ...] }\` \u2014 this is how results get back to you
|
||||
|
||||
After the subagent completes:
|
||||
3. After the subagent completes:
|
||||
- push changes via \`${ghPullfrogMcpName}/push_branch\`
|
||||
- reply to each comment using \`${ghPullfrogMcpName}/reply_to_review_comment\` with the subagent's suggested replies
|
||||
- resolve addressed threads via \`${ghPullfrogMcpName}/resolve_review_thread\`
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with a brief summary
|
||||
|
||||
Use auto or max effort depending on review complexity.`,
|
||||
Review: `For reviews, delegate multiple focused subagents in parallel \u2014 each investigating a different area or aspect of the PR.
|
||||
### Effort
|
||||
|
||||
### Approach
|
||||
Use auto or max effort depending on review complexity.`,
|
||||
Review: `### Checklist
|
||||
|
||||
1. Checkout the PR via \`${ghPullfrogMcpName}/checkout_pr\` \u2014 this returns PR metadata and a \`diffPath\`. Read the diff to identify the major areas of change.
|
||||
2. Delegate multiple subagents in a single \`${ghPullfrogMcpName}/delegate\` call, each focused on a specific area. For example, a PR touching action/, components/, and prisma/ might get three subagents: "action-review", "frontend-review", "schema-review".
|
||||
@@ -143825,61 +143824,58 @@ After all tasks complete, consolidate into a **single** review:
|
||||
- if no subagent found actionable issues, skip the review \u2014 just call \`report_progress\` noting the PR was reviewed
|
||||
|
||||
Use max effort for thorough reviews.`,
|
||||
Plan: `Delegate a single planning subagent:
|
||||
Plan: `### Checklist
|
||||
|
||||
Include in its prompt:
|
||||
- the task to plan for
|
||||
- relevant codebase context (file paths, architecture notes from AGENTS.md)
|
||||
- instruct it to produce a structured, actionable plan with clear milestones
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with the plan (this is how results get back to you \u2014 you'll need the plan to craft the next subagent's prompt)
|
||||
1. Include in its prompt:
|
||||
- the task to plan for
|
||||
- relevant codebase context (file paths, architecture notes from AGENTS.md)
|
||||
- instruct it to produce a structured, actionable plan with clear milestones
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with the plan (this is how results get back to you \u2014 you'll need the plan to craft the next subagent's prompt)
|
||||
2. After the subagent completes, call \`${ghPullfrogMcpName}/report_progress\` with the plan.
|
||||
|
||||
After the subagent completes, call \`${ghPullfrogMcpName}/report_progress\` with the plan.
|
||||
### Effort
|
||||
|
||||
Use mini or auto effort. After receiving the plan, you may delegate a Build subagent to implement it.`,
|
||||
Fix: `For CI fix tasks, consider a focused single-phase approach.
|
||||
Fix: `### Checklist
|
||||
|
||||
Before delegating, checkout the PR branch yourself via \`${ghPullfrogMcpName}/checkout_pr\` \u2014 subagents have no git/checkout tools.
|
||||
1. Before delegating, checkout the PR branch yourself via \`${ghPullfrogMcpName}/checkout_pr\` \u2014 subagents have no git/checkout tools.
|
||||
|
||||
Delegate a single fix subagent with:
|
||||
2. Delegate a single fix subagent with:
|
||||
- the check_suite_id to fetch logs via \`${ghPullfrogMcpName}/get_check_suite_logs\` (subagents have read-only GitHub tools)
|
||||
- the PR diff file path (from checkout_pr result) so it can understand what the PR changed
|
||||
- CRITICAL: instruct it to verify the failure was INTRODUCED BY THIS PR before fixing. If unrelated, abort and report.
|
||||
- instruct it to read the workflow file, reproduce locally with the EXACT same commands CI runs
|
||||
- fix the issue, then verify the fix by re-running the exact CI command
|
||||
- pre-commit quality check: review the diff before committing \u2014 verify only the fix is present, no debug artifacts, no unrelated changes. the fix should be clean enough that a senior engineer would approve it without hesitation.
|
||||
- commit locally via bash (\`git add . && git commit -m "..."\`)
|
||||
- commit locally via shell (\`git add . && git commit -m "..."\`)
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with a concise summary: what failed, why, and the fix applied (this is how results get back to you)
|
||||
|
||||
After the subagent completes:
|
||||
3. After the subagent completes:
|
||||
- push changes via \`${ghPullfrogMcpName}/push_branch\`
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with the diagnosis and fix summary
|
||||
|
||||
### Effort
|
||||
|
||||
Use auto effort.`,
|
||||
Task: `Handle this general-purpose task. For simple operations (labeling, commenting, answering questions, running a single command), you can often handle it directly without delegation.
|
||||
Task: `### Checklist
|
||||
|
||||
When the task involves **substantial work** \u2014 code changes across multiple files, multi-step investigations, or tasks that benefit from focused context \u2014 use \`delegate\` and \`ask_question\` liberally:
|
||||
|
||||
- \`ask_question\`: quick codebase research, finding files, understanding architecture. Use freely \u2014 multiple calls in sequence is fine.
|
||||
- \`delegate\`: research, local coding tasks, and codebase investigations. Each subagent gets dedicated context, so break complex work into focused subtasks and delegate each one. For independent subtasks, batch them in a single \`${ghPullfrogMcpName}/delegate\` call to run in parallel.
|
||||
|
||||
### When delegating
|
||||
|
||||
Include in each task's prompt:
|
||||
- the full subtask description with all relevant context
|
||||
- exactly what information to return. the subagent's output is your only way to get results back \u2014 be precise about what you need.
|
||||
- if code changes are needed: branch naming, testing, commit instructions (do NOT instruct to push or create PR)
|
||||
- if code changes are needed: instruct it to review its own diff before committing \u2014 verify only intended changes are present, no debug artifacts remain, and the changes are clean enough that a senior engineer would approve without hesitation
|
||||
|
||||
### Post-delegation
|
||||
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with results
|
||||
- if the task involved code changes, push via \`${ghPullfrogMcpName}/push_branch\` and create a PR via \`${ghPullfrogMcpName}/create_pull_request\`
|
||||
- if the task involved labeling, commenting, or other GitHub operations, perform those directly
|
||||
|
||||
Use mini effort for simple research tasks, auto for typical tasks, max for complex multi-file changes.`
|
||||
1. Handle this general-purpose task. For simple operations (labeling, commenting, answering questions, running a single command), you can often handle it directly without delegation.
|
||||
2. When the task involves **substantial work** \u2014 code changes across multiple files, multi-step investigations, or tasks that benefit from focused context \u2014 use \`delegate\` and \`ask_question\` liberally:
|
||||
- \`ask_question\`: quick codebase research, finding files, understanding architecture. Use freely \u2014 multiple calls in sequence is fine.
|
||||
- \`delegate\`: research, local coding tasks, and codebase investigations. Each subagent gets dedicated context, so break complex work into focused subtasks and delegate each one. For independent subtasks, batch them in a single \`${ghPullfrogMcpName}/delegate\` call to run in parallel.
|
||||
3. Include in each task's prompt:
|
||||
- the full subtask description with all relevant context
|
||||
- exactly what information to return. the subagent's output is your only way to get results back \u2014 be precise about what you need.
|
||||
- if code changes are needed: branch naming, testing, commit instructions (do NOT instruct to push or create PR)
|
||||
- if code changes are needed: instruct it to review its own diff before committing \u2014 verify only intended changes are present, no debug artifacts remain, and the changes are clean enough that a senior engineer would approve without hesitation
|
||||
4. Post-delegation:
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with results
|
||||
- if the task involved code changes, push via \`${ghPullfrogMcpName}/push_branch\` and create a PR via \`${ghPullfrogMcpName}/create_pull_request\`
|
||||
- if the task involved labeling, commenting, or other GitHub operations, perform those directly
|
||||
5. Use mini effort for simple research tasks, auto for typical tasks, max for complex multi-file changes.`
|
||||
};
|
||||
function buildOrchestratorGuidance(mode) {
|
||||
const guidance = modeGuidance[mode.name] ?? defaultGuidance(mode);
|
||||
const guidance = modeGuidance[mode.name] ?? "";
|
||||
return {
|
||||
modeName: mode.name,
|
||||
description: mode.description,
|
||||
@@ -144260,8 +144256,8 @@ function buildSubagentTools(ctx) {
|
||||
FileDeleteTool(ctx),
|
||||
ListDirectoryTool(ctx)
|
||||
];
|
||||
if (ctx.payload.bash === "restricted") {
|
||||
tools.push(BashTool(ctx));
|
||||
if (ctx.payload.shell === "restricted") {
|
||||
tools.push(ShellTool(ctx));
|
||||
tools.push(KillBackgroundTool(ctx));
|
||||
}
|
||||
return tools;
|
||||
@@ -144643,7 +144639,7 @@ import { join as join11 } from "node:path";
|
||||
// package.json
|
||||
var package_default = {
|
||||
name: "@pullfrog/pullfrog",
|
||||
version: "0.0.170",
|
||||
version: "0.0.171",
|
||||
type: "module",
|
||||
files: [
|
||||
"index.js",
|
||||
@@ -146955,13 +146951,13 @@ When all delegations are complete, call \`${ghPullfrogMcpName}/set_output\` with
|
||||
|
||||
### Subagent capabilities
|
||||
|
||||
Subagents have: file operations, bash (for local git, tests, builds), read-only GitHub queries, and upload_file. They do NOT have: \`git\`, \`checkout_pr\`, \`push_branch\`, \`create_pull_request\`, \`create_pull_request_review\`, \`report_progress\`, \`create_issue_comment\`, \`reply_to_review_comment\`, \`resolve_review_thread\`, \`delegate\`, \`ask_question\`, or any dependency/remote-mutating tools. All GitHub-write and state-mutating operations are your responsibility.
|
||||
Subagents have: file operations, shell (for local git, tests, builds), read-only GitHub queries, and upload_file. They do NOT have: \`git\`, \`checkout_pr\`, \`push_branch\`, \`create_pull_request\`, \`create_pull_request_review\`, \`report_progress\`, \`create_issue_comment\`, \`reply_to_review_comment\`, \`resolve_review_thread\`, \`delegate\`, \`ask_question\`, or any dependency/remote-mutating tools. All GitHub-write and state-mutating operations are your responsibility.
|
||||
|
||||
### Prompt-crafting rules
|
||||
|
||||
- Subagents have NO context beyond what you write. No repo instructions, no event data, no user prompt.
|
||||
- Specify exactly what information the subagent should return. The subagent's \`set_output\` call is your only way to get results back \u2014 be precise about what you need.
|
||||
- Instruct subagents to use bash for local git (\`git add\`, \`git commit\`, \`git diff\`, \`git status\`).
|
||||
- Instruct subagents to use shell for local git (\`git add\`, \`git commit\`, \`git diff\`, \`git status\`).
|
||||
- Never instruct a subagent to push, create PRs, submit reviews, or post comments.
|
||||
- For multi-phase flows, pass results from earlier phases into the next delegate call's prompts.
|
||||
- You do NOT need to instruct subagents to call \`set_output\` \u2014 the system preamble handles this.
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ export function DelegateTool(ctx: ToolContext) {
|
||||
return tool({
|
||||
name: "delegate",
|
||||
description:
|
||||
"Delegate research, local coding tasks, and codebase investigations to subagents. Accepts an array of tasks that run in parallel — use this to fan out work (e.g. reviewing different areas of a PR simultaneously). Each subagent receives ONLY the instructions you provide (plus a system preamble enforcing set_output). Use select_mode first to get guidance on how to craft instructions. Subagents have file operations, bash, read-only GitHub tools (PR/issue info, review comments, check suite logs), and upload_file. They have NO git/checkout tools (would conflict between parallel subagents), NO dependency tools, and NO GitHub-write tools (commenting, reviews, labels, issues). All state-mutating and user-facing operations are your responsibility as orchestrator.",
|
||||
"Delegate research, local coding tasks, and codebase investigations to subagents. Accepts an array of tasks that run in parallel — use this to fan out work (e.g. reviewing different areas of a PR simultaneously). Each subagent receives ONLY the instructions you provide (plus a system preamble enforcing set_output). Use select_mode first to get guidance on how to craft instructions. Subagents have file operations, shell, read-only GitHub tools (PR/issue info, review comments, check suite logs), and upload_file. They have NO git/checkout tools (would conflict between parallel subagents), NO dependency tools, and NO GitHub-write tools (commenting, reviews, labels, issues). All state-mutating and user-facing operations are your responsibility as orchestrator.",
|
||||
parameters: DelegateParams,
|
||||
execute: execute(async (params) => {
|
||||
if (ctx.toolState.selfSubagentId) {
|
||||
|
||||
+44
-49
@@ -14,12 +14,8 @@ function resolveMode(modes: Mode[], modeName: string): Mode | null {
|
||||
return modes.find((m) => m.name.toLowerCase() === modeName.toLowerCase()) ?? null;
|
||||
}
|
||||
|
||||
function defaultGuidance(mode: Mode): string {
|
||||
return `Delegate a subagent for this "${mode.name}" task via the \`tasks\` array. Craft a self-contained prompt that includes all context the subagent needs. Subagents have file ops, bash, and read-only GitHub tools — but NO git/checkout, dependency, GitHub-write, or remote-mutating tools. All state-mutating and user-facing operations are your responsibility as orchestrator.`;
|
||||
}
|
||||
|
||||
const modeGuidance: Record<string, string> = {
|
||||
Build: `For Build tasks, consider a multi-phase approach:
|
||||
Build: `### Checklist
|
||||
|
||||
1. **plan phase** (optional, for complex tasks): delegate a subagent to analyze the requirements, read AGENTS.md and relevant code, and produce a step-by-step implementation plan. Include \`${ghPullfrogMcpName}/set_output\` with the plan so it returns to you. Use mini or auto effort. You can also use \`ask_question\` for codebase questions/investigations.
|
||||
|
||||
@@ -34,7 +30,7 @@ const modeGuidance: Record<string, string> = {
|
||||
- instruct the subagent to plan its approach before writing code: identify which files need to change, key design decisions, and edge cases. for non-trivial changes, consider whether there's a more elegant approach before committing to implementation.
|
||||
- testing expectations: run relevant tests/lints before committing
|
||||
- pre-commit quality check: instruct the subagent to review its own diff before committing — verify only intended changes are present, no debug artifacts or commented-out code remain, and no unrelated files were modified. the change should be clean enough that a senior engineer would approve it without hesitation. for non-trivial changes, ask whether there's a simpler way to achieve the same result.
|
||||
- commit locally via bash (\`git add . && git commit -m "..."\`)
|
||||
- commit locally via shell (\`git add . && git commit -m "..."\`)
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with a concise summary including the branch name (this is how results get back to you)
|
||||
|
||||
4. **review phase** (optional, for non-trivial changes): before pushing, delegate a review subagent to check the pending diff. Use \`ask_question\` for quick spot-checks, or delegate a full Review subagent for high-stakes changes. This catches issues before they're public.
|
||||
@@ -44,32 +40,34 @@ const modeGuidance: Record<string, string> = {
|
||||
- create a PR via \`${ghPullfrogMcpName}/create_pull_request\`
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with the final summary including PR link
|
||||
|
||||
### Notes
|
||||
|
||||
For simple, well-defined tasks, a single build subagent is sufficient — skip the plan and review phases.
|
||||
|
||||
Your subagent receives ONLY what you write. Include file paths, constraints, conventions, and any context from AGENTS.md or the codebase directly in the prompt. Subagents have file ops, bash, and read-only GitHub tools — but NO git/checkout, dependency, GitHub-write, or remote-mutating tools.`,
|
||||
Your subagent receives ONLY what you write. Include file paths, constraints, conventions, and any context from AGENTS.md or the codebase directly in the prompt. Subagents have file ops, shell, and read-only GitHub tools — but NO git/checkout, dependency, GitHub-write, or remote-mutating tools.`,
|
||||
|
||||
AddressReviews: `Delegate a single subagent to address PR review feedback.
|
||||
AddressReviews: `### Checklist
|
||||
|
||||
Before delegating, checkout the PR branch yourself via \`${ghPullfrogMcpName}/checkout_pr\` — subagents have no git/checkout tools.
|
||||
1. Before delegating, checkout the PR branch yourself via \`${ghPullfrogMcpName}/checkout_pr\` — subagents have no git/checkout tools.
|
||||
|
||||
Include in its prompt:
|
||||
2. Include in its prompt:
|
||||
- instruct it to fetch review comments via \`${ghPullfrogMcpName}/get_review_comments\` (subagents have read-only GitHub tools)
|
||||
- for each comment: understand the feedback, make the code change, and record what was done
|
||||
- test changes, then review the diff before committing — verify only intended changes are present, no debug artifacts remain, and the changes are clean enough that a senior engineer would approve without hesitation
|
||||
- commit locally via bash (\`git add . && git commit -m "..."\`)
|
||||
- commit locally via shell (\`git add . && git commit -m "..."\`)
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with a JSON object: \`{ "summary": "...", "replies": [{ "comment_id": 123, "thread_id": "...", "reply": "Fixed by ..." }, ...] }\` — this is how results get back to you
|
||||
|
||||
After the subagent completes:
|
||||
3. After the subagent completes:
|
||||
- push changes via \`${ghPullfrogMcpName}/push_branch\`
|
||||
- reply to each comment using \`${ghPullfrogMcpName}/reply_to_review_comment\` with the subagent's suggested replies
|
||||
- resolve addressed threads via \`${ghPullfrogMcpName}/resolve_review_thread\`
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with a brief summary
|
||||
|
||||
### Effort
|
||||
|
||||
Use auto or max effort depending on review complexity.`,
|
||||
|
||||
Review: `For reviews, delegate multiple focused subagents in parallel — each investigating a different area or aspect of the PR.
|
||||
|
||||
### Approach
|
||||
Review: `### Checklist
|
||||
|
||||
1. Checkout the PR via \`${ghPullfrogMcpName}/checkout_pr\` — this returns PR metadata and a \`diffPath\`. Read the diff to identify the major areas of change.
|
||||
2. Delegate multiple subagents in a single \`${ghPullfrogMcpName}/delegate\` call, each focused on a specific area. For example, a PR touching action/, components/, and prisma/ might get three subagents: "action-review", "frontend-review", "schema-review".
|
||||
@@ -97,60 +95,57 @@ After all tasks complete, consolidate into a **single** review:
|
||||
|
||||
Use max effort for thorough reviews.`,
|
||||
|
||||
Plan: `Delegate a single planning subagent:
|
||||
Plan: `### Checklist
|
||||
|
||||
Include in its prompt:
|
||||
- the task to plan for
|
||||
- relevant codebase context (file paths, architecture notes from AGENTS.md)
|
||||
- instruct it to produce a structured, actionable plan with clear milestones
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with the plan (this is how results get back to you — you'll need the plan to craft the next subagent's prompt)
|
||||
1. Include in its prompt:
|
||||
- the task to plan for
|
||||
- relevant codebase context (file paths, architecture notes from AGENTS.md)
|
||||
- instruct it to produce a structured, actionable plan with clear milestones
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with the plan (this is how results get back to you — you'll need the plan to craft the next subagent's prompt)
|
||||
2. After the subagent completes, call \`${ghPullfrogMcpName}/report_progress\` with the plan.
|
||||
|
||||
After the subagent completes, call \`${ghPullfrogMcpName}/report_progress\` with the plan.
|
||||
### Effort
|
||||
|
||||
Use mini or auto effort. After receiving the plan, you may delegate a Build subagent to implement it.`,
|
||||
|
||||
Fix: `For CI fix tasks, consider a focused single-phase approach.
|
||||
Fix: `### Checklist
|
||||
|
||||
Before delegating, checkout the PR branch yourself via \`${ghPullfrogMcpName}/checkout_pr\` — subagents have no git/checkout tools.
|
||||
1. Before delegating, checkout the PR branch yourself via \`${ghPullfrogMcpName}/checkout_pr\` — subagents have no git/checkout tools.
|
||||
|
||||
Delegate a single fix subagent with:
|
||||
2. Delegate a single fix subagent with:
|
||||
- the check_suite_id to fetch logs via \`${ghPullfrogMcpName}/get_check_suite_logs\` (subagents have read-only GitHub tools)
|
||||
- the PR diff file path (from checkout_pr result) so it can understand what the PR changed
|
||||
- CRITICAL: instruct it to verify the failure was INTRODUCED BY THIS PR before fixing. If unrelated, abort and report.
|
||||
- instruct it to read the workflow file, reproduce locally with the EXACT same commands CI runs
|
||||
- fix the issue, then verify the fix by re-running the exact CI command
|
||||
- pre-commit quality check: review the diff before committing — verify only the fix is present, no debug artifacts, no unrelated changes. the fix should be clean enough that a senior engineer would approve it without hesitation.
|
||||
- commit locally via bash (\`git add . && git commit -m "..."\`)
|
||||
- commit locally via shell (\`git add . && git commit -m "..."\`)
|
||||
- call \`${ghPullfrogMcpName}/set_output\` with a concise summary: what failed, why, and the fix applied (this is how results get back to you)
|
||||
|
||||
After the subagent completes:
|
||||
3. After the subagent completes:
|
||||
- push changes via \`${ghPullfrogMcpName}/push_branch\`
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with the diagnosis and fix summary
|
||||
|
||||
### Effort
|
||||
|
||||
Use auto effort.`,
|
||||
|
||||
Task: `Handle this general-purpose task. For simple operations (labeling, commenting, answering questions, running a single command), you can often handle it directly without delegation.
|
||||
Task: `### Checklist
|
||||
|
||||
When the task involves **substantial work** — code changes across multiple files, multi-step investigations, or tasks that benefit from focused context — use \`delegate\` and \`ask_question\` liberally:
|
||||
|
||||
- \`ask_question\`: quick codebase research, finding files, understanding architecture. Use freely — multiple calls in sequence is fine.
|
||||
- \`delegate\`: research, local coding tasks, and codebase investigations. Each subagent gets dedicated context, so break complex work into focused subtasks and delegate each one. For independent subtasks, batch them in a single \`${ghPullfrogMcpName}/delegate\` call to run in parallel.
|
||||
|
||||
### When delegating
|
||||
|
||||
Include in each task's prompt:
|
||||
- the full subtask description with all relevant context
|
||||
- exactly what information to return. the subagent's output is your only way to get results back — be precise about what you need.
|
||||
- if code changes are needed: branch naming, testing, commit instructions (do NOT instruct to push or create PR)
|
||||
- if code changes are needed: instruct it to review its own diff before committing — verify only intended changes are present, no debug artifacts remain, and the changes are clean enough that a senior engineer would approve without hesitation
|
||||
|
||||
### Post-delegation
|
||||
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with results
|
||||
- if the task involved code changes, push via \`${ghPullfrogMcpName}/push_branch\` and create a PR via \`${ghPullfrogMcpName}/create_pull_request\`
|
||||
- if the task involved labeling, commenting, or other GitHub operations, perform those directly
|
||||
|
||||
Use mini effort for simple research tasks, auto for typical tasks, max for complex multi-file changes.`,
|
||||
1. Handle this general-purpose task. For simple operations (labeling, commenting, answering questions, running a single command), you can often handle it directly without delegation.
|
||||
2. When the task involves **substantial work** — code changes across multiple files, multi-step investigations, or tasks that benefit from focused context — use \`delegate\` and \`ask_question\` liberally:
|
||||
- \`ask_question\`: quick codebase research, finding files, understanding architecture. Use freely — multiple calls in sequence is fine.
|
||||
- \`delegate\`: research, local coding tasks, and codebase investigations. Each subagent gets dedicated context, so break complex work into focused subtasks and delegate each one. For independent subtasks, batch them in a single \`${ghPullfrogMcpName}/delegate\` call to run in parallel.
|
||||
3. Include in each task's prompt:
|
||||
- the full subtask description with all relevant context
|
||||
- exactly what information to return. the subagent's output is your only way to get results back — be precise about what you need.
|
||||
- if code changes are needed: branch naming, testing, commit instructions (do NOT instruct to push or create PR)
|
||||
- if code changes are needed: instruct it to review its own diff before committing — verify only intended changes are present, no debug artifacts remain, and the changes are clean enough that a senior engineer would approve without hesitation
|
||||
4. Post-delegation:
|
||||
- call \`${ghPullfrogMcpName}/report_progress\` with results
|
||||
- if the task involved code changes, push via \`${ghPullfrogMcpName}/push_branch\` and create a PR via \`${ghPullfrogMcpName}/create_pull_request\`
|
||||
- if the task involved labeling, commenting, or other GitHub operations, perform those directly
|
||||
5. Use mini effort for simple research tasks, auto for typical tasks, max for complex multi-file changes.`,
|
||||
};
|
||||
|
||||
type OrchestratorGuidance = {
|
||||
@@ -160,7 +155,7 @@ type OrchestratorGuidance = {
|
||||
};
|
||||
|
||||
function buildOrchestratorGuidance(mode: Mode): OrchestratorGuidance {
|
||||
const guidance = modeGuidance[mode.name] ?? defaultGuidance(mode);
|
||||
const guidance = modeGuidance[mode.name] ?? "";
|
||||
return {
|
||||
modeName: mode.name,
|
||||
description: mode.description,
|
||||
|
||||
+4
-4
@@ -188,7 +188,7 @@ function isAddressInUse(error: unknown): boolean {
|
||||
return message.includes("eaddrinuse") || message.includes("address already in use");
|
||||
}
|
||||
|
||||
// subagent tools: file ops, bash, read-only GitHub, upload, set_output.
|
||||
// subagent tools: file ops, shell, read-only GitHub, upload, set_output.
|
||||
// no git/checkout (mutates shared state), no dependencies (shared state),
|
||||
// no GitHub-write (user-facing side effects), no delegation/remote-mutating.
|
||||
function buildSubagentTools(ctx: ToolContext): Tool<any, any>[] {
|
||||
@@ -210,15 +210,15 @@ function buildSubagentTools(ctx: ToolContext): Tool<any, any>[] {
|
||||
ListDirectoryTool(ctx),
|
||||
];
|
||||
|
||||
if (ctx.payload.bash === "restricted") {
|
||||
tools.push(BashTool(ctx));
|
||||
if (ctx.payload.shell === "restricted") {
|
||||
tools.push(ShellTool(ctx));
|
||||
tools.push(KillBackgroundTool(ctx));
|
||||
}
|
||||
|
||||
return tools;
|
||||
}
|
||||
|
||||
// orchestrator gets everything: file ops, bash, git, GitHub, delegation, remote-mutating
|
||||
// orchestrator gets everything: file ops, shell, git, GitHub, delegation, remote-mutating
|
||||
function buildOrchestratorTools(ctx: ToolContext): Tool<any, any>[] {
|
||||
const tools: Tool<any, any>[] = [
|
||||
StartDependencyInstallationTool(ctx),
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ const subagentSystemPreamble = `You are a focused subagent. Complete the task au
|
||||
|
||||
Your tools are limited to:
|
||||
- **File operations**: \`${ghPullfrogMcpName}/file_read\`, \`file_write\`, \`file_edit\`, \`file_delete\`, \`list_directory\`. Native file tools (Read, Write, StrReplace, etc.) are disabled — use the MCP versions.
|
||||
- **Shell**: \`${ghPullfrogMcpName}/bash\` (if available). Use this for local git operations (\`git add\`, \`git commit\`, \`git diff\`, \`git log\`, \`git status\`), running tests, builds, and linters.
|
||||
- **Shell**: \`${ghPullfrogMcpName}/shell\` (if available). Use this for local git operations (\`git add\`, \`git commit\`, \`git diff\`, \`git log\`, \`git status\`), running tests, builds, and linters.
|
||||
- **Read-only GitHub**: \`get_pull_request\`, \`get_issue\`, \`get_issue_comments\`, \`get_issue_events\`, \`get_review_comments\`, \`list_pull_request_reviews\`, \`get_check_suite_logs\`, \`get_commit_info\`.
|
||||
- **Output**: \`${ghPullfrogMcpName}/upload_file\`, \`${ghPullfrogMcpName}/set_output\`.
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ describe("per-server tool isolation - integration", () => {
|
||||
orchestratorServer.addTool(mockTool("push_branch", "push branch"));
|
||||
orchestratorServer.addTool(mockTool("create_pull_request", "create PR"));
|
||||
|
||||
// subagent gets ONLY file ops, bash, read-only GitHub, upload, set_output
|
||||
// subagent gets ONLY file ops, shell, read-only GitHub, upload, set_output
|
||||
subagentServer = new FastMCP({ name: "subagent", version: "0.0.1" });
|
||||
subagentServer.addTool(mockTool("file_read", "read a file"));
|
||||
subagentServer.addTool(mockTool("set_output", "set output"));
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pullfrog/pullfrog",
|
||||
"version": "0.0.170",
|
||||
"version": "0.0.171",
|
||||
"type": "module",
|
||||
"files": [
|
||||
"index.js",
|
||||
|
||||
@@ -41235,7 +41235,7 @@ var Effort = type.enumerated("mini", "auto", "max");
|
||||
// package.json
|
||||
var package_default = {
|
||||
name: "@pullfrog/pullfrog",
|
||||
version: "0.0.170",
|
||||
version: "0.0.171",
|
||||
type: "module",
|
||||
files: [
|
||||
"index.js",
|
||||
|
||||
@@ -388,13 +388,13 @@ When all delegations are complete, call \`${ghPullfrogMcpName}/set_output\` with
|
||||
|
||||
### Subagent capabilities
|
||||
|
||||
Subagents have: file operations, bash (for local git, tests, builds), read-only GitHub queries, and upload_file. They do NOT have: \`git\`, \`checkout_pr\`, \`push_branch\`, \`create_pull_request\`, \`create_pull_request_review\`, \`report_progress\`, \`create_issue_comment\`, \`reply_to_review_comment\`, \`resolve_review_thread\`, \`delegate\`, \`ask_question\`, or any dependency/remote-mutating tools. All GitHub-write and state-mutating operations are your responsibility.
|
||||
Subagents have: file operations, shell (for local git, tests, builds), read-only GitHub queries, and upload_file. They do NOT have: \`git\`, \`checkout_pr\`, \`push_branch\`, \`create_pull_request\`, \`create_pull_request_review\`, \`report_progress\`, \`create_issue_comment\`, \`reply_to_review_comment\`, \`resolve_review_thread\`, \`delegate\`, \`ask_question\`, or any dependency/remote-mutating tools. All GitHub-write and state-mutating operations are your responsibility.
|
||||
|
||||
### Prompt-crafting rules
|
||||
|
||||
- Subagents have NO context beyond what you write. No repo instructions, no event data, no user prompt.
|
||||
- Specify exactly what information the subagent should return. The subagent's \`set_output\` call is your only way to get results back — be precise about what you need.
|
||||
- Instruct subagents to use bash for local git (\`git add\`, \`git commit\`, \`git diff\`, \`git status\`).
|
||||
- Instruct subagents to use shell for local git (\`git add\`, \`git commit\`, \`git diff\`, \`git status\`).
|
||||
- Never instruct a subagent to push, create PRs, submit reviews, or post comments.
|
||||
- For multi-phase flows, pass results from earlier phases into the next delegate call's prompts.
|
||||
- You do NOT need to instruct subagents to call \`set_output\` — the system preamble handles this.
|
||||
|
||||
Reference in New Issue
Block a user