feat: Add GitHub Copilot converter target

Add Copilot as the 6th converter target, transforming Claude Code plugins
into Copilot's native format: custom agents (.agent.md), agent skills
(SKILL.md), and MCP server configuration JSON.

Component mapping:
- Agents → .github/agents/{name}.agent.md (with Copilot frontmatter)
- Commands → .github/skills/{name}/SKILL.md
- Skills → .github/skills/{name}/ (copied as-is)
- MCP servers → .github/copilot-mcp-config.json
- Hooks → skipped with warning

Also adds `compound sync copilot` support and fixes YAML quoting for
the `*` character in frontmatter serialization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Brayan Jules
2026-02-15 00:14:40 -03:00
parent 134a994c08
commit 4f7c598f27
15 changed files with 1765 additions and 6 deletions

View File

@@ -7,9 +7,10 @@ import { syncToCodex } from "../sync/codex"
import { syncToPi } from "../sync/pi"
import { syncToDroid } from "../sync/droid"
import { syncToCursor } from "../sync/cursor"
import { syncToCopilot } from "../sync/copilot"
import { expandHome } from "../utils/resolve-home"
const validTargets = ["opencode", "codex", "pi", "droid", "cursor"] as const
const validTargets = ["opencode", "codex", "pi", "droid", "cursor", "copilot"] as const
type SyncTarget = (typeof validTargets)[number]
function isValidTarget(value: string): value is SyncTarget {
@@ -42,19 +43,21 @@ function resolveOutputRoot(target: SyncTarget): string {
return path.join(os.homedir(), ".factory")
case "cursor":
return path.join(process.cwd(), ".cursor")
case "copilot":
return path.join(process.cwd(), ".github")
}
}
export default defineCommand({
meta: {
name: "sync",
description: "Sync Claude Code config (~/.claude/) to OpenCode, Codex, Pi, Droid, or Cursor",
description: "Sync Claude Code config (~/.claude/) to OpenCode, Codex, Pi, Droid, Cursor, or Copilot",
},
args: {
target: {
type: "string",
required: true,
description: "Target: opencode | codex | pi | droid | cursor",
description: "Target: opencode | codex | pi | droid | cursor | copilot",
},
claudeHome: {
type: "string",
@@ -100,6 +103,9 @@ export default defineCommand({
case "cursor":
await syncToCursor(config, outputRoot)
break
case "copilot":
await syncToCopilot(config, outputRoot)
break
}
console.log(`✓ Synced to ${args.target}: ${outputRoot}`)