rules-management
Create, modify, delete, and sync Claude rules files (.claude/rules/*.md) and GitHub Copilot instruction files (.github/instructions/*.instructions.md) safely using a discovery-first, non-destructive workflow. Invoked by agent-manager whenever a rules or instructions file lifecycle operation is requested.
- License 许可
- GPL-3.0
- 最近更新
- 2026-06-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- rules-management
- description
- Create, modify, delete, and sync Claude rules files (.claude/rules/*.md) and GitHub Copilot instruction files (.github/instructions/*.instructions.md) safely using a discovery-first, non-destructive workflow. Invoked by agent-manager whenever a rules or instructions file lifecycle operation is requested.
03 SKILL.md 正文
Rules and Instructions Management
Use this skill when a user asks to create, update, or remove a repository rule or instruction file on either the Claude Code or GitHub Copilot platform in this repository.
This skill is platform-aware and actionable. It always discovers existing rule and instruction files first, then applies minimal, reversible changes. Both platforms are kept in sync unless a platform-specific scope is explicitly requested.
This skill is invoked by agent-manager for rules and instructions lifecycle operations.
Inputs Expected
- Operation:
create|modify|delete|sync - Platform target:
claude|copilot|both(default:both) - Rule/instruction name: kebab-case identifier
- Description: what the rule or instruction enforces
- Scope pattern:
globsfor Claude rules andapplyTofor Copilot instructions - Body: the markdown guidance content to enforce
If any required input is missing, ask only the minimum clarifying questions needed to proceed.
Phase 0 - Context Load (silent)
- Read
.claude/CLAUDE.mdandAGENTS.md. - Invoke
Skill("manage-memory", args: "agent-manager"). - Read repository governance files relevant to rule and instruction ownership.
- Discover current rule and instruction surfaces before proposing edits.
Phase 1 - Discovery And Classification
- Glob
.claude/rules/*.md- list all existing Claude rules files. - Glob
.github/instructions/*.instructions.md- list all existing Copilot instruction files. - Build an inventory table:
Name Claude rule path Copilot instruction path Status - Check for drift (rule exists on one platform but not the other).
- Classify request into one mutation strategy:
create- neither platform file exists for the given namemodify- one or both platform files exist and need updatingdelete- one or both platform files must be removedsync- files exist on both platforms but have drifted out of sync
Decision rule:
- If operation is
modifyordeleteand the target file is not discoverable, pause and ask for disambiguation instead of guessing.
Phase 2 - Plan The Change
- Identify exact file paths for all affected files.
- Determine minimum edit set:
- For
create: new file(s) to write - For
modify: field(s) or section(s) to update - For
delete: file(s) to archive/remove - For
sync: diff both files and reconcile to the authoritative source
- For
- Confirm scope with the caller if ambiguous (for example, only one platform was targeted).
- For
delete, require explicit confirmation before any irreversible removal.
Phase 3 - Execute
create
Claude rule - write .claude/rules/<name>.md:
---
description: <one-line description>
globs: "**/*"
alwaysApply: false
---
# <Rule Title>
<rule body>
Copilot instruction - write .github/instructions/<name>.instructions.md:
---
applyTo: "**/*"
description: "<one-line description>"
---
# <Instruction Title>
<instruction body>
modify
- Read both existing files.
- Apply requested changes to frontmatter fields (
description,globs/applyTo,alwaysApply) and body sections. - Keep both files in sync unless a platform-specific change is explicitly requested.
- Preserve all unrelated content.
delete
- Default to soft delete: rename to
<name>.md.deprecated(Claude) or<name>.instructions.md.deprecated(Copilot). - Hard delete only with explicit
hard-deleteflag and user confirmation. - Report what was removed or archived.
sync
- Diff the Claude rule and Copilot instruction for the same name.
- Identify which is authoritative (typically the one most recently updated, or the one intentionally specified by the user).
- Reconcile the non-authoritative file to match, preserving platform-specific frontmatter fields.
Phase 4 - Validation
- Confirm all written files parse as valid Markdown with correct YAML frontmatter.
- Verify frontmatter contains at minimum a
descriptionfield. - Verify frontmatter contains scope fields (
globsfor Claude,applyTofor Copilot). - Report any drift found (for example, rule exists but no matching instruction, or vice versa).
Quality Gate
- No rule or instruction is written without frontmatter and a
descriptionfield. - Soft delete is always the default for
deleteoperations. - Both platform files must be written or updated together unless scope is explicitly restricted.
- Never read or modify
.envor sensitive configuration files.
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.