feat(plugin): add cowork-converter#2091
Conversation
Converts a GitHub Copilot CLI / Claude Code plugin to a Microsoft 365 Copilot Cowork package (.zip). - skills/cowork-converter/skill.md — skill definition with source format detection, validation rules, and sideload instructions - skills/cowork-converter/scripts/convert.py — Python 3 converter (stdlib only, no third-party deps): discovers skills, validates name/folder match and companion file limits, resolves shared references per-skill, generates manifest.json v1.28, creates placeholder icons, packages a compliant zip - plugins/cowork-converter/.github/plugin/plugin.json — plugin metadata - plugins/cowork-converter/README.md — usage documentation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔒 PR Risk Scan ResultsScanned 7 changed file(s).
|
🔍 Skill Validator Results✅ All checks passed
Summary
Full validator output |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new cowork-converter plugin/skill to the Awesome Copilot collection, intended to convert existing Copilot/Claude skills layouts into a Microsoft 365 Copilot Cowork zip package (manifest + per-skill folders + icons), using a standalone Python (stdlib-only) conversion script.
Changes:
- Introduces a new skill definition and a Python converter script for packaging skills into a Cowork-compliant
.zip. - Adds a new plugin (
plugins/cowork-converter) that ships the skill. - Updates generated documentation indexes and marketplace metadata to include the new skill/plugin.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/cowork-converter/skill.md | Adds the skill documentation/workflow (but currently not in the expected SKILL.md location/name). |
| skills/cowork-converter/scripts/convert.py | Implements the conversion/validation/packaging logic in Python. |
| plugins/cowork-converter/README.md | Plugin-level usage documentation and examples. |
| plugins/cowork-converter/.github/plugin/plugin.json | Plugin metadata and skill inclusion. |
| docs/README.skills.md | Adds the skill to the generated skills index (currently links to a non-existent SKILL.md). |
| docs/README.plugins.md | Adds the plugin to the generated plugins index. |
| .github/plugin/marketplace.json | Adds the plugin entry to the generated marketplace list. |
| | [copilot-spaces](../skills/copilot-spaces/SKILL.md)<br />`gh skills install github/awesome-copilot copilot-spaces` | Use Copilot Spaces to provide project-specific context to conversations. Use this skill when users mention a "Copilot space", want to load context from a shared knowledge base, discover available spaces, or ask questions grounded in curated project documentation, code, and instructions. | None | | ||
| | [copilot-usage-metrics](../skills/copilot-usage-metrics/SKILL.md)<br />`gh skills install github/awesome-copilot copilot-usage-metrics` | Retrieve and display GitHub Copilot usage metrics for organizations and enterprises using the GitHub CLI and REST API. | `get-enterprise-metrics.sh`<br />`get-enterprise-user-metrics.sh`<br />`get-org-metrics.sh`<br />`get-org-user-metrics.sh` | | ||
| | [cosmosdb-datamodeling](../skills/cosmosdb-datamodeling/SKILL.md)<br />`gh skills install github/awesome-copilot cosmosdb-datamodeling` | Step-by-step guide for capturing key application requirements for NoSQL use-case and produce Azure Cosmos DB Data NoSQL Model design using best practices and common patterns, artifacts_produced: "cosmosdb_requirements.md" file and "cosmosdb_data_model.md" file | None | | ||
| | [cowork-converter](../skills/cowork-converter/SKILL.md)<br />`gh skills install github/awesome-copilot cowork-converter` | Convert a GitHub Copilot CLI plugin, Claude Code plugin, or any agent-skills directory into a Microsoft 365 Copilot Cowork package (.zip). Use when the user asks to convert, package, or publish a plugin to Cowork, mentions 'Cowork plugin', 'M365 Cowork', or asks to create a cowork.zip. Also triggers if the user asks to transform skills for Microsoft 365 Copilot distribution. | `scripts/convert.py`<br />`skill.md` | |
| def companion_file_ok(path: Path) -> tuple[bool, str]: | ||
| name = path.name | ||
| if name.startswith("."): | ||
| return False, f"hidden file: {name}" | ||
| if name.upper() in UNSAFE_NAMES: | ||
| return False, f"Windows reserved name: {name}" | ||
| if ".." in path.parts: | ||
| return False, f"path traversal: {path}" | ||
| return True, "" |
| import argparse | ||
| import json | ||
| import os | ||
| import re | ||
| import shutil | ||
| import struct | ||
| import sys | ||
| import uuid | ||
| import zipfile | ||
| import zlib | ||
| from pathlib import Path |
| plugin_slug = re.sub(r"[^a-z0-9-]", "-", args.name_short.lower()).strip("-") | ||
| output_root = Path(args.output).expanduser().resolve() if args.output else source.parent | ||
| out = output_root / f"{plugin_slug}-cowork" | ||
|
|
| out.mkdir(parents=True) | ||
| skills_out = out / "skills" | ||
| skills_out.mkdir() | ||
|
|
||
| # ── Discover skills ─────────────────────────────────────────────────────── | ||
| skill_folders = discover_skills(source) | ||
| if not skill_folders: | ||
| print("ERROR: No skills found (looking for SKILL.md in sub-directories).", file=sys.stderr) | ||
| return 1 |
| def generate_placeholder_icon(size: int, color_hex: str = "#0078D4") -> bytes: | ||
| """Generate a minimal solid-color PNG.""" | ||
| r = int(color_hex[1:3], 16) | ||
| g = int(color_hex[3:5], 16) | ||
| b = int(color_hex[5:7], 16) | ||
|
|
| zip_path = output_root / f"{plugin_slug}-cowork.zip" | ||
| with zipfile.ZipFile(zip_path, "w", compression=zipfile.ZIP_DEFLATED) as zf: | ||
| for file in sorted(out.rglob("*")): | ||
| if file.is_file() and not file.name.startswith("."): | ||
| zf.write(file, file.relative_to(out)) | ||
|
|
aaronpowell
left a comment
There was a problem hiding this comment.
I think this skill is overly complicated. There is a docs page (https://learn.microsoft.com/en-us/microsoft-365/copilot/cowork/cowork-plugin-development) that covers how to create them, and it provides a PowerShell script that will generate the package, which would be better to use than a bespoke Python script as you'd be using the official one.
Summary
Adds the cowork-converter plugin — a skill that converts a GitHub Copilot CLI plugin, Claude Code plugin, or any agent-skills directory into a distributable Microsoft 365 Copilot Cowork package (zip).
What it does
SKILL.mdfiles) from Copilot CLI, Claude Code, or bare-skills layoutsname/folder match and companion file limits per the Cowork specreferences/folders (Cowork requires per-skill locality)manifest.jsonv1.28 withagentSkills[]entries.ziprooted atmanifest.jsonTrigger phrases
Files added
skills/cowork-converter/skill.mdskills/cowork-converter/scripts/convert.pyplugins/cowork-converter/.github/plugin/plugin.jsonplugins/cowork-converter/README.mdChecklist
stagednpm install && npm startrun —docs/README.skills.md,docs/README.plugins.md, andmarketplace.jsonupdatednamematches folder name (cowork-converter)