rules-instructions-sync
Detects and resolves drift between .claude/rules/*.md (Claude rules) and .github/instructions/*.instructions.md (Copilot instructions files). Ensures every rule has a matching instructions file and vice versa. Invoked exclusively by the agent-manager agent.
- License 许可
- GPL-3.0
- 最近更新
- 2026-06-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- rules-instructions-sync
- description
- Detects and resolves drift between .claude/rules/*.md (Claude rules) and .github/instructions/*.instructions.md (Copilot instructions files). Ensures every rule has a matching instructions file and vice versa. Invoked exclusively by the agent-manager agent.
03 SKILL.md 正文
Rules or Instructions Sync
Use this skill when rule and instructions files have drifted apart, when a rule was added to one platform but not the other, or when a full rules/instructions 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 and portability rules. - Invoke
Skill("manage-memory", args: "agent-manager")to load persistent memory (prior sync decisions, known rule names, naming conventions). - Glob
.claude/rules/*.mdand.github/instructions/*.instructions.mdto build the current rules/instructions inventory.
Mode: audit
Args: audit
List all rules and instructions files, flag orphans and content drift.
- Glob
.claude/rules/*.md— for each file read frontmatter and extract:name(derived from filename),descriptionor first heading,status. - Glob
.github/instructions/*.instructions.md— for each file read frontmatter and extract:name(derived from filename, strip.instructions.mdsuffix),descriptionor first heading,applyTo(if present). - Normalise names: strip
.md/.instructions.mdextensions to get the bare rule name. - Build a cross-reference map keyed on bare name.
- Classify each entry:
- present-both —
.claude/rules/<name>.mdand.github/instructions/<name>.instructions.mdboth exist - rule-only —
.claude/rules/<name>.mdexists but no.github/instructions/<name>.instructions.md - instructions-only —
.github/instructions/<name>.instructions.mdexists but no.claude/rules/<name>.md - drifted — both files exist but their content (description, first heading, or body) differs significantly
- present-both —
- For drifted pairs, show the first heading or description from each side.
- Output a structured audit report:
## Rules / Instructions Drift Report
| Name | Claude rule | Copilot instructions | Status | Drift |
|------|-------------|---------------------|--------|-------|
| <name> | ✅ | ✅ | in sync | — |
| <name> | ✅ | ❌ | — | missing instructions file |
| <name> | ❌ | ✅ | — | missing rule file |
| <name> | ✅ | ✅ | drifted | content mismatch |
- Summarise counts: total pairs, fully in sync, drifted, orphans.
Mode: sync
Args: sync <name>
Sync a single named rule→instructions pair, using the Claude rule as the authoritative source.
- Read
.claude/rules/<name>.md; fail with a clear error if it does not exist. - Read
.github/instructions/<name>.instructions.mdif it already exists (to detect what would change). - Derive the Copilot instructions file content from the Claude rule:
- Preserve any
applyTofrontmatter from the existing Copilot file if it does not conflict. - Copy body content verbatim from the Claude rule.
- Set
descriptionfrontmatter to match the Claude rule'sdescriptionif present.
- Preserve any
- Write
.github/instructions/<name>.instructions.md. - Confirm: "Rule
<name>synced to.github/instructions/<name>.instructions.md."
Mode: sync-all
Args: sync-all
Run sync <name> for every rule currently in the Claude rules directory.
- Glob
.claude/rules/*.md— collect all bare names. - Filter out rules with
status: deprecatedin frontmatter (skip deprecated, report them separately). - For each remaining name, execute Mode: sync in sequence.
- Produce a summary: pairs synced, pairs skipped (deprecated), any errors encountered.
Mode: diff
Args: diff <name>
Show a structured diff between the Claude rule and Copilot instructions file for a single name.
- Read
.claude/rules/<name>.md; fail if it does not exist. - Read
.github/instructions/<name>.instructions.md; fail if it does not exist. - Compare frontmatter:
description— show both; flag if differentapplyTo— Copilot only; note presence/absencestatus— show both if present
- Compare body sections: identify headings present in one file but absent from the other; compare first 200 chars of each matching section.
- Output:
## Rule/Instructions Diff: <name>
### Frontmatter
| Field | Claude rule | Copilot instructions |
|-------|-------------|---------------------|
| description | <val> | <val> |
| applyTo | n/a | <val> |
| status | <val> | <val> |
### Body Sections
| Section heading | Claude rule | Copilot instructions |
|-----------------|-------------|---------------------|
| ## Overview | ✅ | ✅ |
| ## Examples | ✅ | ❌ |
- Conclude with: In sync / Drifted — run
sync <name>to resolve.
Validation Rules
- Every Claude rule (
.claude/rules/<name>.md) should have a matching Copilot instructions file (.github/instructions/<name>.instructions.md). - Rule and instructions file names must be identical (modulo the
.instructions.mdvs.mdextension difference). - Never delete any rule or instructions file — use deprecation patterns when retiring.
- 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.