agent-sync
Detects and resolves platform drift between .claude/agents/*.md (Claude Code) and .github/agents/*.agent.md (Copilot/VS Code). Produces a drift report and applies corrective edits. Invoked exclusively by the agent-manager agent.
- License 许可
- GPL-3.0
- 最近更新
- 2026-06-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- agent-sync
- description
- Detects and resolves platform drift between .claude/agents/*.md (Claude Code) and .github/agents/*.agent.md (Copilot/VS Code). Produces a drift report and applies corrective edits. Invoked exclusively by the agent-manager agent.
03 SKILL.md 正文
Agent Sync
Use this skill when agent definitions on Claude Code and GitHub Copilot/VS Code have drifted apart, when a new agent was added to one platform but not the other, or when a full roster audit is needed. Parse the args to determine the operation mode, then execute the corresponding procedure.
Phase 0 — Context Load (silent)
- Read
.claude/CLAUDE.mdandAGENTS.mdto internalize project conventions, portability rules, and the tool exclusion list. - Invoke
Skill("manage-memory", args: "agent-manager")to load persistent memory (prior sync decisions, known exclusions, naming conventions). - Glob
.claude/agents/*.mdand.github/agents/*.agent.mdto build the current agent roster index.
Mode: audit
Args: audit
Scan all agents on both platforms and produce a drift report.
- Glob
.claude/agents/*.md— for each file, read frontmatter and extract:name,model,tools,description(first 120 chars),status. - Glob
.github/agents/*.agent.md— for each file, read frontmatter and extract:name,tools,status. - Build a cross-reference map keyed on agent
name. - Classify each entry:
- present-both — exists in both
.claude/agents/and.github/agents/ - claude-only — exists in
.claude/agents/but has no matching.github/agents/<name>.agent.md - copilot-only — exists in
.github/agents/but has no matching.claude/agents/<name>.md - drifted — exists on both platforms but
tools:,description, orstatusdiffer
- present-both — exists in both
- For each drifted agent, enumerate the specific field-level differences:
- Tools present in Claude but missing from Copilot (excluding the Claude-only tool exclusion list — those are expected to be absent)
- Tools present in Copilot but not sourced from Claude
- Description mismatch (first 120 chars differ)
statusfield mismatch
- Output a structured drift report:
## Agent Drift Report
| Agent | Claude | Copilot | Status | Drift |
|-------|--------|---------|--------|-------|
| <name> | ✅ | ✅ | active | tools differ |
| <name> | ✅ | ❌ | — | missing on Copilot |
| <name> | ❌ | ✅ | — | missing on Claude |
- Summarise counts: total agents, fully in sync, drifted, orphans.
Mode: sync
Args: sync <name>
Sync a single named agent from the Claude definition → Copilot, applying all tool exclusion rules.
- Read
.claude/agents/<name>.md; fail with a clear error if it does not exist. - Read
.github/agents/<name>.agent.mdif it exists (to preserve any Copilot-specific additions not in Claude). - Extract from the Claude frontmatter:
name,description,tools,model,color,status, any extra fields. - Apply the Claude-only Tool Exclusion List to the
tools:array:- Remove:
Bash,Glob,Grep,Read,TodoWrite,WebFetch,WebSearch,PushNotification,ToolSearch - Translate retained Claude tools to Copilot-native equivalents:
Read→read(if not already excluded)Edit/Write→editGlob/Grep→searchBash→executeTodoWrite→todoAgent→agent
- Preserve MCP tools verbatim (names containing
mcp__or mapping to an MCP server)
- Remove:
- Copy the body (non-frontmatter content) verbatim from the Claude file.
- Write
.github/agents/<name>.agent.mdwith the translated frontmatter and copied body. - Confirm: "Agent
<name>synced to.github/agents/<name>.agent.md."
Mode: sync-all
Args: sync-all
Run sync <name> for every agent currently in the Claude roster.
- Glob
.claude/agents/*.md— collect all agent names. - Filter out agents with
status: deprecatedin frontmatter (skip deprecated agents, report them separately). - For each remaining agent name, execute Mode: sync in sequence.
- Produce a summary: agents synced, agents skipped (deprecated), any errors encountered.
Mode: diff
Args: diff <name>
Show a structured diff between the Claude and Copilot versions of a single agent.
- Read
.claude/agents/<name>.md; fail if it does not exist. - Read
.github/agents/<name>.agent.md; fail if it does not exist. - Compare frontmatter field by field:
name— must be identicaldescription— show first 120 chars of each; flag if differenttools— list tools in Claude but not Copilot, tools in Copilot but not Claude (ignoring expected exclusions)model— show both valuesstatus— show both values
- Compare body sections: identify headings present in one file but absent from the other.
- Output:
## Agent Diff: <name>
### Frontmatter
| Field | Claude | Copilot |
|-------|--------|---------|
| name | <val> | <val> |
| description | <first 120 chars> | <first 120 chars> |
| tools (extra in Claude) | Bash, Glob | (excluded — expected) |
| tools (extra in Copilot) | execute | (translated from Bash — ok) |
| model | <val> | <val> |
| status | <val> | <val> |
### Body Sections
| Section heading | Claude | Copilot |
|-----------------|--------|---------|
| ## Responsibilities | ✅ | ✅ |
| ## Skills | ✅ | ❌ |
- Conclude with: In sync / Drifted — run
sync <name>to resolve.
Validation Rules
- The Claude-only Tool Exclusion List is always applied during sync — never copy
Bash,Glob,Grep,Read,TodoWrite,WebFetch,WebSearch,PushNotification, orToolSearchto.github/agents/. - Agent names must be kebab-case and identical on both platforms.
- Never delete any agent file —
sync-allonly creates or overwrites the Copilot counterpart. - Deprecated agents are skipped during
sync-allbut reported. - Never read or modify
.envfiles or sensitive configuration.
04 同仓库更多 Skills
write-tests
Test implementation skill for HypermediaEngine. Takes a confirmed test plan from design-test-cases and produces compilable, runnable xUnit tests following project conventions. Validates coverage quality through mutation testing. Invoked by the sqa-engineer agent after the test plan is approved.
write-documentation
Structured documentation writing workflow for HypermediaEngine. Writes or updates README.md files at the repo root and in each project directory (src/, tests/, samples/, etc.) based on current implementation, ADRs, and architecture decisions.
write-adr
Writes a numbered Architecture Decision Record (ADR) for a significant architectural choice in the HypermediaEngine project. Invoked by the software-architect agent whenever a consequential design decision is made or ratified. Saves the ADR to docs/architecture/decisions/.
tunit-playwright-ui-testing
Comprehensive guidance for writing coded end-to-end UI tests in C# using TUnit.Playwright. Tests inherit from PageTest — the base class manages all browser lifecycle. Covers NuGet setup, PageTest inheritance, Page Object Model, browser configuration, parallelism limiting, and CI integration. Based on the official TUnit docs at https://tunit.dev/docs/examples/playwright.
triage
Task classification, decomposition, dependency mapping, and routing skill. Invoked by the triage-agent to break any user request into discrete, independently-routable work items with assigned priorities and agent chains.
system-design
Expert system design skill. Use PROACTIVELY to design systems, review architectures, and assist software engineers in learning design principles and implementing them in the code with design patterns.