EasyPlatform sync-to-copilot
[AI & Tools] Sync Claude Code knowledge to GitHub Copilot instructions. Creates/updates .github/copilot-instructions.md (project-specific) + .github/instructions/common-protocol.instructions.md (generic protocols) + per-group instruction files. Two-tier architecture: script generates structure, AI enriches with file-extracted summaries.
git clone https://github.com/duc01226/EasyPlatform
T=$(mktemp -d) && git clone --depth=1 https://github.com/duc01226/EasyPlatform "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/sync-to-copilot" ~/.claude/skills/duc01226-easyplatform-sync-to-copilot && rm -rf "$T"
.claude/skills/sync-to-copilot/SKILL.md<!-- /SYNC:critical-thinking-mindset --> <!-- SYNC:ai-mistake-prevention -->Critical Thinking Mindset — Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence >80% to act. Anti-hallucination: Never present guess as fact — cite sources for every claim, admit uncertainty freely, self-check output for errors, cross-reference independently, stay skeptical of own confidence — certainty without evidence root of all hallucination.
<!-- /SYNC:ai-mistake-prevention -->AI Mistake Prevention — Failure modes to avoid on every task:
- Check downstream references before deleting. Deleting components causes documentation and code staleness cascades. Map all referencing files before removal.
- Verify AI-generated content against actual code. AI hallucinates APIs, class names, and method signatures. Always grep to confirm existence before documenting or referencing.
- Trace full dependency chain after edits. Changing a definition misses downstream variables and consumers derived from it. Always trace the full chain.
- Trace ALL code paths when verifying correctness. Confirming code exists is not confirming it executes. Always trace early exits, error branches, and conditional skips — not just happy path.
- When debugging, ask "whose responsibility?" before fixing. Trace whether bug is in caller (wrong data) or callee (wrong handling). Fix at responsible layer — never patch symptom site.
- Assume existing values are intentional — ask WHY before changing. Before changing any constant, limit, flag, or pattern: read comments, check git blame, examine surrounding code.
- Verify ALL affected outputs, not just the first. Changes touching multiple stacks require verifying EVERY output. One green check is not all green checks.
- Holistic-first debugging — resist nearest-attention trap. When investigating any failure, list EVERY precondition first (config, env vars, DB names, endpoints, DI registrations, data preconditions), then verify each against evidence before forming any code-layer hypothesis.
- Surgical changes — apply the diff test. Bug fix: every changed line must trace directly to the bug. Don't restyle or improve adjacent code. Enhancement task: implement improvements AND announce them explicitly.
- Surface ambiguity before coding — don't pick silently. If request has multiple interpretations, present each with effort estimate and ask. Never assume all-records, file-based, or more complex path.
Skill: sync-to-copilot
Sync Claude Code knowledge to GitHub Copilot instructions. Two-tier output: project-specific + common protocol.
Quick Summary
Purpose: Keep Copilot instructions in sync with Claude Code workflows, dev rules, and project-reference docs.
Architecture (Two-Tier):
-
— Project-specific (always loaded by Copilot).github/copilot-instructions.md- TL;DR golden rules, decision table
- Project-reference docs index with READ prompts
- Key file locations, dev commands
-
— Generic protocols (applyTo:.github/instructions/common-protocol.instructions.md
)**/*- Prompt protocol, before-editing rules
- Workflow catalog (from workflows.json)
- Workflow execution protocol
- Development rules (from development-rules.md)
-
— Per-group (applyTo: file patterns).github/instructions/{group}.instructions.md- Enhanced summaries per doc with READ prompts
- Groups: backend, frontend, styling, testing, project
What gets synced:
- Workflow catalog (from workflows.json) — SCRIPT-GENERATED
- Dev rules (from development-rules.md) — SCRIPT-GENERATED
- Project-reference summaries (from copilot-registry.json) — SCRIPT-GENERATED
- Enriched section headings and key patterns — AI-GENERATED (this skill)
Usage:
/sync-to-copilot
Script:
.claude/scripts/sync-copilot-workflows.cjs
Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
When to Use This Skill
Trigger this skill when:
- Workflows added/modified — After editing
.claude/workflows.json - Development rules changed — After editing
.claude/docs/development-rules.md - Project-reference docs updated — After modifying files in
docs/project-reference/ - Registry entries changed — After editing
docs/copilot-registry.json - Regular maintenance — Quarterly sync to ensure Copilot parity
- Copilot setup — First-time Copilot instructions creation
Workflow
Phase 1: Script Generation (Automated)
node .claude/scripts/sync-copilot-workflows.cjs
This generates:
— project-specific with registry summaries.github/copilot-instructions.md
— generic protocols.github/instructions/common-protocol.instructions.md
— per-group instruction files.github/instructions/{group}.instructions.md- Removes old
if it exists.github/common.copilot-instructions.md
Phase 2: AI Enrichment (This Skill)
After the script runs, the AI MUST ATTENTION enrich the generated instruction files:
-
For each per-group instruction file in
:.github/instructions/- Read the corresponding
source filedocs/project-reference/*.md - Extract the
section headings from the source file## - Add a "Key Sections" list under each doc entry showing the headings
- Keep it concise — headings only, no content duplication
- Read the corresponding
-
For
:.github/copilot-instructions.md- Verify the TL;DR golden rules in
→docs/copilot-registry.json
still match CLAUDE.mdprojectInstructions.goldenRules - Check if any new project-reference files exist but are missing from
docs/copilot-registry.json - If missing entries found, add them to the registry and re-run the script
- Verify the TL;DR golden rules in
-
For
:docs/copilot-registry.json- Verify each
field accurately describes the current file contentsummary - Update stale summaries based on actual file content
- Add entries for any new
filesdocs/project-reference/*.md
- Verify each
Phase 3: Verification
Check that:
-
contains project-specific content.github/copilot-instructions.md -
contains protocols + workflow catalog.github/instructions/common-protocol.instructions.md - Per-group instruction files contain READ prompts
- No old
file remainscommon.copilot-instructions.md - Workflow count matches workflows.json
- All project-reference files are represented in the registry
AI Enrichment Protocol
When enriching per-group instruction files, follow this pattern for each doc entry:
## [Doc Title](relative/path) **Summary:** One-line summary from registry. **Key Sections:** - Section 1 Name - Section 2 Name - Section 3 Name - ... > **READ** `docs/project-reference/filename.md` when: trigger description
Rules:
- Extract ONLY
level headings from the source file (not##
or deeper)### - Do NOT copy content — just list heading names
- Keep the READ prompt from the registry
fieldwhenToRead - If a file is very large (>30KB), note the file size:
(~59KB - read relevant sections)
Output Files
| File | Type | Content |
|---|---|---|
| Project-specific | TL;DR + project-reference index + READ prompts |
| Generic (applyTo: ) | Prompt protocol + workflow catalog + dev rules |
| Backend (applyTo: ) | Backend doc summaries + READ prompts |
| Frontend (applyTo: ) | Frontend doc summaries + READ prompts |
| Styling (applyTo: ) | Styling doc summaries + READ prompts |
| Testing (applyTo: ) | Testing doc summaries + READ prompts |
| Cross-cutting (applyTo: ) | General project doc summaries + READ prompts |
Copilot Limitations
Copilot can't enforce protocols like Claude Code hooks:
- No blocking operations (edit-enforcement)
- Relies on LLM instruction-following (not guaranteed)
- Protocols are advisory, not enforced
- No runtime context injection — all context must be in instruction files
Benefits:
- Consistent guidance across AI tools
- Same workflow detection for Claude and Copilot users
- READ prompts enable on-demand context loading
- Automated sync reduces configuration drift
Troubleshooting
Issue: "workflows.json not found"
Solution: Ensure you're running from project root
Issue: Missing project-reference files in registry
Solution: Add entries to
docs/copilot-registry.json, then re-run script
Issue: Stale summaries
Solution: Run this skill — AI will read files and update summaries
Related Skills
— Broader Claude/Copilot sync (skills, prompts, agents)/ai-dev-tools-sync
— Workflow-only sync (subset of this skill)/sync-copilot-workflows
References
- Script:
.claude/scripts/sync-copilot-workflows.cjs - Registry:
docs/copilot-registry.json - Sources:
,.claude/workflows.json.claude/docs/development-rules.md - Main output:
.github/copilot-instructions.md - Instruction files:
.github/instructions/*.instructions.md
Closing Reminders
- IMPORTANT MUST ATTENTION break work into small todo tasks using
BEFORE startingTaskCreate - IMPORTANT MUST ATTENTION search codebase for 3+ similar patterns before creating new code
- IMPORTANT MUST ATTENTION cite
evidence for every claim (confidence >80% to act)file:line - IMPORTANT MUST ATTENTION add a final review todo task to verify work quality <!-- SYNC:critical-thinking-mindset:reminder -->
- MUST ATTENTION apply critical thinking — every claim needs traced proof, confidence >80% to act. Anti-hallucination: never present guess as fact. <!-- /SYNC:critical-thinking-mindset:reminder --> <!-- SYNC:ai-mistake-prevention:reminder -->
- MUST ATTENTION apply AI mistake prevention — holistic-first debugging, fix at responsible layer, surface ambiguity before coding, re-read files after compaction. <!-- /SYNC:ai-mistake-prevention:reminder -->