mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-22 11:25:13 +00:00
Remove prompts infrastructure from build scripts
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
This commit is contained in:
@@ -21,31 +21,16 @@ Team and project-specific instructions to enhance GitHub Copilot's behavior for
|
||||
- Create task-specific \`*.instructions.md\` files in your workspace's \`.github/instructions/\` folder (e.g., \`.github/instructions/my-csharp-rules.instructions.md\`)
|
||||
- Instructions automatically apply to Copilot behavior once installed in your workspace`,
|
||||
|
||||
promptsSection: `## 🎯 Reusable Prompts
|
||||
|
||||
Ready-to-use prompt templates for specific development scenarios and tasks, defining prompt text with a specific mode, model, and available set of tools.`,
|
||||
|
||||
promptsUsage: `### How to Use Reusable Prompts
|
||||
|
||||
**To Install:**
|
||||
- Click the **VS Code** or **VS Code Insiders** install button for the prompt you want to use
|
||||
- Download the \`*.prompt.md\` file and manually add it to your prompt collection
|
||||
|
||||
**To Run/Execute:**
|
||||
- Use \`/prompt-name\` in VS Code chat after installation
|
||||
- Run the \`Chat: Run Prompt\` command from the Command Palette
|
||||
- Hit the run button while you have a prompt file open in VS Code`,
|
||||
|
||||
pluginsSection: `## 🔌 Plugins
|
||||
|
||||
Curated plugins of related prompts, agents, and skills organized around specific themes, workflows, or use cases. Plugins can be installed directly via GitHub Copilot CLI.`,
|
||||
Curated plugins of related agents and skills organized around specific themes, workflows, or use cases. Plugins can be installed directly via GitHub Copilot CLI.`,
|
||||
|
||||
pluginsUsage: `### How to Use Plugins
|
||||
|
||||
**Browse Plugins:**
|
||||
- ⭐ Featured plugins are highlighted and appear at the top of the list
|
||||
- Explore themed plugins that group related customizations
|
||||
- Each plugin includes prompts, agents, and skills for specific workflows
|
||||
- Each plugin includes agents and skills for specific workflows
|
||||
- Plugins make it easy to adopt comprehensive toolkits for particular scenarios
|
||||
|
||||
**Install Plugins:**
|
||||
@@ -55,7 +40,7 @@ Curated plugins of related prompts, agents, and skills organized around specific
|
||||
|
||||
featuredPluginsSection: `## 🌟 Featured Plugins
|
||||
|
||||
Discover our curated plugins of prompts, agents, and skills organized around specific themes and workflows.`,
|
||||
Discover our curated plugins of agents and skills organized around specific themes and workflows.`,
|
||||
|
||||
agentsSection: `## 🤖 Custom Agents
|
||||
|
||||
@@ -140,14 +125,12 @@ const repoBaseUrl =
|
||||
|
||||
const AKA_INSTALL_URLS = {
|
||||
instructions: "https://aka.ms/awesome-copilot/install/instructions",
|
||||
prompt: "https://aka.ms/awesome-copilot/install/prompt",
|
||||
agent: "https://aka.ms/awesome-copilot/install/agent",
|
||||
hook: "https://aka.ms/awesome-copilot/install/hook",
|
||||
};
|
||||
|
||||
const ROOT_FOLDER = path.join(__dirname, "..");
|
||||
const INSTRUCTIONS_DIR = path.join(ROOT_FOLDER, "instructions");
|
||||
const PROMPTS_DIR = path.join(ROOT_FOLDER, "prompts");
|
||||
const AGENTS_DIR = path.join(ROOT_FOLDER, "agents");
|
||||
const SKILLS_DIR = path.join(ROOT_FOLDER, "skills");
|
||||
const HOOKS_DIR = path.join(ROOT_FOLDER, "hooks");
|
||||
@@ -172,7 +155,6 @@ export {
|
||||
HOOKS_DIR,
|
||||
INSTRUCTIONS_DIR,
|
||||
MAX_PLUGIN_ITEMS,
|
||||
PROMPTS_DIR,
|
||||
repoBaseUrl,
|
||||
ROOT_FOLDER,
|
||||
SKILL_DESCRIPTION_MAX_LENGTH,
|
||||
|
||||
@@ -26,7 +26,6 @@ function copyDirRecursive(src, dest) {
|
||||
* Resolve a plugin-relative path to the repo-root source file.
|
||||
*
|
||||
* ./agents/foo.md → ROOT/agents/foo.agent.md
|
||||
* ./commands/bar.md → ROOT/prompts/bar.prompt.md
|
||||
* ./skills/baz/ → ROOT/skills/baz/
|
||||
*/
|
||||
function resolveSource(relPath) {
|
||||
@@ -34,9 +33,6 @@ function resolveSource(relPath) {
|
||||
if (relPath.startsWith("./agents/")) {
|
||||
return path.join(ROOT_FOLDER, "agents", `${basename}.agent.md`);
|
||||
}
|
||||
if (relPath.startsWith("./commands/")) {
|
||||
return path.join(ROOT_FOLDER, "prompts", `${basename}.prompt.md`);
|
||||
}
|
||||
if (relPath.startsWith("./skills/")) {
|
||||
// Strip trailing slash and get the skill folder name
|
||||
const skillName = relPath.replace(/^\.\/skills\//, "").replace(/\/$/, "");
|
||||
@@ -59,7 +55,6 @@ function materializePlugins() {
|
||||
.sort();
|
||||
|
||||
let totalAgents = 0;
|
||||
let totalCommands = 0;
|
||||
let totalSkills = 0;
|
||||
let warnings = 0;
|
||||
let errors = 0;
|
||||
@@ -104,27 +99,6 @@ function materializePlugins() {
|
||||
}
|
||||
}
|
||||
|
||||
// Process commands
|
||||
if (Array.isArray(metadata.commands)) {
|
||||
for (const relPath of metadata.commands) {
|
||||
const src = resolveSource(relPath);
|
||||
if (!src) {
|
||||
console.warn(` ⚠ ${pluginName}: Unknown path format: ${relPath}`);
|
||||
warnings++;
|
||||
continue;
|
||||
}
|
||||
if (!fs.existsSync(src)) {
|
||||
console.warn(` ⚠ ${pluginName}: Source not found: ${src}`);
|
||||
warnings++;
|
||||
continue;
|
||||
}
|
||||
const dest = path.join(pluginPath, relPath.replace(/^\.\//, ""));
|
||||
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
||||
fs.copyFileSync(src, dest);
|
||||
totalCommands++;
|
||||
}
|
||||
}
|
||||
|
||||
// Process skills
|
||||
if (Array.isArray(metadata.skills)) {
|
||||
for (const relPath of metadata.skills) {
|
||||
@@ -147,14 +121,13 @@ function materializePlugins() {
|
||||
|
||||
const counts = [];
|
||||
if (metadata.agents?.length) counts.push(`${metadata.agents.length} agents`);
|
||||
if (metadata.commands?.length) counts.push(`${metadata.commands.length} commands`);
|
||||
if (metadata.skills?.length) counts.push(`${metadata.skills.length} skills`);
|
||||
if (counts.length) {
|
||||
console.log(`✓ ${pluginName}: ${counts.join(", ")}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`\nDone. Copied ${totalAgents} agents, ${totalCommands} commands, ${totalSkills} skills.`);
|
||||
console.log(`\nDone. Copied ${totalAgents} agents, ${totalSkills} skills.`);
|
||||
if (warnings > 0) {
|
||||
console.log(`${warnings} warning(s).`);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
HOOKS_DIR,
|
||||
INSTRUCTIONS_DIR,
|
||||
PLUGINS_DIR,
|
||||
PROMPTS_DIR,
|
||||
repoBaseUrl,
|
||||
ROOT_FOLDER,
|
||||
SKILLS_DIR,
|
||||
@@ -341,63 +340,6 @@ function generateInstructionsSection(instructionsDir) {
|
||||
return `${TEMPLATES.instructionsSection}\n${TEMPLATES.instructionsUsage}\n\n${instructionsContent}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the prompts section with a table of all prompts
|
||||
*/
|
||||
function generatePromptsSection(promptsDir) {
|
||||
// Check if directory exists
|
||||
if (!fs.existsSync(promptsDir)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// Get all prompt files
|
||||
const promptFiles = fs
|
||||
.readdirSync(promptsDir)
|
||||
.filter((file) => file.endsWith(".prompt.md"));
|
||||
|
||||
// Map prompt files to objects with title for sorting
|
||||
const promptEntries = promptFiles.map((file) => {
|
||||
const filePath = path.join(promptsDir, file);
|
||||
const title = extractTitle(filePath);
|
||||
return { file, filePath, title };
|
||||
});
|
||||
|
||||
// Sort by title alphabetically
|
||||
promptEntries.sort((a, b) => a.title.localeCompare(b.title));
|
||||
|
||||
console.log(`Found ${promptEntries.length} prompt files`);
|
||||
|
||||
// Return empty string if no files found
|
||||
if (promptEntries.length === 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// Create table header
|
||||
let promptsContent = "| Title | Description |\n| ----- | ----------- |\n";
|
||||
|
||||
// Generate table rows for each prompt file
|
||||
for (const entry of promptEntries) {
|
||||
const { file, filePath, title } = entry;
|
||||
const link = encodeURI(`prompts/${file}`);
|
||||
|
||||
// Check if there's a description in the frontmatter
|
||||
const customDescription = extractDescription(filePath);
|
||||
|
||||
// Create badges for installation links
|
||||
const badges = makeBadges(link, "prompt");
|
||||
|
||||
if (customDescription && customDescription !== "null") {
|
||||
promptsContent += `| [${title}](../${link})<br />${badges} | ${formatTableCell(
|
||||
customDescription
|
||||
)} |\n`;
|
||||
} else {
|
||||
promptsContent += `| [${title}](../${link})<br />${badges} | | |\n`;
|
||||
}
|
||||
}
|
||||
|
||||
return `${TEMPLATES.promptsSection}\n${TEMPLATES.promptsUsage}\n\n${promptsContent}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate MCP server links for an agent
|
||||
* @param {string[]} servers - Array of MCP server names
|
||||
@@ -918,7 +860,6 @@ async function main() {
|
||||
/^##\s/m,
|
||||
"# "
|
||||
);
|
||||
const promptsHeader = TEMPLATES.promptsSection.replace(/^##\s/m, "# ");
|
||||
const agentsHeader = TEMPLATES.agentsSection.replace(/^##\s/m, "# ");
|
||||
const hooksHeader = TEMPLATES.hooksSection.replace(/^##\s/m, "# ");
|
||||
const skillsHeader = TEMPLATES.skillsSection.replace(/^##\s/m, "# ");
|
||||
@@ -934,13 +875,6 @@ async function main() {
|
||||
TEMPLATES.instructionsUsage,
|
||||
registryNames
|
||||
);
|
||||
const promptsReadme = buildCategoryReadme(
|
||||
generatePromptsSection,
|
||||
PROMPTS_DIR,
|
||||
promptsHeader,
|
||||
TEMPLATES.promptsUsage,
|
||||
registryNames
|
||||
);
|
||||
// Generate agents README
|
||||
const agentsReadme = buildCategoryReadme(
|
||||
generateAgentsSection,
|
||||
@@ -987,7 +921,6 @@ async function main() {
|
||||
path.join(DOCS_DIR, "README.instructions.md"),
|
||||
instructionsReadme
|
||||
);
|
||||
writeFileIfChanged(path.join(DOCS_DIR, "README.prompts.md"), promptsReadme);
|
||||
writeFileIfChanged(path.join(DOCS_DIR, "README.agents.md"), agentsReadme);
|
||||
writeFileIfChanged(path.join(DOCS_DIR, "README.hooks.md"), hooksReadme);
|
||||
writeFileIfChanged(path.join(DOCS_DIR, "README.skills.md"), skillsReadme);
|
||||
|
||||
@@ -68,7 +68,6 @@ function validateSpecPaths(plugin) {
|
||||
const errors = [];
|
||||
const specs = {
|
||||
agents: { prefix: "./agents/", suffix: ".md", repoDir: "agents", repoSuffix: ".agent.md" },
|
||||
commands: { prefix: "./commands/", suffix: ".md", repoDir: "prompts", repoSuffix: ".prompt.md" },
|
||||
skills: { prefix: "./skills/", suffix: "/", repoDir: "skills", repoFile: "SKILL.md" },
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user