Skip to content

Conversation

@aaronpowell
Copy link
Contributor

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • My contribution adds a new instruction, prompt, or chat mode file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, or chat mode with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New chat mode file.
  • New collection file.
  • Update to existing instruction, prompt, chat mode, or collection.
  • Other (please specify):

Additional Notes


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Copilot AI review requested due to automatic review settings November 26, 2025 00:20
Copilot finished reviewing on behalf of aaronpowell November 26, 2025 00:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds visual indicators to display handoff capabilities in the README for custom agents. The feature allows users to quickly identify which agents support handoffs to other agents, a VS Code-specific feature that enables seamless context transfer between specialized agents.

Key Changes:

  • Added a getHandoffs() function to parse handoff metadata from agent frontmatter
  • Updated the agent table generation to display handoff labels with a 🔄 emoji indicator
  • Added documentation about handoffs in the "How to Use Custom Agents" section

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
eng/update-readme.mjs Added getHandoffs() function to extract handoff information from agent files and integrated handoff display logic into the agent table generation
eng/constants.mjs Added "Handoffs" documentation section explaining the handoff feature with a link to VS Code documentation
docs/README.agents.md Shows the generated output with handoff documentation and example handoff indicator for the Context7 agent

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment on lines +340 to +351
try {
const frontmatter = parseFrontmatter(filePath);
if (frontmatter && Array.isArray(frontmatter.handoffs) && frontmatter.handoffs.length > 0) {
return frontmatter.handoffs.map(h => ({
label: h.label || 'Unknown handoff',
agent: h.agent || 'unknown'
}));
}
return null;
} catch (error) {
return null;
}
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The try-catch block here is redundant since parseFrontmatter already uses safeFileOperation which handles errors internally and returns null on failure. The try-catch can be removed to follow the pattern used by other similar functions in this file like extractDescription (line 190-204).

Suggested change
try {
const frontmatter = parseFrontmatter(filePath);
if (frontmatter && Array.isArray(frontmatter.handoffs) && frontmatter.handoffs.length > 0) {
return frontmatter.handoffs.map(h => ({
label: h.label || 'Unknown handoff',
agent: h.agent || 'unknown'
}));
}
return null;
} catch (error) {
return null;
}
const frontmatter = parseFrontmatter(filePath);
if (frontmatter && Array.isArray(frontmatter.handoffs) && frontmatter.handoffs.length > 0) {
return frontmatter.handoffs.map(h => ({
label: h.label || 'Unknown handoff',
agent: h.agent || 'unknown'
}));
}
return null;

Copilot uses AI. Check for mistakes.
try {
const frontmatter = parseFrontmatter(filePath);
if (frontmatter && Array.isArray(frontmatter.handoffs) && frontmatter.handoffs.length > 0) {
return frontmatter.handoffs.map(h => ({
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arrow function parameter should use parentheses for consistency with the rest of the codebase. Change h => to (h) => to match the style used in other .map() calls throughout this file (see lines 63, 106, 235, 294, 388, 475, 546, 623).

Suggested change
return frontmatter.handoffs.map(h => ({
return frontmatter.handoffs.map((h) => ({

Copilot uses AI. Check for mistakes.
if (badgeType === "agent") {
const handoffs = getHandoffs(filePath);
if (handoffs && handoffs.length > 0) {
const handoffLabels = handoffs.map(h => h.label).join(', ');
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arrow function parameter should use parentheses for consistency with the rest of the codebase. Change h => to (h) => to match the style used in other .map() calls throughout this file (see lines 63, 106, 235, 294, 388, 475, 546, 623).

Suggested change
const handoffLabels = handoffs.map(h => h.label).join(', ');
const handoffLabels = handoffs.map((h) => h.label).join(', ');

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants