Skip to content

[Plugin] Claude Code Plugin + Script to automatically keep it in sync with the GHCPCLI Plugin.#569

Open
Jaylyn-Barbee wants to merge 5 commits into
mainfrom
jay/cc-ext
Open

[Plugin] Claude Code Plugin + Script to automatically keep it in sync with the GHCPCLI Plugin.#569
Jaylyn-Barbee wants to merge 5 commits into
mainfrom
jay/cc-ext

Conversation

@Jaylyn-Barbee
Copy link
Copy Markdown
Contributor

@Jaylyn-Barbee Jaylyn-Barbee commented Jun 5, 2026

Description

Adds a Claude Code-compatible plugin tree at .claude/ mirroring the existing GitHub Copilot plugin under .github/plugin/, plus tooling to keep the two in sync automatically. This lets us register the repo with the Claude Code community plugin marketplace using the same source-of-truth content (skills + agent) authored for Copilot, with no manual duplication.

The plan is to land this on main, sync to stable, and then add an external plugin reference in the cc-community repo pointing at this .claude/ tree.

What changed:

  • .claude/ (generated, checked in) — Claude Code project plugin layout:
    • .claude/agents/winapp.md (Copilot-only infer: frontmatter field stripped)
    • .claude/skills/winapp-{frameworks,identity,manifest,package,setup,signing,troubleshoot,ui-automation}/SKILL.md — directory names match the skill name: from frontmatter; sibling files (e.g. ui-automation/references/) preserved
  • scripts/sync-claude-plugin.ps1 — reads .github/plugin/ (source of truth), parses skill name: from frontmatter to derive Claude skill dir names, strips the Copilot-only infer: field from agents, and rebuilds .claude/skills and .claude/agents. Idempotent. Includes a -Check flag that exits 1 if .claude/ is stale (CI backstop).
  • scripts/generate-llm-docs.ps1 — now invokes the sync script as its final step, so .claude/ is regenerated in the same pipeline that already produces .github/plugin/skills/. Running scripts/build-cli.ps1 keeps both plugin trees in sync with no extra steps.
  • AGENTS.md — Auto-generation pipeline section updated to list .claude/ as a generated output.

Usage Example

# Normal flow — build-cli.ps1 already calls generate-llm-docs.ps1, which now also syncs .claude/
.\scripts\build-cli.ps1

# Or sync directly (e.g., after editing .github/plugin/ manually)
pwsh scripts/sync-claude-plugin.ps1

# CI/PR drift check (non-zero exit if .claude/ is out of date)
pwsh scripts/sync-claude-plugin.ps1 -Check

Related Issue

Type of Change

  • ✨ New feature
  • 🔧 Config/build
  • 📝 Documentation

Checklist

  • Tested locally on Windows (ran generate-llm-docs.ps1 end-to-end and verified [CLAUDE] syncing .claude/ from .github/plugin/ produces all 8 skills + agent; re-run reports "already up to date")
  • Agent skill templates updated in docs/fragments/skills/ — N/A (no CLI command/workflow changes; .claude/ is purely a mirror of the existing Copilot plugin)

Additional Notes

  • Source of truth: .github/plugin/ remains canonical. .claude/ is a generated output and should never be edited directly — edits will be overwritten on the next build.
  • Why hook into generate-llm-docs.ps1 instead of just adding a CI guard? The skills under .github/plugin/skills/ are themselves generated from docs/fragments/skills/ by that same script. Putting the .claude/ sync in the same place means both plugin trees come out of one build step, so contributors who follow the documented workflow ("Always call the build script at the end") get the sync for free. The -Check flag is available as a CI backstop if we want to add a workflow guard later.
  • Marketplace next steps: after merge, sync to stable, then add the external plugin reference in the cc-community repo.

AI Description

This PR introduces a new Claude Code-compatible plugin structure in the .claude/ directory, mirroring the existing GitHub Copilot plugin found in .github/plugin/, along with a syncing script to maintain their consistency. New skills and agent documentation have been added, allowing integration with the Claude Code community plugin marketplace without duplication of content. Users can now run the following commands to utilize this new functionality:

# Normal flow — build-cli.ps1 calls generate-llm-docs.ps1, which now syncs .claude/
.\scripts\build-cli.ps1

# Direct sync after editing .github/plugin/
pwsh scripts/sync-claude-plugin.ps1

# CI check for updates
pwsh scripts/sync-claude-plugin.ps1 -Check

@github-actions github-actions Bot added the enhancement New feature or request label Jun 5, 2026
Jaylyn-Barbee and others added 2 commits June 5, 2026 11:17
…i-schema.json

Running generate-llm-docs.ps1 against a stale 0.3.2 CLI binary regenerated
auto-generated tables and reverted recent description edits. Restore these
generated files to origin/main and re-run sync-claude-plugin.ps1 so .claude/
mirrors the correct content.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Build Metrics Report

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 31.45 MB 31.45 MB ✅ 0.0 KB (0.00%)
CLI (x64) 31.79 MB 31.79 MB ✅ 0.0 KB (0.00%)
MSIX (ARM64) 13.22 MB 13.22 MB 📈 +0.0 KB (+0.00%)
MSIX (x64) 14.05 MB 14.05 MB 📈 +0.0 KB (+0.00%)
NPM Package 27.50 MB 27.50 MB 📉 -0.0 KB (-0.00%)
NuGet Package 27.59 MB 27.59 MB 📈 +0.0 KB (+0.00%)
VS Code Extension 20.32 MB 20.32 MB 📈 +0.0 KB (+0.00%)

