mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-22 11:25:13 +00:00
Chat Modes -> Agents (#433)
* Migrating chat modes to agents now that's been released to stable * Fixing collections * Fixing names of agents * Formatting * name too long * Escaping C# agent name
This commit is contained in:
@@ -37,31 +37,16 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi
|
||||
- Run the \`Chat: Run Prompt\` command from the Command Palette
|
||||
- Hit the run button while you have a prompt file open in VS Code`,
|
||||
|
||||
chatmodesSection: `## 💭 Custom Chat Modes
|
||||
|
||||
Custom chat modes define specific behaviors and tools for GitHub Copilot Chat, enabling enhanced context-aware assistance for particular tasks or workflows.`,
|
||||
|
||||
chatmodesUsage: `### How to Use Custom Chat Modes
|
||||
|
||||
**To Install:**
|
||||
- Click the **VS Code** or **VS Code Insiders** install button for the chat mode you want to use
|
||||
- Download the \`*.chatmode.md\` file and manually install it in VS Code using the Command Palette
|
||||
|
||||
**To Activate/Use:**
|
||||
- Import the chat mode configuration into your VS Code settings
|
||||
- Access the installed chat modes through the VS Code Chat interface
|
||||
- Select the desired chat mode from the available options in VS Code Chat`,
|
||||
|
||||
collectionsSection: `## 📦 Collections
|
||||
|
||||
Curated collections of related prompts, instructions, and chat modes organized around specific themes, workflows, or use cases.`,
|
||||
Curated collections of related prompts, instructions, and agents organized around specific themes, workflows, or use cases.`,
|
||||
|
||||
collectionsUsage: `### How to Use Collections
|
||||
|
||||
**Browse Collections:**
|
||||
- ⭐ Featured collections are highlighted and appear at the top of the list
|
||||
- Explore themed collections that group related customizations
|
||||
- Each collection includes prompts, instructions, and chat modes for specific workflows
|
||||
- Each collection includes prompts, instructions, and agents for specific workflows
|
||||
- Collections make it easy to adopt comprehensive toolkits for particular scenarios
|
||||
|
||||
**Install Items:**
|
||||
@@ -71,7 +56,7 @@ Curated collections of related prompts, instructions, and chat modes organized a
|
||||
|
||||
featuredCollectionsSection: `## 🌟 Featured Collections
|
||||
|
||||
Discover our curated collections of prompts, instructions, and chat modes organized around specific themes and workflows.`,
|
||||
Discover our curated collections of prompts, instructions, and agents organized around specific themes and workflows.`,
|
||||
|
||||
agentsSection: `## 🤖 Custom Agents
|
||||
|
||||
@@ -106,14 +91,12 @@ const repoBaseUrl =
|
||||
const AKA_INSTALL_URLS = {
|
||||
instructions: "https://aka.ms/awesome-copilot/install/instructions",
|
||||
prompt: "https://aka.ms/awesome-copilot/install/prompt",
|
||||
mode: "https://aka.ms/awesome-copilot/install/chatmode",
|
||||
agent: "https://aka.ms/awesome-copilot/install/agent",
|
||||
};
|
||||
|
||||
const ROOT_FOLDER = path.join(__dirname, "..");
|
||||
const INSTRUCTIONS_DIR = path.join(ROOT_FOLDER, "instructions");
|
||||
const PROMPTS_DIR = path.join(ROOT_FOLDER, "prompts");
|
||||
const CHATMODES_DIR = path.join(ROOT_FOLDER, "chatmodes");
|
||||
const AGENTS_DIR = path.join(ROOT_FOLDER, "agents");
|
||||
const COLLECTIONS_DIR = path.join(ROOT_FOLDER, "collections");
|
||||
const MAX_COLLECTION_ITEMS = 50;
|
||||
@@ -129,7 +112,6 @@ export {
|
||||
ROOT_FOLDER,
|
||||
INSTRUCTIONS_DIR,
|
||||
PROMPTS_DIR,
|
||||
CHATMODES_DIR,
|
||||
AGENTS_DIR,
|
||||
COLLECTIONS_DIR,
|
||||
MAX_COLLECTION_ITEMS,
|
||||
|
||||
@@ -109,7 +109,7 @@ async function createCollectionTemplate() {
|
||||
}
|
||||
|
||||
// Get description
|
||||
const defaultDescription = `A collection of related prompts, instructions, and chat modes for ${collectionName.toLowerCase()}.`;
|
||||
const defaultDescription = `A collection of related prompts, instructions, and agents for ${collectionName.toLowerCase()}.`;
|
||||
let description = await prompt(
|
||||
`Description (default: ${defaultDescription}): `
|
||||
);
|
||||
@@ -149,8 +149,8 @@ items:
|
||||
# kind: prompt
|
||||
# - path: instructions/example.instructions.md
|
||||
# kind: instruction
|
||||
# - path: chatmodes/example.chatmode.md
|
||||
# kind: chat-mode
|
||||
# - path: agents/example.agent.md
|
||||
# kind: agent
|
||||
# - path: agents/example.agent.md
|
||||
# kind: agent
|
||||
# usage: |
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
vscodeInsidersInstallImage,
|
||||
ROOT_FOLDER,
|
||||
PROMPTS_DIR,
|
||||
CHATMODES_DIR,
|
||||
AGENTS_DIR,
|
||||
COLLECTIONS_DIR,
|
||||
INSTRUCTIONS_DIR,
|
||||
@@ -109,10 +108,10 @@ function extractTitle(filePath) {
|
||||
}
|
||||
}
|
||||
|
||||
// Step 2: For prompt/chatmode/instructions files, look for heading after frontmatter
|
||||
// Step 2: For prompt/agent/instructions files, look for heading after frontmatter
|
||||
if (
|
||||
filePath.includes(".prompt.md") ||
|
||||
filePath.includes(".chatmode.md") ||
|
||||
filePath.includes(".agent.md") ||
|
||||
filePath.includes(".instructions.md")
|
||||
) {
|
||||
// Look for first heading after frontmatter
|
||||
@@ -152,8 +151,8 @@ function extractTitle(filePath) {
|
||||
filePath,
|
||||
filePath.includes(".prompt.md")
|
||||
? ".prompt.md"
|
||||
: filePath.includes(".chatmode.md")
|
||||
? ".chatmode.md"
|
||||
: filePath.includes(".agent.md")
|
||||
? ".agent.md"
|
||||
: ".instructions.md"
|
||||
);
|
||||
return basename
|
||||
@@ -332,21 +331,6 @@ function generatePromptsSection(promptsDir) {
|
||||
return `${TEMPLATES.promptsSection}\n${TEMPLATES.promptsUsage}\n\n${promptsContent}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the chat modes section with a table of all chat modes
|
||||
*/
|
||||
function generateChatModesSection(chatmodesDir) {
|
||||
return generateUnifiedModeSection({
|
||||
dir: chatmodesDir,
|
||||
extension: ".chatmode.md",
|
||||
linkPrefix: "chatmodes",
|
||||
badgeType: "mode",
|
||||
includeMcpServers: false,
|
||||
sectionTemplate: TEMPLATES.chatmodesSection,
|
||||
usageTemplate: TEMPLATES.chatmodesUsage,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate MCP server links for an agent
|
||||
* @param {string[]} servers - Array of MCP server names
|
||||
@@ -443,7 +427,7 @@ function generateAgentsSection(agentsDir) {
|
||||
* Unified generator for chat modes & agents (future consolidation)
|
||||
* @param {Object} cfg
|
||||
* @param {string} cfg.dir - Directory path
|
||||
* @param {string} cfg.extension - File extension to match (e.g. .chatmode.md, .agent.md)
|
||||
* @param {string} cfg.extension - File extension to match (e.g. .agent.md, .agent.md)
|
||||
* @param {string} cfg.linkPrefix - Link prefix folder name
|
||||
* @param {string} cfg.badgeType - Badge key (mode, agent)
|
||||
* @param {boolean} cfg.includeMcpServers - Whether to include MCP server column
|
||||
@@ -836,7 +820,6 @@ try {
|
||||
"# "
|
||||
);
|
||||
const promptsHeader = TEMPLATES.promptsSection.replace(/^##\s/m, "# ");
|
||||
const chatmodesHeader = TEMPLATES.chatmodesSection.replace(/^##\s/m, "# ");
|
||||
const agentsHeader = TEMPLATES.agentsSection.replace(/^##\s/m, "# ");
|
||||
const collectionsHeader = TEMPLATES.collectionsSection.replace(
|
||||
/^##\s/m,
|
||||
@@ -855,13 +838,6 @@ try {
|
||||
promptsHeader,
|
||||
TEMPLATES.promptsUsage
|
||||
);
|
||||
const chatmodesReadme = buildCategoryReadme(
|
||||
generateChatModesSection,
|
||||
CHATMODES_DIR,
|
||||
chatmodesHeader,
|
||||
TEMPLATES.chatmodesUsage
|
||||
);
|
||||
|
||||
// Generate agents README
|
||||
const agentsReadme = buildCategoryReadme(
|
||||
generateAgentsSection,
|
||||
@@ -889,10 +865,6 @@ try {
|
||||
instructionsReadme
|
||||
);
|
||||
writeFileIfChanged(path.join(DOCS_DIR, "README.prompts.md"), promptsReadme);
|
||||
writeFileIfChanged(
|
||||
path.join(DOCS_DIR, "README.chatmodes.md"),
|
||||
chatmodesReadme
|
||||
);
|
||||
writeFileIfChanged(path.join(DOCS_DIR, "README.agents.md"), agentsReadme);
|
||||
writeFileIfChanged(
|
||||
path.join(DOCS_DIR, "README.collections.md"),
|
||||
|
||||
@@ -177,10 +177,10 @@ function validateCollectionItems(items) {
|
||||
if (!item.kind || typeof item.kind !== "string") {
|
||||
return `Item ${i + 1} must have a kind string`;
|
||||
}
|
||||
if (!["prompt", "instruction", "chat-mode", "agent"].includes(item.kind)) {
|
||||
if (!["prompt", "instruction", "agent"].includes(item.kind)) {
|
||||
return `Item ${
|
||||
i + 1
|
||||
} kind must be one of: prompt, instruction, chat-mode, agent`;
|
||||
} kind must be one of: prompt, instruction, agent`;
|
||||
}
|
||||
|
||||
// Validate file path exists
|
||||
@@ -203,11 +203,6 @@ function validateCollectionItems(items) {
|
||||
i + 1
|
||||
} kind is "instruction" but path doesn't end with .instructions.md`;
|
||||
}
|
||||
if (item.kind === "chat-mode" && !item.path.endsWith(".chatmode.md")) {
|
||||
return `Item ${
|
||||
i + 1
|
||||
} kind is "chat-mode" but path doesn't end with .chatmode.md`;
|
||||
}
|
||||
if (item.kind === "agent" && !item.path.endsWith(".agent.md")) {
|
||||
return `Item ${
|
||||
i + 1
|
||||
|
||||
@@ -34,7 +34,7 @@ function parseCollectionYaml(filePath) {
|
||||
|
||||
/**
|
||||
* Parse frontmatter from a markdown file using vfile-matter
|
||||
* Works with any markdown file that has YAML frontmatter (agents, prompts, chatmodes, instructions)
|
||||
* Works with any markdown file that has YAML frontmatter (agents, prompts, instructions)
|
||||
* @param {string} filePath - Path to the markdown file
|
||||
* @returns {object|null} Parsed frontmatter object or null on error
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user