Test Results

1192 passed, 1 skipped out of 1193 tests in 460.9s (-7.8s vs. baseline)

Test Coverage

17.2% line coverage, 36.3% branch coverage · ✅ no change vs. baseline

CLI Startup Time

42ms median (x64, winapp --version) · ✅ no change vs. baseline


Updated 2026-06-05 20:24:00 UTC · commit 4dc9cc2 · workflow run

Jaylyn-Barbee and others added 2 commits June 5, 2026 14:54
The sync script wrote the agent file via Set-Content -Encoding utf8, which
produces UTF-8 BOM + CRLF on PowerShell 5 and UTF-8 no-BOM on PowerShell 7,
and .gitattributes had no eol=lf rule for .claude/** or .github/plugin/agents/**.
Together these meant sync-claude-plugin.ps1 -Check could trip false-positive
drift across Windows vs Linux contributors and CI.

Fix:
- sync-claude-plugin.ps1: write the agent with [File]::WriteAllText + UTF8 no-BOM
  and explicit LF normalization, matching the convention in generate-llm-docs.ps1.
- .gitattributes: force eol=lf for .claude/** and .github/plugin/agents/** so the
  on-disk bytes match what the sync writes on every platform.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Jaylyn-Barbee Jaylyn-Barbee marked this pull request as ready for review June 5, 2026 20:04
Copilot AI review requested due to automatic review settings June 5, 2026 20:04
Copy link
Copy Markdown
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 PR adds a Claude Code-compatible plugin tree under .claude/ that mirrors the existing Copilot plugin under .github/plugin/, and wires a sync step into the existing docs generation pipeline so the two stay aligned.

Changes:

  • Added scripts/sync-claude-plugin.ps1 to regenerate .claude/{skills,agents} from .github/plugin/ (including stripping the Copilot-only infer: frontmatter field from agents).
  • Updated scripts/generate-llm-docs.ps1, .gitattributes, and AGENTS.md to treat .claude/ as a generated, checked-in output kept in sync by the standard build/docs workflow.
  • Added the generated .claude/agents/winapp.md and .claude/skills/** content for Claude Code consumption.

Reviewed changes

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

Show a summary per file
File Description
scripts/sync-claude-plugin.ps1 New sync script that rebuilds .claude/ from .github/plugin/
scripts/generate-llm-docs.ps1 Hooks Claude sync into the existing LLM docs + skills generation pipeline
AGENTS.md Documents .claude/ as an auto-generated output
.gitattributes Enforces LF endings for .github/plugin/agents/** and .claude/**
.claude/agents/winapp.md Generated Claude agent mirror of the Copilot agent
.claude/skills/winapp-ui-automation/SKILL.md Generated Claude skill mirror
.claude/skills/winapp-ui-automation/references/ui-json-envelope.md Generated reference doc mirror
.claude/skills/winapp-troubleshoot/SKILL.md Generated Claude skill mirror
.claude/skills/winapp-signing/SKILL.md Generated Claude skill mirror
.claude/skills/winapp-setup/SKILL.md Generated Claude skill mirror
.claude/skills/winapp-package/SKILL.md Generated Claude skill mirror
.claude/skills/winapp-manifest/SKILL.md Generated Claude skill mirror
.claude/skills/winapp-identity/SKILL.md Generated Claude skill mirror
.claude/skills/winapp-frameworks/SKILL.md Generated Claude skill mirror

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +131 to +134
if ($diff) {
Write-Error ".claude/ is out of date. Run: pwsh scripts/sync-claude-plugin.ps1"
exit 1
}
Comment on lines +85 to +89
$skillName = Get-FrontmatterName -Path $skillFile
$destDir = Join-Path $tmpSkills $skillName
Copy-Item -LiteralPath $skillDir.FullName -Destination $destDir -Recurse
Write-Host "skill : $($skillDir.Name) -> .claude/skills/$skillName"
}
Comment on lines +306 to +313
$syncScript = Join-Path $PSScriptRoot 'sync-claude-plugin.ps1'
if (Test-Path $syncScript) {
Write-Host "`n[CLAUDE] syncing .claude/ from .github/plugin/" -ForegroundColor Gray
& $syncScript
if ($LASTEXITCODE -ne 0) {
Write-Error "sync-claude-plugin.ps1 failed (exit $LASTEXITCODE)"
exit $LASTEXITCODE
}
Comment on lines +105 to +121
### Add an execution alias

Execution aliases let users launch the app by typing its name in a terminal (e.g. `myapp`).

```powershell
# Add alias inferred from the Executable attribute in the manifest
winapp manifest add-alias

# Specify the alias name explicitly
winapp manifest add-alias --name myapp

# Target a specific manifest file
winapp manifest add-alias --manifest ./path/to/Package.appxmanifest
```

This adds a `uap5:AppExecutionAlias` extension to the manifest. If the alias already exists, the command reports it and exits successfully.

Comment on lines +28 to +31
### Electron (npm package)
Use the **npm package** (`@Microsoft/WinAppCli`), **not** the standalone CLI. The npm package includes:
- The native winapp CLI binary bundled inside `node_modules`
- A Node.js SDK with helpers for creating native C#/C++ addons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants